@nuxt/devtools 3.3.1 → 3.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/module-main.mjs +47 -10
- package/dist/client/200.html +1 -1
- package/dist/client/404.html +1 -1
- package/dist/client/_nuxt/__blank-o2muls23.js +1 -0
- package/dist/client/_nuxt/{analyze-build-ndbr1zwt.js → analyze-build-kjyk398o.js} +1 -1
- package/dist/client/_nuxt/assets-ecwtrmuk.js +6 -0
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/04180599-af74-454c-91e0-3d5527eae2fc.json +1 -0
- package/dist/client/_nuxt/{client-d56h4dc4.js → client-eh4ejzq8.js} +1 -1
- package/dist/client/_nuxt/{code-diff-gh0ro4cb.js → code-diff-el8puwy4.js} +1 -1
- package/dist/client/_nuxt/{code-snippets-m9271riq.js → code-snippets-i5i2u9zz.js} +1 -1
- package/dist/client/_nuxt/{components-iry12ufh.js → components-iwfpkbz3.js} +1 -1
- package/dist/client/_nuxt/{composable-item-m3m39yy8.js → composable-item-e8kv7080.js} +1 -1
- package/dist/client/_nuxt/custom-_name_-ft6dg0e3.js +1 -0
- package/dist/client/_nuxt/{data-schema-button-hha0wi47.js → data-schema-button-hx1dia1u.js} +1 -1
- package/dist/client/_nuxt/{data-schema-drawer-mvrnpqdm.js → data-schema-drawer-iw791a0n.js} +1 -1
- package/dist/client/_nuxt/{debug-emfpm2zp.js → debug-f1y4ok7e.js} +1 -1
- package/dist/client/_nuxt/{default-dv40aud6.js → default-i5dr248x.js} +1 -1
- package/dist/client/_nuxt/{duration-display-g4enq0h7.js → duration-display-ce789vbq.js} +1 -1
- package/dist/client/_nuxt/{error-404-jybbe03f.js → error-404-hwu9ougr.js} +1 -1
- package/dist/client/_nuxt/error-404.css-cwq14vxz.css +1 -0
- package/dist/client/_nuxt/{error-500-onq7ss3q.js → error-500-gbqjpcce.js} +1 -1
- package/dist/client/_nuxt/error-500.css-hftlqubg.css +1 -0
- package/dist/client/_nuxt/{error-nnemr5rw.js → error-g08v33x2.js} +1 -1
- package/dist/client/_nuxt/{filepath-item-hz9dqk37.js → filepath-item-cfknf7u4.js} +1 -1
- package/dist/client/_nuxt/full-fv9atfrx.js +1 -0
- package/dist/client/_nuxt/{help-fab-oij4kl08.js → help-fab-kzusjvzh.js} +1 -1
- package/dist/client/_nuxt/{hooks-mm4wkhji.js → hooks-m7w83qkt.js} +1 -1
- package/dist/client/_nuxt/{imports-ih50w3iv.js → imports-m5e06d1m.js} +1 -1
- package/dist/client/_nuxt/{launch-page-bpr4mhu5.js → launch-page-k1jy2olz.js} +1 -1
- package/dist/client/_nuxt/{modules-hshgq2d9.js → modules-ocni0pmc.js} +1 -1
- package/dist/client/_nuxt/nbadge-dq091bml.js +1 -0
- package/dist/client/_nuxt/{ncheckbox-mc98noss.js → ncheckbox-oaojay1f.js} +1 -1
- package/dist/client/_nuxt/{ncode-block-mvjvaye5.js → ncode-block-jmq04laj.js} +1 -1
- package/dist/client/_nuxt/{ndrawer-mfwl47cs.js → ndrawer-iq9tsfcb.js} +1 -1
- package/dist/client/_nuxt/{ndropdown-l4kx50eu.js → ndropdown-bzq1eo9l.js} +1 -1
- package/dist/client/_nuxt/{nicon-title-dciaco6o.js → nicon-title-kclz18f2.js} +1 -1
- package/dist/client/_nuxt/{nlink-n14t4xmt.js → nlink-oovljifl.js} +1 -1
- package/dist/client/_nuxt/{nmarkdown-fnnmuq60.js → nmarkdown-mnforar7.js} +1 -1
- package/dist/client/_nuxt/{nnavbar-bwuaevkz.js → nnavbar-dy6zssbb.js} +1 -1
- package/dist/client/_nuxt/none-hmdczuga.js +1 -0
- package/dist/client/_nuxt/{nsection-block-na7dtpi3.js → nsection-block-mm2ln8au.js} +1 -1
- package/dist/client/_nuxt/{nselect-o9ezbf9h.js → nselect-cvj6vn8t.js} +1 -1
- package/dist/client/_nuxt/{nselect-tabs-h2jrpp6v.js → nselect-tabs-bnxyj6c3.js} +1 -1
- package/dist/client/_nuxt/{nswitch-j5ndrsa4.js → nswitch-nii7reuz.js} +1 -1
- package/dist/client/_nuxt/{open-graph-i2tbvdoe.js → open-graph-e5ujlf0w.js} +1 -1
- package/dist/client/_nuxt/{overview-bbsxnnle.js → overview-k1lqhpdx.js} +1 -1
- package/dist/client/_nuxt/owz5kq17.js +4 -0
- package/dist/client/_nuxt/{pages-hi877nlf.js → pages-e8109ruk.js} +1 -1
- package/dist/client/_nuxt/{pages-j6q5h70o.js → pages-ja4oy9os.js} +1 -1
- package/dist/client/_nuxt/{payload-fhnthlp2.js → payload-evlvpptz.js} +1 -1
- package/dist/client/_nuxt/{pinia-h746a499.js → pinia-eb8q0lb7.js} +1 -1
- package/dist/client/_nuxt/{plugins-ozt4gxp5.js → plugins-n65vqkm5.js} +1 -1
- package/dist/client/_nuxt/{render-tree-ntf97xvm.js → render-tree-lcd73hdy.js} +1 -1
- package/dist/client/_nuxt/{runtime-configs-k0yp3zpx.js → runtime-configs-novpfnwf.js} +1 -1
- package/dist/client/_nuxt/{server-discovery-giorkvmy.js → server-discovery-e129227e.js} +1 -1
- package/dist/client/_nuxt/{server-route-inputs-jeqq7e8y.js → server-route-inputs-jyu03h3d.js} +1 -1
- package/dist/client/_nuxt/{server-routes-ebfdakke.js → server-routes-cuzpq3e6.js} +1 -1
- package/dist/client/_nuxt/{server-tasks-otdic2qc.js → server-tasks-k13zuqrk.js} +1 -1
- package/dist/client/_nuxt/{settings-cm4nn6s2.js → settings-e3yeoaaw.js} +1 -1
- package/dist/client/_nuxt/{stacktrace-list-outaanb2.js → stacktrace-list-n2oy2o29.js} +1 -1
- package/dist/client/_nuxt/{state-components-bi9epr0v.js → state-components-kbt6b53p.js} +1 -1
- package/dist/client/_nuxt/{state-editor-uoql44oq.js → state-editor-d3ywfwuf.js} +1 -1
- package/dist/client/_nuxt/{state-modules-cbgrygie.js → state-modules-g1xroclg.js} +1 -1
- package/dist/client/_nuxt/{storage-bs8swo7k.js → storage-bsevx2m8.js} +1 -1
- package/dist/client/_nuxt/{terminals-bk86ug8r.js → terminals-om2sdbvh.js} +1 -1
- package/dist/client/_nuxt/timeline-fl3dqhun.js +31 -0
- package/dist/client/_nuxt/{unocss-runtime-l6tkrfnt.js → unocss-runtime-hldtyz3c.js} +1 -1
- package/dist/client/_nuxt/vendor/{json-editor-vue-g94ysn44.js → json-editor-vue-k2rpz34q.js} +63 -63
- package/dist/client/_nuxt/vendor/{unocss-ix37k1vj.js → unocss-c4v2jnrn.js} +1 -1
- package/dist/client/_nuxt/{virtual-files-abzkda2j.js → virtual-files-irp1xg65.js} +1 -1
- package/dist/client/_nuxt/{vue-devtools-e7301kz1.js → vue-devtools-ixjb5uzw.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/module.json +1 -1
- package/package.json +5 -5
- package/dist/client/_nuxt/__blank-3fn4vtge.js +0 -1
- package/dist/client/_nuxt/assets-dqfzy0hw.js +0 -6
- package/dist/client/_nuxt/builds/meta/bfa29bcc-58d6-4376-85c9-764240642351.json +0 -1
- package/dist/client/_nuxt/custom-_name_-owx1vzws.js +0 -1
- package/dist/client/_nuxt/error-404.css-ip9v33hj.css +0 -1
- package/dist/client/_nuxt/error-500.css-hhe2fh34.css +0 -1
- package/dist/client/_nuxt/full-pn9pgtl7.js +0 -1
- package/dist/client/_nuxt/h38cvs9r.js +0 -4
- package/dist/client/_nuxt/nbadge-f7rzhjkq.js +0 -1
- package/dist/client/_nuxt/none-eri9psdj.js +0 -1
- package/dist/client/_nuxt/timeline-g2ip7lzl.js +0 -31
package/dist/client/_nuxt/vendor/{json-editor-vue-g94ysn44.js → json-editor-vue-k2rpz34q.js}
RENAMED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import{a as e,n as t,o as n,r,t as i}from"../rolldown-runtime-ga5ujxqr.js";function a(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}var o={},s=[],c=()=>{},l=()=>!1,u=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),d=e=>e.startsWith(`onUpdate:`),f=Object.assign,p=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},m=Object.prototype.hasOwnProperty,h=(e,t)=>m.call(e,t),g=Array.isArray,_=e=>ee(e)===`[object Map]`,v=e=>ee(e)===`[object Set]`,y=e=>ee(e)===`[object Date]`,b=e=>ee(e)===`[object RegExp]`,x=e=>typeof e==`function`,S=e=>typeof e==`string`,C=e=>typeof e==`symbol`,w=e=>typeof e==`object`&&!!e,T=e=>(w(e)||x(e))&&x(e.then)&&x(e.catch),E=Object.prototype.toString,ee=e=>E.call(e),te=e=>ee(e).slice(8,-1),D=e=>ee(e)===`[object Object]`,ne=e=>S(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,re=a(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),ie=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},ae=/-\w/g,oe=ie(e=>e.replace(ae,e=>e.slice(1).toUpperCase())),O=/\B([A-Z])/g,k=ie(e=>e.replace(O,`-$1`).toLowerCase()),se=ie(e=>e.charAt(0).toUpperCase()+e.slice(1)),ce=ie(e=>e?`on${se(e)}`:``),le=(e,t)=>!Object.is(e,t),ue=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},A=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},de=e=>{let t=parseFloat(e);return isNaN(t)?e:t},fe=e=>{let t=S(e)?Number(e):NaN;return isNaN(t)?e:t},pe,j=()=>pe||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{};function me(e){if(g(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],i=S(r)?ge(r):me(r);if(i)for(let e in i)t[e]=i[e]}return t}else if(S(e)||w(e))return e}var M=/;(?![^(]*\))/g,he=/:([^]+)/,N=/\/\*[^]*?\*\//g;function ge(e){let t={};return e.replace(N,``).split(M).forEach(e=>{if(e){let n=e.split(he);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function P(e){let t=``;if(S(e))t=e;else if(g(e))for(let n=0;n<e.length;n++){let r=P(e[n]);r&&(t+=r+` `)}else if(w(e))for(let n in e)e[n]&&(t+=n+` `);return t.trim()}function F(e){if(!e)return null;let{class:t,style:n}=e;return t&&!S(t)&&(e.class=P(t)),n&&(e.style=me(n)),e}var _e=`itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`,ve=a(_e);_e+``;function ye(e){return!!e||e===``}function be(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=xe(e[r],t[r]);return n}function xe(e,t){if(e===t)return!0;let n=y(e),r=y(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=C(e),r=C(t),n||r)return e===t;if(n=g(e),r=g(t),n||r)return n&&r?be(e,t):!1;if(n=w(e),r=w(t),n||r){if(!n||!r||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e){let r=e.hasOwnProperty(n),i=t.hasOwnProperty(n);if(r&&!i||!r&&i||!xe(e[n],t[n]))return!1}}return String(e)===String(t)}function Se(e,t){return e.findIndex(e=>xe(e,t))}var Ce=e=>!!(e&&e.__v_isRef===!0),we=e=>S(e)?e:e==null?``:g(e)||w(e)&&(e.toString===E||!x(e.toString))?Ce(e)?we(e.value):JSON.stringify(e,Te,2):String(e),Te=(e,t)=>Ce(t)?Te(e,t.value):_(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[Ee(t,r)+` =>`]=n,e),{})}:v(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>Ee(e))}:C(t)?Ee(t):w(t)&&!g(t)&&!D(t)?String(t):t,Ee=(e,t=``)=>C(e)?`Symbol(${e.description??t})`:e,De,Oe=class{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.__v_skip=!0,this.parent=De,!e&&De&&(this.index=(De.scopes||=[]).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].pause();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,t;if(this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].resume();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].resume()}}run(e){if(this._active){let t=De;try{return De=this,e()}finally{De=t}}}on(){++this._on===1&&(this.prevScope=De,De=this)}off(){if(this._on>0&&--this._on===0){if(De===this)De=this.prevScope;else{let e=De;for(;e;){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){this._active=!1;let t,n;for(t=0,n=this.effects.length;t<n;t++)this.effects[t].stop();for(this.effects.length=0,t=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){let e=this.parent.scopes.pop();e&&e!==this&&(this.parent.scopes[this.index]=e,e.index=this.index)}this.parent=void 0}}};function ke(e){return new Oe(e)}function Ae(){return De}function je(e,t=!1){De&&De.cleanups.push(e)}var Me,Ne=new WeakSet,I=class{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,De&&De.active&&De.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Ne.has(this)&&(Ne.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Le(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Xe(this),Be(this);let e=Me,t=Ke;Me=this,Ke=!0;try{return this.fn()}finally{Ve(this),Me=e,Ke=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)We(e);this.deps=this.depsTail=void 0,Xe(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Ne.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){He(this)&&this.run()}get dirty(){return He(this)}},Pe=0,Fe,Ie;function Le(e,t=!1){if(e.flags|=8,t){e.next=Ie,Ie=e;return}e.next=Fe,Fe=e}function Re(){Pe++}function ze(){if(--Pe>0)return;if(Ie){let e=Ie;for(Ie=void 0;e;){let t=e.next;e.next=void 0,e.flags&=-9,e=t}}let e;for(;Fe;){let t=Fe;for(Fe=void 0;t;){let n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(t){e||=t}t=n}}if(e)throw e}function Be(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Ve(e){let t,n=e.depsTail,r=n;for(;r;){let e=r.prevDep;r.version===-1?(r===n&&(n=e),We(r),Ge(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=e}e.deps=t,e.depsTail=n}function He(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Ue(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Ue(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Ze)||(e.globalVersion=Ze,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!He(e))))return;e.flags|=2;let t=e.dep,n=Me,r=Ke;Me=e,Ke=!0;try{Be(e);let n=e.fn(e._value);(t.version===0||le(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(e){throw t.version++,e}finally{Me=n,Ke=r,Ve(e),e.flags&=-3}}function We(e,t=!1){let{dep:n,prevSub:r,nextSub:i}=e;if(r&&(r.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)We(e,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Ge(e){let{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}var Ke=!0,qe=[];function Je(){qe.push(Ke),Ke=!1}function Ye(){let e=qe.pop();Ke=e===void 0?!0:e}function Xe(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let e=Me;Me=void 0;try{t()}finally{Me=e}}}var Ze=0,Qe=class{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}},$e=class{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!Me||!Ke||Me===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==Me)t=this.activeLink=new Qe(Me,this),Me.deps?(t.prevDep=Me.depsTail,Me.depsTail.nextDep=t,Me.depsTail=t):Me.deps=Me.depsTail=t,et(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){let e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=Me.depsTail,t.nextDep=void 0,Me.depsTail.nextDep=t,Me.depsTail=t,Me.deps===t&&(Me.deps=e)}return t}trigger(e){this.version++,Ze++,this.notify(e)}notify(e){Re();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{ze()}}};function et(e){if(e.dep.sc++,e.sub.flags&4){let t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let e=t.deps;e;e=e.nextDep)et(e)}let n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}var tt=new WeakMap,nt=Symbol(``),rt=Symbol(``),it=Symbol(``);function at(e,t,n){if(Ke&&Me){let t=tt.get(e);t||tt.set(e,t=new Map);let r=t.get(n);r||(t.set(n,r=new $e),r.map=t,r.key=n),r.track()}}function ot(e,t,n,r,i,a){let o=tt.get(e);if(!o){Ze++;return}let s=e=>{e&&e.trigger()};if(Re(),t===`clear`)o.forEach(s);else{let i=g(e),a=i&&ne(n);if(i&&n===`length`){let e=Number(r);o.forEach((t,n)=>{(n===`length`||n===it||!C(n)&&n>=e)&&s(t)})}else switch((n!==void 0||o.has(void 0))&&s(o.get(n)),a&&s(o.get(it)),t){case`add`:i?a&&s(o.get(`length`)):(s(o.get(nt)),_(e)&&s(o.get(rt)));break;case`delete`:i||(s(o.get(nt)),_(e)&&s(o.get(rt)));break;case`set`:_(e)&&s(o.get(nt));break}}ze()}function st(e,t){let n=tt.get(e);return n&&n.get(t)}function ct(e){let t=$t(e);return t===e?t:(at(t,`iterate`,it),Zt(e)?t:t.map(tn))}function lt(e){return at(e=$t(e),`iterate`,it),e}function ut(e,t){return Xt(e)?nn(Yt(e)?tn(t):t):tn(t)}var dt={__proto__:null,[Symbol.iterator](){return ft(this,Symbol.iterator,e=>ut(this,e))},concat(...e){return ct(this).concat(...e.map(e=>g(e)?ct(e):e))},entries(){return ft(this,`entries`,e=>(e[1]=ut(this,e[1]),e))},every(e,t){return mt(this,`every`,e,t,void 0,arguments)},filter(e,t){return mt(this,`filter`,e,t,e=>e.map(e=>ut(this,e)),arguments)},find(e,t){return mt(this,`find`,e,t,e=>ut(this,e),arguments)},findIndex(e,t){return mt(this,`findIndex`,e,t,void 0,arguments)},findLast(e,t){return mt(this,`findLast`,e,t,e=>ut(this,e),arguments)},findLastIndex(e,t){return mt(this,`findLastIndex`,e,t,void 0,arguments)},forEach(e,t){return mt(this,`forEach`,e,t,void 0,arguments)},includes(...e){return gt(this,`includes`,e)},indexOf(...e){return gt(this,`indexOf`,e)},join(e){return ct(this).join(e)},lastIndexOf(...e){return gt(this,`lastIndexOf`,e)},map(e,t){return mt(this,`map`,e,t,void 0,arguments)},pop(){return _t(this,`pop`)},push(...e){return _t(this,`push`,e)},reduce(e,...t){return ht(this,`reduce`,e,t)},reduceRight(e,...t){return ht(this,`reduceRight`,e,t)},shift(){return _t(this,`shift`)},some(e,t){return mt(this,`some`,e,t,void 0,arguments)},splice(...e){return _t(this,`splice`,e)},toReversed(){return ct(this).toReversed()},toSorted(e){return ct(this).toSorted(e)},toSpliced(...e){return ct(this).toSpliced(...e)},unshift(...e){return _t(this,`unshift`,e)},values(){return ft(this,`values`,e=>ut(this,e))}};function ft(e,t,n){let r=lt(e),i=r[t]();return r!==e&&!Zt(e)&&(i._next=i.next,i.next=()=>{let e=i._next();return e.done||(e.value=n(e.value)),e}),i}var pt=Array.prototype;function mt(e,t,n,r,i,a){let o=lt(e),s=o!==e&&!Zt(e),c=o[t];if(c!==pt[t]){let t=c.apply(e,a);return s?tn(t):t}let l=n;o!==e&&(s?l=function(t,r){return n.call(this,ut(e,t),r,e)}:n.length>2&&(l=function(t,r){return n.call(this,t,r,e)}));let u=c.call(o,l,r);return s&&i?i(u):u}function ht(e,t,n,r){let i=lt(e),a=i!==e&&!Zt(e),o=n,s=!1;i!==e&&(a?(s=r.length===0,o=function(t,r,i){return s&&(s=!1,t=ut(e,t)),n.call(this,t,ut(e,r),i,e)}):n.length>3&&(o=function(t,r,i){return n.call(this,t,r,i,e)}));let c=i[t](o,...r);return s?ut(e,c):c}function gt(e,t,n){let r=$t(e);at(r,`iterate`,it);let i=r[t](...n);return(i===-1||i===!1)&&Qt(n[0])?(n[0]=$t(n[0]),r[t](...n)):i}function _t(e,t,n=[]){Je(),Re();let r=$t(e)[t].apply(e,n);return ze(),Ye(),r}var vt=a(`__proto__,__v_isRef,__isVue`),yt=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!==`arguments`&&e!==`caller`).map(e=>Symbol[e]).filter(C));function bt(e){C(e)||(e=String(e));let t=$t(this);return at(t,`has`,e),t.hasOwnProperty(e)}var xt=class{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if(t===`__v_skip`)return e.__v_skip;let r=this._isReadonly,i=this._isShallow;if(t===`__v_isReactive`)return!r;if(t===`__v_isReadonly`)return r;if(t===`__v_isShallow`)return i;if(t===`__v_raw`)return n===(r?i?Vt:Bt:i?zt:Rt).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;let a=g(e);if(!r){let e;if(a&&(e=dt[t]))return e;if(t===`hasOwnProperty`)return bt}let o=Reflect.get(e,t,rn(e)?e:n);if((C(t)?yt.has(t):vt(t))||(r||at(e,`get`,t),i))return o;if(rn(o)){let e=a&&ne(t)?o:o.value;return r&&w(e)?Kt(e):e}return w(o)?r?Kt(o):Wt(o):o}},St=class extends xt{constructor(e=!1){super(!1,e)}set(e,t,n,r){let i=e[t],a=g(e)&&ne(t);if(!this._isShallow){let e=Xt(i);if(!Zt(n)&&!Xt(n)&&(i=$t(i),n=$t(n)),!a&&rn(i)&&!rn(n))return e||(i.value=n),!0}let o=a?Number(t)<e.length:h(e,t),s=Reflect.set(e,t,n,rn(e)?e:r);return e===$t(r)&&(o?le(n,i)&&ot(e,`set`,t,n,i):ot(e,`add`,t,n)),s}deleteProperty(e,t){let n=h(e,t),r=e[t],i=Reflect.deleteProperty(e,t);return i&&n&&ot(e,`delete`,t,void 0,r),i}has(e,t){let n=Reflect.has(e,t);return(!C(t)||!yt.has(t))&&at(e,`has`,t),n}ownKeys(e){return at(e,`iterate`,g(e)?`length`:nt),Reflect.ownKeys(e)}},Ct=class extends xt{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}},wt=new St,Tt=new Ct,Et=new St(!0),Dt=new Ct(!0),Ot=e=>e,kt=e=>Reflect.getPrototypeOf(e);function At(e,t,n){return function(...r){let i=this.__v_raw,a=$t(i),o=_(a),s=e===`entries`||e===Symbol.iterator&&o,c=e===`keys`&&o,l=i[e](...r),u=n?Ot:t?nn:tn;return!t&&at(a,`iterate`,c?rt:nt),f(Object.create(l),{next(){let{value:e,done:t}=l.next();return t?{value:e,done:t}:{value:s?[u(e[0]),u(e[1])]:u(e),done:t}}})}}function jt(e){return function(...t){return e===`delete`?!1:e===`clear`?void 0:this}}function Mt(e,t){let n={get(n){let r=this.__v_raw,i=$t(r),a=$t(n);e||(le(n,a)&&at(i,`get`,n),at(i,`get`,a));let{has:o}=kt(i),s=t?Ot:e?nn:tn;if(o.call(i,n))return s(r.get(n));if(o.call(i,a))return s(r.get(a));r!==i&&r.get(n)},get size(){let t=this.__v_raw;return!e&&at($t(t),`iterate`,nt),t.size},has(t){let n=this.__v_raw,r=$t(n),i=$t(t);return e||(le(t,i)&&at(r,`has`,t),at(r,`has`,i)),t===i?n.has(t):n.has(t)||n.has(i)},forEach(n,r){let i=this,a=i.__v_raw,o=$t(a),s=t?Ot:e?nn:tn;return!e&&at(o,`iterate`,nt),a.forEach((e,t)=>n.call(r,s(e),s(t),i))}};return f(n,e?{add:jt(`add`),set:jt(`set`),delete:jt(`delete`),clear:jt(`clear`)}:{add(e){let n=$t(this),r=kt(n),i=$t(e),a=!t&&!Zt(e)&&!Xt(e)?i:e;return r.has.call(n,a)||le(e,a)&&r.has.call(n,e)||le(i,a)&&r.has.call(n,i)||(n.add(a),ot(n,`add`,a,a)),this},set(e,n){!t&&!Zt(n)&&!Xt(n)&&(n=$t(n));let r=$t(this),{has:i,get:a}=kt(r),o=i.call(r,e);o||=(e=$t(e),i.call(r,e));let s=a.call(r,e);return r.set(e,n),o?le(n,s)&&ot(r,`set`,e,n,s):ot(r,`add`,e,n),this},delete(e){let t=$t(this),{has:n,get:r}=kt(t),i=n.call(t,e);i||=(e=$t(e),n.call(t,e));let a=r?r.call(t,e):void 0,o=t.delete(e);return i&&ot(t,`delete`,e,void 0,a),o},clear(){let e=$t(this),t=e.size!==0,n=e.clear();return t&&ot(e,`clear`,void 0,void 0,void 0),n}}),[`keys`,`values`,`entries`,Symbol.iterator].forEach(r=>{n[r]=At(r,e,t)}),n}function Nt(e,t){let n=Mt(e,t);return(t,r,i)=>r===`__v_isReactive`?!e:r===`__v_isReadonly`?e:r===`__v_raw`?t:Reflect.get(h(n,r)&&r in t?n:t,r,i)}var Pt={get:Nt(!1,!1)},Ft={get:Nt(!1,!0)},It={get:Nt(!0,!1)},Lt={get:Nt(!0,!0)},Rt=new WeakMap,zt=new WeakMap,Bt=new WeakMap,Vt=new WeakMap;function Ht(e){switch(e){case`Object`:case`Array`:return 1;case`Map`:case`Set`:case`WeakMap`:case`WeakSet`:return 2;default:return 0}}function Ut(e){return e.__v_skip||!Object.isExtensible(e)?0:Ht(te(e))}function Wt(e){return Xt(e)?e:Jt(e,!1,wt,Pt,Rt)}function Gt(e){return Jt(e,!1,Et,Ft,zt)}function Kt(e){return Jt(e,!0,Tt,It,Bt)}function qt(e){return Jt(e,!0,Dt,Lt,Vt)}function Jt(e,t,n,r,i){if(!w(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;let a=Ut(e);if(a===0)return e;let o=i.get(e);if(o)return o;let s=new Proxy(e,a===2?r:n);return i.set(e,s),s}function Yt(e){return Xt(e)?Yt(e.__v_raw):!!(e&&e.__v_isReactive)}function Xt(e){return!!(e&&e.__v_isReadonly)}function Zt(e){return!!(e&&e.__v_isShallow)}function Qt(e){return e?!!e.__v_raw:!1}function $t(e){let t=e&&e.__v_raw;return t?$t(t):e}function en(e){return!h(e,`__v_skip`)&&Object.isExtensible(e)&&A(e,`__v_skip`,!0),e}var tn=e=>w(e)?Wt(e):e,nn=e=>w(e)?Kt(e):e;function rn(e){return e?e.__v_isRef===!0:!1}function an(e){return sn(e,!1)}function on(e){return sn(e,!0)}function sn(e,t){return rn(e)?e:new cn(e,t)}var cn=class{constructor(e,t){this.dep=new $e,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:$t(e),this._value=t?e:tn(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){let t=this._rawValue,n=this.__v_isShallow||Zt(e)||Xt(e);e=n?e:$t(e),le(e,t)&&(this._rawValue=e,this._value=n?e:tn(e),this.dep.trigger())}};function ln(e){e.dep&&e.dep.trigger()}function un(e){return rn(e)?e.value:e}function dn(e){return x(e)?e():un(e)}var fn={get:(e,t,n)=>t===`__v_raw`?e:un(Reflect.get(e,t,n)),set:(e,t,n,r)=>{let i=e[t];return rn(i)&&!rn(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function pn(e){return Yt(e)?e:new Proxy(e,fn)}var mn=class{constructor(e){this.__v_isRef=!0,this._value=void 0;let t=this.dep=new $e,{get:n,set:r}=e(t.track.bind(t),t.trigger.bind(t));this._get=n,this._set=r}get value(){return this._value=this._get()}set value(e){this._set(e)}};function hn(e){return new mn(e)}function gn(e){let t=g(e)?Array(e.length):{};for(let n in e)t[n]=bn(e,n);return t}var _n=class{constructor(e,t,n){this._object=e,this._defaultValue=n,this.__v_isRef=!0,this._value=void 0,this._key=C(t)?t:String(t),this._raw=$t(e);let r=!0,i=e;if(!g(e)||C(this._key)||!ne(this._key))do r=!Qt(i)||Zt(i);while(r&&(i=i.__v_raw));this._shallow=r}get value(){let e=this._object[this._key];return this._shallow&&(e=un(e)),this._value=e===void 0?this._defaultValue:e}set value(e){if(this._shallow&&rn(this._raw[this._key])){let t=this._object[this._key];if(rn(t)){t.value=e;return}}this._object[this._key]=e}get dep(){return st(this._raw,this._key)}},vn=class{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}};function yn(e,t,n){return rn(e)?e:x(e)?new vn(e):w(e)&&arguments.length>1?bn(e,t,n):an(e)}function bn(e,t,n){return new _n(e,t,n)}var xn=class{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new $e(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Ze-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&Me!==this)return Le(this,!0),!0}get value(){let e=this.dep.track();return Ue(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}};function Sn(e,t,n=!1){let r,i;return x(e)?r=e:(r=e.get,i=e.set),new xn(r,i,n)}var Cn={},wn=new WeakMap,Tn=void 0;function En(e,t=!1,n=Tn){if(n){let t=wn.get(n);t||wn.set(n,t=[]),t.push(e)}}function Dn(e,t,n=o){let{immediate:r,deep:i,once:a,scheduler:s,augmentJob:l,call:u}=n,d=e=>i?e:Zt(e)||i===!1||i===0?On(e,1):On(e),f,m,h,_,v=!1,y=!1;if(rn(e)?(m=()=>e.value,v=Zt(e)):Yt(e)?(m=()=>d(e),v=!0):g(e)?(y=!0,v=e.some(e=>Yt(e)||Zt(e)),m=()=>e.map(e=>{if(rn(e))return e.value;if(Yt(e))return d(e);if(x(e))return u?u(e,2):e()})):m=x(e)?t?u?()=>u(e,2):e:()=>{if(h){Je();try{h()}finally{Ye()}}let t=Tn;Tn=f;try{return u?u(e,3,[_]):e(_)}finally{Tn=t}}:c,t&&i){let e=m,t=i===!0?1/0:i;m=()=>On(e(),t)}let b=Ae(),S=()=>{f.stop(),b&&b.active&&p(b.effects,f)};if(a&&t){let e=t;t=(...t)=>{e(...t),S()}}let C=y?Array(e.length).fill(Cn):Cn,w=e=>{if(!(!(f.flags&1)||!f.dirty&&!e))if(t){let e=f.run();if(i||v||(y?e.some((e,t)=>le(e,C[t])):le(e,C))){h&&h();let n=Tn;Tn=f;try{let n=[e,C===Cn?void 0:y&&C[0]===Cn?[]:C,_];C=e,u?u(t,3,n):t(...n)}finally{Tn=n}}}else f.run()};return l&&l(w),f=new I(m),f.scheduler=s?()=>s(w,!1):w,_=e=>En(e,!1,f),h=f.onStop=()=>{let e=wn.get(f);if(e){if(u)u(e,4);else for(let t of e)t();wn.delete(f)}},t?r?w(!0):C=f.run():s?s(w.bind(null,!0),!0):f.run(),S.pause=f.pause.bind(f),S.resume=f.resume.bind(f),S.stop=S,S}function On(e,t=1/0,n){if(t<=0||!w(e)||e.__v_skip||(n||=new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,rn(e))On(e.value,t,n);else if(g(e))for(let r=0;r<e.length;r++)On(e[r],t,n);else if(v(e)||_(e))e.forEach(e=>{On(e,t,n)});else if(D(e)){for(let r in e)On(e[r],t,n);for(let r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&On(e[r],t,n)}return e}function kn(e,t,n,r){try{return r?e(...r):e()}catch(e){jn(e,t,n)}}function An(e,t,n,r){if(x(e)){let i=kn(e,t,n,r);return i&&T(i)&&i.catch(e=>{jn(e,t,n)}),i}if(g(e)){let i=[];for(let a=0;a<e.length;a++)i.push(An(e[a],t,n,r));return i}}function jn(e,t,n,r=!0){let i=t?t.vnode:null,{errorHandler:a,throwUnhandledErrorInProduction:s}=t&&t.appContext.config||o;if(t){let r=t.parent,i=t.proxy,o=`https://vuejs.org/error-reference/#runtime-${n}`;for(;r;){let t=r.ec;if(t){for(let n=0;n<t.length;n++)if(t[n](e,i,o)===!1)return}r=r.parent}if(a){Je(),kn(a,null,10,[e,i,o]),Ye();return}}Mn(e,n,i,r,s)}function Mn(e,t,n,r=!0,i=!1){if(i)throw e;console.error(e)}var Nn=[],Pn=-1,Fn=[],In=null,Ln=0,Rn=Promise.resolve(),zn=null;function Bn(e){let t=zn||Rn;return e?t.then(this?e.bind(this):e):t}function Vn(e){let t=Pn+1,n=Nn.length;for(;t<n;){let r=t+n>>>1,i=Nn[r],a=qn(i);a<e||a===e&&i.flags&2?t=r+1:n=r}return t}function Hn(e){if(!(e.flags&1)){let t=qn(e),n=Nn[Nn.length-1];!n||!(e.flags&2)&&t>=qn(n)?Nn.push(e):Nn.splice(Vn(t),0,e),e.flags|=1,Un()}}function Un(){zn||=Rn.then(Jn)}function Wn(e){g(e)?Fn.push(...e):In&&e.id===-1?In.splice(Ln+1,0,e):e.flags&1||(Fn.push(e),e.flags|=1),Un()}function Gn(e,t,n=Pn+1){for(;n<Nn.length;n++){let t=Nn[n];if(t&&t.flags&2){if(e&&t.id!==e.uid)continue;Nn.splice(n,1),n--,t.flags&4&&(t.flags&=-2),t(),t.flags&4||(t.flags&=-2)}}}function Kn(e){if(Fn.length){let e=[...new Set(Fn)].sort((e,t)=>qn(e)-qn(t));if(Fn.length=0,In){In.push(...e);return}for(In=e,Ln=0;Ln<In.length;Ln++){let e=In[Ln];e.flags&4&&(e.flags&=-2),e.flags&8||e(),e.flags&=-2}In=null,Ln=0}}var qn=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Jn(e){try{for(Pn=0;Pn<Nn.length;Pn++){let e=Nn[Pn];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),kn(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;Pn<Nn.length;Pn++){let e=Nn[Pn];e&&(e.flags&=-2)}Pn=-1,Nn.length=0,Kn(e),zn=null,(Nn.length||Fn.length)&&Jn(e)}}var Yn=null,Xn=null;function Zn(e){let t=Yn;return Yn=e,Xn=e&&e.type.__scopeId||null,t}function Qn(e){Xn=e}function $n(){Xn=null}var er=e=>tr;function tr(e,t=Yn,n){if(!t||e._n)return e;let r=(...n)=>{r._d&&Mo(-1);let i=Zn(t),a;try{a=e(...n)}finally{Zn(i),r._d&&Mo(1)}return a};return r._n=!0,r._c=!0,r._d=!0,r}function nr(e,t){if(Yn===null)return e;let n=vs(Yn),r=e.dirs||=[];for(let e=0;e<t.length;e++){let[i,a,s,c=o]=t[e];i&&(x(i)&&(i={mounted:i,updated:i}),i.deep&&On(a),r.push({dir:i,instance:n,value:a,oldValue:void 0,arg:s,modifiers:c}))}return e}function rr(e,t,n,r){let i=e.dirs,a=t&&t.dirs;for(let o=0;o<i.length;o++){let s=i[o];a&&(s.oldValue=a[o].value);let c=s.dir[r];c&&(Je(),An(c,n,8,[e.el,s,e,t]),Ye())}}function ir(e,t){if(ns){let n=ns.provides,r=ns.parent&&ns.parent.provides;r===n&&(n=ns.provides=Object.create(r)),n[e]=t}}function ar(e,t,n=!1){let r=rs();if(r||va){let i=va?va._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(i&&e in i)return i[e];if(arguments.length>1)return n&&x(t)?t.call(r&&r.proxy):t}}function or(){return!!(rs()||va)}var sr=Symbol.for(`v-scx`),cr=()=>ar(sr);function lr(e,t){return fr(e,null,t)}function ur(e,t){return fr(e,null,{flush:`sync`})}function dr(e,t,n){return fr(e,t,n)}function fr(e,t,n=o){let{immediate:r,deep:i,flush:a,once:s}=n,l=f({},n),u=t&&r||!t&&a!==`post`,d;if(ls){if(a===`sync`){let e=cr();d=e.__watcherHandles||=[]}else if(!u){let e=()=>{};return e.stop=c,e.resume=c,e.pause=c,e}}let p=ns;l.call=(e,t,n)=>An(e,p,t,n);let m=!1;a===`post`?l.scheduler=e=>{Za(e,p&&p.suspense)}:a!==`sync`&&(m=!0,l.scheduler=(e,t)=>{t?e():Hn(e)}),l.augmentJob=e=>{t&&(e.flags|=4),m&&(e.flags|=2,p&&(e.id=p.uid,e.i=p))};let h=Dn(e,t,l);return ls&&(d?d.push(h):u&&h()),h}function pr(e,t,n){let r=this.proxy,i=S(e)?e.includes(`.`)?mr(r,e):()=>r[e]:e.bind(r,r),a;x(t)?a=t:(a=t.handler,n=t);let o=os(this),s=fr(i,a.bind(r),n);return o(),s}function mr(e,t){let n=t.split(`.`);return()=>{let t=e;for(let e=0;e<n.length&&t;e++)t=t[n[e]];return t}}var hr=new WeakMap,gr=Symbol(`_vte`),_r=e=>e.__isTeleport,vr=e=>e&&(e.disabled||e.disabled===``),yr=e=>e&&(e.defer||e.defer===``),br=e=>typeof SVGElement<`u`&&e instanceof SVGElement,xr=e=>typeof MathMLElement==`function`&&e instanceof MathMLElement,Sr=(e,t)=>{let n=e&&e.to;return S(n)?t?t(n):null:n},eee={name:`Teleport`,__isTeleport:!0,process(e,t,n,r,i,a,o,s,c,l){let{mc:u,pc:d,pbc:f,o:{insert:p,querySelector:m,createText:h,createComment:g,parentNode:_}}=l,v=vr(t.props),{dynamicChildren:y}=t,b=(e,t,n)=>{e.shapeFlag&16&&u(e.children,t,n,i,a,o,s,c)},x=(e=t)=>{let n=vr(e.props),r=e.target=Sr(e.props,m),a=Dr(r,e,h,p);r&&(o!==`svg`&&br(r)?o=`svg`:o!==`mathml`&&xr(r)&&(o=`mathml`),i&&i.isCE&&(i.ce._teleportTargets||(i.ce._teleportTargets=new Set)).add(r),n||(b(e,r,a),Er(e,!1)))},S=e=>{let t=()=>{hr.get(e)===t&&(hr.delete(e),vr(e.props)&&(b(e,_(e.el)||n,e.anchor),Er(e,!0)),x(e))};hr.set(e,t),Za(t,a)};if(e==null){let e=t.el=h(``),i=t.anchor=h(``);if(p(e,n,r),p(i,n,r),yr(t.props)||a&&a.pendingBranch){S(t);return}v&&(b(t,n,i),Er(t,!0)),x()}else{t.el=e.el;let r=t.anchor=e.anchor,u=hr.get(e);if(u){u.flags|=8,hr.delete(e),S(t);return}t.targetStart=e.targetStart;let p=t.target=e.target,h=t.targetAnchor=e.targetAnchor,g=vr(e.props),_=g?n:p,b=g?r:h;if(o===`svg`||br(p)?o=`svg`:(o===`mathml`||xr(p))&&(o=`mathml`),y?(f(e.dynamicChildren,y,_,i,a,o,s),io(e,t,!0)):c||d(e,t,_,b,i,a,o,s,!1),v)g?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Cr(t,n,r,l,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){let e=t.target=Sr(t.props,m);e&&Cr(t,e,null,l,0)}else g&&Cr(t,p,h,l,1);Er(t,v)}},remove(e,t,n,{um:r,o:{remove:i}},a){let{shapeFlag:o,children:s,anchor:c,targetStart:l,targetAnchor:u,target:d,props:f}=e,p=a||!vr(f),m=hr.get(e);if(m&&(m.flags|=8,hr.delete(e),p=!1),d&&(i(l),i(u)),a&&i(c),o&16)for(let e=0;e<s.length;e++){let i=s[e];r(i,t,n,p,!!i.dynamicChildren)}},move:Cr,hydrate:wr};function Cr(e,t,n,{o:{insert:r},m:i},a=2){a===0&&r(e.targetAnchor,t,n);let{el:o,anchor:s,shapeFlag:c,children:l,props:u}=e,d=a===2;if(d&&r(o,t,n),!hr.has(e)&&(!d||vr(u))&&c&16)for(let e=0;e<l.length;e++)i(l[e],t,n,2);d&&r(s,t,n)}function wr(e,t,n,r,i,a,{o:{nextSibling:o,parentNode:s,querySelector:c,insert:l,createText:u}},d){function f(e,n){let r=n;for(;r;){if(r&&r.nodeType===8){if(r.data===`teleport start anchor`)t.targetStart=r;else if(r.data===`teleport anchor`){t.targetAnchor=r,e._lpa=t.targetAnchor&&o(t.targetAnchor);break}}r=o(r)}}function p(e,t){t.anchor=d(o(e),t,s(e),n,r,i,a)}let m=t.target=Sr(t.props,c),h=vr(t.props);if(m){let c=m._lpa||m.firstChild;t.shapeFlag&16&&(h?(p(e,t),f(m,c),t.targetAnchor||Dr(m,t,u,l,s(e)===m?e:null)):(t.anchor=o(e),f(m,c),t.targetAnchor||Dr(m,t,u,l),d(c&&o(c),t,m,n,r,i,a))),Er(t,h)}else h&&t.shapeFlag&16&&(p(e,t),t.targetStart=e,t.targetAnchor=o(e));return t.anchor&&o(t.anchor)}var Tr=eee;function Er(e,t){let n=e.ctx;if(n&&n.ut){let r,i;for(t?(r=e.el,i=e.anchor):(r=e.targetStart,i=e.targetAnchor);r&&r!==i;)r.nodeType===1&&r.setAttribute(`data-v-owner`,n.uid),r=r.nextSibling;n.ut()}}function Dr(e,t,n,r,i=null){let a=t.targetStart=n(``),o=t.targetAnchor=n(``);return a[gr]=o,e&&(r(a,e,i),r(o,e,i)),o}var Or=Symbol(`_leaveCb`),kr=Symbol(`_enterCb`);function Ar(){let e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Si(()=>{e.isMounted=!0}),Ti(()=>{e.isUnmounting=!0}),e}var jr=[Function,Array],Mr={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:jr,onEnter:jr,onAfterEnter:jr,onEnterCancelled:jr,onBeforeLeave:jr,onLeave:jr,onAfterLeave:jr,onLeaveCancelled:jr,onBeforeAppear:jr,onAppear:jr,onAfterAppear:jr,onAppearCancelled:jr},Nr=e=>{let t=e.subTree;return t.component?Nr(t.component):t},Pr={name:`BaseTransition`,props:Mr,setup(e,{slots:t}){let n=rs(),r=Ar();return()=>{let i=t.default&&Hr(t.default(),!0),a=i&&i.length?Fr(i):n.subTree?qo():void 0;if(!a)return;let o=$t(e),{mode:s}=o;if(r.isLeaving)return zr(a);let c=Br(a);if(!c)return zr(a);let l=Rr(c,o,r,n,e=>l=e);c.type!==To&&Vr(c,l);let u=n.subTree&&Br(n.subTree);if(u&&u.type!==To&&!Lo(u,c)&&Nr(n).type!==To){let e=Rr(u,o,r,n);if(Vr(u,e),s===`out-in`&&c.type!==To)return r.isLeaving=!0,e.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete e.afterLeave,u=void 0},zr(a);s===`in-out`&&c.type!==To?e.delayLeave=(e,t,n)=>{let i=Lr(r,u);i[String(u.key)]=u,e[Or]=()=>{t(),e[Or]=void 0,delete l.delayedLeave,u=void 0},l.delayedLeave=()=>{n(),delete l.delayedLeave,u=void 0}}:u=void 0}else u&&=void 0;return a}}};function Fr(e){let t=e[0];if(e.length>1){for(let n of e)if(n.type!==To){t=n;break}}return t}var Ir=Pr;function Lr(e,t){let{leavingVNodes:n}=e,r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}function Rr(e,t,n,r,i){let{appear:a,mode:o,persisted:s=!1,onBeforeEnter:c,onEnter:l,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:f,onLeave:p,onAfterLeave:m,onLeaveCancelled:h,onBeforeAppear:_,onAppear:v,onAfterAppear:y,onAppearCancelled:b}=t,x=String(e.key),S=Lr(n,e),C=(e,t)=>{e&&An(e,r,9,t)},w=(e,t)=>{let n=t[1];C(e,t),g(e)?e.every(e=>e.length<=1)&&n():e.length<=1&&n()},T={mode:o,persisted:s,beforeEnter(t){let r=c;if(!n.isMounted)if(a)r=_||c;else return;t[Or]&&t[Or](!0);let i=S[x];i&&Lo(e,i)&&i.el[Or]&&i.el[Or](),C(r,[t])},enter(t){if(S[x]===e)return;let r=l,i=u,o=d;if(!n.isMounted)if(a)r=v||l,i=y||u,o=b||d;else return;let s=!1;t[kr]=e=>{s||(s=!0,C(e?o:i,[t]),T.delayedLeave&&T.delayedLeave(),t[kr]=void 0)};let c=t[kr].bind(null,!1);r?w(r,[t,c]):c()},leave(t,r){let i=String(e.key);if(t[kr]&&t[kr](!0),n.isUnmounting)return r();C(f,[t]);let a=!1;t[Or]=n=>{a||(a=!0,r(),C(n?h:m,[t]),t[Or]=void 0,S[i]===e&&delete S[i])};let o=t[Or].bind(null,!1);S[i]=e,p?w(p,[t,o]):o()},clone(e){let a=Rr(e,t,n,r,i);return i&&i(a),a}};return T}function zr(e){if(ui(e))return e=Wo(e),e.children=null,e}function Br(e){if(!ui(e))return _r(e.type)&&e.children?Fr(e.children):e;if(e.component)return e.component.subTree;let{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&x(n.default))return n.default()}}function Vr(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Vr(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Hr(e,t=!1,n){let r=[],i=0;for(let a=0;a<e.length;a++){let o=e[a],s=n==null?o.key:String(n)+String(o.key==null?a:o.key);o.type===Co?(o.patchFlag&128&&i++,r=r.concat(Hr(o.children,t,s))):(t||o.type!==To)&&r.push(s==null?o:Wo(o,{key:s}))}if(i>1)for(let e=0;e<r.length;e++)r[e].patchFlag=-2;return r}function Ur(e,t){return x(e)?f({name:e.name},t,{setup:e}):e}function Wr(e){e.ids=[e.ids[0]+ e.ids[2]+++`-`,0,0]}function Gr(e){let t=rs(),n=on(null);if(t){let r=t.refs===o?t.refs={}:t.refs;Object.defineProperty(r,e,{enumerable:!0,get:()=>n.value,set:e=>n.value=e})}return n}function Kr(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}var qr=new WeakMap;function Jr(e,t,n,r,i=!1){if(g(e)){e.forEach((e,a)=>Jr(e,t&&(g(t)?t[a]:t),n,r,i));return}if(si(r)&&!i){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&Jr(e,t,n,r.component.subTree);return}let a=r.shapeFlag&4?vs(r.component):r.el,s=i?null:a,{i:c,r:u}=e,d=t&&t.r,f=c.refs===o?c.refs={}:c.refs,m=c.setupState,_=$t(m),v=m===o?l:e=>Kr(f,e)?!1:h(_,e),y=(e,t)=>!(t&&Kr(f,t));if(d!=null&&d!==u){if(Yr(t),S(d))f[d]=null,v(d)&&(m[d]=null);else if(rn(d)){let e=t;y(d,e.k)&&(d.value=null),e.k&&(f[e.k]=null)}}if(x(u))kn(u,c,12,[s,f]);else{let t=S(u),r=rn(u);if(t||r){let o=()=>{if(e.f){let n=t?v(u)?m[u]:f[u]:y(u)||!e.k?u.value:f[e.k];if(i)g(n)&&p(n,a);else if(g(n))n.includes(a)||n.push(a);else if(t)f[u]=[a],v(u)&&(m[u]=f[u]);else{let t=[a];y(u,e.k)&&(u.value=t),e.k&&(f[e.k]=t)}}else t?(f[u]=s,v(u)&&(m[u]=s)):r&&(y(u,e.k)&&(u.value=s),e.k&&(f[e.k]=s))};if(s){let t=()=>{o(),qr.delete(e)};t.id=-1,qr.set(e,t),Za(t,n)}else Yr(e),o()}}}function Yr(e){let t=qr.get(e);t&&(t.flags|=8,qr.delete(e))}var Xr=!1,Zr=()=>{Xr||=(console.error(`Hydration completed but contains mismatches.`),!0)},Qr=e=>e.namespaceURI.includes(`svg`)&&e.tagName!==`foreignObject`,$r=e=>e.namespaceURI.includes(`MathML`),ei=e=>{if(e.nodeType===1){if(Qr(e))return`svg`;if($r(e))return`mathml`}},ti=e=>e.nodeType===8;function ni(e){let{mt:t,p:n,o:{patchProp:r,createText:i,nextSibling:a,parentNode:o,remove:s,insert:c,createComment:l}}=e,d=(e,t)=>{if(!t.hasChildNodes()){n(null,e,t),Kn(),t._vnode=e;return}f(t.firstChild,e,null,null,null),Kn(),t._vnode=e},f=(n,r,s,l,u,d=!1)=>{d||=!!r.dynamicChildren;let b=ti(n)&&n.data===`[`,x=()=>g(n,r,s,l,u,b),{type:S,ref:C,shapeFlag:w,patchFlag:T}=r,E=n.nodeType;r.el=n,T===-2&&(d=!1,r.dynamicChildren=null);let ee=null;switch(S){case wo:E===3?(n.data!==r.children&&(Zr(),n.data=r.children),ee=a(n)):r.children===``?(c(r.el=i(``),o(n),n),ee=n):ee=x();break;case To:y(n)?(ee=a(n),v(r.el=n.content.firstChild,n,s)):ee=E!==8||b?x():a(n);break;case Eo:if(b&&(n=a(n),E=n.nodeType),E===1||E===3){ee=n;let e=!r.children.length;for(let t=0;t<r.staticCount;t++)e&&(r.children+=ee.nodeType===1?ee.outerHTML:ee.data),t===r.staticCount-1&&(r.anchor=ee),ee=a(ee);return b?a(ee):ee}else x();break;case Co:ee=b?h(n,r,s,l,u,d):x();break;default:if(w&1)ee=(E!==1||r.type.toLowerCase()!==n.tagName.toLowerCase())&&!y(n)?x():p(n,r,s,l,u,d);else if(w&6){r.slotScopeIds=u;let e=o(n);if(ee=b?_(n):ti(n)&&n.data===`teleport start`?_(n,n.data,`teleport end`):a(n),t(r,e,null,s,l,ei(e),d),si(r)&&!r.type.__asyncResolved){let t;b?(t=Vo(Co),t.anchor=ee?ee.previousSibling:e.lastChild):t=n.nodeType===3?Go(``):Vo(`div`),t.el=n,r.component.subTree=t}}else w&64?ee=E===8?r.type.hydrate(n,r,s,l,u,d,e,m):x():w&128&&(ee=r.type.hydrate(n,r,s,l,ei(o(n)),u,d,e,f))}return C!=null&&Jr(C,null,l,r),ee},p=(e,t,n,i,a,o)=>{o||=!!t.dynamicChildren;let{type:c,props:l,patchFlag:d,shapeFlag:f,dirs:p,transition:h}=t,g=c===`input`||c===`option`;if(g||d!==-1){p&&rr(t,null,n,`created`);let c=!1;if(y(e)){c=ro(null,h)&&n&&n.vnode.props&&n.vnode.props.appear;let r=e.content.firstChild;if(c){let e=r.getAttribute(`class`);e&&(r.$cls=e),h.beforeEnter(r)}v(r,e,n),t.el=e=r}if(f&16&&!(l&&(l.innerHTML||l.textContent))){let r=m(e.firstChild,t,e,n,i,a,o);for(;r;){ai(e,1)||Zr();let t=r;r=r.nextSibling,s(t)}}else if(f&8){let n=t.children;n[0]===`
|
|
1
|
+
import{a as e,n as t,o as n,r,t as i}from"../rolldown-runtime-ga5ujxqr.js";function a(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}var o={},s=[],c=()=>{},l=()=>!1,u=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),d=e=>e.startsWith(`onUpdate:`),f=Object.assign,p=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},m=Object.prototype.hasOwnProperty,h=(e,t)=>m.call(e,t),g=Array.isArray,_=e=>ee(e)===`[object Map]`,v=e=>ee(e)===`[object Set]`,y=e=>ee(e)===`[object Date]`,b=e=>ee(e)===`[object RegExp]`,x=e=>typeof e==`function`,S=e=>typeof e==`string`,C=e=>typeof e==`symbol`,w=e=>typeof e==`object`&&!!e,T=e=>(w(e)||x(e))&&x(e.then)&&x(e.catch),E=Object.prototype.toString,ee=e=>E.call(e),te=e=>ee(e).slice(8,-1),D=e=>ee(e)===`[object Object]`,ne=e=>S(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,re=a(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),ie=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},ae=/-\w/g,oe=ie(e=>e.replace(ae,e=>e.slice(1).toUpperCase())),O=/\B([A-Z])/g,k=ie(e=>e.replace(O,`-$1`).toLowerCase()),se=ie(e=>e.charAt(0).toUpperCase()+e.slice(1)),ce=ie(e=>e?`on${se(e)}`:``),le=(e,t)=>!Object.is(e,t),ue=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},A=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},de=e=>{let t=parseFloat(e);return isNaN(t)?e:t},fe=e=>{let t=S(e)?Number(e):NaN;return isNaN(t)?e:t},pe,j=()=>pe||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{};function me(e){if(g(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],i=S(r)?ge(r):me(r);if(i)for(let e in i)t[e]=i[e]}return t}else if(S(e)||w(e))return e}var M=/;(?![^(]*\))/g,he=/:([^]+)/,N=/\/\*[^]*?\*\//g;function ge(e){let t={};return e.replace(N,``).split(M).forEach(e=>{if(e){let n=e.split(he);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function P(e){let t=``;if(S(e))t=e;else if(g(e))for(let n=0;n<e.length;n++){let r=P(e[n]);r&&(t+=r+` `)}else if(w(e))for(let n in e)e[n]&&(t+=n+` `);return t.trim()}function F(e){if(!e)return null;let{class:t,style:n}=e;return t&&!S(t)&&(e.class=P(t)),n&&(e.style=me(n)),e}var _e=`itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`,ve=a(_e);_e+``;function ye(e){return!!e||e===``}function be(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=xe(e[r],t[r]);return n}function xe(e,t){if(e===t)return!0;let n=y(e),r=y(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=C(e),r=C(t),n||r)return e===t;if(n=g(e),r=g(t),n||r)return n&&r?be(e,t):!1;if(n=w(e),r=w(t),n||r){if(!n||!r||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e){let r=e.hasOwnProperty(n),i=t.hasOwnProperty(n);if(r&&!i||!r&&i||!xe(e[n],t[n]))return!1}}return String(e)===String(t)}function Se(e,t){return e.findIndex(e=>xe(e,t))}var Ce=e=>!!(e&&e.__v_isRef===!0),we=e=>S(e)?e:e==null?``:g(e)||w(e)&&(e.toString===E||!x(e.toString))?Ce(e)?we(e.value):JSON.stringify(e,Te,2):String(e),Te=(e,t)=>Ce(t)?Te(e,t.value):_(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[Ee(t,r)+` =>`]=n,e),{})}:v(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>Ee(e))}:C(t)?Ee(t):w(t)&&!g(t)&&!D(t)?String(t):t,Ee=(e,t=``)=>C(e)?`Symbol(${e.description??t})`:e,De,Oe=class{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&De&&(De.active?(this.parent=De,this.index=(De.scopes||=[]).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].pause()}for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}let n=this.effects.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}}run(e){if(this._active){let t=De;try{return De=this,e()}finally{De=t}}}on(){++this._on===1&&(this.prevScope=De,De=this)}off(){if(this._on>0&&--this._on===0){if(De===this)De=this.prevScope;else{let e=De;for(;e;){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){this._active=!1;let t,n;for(t=0,n=this.effects.length;t<n;t++)this.effects[t].stop();for(this.effects.length=0,t=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){let e=this.scopes.slice();for(t=0,n=e.length;t<n;t++)e[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){let e=this.parent.scopes.pop();e&&e!==this&&(this.parent.scopes[this.index]=e,e.index=this.index)}this.parent=void 0}}};function ke(e){return new Oe(e)}function Ae(){return De}function je(e,t=!1){De&&De.cleanups.push(e)}var Me,Ne=new WeakSet,I=class{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,De&&(De.active?De.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Ne.has(this)&&(Ne.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Le(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Xe(this),Be(this);let e=Me,t=Ke;Me=this,Ke=!0;try{return this.fn()}finally{Ve(this),Me=e,Ke=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)We(e);this.deps=this.depsTail=void 0,Xe(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Ne.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){He(this)&&this.run()}get dirty(){return He(this)}},Pe=0,Fe,Ie;function Le(e,t=!1){if(e.flags|=8,t){e.next=Ie,Ie=e;return}e.next=Fe,Fe=e}function Re(){Pe++}function ze(){if(--Pe>0)return;if(Ie){let e=Ie;for(Ie=void 0;e;){let t=e.next;e.next=void 0,e.flags&=-9,e=t}}let e;for(;Fe;){let t=Fe;for(Fe=void 0;t;){let n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(t){e||=t}t=n}}if(e)throw e}function Be(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Ve(e){let t,n=e.depsTail,r=n;for(;r;){let e=r.prevDep;r.version===-1?(r===n&&(n=e),We(r),Ge(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=e}e.deps=t,e.depsTail=n}function He(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Ue(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Ue(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Ze)||(e.globalVersion=Ze,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!He(e))))return;e.flags|=2;let t=e.dep,n=Me,r=Ke;Me=e,Ke=!0;try{Be(e);let n=e.fn(e._value);(t.version===0||le(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(e){throw t.version++,e}finally{Me=n,Ke=r,Ve(e),e.flags&=-3}}function We(e,t=!1){let{dep:n,prevSub:r,nextSub:i}=e;if(r&&(r.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)We(e,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Ge(e){let{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}var Ke=!0,qe=[];function Je(){qe.push(Ke),Ke=!1}function Ye(){let e=qe.pop();Ke=e===void 0?!0:e}function Xe(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let e=Me;Me=void 0;try{t()}finally{Me=e}}}var Ze=0,Qe=class{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}},$e=class{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!Me||!Ke||Me===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==Me)t=this.activeLink=new Qe(Me,this),Me.deps?(t.prevDep=Me.depsTail,Me.depsTail.nextDep=t,Me.depsTail=t):Me.deps=Me.depsTail=t,et(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){let e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=Me.depsTail,t.nextDep=void 0,Me.depsTail.nextDep=t,Me.depsTail=t,Me.deps===t&&(Me.deps=e)}return t}trigger(e){this.version++,Ze++,this.notify(e)}notify(e){Re();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{ze()}}};function et(e){if(e.dep.sc++,e.sub.flags&4){let t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let e=t.deps;e;e=e.nextDep)et(e)}let n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}var tt=new WeakMap,nt=Symbol(``),rt=Symbol(``),it=Symbol(``);function at(e,t,n){if(Ke&&Me){let t=tt.get(e);t||tt.set(e,t=new Map);let r=t.get(n);r||(t.set(n,r=new $e),r.map=t,r.key=n),r.track()}}function ot(e,t,n,r,i,a){let o=tt.get(e);if(!o){Ze++;return}let s=e=>{e&&e.trigger()};if(Re(),t===`clear`)o.forEach(s);else{let i=g(e),a=i&&ne(n);if(i&&n===`length`){let e=Number(r);o.forEach((t,n)=>{(n===`length`||n===it||!C(n)&&n>=e)&&s(t)})}else switch((n!==void 0||o.has(void 0))&&s(o.get(n)),a&&s(o.get(it)),t){case`add`:i?a&&s(o.get(`length`)):(s(o.get(nt)),_(e)&&s(o.get(rt)));break;case`delete`:i||(s(o.get(nt)),_(e)&&s(o.get(rt)));break;case`set`:_(e)&&s(o.get(nt));break}}ze()}function st(e,t){let n=tt.get(e);return n&&n.get(t)}function ct(e){let t=Qt(e);return t===e?t:(at(t,`iterate`,it),Xt(e)?t:t.map(en))}function lt(e){return at(e=Qt(e),`iterate`,it),e}function ut(e,t){return Yt(e)?tn(Jt(e)?en(t):t):en(t)}var dt={__proto__:null,[Symbol.iterator](){return ft(this,Symbol.iterator,e=>ut(this,e))},concat(...e){return ct(this).concat(...e.map(e=>g(e)?ct(e):e))},entries(){return ft(this,`entries`,e=>(e[1]=ut(this,e[1]),e))},every(e,t){return mt(this,`every`,e,t,void 0,arguments)},filter(e,t){return mt(this,`filter`,e,t,e=>e.map(e=>ut(this,e)),arguments)},find(e,t){return mt(this,`find`,e,t,e=>ut(this,e),arguments)},findIndex(e,t){return mt(this,`findIndex`,e,t,void 0,arguments)},findLast(e,t){return mt(this,`findLast`,e,t,e=>ut(this,e),arguments)},findLastIndex(e,t){return mt(this,`findLastIndex`,e,t,void 0,arguments)},forEach(e,t){return mt(this,`forEach`,e,t,void 0,arguments)},includes(...e){return gt(this,`includes`,e)},indexOf(...e){return gt(this,`indexOf`,e)},join(e){return ct(this).join(e)},lastIndexOf(...e){return gt(this,`lastIndexOf`,e)},map(e,t){return mt(this,`map`,e,t,void 0,arguments)},pop(){return _t(this,`pop`)},push(...e){return _t(this,`push`,e)},reduce(e,...t){return ht(this,`reduce`,e,t)},reduceRight(e,...t){return ht(this,`reduceRight`,e,t)},shift(){return _t(this,`shift`)},some(e,t){return mt(this,`some`,e,t,void 0,arguments)},splice(...e){return _t(this,`splice`,e)},toReversed(){return ct(this).toReversed()},toSorted(e){return ct(this).toSorted(e)},toSpliced(...e){return ct(this).toSpliced(...e)},unshift(...e){return _t(this,`unshift`,e)},values(){return ft(this,`values`,e=>ut(this,e))}};function ft(e,t,n){let r=lt(e),i=r[t]();return r!==e&&!Xt(e)&&(i._next=i.next,i.next=()=>{let e=i._next();return e.done||(e.value=n(e.value)),e}),i}var pt=Array.prototype;function mt(e,t,n,r,i,a){let o=lt(e),s=o!==e&&!Xt(e),c=o[t];if(c!==pt[t]){let t=c.apply(e,a);return s?en(t):t}let l=n;o!==e&&(s?l=function(t,r){return n.call(this,ut(e,t),r,e)}:n.length>2&&(l=function(t,r){return n.call(this,t,r,e)}));let u=c.call(o,l,r);return s&&i?i(u):u}function ht(e,t,n,r){let i=lt(e),a=i!==e&&!Xt(e),o=n,s=!1;i!==e&&(a?(s=r.length===0,o=function(t,r,i){return s&&(s=!1,t=ut(e,t)),n.call(this,t,ut(e,r),i,e)}):n.length>3&&(o=function(t,r,i){return n.call(this,t,r,i,e)}));let c=i[t](o,...r);return s?ut(e,c):c}function gt(e,t,n){let r=Qt(e);at(r,`iterate`,it);let i=r[t](...n);return(i===-1||i===!1)&&Zt(n[0])?(n[0]=Qt(n[0]),r[t](...n)):i}function _t(e,t,n=[]){Je(),Re();let r=Qt(e)[t].apply(e,n);return ze(),Ye(),r}var vt=a(`__proto__,__v_isRef,__isVue`),yt=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!==`arguments`&&e!==`caller`).map(e=>Symbol[e]).filter(C));function bt(e){C(e)||(e=String(e));let t=Qt(this);return at(t,`has`,e),t.hasOwnProperty(e)}var xt=class{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if(t===`__v_skip`)return e.__v_skip;let r=this._isReadonly,i=this._isShallow;if(t===`__v_isReactive`)return!r;if(t===`__v_isReadonly`)return r;if(t===`__v_isShallow`)return i;if(t===`__v_raw`)return n===(r?i?Vt:Bt:i?zt:Rt).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;let a=g(e);if(!r){let e;if(a&&(e=dt[t]))return e;if(t===`hasOwnProperty`)return bt}let o=Reflect.get(e,t,nn(e)?e:n);if((C(t)?yt.has(t):vt(t))||(r||at(e,`get`,t),i))return o;if(nn(o)){let e=a&&ne(t)?o:o.value;return r&&w(e)?Gt(e):e}return w(o)?r?Gt(o):Ut(o):o}},St=class extends xt{constructor(e=!1){super(!1,e)}set(e,t,n,r){let i=e[t],a=g(e)&&ne(t);if(!this._isShallow){let e=Yt(i);if(!Xt(n)&&!Yt(n)&&(i=Qt(i),n=Qt(n)),!a&&nn(i)&&!nn(n))return e||(i.value=n),!0}let o=a?Number(t)<e.length:h(e,t),s=Reflect.set(e,t,n,nn(e)?e:r);return e===Qt(r)&&s&&(o?le(n,i)&&ot(e,`set`,t,n,i):ot(e,`add`,t,n)),s}deleteProperty(e,t){let n=h(e,t),r=e[t],i=Reflect.deleteProperty(e,t);return i&&n&&ot(e,`delete`,t,void 0,r),i}has(e,t){let n=Reflect.has(e,t);return(!C(t)||!yt.has(t))&&at(e,`has`,t),n}ownKeys(e){return at(e,`iterate`,g(e)?`length`:nt),Reflect.ownKeys(e)}},Ct=class extends xt{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}},wt=new St,Tt=new Ct,Et=new St(!0),Dt=new Ct(!0),Ot=e=>e,kt=e=>Reflect.getPrototypeOf(e);function At(e,t,n){return function(...r){let i=this.__v_raw,a=Qt(i),o=_(a),s=e===`entries`||e===Symbol.iterator&&o,c=e===`keys`&&o,l=i[e](...r),u=n?Ot:t?tn:en;return!t&&at(a,`iterate`,c?rt:nt),f(Object.create(l),{next(){let{value:e,done:t}=l.next();return t?{value:e,done:t}:{value:s?[u(e[0]),u(e[1])]:u(e),done:t}}})}}function jt(e){return function(...t){return e===`delete`?!1:e===`clear`?void 0:this}}function Mt(e,t){let n={get(n){let r=this.__v_raw,i=Qt(r),a=Qt(n);e||(le(n,a)&&at(i,`get`,n),at(i,`get`,a));let{has:o}=kt(i),s=t?Ot:e?tn:en;if(o.call(i,n))return s(r.get(n));if(o.call(i,a))return s(r.get(a));r!==i&&r.get(n)},get size(){let t=this.__v_raw;return!e&&at(Qt(t),`iterate`,nt),t.size},has(t){let n=this.__v_raw,r=Qt(n),i=Qt(t);return e||(le(t,i)&&at(r,`has`,t),at(r,`has`,i)),t===i?n.has(t):n.has(t)||n.has(i)},forEach(n,r){let i=this,a=i.__v_raw,o=Qt(a),s=t?Ot:e?tn:en;return!e&&at(o,`iterate`,nt),a.forEach((e,t)=>n.call(r,s(e),s(t),i))}};return f(n,e?{add:jt(`add`),set:jt(`set`),delete:jt(`delete`),clear:jt(`clear`)}:{add(e){let n=Qt(this),r=kt(n),i=Qt(e),a=!t&&!Xt(e)&&!Yt(e)?i:e;return r.has.call(n,a)||le(e,a)&&r.has.call(n,e)||le(i,a)&&r.has.call(n,i)||(n.add(a),ot(n,`add`,a,a)),this},set(e,n){!t&&!Xt(n)&&!Yt(n)&&(n=Qt(n));let r=Qt(this),{has:i,get:a}=kt(r),o=i.call(r,e);o||=(e=Qt(e),i.call(r,e));let s=a.call(r,e);return r.set(e,n),o?le(n,s)&&ot(r,`set`,e,n,s):ot(r,`add`,e,n),this},delete(e){let t=Qt(this),{has:n,get:r}=kt(t),i=n.call(t,e);i||=(e=Qt(e),n.call(t,e));let a=r?r.call(t,e):void 0,o=t.delete(e);return i&&ot(t,`delete`,e,void 0,a),o},clear(){let e=Qt(this),t=e.size!==0,n=e.clear();return t&&ot(e,`clear`,void 0,void 0,void 0),n}}),[`keys`,`values`,`entries`,Symbol.iterator].forEach(r=>{n[r]=At(r,e,t)}),n}function Nt(e,t){let n=Mt(e,t);return(t,r,i)=>r===`__v_isReactive`?!e:r===`__v_isReadonly`?e:r===`__v_raw`?t:Reflect.get(h(n,r)&&r in t?n:t,r,i)}var Pt={get:Nt(!1,!1)},Ft={get:Nt(!1,!0)},It={get:Nt(!0,!1)},Lt={get:Nt(!0,!0)},Rt=new WeakMap,zt=new WeakMap,Bt=new WeakMap,Vt=new WeakMap;function Ht(e){switch(e){case`Object`:case`Array`:return 1;case`Map`:case`Set`:case`WeakMap`:case`WeakSet`:return 2;default:return 0}}function Ut(e){return Yt(e)?e:qt(e,!1,wt,Pt,Rt)}function Wt(e){return qt(e,!1,Et,Ft,zt)}function Gt(e){return qt(e,!0,Tt,It,Bt)}function Kt(e){return qt(e,!0,Dt,Lt,Vt)}function qt(e,t,n,r,i){if(!w(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;let a=i.get(e);if(a)return a;let o=Ht(te(e));if(o===0)return e;let s=new Proxy(e,o===2?r:n);return i.set(e,s),s}function Jt(e){return Yt(e)?Jt(e.__v_raw):!!(e&&e.__v_isReactive)}function Yt(e){return!!(e&&e.__v_isReadonly)}function Xt(e){return!!(e&&e.__v_isShallow)}function Zt(e){return e?!!e.__v_raw:!1}function Qt(e){let t=e&&e.__v_raw;return t?Qt(t):e}function $t(e){return!h(e,`__v_skip`)&&Object.isExtensible(e)&&A(e,`__v_skip`,!0),e}var en=e=>w(e)?Ut(e):e,tn=e=>w(e)?Gt(e):e;function nn(e){return e?e.__v_isRef===!0:!1}function rn(e){return on(e,!1)}function an(e){return on(e,!0)}function on(e,t){return nn(e)?e:new sn(e,t)}var sn=class{constructor(e,t){this.dep=new $e,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:Qt(e),this._value=t?e:en(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){let t=this._rawValue,n=this.__v_isShallow||Xt(e)||Yt(e);e=n?e:Qt(e),le(e,t)&&(this._rawValue=e,this._value=n?e:en(e),this.dep.trigger())}};function cn(e){e.dep&&e.dep.trigger()}function ln(e){return nn(e)?e.value:e}function un(e){return x(e)?e():ln(e)}var dn={get:(e,t,n)=>t===`__v_raw`?e:ln(Reflect.get(e,t,n)),set:(e,t,n,r)=>{let i=e[t];return nn(i)&&!nn(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function fn(e){return Jt(e)?e:new Proxy(e,dn)}var pn=class{constructor(e){this.__v_isRef=!0,this._value=void 0;let t=this.dep=new $e,{get:n,set:r}=e(t.track.bind(t),t.trigger.bind(t));this._get=n,this._set=r}get value(){return this._value=this._get()}set value(e){this._set(e)}};function mn(e){return new pn(e)}function hn(e){let t=g(e)?Array(e.length):{};for(let n in e)t[n]=yn(e,n);return t}var gn=class{constructor(e,t,n){this._object=e,this._defaultValue=n,this.__v_isRef=!0,this._value=void 0,this._key=C(t)?t:String(t),this._raw=Qt(e);let r=!0,i=e;if(!g(e)||C(this._key)||!ne(this._key))do r=!Zt(i)||Xt(i);while(r&&(i=i.__v_raw));this._shallow=r}get value(){let e=this._object[this._key];return this._shallow&&(e=ln(e)),this._value=e===void 0?this._defaultValue:e}set value(e){if(this._shallow&&nn(this._raw[this._key])){let t=this._object[this._key];if(nn(t)){t.value=e;return}}this._object[this._key]=e}get dep(){return st(this._raw,this._key)}},_n=class{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}};function vn(e,t,n){return nn(e)?e:x(e)?new _n(e):w(e)&&arguments.length>1?yn(e,t,n):rn(e)}function yn(e,t,n){return new gn(e,t,n)}var bn=class{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new $e(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Ze-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&Me!==this)return Le(this,!0),!0}get value(){let e=this.dep.track();return Ue(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}};function xn(e,t,n=!1){let r,i;return x(e)?r=e:(r=e.get,i=e.set),new bn(r,i,n)}var Sn={},Cn=new WeakMap,wn=void 0;function Tn(e,t=!1,n=wn){if(n){let t=Cn.get(n);t||Cn.set(n,t=[]),t.push(e)}}function En(e,t,n=o){let{immediate:r,deep:i,once:a,scheduler:s,augmentJob:l,call:u}=n,d=e=>i?e:Xt(e)||i===!1||i===0?Dn(e,1):Dn(e),f,m,h,_,v=!1,y=!1;if(nn(e)?(m=()=>e.value,v=Xt(e)):Jt(e)?(m=()=>d(e),v=!0):g(e)?(y=!0,v=e.some(e=>Jt(e)||Xt(e)),m=()=>e.map(e=>{if(nn(e))return e.value;if(Jt(e))return d(e);if(x(e))return u?u(e,2):e()})):m=x(e)?t?u?()=>u(e,2):e:()=>{if(h){Je();try{h()}finally{Ye()}}let t=wn;wn=f;try{return u?u(e,3,[_]):e(_)}finally{wn=t}}:c,t&&i){let e=m,t=i===!0?1/0:i;m=()=>Dn(e(),t)}let b=Ae(),S=()=>{f.stop(),b&&b.active&&p(b.effects,f)};if(a&&t){let e=t;t=(...t)=>{let n=e(...t);return S(),n}}let C=y?Array(e.length).fill(Sn):Sn,w=e=>{if(!(!(f.flags&1)||!f.dirty&&!e))if(t){let n=f.run();if(e||i||v||(y?n.some((e,t)=>le(e,C[t])):le(n,C))){h&&h();let e=wn;wn=f;try{let e=[n,C===Sn?void 0:y&&C[0]===Sn?[]:C,_];C=n,u?u(t,3,e):t(...e)}finally{wn=e}}}else f.run()};return l&&l(w),f=new I(m),f.scheduler=s?()=>s(w,!1):w,_=e=>Tn(e,!1,f),h=f.onStop=()=>{let e=Cn.get(f);if(e){if(u)u(e,4);else for(let t of e)t();Cn.delete(f)}},t?r?w(!0):C=f.run():s?s(w.bind(null,!0),!0):f.run(),S.pause=f.pause.bind(f),S.resume=f.resume.bind(f),S.stop=S,S}function Dn(e,t=1/0,n){if(t<=0||!w(e)||e.__v_skip||(n||=new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,nn(e))Dn(e.value,t,n);else if(g(e))for(let r=0;r<e.length;r++)Dn(e[r],t,n);else if(v(e)||_(e))e.forEach(e=>{Dn(e,t,n)});else if(D(e)){for(let r in e)Dn(e[r],t,n);for(let r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&Dn(e[r],t,n)}return e}function On(e,t,n,r){try{return r?e(...r):e()}catch(e){An(e,t,n)}}function kn(e,t,n,r){if(x(e)){let i=On(e,t,n,r);return i&&T(i)&&i.catch(e=>{An(e,t,n)}),i}if(g(e)){let i=[];for(let a=0;a<e.length;a++)i.push(kn(e[a],t,n,r));return i}}function An(e,t,n,r=!0){let i=t?t.vnode:null,{errorHandler:a,throwUnhandledErrorInProduction:s}=t&&t.appContext.config||o;if(t){let r=t.parent,i=t.proxy,o=`https://vuejs.org/error-reference/#runtime-${n}`;for(;r;){let t=r.ec;if(t){for(let n=0;n<t.length;n++)if(t[n](e,i,o)===!1)return}r=r.parent}if(a){Je(),On(a,null,10,[e,i,o]),Ye();return}}jn(e,n,i,r,s)}function jn(e,t,n,r=!0,i=!1){if(i)throw e;console.error(e)}var Mn=[],Nn=-1,Pn=[],Fn=null,In=0,Ln=Promise.resolve(),Rn=null;function zn(e){let t=Rn||Ln;return e?t.then(this?e.bind(this):e):t}function Bn(e){let t=Nn+1,n=Mn.length;for(;t<n;){let r=t+n>>>1,i=Mn[r],a=Kn(i);a<e||a===e&&i.flags&2?t=r+1:n=r}return t}function Vn(e){if(!(e.flags&1)){let t=Kn(e),n=Mn[Mn.length-1];!n||!(e.flags&2)&&t>=Kn(n)?Mn.push(e):Mn.splice(Bn(t),0,e),e.flags|=1,Hn()}}function Hn(){Rn||=Ln.then(qn)}function Un(e){g(e)?Pn.push(...e):Fn&&e.id===-1?Fn.splice(In+1,0,e):e.flags&1||(Pn.push(e),e.flags|=1),Hn()}function Wn(e,t,n=Nn+1){for(;n<Mn.length;n++){let t=Mn[n];if(t&&t.flags&2){if(e&&t.id!==e.uid)continue;Mn.splice(n,1),n--,t.flags&4&&(t.flags&=-2),t(),t.flags&4||(t.flags&=-2)}}}function Gn(e){if(Pn.length){let e=[...new Set(Pn)].sort((e,t)=>Kn(e)-Kn(t));if(Pn.length=0,Fn){Fn.push(...e);return}for(Fn=e,In=0;In<Fn.length;In++){let e=Fn[In];e.flags&4&&(e.flags&=-2),e.flags&8||e(),e.flags&=-2}Fn=null,In=0}}var Kn=e=>e.id==null?e.flags&2?-1:1/0:e.id;function qn(e){try{for(Nn=0;Nn<Mn.length;Nn++){let e=Mn[Nn];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),On(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;Nn<Mn.length;Nn++){let e=Mn[Nn];e&&(e.flags&=-2)}Nn=-1,Mn.length=0,Gn(e),Rn=null,(Mn.length||Pn.length)&&qn(e)}}var Jn=null,Yn=null;function Xn(e){let t=Jn;return Jn=e,Yn=e&&e.type.__scopeId||null,t}function Zn(e){Yn=e}function Qn(){Yn=null}var $n=e=>er;function er(e,t=Jn,n){if(!t||e._n)return e;let r=(...n)=>{r._d&&Mo(-1);let i=Xn(t),a=Do.length,o;try{o=e(...n)}finally{for(let e=Do.length;e>a;e--)Ao();Xn(i),r._d&&Mo(1)}return o};return r._n=!0,r._c=!0,r._d=!0,r}function tr(e,t){if(Jn===null)return e;let n=vs(Jn),r=e.dirs||=[];for(let e=0;e<t.length;e++){let[i,a,s,c=o]=t[e];i&&(x(i)&&(i={mounted:i,updated:i}),i.deep&&Dn(a),r.push({dir:i,instance:n,value:a,oldValue:void 0,arg:s,modifiers:c}))}return e}function nr(e,t,n,r){let i=e.dirs,a=t&&t.dirs;for(let o=0;o<i.length;o++){let s=i[o];a&&(s.oldValue=a[o].value);let c=s.dir[r];c&&(Je(),kn(c,n,8,[e.el,s,e,t]),Ye())}}function rr(e,t){if(ns){let n=ns.provides,r=ns.parent&&ns.parent.provides;r===n&&(n=ns.provides=Object.create(r)),n[e]=t}}function ir(e,t,n=!1){let r=rs();if(r||Sa){let i=Sa?Sa._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(i&&e in i)return i[e];if(arguments.length>1)return n&&x(t)?t.call(r&&r.proxy):t}}function ar(){return!!(rs()||Sa)}var or=Symbol.for(`v-scx`),sr=()=>ir(or);function cr(e,t){return dr(e,null,t)}function lr(e,t){return dr(e,null,{flush:`sync`})}function ur(e,t,n){return dr(e,t,n)}function dr(e,t,n=o){let{immediate:r,deep:i,flush:a,once:s}=n,l=f({},n),u=t&&r||!t&&a!==`post`,d;if(ls){if(a===`sync`){let e=sr();d=e.__watcherHandles||=[]}else if(!u){let e=()=>{};return e.stop=c,e.resume=c,e.pause=c,e}}let p=ns;l.call=(e,t,n)=>kn(e,p,t,n);let m=!1;a===`post`?l.scheduler=e=>{Qa(e,p&&p.suspense)}:a!==`sync`&&(m=!0,l.scheduler=(e,t)=>{t?e():Vn(e)}),l.augmentJob=e=>{t&&(e.flags|=4),m&&(e.flags|=2,p&&(e.id=p.uid,e.i=p))};let h=En(e,t,l);return ls&&(d?d.push(h):u&&h()),h}function fr(e,t,n){let r=this.proxy,i=S(e)?e.includes(`.`)?pr(r,e):()=>r[e]:e.bind(r,r),a;x(t)?a=t:(a=t.handler,n=t);let o=os(this),s=dr(i,a.bind(r),n);return o(),s}function pr(e,t){let n=t.split(`.`);return()=>{let t=e;for(let e=0;e<n.length&&t;e++)t=t[n[e]];return t}}var mr=new WeakMap,hr=Symbol(`_vte`),gr=e=>e.__isTeleport,_r=e=>e&&(e.disabled||e.disabled===``),vr=e=>e&&(e.defer||e.defer===``),yr=e=>typeof SVGElement<`u`&&e instanceof SVGElement,br=e=>typeof MathMLElement==`function`&&e instanceof MathMLElement,xr=(e,t)=>{let n=e&&e.to;return S(n)?t?t(n):null:n},Sr={name:`Teleport`,__isTeleport:!0,process(e,t,n,r,i,a,o,s,c,l){let{mc:u,pc:d,pbc:f,o:{insert:p,querySelector:m,createText:h,createComment:g,parentNode:_}}=l,v=_r(t.props),{dynamicChildren:y}=t,b=(e,t,n)=>{e.shapeFlag&16&&u(e.children,t,n,i,a,o,s,c)},x=(e=t)=>{let n=_r(e.props),r=e.target=xr(e.props,m),a=Dr(r,e,h,p);r&&(o!==`svg`&&yr(r)?o=`svg`:o!==`mathml`&&br(r)&&(o=`mathml`),i&&i.isCE&&(i.ce._teleportTargets||(i.ce._teleportTargets=new Set)).add(r),n||(b(e,r,a),Er(e,!1)))},S=e=>{let t=()=>{mr.get(e)===t&&(mr.delete(e),_r(e.props)&&(b(e,_(e.el)||n,e.anchor),Er(e,!0)),x(e))};mr.set(e,t),Qa(t,a)};if(e==null){let e=t.el=h(``),i=t.anchor=h(``);if(p(e,n,r),p(i,n,r),vr(t.props)||a&&a.pendingBranch){S(t);return}v&&(b(t,n,i),Er(t,!0)),x()}else{t.el=e.el;let r=t.anchor=e.anchor,u=mr.get(e);if(u){u.flags|=8,mr.delete(e),S(t);return}t.targetStart=e.targetStart;let p=t.target=e.target,h=t.targetAnchor=e.targetAnchor,g=_r(e.props),_=g?n:p,b=g?r:h;if(o===`svg`||yr(p)?o=`svg`:(o===`mathml`||br(p))&&(o=`mathml`),y?(f(e.dynamicChildren,y,_,i,a,o,s),ao(e,t,!0)):c||d(e,t,_,b,i,a,o,s,!1),v)g?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Cr(t,n,r,l,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){let e=xr(t.props,m);e&&(t.target=e,Cr(t,e,null,l,0))}else g&&Cr(t,p,h,l,1);Er(t,v)}},remove(e,t,n,{um:r,o:{remove:i}},a){let{shapeFlag:o,children:s,anchor:c,targetStart:l,targetAnchor:u,target:d,props:f}=e,p=_r(f),m=a||!p,h=mr.get(e);if(h&&(h.flags|=8,mr.delete(e)),d&&(i(l),i(u)),a&&i(c),!h&&(p||d)&&o&16)for(let e=0;e<s.length;e++){let i=s[e];r(i,t,n,m,!!i.dynamicChildren)}},move:Cr,hydrate:wr};function Cr(e,t,n,{o:{insert:r},m:i},a=2){a===0&&r(e.targetAnchor,t,n);let{el:o,anchor:s,shapeFlag:c,children:l,props:u}=e,d=a===2;if(d&&r(o,t,n),!mr.has(e)&&(!d||_r(u))&&c&16)for(let e=0;e<l.length;e++)i(l[e],t,n,2);d&&r(s,t,n)}function wr(e,t,n,r,i,a,{o:{nextSibling:o,parentNode:s,querySelector:c,insert:l,createText:u}},d){function f(e,n){let r=n;for(;r;){if(r&&r.nodeType===8){if(r.data===`teleport start anchor`)t.targetStart=r;else if(r.data===`teleport anchor`){t.targetAnchor=r,e._lpa=t.targetAnchor&&o(t.targetAnchor);break}}r=o(r)}}function p(e,t){t.anchor=d(o(e),t,s(e),n,r,i,a)}let m=t.target=xr(t.props,c),h=_r(t.props);if(m){let c=m._lpa||m.firstChild;t.shapeFlag&16&&(h?(p(e,t),f(m,c),t.targetAnchor||Dr(m,t,u,l,s(e)===m?e:null)):(t.anchor=o(e),f(m,c),t.targetAnchor||Dr(m,t,u,l),d(c&&o(c),t,m,n,r,i,a))),Er(t,h)}else h&&t.shapeFlag&16&&(p(e,t),t.targetStart=e,t.targetAnchor=o(e));return t.anchor&&o(t.anchor)}var Tr=Sr;function Er(e,t){let n=e.ctx;if(n&&n.ut){let r,i;for(t?(r=e.el,i=e.anchor):(r=e.targetStart,i=e.targetAnchor);r&&r!==i;)r.nodeType===1&&r.setAttribute(`data-v-owner`,n.uid),r=r.nextSibling;n.ut()}}function Dr(e,t,n,r,i=null){let a=t.targetStart=n(``),o=t.targetAnchor=n(``);return a[hr]=o,e&&(r(a,e,i),r(o,e,i)),o}var Or=Symbol(`_leaveCb`),kr=Symbol(`_enterCb`);function Ar(){let e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Ei(()=>{e.isMounted=!0}),ki(()=>{e.isUnmounting=!0}),e}var jr=[Function,Array],Mr={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:jr,onEnter:jr,onAfterEnter:jr,onEnterCancelled:jr,onBeforeLeave:jr,onLeave:jr,onAfterLeave:jr,onLeaveCancelled:jr,onBeforeAppear:jr,onAppear:jr,onAfterAppear:jr,onAppearCancelled:jr},Nr=e=>{let t=e.subTree;return t.component?Nr(t.component):t},Pr={name:`BaseTransition`,props:Mr,setup(e,{slots:t}){let n=rs(),r=Ar();return()=>{let i=t.default&&Hr(t.default(),!0),a=i&&i.length?Fr(i):n.subTree?qo():void 0;if(!a)return;let o=Qt(e),{mode:s}=o;if(r.isLeaving)return zr(a);let c=Br(a);if(!c)return zr(a);let l=Rr(c,o,r,n,e=>l=e);c.type!==To&&Vr(c,l);let u=n.subTree&&Br(n.subTree);if(u&&u.type!==To&&!Lo(u,c)&&Nr(n).type!==To){let e=Rr(u,o,r,n);if(Vr(u,e),s===`out-in`&&c.type!==To)return r.isLeaving=!0,e.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete e.afterLeave,u=void 0},zr(a);s===`in-out`&&c.type!==To?e.delayLeave=(e,t,n)=>{let i=Lr(r,u);i[String(u.key)]=u,e[Or]=()=>{t(),e[Or]=void 0,delete l.delayedLeave,u=void 0},l.delayedLeave=()=>{n(),delete l.delayedLeave,u=void 0}}:u=void 0}else u&&=void 0;return a}}};function Fr(e){let t=e[0];if(e.length>1){for(let n of e)if(n.type!==To){t=n;break}}return t}var Ir=Pr;function Lr(e,t){let{leavingVNodes:n}=e,r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}function Rr(e,t,n,r,i){let{appear:a,mode:o,persisted:s=!1,onBeforeEnter:c,onEnter:l,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:f,onLeave:p,onAfterLeave:m,onLeaveCancelled:h,onBeforeAppear:_,onAppear:v,onAfterAppear:y,onAppearCancelled:b}=t,x=String(e.key),S=Lr(n,e),C=(e,t)=>{e&&kn(e,r,9,t)},w=(e,t)=>{let n=t[1];C(e,t),g(e)?e.every(e=>e.length<=1)&&n():e.length<=1&&n()},T={mode:o,persisted:s,beforeEnter(t){let r=c;if(!n.isMounted)if(a)r=_||c;else return;t[Or]&&t[Or](!0);let i=S[x];i&&Lo(e,i)&&i.el[Or]&&i.el[Or](),C(r,[t])},enter(t){if(S[x]===e)return;let r=l,i=u,o=d;if(!n.isMounted)if(a)r=v||l,i=y||u,o=b||d;else return;let s=!1;t[kr]=e=>{s||(s=!0,C(e?o:i,[t]),T.delayedLeave&&T.delayedLeave(),t[kr]=void 0)};let c=t[kr].bind(null,!1);r?w(r,[t,c]):c()},leave(t,r){let i=String(e.key);if(t[kr]&&t[kr](!0),n.isUnmounting)return r();C(f,[t]);let a=!1;t[Or]=n=>{a||(a=!0,r(),C(n?h:m,[t]),t[Or]=void 0,S[i]===e&&delete S[i])};let o=t[Or].bind(null,!1);S[i]=e,p?w(p,[t,o]):o()},clone(e){let a=Rr(e,t,n,r,i);return i&&i(a),a}};return T}function zr(e){if(mi(e))return e=Wo(e),e.children=null,e}function Br(e){if(!mi(e))return gr(e.type)&&e.children?Fr(e.children):e;if(e.component)return e.component.subTree;let{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&x(n.default))return n.default()}}function Vr(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Vr(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Hr(e,t=!1,n){let r=[],i=0;for(let a=0;a<e.length;a++){let o=e[a],s=n==null?o.key:String(n)+String(o.key==null?a:o.key);o.type===Co?(o.patchFlag&128&&i++,r=r.concat(Hr(o.children,t,s))):(t||o.type!==To)&&r.push(s==null?o:Wo(o,{key:s}))}if(i>1)for(let e=0;e<r.length;e++)r[e].patchFlag=-2;return r}function Ur(e,t){return x(e)?f({name:e.name},t,{setup:e}):e}function Wr(e){e.ids=[e.ids[0]+ e.ids[2]+++`-`,0,0]}function Gr(e){let t=rs(),n=an(null);if(t){let r=t.refs===o?t.refs={}:t.refs;Object.defineProperty(r,e,{enumerable:!0,get:()=>n.value,set:e=>n.value=e})}return n}function Kr(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}var qr=new WeakMap;function Jr(e,t,n,r,i=!1){if(g(e)){e.forEach((e,a)=>Jr(e,t&&(g(t)?t[a]:t),n,r,i));return}if(di(r)&&!i){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&Jr(e,t,n,r.component.subTree);return}let a=r.shapeFlag&4?vs(r.component):r.el,s=i?null:a,{i:c,r:u}=e,d=t&&t.r,f=c.refs===o?c.refs={}:c.refs,m=c.setupState,_=Qt(m),v=m===o?l:e=>Kr(f,e)?!1:h(_,e),y=(e,t)=>!(t&&Kr(f,t));if(d!=null&&d!==u){if(Yr(t),S(d))f[d]=null,v(d)&&(m[d]=null);else if(nn(d)){let e=t;y(d,e.k)&&(d.value=null),e.k&&(f[e.k]=null)}}if(x(u))On(u,c,12,[s,f]);else{let t=S(u),r=nn(u);if(t||r){let o=()=>{if(e.f){let n=t?v(u)?m[u]:f[u]:y(u)||!e.k?u.value:f[e.k];if(i)g(n)&&p(n,a);else if(g(n))n.includes(a)||n.push(a);else if(t)f[u]=[a],v(u)&&(m[u]=f[u]);else{let t=[a];y(u,e.k)&&(u.value=t),e.k&&(f[e.k]=t)}}else t?(f[u]=s,v(u)&&(m[u]=s)):r&&(y(u,e.k)&&(u.value=s),e.k&&(f[e.k]=s))};if(s){let t=()=>{o(),qr.delete(e)};t.id=-1,qr.set(e,t),Qa(t,n)}else Yr(e),o()}}}function Yr(e){let t=qr.get(e);t&&(t.flags|=8,qr.delete(e))}var Xr=!1,Zr=()=>{Xr||=(console.error(`Hydration completed but contains mismatches.`),!0)},Qr=e=>e.namespaceURI.includes(`svg`)&&e.tagName!==`foreignObject`,$r=e=>e.namespaceURI.includes(`MathML`),ei=e=>{if(e.nodeType===1){if(Qr(e))return`svg`;if($r(e))return`mathml`}},ti=e=>e.nodeType===8;function ni(e){let{mt:t,p:n,o:{patchProp:r,createText:i,nextSibling:a,parentNode:o,remove:s,insert:c,createComment:l}}=e,d=(e,t)=>{if(!t.hasChildNodes()){n(null,e,t),Gn(),t._vnode=e;return}f(t.firstChild,e,null,null,null),Gn(),t._vnode=e},f=(n,r,s,l,u,d=!1)=>{d||=!!r.dynamicChildren;let b=ti(n)&&n.data===`[`,x=()=>g(n,r,s,l,u,b),{type:S,ref:C,shapeFlag:w,patchFlag:T}=r,E=n.nodeType;r.el=n,T===-2&&(d=!1,r.dynamicChildren=null);let ee=null;switch(S){case wo:E===3?(n.data!==r.children&&(Zr(),n.data=r.children),ee=a(n)):r.children===``?(c(r.el=i(``),o(n),n),ee=n):ee=x();break;case To:y(n)?(ee=a(n),v(r.el=n.content.firstChild,n,s)):ee=E!==8||b?x():a(n);break;case Eo:if(b&&(n=a(n),E=n.nodeType),E===1||E===3){ee=n;let e=!r.children.length;for(let t=0;t<r.staticCount;t++)e&&(r.children+=ee.nodeType===1?ee.outerHTML:ee.data),t===r.staticCount-1&&(r.anchor=ee),ee=a(ee);return b?a(ee):ee}else x();break;case Co:ee=b?h(n,r,s,l,u,d):x();break;default:if(w&1)ee=(E!==1||r.type.toLowerCase()!==n.tagName.toLowerCase())&&!y(n)?x():p(n,r,s,l,u,d);else if(w&6){r.slotScopeIds=u;let e=o(n);if(ee=b?_(n):ti(n)&&n.data===`teleport start`?_(n,n.data,`teleport end`):a(n),t(r,e,null,s,l,ei(e),d),di(r)&&!r.type.__asyncResolved){let t;b?(t=Vo(Co),t.anchor=ee?ee.previousSibling:e.lastChild):t=n.nodeType===3?Go(``):Vo(`div`),t.el=n,r.component.subTree=t}}else w&64?ee=E===8?r.type.hydrate(n,r,s,l,u,d,e,m):x():w&128&&(ee=r.type.hydrate(n,r,s,l,ei(o(n)),u,d,e,f))}return C!=null&&Jr(C,null,l,r),ee},p=(e,t,n,i,a,o)=>{o||=!!t.dynamicChildren;let{type:c,dynamicProps:l,props:d,patchFlag:f,shapeFlag:p,dirs:h,transition:g}=t,_=c===`input`||c===`option`,b=!!l;if(_||b||f!==-1){h&&nr(t,null,n,`created`);let c=!1;if(y(e)){c=io(null,g)&&n&&n.vnode.props&&n.vnode.props.appear;let r=e.content.firstChild;if(c){let e=r.getAttribute(`class`);e&&(r.$cls=e),g.beforeEnter(r)}v(r,e,n),t.el=e=r}if(p&16&&!(d&&(d.innerHTML||d.textContent))){let r=m(e.firstChild,t,e,n,i,a,o);for(r&&!ai(e,1)&&Zr();r;){let e=r;r=r.nextSibling,s(e)}}else if(p&8){let n=t.children;n[0]===`
|
|
2
2
|
`&&(e.tagName===`PRE`||e.tagName===`TEXTAREA`)&&(n=n.slice(1));let{textContent:r}=e;r!==n&&r!==n.replace(/\r\n|\r/g,`
|
|
3
|
-
`)&&(ai(e,0)||Zr(),e.textContent=t.children)}if(l){if(g||!o||d&48){let t=e.tagName.includes(`-`);for(let i in l)(g&&(i.endsWith(`value`)||i===`indeterminate`)||u(i)&&!re(i)||i[0]===`.`||t&&!re(i))&&r(e,i,null,l[i],void 0,n)}else if(l.onClick)r(e,`onClick`,null,l.onClick,void 0,n);else if(d&4&&Yt(l.style))for(let e in l.style)l.style[e]}let _;(_=l&&l.onVnodeBeforeMount)&&Qo(_,n,t),p&&rr(t,null,n,`beforeMount`),((_=l&&l.onVnodeMounted)||p||c)&&bo(()=>{_&&Qo(_,n,t),c&&h.enter(e),p&&rr(t,null,n,`mounted`)},i)}return e.nextSibling},m=(e,t,r,o,s,l,u)=>{u||=!!t.dynamicChildren;let d=t.children,p=d.length;for(let t=0;t<p;t++){let m=u?d[t]:d[t]=Jo(d[t]),h=m.type===wo;e?(h&&!u&&t+1<p&&Jo(d[t+1]).type===wo&&(c(i(e.data.slice(m.children.length)),r,a(e)),e.data=m.children),e=f(e,m,o,s,l,u)):h&&!m.children?c(m.el=i(``),r):(ai(r,1)||Zr(),n(null,m,r,null,o,s,ei(r),l))}return e},h=(e,t,n,r,i,s)=>{let{slotScopeIds:u}=t;u&&(i=i?i.concat(u):u);let d=o(e),f=m(a(e),t,d,n,r,i,s);return f&&ti(f)&&f.data===`]`?a(t.anchor=f):(Zr(),c(t.anchor=l(`]`),d,f),f)},g=(e,t,r,i,c,l)=>{if(ai(e.parentElement,1)||Zr(),t.el=null,l){let t=_(e);for(;;){let n=a(e);if(n&&n!==t)s(n);else break}}let u=a(e),d=o(e);return s(e),n(null,t,d,u,r,i,ei(d),c),r&&(r.vnode.el=t.el,Ma(r,t.el)),u},_=(e,t=`[`,n=`]`)=>{let r=0;for(;e;)if(e=a(e),e&&ti(e)&&(e.data===t&&r++,e.data===n)){if(r===0)return a(e);r--}return e},v=(e,t,n)=>{let r=t.parentNode;r&&r.replaceChild(e,t);let i=n;for(;i;)i.vnode.el===t&&(i.vnode.el=i.subTree.el=e),i=i.parent},y=e=>e.nodeType===1&&e.tagName===`TEMPLATE`;return[d,f]}var ri=`data-allow-mismatch`,ii={0:`text`,1:`children`,2:`class`,3:`style`,4:`attribute`};function ai(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(ri);)e=e.parentElement;let n=e&&e.getAttribute(ri);if(n==null)return!1;if(n===``)return!0;{let e=n.split(`,`);return t===0&&e.includes(`children`)?!0:e.includes(ii[t])}}j().requestIdleCallback,j().cancelIdleCallback;function oi(e,t){if(ti(e)&&e.data===`[`){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(ti(r))if(r.data===`]`){if(--n===0)break}else r.data===`[`&&n++;r=r.nextSibling}}else t(e)}var si=e=>!!e.type.__asyncLoader;function ci(e){x(e)&&(e={loader:e});let{loader:t,loadingComponent:n,errorComponent:r,delay:i=200,hydrate:a,timeout:o,suspensible:s=!0,onError:c}=e,l=null,u,d=0,f=()=>(d++,l=null,p()),p=()=>{let e;return l||(e=l=t().catch(e=>{if(e=e instanceof Error?e:Error(String(e)),c)return new Promise((t,n)=>{c(e,()=>t(f()),()=>n(e),d+1)});throw e}).then(t=>e!==l&&l?l:(t&&(t.__esModule||t[Symbol.toStringTag]===`Module`)&&(t=t.default),u=t,t)))};return Ur({name:`AsyncComponentWrapper`,__asyncLoader:p,__asyncHydrate(e,t,n){let r=!1;(t.bu||=[]).push(()=>r=!0);let i=()=>{r||n()},o=a?()=>{let n=a(i,t=>oi(e,t));n&&(t.bum||=[]).push(n)}:i;u?o():p().then(()=>!t.isUnmounted&&o())},get __asyncResolved(){return u},setup(){let e=ns;if(Wr(e),u)return()=>li(u,e);let t=t=>{l=null,jn(t,e,13,!r)};if(s&&e.suspense||ls)return p().then(t=>()=>li(t,e)).catch(e=>(t(e),()=>r?Vo(r,{error:e}):null));let a=an(!1),c=an(),d=an(!!i);return i&&setTimeout(()=>{d.value=!1},i),o!=null&&setTimeout(()=>{if(!a.value&&!c.value){let e=Error(`Async component timed out after ${o}ms.`);t(e),c.value=e}},o),p().then(()=>{a.value=!0,e.parent&&ui(e.parent.vnode)&&e.parent.update()}).catch(e=>{t(e),c.value=e}),()=>{if(a.value&&u)return li(u,e);if(c.value&&r)return Vo(r,{error:c.value});if(n&&!d.value)return li(n,e)}}})}function li(e,t){let{ref:n,props:r,children:i,ce:a}=t.vnode,o=Vo(e,r,i);return o.ref=n,o.ce=a,delete t.vnode.ce,o}var ui=e=>e.type.__isKeepAlive,di={name:`KeepAlive`,__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){let n=rs(),r=n.ctx;if(!r.renderer)return()=>{let e=t.default&&t.default();return e&&e.length===1?e[0]:e};let i=new Map,a=new Set,o=null,s=n.suspense,{renderer:{p:c,m:l,um:u,o:{createElement:d}}}=r,f=d(`div`);r.activate=(e,t,n,r,i)=>{let a=e.component;l(e,t,n,0,s),c(a.vnode,e,t,n,a,s,r,e.slotScopeIds,i),Za(()=>{a.isDeactivated=!1,a.a&&ue(a.a);let t=e.props&&e.props.onVnodeMounted;t&&Qo(t,a.parent,e)},s)},r.deactivate=e=>{let t=e.component;so(t.m),so(t.a),l(e,f,null,1,s),Za(()=>{t.da&&ue(t.da);let n=e.props&&e.props.onVnodeUnmounted;n&&Qo(n,t.parent,e),t.isDeactivated=!0},s)};function p(e){_i(e),u(e,n,s,!0)}function m(e){i.forEach((t,n)=>{let r=ys(si(t)?t.type.__asyncResolved||{}:t.type);r&&!e(r)&&h(n)})}function h(e){let t=i.get(e);t&&(!o||!Lo(t,o))?p(t):o&&_i(o),i.delete(e),a.delete(e)}dr(()=>[e.include,e.exclude],([e,t])=>{e&&m(t=>fi(e,t)),t&&m(e=>!fi(t,e))},{flush:`post`,deep:!0});let g=null,_=()=>{g!=null&&(lo(n.subTree.type)?Za(()=>{i.set(g,vi(n.subTree))},n.subTree.suspense):i.set(g,vi(n.subTree)))};return Si(_),wi(_),Ti(()=>{i.forEach(e=>{let{subTree:t,suspense:r}=n,i=vi(t);if(e.type===i.type&&e.key===i.key){_i(i);let e=i.component.da;e&&Za(e,r);return}p(e)})}),()=>{if(g=null,!t.default)return o=null;let n=t.default(),r=n[0];if(n.length>1)return o=null,n;if(!Io(r)||!(r.shapeFlag&4)&&!(r.shapeFlag&128))return o=null,r;let s=vi(r);if(s.type===To)return o=null,s;let c=s.type,l=ys(si(s)?s.type.__asyncResolved||{}:c),{include:u,exclude:d,max:f}=e;if(u&&(!l||!fi(u,l))||d&&l&&fi(d,l))return s.shapeFlag&=-257,o=s,r;let p=s.key==null?c:s.key,m=i.get(p);return s.el&&(s=Wo(s),r.shapeFlag&128&&(r.ssContent=s)),g=p,m?(s.el=m.el,s.component=m.component,s.transition&&Vr(s,s.transition),s.shapeFlag|=512,a.delete(p),a.add(p)):(a.add(p),f&&a.size>parseInt(f,10)&&h(a.values().next().value)),s.shapeFlag|=256,o=s,lo(r.type)?r:s}}};function fi(e,t){return g(e)?e.some(e=>fi(e,t)):S(e)?e.split(`,`).includes(t):b(e)?(e.lastIndex=0,e.test(t)):!1}function pi(e,t){hi(e,`a`,t)}function mi(e,t){hi(e,`da`,t)}function hi(e,t,n=ns){let r=e.__wdc||=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()};if(yi(t,r,n),n){let e=n.parent;for(;e&&e.parent;)ui(e.parent.vnode)&&gi(r,t,n,e),e=e.parent}}function gi(e,t,n,r){let i=yi(t,e,r,!0);Ei(()=>{p(r[t],i)},n)}function _i(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function vi(e){return e.shapeFlag&128?e.ssContent:e}function yi(e,t,n=ns,r=!1){if(n){let i=n[e]||(n[e]=[]),a=t.__weh||=(...r)=>{Je();let i=os(n),a=An(t,n,e,r);return i(),Ye(),a};return r?i.unshift(a):i.push(a),a}}var bi=e=>(t,n=ns)=>{(!ls||e===`sp`)&&yi(e,(...e)=>t(...e),n)},xi=bi(`bm`),Si=bi(`m`),Ci=bi(`bu`),wi=bi(`u`),Ti=bi(`bum`),Ei=bi(`um`),Di=bi(`sp`),Oi=bi(`rtg`),ki=bi(`rtc`);function Ai(e,t=ns){yi(`ec`,e,t)}var ji=`components`,Mi=`directives`;function Ni(e,t){return Li(ji,e,!0,t)||e}var Pi=Symbol.for(`v-ndc`);function Fi(e){return S(e)?Li(ji,e,!1)||e:e||Pi}function Ii(e){return Li(Mi,e)}function Li(e,t,n=!0,r=!1){let i=Yn||ns;if(i){let n=i.type;if(e===ji){let e=ys(n,!1);if(e&&(e===t||e===oe(t)||e===se(oe(t))))return n}let a=Ri(i[e]||n[e],t)||Ri(i.appContext[e],t);return!a&&r?n:a}}function Ri(e,t){return e&&(e[t]||e[oe(t)]||e[se(oe(t))])}function zi(e,t,n,r){let i,a=n&&n[r],o=g(e);if(o||S(e)){let n=o&&Yt(e),r=!1,s=!1;n&&(r=!Zt(e),s=Xt(e),e=lt(e)),i=Array(e.length);for(let n=0,o=e.length;n<o;n++)i[n]=t(r?s?nn(tn(e[n])):tn(e[n]):e[n],n,void 0,a&&a[n])}else if(typeof e==`number`){i=Array(e);for(let n=0;n<e;n++)i[n]=t(n+1,n,void 0,a&&a[n])}else if(w(e))if(e[Symbol.iterator])i=Array.from(e,(e,n)=>t(e,n,void 0,a&&a[n]));else{let n=Object.keys(e);i=Array(n.length);for(let r=0,o=n.length;r<o;r++){let o=n[r];i[r]=t(e[o],o,r,a&&a[r])}}else i=[];return n&&(n[r]=i),i}function Bi(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(g(r))for(let t=0;t<r.length;t++)e[r[t].name]=r[t].fn;else r&&(e[r.name]=r.key?(...e)=>{let t=r.fn(...e);return t&&(t.key=r.key),t}:r.fn)}return e}function Vi(e,t,n={},r,i){if(Yn.ce||Yn.parent&&si(Yn.parent)&&Yn.parent.ce){let e=Object.keys(n).length>0;return t!==`default`&&(n.name=t),ko(),Fo(Co,null,[Vo(`slot`,n,r&&r())],e?-2:64)}let a=e[t];a&&a._c&&(a._d=!1),ko();let o=a&&Hi(a(n)),s=n.key||o&&o.key,c=Fo(Co,{key:(s&&!C(s)?s:`_${t}`)+(!o&&r?`_fb`:``)},o||(r?r():[]),o&&e._===1?64:-2);return!i&&c.scopeId&&(c.slotScopeIds=[c.scopeId+`-s`]),a&&a._c&&(a._d=!0),c}function Hi(e){return e.some(e=>Io(e)?!(e.type===To||e.type===Co&&!Hi(e.children)):!0)?e:null}function Ui(e,t){let n={};for(let r in e)n[t&&/[A-Z]/.test(r)?`on:${r}`:ce(r)]=e[r];return n}var Wi=e=>e?cs(e)?vs(e):Wi(e.parent):null,Gi=f(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=>Wi(e.parent),$root:e=>Wi(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>aa(e),$forceUpdate:e=>e.f||=()=>{Hn(e.update)},$nextTick:e=>e.n||=Bn.bind(e.proxy),$watch:e=>pr.bind(e)}),Ki=(e,t)=>e!==o&&!e.__isScriptSetup&&h(e,t),qi={get({_:e},t){if(t===`__v_skip`)return!0;let{ctx:n,setupState:r,data:i,props:a,accessCache:s,type:c,appContext:l}=e;if(t[0]!==`$`){let e=s[t];if(e!==void 0)switch(e){case 1:return r[t];case 2:return i[t];case 4:return n[t];case 3:return a[t]}else if(Ki(r,t))return s[t]=1,r[t];else if(i!==o&&h(i,t))return s[t]=2,i[t];else if(h(a,t))return s[t]=3,a[t];else if(n!==o&&h(n,t))return s[t]=4,n[t];else ea&&(s[t]=0)}let u=Gi[t],d,f;if(u)return t===`$attrs`&&at(e.attrs,`get`,``),u(e);if((d=c.__cssModules)&&(d=d[t]))return d;if(n!==o&&h(n,t))return s[t]=4,n[t];if(f=l.config.globalProperties,h(f,t))return f[t]},set({_:e},t,n){let{data:r,setupState:i,ctx:a}=e;return Ki(i,t)?(i[t]=n,!0):r!==o&&h(r,t)?(r[t]=n,!0):h(e.props,t)||t[0]===`$`&&t.slice(1)in e?!1:(a[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:i,props:a,type:s}},c){let l;return!!(n[c]||e!==o&&c[0]!==`$`&&h(e,c)||Ki(t,c)||h(a,c)||h(r,c)||h(Gi,c)||h(i.config.globalProperties,c)||(l=s.__cssModules)&&l[c])},defineProperty(e,t,n){return n.get==null?h(n,`value`)&&this.set(e,t,n.value,null):e._.accessCache[t]=0,Reflect.defineProperty(e,t,n)}};function Ji(){return Xi(`useSlots`).slots}function Yi(){return Xi(`useAttrs`).attrs}function Xi(e){let t=rs();return t.setupContext||=_s(t)}function Zi(e){return g(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}function Qi(e,t){return!e||!t?e||t:g(e)&&g(t)?e.concat(t):f({},Zi(e),Zi(t))}function $i(e){let t=rs(),n=ls,r=e();ss(),n&&as(!1);let i=()=>{os(t),n&&as(!0)},a=()=>{rs()!==t&&t.scope.off(),ss(),n&&as(!1)};return T(r)&&(r=r.catch(e=>{throw i(),Promise.resolve().then(()=>Promise.resolve().then(a)),e})),[r,()=>{i(),Promise.resolve().then(a)}]}var ea=!0;function ta(e){let t=aa(e),n=e.proxy,r=e.ctx;ea=!1,t.beforeCreate&&ra(t.beforeCreate,e,`bc`);let{data:i,computed:a,methods:o,watch:s,provide:l,inject:u,created:d,beforeMount:f,mounted:p,beforeUpdate:m,updated:h,activated:_,deactivated:v,beforeDestroy:y,beforeUnmount:b,destroyed:S,unmounted:C,render:T,renderTracked:E,renderTriggered:ee,errorCaptured:te,serverPrefetch:D,expose:ne,inheritAttrs:re,components:ie,directives:ae,filters:oe}=t;if(u&&na(u,r,null),o)for(let e in o){let t=o[e];x(t)&&(r[e]=t.bind(n))}if(i){let t=i.call(n,n);w(t)&&(e.data=Wt(t))}if(ea=!0,a)for(let e in a){let t=a[e],i=xs({get:x(t)?t.bind(n,n):x(t.get)?t.get.bind(n,n):c,set:!x(t)&&x(t.set)?t.set.bind(n):c});Object.defineProperty(r,e,{enumerable:!0,configurable:!0,get:()=>i.value,set:e=>i.value=e})}if(s)for(let e in s)ia(s[e],r,n,e);if(l){let e=x(l)?l.call(n):l;Reflect.ownKeys(e).forEach(t=>{ir(t,e[t])})}d&&ra(d,e,`c`);function O(e,t){g(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(O(xi,f),O(Si,p),O(Ci,m),O(wi,h),O(pi,_),O(mi,v),O(Ai,te),O(ki,E),O(Oi,ee),O(Ti,b),O(Ei,C),O(Di,D),g(ne))if(ne.length){let t=e.exposed||={};ne.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t,enumerable:!0})})}else e.exposed||={};T&&e.render===c&&(e.render=T),re!=null&&(e.inheritAttrs=re),ie&&(e.components=ie),ae&&(e.directives=ae),D&&Wr(e)}function na(e,t,n=c){g(e)&&(e=ua(e));for(let n in e){let r=e[n],i;i=w(r)?`default`in r?ar(r.from||n,r.default,!0):ar(r.from||n):ar(r),rn(i)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>i.value,set:e=>i.value=e}):t[n]=i}}function ra(e,t,n){An(g(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function ia(e,t,n,r){let i=r.includes(`.`)?mr(n,r):()=>n[r];if(S(e)){let n=t[e];x(n)&&dr(i,n)}else if(x(e))dr(i,e.bind(n));else if(w(e))if(g(e))e.forEach(e=>ia(e,t,n,r));else{let r=x(e.handler)?e.handler.bind(n):t[e.handler];x(r)&&dr(i,r,e)}}function aa(e){let t=e.type,{mixins:n,extends:r}=t,{mixins:i,optionsCache:a,config:{optionMergeStrategies:o}}=e.appContext,s=a.get(t),c;return s?c=s:!i.length&&!n&&!r?c=t:(c={},i.length&&i.forEach(e=>oa(c,e,o,!0)),oa(c,t,o)),w(t)&&a.set(t,c),c}function oa(e,t,n,r=!1){let{mixins:i,extends:a}=t;a&&oa(e,a,n,!0),i&&i.forEach(t=>oa(e,t,n,!0));for(let i in t)if(!(r&&i===`expose`)){let r=sa[i]||n&&n[i];e[i]=r?r(e[i],t[i]):t[i]}return e}var sa={data:ca,props:pa,emits:pa,methods:fa,computed:fa,beforeCreate:da,created:da,beforeMount:da,mounted:da,beforeUpdate:da,updated:da,beforeDestroy:da,beforeUnmount:da,destroyed:da,unmounted:da,activated:da,deactivated:da,errorCaptured:da,serverPrefetch:da,components:fa,directives:fa,watch:ma,provide:ca,inject:la};function ca(e,t){return t?e?function(){return f(x(e)?e.call(this,this):e,x(t)?t.call(this,this):t)}:t:e}function la(e,t){return fa(ua(e),ua(t))}function ua(e){if(g(e)){let t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function da(e,t){return e?[...new Set([].concat(e,t))]:t}function fa(e,t){return e?f(Object.create(null),e,t):t}function pa(e,t){return e?g(e)&&g(t)?[...new Set([...e,...t])]:f(Object.create(null),Zi(e),Zi(t??{})):t}function ma(e,t){if(!e)return t;if(!t)return e;let n=f(Object.create(null),e);for(let r in t)n[r]=da(e[r],t[r]);return n}function ha(){return{app:null,config:{isNativeTag:l,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}var ga=0;function _a(e,t){return function(n,r=null){x(n)||(n=f({},n)),r!=null&&!w(r)&&(r=null);let i=ha(),a=new WeakSet,o=[],s=!1,c=i.app={_uid:ga++,_component:n,_props:r,_container:null,_context:i,_instance:null,version:Cs,get config(){return i.config},set config(e){},use(e,...t){return a.has(e)||(e&&x(e.install)?(a.add(e),e.install(c,...t)):x(e)&&(a.add(e),e(c,...t))),c},mixin(e){return i.mixins.includes(e)||i.mixins.push(e),c},component(e,t){return t?(i.components[e]=t,c):i.components[e]},directive(e,t){return t?(i.directives[e]=t,c):i.directives[e]},mount(a,o,l){if(!s){let u=c._ceVNode||Vo(n,r);return u.appContext=i,l===!0?l=`svg`:l===!1&&(l=void 0),o&&t?t(u,a):e(u,a,l),s=!0,c._container=a,a.__vue_app__=c,vs(u.component)}},onUnmount(e){o.push(e)},unmount(){s&&(An(o,c._instance,16),e(null,c._container),delete c._container.__vue_app__)},provide(e,t){return i.provides[e]=t,c},runWithContext(e){let t=va;va=c;try{return e()}finally{va=t}}};return c}}var va=null;function ya(e,t,n=o){let r=rs(),i=oe(t),a=k(t),s=ba(e,i),c=hn((s,c)=>{let l,u=o,d;return ur(()=>{let t=e[i];le(l,t)&&(l=t,c())}),{get(){return s(),n.get?n.get(l):l},set(e){let s=n.set?n.set(e):e;if(!le(s,l)&&!(u!==o&&le(e,u)))return;let f=r.vnode.props;f&&(t in f||i in f||a in f)&&(`onUpdate:${t}`in f||`onUpdate:${i}`in f||`onUpdate:${a}`in f)||(l=e,c()),r.emit(`update:${t}`,s),le(e,s)&&le(e,u)&&!le(s,d)&&c(),u=e,d=s}}});return c[Symbol.iterator]=()=>{let e=0;return{next(){return e<2?{value:e++?s||o:c,done:!1}:{done:!0}}}},c}var ba=(e,t)=>t===`modelValue`||t===`model-value`?e.modelModifiers:e[`${t}Modifiers`]||e[`${oe(t)}Modifiers`]||e[`${k(t)}Modifiers`];function xa(e,t,...n){if(e.isUnmounted)return;let r=e.vnode.props||o,i=n,a=t.startsWith(`update:`),s=a&&ba(r,t.slice(7));s&&(s.trim&&(i=n.map(e=>S(e)?e.trim():e)),s.number&&(i=n.map(de)));let c,l=r[c=ce(t)]||r[c=ce(oe(t))];!l&&a&&(l=r[c=ce(k(t))]),l&&An(l,e,6,i);let u=r[c+`Once`];if(u){if(!e.emitted)e.emitted={};else if(e.emitted[c])return;e.emitted[c]=!0,An(u,e,6,i)}}var Sa=new WeakMap;function Ca(e,t,n=!1){let r=n?Sa:t.emitsCache,i=r.get(e);if(i!==void 0)return i;let a=e.emits,o={},s=!1;if(!x(e)){let r=e=>{let n=Ca(e,t,!0);n&&(s=!0,f(o,n))};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}return!a&&!s?(w(e)&&r.set(e,null),null):(g(a)?a.forEach(e=>o[e]=null):f(o,a),w(e)&&r.set(e,o),o)}function wa(e,t){return!e||!u(t)?!1:(t=t.slice(2).replace(/Once$/,``),h(e,t[0].toLowerCase()+t.slice(1))||h(e,k(t))||h(e,t))}function Ta(e){let{type:t,vnode:n,proxy:r,withProxy:i,propsOptions:[a],slots:o,attrs:s,emit:c,render:l,renderCache:u,props:f,data:p,setupState:m,ctx:h,inheritAttrs:g}=e,_=Zn(e),v,y;try{if(n.shapeFlag&4){let e=i||r,t=e;v=Jo(l.call(t,e,u,f,m,p,h)),y=s}else{let e=t;v=Jo(e.length>1?e(f,{attrs:s,slots:o,emit:c}):e(f,null)),y=t.props?s:Da(s)}}catch(t){Do.length=0,jn(t,e,1),v=Vo(To)}let b=v;if(y&&g!==!1){let e=Object.keys(y),{shapeFlag:t}=b;e.length&&t&7&&(a&&e.some(d)&&(y=Oa(y,a)),b=Wo(b,y,!1,!0))}return n.dirs&&(b=Wo(b,null,!1,!0),b.dirs=b.dirs?b.dirs.concat(n.dirs):n.dirs),n.transition&&Vr(b,n.transition),v=b,Zn(_),v}function Ea(e,t=!0){let n;for(let t=0;t<e.length;t++){let r=e[t];if(Io(r)){if(r.type!==To||r.children===`v-if`){if(n)return;n=r}}else return}return n}var Da=e=>{let t;for(let n in e)(n===`class`||n===`style`||u(n))&&((t||={})[n]=e[n]);return t},Oa=(e,t)=>{let n={};for(let r in e)(!d(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function ka(e,t,n){let{props:r,children:i,component:a}=e,{props:o,children:s,patchFlag:c}=t,l=a.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return r?Aa(r,o,l):!!o;if(c&8){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let n=e[t];if(ja(o,r,n)&&!wa(l,n))return!0}}}else return(i||s)&&(!s||!s.$stable)?!0:r===o?!1:r?o?Aa(r,o,l):!0:!!o;return!1}function Aa(e,t,n){let r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let i=0;i<r.length;i++){let a=r[i];if(ja(t,e,a)&&!wa(n,a))return!0}return!1}function ja(e,t,n){let r=e[n],i=t[n];return n===`style`&&w(r)&&w(i)?!xe(r,i):r!==i}function Ma({vnode:e,parent:t,suspense:n},r){for(;t;){let n=t.subTree;if(n.suspense&&n.suspense.activeBranch===e&&(n.suspense.vnode.el=n.el=r,e=n),n===e)(e=t.vnode).el=r,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=r)}var Na={},Pa=()=>Object.create(Na),Fa=e=>Object.getPrototypeOf(e)===Na;function Ia(e,t,n,r=!1){let i={},a=Pa();e.propsDefaults=Object.create(null),Ra(e,t,i,a);for(let t in e.propsOptions[0])t in i||(i[t]=void 0);n?e.props=r?i:Gt(i):e.type.props?e.props=i:e.props=a,e.attrs=a}function La(e,t,n,r){let{props:i,attrs:a,vnode:{patchFlag:o}}=e,s=$t(i),[c]=e.propsOptions,l=!1;if((r||o>0)&&!(o&16)){if(o&8){let n=e.vnode.dynamicProps;for(let r=0;r<n.length;r++){let o=n[r];if(wa(e.emitsOptions,o))continue;let u=t[o];if(c)if(h(a,o))u!==a[o]&&(a[o]=u,l=!0);else{let t=oe(o);i[t]=za(c,s,t,u,e,!1)}else u!==a[o]&&(a[o]=u,l=!0)}}}else{Ra(e,t,i,a)&&(l=!0);let r;for(let a in s)(!t||!h(t,a)&&((r=k(a))===a||!h(t,r)))&&(c?n&&(n[a]!==void 0||n[r]!==void 0)&&(i[a]=za(c,s,a,void 0,e,!0)):delete i[a]);if(a!==s)for(let e in a)(!t||!h(t,e))&&(delete a[e],l=!0)}l&&ot(e.attrs,`set`,``)}function Ra(e,t,n,r){let[i,a]=e.propsOptions,s=!1,c;if(t)for(let o in t){if(re(o))continue;let l=t[o],u;i&&h(i,u=oe(o))?!a||!a.includes(u)?n[u]=l:(c||={})[u]=l:wa(e.emitsOptions,o)||(!(o in r)||l!==r[o])&&(r[o]=l,s=!0)}if(a){let t=$t(n),r=c||o;for(let o=0;o<a.length;o++){let s=a[o];n[s]=za(i,t,s,r[s],e,!h(r,s))}}return s}function za(e,t,n,r,i,a){let o=e[n];if(o!=null){let e=h(o,`default`);if(e&&r===void 0){let e=o.default;if(o.type!==Function&&!o.skipFactory&&x(e)){let{propsDefaults:a}=i;if(n in a)r=a[n];else{let o=os(i);r=a[n]=e.call(null,t),o()}}else r=e;i.ce&&i.ce._setProp(n,r)}o[0]&&(a&&!e?r=!1:o[1]&&(r===``||r===k(n))&&(r=!0))}return r}var Ba=new WeakMap;function Va(e,t,n=!1){let r=n?Ba:t.propsCache,i=r.get(e);if(i)return i;let a=e.props,c={},l=[],u=!1;if(!x(e)){let r=e=>{u=!0;let[n,r]=Va(e,t,!0);f(c,n),r&&l.push(...r)};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}if(!a&&!u)return w(e)&&r.set(e,s),s;if(g(a))for(let e=0;e<a.length;e++){let t=oe(a[e]);Ha(t)&&(c[t]=o)}else if(a)for(let e in a){let t=oe(e);if(Ha(t)){let n=a[e],r=c[t]=g(n)||x(n)?{type:n}:f({},n),i=r.type,o=!1,s=!0;if(g(i))for(let e=0;e<i.length;++e){let t=i[e],n=x(t)&&t.name;if(n===`Boolean`){o=!0;break}else n===`String`&&(s=!1)}else o=x(i)&&i.name===`Boolean`;r[0]=o,r[1]=s,(o||h(r,`default`))&&l.push(t)}}let d=[c,l];return w(e)&&r.set(e,d),d}function Ha(e){return e[0]!==`$`&&!re(e)}var Ua=e=>e===`_`||e===`_ctx`||e===`$stable`,Wa=e=>g(e)?e.map(Jo):[Jo(e)],Ga=(e,t,n)=>{if(t._n)return t;let r=tr((...e)=>Wa(t(...e)),n);return r._c=!1,r},Ka=(e,t,n)=>{let r=e._ctx;for(let n in e){if(Ua(n))continue;let i=e[n];if(x(i))t[n]=Ga(n,i,r);else if(i!=null){let e=Wa(i);t[n]=()=>e}}},qa=(e,t)=>{let n=Wa(t);e.slots.default=()=>n},Ja=(e,t,n)=>{for(let r in t)(n||!Ua(r))&&(e[r]=t[r])},Ya=(e,t,n)=>{let r=e.slots=Pa();if(e.vnode.shapeFlag&32){let e=t._;e?(Ja(r,t,n),n&&A(r,`_`,e,!0)):Ka(t,r)}else t&&qa(e,t)},Xa=(e,t,n)=>{let{vnode:r,slots:i}=e,a=!0,s=o;if(r.shapeFlag&32){let e=t._;e?n&&e===1?a=!1:Ja(i,t,n):(a=!t.$stable,Ka(t,i)),s=t}else t&&(qa(e,t),s={default:1});if(a)for(let e in i)!Ua(e)&&s[e]==null&&delete i[e]},Za=bo;function Qa(e){return eo(e)}function $a(e){return eo(e,ni)}function eo(e,t){let n=j();n.__VUE__=!0;let{insert:r,remove:i,patchProp:a,createElement:l,createText:u,createComment:d,setText:f,setElementText:p,parentNode:m,nextSibling:h,setScopeId:g=c,insertStaticContent:_}=e,v=(e,t,n,r=null,i=null,a=null,o=void 0,s=null,c=!!t.dynamicChildren)=>{if(e===t)return;e&&!Lo(e,t)&&(r=N(e),fe(e,i,a,!0),e=null),t.patchFlag===-2&&(c=!1,t.dynamicChildren=null);let{type:l,ref:u,shapeFlag:d}=t;switch(l){case wo:y(e,t,n,r);break;case To:b(e,t,n,r);break;case Eo:e??x(t,n,r,o);break;case Co:ie(e,t,n,r,i,a,o,s,c);break;default:d&1?w(e,t,n,r,i,a,o,s,c):d&6?ae(e,t,n,r,i,a,o,s,c):(d&64||d&128)&&l.process(e,t,n,r,i,a,o,s,c,F)}u!=null&&i?Jr(u,e&&e.ref,a,t||e,!t):u==null&&e&&e.ref!=null&&Jr(e.ref,null,a,e,!0)},y=(e,t,n,i)=>{if(e==null)r(t.el=u(t.children),n,i);else{let n=t.el=e.el;t.children!==e.children&&f(n,t.children)}},b=(e,t,n,i)=>{e==null?r(t.el=d(t.children||``),n,i):t.el=e.el},x=(e,t,n,r)=>{[e.el,e.anchor]=_(e.children,t,n,r,e.el,e.anchor)},S=({el:e,anchor:t},n,i)=>{let a;for(;e&&e!==t;)a=h(e),r(e,n,i),e=a;r(t,n,i)},C=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=h(e),i(e),e=n;i(t)},w=(e,t,n,r,i,a,o,s,c)=>{if(t.type===`svg`?o=`svg`:t.type===`math`&&(o=`mathml`),e==null)T(t,n,r,i,a,o,s,c);else{let n=e.el&&e.el._isVueCE?e.el:null;try{n&&n._beginPatch(),te(e,t,i,a,o,s,c)}finally{n&&n._endPatch()}}},T=(e,t,n,i,o,s,c,u)=>{let d,f,{props:m,shapeFlag:h,transition:g,dirs:_}=e;if(d=e.el=l(e.type,s,m&&m.is,m),h&8?p(d,e.children):h&16&&ee(e.children,d,null,i,o,to(e,s),c,u),_&&rr(e,null,i,`created`),E(d,e,e.scopeId,c,i),m){for(let e in m)e!==`value`&&!re(e)&&a(d,e,null,m[e],s,i);`value`in m&&a(d,`value`,null,m.value,s),(f=m.onVnodeBeforeMount)&&Qo(f,i,e)}_&&rr(e,null,i,`beforeMount`);let v=ro(o,g);v&&g.beforeEnter(d),r(d,t,n),((f=m&&m.onVnodeMounted)||v||_)&&Za(()=>{try{f&&Qo(f,i,e),v&&g.enter(d),_&&rr(e,null,i,`mounted`)}finally{}},o)},E=(e,t,n,r,i)=>{if(n&&g(e,n),r)for(let t=0;t<r.length;t++)g(e,r[t]);if(i){let n=i.subTree;if(t===n||lo(n.type)&&(n.ssContent===t||n.ssFallback===t)){let t=i.vnode;E(e,t,t.scopeId,t.slotScopeIds,i.parent)}}},ee=(e,t,n,r,i,a,o,s,c=0)=>{for(let l=c;l<e.length;l++)v(null,e[l]=s?Yo(e[l]):Jo(e[l]),t,n,r,i,a,o,s)},te=(e,t,n,r,i,s,c)=>{let l=t.el=e.el,{patchFlag:u,dynamicChildren:d,dirs:f}=t;u|=e.patchFlag&16;let m=e.props||o,h=t.props||o,g;if(n&&no(n,!1),(g=h.onVnodeBeforeUpdate)&&Qo(g,n,t,e),f&&rr(t,e,n,`beforeUpdate`),n&&no(n,!0),(m.innerHTML&&h.innerHTML==null||m.textContent&&h.textContent==null)&&p(l,``),d?D(e.dynamicChildren,d,l,n,r,to(t,i),s):c||ce(e,t,l,null,n,r,to(t,i),s,!1),u>0){if(u&16)ne(l,m,h,n,i);else if(u&2&&m.class!==h.class&&a(l,`class`,null,h.class,i),u&4&&a(l,`style`,m.style,h.style,i),u&8){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let r=e[t],o=m[r],s=h[r];(s!==o||r===`value`)&&a(l,r,o,s,i,n)}}u&1&&e.children!==t.children&&p(l,t.children)}else !c&&d==null&&ne(l,m,h,n,i);((g=h.onVnodeUpdated)||f)&&Za(()=>{g&&Qo(g,n,t,e),f&&rr(t,e,n,`updated`)},r)},D=(e,t,n,r,i,a,o)=>{for(let s=0;s<t.length;s++){let c=e[s],l=t[s];v(c,l,c.el&&(c.type===Co||!Lo(c,l)||c.shapeFlag&198)?m(c.el):n,null,r,i,a,o,!0)}},ne=(e,t,n,r,i)=>{if(t!==n){if(t!==o)for(let o in t)!re(o)&&!(o in n)&&a(e,o,t[o],null,i,r);for(let o in n){if(re(o))continue;let s=n[o],c=t[o];s!==c&&o!==`value`&&a(e,o,c,s,i,r)}`value`in n&&a(e,`value`,t.value,n.value,i)}},ie=(e,t,n,i,a,o,s,c,l)=>{let d=t.el=e?e.el:u(``),f=t.anchor=e?e.anchor:u(``),{patchFlag:p,dynamicChildren:m,slotScopeIds:h}=t;h&&(c=c?c.concat(h):h),e==null?(r(d,n,i),r(f,n,i),ee(t.children||[],n,f,a,o,s,c,l)):p>0&&p&64&&m&&e.dynamicChildren&&e.dynamicChildren.length===m.length?(D(e.dynamicChildren,m,n,a,o,s,c),(t.key!=null||a&&t===a.subTree)&&io(e,t,!0)):ce(e,t,n,f,a,o,s,c,l)},ae=(e,t,n,r,i,a,o,s,c)=>{t.slotScopeIds=s,e==null?t.shapeFlag&512?i.ctx.activate(t,n,r,o,c):oe(t,n,r,i,a,o,c):O(e,t,c)},oe=(e,t,n,r,i,a,o)=>{let s=e.component=ts(e,r,i);if(ui(e)&&(s.ctx.renderer=F),us(s,!1,o),s.asyncDep){if(i&&i.registerDep(s,k,o),!e.el){let r=s.subTree=Vo(To);b(null,r,t,n),e.placeholder=r.el}}else k(s,e,t,n,i,a,o)},O=(e,t,n)=>{let r=t.component=e.component;if(ka(e,t,n))if(r.asyncDep&&!r.asyncResolved){se(r,t,n);return}else r.next=t,r.update();else t.el=e.el,r.vnode=t},k=(e,t,n,r,i,a,o)=>{let s=()=>{if(e.isMounted){let{next:t,bu:n,u:r,parent:s,vnode:c}=e;{let n=oo(e);if(n){t&&(t.el=c.el,se(e,t,o)),n.asyncDep.then(()=>{Za(()=>{e.isUnmounted||l()},i)});return}}let u=t,d;no(e,!1),t?(t.el=c.el,se(e,t,o)):t=c,n&&ue(n),(d=t.props&&t.props.onVnodeBeforeUpdate)&&Qo(d,s,t,c),no(e,!0);let f=Ta(e),p=e.subTree;e.subTree=f,v(p,f,m(p.el),N(p),e,i,a),t.el=f.el,u===null&&Ma(e,f.el),r&&Za(r,i),(d=t.props&&t.props.onVnodeUpdated)&&Za(()=>Qo(d,s,t,c),i)}else{let o,{el:s,props:c}=t,{bm:l,m:u,parent:d,root:f,type:p}=e,m=si(t);if(no(e,!1),l&&ue(l),!m&&(o=c&&c.onVnodeBeforeMount)&&Qo(o,d,t),no(e,!0),s&&ve){let t=()=>{e.subTree=Ta(e),ve(s,e.subTree,e,i,null)};m&&p.__asyncHydrate?p.__asyncHydrate(s,e,t):t()}else{f.ce&&f.ce._hasShadowRoot()&&f.ce._injectChildStyle(p,e.parent?e.parent.type:void 0);let o=e.subTree=Ta(e);v(null,o,n,r,e,i,a),t.el=o.el}if(u&&Za(u,i),!m&&(o=c&&c.onVnodeMounted)){let e=t;Za(()=>Qo(o,d,e),i)}(t.shapeFlag&256||d&&si(d.vnode)&&d.vnode.shapeFlag&256)&&e.a&&Za(e.a,i),e.isMounted=!0,t=n=r=null}};e.scope.on();let c=e.effect=new I(s);e.scope.off();let l=e.update=c.run.bind(c),u=e.job=c.runIfDirty.bind(c);u.i=e,u.id=e.uid,c.scheduler=()=>Hn(u),no(e,!0),l()},se=(e,t,n)=>{t.component=e;let r=e.vnode.props;e.vnode=t,e.next=null,La(e,t.props,r,n),Xa(e,t.children,n),Je(),Gn(e),Ye()},ce=(e,t,n,r,i,a,o,s,c=!1)=>{let l=e&&e.children,u=e?e.shapeFlag:0,d=t.children,{patchFlag:f,shapeFlag:m}=t;if(f>0){if(f&128){A(l,d,n,r,i,a,o,s,c);return}else if(f&256){le(l,d,n,r,i,a,o,s,c);return}}m&8?(u&16&&he(l,i,a),d!==l&&p(n,d)):u&16?m&16?A(l,d,n,r,i,a,o,s,c):he(l,i,a,!0):(u&8&&p(n,``),m&16&&ee(d,n,r,i,a,o,s,c))},le=(e,t,n,r,i,a,o,c,l)=>{e||=s,t||=s;let u=e.length,d=t.length,f=Math.min(u,d),p;for(p=0;p<f;p++){let r=t[p]=l?Yo(t[p]):Jo(t[p]);v(e[p],r,n,null,i,a,o,c,l)}u>d?he(e,i,a,!0,!1,f):ee(t,n,r,i,a,o,c,l,f)},A=(e,t,n,r,i,a,o,c,l)=>{let u=0,d=t.length,f=e.length-1,p=d-1;for(;u<=f&&u<=p;){let r=e[u],s=t[u]=l?Yo(t[u]):Jo(t[u]);if(Lo(r,s))v(r,s,n,null,i,a,o,c,l);else break;u++}for(;u<=f&&u<=p;){let r=e[f],s=t[p]=l?Yo(t[p]):Jo(t[p]);if(Lo(r,s))v(r,s,n,null,i,a,o,c,l);else break;f--,p--}if(u>f){if(u<=p){let e=p+1,s=e<d?t[e].el:r;for(;u<=p;)v(null,t[u]=l?Yo(t[u]):Jo(t[u]),n,s,i,a,o,c,l),u++}}else if(u>p)for(;u<=f;)fe(e[u],i,a,!0),u++;else{let m=u,h=u,g=new Map;for(u=h;u<=p;u++){let e=t[u]=l?Yo(t[u]):Jo(t[u]);e.key!=null&&g.set(e.key,u)}let _,y=0,b=p-h+1,x=!1,S=0,C=Array(b);for(u=0;u<b;u++)C[u]=0;for(u=m;u<=f;u++){let r=e[u];if(y>=b){fe(r,i,a,!0);continue}let s;if(r.key!=null)s=g.get(r.key);else for(_=h;_<=p;_++)if(C[_-h]===0&&Lo(r,t[_])){s=_;break}s===void 0?fe(r,i,a,!0):(C[s-h]=u+1,s>=S?S=s:x=!0,v(r,t[s],n,null,i,a,o,c,l),y++)}let w=x?ao(C):s;for(_=w.length-1,u=b-1;u>=0;u--){let e=h+u,s=t[e],f=t[e+1],p=e+1<d?f.el||co(f):r;C[u]===0?v(null,s,n,p,i,a,o,c,l):x&&(_<0||u!==w[_]?de(s,n,p,2):_--)}}},de=(e,t,n,a,o=null)=>{let{el:s,type:c,transition:l,children:u,shapeFlag:d}=e;if(d&6){de(e.component.subTree,t,n,a);return}if(d&128){e.suspense.move(t,n,a);return}if(d&64){c.move(e,t,n,F);return}if(c===Co){r(s,t,n);for(let e=0;e<u.length;e++)de(u[e],t,n,a);r(e.anchor,t,n);return}if(c===Eo){S(e,t,n);return}if(a!==2&&d&1&&l)if(a===0)l.beforeEnter(s),r(s,t,n),Za(()=>l.enter(s),o);else{let{leave:a,delayLeave:o,afterLeave:c}=l,u=()=>{e.ctx.isUnmounted?i(s):r(s,t,n)},d=()=>{s._isLeaving&&s[Or](!0),a(s,()=>{u(),c&&c()})};o?o(s,u,d):d()}else r(s,t,n)},fe=(e,t,n,r=!1,i=!1)=>{let{type:a,props:o,ref:s,children:c,dynamicChildren:l,shapeFlag:u,patchFlag:d,dirs:f,cacheIndex:p,memo:m}=e;if(d===-2&&(i=!1),s!=null&&(Je(),Jr(s,null,n,e,!0),Ye()),p!=null&&(t.renderCache[p]=void 0),u&256){t.ctx.deactivate(e);return}let h=u&1&&f,g=!si(e),_;if(g&&(_=o&&o.onVnodeBeforeUnmount)&&Qo(_,t,e),u&6)M(e.component,n,r);else{if(u&128){e.suspense.unmount(n,r);return}h&&rr(e,null,t,`beforeUnmount`),u&64?e.type.remove(e,t,n,F,r):l&&!l.hasOnce&&(a!==Co||d>0&&d&64)?he(l,t,n,!1,!0):(a===Co&&d&384||!i&&u&16)&&he(c,t,n),r&&pe(e)}let v=m!=null&&p==null;(g&&(_=o&&o.onVnodeUnmounted)||h||v)&&Za(()=>{_&&Qo(_,t,e),h&&rr(e,null,t,`unmounted`),v&&(e.el=null)},n)},pe=e=>{let{type:t,el:n,anchor:r,transition:a}=e;if(t===Co){me(n,r);return}if(t===Eo){C(e);return}let o=()=>{i(n),a&&!a.persisted&&a.afterLeave&&a.afterLeave()};if(e.shapeFlag&1&&a&&!a.persisted){let{leave:t,delayLeave:r}=a,i=()=>t(n,o);r?r(e.el,o,i):i()}else o()},me=(e,t)=>{let n;for(;e!==t;)n=h(e),i(e),e=n;i(t)},M=(e,t,n)=>{let{bum:r,scope:i,job:a,subTree:o,um:s,m:c,a:l}=e;so(c),so(l),r&&ue(r),i.stop(),a&&(a.flags|=8,fe(o,e,t,n)),s&&Za(s,t),Za(()=>{e.isUnmounted=!0},t)},he=(e,t,n,r=!1,i=!1,a=0)=>{for(let o=a;o<e.length;o++)fe(e[o],t,n,r,i)},N=e=>{if(e.shapeFlag&6)return N(e.component.subTree);if(e.shapeFlag&128)return e.suspense.next();let t=h(e.anchor||e.el),n=t&&t[gr];return n?h(n):t},ge=!1,P=(e,t,n)=>{let r;e==null?t._vnode&&(fe(t._vnode,null,null,!0),r=t._vnode.component):v(t._vnode||null,e,t,null,null,null,n),t._vnode=e,ge||=(ge=!0,Gn(r),Kn(),!1)},F={p:v,um:fe,m:de,r:pe,mt:oe,mc:ee,pc:ce,pbc:D,n:N,o:e},_e,ve;return t&&([_e,ve]=t(F)),{render:P,hydrate:_e,createApp:_a(P,_e)}}function to({type:e,props:t},n){return n===`svg`&&e===`foreignObject`||n===`mathml`&&e===`annotation-xml`&&t&&t.encoding&&t.encoding.includes(`html`)?void 0:n}function no({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function ro(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function io(e,t,n=!1){let r=e.children,i=t.children;if(g(r)&&g(i))for(let e=0;e<r.length;e++){let t=r[e],a=i[e];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=i[e]=Yo(i[e]),a.el=t.el),!n&&a.patchFlag!==-2&&io(t,a)),a.type===wo&&(a.patchFlag===-1&&(a=i[e]=Yo(a)),a.el=t.el),a.type===To&&!a.el&&(a.el=t.el)}}function ao(e){let t=e.slice(),n=[0],r,i,a,o,s,c=e.length;for(r=0;r<c;r++){let c=e[r];if(c!==0){if(i=n[n.length-1],e[i]<c){t[r]=i,n.push(r);continue}for(a=0,o=n.length-1;a<o;)s=a+o>>1,e[n[s]]<c?a=s+1:o=s;c<e[n[a]]&&(a>0&&(t[r]=n[a-1]),n[a]=r)}}for(a=n.length,o=n[a-1];a-- >0;)n[a]=o,o=t[o];return n}function oo(e){let t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:oo(t)}function so(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function co(e){if(e.placeholder)return e.placeholder;let t=e.component;return t?co(t.subTree):null}var lo=e=>e.__isSuspense,uo=0,fo={name:`Suspense`,__isSuspense:!0,process(e,t,n,r,i,a,o,s,c,l){if(e==null)mo(t,n,r,i,a,o,s,c,l);else{if(a&&a.deps>0&&!e.suspense.isInFallback){t.suspense=e.suspense,t.suspense.vnode=t,t.el=e.el;return}ho(e,t,n,r,i,o,s,c,l)}},hydrate:_o,normalize:vo};function po(e,t){let n=e.props&&e.props[t];x(n)&&n()}function mo(e,t,n,r,i,a,o,s,c){let{p:l,o:{createElement:u}}=c,d=u(`div`),f=e.suspense=go(e,i,r,t,d,n,a,o,s,c);l(null,f.pendingBranch=e.ssContent,d,null,r,f,a,o),f.deps>0?(po(e,`onPending`),po(e,`onFallback`),l(null,e.ssFallback,t,n,r,null,a,o),xo(f,e.ssFallback)):f.resolve(!1,!0)}function ho(e,t,n,r,i,a,o,s,{p:c,um:l,o:{createElement:u}}){let d=t.suspense=e.suspense;d.vnode=t,t.el=e.el;let f=t.ssContent,p=t.ssFallback,{activeBranch:m,pendingBranch:h,isInFallback:g,isHydrating:_}=d;if(h)d.pendingBranch=f,Lo(h,f)?(c(h,f,d.hiddenContainer,null,i,d,a,o,s),d.deps<=0?d.resolve():g&&(_||(c(m,p,n,r,i,null,a,o,s),xo(d,p)))):(d.pendingId=uo++,_?(d.isHydrating=!1,d.activeBranch=h):l(h,i,d),d.deps=0,d.effects.length=0,d.hiddenContainer=u(`div`),g?(c(null,f,d.hiddenContainer,null,i,d,a,o,s),d.deps<=0?d.resolve():(c(m,p,n,r,i,null,a,o,s),xo(d,p))):m&&Lo(m,f)?(c(m,f,n,r,i,d,a,o,s),d.resolve(!0)):(c(null,f,d.hiddenContainer,null,i,d,a,o,s),d.deps<=0&&d.resolve()));else if(m&&Lo(m,f))c(m,f,n,r,i,d,a,o,s),xo(d,f);else if(po(t,`onPending`),d.pendingBranch=f,f.shapeFlag&512?d.pendingId=f.component.suspenseId:d.pendingId=uo++,c(null,f,d.hiddenContainer,null,i,d,a,o,s),d.deps<=0)d.resolve();else{let{timeout:e,pendingId:t}=d;e>0?setTimeout(()=>{d.pendingId===t&&d.fallback(p)},e):e===0&&d.fallback(p)}}function go(e,t,n,r,i,a,o,s,c,l,u=!1){let{p:d,m:f,um:p,n:m,o:{parentNode:h,remove:g}}=l,_,v=So(e);v&&t&&t.pendingBranch&&(_=t.pendingId,t.deps++);let y=e.props?fe(e.props.timeout):void 0,b=a,x={vnode:e,parent:t,parentComponent:n,namespace:o,container:r,hiddenContainer:i,deps:0,pendingId:uo++,timeout:typeof y==`number`?y:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve(e=!1,n=!1){let{vnode:r,activeBranch:i,pendingBranch:o,pendingId:s,effects:c,parentComponent:l,container:u,isInFallback:d}=x,g=!1;x.isHydrating?x.isHydrating=!1:e||(g=i&&o.transition&&o.transition.mode===`out-in`,g&&(i.transition.afterLeave=()=>{s===x.pendingId&&(f(o,u,a===b?m(i):a,0),Wn(c),d&&r.ssFallback&&(r.ssFallback.el=null))}),i&&!x.isFallbackMountPending&&(h(i.el)===u&&(a=m(i)),p(i,l,x,!0),!g&&d&&r.ssFallback&&Za(()=>r.ssFallback.el=null,x)),g||f(o,u,a,0)),x.isFallbackMountPending=!1,xo(x,o),x.pendingBranch=null,x.isInFallback=!1;let y=x.parent,S=!1;for(;y;){if(y.pendingBranch){y.effects.push(...c),S=!0;break}y=y.parent}!S&&!g&&Wn(c),x.effects=[],v&&t&&t.pendingBranch&&_===t.pendingId&&(t.deps--,t.deps===0&&!n&&t.resolve()),po(r,`onResolve`)},fallback(e){if(!x.pendingBranch)return;let{vnode:t,activeBranch:n,parentComponent:r,container:i,namespace:a}=x;po(t,`onFallback`);let o=m(n),l=()=>{x.isFallbackMountPending=!1,x.isInFallback&&(d(null,e,i,o,r,null,a,s,c),xo(x,e))},u=e.transition&&e.transition.mode===`out-in`;u&&(x.isFallbackMountPending=!0,n.transition.afterLeave=l),x.isInFallback=!0,p(n,r,null,!0),u||l()},move(e,t,n){x.activeBranch&&f(x.activeBranch,e,t,n),x.container=e},next(){return x.activeBranch&&m(x.activeBranch)},registerDep(e,t,n){let r=!!x.pendingBranch;r&&x.deps++;let i=e.vnode.el;e.asyncDep.catch(t=>{jn(t,e,0)}).then(a=>{if(e.isUnmounted||x.isUnmounted||x.pendingId!==e.suspenseId)return;ss(),e.asyncResolved=!0;let{vnode:s}=e;fs(e,a,!1),i&&(s.el=i);let c=!i&&e.subTree.el;t(e,s,h(i||e.subTree.el),i?null:m(e.subTree),x,o,n),c&&(s.placeholder=null,g(c)),Ma(e,s.el),r&&--x.deps===0&&x.resolve()})},unmount(e,t){x.isUnmounted=!0,x.activeBranch&&p(x.activeBranch,n,e,t),x.pendingBranch&&p(x.pendingBranch,n,e,t)}};return x}function _o(e,t,n,r,i,a,o,s,c){let l=t.suspense=go(t,r,n,e.parentNode,document.createElement(`div`),null,i,a,o,s,!0),u=c(e,l.pendingBranch=t.ssContent,n,l,a,o);return l.deps===0&&l.resolve(!1,!0),u}function vo(e){let{shapeFlag:t,children:n}=e,r=t&32;e.ssContent=yo(r?n.default:n),e.ssFallback=r?yo(n.fallback):Vo(To)}function yo(e){let t;if(x(e)){let n=jo&&e._c;n&&(e._d=!1,ko()),e=e(),n&&(e._d=!0,t=Oo,Ao())}return g(e)&&(e=Ea(e)),e=Jo(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(t=>t!==e)),e}function bo(e,t){t&&t.pendingBranch?g(e)?t.effects.push(...e):t.effects.push(e):Wn(e)}function xo(e,t){e.activeBranch=t;let{vnode:n,parentComponent:r}=e,i=t.el;for(;!i&&t.component;)t=t.component.subTree,i=t.el;n.el=i,r&&r.subTree===n&&(r.vnode.el=i,Ma(r,i))}function So(e){let t=e.props&&e.props.suspensible;return t!=null&&t!==!1}var Co=Symbol.for(`v-fgt`),wo=Symbol.for(`v-txt`),To=Symbol.for(`v-cmt`),Eo=Symbol.for(`v-stc`),Do=[],Oo=null;function ko(e=!1){Do.push(Oo=e?null:[])}function Ao(){Do.pop(),Oo=Do[Do.length-1]||null}var jo=1;function Mo(e,t=!1){jo+=e,e<0&&Oo&&t&&(Oo.hasOnce=!0)}function No(e){return e.dynamicChildren=jo>0?Oo||s:null,Ao(),jo>0&&Oo&&Oo.push(e),e}function Po(e,t,n,r,i,a){return No(Bo(e,t,n,r,i,a,!0))}function Fo(e,t,n,r,i){return No(Vo(e,t,n,r,i,!0))}function Io(e){return e?e.__v_isVNode===!0:!1}function Lo(e,t){return e.type===t.type&&e.key===t.key}var Ro=({key:e})=>e??null,zo=({ref:e,ref_key:t,ref_for:n})=>(typeof e==`number`&&(e=``+e),e==null?null:S(e)||rn(e)||x(e)?{i:Yn,r:e,k:t,f:!!n}:e);function Bo(e,t=null,n=null,r=0,i=null,a=e===Co?0:1,o=!1,s=!1){let c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Ro(t),ref:t&&zo(t),scopeId:Xn,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:a,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:Yn};return s?(Xo(c,n),a&128&&e.normalize(c)):n&&(c.shapeFlag|=S(n)?8:16),jo>0&&!o&&Oo&&(c.patchFlag>0||a&6)&&c.patchFlag!==32&&Oo.push(c),c}var Vo=Ho;function Ho(e,t=null,n=null,r=0,i=null,a=!1){if((!e||e===Pi)&&(e=To),Io(e)){let r=Wo(e,t,!0);return n&&Xo(r,n),jo>0&&!a&&Oo&&(r.shapeFlag&6?Oo[Oo.indexOf(e)]=r:Oo.push(r)),r.patchFlag=-2,r}if(bs(e)&&(e=e.__vccOpts),t){t=Uo(t);let{class:e,style:n}=t;e&&!S(e)&&(t.class=P(e)),w(n)&&(Qt(n)&&!g(n)&&(n=f({},n)),t.style=me(n))}let o=S(e)?1:lo(e)?128:_r(e)?64:w(e)?4:x(e)?2:0;return Bo(e,t,n,r,i,o,a,!0)}function Uo(e){return e?Qt(e)||Fa(e)?f({},e):e:null}function Wo(e,t,n=!1,r=!1){let{props:i,ref:a,patchFlag:o,children:s,transition:c}=e,l=t?Zo(i||{},t):i,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&Ro(l),ref:t&&t.ref?n&&a?g(a)?a.concat(zo(t)):[a,zo(t)]:zo(t):a,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:s,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Co?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Wo(e.ssContent),ssFallback:e.ssFallback&&Wo(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&r&&Vr(u,c.clone(u)),u}function Go(e=` `,t=0){return Vo(wo,null,e,t)}function Ko(e,t){let n=Vo(Eo,null,e);return n.staticCount=t,n}function qo(e=``,t=!1){return t?(ko(),Fo(To,null,e)):Vo(To,null,e)}function Jo(e){return e==null||typeof e==`boolean`?Vo(To):g(e)?Vo(Co,null,e.slice()):Io(e)?Yo(e):Vo(wo,null,String(e))}function Yo(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Wo(e)}function Xo(e,t){let n=0,{shapeFlag:r}=e;if(t==null)t=null;else if(g(t))n=16;else if(typeof t==`object`)if(r&65){let n=t.default;n&&(n._c&&(n._d=!1),Xo(e,n()),n._c&&(n._d=!0));return}else{n=32;let r=t._;!r&&!Fa(t)?t._ctx=Yn:r===3&&Yn&&(Yn.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else x(t)?(t={default:t,_ctx:Yn},n=32):(t=String(t),r&64?(n=16,t=[Go(t)]):n=8);e.children=t,e.shapeFlag|=n}function Zo(...e){let t={};for(let n=0;n<e.length;n++){let r=e[n];for(let e in r)if(e===`class`)t.class!==r.class&&(t.class=P([t.class,r.class]));else if(e===`style`)t.style=me([t.style,r.style]);else if(u(e)){let n=t[e],i=r[e];i&&n!==i&&!(g(n)&&n.includes(i))?t[e]=n?[].concat(n,i):i:i==null&&n==null&&!d(e)&&(t[e]=i)}else e!==``&&(t[e]=r[e])}return t}function Qo(e,t,n,r=null){An(e,t,7,[n,r])}var $o=ha(),es=0;function ts(e,t,n){let r=e.type,i=(t?t.appContext:e.appContext)||$o,a={uid:es++,vnode:e,type:r,parent:t,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Oe(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(i.provides),ids:t?t.ids:[``,0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Va(r,i),emitsOptions:Ca(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,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 a.ctx={_:a},a.root=t?t.root:a,a.emit=xa.bind(null,a),e.ce&&e.ce(a),a}var ns=null,rs=()=>ns||Yn,is,as;{let e=j(),t=(t,n)=>{let r;return(r=e[t])||(r=e[t]=[]),r.push(n),e=>{r.length>1?r.forEach(t=>t(e)):r[0](e)}};is=t(`__VUE_INSTANCE_SETTERS__`,e=>ns=e),as=t(`__VUE_SSR_SETTERS__`,e=>ls=e)}var os=e=>{let t=ns;return is(e),e.scope.on(),()=>{e.scope.off(),is(t)}},ss=()=>{ns&&ns.scope.off(),is(null)};function cs(e){return e.vnode.shapeFlag&4}var ls=!1;function us(e,t=!1,n=!1){t&&as(t);let{props:r,children:i}=e.vnode,a=cs(e);Ia(e,r,a,t),Ya(e,i,n||t);let o=a?ds(e,t):void 0;return t&&as(!1),o}function ds(e,t){let n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,qi);let{setup:r}=n;if(r){Je();let n=e.setupContext=r.length>1?_s(e):null,i=os(e),a=kn(r,e,0,[e.props,n]),o=T(a);if(Ye(),i(),(o||e.sp)&&!si(e)&&Wr(e),o){if(a.then(ss,ss),t)return a.then(n=>{fs(e,n,t)}).catch(t=>{jn(t,e,0)});e.asyncDep=a}else fs(e,a,t)}else hs(e,t)}function fs(e,t,n){x(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:w(t)&&(e.setupState=pn(t)),hs(e,n)}var ps,ms;function hs(e,t,n){let r=e.type;if(!e.render){if(!t&&ps&&!r.render){let t=r.template||aa(e).template;if(t){let{isCustomElement:n,compilerOptions:i}=e.appContext.config,{delimiters:a,compilerOptions:o}=r;r.render=ps(t,f(f({isCustomElement:n,delimiters:a},i),o))}}e.render=r.render||c,ms&&ms(e)}{let t=os(e);Je();try{ta(e)}finally{Ye(),t()}}}var gs={get(e,t){return at(e,`get`,``),e[t]}};function _s(e){return{attrs:new Proxy(e.attrs,gs),slots:e.slots,emit:e.emit,expose:t=>{e.exposed=t||{}}}}function vs(e){return e.exposed?e.exposeProxy||=new Proxy(pn(en(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Gi)return Gi[n](e)},has(e,t){return t in e||t in Gi}}):e.proxy}function ys(e,t=!0){return x(e)?e.displayName||e.name:e.name||t&&e.__name}function bs(e){return x(e)&&`__vccOpts`in e}var xs=(e,t)=>Sn(e,t,ls);function Ss(e,t,n){try{Mo(-1);let r=arguments.length;return r===2?w(t)&&!g(t)?Io(t)?Vo(e,null,[t]):Vo(e,t):Vo(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&Io(n)&&(n=[n]),Vo(e,t,n))}finally{Mo(1)}}var Cs=`3.5.33`,ws=`modulepreload`,Ts=function(e,t){return new URL(e,t).href},Es={},Ds=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=Ts(t,n),t in Es)return;Es[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:ws,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Os=r({default:()=>Ks}),ks=function(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)},As=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),js=function(){function e(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(r=(s=o.next()).done)&&(n.push(s.value),!(t&&n.length===t));r=!0);}catch(e){i=!0,a=e}finally{try{!r&&o.return&&o.return()}finally{if(i)throw a}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw TypeError(`Invalid attempt to destructure non-iterable instance`)}}();String.prototype.startsWith=String.prototype.startsWith||function(e){return this.indexOf(e)===0},String.prototype.padStart=String.prototype.padStart||function(e,t){for(var n=this;n.length<e;)n=t+n;return n};var Ms={cb:`0f8ff`,tqw:`aebd7`,q:`-ffff`,qmrn:`7fffd4`,zr:`0ffff`,bg:`5f5dc`,bsq:`e4c4`,bck:`---`,nch:`ebcd`,b:`--ff`,bvt:`8a2be2`,brwn:`a52a2a`,brw:`deb887`,ctb:`5f9ea0`,hrt:`7fff-`,chcT:`d2691e`,cr:`7f50`,rnw:`6495ed`,crns:`8dc`,crms:`dc143c`,cn:`-ffff`,Db:`--8b`,Dcn:`-8b8b`,Dgnr:`b8860b`,Dgr:`a9a9a9`,Dgrn:`-64-`,Dkhk:`bdb76b`,Dmgn:`8b-8b`,Dvgr:`556b2f`,Drng:`8c-`,Drch:`9932cc`,Dr:`8b--`,Dsmn:`e9967a`,Dsgr:`8fbc8f`,DsTb:`483d8b`,DsTg:`2f4f4f`,Dtrq:`-ced1`,Dvt:`94-d3`,ppnk:`1493`,pskb:`-bfff`,mgr:`696969`,grb:`1e90ff`,rbrc:`b22222`,rwht:`af0`,stg:`228b22`,chs:`-ff`,gnsb:`dcdcdc`,st:`8f8ff`,g:`d7-`,gnr:`daa520`,gr:`808080`,grn:`-8-0`,grnw:`adff2f`,hnw:`0fff0`,htpn:`69b4`,nnr:`cd5c5c`,ng:`4b-82`,vr:`0`,khk:`0e68c`,vnr:`e6e6fa`,nrb:`0f5`,wngr:`7cfc-`,mnch:`acd`,Lb:`add8e6`,Lcr:`08080`,Lcn:`e0ffff`,Lgnr:`afad2`,Lgr:`d3d3d3`,Lgrn:`90ee90`,Lpnk:`b6c1`,Lsmn:`a07a`,Lsgr:`20b2aa`,Lskb:`87cefa`,LsTg:`778899`,Lstb:`b0c4de`,Lw:`e0`,m:`-ff-`,mgrn:`32cd32`,nn:`af0e6`,mgnt:`-ff`,mrn:`8--0`,mqm:`66cdaa`,mmb:`--cd`,mmrc:`ba55d3`,mmpr:`9370db`,msg:`3cb371`,mmsT:`7b68ee`,"":`-fa9a`,mtr:`48d1cc`,mmvt:`c71585`,mnLb:`191970`,ntc:`5fffa`,mstr:`e4e1`,mccs:`e4b5`,vjw:`dead`,nv:`--80`,c:`df5e6`,v:`808-0`,vrb:`6b8e23`,rng:`a5-`,rngr:`45-`,rch:`da70d6`,pgnr:`eee8aa`,pgrn:`98fb98`,ptrq:`afeeee`,pvtr:`db7093`,ppwh:`efd5`,pchp:`dab9`,pr:`cd853f`,pnk:`c0cb`,pm:`dda0dd`,pwrb:`b0e0e6`,prp:`8-080`,cc:`663399`,r:`--`,sbr:`bc8f8f`,rb:`4169e1`,sbrw:`8b4513`,smn:`a8072`,nbr:`4a460`,sgrn:`2e8b57`,ssh:`5ee`,snn:`a0522d`,svr:`c0c0c0`,skb:`87ceeb`,sTb:`6a5acd`,sTgr:`708090`,snw:`afa`,n:`-ff7f`,stb:`4682b4`,tn:`d2b48c`,t:`-8080`,thst:`d8bfd8`,tmT:`6347`,trqs:`40e0d0`,vt:`ee82ee`,whT:`5deb3`,wht:``,hts:`5f5f5`,w:`-`,wgrn:`9acd32`};function Ns(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return(t>0?e.toFixed(t).replace(/0+$/,``).replace(/\.$/,``):e.toString())||`0`}var Ps=function(){function e(t,n,r,i){ks(this,e);var a=this;function o(t){if(t.startsWith(`hsl`)){var n=js(t.match(/([\-\d\.e]+)/g).map(Number),4),r=n[0],i=n[1],o=n[2],s=n[3];s===void 0&&(s=1),r/=360,i/=100,o/=100,a.hsla=[r,i,o,s]}else if(t.startsWith(`rgb`)){var c=js(t.match(/([\-\d\.e]+)/g).map(Number),4),l=c[0],u=c[1],d=c[2],f=c[3];f===void 0&&(f=1),a.rgba=[l,u,d,f]}else t.startsWith(`#`)?a.rgba=e.hexToRgb(t):a.rgba=e.nameToRgb(t)||e.hexToRgb(t)}if(t!==void 0)if(Array.isArray(t))this.rgba=t;else if(r===void 0){var s=t&&``+t;s&&o(s.toLowerCase())}else this.rgba=[t,n,r,i===void 0?1:i]}return As(e,[{key:`printRGB`,value:function(e){var t=(e?this.rgba:this.rgba.slice(0,3)).map(function(e,t){return Ns(e,t===3?3:0)});return e?`rgba(`+t+`)`:`rgb(`+t+`)`}},{key:`printHSL`,value:function(e){var t=[360,100,100,1],n=[``,`%`,`%`,``],r=(e?this.hsla:this.hsla.slice(0,3)).map(function(e,r){return Ns(e*t[r],r===3?3:1)+n[r]});return e?`hsla(`+r+`)`:`hsl(`+r+`)`}},{key:`printHex`,value:function(e){var t=this.hex;return e?t:t.substring(0,7)}},{key:`rgba`,get:function(){if(this._rgba)return this._rgba;if(!this._hsla)throw Error(`No color is set`);return this._rgba=e.hslToRgb(this._hsla)},set:function(e){e.length===3&&(e[3]=1),this._rgba=e,this._hsla=null}},{key:`rgbString`,get:function(){return this.printRGB()}},{key:`rgbaString`,get:function(){return this.printRGB(!0)}},{key:`hsla`,get:function(){if(this._hsla)return this._hsla;if(!this._rgba)throw Error(`No color is set`);return this._hsla=e.rgbToHsl(this._rgba)},set:function(e){e.length===3&&(e[3]=1),this._hsla=e,this._rgba=null}},{key:`hslString`,get:function(){return this.printHSL()}},{key:`hslaString`,get:function(){return this.printHSL(!0)}},{key:`hex`,get:function(){return`#`+this.rgba.map(function(e,t){return t<3?e.toString(16):Math.round(e*255).toString(16)}).map(function(e){return e.padStart(2,`0`)}).join(``)},set:function(t){this.rgba=e.hexToRgb(t)}}],[{key:`hexToRgb`,value:function(e){var t=(e.startsWith(`#`)?e.slice(1):e).replace(/^(\w{3})$/,`$1F`).replace(/^(\w)(\w)(\w)(\w)$/,`$1$1$2$2$3$3$4$4`).replace(/^(\w{6})$/,`$1FF`);if(!t.match(/^([0-9a-fA-F]{8})$/))throw Error(`Unknown hex color; `+e);var n=t.match(/^(\w\w)(\w\w)(\w\w)(\w\w)$/).slice(1).map(function(e){return parseInt(e,16)});return n[3]/=255,n}},{key:`nameToRgb`,value:function(t){var n=Ms[t.toLowerCase().replace(`at`,`T`).replace(/[aeiouyldf]/g,``).replace(`ght`,`L`).replace(`rk`,`D`).slice(-5,4)];return n===void 0?n:e.hexToRgb(n.replace(/\-/g,`00`).padStart(6,`f`))}},{key:`rgbToHsl`,value:function(e){var t=js(e,4),n=t[0],r=t[1],i=t[2],a=t[3];n/=255,r/=255,i/=255;var o=Math.max(n,r,i),s=Math.min(n,r,i),c=void 0,l=void 0,u=(o+s)/2;if(o===s)c=l=0;else{var d=o-s;switch(l=u>.5?d/(2-o-s):d/(o+s),o){case n:c=(r-i)/d+(r<i?6:0);break;case r:c=(i-n)/d+2;break;case i:c=(n-r)/d+4;break}c/=6}return[c,l,u,a]}},{key:`hslToRgb`,value:function(e){var t=js(e,4),n=t[0],r=t[1],i=t[2],a=t[3],o=void 0,s=void 0,c=void 0;if(r===0)o=s=c=i;else{var l=function(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e},u=i<.5?i*(1+r):i+r-i*r,d=2*i-u;o=l(d,u,n+1/3),s=l(d,u,n),c=l(d,u,n-1/3)}var f=[o*255,s*255,c*255].map(Math.round);return f[3]=a,f}}]),e}(),Fs=function(){function e(){ks(this,e),this._events=[]}return As(e,[{key:`add`,value:function(e,t,n){e.addEventListener(t,n,!1),this._events.push({target:e,type:t,handler:n})}},{key:`remove`,value:function(t,n,r){this._events=this._events.filter(function(i){var a=!0;return t&&t!==i.target&&(a=!1),n&&n!==i.type&&(a=!1),r&&r!==i.handler&&(a=!1),a&&e._doRemove(i.target,i.type,i.handler),!a})}},{key:`destroy`,value:function(){this._events.forEach(function(t){return e._doRemove(t.target,t.type,t.handler)}),this._events=[]}}],[{key:`_doRemove`,value:function(e,t,n){e.removeEventListener(t,n,!1)}}]),e}();function Is(e){var t=document.createElement(`div`);return t.innerHTML=e,t.firstElementChild}function Ls(e,t,n){var r=!1;function i(e,t,n){return Math.max(t,Math.min(e,n))}function a(e,a,o){if(o&&(r=!0),r){e.preventDefault();var s=t.getBoundingClientRect(),c=s.width,l=s.height,u=a.clientX,d=a.clientY,f=i(u-s.left,0,c),p=i(d-s.top,0,l);n(f/c,p/l)}}function o(e,t){(e.buttons===void 0?e.which:e.buttons)===1?a(e,e,t):r=!1}function s(e,t){e.touches.length===1?a(e,e.touches[0],t):r=!1}e.add(t,`mousedown`,function(e){o(e,!0)}),e.add(t,`touchstart`,function(e){s(e,!0)}),e.add(window,`mousemove`,o),e.add(t,`touchmove`,s),e.add(window,`mouseup`,function(e){r=!1}),e.add(t,`touchend`,function(e){r=!1}),e.add(t,`touchcancel`,function(e){r=!1})}var Rs=`linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0 / 2em 2em,
|
|
3
|
+
`)&&(ai(e,0)||Zr(),e.textContent=t.children)}if(d){if(_||b||!o||f&48){let t=e.tagName.includes(`-`),i=e.namespaceURI.includes(`svg`)?`svg`:e.namespaceURI.includes(`MathML`)?`mathml`:void 0;for(let a in d)(_&&(a.endsWith(`value`)||a===`indeterminate`)||u(a)&&!re(a)||a[0]===`.`||t&&!re(a)||l&&l.includes(a))&&r(e,a,null,d[a],i,n)}else if(d.onClick)r(e,`onClick`,null,d.onClick,void 0,n);else if(f&4&&Jt(d.style))for(let e in d.style)d.style[e]}let x;(x=d&&d.onVnodeBeforeMount)&&Qo(x,n,t),h&&nr(t,null,n,`beforeMount`),((x=d&&d.onVnodeMounted)||h||c)&&bo(()=>{x&&Qo(x,n,t),c&&g.enter(e),h&&nr(t,null,n,`mounted`)},i)}return e.nextSibling},m=(e,t,r,o,s,l,u)=>{u||=!!t.dynamicChildren;let d=t.children,p=d.length,m=!1;for(let t=0;t<p;t++){let h=u?d[t]:d[t]=Jo(d[t]),g=h.type===wo;e?(g&&!u&&t+1<p&&Jo(d[t+1]).type===wo&&(c(i(e.data.slice(h.children.length)),r,a(e)),e.data=h.children),e=f(e,h,o,s,l,u)):g&&!h.children?c(h.el=i(``),r):(m||(m=!0,ai(r,1)||Zr()),n(null,h,r,null,o,s,ei(r),l))}return e},h=(e,t,n,r,i,s)=>{let{slotScopeIds:u}=t;u&&(i=i?i.concat(u):u);let d=o(e),f=m(a(e),t,d,n,r,i,s);return f&&ti(f)&&f.data===`]`?a(t.anchor=f):(Zr(),c(t.anchor=l(`]`),d,f),f)},g=(e,t,r,i,c,l)=>{if(si(e,t)||Zr(),t.el=null,l){let t=_(e);for(;;){let n=a(e);if(n&&n!==t)s(n);else break}}let u=a(e),d=o(e);return s(e),n(null,t,d,u,r,i,ei(d),c),r&&(r.vnode.el=t.el,Pa(r,t.el)),u},_=(e,t=`[`,n=`]`)=>{let r=0;for(;e;)if(e=a(e),e&&ti(e)&&(e.data===t&&r++,e.data===n)){if(r===0)return a(e);r--}return e},v=(e,t,n)=>{let r=t.parentNode;r&&r.replaceChild(e,t);let i=n;for(;i;)i.vnode.el===t&&(i.vnode.el=i.subTree.el=e),i=i.parent},y=e=>e.nodeType===1&&e.tagName===`TEMPLATE`;return[d,f]}var ri=`data-allow-mismatch`,ii={0:`text`,1:`children`,2:`class`,3:`style`,4:`attribute`};function ai(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(ri);)e=e.parentElement;return oi(e&&e.getAttribute(ri),t)}function oi(e,t){if(e==null)return!1;if(e===``)return!0;{let n=e.split(`,`);return t===0&&n.includes(`children`)?!0:n.includes(ii[t])}}function si(e,t){return ai(e.parentElement,1)||ci(e)||li(t)}function ci(e){return e.nodeType===1&&oi(e.getAttribute(ri),1)}function li({props:e}){let t=e&&e[ri];return typeof t==`string`&&oi(t,1)}j().requestIdleCallback,j().cancelIdleCallback;function ui(e,t){if(ti(e)&&e.data===`[`){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(ti(r))if(r.data===`]`){if(--n===0)break}else r.data===`[`&&n++;r=r.nextSibling}}else t(e)}var di=e=>!!e.type.__asyncLoader;function fi(e){x(e)&&(e={loader:e});let{loader:t,loadingComponent:n,errorComponent:r,delay:i=200,hydrate:a,timeout:o,suspensible:s=!0,onError:c}=e,l=null,u,d=0,f=()=>(d++,l=null,p()),p=()=>{let e;return l||(e=l=t().catch(e=>{if(e=e instanceof Error?e:Error(String(e)),c)return new Promise((t,n)=>{c(e,()=>t(f()),()=>n(e),d+1)});throw e}).then(t=>e!==l&&l?l:(t&&(t.__esModule||t[Symbol.toStringTag]===`Module`)&&(t=t.default),u=t,t)))};return Ur({name:`AsyncComponentWrapper`,__asyncLoader:p,__asyncHydrate(e,t,n){let r=e.isConnected,i=!1;(t.bu||=[]).push(()=>i=!0);let o=()=>{i||!e.parentNode||r&&!e.isConnected||n()},s=a?()=>{let n=a(o,t=>ui(e,t));n&&(t.bum||=[]).push(n)}:o;u?s():p().then(()=>!t.isUnmounted&&s())},get __asyncResolved(){return u},setup(){let e=ns;if(Wr(e),u)return()=>pi(u,e);let t=t=>{l=null,An(t,e,13,!r)};if(s&&e.suspense||ls)return p().then(t=>()=>pi(t,e)).catch(e=>(t(e),()=>r?Vo(r,{error:e}):null));let a=rn(!1),c=rn(),d=rn(!!i),f,m;return Ai(()=>{f!=null&&clearTimeout(f),m!=null&&clearTimeout(m)}),i&&(m=setTimeout(()=>{e.isUnmounted||(d.value=!1)},i)),o!=null&&(f=setTimeout(()=>{if(!e.isUnmounted&&!a.value&&!c.value){let e=Error(`Async component timed out after ${o}ms.`);t(e),c.value=e}},o)),p().then(()=>{e.isUnmounted||(a.value=!0,e.parent&&mi(e.parent.vnode)&&e.parent.update())}).catch(n=>{if(e.isUnmounted){l=null;return}t(n),c.value=n}),()=>{if(a.value&&u)return pi(u,e);if(c.value&&r)return Vo(r,{error:c.value});if(n&&!d.value)return pi(n,e)}}})}function pi(e,t){let{ref:n,props:r,children:i,ce:a}=t.vnode,o=Vo(e,r,i);return o.ref=n,o.ce=a,delete t.vnode.ce,o}var mi=e=>e.type.__isKeepAlive,hi={name:`KeepAlive`,__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){let n=rs(),r=n.ctx;if(!r.renderer)return()=>{let e=t.default&&t.default();return e&&e.length===1?e[0]:e};let i=new Map,a=new Set,o=null,s=n.suspense,{renderer:{p:c,m:l,um:u,o:{createElement:d}}}=r,f=d(`div`);r.activate=(e,t,n,r,i)=>{let a=e.component;l(e,t,n,0,s),c(a.vnode,e,t,n,a,s,r,e.slotScopeIds,i),Qa(()=>{a.isDeactivated=!1,a.a&&ue(a.a);let t=e.props&&e.props.onVnodeMounted;t&&Qo(t,a.parent,e)},s)},r.deactivate=e=>{let t=e.component;co(t.m),co(t.a),l(e,f,null,1,s),Qa(()=>{t.da&&ue(t.da);let n=e.props&&e.props.onVnodeUnmounted;n&&Qo(n,t.parent,e),t.isDeactivated=!0},s)};function p(e){xi(e),u(e,n,s,!0)}function m(e){i.forEach((t,n)=>{let r=ys(di(t)?t.type.__asyncResolved||{}:t.type);r&&!e(r)&&h(n)})}function h(e){let t=i.get(e);t&&(!o||!Lo(t,o))?p(t):o&&xi(o),i.delete(e),a.delete(e)}ur(()=>[e.include,e.exclude],([e,t])=>{e&&m(t=>gi(e,t)),t&&m(e=>!gi(t,e))},{flush:`post`,deep:!0});let g=null,_=()=>{g!=null&&(uo(n.subTree.type)?Qa(()=>{i.set(g,Si(n.subTree))},n.subTree.suspense):i.set(g,Si(n.subTree)))};return Ei(_),Oi(_),ki(()=>{i.forEach(e=>{let{subTree:t,suspense:r}=n,i=Si(t);if(e.type===i.type&&e.key===i.key){xi(i);let e=i.component.da;e&&Qa(e,r);return}p(e)})}),()=>{if(g=null,!t.default)return o=null;let n=t.default(),r=n[0];if(n.length>1)return o=null,n;if(!Io(r)||!(r.shapeFlag&4)&&!(r.shapeFlag&128))return o=null,r;let s=Si(r);if(s.type===To)return o=null,s;let c=s.type,l=ys(di(s)?s.type.__asyncResolved||{}:c),{include:u,exclude:d,max:f}=e;if(u&&(!l||!gi(u,l))||d&&l&&gi(d,l))return s.shapeFlag&=-257,o=s,r;let p=s.key==null?c:s.key,m=i.get(p);return s.el&&(s=Wo(s),r.shapeFlag&128&&(r.ssContent=s)),g=p,m?(s.el=m.el,s.component=m.component,s.transition&&Vr(s,s.transition),s.shapeFlag|=512,a.delete(p),a.add(p)):(a.add(p),f&&a.size>parseInt(f,10)&&h(a.values().next().value)),s.shapeFlag|=256,o=s,uo(r.type)?r:s}}};function gi(e,t){return g(e)?e.some(e=>gi(e,t)):S(e)?e.split(`,`).includes(t):b(e)?(e.lastIndex=0,e.test(t)):!1}function _i(e,t){yi(e,`a`,t)}function vi(e,t){yi(e,`da`,t)}function yi(e,t,n=ns){let r=e.__wdc||=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()};if(Ci(t,r,n),n){let e=n.parent;for(;e&&e.parent;)mi(e.parent.vnode)&&bi(r,t,n,e),e=e.parent}}function bi(e,t,n,r){let i=Ci(t,e,r,!0);Ai(()=>{p(r[t],i)},n)}function xi(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function Si(e){return e.shapeFlag&128?e.ssContent:e}function Ci(e,t,n=ns,r=!1){if(n){let i=n[e]||(n[e]=[]),a=t.__weh||=(...r)=>{Je();let i=os(n),a=kn(t,n,e,r);return i(),Ye(),a};return r?i.unshift(a):i.push(a),a}}var wi=e=>(t,n=ns)=>{(!ls||e===`sp`)&&Ci(e,(...e)=>t(...e),n)},Ti=wi(`bm`),Ei=wi(`m`),Di=wi(`bu`),Oi=wi(`u`),ki=wi(`bum`),Ai=wi(`um`),ji=wi(`sp`),Mi=wi(`rtg`),Ni=wi(`rtc`);function Pi(e,t=ns){Ci(`ec`,e,t)}var Fi=`components`,Ii=`directives`;function Li(e,t){return Vi(Fi,e,!0,t)||e}var Ri=Symbol.for(`v-ndc`);function zi(e){return S(e)?Vi(Fi,e,!1)||e:e||Ri}function Bi(e){return Vi(Ii,e)}function Vi(e,t,n=!0,r=!1){let i=Jn||ns;if(i){let n=i.type;if(e===Fi){let e=ys(n,!1);if(e&&(e===t||e===oe(t)||e===se(oe(t))))return n}let a=Hi(i[e]||n[e],t)||Hi(i.appContext[e],t);return!a&&r?n:a}}function Hi(e,t){return e&&(e[t]||e[oe(t)]||e[se(oe(t))])}function Ui(e,t,n,r){let i,a=n&&n[r],o=g(e);if(o||S(e)){let n=o&&Jt(e),r=!1,s=!1;n&&(r=!Xt(e),s=Yt(e),e=lt(e)),i=Array(e.length);for(let n=0,o=e.length;n<o;n++)i[n]=t(r?s?tn(en(e[n])):en(e[n]):e[n],n,void 0,a&&a[n])}else if(typeof e==`number`){i=Array(e);for(let n=0;n<e;n++)i[n]=t(n+1,n,void 0,a&&a[n])}else if(w(e))if(e[Symbol.iterator])i=Array.from(e,(e,n)=>t(e,n,void 0,a&&a[n]));else{let n=Object.keys(e);i=Array(n.length);for(let r=0,o=n.length;r<o;r++){let o=n[r];i[r]=t(e[o],o,r,a&&a[r])}}else i=[];return n&&(n[r]=i),i}function Wi(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(g(r))for(let t=0;t<r.length;t++)e[r[t].name]=r[t].fn;else r&&(e[r.name]=r.key?(...e)=>{let t=r.fn(...e);return t&&(t.key=r.key),t}:r.fn)}return e}function Gi(e,t,n={},r,i,a){if(Jn.ce||Jn.parent&&di(Jn.parent)&&Jn.parent.ce){let e=a!=null&&n.key==null?f({},n,{key:a}):n,i=Object.keys(e).length>0;return t!==`default`&&(e.name=t),ko(),Fo(Co,null,[Vo(`slot`,e,r&&r())],i?-2:64)}let o=e[t];o&&o._c&&(o._d=!1);let s=Do.length;ko();let c;try{let i=o&&Ki(o(n)),s=n.key||a||i&&i.key;c=Fo(Co,{key:(s&&!C(s)?s:`_${t}`)+(!i&&r?`_fb`:``)},i||(r?r():[]),i&&e._===1?64:-2)}catch(e){for(let e=Do.length;e>s;e--)Ao();throw e}finally{o&&o._c&&(o._d=!0)}return!i&&c.scopeId&&(c.slotScopeIds=[c.scopeId+`-s`]),c}function Ki(e){return e.some(e=>Io(e)?!(e.type===To||e.type===Co&&!Ki(e.children)):!0)?e:null}function qi(e,t){let n={};for(let r in e)n[t&&/[A-Z]/.test(r)?`on:${r}`:ce(r)]=e[r];return n}var Ji=e=>e?cs(e)?vs(e):Ji(e.parent):null,Yi=f(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=>Ji(e.parent),$root:e=>Ji(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>la(e),$forceUpdate:e=>e.f||=()=>{Vn(e.update)},$nextTick:e=>e.n||=zn.bind(e.proxy),$watch:e=>fr.bind(e)}),Xi=(e,t)=>e!==o&&!e.__isScriptSetup&&h(e,t),Zi={get({_:e},t){if(t===`__v_skip`)return!0;let{ctx:n,setupState:r,data:i,props:a,accessCache:s,type:c,appContext:l}=e;if(t[0]!==`$`){let e=s[t];if(e!==void 0)switch(e){case 1:return r[t];case 2:return i[t];case 4:return n[t];case 3:return a[t]}else if(Xi(r,t))return s[t]=1,r[t];else if(i!==o&&h(i,t))return s[t]=2,i[t];else if(h(a,t))return s[t]=3,a[t];else if(n!==o&&h(n,t))return s[t]=4,n[t];else ia&&(s[t]=0)}let u=Yi[t],d,f;if(u)return t===`$attrs`&&at(e.attrs,`get`,``),u(e);if((d=c.__cssModules)&&(d=d[t]))return d;if(n!==o&&h(n,t))return s[t]=4,n[t];if(f=l.config.globalProperties,h(f,t))return f[t]},set({_:e},t,n){let{data:r,setupState:i,ctx:a}=e;return Xi(i,t)?(i[t]=n,!0):r!==o&&h(r,t)?(r[t]=n,!0):h(e.props,t)||t[0]===`$`&&t.slice(1)in e?!1:(a[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:i,props:a,type:s}},c){let l;return!!(n[c]||e!==o&&c[0]!==`$`&&h(e,c)||Xi(t,c)||h(a,c)||h(r,c)||h(Yi,c)||h(i.config.globalProperties,c)||(l=s.__cssModules)&&l[c])},defineProperty(e,t,n){return n.get==null?h(n,`value`)&&this.set(e,t,n.value,null):e._.accessCache[t]=0,Reflect.defineProperty(e,t,n)}};function Qi(){return ea(`useSlots`).slots}function $i(){return ea(`useAttrs`).attrs}function ea(e){let t=rs();return t.setupContext||=_s(t)}function ta(e){return g(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}function na(e,t){return!e||!t?e||t:g(e)&&g(t)?e.concat(t):f({},ta(e),ta(t))}function ra(e){let t=rs(),n=ls,r=e();ss(),n&&as(!1);let i=()=>{os(t),n&&as(!0)},a=()=>{rs()!==t&&t.scope.off(),ss(),n&&as(!1)};return T(r)&&(r=r.catch(e=>{throw i(),Promise.resolve().then(()=>Promise.resolve().then(a)),e})),[r,()=>{i(),Promise.resolve().then(a)}]}var ia=!0;function aa(e){let t=la(e),n=e.proxy,r=e.ctx;ia=!1,t.beforeCreate&&sa(t.beforeCreate,e,`bc`);let{data:i,computed:a,methods:o,watch:s,provide:l,inject:u,created:d,beforeMount:f,mounted:p,beforeUpdate:m,updated:h,activated:_,deactivated:v,beforeDestroy:y,beforeUnmount:b,destroyed:S,unmounted:C,render:T,renderTracked:E,renderTriggered:ee,errorCaptured:te,serverPrefetch:D,expose:ne,inheritAttrs:re,components:ie,directives:ae,filters:oe}=t;if(u&&oa(u,r,null),o)for(let e in o){let t=o[e];x(t)&&(r[e]=t.bind(n))}if(i){let t=i.call(n,n);w(t)&&(e.data=Ut(t))}if(ia=!0,a)for(let e in a){let t=a[e],i=xs({get:x(t)?t.bind(n,n):x(t.get)?t.get.bind(n,n):c,set:!x(t)&&x(t.set)?t.set.bind(n):c});Object.defineProperty(r,e,{enumerable:!0,configurable:!0,get:()=>i.value,set:e=>i.value=e})}if(s)for(let e in s)ca(s[e],r,n,e);if(l){let e=x(l)?l.call(n):l;Reflect.ownKeys(e).forEach(t=>{rr(t,e[t])})}d&&sa(d,e,`c`);function O(e,t){g(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(O(Ti,f),O(Ei,p),O(Di,m),O(Oi,h),O(_i,_),O(vi,v),O(Pi,te),O(Ni,E),O(Mi,ee),O(ki,b),O(Ai,C),O(ji,D),g(ne))if(ne.length){let t=e.exposed||={};ne.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t,enumerable:!0})})}else e.exposed||={};T&&e.render===c&&(e.render=T),re!=null&&(e.inheritAttrs=re),ie&&(e.components=ie),ae&&(e.directives=ae),D&&Wr(e)}function oa(e,t,n=c){g(e)&&(e=ma(e));for(let n in e){let r=e[n],i;i=w(r)?`default`in r?ir(r.from||n,r.default,!0):ir(r.from||n):ir(r),nn(i)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>i.value,set:e=>i.value=e}):t[n]=i}}function sa(e,t,n){kn(g(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function ca(e,t,n,r){let i=r.includes(`.`)?pr(n,r):()=>n[r];if(S(e)){let n=t[e];x(n)&&ur(i,n)}else if(x(e))ur(i,e.bind(n));else if(w(e))if(g(e))e.forEach(e=>ca(e,t,n,r));else{let r=x(e.handler)?e.handler.bind(n):t[e.handler];x(r)&&ur(i,r,e)}}function la(e){let t=e.type,{mixins:n,extends:r}=t,{mixins:i,optionsCache:a,config:{optionMergeStrategies:o}}=e.appContext,s=a.get(t),c;return s?c=s:!i.length&&!n&&!r?c=t:(c={},i.length&&i.forEach(e=>ua(c,e,o,!0)),ua(c,t,o)),w(t)&&a.set(t,c),c}function ua(e,t,n,r=!1){let{mixins:i,extends:a}=t;a&&ua(e,a,n,!0),i&&i.forEach(t=>ua(e,t,n,!0));for(let i in t)if(!(r&&i===`expose`)){let r=da[i]||n&&n[i];e[i]=r?r(e[i],t[i]):t[i]}return e}var da={data:fa,props:_a,emits:_a,methods:ga,computed:ga,beforeCreate:ha,created:ha,beforeMount:ha,mounted:ha,beforeUpdate:ha,updated:ha,beforeDestroy:ha,beforeUnmount:ha,destroyed:ha,unmounted:ha,activated:ha,deactivated:ha,errorCaptured:ha,serverPrefetch:ha,components:ga,directives:ga,watch:va,provide:fa,inject:pa};function fa(e,t){return t?e?function(){return f(x(e)?e.call(this,this):e,x(t)?t.call(this,this):t)}:t:e}function pa(e,t){return ga(ma(e),ma(t))}function ma(e){if(g(e)){let t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function ha(e,t){return e?[...new Set([].concat(e,t))]:t}function ga(e,t){return e?f(Object.create(null),e,t):t}function _a(e,t){return e?g(e)&&g(t)?[...new Set([...e,...t])]:f(Object.create(null),ta(e),ta(t??{})):t}function va(e,t){if(!e)return t;if(!t)return e;let n=f(Object.create(null),e);for(let r in t)n[r]=ha(e[r],t[r]);return n}function ya(){return{app:null,config:{isNativeTag:l,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}var ba=0;function xa(e,t){return function(n,r=null){x(n)||(n=f({},n)),r!=null&&!w(r)&&(r=null);let i=ya(),a=new WeakSet,o=[],s=!1,c=i.app={_uid:ba++,_component:n,_props:r,_container:null,_context:i,_instance:null,version:Cs,get config(){return i.config},set config(e){},use(e,...t){return a.has(e)||(e&&x(e.install)?(a.add(e),e.install(c,...t)):x(e)&&(a.add(e),e(c,...t))),c},mixin(e){return i.mixins.includes(e)||i.mixins.push(e),c},component(e,t){return t?(i.components[e]=t,c):i.components[e]},directive(e,t){return t?(i.directives[e]=t,c):i.directives[e]},mount(a,o,l){if(!s){let u=c._ceVNode||Vo(n,r);return u.appContext=i,l===!0?l=`svg`:l===!1&&(l=void 0),o&&t?t(u,a):e(u,a,l),s=!0,c._container=a,a.__vue_app__=c,vs(u.component)}},onUnmount(e){o.push(e)},unmount(){s&&(kn(o,c._instance,16),e(null,c._container),delete c._container.__vue_app__)},provide(e,t){return i.provides[e]=t,c},runWithContext(e){let t=Sa;Sa=c;try{return e()}finally{Sa=t}}};return c}}var Sa=null;function Ca(e,t,n=o){let r=rs(),i=oe(t),a=k(t),s=wa(e,i),c=mn((s,c)=>{let l,u=o,d;return lr(()=>{let t=e[i];le(l,t)&&(l=t,c())}),{get(){return s(),n.get?n.get(l):l},set(e){let s=n.set?n.set(e):e;if(!le(s,l)&&!(u!==o&&le(e,u)))return;let f=r.vnode.props,p=!!(f&&(t in f||i in f||a in f)&&(`onUpdate:${t}`in f||`onUpdate:${i}`in f||`onUpdate:${a}`in f));p||(l=e,c()),r.emit(`update:${t}`,s),le(e,u)&&(le(e,s)&&!le(s,d)||p&&u!==o&&!le(s,l))&&c(),u=e,d=s}}});return c[Symbol.iterator]=()=>{let e=0;return{next(){return e<2?{value:e++?s||o:c,done:!1}:{done:!0}}}},c}var wa=(e,t)=>t===`modelValue`||t===`model-value`?e.modelModifiers:e[`${t}Modifiers`]||e[`${oe(t)}Modifiers`]||e[`${k(t)}Modifiers`];function Ta(e,t,...n){if(e.isUnmounted)return;let r=e.vnode.props||o,i=n,a=t.startsWith(`update:`),s=a&&wa(r,t.slice(7));s&&(s.trim&&(i=n.map(e=>S(e)?e.trim():e)),s.number&&(i=n.map(de)));let c,l=r[c=ce(t)]||r[c=ce(oe(t))];!l&&a&&(l=r[c=ce(k(t))]),l&&kn(l,e,6,i);let u=r[c+`Once`];if(u){if(!e.emitted)e.emitted={};else if(e.emitted[c])return;e.emitted[c]=!0,kn(u,e,6,i)}}var Ea=new WeakMap;function Da(e,t,n=!1){let r=n?Ea:t.emitsCache,i=r.get(e);if(i!==void 0)return i;let a=e.emits,o={},s=!1;if(!x(e)){let r=e=>{let n=Da(e,t,!0);n&&(s=!0,f(o,n))};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}return!a&&!s?(w(e)&&r.set(e,null),null):(g(a)?a.forEach(e=>o[e]=null):f(o,a),w(e)&&r.set(e,o),o)}function Oa(e,t){return!e||!u(t)?!1:(t=t.slice(2),t=t===`Once`?t:t.replace(/Once$/,``),h(e,t[0].toLowerCase()+t.slice(1))||h(e,k(t))||h(e,t))}function ka(e){let{type:t,vnode:n,proxy:r,withProxy:i,propsOptions:[a],slots:o,attrs:s,emit:c,render:l,renderCache:u,props:f,data:p,setupState:m,ctx:h,inheritAttrs:g}=e,_=Xn(e),v,y;try{if(n.shapeFlag&4){let e=i||r,t=e;v=Jo(l.call(t,e,u,f,m,p,h)),y=s}else{let e=t;v=Jo(e.length>1?e(f,{attrs:s,slots:o,emit:c}):e(f,null)),y=t.props?s:ja(s)}}catch(t){Do.length=0,An(t,e,1),v=Vo(To)}let b=v;if(y&&g!==!1){let e=Object.keys(y),{shapeFlag:t}=b;e.length&&t&7&&(a&&e.some(d)&&(y=eee(y,a)),b=Wo(b,y,!1,!0))}return n.dirs&&(b=Wo(b,null,!1,!0),b.dirs=b.dirs?b.dirs.concat(n.dirs):n.dirs),n.transition&&Vr(b,n.transition),v=b,Xn(_),v}function Aa(e,t=!0){let n;for(let t=0;t<e.length;t++){let r=e[t];if(Io(r)){if(r.type!==To||r.children===`v-if`){if(n)return;n=r}}else return}return n}var ja=e=>{let t;for(let n in e)(n===`class`||n===`style`||u(n))&&((t||={})[n]=e[n]);return t},eee=(e,t)=>{let n={};for(let r in e)(!d(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function tee(e,t,n){let{props:r,children:i,component:a}=e,{props:o,children:s,patchFlag:c}=t,l=a.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return r?Ma(r,o,l):!!o;if(c&8){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let n=e[t];if(Na(o,r,n)&&!Oa(l,n))return!0}}}else return(i||s)&&(!s||!s.$stable)?!0:r===o?!1:r?o?Ma(r,o,l):!0:!!o;return!1}function Ma(e,t,n){let r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let i=0;i<r.length;i++){let a=r[i];if(Na(t,e,a)&&!Oa(n,a))return!0}return!1}function Na(e,t,n){let r=e[n],i=t[n];return n===`style`&&w(r)&&w(i)?!xe(r,i):r!==i}function Pa({vnode:e,parent:t,suspense:n},r){for(;t;){let n=t.subTree;if(n.suspense&&n.suspense.activeBranch===e&&(n.suspense.vnode.el=n.el=r,e=n),n===e)(e=t.vnode).el=r,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=r)}var Fa={},Ia=()=>Object.create(Fa),La=e=>Object.getPrototypeOf(e)===Fa;function Ra(e,t,n,r=!1){let i={},a=Ia();e.propsDefaults=Object.create(null),Ba(e,t,i,a);for(let t in e.propsOptions[0])t in i||(i[t]=void 0);n?e.props=r?i:Wt(i):e.type.props?e.props=i:e.props=a,e.attrs=a}function za(e,t,n,r){let{props:i,attrs:a,vnode:{patchFlag:o}}=e,s=Qt(i),[c]=e.propsOptions,l=!1;if((r||o>0)&&!(o&16)){if(o&8){let n=e.vnode.dynamicProps;for(let r=0;r<n.length;r++){let o=n[r];if(Oa(e.emitsOptions,o))continue;let u=t[o];if(c)if(h(a,o))u!==a[o]&&(a[o]=u,l=!0);else{let t=oe(o);i[t]=Va(c,s,t,u,e,!1)}else u!==a[o]&&(a[o]=u,l=!0)}}}else{Ba(e,t,i,a)&&(l=!0);let r;for(let a in s)(!t||!h(t,a)&&((r=k(a))===a||!h(t,r)))&&(c?n&&(n[a]!==void 0||n[r]!==void 0)&&(i[a]=Va(c,s,a,void 0,e,!0)):delete i[a]);if(a!==s)for(let e in a)(!t||!h(t,e))&&(delete a[e],l=!0)}l&&ot(e.attrs,`set`,``)}function Ba(e,t,n,r){let[i,a]=e.propsOptions,s=!1,c;if(t)for(let o in t){if(re(o))continue;let l=t[o],u;i&&h(i,u=oe(o))?!a||!a.includes(u)?n[u]=l:(c||={})[u]=l:Oa(e.emitsOptions,o)||(!(o in r)||l!==r[o])&&(r[o]=l,s=!0)}if(a){let t=Qt(n),r=c||o;for(let o=0;o<a.length;o++){let s=a[o];n[s]=Va(i,t,s,r[s],e,!h(r,s))}}return s}function Va(e,t,n,r,i,a){let o=e[n];if(o!=null){let e=h(o,`default`);if(e&&r===void 0){let e=o.default;if(o.type!==Function&&!o.skipFactory&&x(e)){let{propsDefaults:a}=i;if(n in a)r=a[n];else{let o=os(i);r=a[n]=e.call(null,t),o()}}else r=e;i.ce&&i.ce._setProp(n,r)}o[0]&&(a&&!e?r=!1:o[1]&&(r===``||r===k(n))&&(r=!0))}return r}var Ha=new WeakMap;function Ua(e,t,n=!1){let r=n?Ha:t.propsCache,i=r.get(e);if(i)return i;let a=e.props,c={},l=[],u=!1;if(!x(e)){let r=e=>{u=!0;let[n,r]=Ua(e,t,!0);f(c,n),r&&l.push(...r)};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}if(!a&&!u)return w(e)&&r.set(e,s),s;if(g(a))for(let e=0;e<a.length;e++){let t=oe(a[e]);Wa(t)&&(c[t]=o)}else if(a)for(let e in a){let t=oe(e);if(Wa(t)){let n=a[e],r=c[t]=g(n)||x(n)?{type:n}:f({},n),i=r.type,o=!1,s=!0;if(g(i))for(let e=0;e<i.length;++e){let t=i[e],n=x(t)&&t.name;if(n===`Boolean`){o=!0;break}else n===`String`&&(s=!1)}else o=x(i)&&i.name===`Boolean`;r[0]=o,r[1]=s,(o||h(r,`default`))&&l.push(t)}}let d=[c,l];return w(e)&&r.set(e,d),d}function Wa(e){return e[0]!==`$`&&!re(e)}var Ga=e=>e===`_`||e===`_ctx`||e===`$stable`,Ka=e=>g(e)?e.map(Jo):[Jo(e)],qa=(e,t,n)=>{if(t._n)return t;let r=er((...e)=>Ka(t(...e)),n);return r._c=!1,r},Ja=(e,t,n)=>{let r=e._ctx;for(let n in e){if(Ga(n))continue;let i=e[n];if(x(i))t[n]=qa(n,i,r);else if(i!=null){let e=Ka(i);t[n]=()=>e}}},Ya=(e,t)=>{let n=Ka(t);e.slots.default=()=>n},Xa=(e,t,n)=>{for(let r in t)(n||!Ga(r))&&(e[r]=t[r])},Za=(e,t,n)=>{let r=e.slots=Ia();if(e.vnode.shapeFlag&32){let e=t._;e?(Xa(r,t,n),n&&A(r,`_`,e,!0)):Ja(t,r)}else t&&Ya(e,t)},nee=(e,t,n)=>{let{vnode:r,slots:i}=e,a=!0,s=o;if(r.shapeFlag&32){let e=t._;e?n&&e===1?a=!1:Xa(i,t,n):(a=!t.$stable,Ja(t,i)),s=t}else t&&(Ya(e,t),s={default:1});if(a)for(let e in i)!Ga(e)&&s[e]==null&&delete i[e]},Qa=bo;function $a(e){return to(e)}function eo(e){return to(e,ni)}function to(e,t){let n=j();n.__VUE__=!0;let{insert:r,remove:i,patchProp:a,createElement:l,createText:u,createComment:d,setText:f,setElementText:p,parentNode:m,nextSibling:h,setScopeId:g=c,insertStaticContent:_}=e,v=(e,t,n,r=null,i=null,a=null,o=void 0,s=null,c=!!t.dynamicChildren)=>{if(e===t)return;e&&!Lo(e,t)&&(r=N(e),fe(e,i,a,!0),e=null),t.patchFlag===-2&&(c=!1,t.dynamicChildren=null);let{type:l,ref:u,shapeFlag:d}=t;switch(l){case wo:y(e,t,n,r);break;case To:b(e,t,n,r);break;case Eo:e??x(t,n,r,o);break;case Co:ie(e,t,n,r,i,a,o,s,c);break;default:d&1?w(e,t,n,r,i,a,o,s,c):d&6?ae(e,t,n,r,i,a,o,s,c):(d&64||d&128)&&l.process(e,t,n,r,i,a,o,s,c,F)}u!=null&&i?Jr(u,e&&e.ref,a,t||e,!t):u==null&&e&&e.ref!=null&&Jr(e.ref,null,a,e,!0)},y=(e,t,n,i)=>{if(e==null)r(t.el=u(t.children),n,i);else{let n=t.el=e.el;t.children!==e.children&&f(n,t.children)}},b=(e,t,n,i)=>{e==null?r(t.el=d(t.children||``),n,i):t.el=e.el},x=(e,t,n,r)=>{[e.el,e.anchor]=_(e.children,t,n,r,e.el,e.anchor)},S=({el:e,anchor:t},n,i)=>{let a;for(;e&&e!==t;)a=h(e),r(e,n,i),e=a;r(t,n,i)},C=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=h(e),i(e),e=n;i(t)},w=(e,t,n,r,i,a,o,s,c)=>{if(t.type===`svg`?o=`svg`:t.type===`math`&&(o=`mathml`),e==null)T(t,n,r,i,a,o,s,c);else{let n=e.el&&e.el._isVueCE?e.el:null;try{n&&n._beginPatch(),te(e,t,i,a,o,s,c)}finally{n&&n._endPatch()}}},T=(e,t,n,i,o,s,c,u)=>{let d,f,{props:m,shapeFlag:h,transition:g,dirs:_}=e;if(d=e.el=l(e.type,s,m&&m.is,m),h&8?p(d,e.children):h&16&&ee(e.children,d,null,i,o,no(e,s),c,u),_&&nr(e,null,i,`created`),E(d,e,e.scopeId,c,i),m){for(let e in m)e!==`value`&&!re(e)&&a(d,e,null,m[e],s,i);`value`in m&&a(d,`value`,null,m.value,s),(f=m.onVnodeBeforeMount)&&Qo(f,i,e)}_&&nr(e,null,i,`beforeMount`);let v=io(o,g);v&&g.beforeEnter(d),r(d,t,n),((f=m&&m.onVnodeMounted)||v||_)&&Qa(()=>{try{f&&Qo(f,i,e),v&&g.enter(d),_&&nr(e,null,i,`mounted`)}finally{}},o)},E=(e,t,n,r,i)=>{if(n&&g(e,n),r)for(let t=0;t<r.length;t++)g(e,r[t]);if(i){let n=i.subTree;if(t===n||uo(n.type)&&(n.ssContent===t||n.ssFallback===t)){let t=i.vnode;E(e,t,t.scopeId,t.slotScopeIds,i.parent)}}},ee=(e,t,n,r,i,a,o,s,c=0)=>{for(let l=c;l<e.length;l++)v(null,e[l]=s?Yo(e[l]):Jo(e[l]),t,n,r,i,a,o,s)},te=(e,t,n,r,i,s,c)=>{let l=t.el=e.el,{patchFlag:u,dynamicChildren:d,dirs:f}=t;u|=e.patchFlag&16;let m=e.props||o,h=t.props||o,g;if(n&&ro(n,!1),(g=h.onVnodeBeforeUpdate)&&Qo(g,n,t,e),f&&nr(t,e,n,`beforeUpdate`),n&&ro(n,!0),d&&(!e.dynamicChildren||e.dynamicChildren.length!==d.length)&&(u=0,c=!1,d=null),(m.innerHTML&&h.innerHTML==null||m.textContent&&h.textContent==null)&&p(l,``),d?D(e.dynamicChildren,d,l,n,r,no(t,i),s):c||ce(e,t,l,null,n,r,no(t,i),s,!1),u>0){if(u&16)ne(l,m,h,n,i);else if(u&2&&m.class!==h.class&&a(l,`class`,null,h.class,i),u&4&&a(l,`style`,m.style,h.style,i),u&8){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let r=e[t],o=m[r],s=h[r];(s!==o||r===`value`)&&a(l,r,o,s,i,n)}}u&1&&e.children!==t.children&&p(l,t.children)}else !c&&d==null&&ne(l,m,h,n,i);((g=h.onVnodeUpdated)||f)&&Qa(()=>{g&&Qo(g,n,t,e),f&&nr(t,e,n,`updated`)},r)},D=(e,t,n,r,i,a,o)=>{for(let s=0;s<t.length;s++){let c=e[s],l=t[s];v(c,l,c.el&&(c.type===Co||!Lo(c,l)||c.shapeFlag&198)?m(c.el):n,null,r,i,a,o,!0)}},ne=(e,t,n,r,i)=>{if(t!==n){if(t!==o)for(let o in t)!re(o)&&!(o in n)&&a(e,o,t[o],null,i,r);for(let o in n){if(re(o))continue;let s=n[o],c=t[o];s!==c&&o!==`value`&&a(e,o,c,s,i,r)}`value`in n&&a(e,`value`,t.value,n.value,i)}},ie=(e,t,n,i,a,o,s,c,l)=>{let d=t.el=e?e.el:u(``),f=t.anchor=e?e.anchor:u(``),{patchFlag:p,dynamicChildren:m,slotScopeIds:h}=t;h&&(c=c?c.concat(h):h),e==null?(r(d,n,i),r(f,n,i),ee(t.children||[],n,f,a,o,s,c,l)):p>0&&p&64&&m&&e.dynamicChildren&&e.dynamicChildren.length===m.length?(D(e.dynamicChildren,m,n,a,o,s,c),(t.key!=null||a&&t===a.subTree)&&ao(e,t,!0)):ce(e,t,n,f,a,o,s,c,l)},ae=(e,t,n,r,i,a,o,s,c)=>{t.slotScopeIds=s,e==null?t.shapeFlag&512?i.ctx.activate(t,n,r,o,c):oe(t,n,r,i,a,o,c):O(e,t,c)},oe=(e,t,n,r,i,a,o)=>{let s=e.component=ts(e,r,i);if(mi(e)&&(s.ctx.renderer=F),us(s,!1,o),s.asyncDep){if(i&&i.registerDep(s,k,o),!e.el){let r=s.subTree=Vo(To);b(null,r,t,n),e.placeholder=r.el}}else k(s,e,t,n,i,a,o)},O=(e,t,n)=>{let r=t.component=e.component;if(tee(e,t,n))if(r.asyncDep&&!r.asyncResolved){se(r,t,n);return}else r.next=t,r.update();else t.el=e.el,r.vnode=t},k=(e,t,n,r,i,a,o)=>{let s=()=>{if(e.isMounted){let{next:t,bu:n,u:r,parent:s,vnode:c}=e;{let n=so(e);if(n){t&&(t.el=c.el,se(e,t,o)),n.asyncDep.then(()=>{Qa(()=>{e.isUnmounted||l()},i)});return}}let u=t,d;ro(e,!1),t?(t.el=c.el,se(e,t,o)):t=c,n&&ue(n),(d=t.props&&t.props.onVnodeBeforeUpdate)&&Qo(d,s,t,c),ro(e,!0);let f=ka(e),p=e.subTree;e.subTree=f,v(p,f,m(p.el),N(p),e,i,a),t.el=f.el,u===null&&Pa(e,f.el),r&&Qa(r,i),(d=t.props&&t.props.onVnodeUpdated)&&Qa(()=>Qo(d,s,t,c),i)}else{let o,{el:s,props:c}=t,{bm:l,m:u,parent:d,root:f,type:p}=e,m=di(t);if(ro(e,!1),l&&ue(l),!m&&(o=c&&c.onVnodeBeforeMount)&&Qo(o,d,t),ro(e,!0),s&&ve){let t=()=>{e.subTree=ka(e),ve(s,e.subTree,e,i,null)};m&&p.__asyncHydrate?p.__asyncHydrate(s,e,t):t()}else{f.ce&&f.ce._hasShadowRoot()&&f.ce._injectChildStyle(p,e.parent?e.parent.type:void 0);let o=e.subTree=ka(e);v(null,o,n,r,e,i,a),t.el=o.el}if(u&&Qa(u,i),!m&&(o=c&&c.onVnodeMounted)){let e=t;Qa(()=>Qo(o,d,e),i)}(t.shapeFlag&256||d&&di(d.vnode)&&d.vnode.shapeFlag&256)&&e.a&&Qa(e.a,i),e.isMounted=!0,t=n=r=null}};e.scope.on();let c=e.effect=new I(s);e.scope.off();let l=e.update=c.run.bind(c),u=e.job=c.runIfDirty.bind(c);u.i=e,u.id=e.uid,c.scheduler=()=>Vn(u),ro(e,!0),l()},se=(e,t,n)=>{t.component=e;let r=e.vnode.props;e.vnode=t,e.next=null,za(e,t.props,r,n),nee(e,t.children,n),Je(),Wn(e),Ye()},ce=(e,t,n,r,i,a,o,s,c=!1)=>{let l=e&&e.children,u=e?e.shapeFlag:0,d=t.children,{patchFlag:f,shapeFlag:m}=t;if(f>0){if(f&128){A(l,d,n,r,i,a,o,s,c);return}else if(f&256){le(l,d,n,r,i,a,o,s,c);return}}m&8?(u&16&&he(l,i,a),d!==l&&p(n,d)):u&16?m&16?A(l,d,n,r,i,a,o,s,c):he(l,i,a,!0):(u&8&&p(n,``),m&16&&ee(d,n,r,i,a,o,s,c))},le=(e,t,n,r,i,a,o,c,l)=>{e||=s,t||=s;let u=e.length,d=t.length,f=Math.min(u,d),p;for(p=0;p<f;p++){let r=t[p]=l?Yo(t[p]):Jo(t[p]);v(e[p],r,n,null,i,a,o,c,l)}u>d?he(e,i,a,!0,!1,f):ee(t,n,r,i,a,o,c,l,f)},A=(e,t,n,r,i,a,o,c,l)=>{let u=0,d=t.length,f=e.length-1,p=d-1;for(;u<=f&&u<=p;){let r=e[u],s=t[u]=l?Yo(t[u]):Jo(t[u]);if(Lo(r,s))v(r,s,n,null,i,a,o,c,l);else break;u++}for(;u<=f&&u<=p;){let r=e[f],s=t[p]=l?Yo(t[p]):Jo(t[p]);if(Lo(r,s))v(r,s,n,null,i,a,o,c,l);else break;f--,p--}if(u>f){if(u<=p){let e=p+1,s=e<d?t[e].el:r;for(;u<=p;)v(null,t[u]=l?Yo(t[u]):Jo(t[u]),n,s,i,a,o,c,l),u++}}else if(u>p)for(;u<=f;)fe(e[u],i,a,!0),u++;else{let m=u,h=u,g=new Map;for(u=h;u<=p;u++){let e=t[u]=l?Yo(t[u]):Jo(t[u]);e.key!=null&&g.set(e.key,u)}let _,y=0,b=p-h+1,x=!1,S=0,C=Array(b);for(u=0;u<b;u++)C[u]=0;for(u=m;u<=f;u++){let r=e[u];if(y>=b){fe(r,i,a,!0);continue}let s;if(r.key!=null)s=g.get(r.key);else for(_=h;_<=p;_++)if(C[_-h]===0&&Lo(r,t[_])){s=_;break}s===void 0?fe(r,i,a,!0):(C[s-h]=u+1,s>=S?S=s:x=!0,v(r,t[s],n,null,i,a,o,c,l),y++)}let w=x?oo(C):s;for(_=w.length-1,u=b-1;u>=0;u--){let e=h+u,s=t[e],f=t[e+1],p=e+1<d?f.el||lo(f):r;C[u]===0?v(null,s,n,p,i,a,o,c,l):x&&(_<0||u!==w[_]?de(s,n,p,2):_--)}}},de=(e,t,n,a,o=null)=>{let{el:s,type:c,transition:l,children:u,shapeFlag:d}=e;if(d&6){de(e.component.subTree,t,n,a);return}if(d&128){e.suspense.move(t,n,a);return}if(d&64){c.move(e,t,n,F);return}if(c===Co){r(s,t,n);for(let e=0;e<u.length;e++)de(u[e],t,n,a);r(e.anchor,t,n);return}if(c===Eo){S(e,t,n);return}if(a!==2&&d&1&&l)if(a===0)l.persisted&&!s[Or]?r(s,t,n):(l.beforeEnter(s),r(s,t,n),Qa(()=>l.enter(s),o));else{let{leave:a,delayLeave:o,afterLeave:c}=l,u=()=>{e.ctx.isUnmounted?i(s):r(s,t,n)},d=()=>{let e=s._isLeaving||!!s[Or];s._isLeaving&&s[Or](!0),l.persisted&&!e?u():a(s,()=>{u(),c&&c()})};o?o(s,u,d):d()}else r(s,t,n)},fe=(e,t,n,r=!1,i=!1)=>{let{type:a,props:o,ref:s,children:c,dynamicChildren:l,shapeFlag:u,patchFlag:d,dirs:f,cacheIndex:p,memo:m}=e;if(d===-2&&(i=!1),s!=null&&(Je(),Jr(s,null,n,e,!0),Ye()),p!=null&&(t.renderCache[p]=void 0),u&256){t.ctx.deactivate(e);return}let h=u&1&&f,g=!di(e),_;if(g&&(_=o&&o.onVnodeBeforeUnmount)&&Qo(_,t,e),u&6)M(e.component,n,r);else{if(u&128){e.suspense.unmount(n,r);return}h&&nr(e,null,t,`beforeUnmount`),u&64?e.type.remove(e,t,n,F,r):l&&!l.hasOnce&&(a!==Co||d>0&&d&64)?he(l,t,n,!1,!0):(a===Co&&d&384||!i&&u&16)&&he(c,t,n),r&&pe(e)}let v=m!=null&&p==null;(g&&(_=o&&o.onVnodeUnmounted)||h||v)&&Qa(()=>{_&&Qo(_,t,e),h&&nr(e,null,t,`unmounted`),v&&(e.el=null)},n)},pe=e=>{let{type:t,el:n,anchor:r,transition:a}=e;if(t===Co){me(n,r);return}if(t===Eo){C(e);return}let o=()=>{i(n),a&&!a.persisted&&a.afterLeave&&a.afterLeave()};if(e.shapeFlag&1&&a&&!a.persisted){let{leave:t,delayLeave:r}=a,i=()=>t(n,o);r?r(e.el,o,i):i()}else o()},me=(e,t)=>{let n;for(;e!==t;)n=h(e),i(e),e=n;i(t)},M=(e,t,n)=>{let{bum:r,scope:i,job:a,subTree:o,um:s,m:c,a:l}=e;co(c),co(l),r&&ue(r),i.stop(),a&&(a.flags|=8,fe(o,e,t,n)),s&&Qa(s,t),Qa(()=>{e.isUnmounted=!0},t)},he=(e,t,n,r=!1,i=!1,a=0)=>{for(let o=a;o<e.length;o++)fe(e[o],t,n,r,i)},N=e=>{if(e.shapeFlag&6)return N(e.component.subTree);if(e.shapeFlag&128)return e.suspense.next();let t=h(e.anchor||e.el),n=t&&t[hr];return n?h(n):t},ge=!1,P=(e,t,n)=>{let r;e==null?t._vnode&&(fe(t._vnode,null,null,!0),r=t._vnode.component):v(t._vnode||null,e,t,null,null,null,n),t._vnode=e,ge||=(ge=!0,Wn(r),Gn(),!1)},F={p:v,um:fe,m:de,r:pe,mt:oe,mc:ee,pc:ce,pbc:D,n:N,o:e},_e,ve;return t&&([_e,ve]=t(F)),{render:P,hydrate:_e,createApp:xa(P,_e)}}function no({type:e,props:t},n){return n===`svg`&&e===`foreignObject`||n===`mathml`&&e===`annotation-xml`&&t&&t.encoding&&t.encoding.includes(`html`)?void 0:n}function ro({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function io(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function ao(e,t,n=!1){let r=e.children,i=t.children;if(g(r)&&g(i))for(let e=0;e<r.length;e++){let t=r[e],a=i[e];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=i[e]=Yo(i[e]),a.el=t.el),!n&&a.patchFlag!==-2&&ao(t,a)),a.type===wo&&(a.patchFlag===-1&&(a=i[e]=Yo(a)),a.el=t.el),a.type===To&&!a.el&&(a.el=t.el)}}function oo(e){let t=e.slice(),n=[0],r,i,a,o,s,c=e.length;for(r=0;r<c;r++){let c=e[r];if(c!==0){if(i=n[n.length-1],e[i]<c){t[r]=i,n.push(r);continue}for(a=0,o=n.length-1;a<o;)s=a+o>>1,e[n[s]]<c?a=s+1:o=s;c<e[n[a]]&&(a>0&&(t[r]=n[a-1]),n[a]=r)}}for(a=n.length,o=n[a-1];a-- >0;)n[a]=o,o=t[o];return n}function so(e){let t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:so(t)}function co(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function lo(e){if(e.placeholder)return e.placeholder;let t=e.component;return t?lo(t.subTree):null}var uo=e=>e.__isSuspense,fo=0,po={name:`Suspense`,__isSuspense:!0,process(e,t,n,r,i,a,o,s,c,l){if(e==null)ree(t,n,r,i,a,o,s,c,l);else{if(a&&a.deps>0&&!e.suspense.isInFallback){t.suspense=e.suspense,t.suspense.vnode=t,t.el=e.el;return}ho(e,t,n,r,i,o,s,c,l)}},hydrate:_o,normalize:vo};function mo(e,t){let n=e.props&&e.props[t];x(n)&&n()}function ree(e,t,n,r,i,a,o,s,c){let{p:l,o:{createElement:u}}=c,d=u(`div`),f=e.suspense=go(e,i,r,t,d,n,a,o,s,c);l(null,f.pendingBranch=e.ssContent,d,null,r,f,a,o),f.deps>0?(mo(e,`onPending`),mo(e,`onFallback`),l(null,e.ssFallback,t,n,r,null,a,o),xo(f,e.ssFallback)):f.resolve(!1,!0)}function ho(e,t,n,r,i,a,o,s,{p:c,um:l,o:{createElement:u}}){let d=t.suspense=e.suspense;d.vnode=t,t.el=e.el;let f=t.ssContent,p=t.ssFallback,{activeBranch:m,pendingBranch:h,isInFallback:g,isHydrating:_}=d;if(h)d.pendingBranch=f,Lo(h,f)?(c(h,f,d.hiddenContainer,null,i,d,a,o,s),d.deps<=0?d.resolve():g&&(_||(c(m,p,n,r,i,null,a,o,s),xo(d,p)))):(d.pendingId=fo++,_?(d.isHydrating=!1,d.activeBranch=h):l(h,i,d),d.deps=0,d.effects.length=0,d.hiddenContainer=u(`div`),g?(c(null,f,d.hiddenContainer,null,i,d,a,o,s),d.deps<=0?d.resolve():(c(m,p,n,r,i,null,a,o,s),xo(d,p))):m&&Lo(m,f)?(c(m,f,n,r,i,d,a,o,s),d.resolve(!0)):(c(null,f,d.hiddenContainer,null,i,d,a,o,s),d.deps<=0&&d.resolve()));else if(m&&Lo(m,f))c(m,f,n,r,i,d,a,o,s),xo(d,f);else if(mo(t,`onPending`),d.pendingBranch=f,f.shapeFlag&512?d.pendingId=f.component.suspenseId:d.pendingId=fo++,c(null,f,d.hiddenContainer,null,i,d,a,o,s),d.deps<=0)d.resolve();else{let{timeout:e,pendingId:t}=d;e>0?setTimeout(()=>{d.pendingId===t&&d.fallback(p)},e):e===0&&d.fallback(p)}}function go(e,t,n,r,i,a,o,s,c,l,u=!1){let{p:d,m:f,um:p,n:m,o:{parentNode:h,remove:g}}=l,_,v=So(e);v&&t&&t.pendingBranch&&(_=t.pendingId,t.deps++);let y=e.props?fe(e.props.timeout):void 0,b=a,x={vnode:e,parent:t,parentComponent:n,namespace:o,container:r,hiddenContainer:i,deps:0,pendingId:fo++,timeout:typeof y==`number`?y:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve(e=!1,n=!1){let{vnode:r,activeBranch:i,pendingBranch:o,pendingId:s,effects:c,parentComponent:l,container:u,isInFallback:d}=x,g=!1;if(x.isHydrating)x.isHydrating=!1;else if(!e){g=i&&o.transition&&o.transition.mode===`out-in`;let e=!1;g&&(i.transition.afterLeave=()=>{s===x.pendingId&&(f(o,u,a===b&&!e?m(i):a,0),Un(c),d&&r.ssFallback&&(r.ssFallback.el=null))}),i&&!x.isFallbackMountPending&&(h(i.el)===u&&(a=m(i),e=!0),p(i,l,x,!0),!g&&d&&r.ssFallback&&Qa(()=>r.ssFallback.el=null,x)),g||f(o,u,a,0)}x.isFallbackMountPending=!1,xo(x,o),x.pendingBranch=null,x.isInFallback=!1;let y=x.parent,S=!1;for(;y;){if(y.pendingBranch){y.effects.push(...c),S=!0;break}y=y.parent}!S&&!g&&Un(c),x.effects=[],v&&t&&t.pendingBranch&&_===t.pendingId&&(t.deps--,t.deps===0&&!n&&t.resolve()),mo(r,`onResolve`)},fallback(e){if(!x.pendingBranch)return;let{vnode:t,activeBranch:n,parentComponent:r,container:i,namespace:a}=x;mo(t,`onFallback`);let o=m(n),l=()=>{x.isFallbackMountPending=!1,x.isInFallback&&(d(null,e,i,o,r,null,a,s,c),xo(x,e))},u=e.transition&&e.transition.mode===`out-in`;u&&(x.isFallbackMountPending=!0,n.transition.afterLeave=l),x.isInFallback=!0,p(n,r,null,!0),u||l()},move(e,t,n){x.activeBranch&&f(x.activeBranch,e,t,n),x.container=e},next(){return x.activeBranch&&m(x.activeBranch)},registerDep(e,t,n){let r=!!x.pendingBranch;r&&x.deps++;let i=e.vnode.el;e.asyncDep.catch(t=>{An(t,e,0)}).then(a=>{if(e.isUnmounted||x.isUnmounted||x.pendingId!==e.suspenseId)return;ss(),e.asyncResolved=!0;let{vnode:s}=e;fs(e,a,!1),i&&(s.el=i);let c=!i&&e.subTree.el;t(e,s,h(i||e.subTree.el),i?null:m(e.subTree),x,o,n),c&&(s.placeholder=null,g(c)),Pa(e,s.el),r&&--x.deps===0&&x.resolve()})},unmount(e,t){x.isUnmounted=!0,x.activeBranch&&p(x.activeBranch,n,e,t),x.pendingBranch&&p(x.pendingBranch,n,e,t)}};return x}function _o(e,t,n,r,i,a,o,s,c){let l=t.suspense=go(t,r,n,e.parentNode,document.createElement(`div`),null,i,a,o,s,!0),u=c(e,l.pendingBranch=t.ssContent,n,l,a,o);return l.deps===0&&l.resolve(!1,!0),u}function vo(e){let{shapeFlag:t,children:n}=e,r=t&32;e.ssContent=yo(r?n.default:n),e.ssFallback=r?yo(n.fallback):Vo(To)}function yo(e){let t;if(x(e)){let n=jo&&e._c;n&&(e._d=!1,ko()),e=e(),n&&(e._d=!0,t=Oo,Ao())}return g(e)&&(e=Aa(e)),e=Jo(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(t=>t!==e)),e}function bo(e,t){t&&t.pendingBranch?g(e)?t.effects.push(...e):t.effects.push(e):Un(e)}function xo(e,t){e.activeBranch=t;let{vnode:n,parentComponent:r}=e,i=t.el;for(;!i&&t.component;)t=t.component.subTree,i=t.el;n.el=i,r&&r.subTree===n&&(r.vnode.el=i,Pa(r,i))}function So(e){let t=e.props&&e.props.suspensible;return t!=null&&t!==!1}var Co=Symbol.for(`v-fgt`),wo=Symbol.for(`v-txt`),To=Symbol.for(`v-cmt`),Eo=Symbol.for(`v-stc`),Do=[],Oo=null;function ko(e=!1){Do.push(Oo=e?null:[])}function Ao(){Do.pop(),Oo=Do[Do.length-1]||null}var jo=1;function Mo(e,t=!1){jo+=e,e<0&&Oo&&t&&(Oo.hasOnce=!0)}function No(e){return e.dynamicChildren=jo>0?Oo||s:null,Ao(),jo>0&&Oo&&Oo.push(e),e}function Po(e,t,n,r,i,a){return No(Bo(e,t,n,r,i,a,!0))}function Fo(e,t,n,r,i){return No(Vo(e,t,n,r,i,!0))}function Io(e){return e?e.__v_isVNode===!0:!1}function Lo(e,t){return e.type===t.type&&e.key===t.key}var Ro=({key:e})=>e??null,zo=({ref:e,ref_key:t,ref_for:n})=>(typeof e==`number`&&(e=``+e),e==null?null:S(e)||nn(e)||x(e)?{i:Jn,r:e,k:t,f:!!n}:e);function Bo(e,t=null,n=null,r=0,i=null,a=e===Co?0:1,o=!1,s=!1){let c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Ro(t),ref:t&&zo(t),scopeId:Yn,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:a,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:Jn};return s?(Xo(c,n),a&128&&e.normalize(c)):n&&(c.shapeFlag|=S(n)?8:16),jo>0&&!o&&Oo&&(c.patchFlag>0||a&6)&&c.patchFlag!==32&&Oo.push(c),c}var Vo=Ho;function Ho(e,t=null,n=null,r=0,i=null,a=!1){if((!e||e===Ri)&&(e=To),Io(e)){let r=Wo(e,t,!0);return n&&Xo(r,n),jo>0&&!a&&Oo&&(r.shapeFlag&6?Oo[Oo.indexOf(e)]=r:Oo.push(r)),r.patchFlag=-2,r}if(bs(e)&&(e=e.__vccOpts),t){t=Uo(t);let{class:e,style:n}=t;e&&!S(e)&&(t.class=P(e)),w(n)&&(Zt(n)&&!g(n)&&(n=f({},n)),t.style=me(n))}let o=S(e)?1:uo(e)?128:gr(e)?64:w(e)?4:x(e)?2:0;return Bo(e,t,n,r,i,o,a,!0)}function Uo(e){return e?Zt(e)||La(e)?f({},e):e:null}function Wo(e,t,n=!1,r=!1){let{props:i,ref:a,patchFlag:o,children:s,transition:c}=e,l=t?Zo(i||{},t):i,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&Ro(l),ref:t&&t.ref?n&&a?g(a)?a.concat(zo(t)):[a,zo(t)]:zo(t):a,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:s,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Co?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Wo(e.ssContent),ssFallback:e.ssFallback&&Wo(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&r&&Vr(u,c.clone(u)),u}function Go(e=` `,t=0){return Vo(wo,null,e,t)}function Ko(e,t){let n=Vo(Eo,null,e);return n.staticCount=t,n}function qo(e=``,t=!1){return t?(ko(),Fo(To,null,e)):Vo(To,null,e)}function Jo(e){return e==null||typeof e==`boolean`?Vo(To):g(e)?Vo(Co,null,e.slice()):Io(e)?Yo(e):Vo(wo,null,String(e))}function Yo(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Wo(e)}function Xo(e,t){let n=0,{shapeFlag:r}=e;if(t==null)t=null;else if(g(t))n=16;else if(typeof t==`object`)if(r&65){let n=t.default;n&&(n._c&&(n._d=!1),Xo(e,n()),n._c&&(n._d=!0));return}else{n=32;let r=t._;!r&&!La(t)?t._ctx=Jn:r===3&&Jn&&(Jn.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(x(t)){if(r&65){Xo(e,{default:t});return}t={default:t,_ctx:Jn},n=32}else t=String(t),r&64?(n=16,t=[Go(t)]):n=8;e.children=t,e.shapeFlag|=n}function Zo(...e){let t={};for(let n=0;n<e.length;n++){let r=e[n];for(let e in r)if(e===`class`)t.class!==r.class&&(t.class=P([t.class,r.class]));else if(e===`style`)t.style=me([t.style,r.style]);else if(u(e)){let n=t[e],i=r[e];i&&n!==i&&!(g(n)&&n.includes(i))?t[e]=n?[].concat(n,i):i:i==null&&n==null&&!d(e)&&(t[e]=i)}else e!==``&&(t[e]=r[e])}return t}function Qo(e,t,n,r=null){kn(e,t,7,[n,r])}var $o=ya(),es=0;function ts(e,t,n){let r=e.type,i=(t?t.appContext:e.appContext)||$o,a={uid:es++,vnode:e,type:r,parent:t,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Oe(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(i.provides),ids:t?t.ids:[``,0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Ua(r,i),emitsOptions:Da(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,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 a.ctx={_:a},a.root=t?t.root:a,a.emit=Ta.bind(null,a),e.ce&&e.ce(a),a}var ns=null,rs=()=>ns||Jn,is,as;{let e=j(),t=(t,n)=>{let r;return(r=e[t])||(r=e[t]=[]),r.push(n),e=>{r.length>1?r.forEach(t=>t(e)):r[0](e)}};is=t(`__VUE_INSTANCE_SETTERS__`,e=>ns=e),as=t(`__VUE_SSR_SETTERS__`,e=>ls=e)}var os=e=>{let t=ns;return is(e),e.scope.on(),()=>{e.scope.off(),is(t)}},ss=()=>{ns&&ns.scope.off(),is(null)};function cs(e){return e.vnode.shapeFlag&4}var ls=!1;function us(e,t=!1,n=!1){t&&as(t);let{props:r,children:i}=e.vnode,a=cs(e);Ra(e,r,a,t),Za(e,i,n||t);let o=a?ds(e,t):void 0;return t&&as(!1),o}function ds(e,t){let n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Zi);let{setup:r}=n;if(r){Je();let n=e.setupContext=r.length>1?_s(e):null,i=os(e),a=On(r,e,0,[e.props,n]),o=T(a);if(Ye(),i(),(o||e.sp)&&!di(e)&&Wr(e),o){if(a.then(ss,ss),t)return a.then(n=>{fs(e,n,t)}).catch(t=>{An(t,e,0)});e.asyncDep=a}else fs(e,a,t)}else hs(e,t)}function fs(e,t,n){x(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:w(t)&&(e.setupState=fn(t)),hs(e,n)}var ps,ms;function hs(e,t,n){let r=e.type;if(!e.render){if(!t&&ps&&!r.render){let t=r.template||la(e).template;if(t){let{isCustomElement:n,compilerOptions:i}=e.appContext.config,{delimiters:a,compilerOptions:o}=r;r.render=ps(t,f(f({isCustomElement:n,delimiters:a},i),o))}}e.render=r.render||c,ms&&ms(e)}{let t=os(e);Je();try{aa(e)}finally{Ye(),t()}}}var gs={get(e,t){return at(e,`get`,``),e[t]}};function _s(e){return{attrs:new Proxy(e.attrs,gs),slots:e.slots,emit:e.emit,expose:t=>{e.exposed=t||{}}}}function vs(e){return e.exposed?e.exposeProxy||=new Proxy(fn($t(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Yi)return Yi[n](e)},has(e,t){return t in e||t in Yi}}):e.proxy}function ys(e,t=!0){return x(e)?e.displayName||e.name:e.name||t&&e.__name}function bs(e){return x(e)&&`__vccOpts`in e}var xs=(e,t)=>xn(e,t,ls);function Ss(e,t,n){try{Mo(-1);let r=arguments.length;return r===2?w(t)&&!g(t)?Io(t)?Vo(e,null,[t]):Vo(e,t):Vo(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&Io(n)&&(n=[n]),Vo(e,t,n))}finally{Mo(1)}}var Cs=`3.5.40`,ws=`modulepreload`,Ts=function(e,t){return new URL(e,t).href},Es={},Ds=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=Ts(t,n),t in Es)return;Es[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:ws,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Os=r({default:()=>Ks}),ks=function(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)},As=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),js=function(){function e(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(r=(s=o.next()).done)&&(n.push(s.value),!(t&&n.length===t));r=!0);}catch(e){i=!0,a=e}finally{try{!r&&o.return&&o.return()}finally{if(i)throw a}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw TypeError(`Invalid attempt to destructure non-iterable instance`)}}();String.prototype.startsWith=String.prototype.startsWith||function(e){return this.indexOf(e)===0},String.prototype.padStart=String.prototype.padStart||function(e,t){for(var n=this;n.length<e;)n=t+n;return n};var Ms={cb:`0f8ff`,tqw:`aebd7`,q:`-ffff`,qmrn:`7fffd4`,zr:`0ffff`,bg:`5f5dc`,bsq:`e4c4`,bck:`---`,nch:`ebcd`,b:`--ff`,bvt:`8a2be2`,brwn:`a52a2a`,brw:`deb887`,ctb:`5f9ea0`,hrt:`7fff-`,chcT:`d2691e`,cr:`7f50`,rnw:`6495ed`,crns:`8dc`,crms:`dc143c`,cn:`-ffff`,Db:`--8b`,Dcn:`-8b8b`,Dgnr:`b8860b`,Dgr:`a9a9a9`,Dgrn:`-64-`,Dkhk:`bdb76b`,Dmgn:`8b-8b`,Dvgr:`556b2f`,Drng:`8c-`,Drch:`9932cc`,Dr:`8b--`,Dsmn:`e9967a`,Dsgr:`8fbc8f`,DsTb:`483d8b`,DsTg:`2f4f4f`,Dtrq:`-ced1`,Dvt:`94-d3`,ppnk:`1493`,pskb:`-bfff`,mgr:`696969`,grb:`1e90ff`,rbrc:`b22222`,rwht:`af0`,stg:`228b22`,chs:`-ff`,gnsb:`dcdcdc`,st:`8f8ff`,g:`d7-`,gnr:`daa520`,gr:`808080`,grn:`-8-0`,grnw:`adff2f`,hnw:`0fff0`,htpn:`69b4`,nnr:`cd5c5c`,ng:`4b-82`,vr:`0`,khk:`0e68c`,vnr:`e6e6fa`,nrb:`0f5`,wngr:`7cfc-`,mnch:`acd`,Lb:`add8e6`,Lcr:`08080`,Lcn:`e0ffff`,Lgnr:`afad2`,Lgr:`d3d3d3`,Lgrn:`90ee90`,Lpnk:`b6c1`,Lsmn:`a07a`,Lsgr:`20b2aa`,Lskb:`87cefa`,LsTg:`778899`,Lstb:`b0c4de`,Lw:`e0`,m:`-ff-`,mgrn:`32cd32`,nn:`af0e6`,mgnt:`-ff`,mrn:`8--0`,mqm:`66cdaa`,mmb:`--cd`,mmrc:`ba55d3`,mmpr:`9370db`,msg:`3cb371`,mmsT:`7b68ee`,"":`-fa9a`,mtr:`48d1cc`,mmvt:`c71585`,mnLb:`191970`,ntc:`5fffa`,mstr:`e4e1`,mccs:`e4b5`,vjw:`dead`,nv:`--80`,c:`df5e6`,v:`808-0`,vrb:`6b8e23`,rng:`a5-`,rngr:`45-`,rch:`da70d6`,pgnr:`eee8aa`,pgrn:`98fb98`,ptrq:`afeeee`,pvtr:`db7093`,ppwh:`efd5`,pchp:`dab9`,pr:`cd853f`,pnk:`c0cb`,pm:`dda0dd`,pwrb:`b0e0e6`,prp:`8-080`,cc:`663399`,r:`--`,sbr:`bc8f8f`,rb:`4169e1`,sbrw:`8b4513`,smn:`a8072`,nbr:`4a460`,sgrn:`2e8b57`,ssh:`5ee`,snn:`a0522d`,svr:`c0c0c0`,skb:`87ceeb`,sTb:`6a5acd`,sTgr:`708090`,snw:`afa`,n:`-ff7f`,stb:`4682b4`,tn:`d2b48c`,t:`-8080`,thst:`d8bfd8`,tmT:`6347`,trqs:`40e0d0`,vt:`ee82ee`,whT:`5deb3`,wht:``,hts:`5f5f5`,w:`-`,wgrn:`9acd32`};function Ns(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return(t>0?e.toFixed(t).replace(/0+$/,``).replace(/\.$/,``):e.toString())||`0`}var Ps=function(){function e(t,n,r,i){ks(this,e);var a=this;function o(t){if(t.startsWith(`hsl`)){var n=js(t.match(/([\-\d\.e]+)/g).map(Number),4),r=n[0],i=n[1],o=n[2],s=n[3];s===void 0&&(s=1),r/=360,i/=100,o/=100,a.hsla=[r,i,o,s]}else if(t.startsWith(`rgb`)){var c=js(t.match(/([\-\d\.e]+)/g).map(Number),4),l=c[0],u=c[1],d=c[2],f=c[3];f===void 0&&(f=1),a.rgba=[l,u,d,f]}else t.startsWith(`#`)?a.rgba=e.hexToRgb(t):a.rgba=e.nameToRgb(t)||e.hexToRgb(t)}if(t!==void 0)if(Array.isArray(t))this.rgba=t;else if(r===void 0){var s=t&&``+t;s&&o(s.toLowerCase())}else this.rgba=[t,n,r,i===void 0?1:i]}return As(e,[{key:`printRGB`,value:function(e){var t=(e?this.rgba:this.rgba.slice(0,3)).map(function(e,t){return Ns(e,t===3?3:0)});return e?`rgba(`+t+`)`:`rgb(`+t+`)`}},{key:`printHSL`,value:function(e){var t=[360,100,100,1],n=[``,`%`,`%`,``],r=(e?this.hsla:this.hsla.slice(0,3)).map(function(e,r){return Ns(e*t[r],r===3?3:1)+n[r]});return e?`hsla(`+r+`)`:`hsl(`+r+`)`}},{key:`printHex`,value:function(e){var t=this.hex;return e?t:t.substring(0,7)}},{key:`rgba`,get:function(){if(this._rgba)return this._rgba;if(!this._hsla)throw Error(`No color is set`);return this._rgba=e.hslToRgb(this._hsla)},set:function(e){e.length===3&&(e[3]=1),this._rgba=e,this._hsla=null}},{key:`rgbString`,get:function(){return this.printRGB()}},{key:`rgbaString`,get:function(){return this.printRGB(!0)}},{key:`hsla`,get:function(){if(this._hsla)return this._hsla;if(!this._rgba)throw Error(`No color is set`);return this._hsla=e.rgbToHsl(this._rgba)},set:function(e){e.length===3&&(e[3]=1),this._hsla=e,this._rgba=null}},{key:`hslString`,get:function(){return this.printHSL()}},{key:`hslaString`,get:function(){return this.printHSL(!0)}},{key:`hex`,get:function(){return`#`+this.rgba.map(function(e,t){return t<3?e.toString(16):Math.round(e*255).toString(16)}).map(function(e){return e.padStart(2,`0`)}).join(``)},set:function(t){this.rgba=e.hexToRgb(t)}}],[{key:`hexToRgb`,value:function(e){var t=(e.startsWith(`#`)?e.slice(1):e).replace(/^(\w{3})$/,`$1F`).replace(/^(\w)(\w)(\w)(\w)$/,`$1$1$2$2$3$3$4$4`).replace(/^(\w{6})$/,`$1FF`);if(!t.match(/^([0-9a-fA-F]{8})$/))throw Error(`Unknown hex color; `+e);var n=t.match(/^(\w\w)(\w\w)(\w\w)(\w\w)$/).slice(1).map(function(e){return parseInt(e,16)});return n[3]/=255,n}},{key:`nameToRgb`,value:function(t){var n=Ms[t.toLowerCase().replace(`at`,`T`).replace(/[aeiouyldf]/g,``).replace(`ght`,`L`).replace(`rk`,`D`).slice(-5,4)];return n===void 0?n:e.hexToRgb(n.replace(/\-/g,`00`).padStart(6,`f`))}},{key:`rgbToHsl`,value:function(e){var t=js(e,4),n=t[0],r=t[1],i=t[2],a=t[3];n/=255,r/=255,i/=255;var o=Math.max(n,r,i),s=Math.min(n,r,i),c=void 0,l=void 0,u=(o+s)/2;if(o===s)c=l=0;else{var d=o-s;switch(l=u>.5?d/(2-o-s):d/(o+s),o){case n:c=(r-i)/d+(r<i?6:0);break;case r:c=(i-n)/d+2;break;case i:c=(n-r)/d+4;break}c/=6}return[c,l,u,a]}},{key:`hslToRgb`,value:function(e){var t=js(e,4),n=t[0],r=t[1],i=t[2],a=t[3],o=void 0,s=void 0,c=void 0;if(r===0)o=s=c=i;else{var l=function(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e},u=i<.5?i*(1+r):i+r-i*r,d=2*i-u;o=l(d,u,n+1/3),s=l(d,u,n),c=l(d,u,n-1/3)}var f=[o*255,s*255,c*255].map(Math.round);return f[3]=a,f}}]),e}(),Fs=function(){function e(){ks(this,e),this._events=[]}return As(e,[{key:`add`,value:function(e,t,n){e.addEventListener(t,n,!1),this._events.push({target:e,type:t,handler:n})}},{key:`remove`,value:function(t,n,r){this._events=this._events.filter(function(i){var a=!0;return t&&t!==i.target&&(a=!1),n&&n!==i.type&&(a=!1),r&&r!==i.handler&&(a=!1),a&&e._doRemove(i.target,i.type,i.handler),!a})}},{key:`destroy`,value:function(){this._events.forEach(function(t){return e._doRemove(t.target,t.type,t.handler)}),this._events=[]}}],[{key:`_doRemove`,value:function(e,t,n){e.removeEventListener(t,n,!1)}}]),e}();function Is(e){var t=document.createElement(`div`);return t.innerHTML=e,t.firstElementChild}function Ls(e,t,n){var r=!1;function i(e,t,n){return Math.max(t,Math.min(e,n))}function a(e,a,o){if(o&&(r=!0),r){e.preventDefault();var s=t.getBoundingClientRect(),c=s.width,l=s.height,u=a.clientX,d=a.clientY,f=i(u-s.left,0,c),p=i(d-s.top,0,l);n(f/c,p/l)}}function o(e,t){(e.buttons===void 0?e.which:e.buttons)===1?a(e,e,t):r=!1}function s(e,t){e.touches.length===1?a(e,e.touches[0],t):r=!1}e.add(t,`mousedown`,function(e){o(e,!0)}),e.add(t,`touchstart`,function(e){s(e,!0)}),e.add(window,`mousemove`,o),e.add(t,`touchmove`,s),e.add(window,`mouseup`,function(e){r=!1}),e.add(t,`touchend`,function(e){r=!1}),e.add(t,`touchcancel`,function(e){r=!1})}var Rs=`linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0 / 2em 2em,
|
|
4
4
|
linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em / 2em 2em`,zs=360,Bs=`keydown`,Vs=`mousedown`,Hs=`focusin`;function Us(e,t){return(t||document).querySelector(e)}function Ws(e){e.preventDefault(),e.stopPropagation()}function Gs(e,t,n,r,i){e.add(t,Bs,function(e){n.indexOf(e.key)>=0&&(i&&Ws(e),r(e))})}var Ks=function(){function e(t){ks(this,e),this.settings={popup:`right`,layout:`default`,alpha:!0,editor:!0,editorFormat:`hex`,cancelButton:!1,defaultColor:`#0cf`},this._events=new Fs,this.onChange=null,this.onDone=null,this.onOpen=null,this.onClose=null,this.setOptions(t)}return As(e,[{key:`setOptions`,value:function(e){var t=this;if(!e)return;var n=this.settings;function r(e,t,n){for(var r in e)n&&n.indexOf(r)>=0||(t[r]=e[r])}if(e instanceof HTMLElement)n.parent=e;else{n.parent&&e.parent&&n.parent!==e.parent&&(this._events.remove(n.parent),this._popupInited=!1),r(e,n),e.onChange&&(this.onChange=e.onChange),e.onDone&&(this.onDone=e.onDone),e.onOpen&&(this.onOpen=e.onOpen),e.onClose&&(this.onClose=e.onClose);var i=e.color||e.colour;i&&this._setColor(i)}var a=n.parent;if(a&&n.popup&&!this._popupInited){var o=function(e){return t.openHandler(e)};this._events.add(a,`click`,o),Gs(this._events,a,[` `,`Spacebar`,`Enter`],o),this._popupInited=!0}else e.parent&&!n.popup&&this.show()}},{key:`openHandler`,value:function(e){if(this.show()){e&&e.preventDefault(),this.settings.parent.style.pointerEvents=`none`;var t=e&&e.type===Bs?this._domEdit:this.domElement;setTimeout(function(){return t.focus()},100),this.onOpen&&this.onOpen(this.colour)}}},{key:`closeHandler`,value:function(e){var t=e&&e.type,n=!1;if(!e)n=!0;else if(t===Vs||t===Hs){var r=(this.__containedEvent||0)+100;e.timeStamp>r&&(n=!0)}else Ws(e),n=!0;n&&this.hide()&&(this.settings.parent.style.pointerEvents=``,t!==Vs&&this.settings.parent.focus(),this.onClose&&this.onClose(this.colour))}},{key:`movePopup`,value:function(e,t){this.closeHandler(),this.setOptions(e),t&&this.openHandler()}},{key:`setColor`,value:function(e,t){this._setColor(e,{silent:t})}},{key:`_setColor`,value:function(e,t){if(typeof e==`string`&&(e=e.trim()),e){t||={};var n=void 0;try{n=new Ps(e)}catch(e){if(t.failSilently)return;throw e}if(!this.settings.alpha){var r=n.hsla;r[3]=1,n.hsla=r}this.colour=this.color=n,this._setHSLA(null,null,null,null,t)}}},{key:`setColour`,value:function(e,t){this.setColor(e,t)}},{key:`show`,value:function(){if(!this.settings.parent)return!1;if(this.domElement){var e=this._toggleDOM(!0);return this._setPosition(),e}var t=Is(this.settings.template||`<div class="picker_wrapper" tabindex="-1"><div class="picker_arrow"></div><div class="picker_hue picker_slider"><div class="picker_selector"></div></div><div class="picker_sl"><div class="picker_selector"></div></div><div class="picker_alpha picker_slider"><div class="picker_selector"></div></div><div class="picker_editor"><input aria-label="Type a color name or hex value"/></div><div class="picker_sample"></div><div class="picker_done"><button>Ok</button></div><div class="picker_cancel"><button>Cancel</button></div></div>`);return this.domElement=t,this._domH=Us(`.picker_hue`,t),this._domSL=Us(`.picker_sl`,t),this._domA=Us(`.picker_alpha`,t),this._domEdit=Us(`.picker_editor input`,t),this._domSample=Us(`.picker_sample`,t),this._domOkay=Us(`.picker_done button`,t),this._domCancel=Us(`.picker_cancel button`,t),t.classList.add(`layout_`+this.settings.layout),this.settings.alpha||t.classList.add(`no_alpha`),this.settings.editor||t.classList.add(`no_editor`),this.settings.cancelButton||t.classList.add(`no_cancel`),this._ifPopup(function(){return t.classList.add(`popup`)}),this._setPosition(),this.colour?this._updateUI():this._setColor(this.settings.defaultColor),this._bindEvents(),!0}},{key:`hide`,value:function(){return this._toggleDOM(!1)}},{key:`destroy`,value:function(){this._events.destroy(),this.domElement&&this.settings.parent.removeChild(this.domElement)}},{key:`_bindEvents`,value:function(){var e=this,t=this,n=this.domElement,r=this._events;function i(e,t,n){r.add(e,t,n)}i(n,`click`,function(e){return e.preventDefault()}),Ls(r,this._domH,function(e,n){return t._setHSLA(e)}),Ls(r,this._domSL,function(e,n){return t._setHSLA(null,e,1-n)}),this.settings.alpha&&Ls(r,this._domA,function(e,n){return t._setHSLA(null,null,null,1-n)});var a=this._domEdit;i(a,`input`,function(e){t._setColor(this.value,{fromEditor:!0,failSilently:!0})}),i(a,`focus`,function(e){var t=this;t.selectionStart===t.selectionEnd&&t.select()}),this._ifPopup(function(){var t=function(t){return e.closeHandler(t)};i(window,Vs,t),i(window,Hs,t),Gs(r,n,[`Esc`,`Escape`],t);var a=function(t){e.__containedEvent=t.timeStamp};i(n,Vs,a),i(n,Hs,a),i(e._domCancel,`click`,t)});var o=function(t){e._ifPopup(function(){return e.closeHandler(t)}),e.onDone&&e.onDone(e.colour)};i(this._domOkay,`click`,o),Gs(r,n,[`Enter`],o)}},{key:`_setPosition`,value:function(){var e=this.settings.parent,t=this.domElement;e!==t.parentNode&&e.appendChild(t),this._ifPopup(function(n){getComputedStyle(e).position===`static`&&(e.style.position=`relative`);var r=n===!0?`popup_right`:`popup_`+n;[`popup_top`,`popup_bottom`,`popup_left`,`popup_right`].forEach(function(e){e===r?t.classList.add(e):t.classList.remove(e)}),t.classList.add(r)})}},{key:`_setHSLA`,value:function(e,t,n,r,i){i||={};var a=this.colour,o=a.hsla;[e,t,n,r].forEach(function(e,t){(e||e===0)&&(o[t]=e)}),a.hsla=o,this._updateUI(i),this.onChange&&!i.silent&&this.onChange(a)}},{key:`_updateUI`,value:function(e){if(!this.domElement)return;e||={};var t=this.colour,n=t.hsla,r=`hsl(`+n[0]*zs+`, 100%, 50%)`,i=t.hslString,a=t.hslaString,o=this._domH,s=this._domSL,c=this._domA,l=Us(`.picker_selector`,o),u=Us(`.picker_selector`,s),d=Us(`.picker_selector`,c);function f(e,t,n){t.style.left=n*100+`%`}function p(e,t,n){t.style.top=n*100+`%`}f(o,l,n[0]),this._domSL.style.backgroundColor=this._domH.style.color=r,f(s,u,n[1]),p(s,u,1-n[2]),s.style.color=i,p(c,d,1-n[3]);var m=i,h=`linear-gradient(`+[m,m.replace(`hsl`,`hsla`).replace(`)`,`, 0)`)]+`)`;if(this._domA.style.background=h+`, `+Rs,!e.fromEditor){var g=this.settings.editorFormat,_=this.settings.alpha,v=void 0;switch(g){case`rgb`:v=t.printRGB(_);break;case`hsl`:v=t.printHSL(_);break;default:v=t.printHex(_)}this._domEdit.value=v}this._domSample.style.color=a}},{key:`_ifPopup`,value:function(e,t){this.settings.parent&&this.settings.popup?e&&e(this.settings.popup):t&&t()}},{key:`_toggleDOM`,value:function(e){var t=this.domElement;if(!t)return!1;var n=e?``:`none`,r=t.style.display!==n;return r&&(t.style.display=n),r}}]),e}(),qs=document.createElement(`style`);qs.textContent=`.picker_wrapper.no_alpha .picker_alpha{display:none}.picker_wrapper.no_editor .picker_editor{position:absolute;z-index:-1;opacity:0}.picker_wrapper.no_cancel .picker_cancel{display:none}.layout_default.picker_wrapper{display:flex;flex-flow:row wrap;justify-content:space-between;align-items:stretch;font-size:10px;width:25em;padding:.5em}.layout_default.picker_wrapper input,.layout_default.picker_wrapper button{font-size:1rem}.layout_default.picker_wrapper>*{margin:.5em}.layout_default.picker_wrapper::before{content:"";display:block;width:100%;height:0;order:1}.layout_default .picker_slider,.layout_default .picker_selector{padding:1em}.layout_default .picker_hue{width:100%}.layout_default .picker_sl{flex:1 1 auto}.layout_default .picker_sl::before{content:"";display:block;padding-bottom:100%}.layout_default .picker_editor{order:1;width:6.5rem}.layout_default .picker_editor input{width:100%;height:100%}.layout_default .picker_sample{order:1;flex:1 1 auto}.layout_default .picker_done,.layout_default .picker_cancel{order:1}.picker_wrapper{box-sizing:border-box;background:#f2f2f2;box-shadow:0 0 0 1px silver;cursor:default;font-family:sans-serif;color:#444;pointer-events:auto}.picker_wrapper:focus{outline:none}.picker_wrapper button,.picker_wrapper input{box-sizing:border-box;border:none;box-shadow:0 0 0 1px silver;outline:none}.picker_wrapper button:focus,.picker_wrapper button:active,.picker_wrapper input:focus,.picker_wrapper input:active{box-shadow:0 0 2px 1px #1e90ff}.picker_wrapper button{padding:.4em .6em;cursor:pointer;background-color:#f5f5f5;background-image:linear-gradient(0deg, gainsboro, transparent)}.picker_wrapper button:active{background-image:linear-gradient(0deg, transparent, gainsboro)}.picker_wrapper button:hover{background-color:#fff}.picker_selector{position:absolute;z-index:1;display:block;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);border:2px solid #fff;border-radius:100%;box-shadow:0 0 3px 1px #67b9ff;background:currentColor;cursor:pointer}.picker_slider .picker_selector{border-radius:2px}.picker_hue{position:relative;background-image:linear-gradient(90deg, red, yellow, lime, cyan, blue, magenta, red);box-shadow:0 0 0 1px silver}.picker_sl{position:relative;box-shadow:0 0 0 1px silver;background-image:linear-gradient(180deg, white, rgba(255, 255, 255, 0) 50%),linear-gradient(0deg, black, rgba(0, 0, 0, 0) 50%),linear-gradient(90deg, #808080, rgba(128, 128, 128, 0))}.picker_alpha,.picker_sample{position:relative;background:linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0/2em 2em,linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em/2em 2em;box-shadow:0 0 0 1px silver}.picker_alpha .picker_selector,.picker_sample .picker_selector{background:none}.picker_editor input{font-family:monospace;padding:.2em .4em}.picker_sample::before{content:"";position:absolute;display:block;width:100%;height:100%;background:currentColor}.picker_arrow{position:absolute;z-index:-1}.picker_wrapper.popup{position:absolute;z-index:2;margin:1.5em}.picker_wrapper.popup,.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{background:#f2f2f2;box-shadow:0 0 10px 1px rgba(0,0,0,.4)}.picker_wrapper.popup .picker_arrow{width:3em;height:3em;margin:0}.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{content:"";display:block;position:absolute;top:0;left:0;z-index:-99}.picker_wrapper.popup .picker_arrow::before{width:100%;height:100%;-webkit-transform:skew(45deg);transform:skew(45deg);-webkit-transform-origin:0 100%;transform-origin:0 100%}.picker_wrapper.popup .picker_arrow::after{width:150%;height:150%;box-shadow:none}.popup.popup_top{bottom:100%;left:0}.popup.popup_top .picker_arrow{bottom:0;left:0;-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.popup.popup_bottom{top:100%;left:0}.popup.popup_bottom .picker_arrow{top:0;left:0;-webkit-transform:rotate(90deg) scale(1, -1);transform:rotate(90deg) scale(1, -1)}.popup.popup_left{top:0;right:100%}.popup.popup_left .picker_arrow{top:0;right:0;-webkit-transform:scale(-1, 1);transform:scale(-1, 1)}.popup.popup_right{top:0;left:100%}.popup.popup_right .picker_arrow{top:0;left:0}`,document.documentElement.firstElementChild.appendChild(qs),Ks.StyleElement=qs;function Js(e){return Array.isArray(e)}function Ys(e){return typeof e==`object`&&!!e&&(e.constructor===void 0||e.constructor.name===`Object`)}function Xs(e){return e&&typeof e==`object`?e.op===`add`:!1}function Zs(e){return e&&typeof e==`object`?e.op===`remove`:!1}function Qs(e){return e&&typeof e==`object`?e.op===`replace`:!1}function $s(e){return e&&typeof e==`object`?e.op===`copy`:!1}function ec(e){return e&&typeof e==`object`?e.op===`move`:!1}function tc(e,t){return JSON.stringify(e)===JSON.stringify(t)}function nc(e,t){return e===t}function rc(e){return e.slice(0,e.length-1)}function ic(e){return e[e.length-1]}function ac(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:nc;if(e.length<t.length)return!1;for(let r=0;r<t.length;r++)if(!n(e[r],t[r]))return!1;return!0}function oc(e){return typeof e==`object`&&!!e}function sc(e){if(Js(e)){let t=e.slice();return Object.getOwnPropertySymbols(e).forEach(n=>{t[n]=e[n]}),t}else if(Ys(e)){let t={...e};return Object.getOwnPropertySymbols(e).forEach(n=>{t[n]=e[n]}),t}else return e}function cc(e,t,n){if(e[t]===n)return e;{let r=sc(e);return r[t]=n,r}}function lc(e,t){let n=e,r=0;for(;r<t.length;)n=Ys(n)?n[t[r]]:Js(n)?n[parseInt(t[r])]:void 0,r++;return n}function uc(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(t.length===0)return n;let i=t[0],a=uc(e?e[i]:void 0,t.slice(1),n,r);if(Ys(e)||Js(e))return cc(e,i,a);if(r){let e=dc.test(i)?[]:{};return e[i]=a,e}else throw Error(`Path does not exist`)}var dc=/^\d+$/;function fc(e,t,n){if(t.length===0)return n(e);if(!oc(e))throw Error(`Path doesn't exist`);let r=t[0];return cc(e,r,fc(e[r],t.slice(1),n))}function pc(e,t){if(t.length===0)return e;if(!oc(e))throw Error(`Path does not exist`);if(t.length===1){let n=t[0];if(n in e){let t=sc(e);return Js(t)&&t.splice(parseInt(n),1),Ys(t)&&delete t[n],t}else return e}let n=t[0];return cc(e,n,pc(e[n],t.slice(1)))}function mc(e,t,n){let r=t.slice(0,t.length-1),i=t[t.length-1];return fc(e,r,e=>{if(!Array.isArray(e))throw TypeError(`Array expected at path `+JSON.stringify(r));let t=sc(e);return t.splice(parseInt(i),0,n),t})}function hc(e,t){return e===void 0?!1:t.length===0?!0:e===null?!1:hc(e[t[0]],t.slice(1))}function gc(e){let t=e.split(`/`);return t.shift(),t.map(e=>e.replace(/~1/g,`/`).replace(/~0/g,`~`))}function _c(e){return e.map(vc).join(``)}function vc(e){return`/`+String(e).replace(/~/g,`~0`).replace(/\//g,`~1`)}function yc(e,t){return e+vc(t)}function bc(e,t,n){let r=e;for(let e=0;e<t.length;e++){kc(t[e]);let i=t[e];if(n&&n.before){let e=n.before(r,i);if(e!==void 0){if(e.document!==void 0&&(r=e.document),e.json!==void 0)throw Error(`Deprecation warning: returned object property ".json" has been renamed to ".document"`);e.operation!==void 0&&(i=e.operation)}}let a=r,o=Ac(r,i.path);if(i.op===`add`)r=Cc(r,o,i.value);else if(i.op===`remove`)r=Sc(r,o);else if(i.op===`replace`)r=xc(r,o,i.value);else if(i.op===`copy`)r=wc(r,o,jc(i.from));else if(i.op===`move`)r=Tc(r,o,jc(i.from));else if(i.op===`test`)Ec(r,o,i.value);else throw Error(`Unknown JSONPatch operation `+JSON.stringify(i));if(n&&n.after){let e=n.after(r,i,a);e!==void 0&&(r=e)}}return r}function xc(e,t,n){return uc(e,t,n)}function Sc(e,t){return pc(e,t)}function Cc(e,t,n){return Dc(e,t)?mc(e,t,n):uc(e,t,n)}function wc(e,t,n){let r=lc(e,n);return Dc(e,t)?mc(e,t,r):uc(e,t,lc(e,n))}function Tc(e,t,n){let r=lc(e,n),i=pc(e,n);return Dc(i,t)?mc(i,t,r):uc(i,t,r)}function Ec(e,t,n){if(n===void 0)throw Error(`Test failed: no value provided (path: "${_c(t)}")`);if(!hc(e,t))throw Error(`Test failed: path not found (path: "${_c(t)}")`);if(!tc(lc(e,t),n))throw Error(`Test failed, value differs (path: "${_c(t)}")`)}function Dc(e,t){if(t.length===0)return!1;let n=lc(e,rc(t));return Array.isArray(n)}function Oc(e,t){if(ic(t)!==`-`)return t;let n=rc(t),r=lc(e,n);return n.concat(r.length)}function kc(e){if(![`add`,`remove`,`replace`,`copy`,`move`,`test`].includes(e.op))throw Error(`Unknown JSONPatch op `+JSON.stringify(e.op));if(typeof e.path!=`string`)throw Error(`Required property "path" missing or not a string in operation `+JSON.stringify(e));if((e.op===`copy`||e.op===`move`)&&typeof e.from!=`string`)throw Error(`Required property "from" missing or not a string in operation `+JSON.stringify(e))}function Ac(e,t){return Oc(e,gc(t))}function jc(e){return gc(e)}function Mc(e,t,n){let r=[];return bc(e,t,{before:(e,t)=>{let i,a=Ac(e,t.path);if(t.op===`add`)i=Fc(e,a);else if(t.op===`remove`)i=Pc(e,a);else if(t.op===`replace`)i=Nc(e,a);else if(t.op===`copy`)i=Ic(e,a);else if(t.op===`move`)i=Lc(e,a,jc(t.from));else if(t.op===`test`)i=[];else throw Error(`Unknown JSONPatch operation `+JSON.stringify(t));let o;if(n&&n.before){let r=n.before(e,t,i);if(r&&r.revertOperations&&(i=r.revertOperations),r&&r.document&&(o=r.document),r&&r.json)throw Error(`Deprecation warning: returned object property ".json" has been renamed to ".document"`)}if(r=i.concat(r),o!==void 0)return{document:o}}}),r}function Nc(e,t){return[{op:`replace`,path:_c(t),value:lc(e,t)}]}function Pc(e,t){return[{op:`add`,path:_c(t),value:lc(e,t)}]}function Fc(e,t){return Dc(e,t)||!hc(e,t)?[{op:`remove`,path:_c(t)}]:Nc(e,t)}function Ic(e,t){return Fc(e,t)}function Lc(e,t,n){if(t.length<n.length&&ac(n,t))return[{op:`replace`,path:_c(t),value:e}];let r={op:`move`,from:_c(t),path:_c(n)};return!Dc(e,t)&&hc(e,t)?[r,...Pc(e,t)]:[r]}var Rc=i((e=>{var t={b:`\b`,f:`\f`,n:`
|
|
5
5
|
`,r:`\r`,t:` `,'"':`"`,"/":`/`,"\\":`\\`},n=97;e.parse=function(e,r,i){var o={},s=0,c=0,l=0,u=i&&i.bigint&&typeof BigInt<`u`;return{data:d(``,!0),pointers:o};function d(t,n){f();var r;S(t,`value`);var i=v();switch(i){case`t`:_(`rue`),r=!0;break;case`f`:_(`alse`),r=!1;break;case`n`:_(`ull`),r=null;break;case`"`:r=p();break;case`[`:r=h(t);break;case`{`:r=g(t);break;default:y(),`-0123456789`.indexOf(i)>=0?r=m():T()}return S(t,`valueEnd`),f(),n&&l<e.length&&T(),r}function f(){loop:for(;l<e.length;){switch(e[l]){case` `:c++;break;case` `:c+=4;break;case`\r`:c=0;break;case`
|
|
6
|
-
`:c=0,s++;break;default:break loop}l++}}function p(){for(var e=``,n;n=v(),n!=`"`;)n==`\\`?(n=v(),n in t?e+=t[n]:n==`u`?e+=b():E()):e+=n;return e}function m(){var t=``,n=!0;e[l]==`-`&&(t+=v()),t+=e[l]==`0`?v():x(),e[l]==`.`&&(t+=v()+x(),n=!1),(e[l]==`e`||e[l]==`E`)&&(t+=v(),(e[l]==`+`||e[l]==`-`)&&(t+=v()),t+=x(),n=!1);var r=+t;return u&&n&&(r>2**53-1||r<-(2**53-1))?BigInt(t):r}function h(e){f();var t=[],n=0;if(v()==`]`)return t;for(y();;){var r=e+`/`+n;t.push(d(r)),f();var i=v();if(i==`]`)break;i!=`,`&&E(),f(),n++}return t}function g(e){f();var t={};if(v()==`}`)return t;for(y();;){var n=w();v()!=`"`&&E();var r=p(),i=e+`/`+a(r);C(i,`key`,n),S(i,`keyEnd`),f(),v()!=`:`&&E(),f(),t[r]=d(i),f();var o=v();if(o==`}`)break;o!=`,`&&E(),f()}return t}function _(e){for(var t=0;t<e.length;t++)v()!==e[t]&&E()}function v(){ee();var t=e[l];return l++,c++,t}function y(){l--,c--}function b(){for(var e=4,t=0;e--;){t<<=4;var r=v().toLowerCase();r>=`a`&&r<=`f`?t+=r.charCodeAt()-n+10:r>=`0`&&r<=`9`?t+=+r:E()}return String.fromCharCode(t)}function x(){for(var t=``;e[l]>=`0`&&e[l]<=`9`;)t+=v();if(t.length)return t;ee(),T()}function S(e,t){C(e,t,w())}function C(e,t,n){o[e]=o[e]||{},o[e][t]=n}function w(){return{line:s,column:c,pos:l}}function T(){throw SyntaxError(`Unexpected token `+e[l]+` in JSON at position `+l)}function E(){y(),T()}function ee(){if(l>=e.length)throw SyntaxError(`Unexpected end of JSON input`)}};var r=/~/g,i=/\//g;function a(e){return e.replace(r,`~0`).replace(i,`~1`)}})),zc=class extends Error{constructor(e,t){super(`${e} at position ${t}`),this.position=t}},Bc=32,Vc=10,Hc=9,Uc=13,Wc=160,Gc=8192,Kc=8202,qc=8239,
|
|
7
|
-
+`.includes(e)}function
|
|
8
|
-
+`.includes(e)}function
|
|
9
|
-
`||e===`\r`||e===` `||e===`\b`||e===`\f`}function
|
|
10
|
-
`,r:`\r`,t:` `};function
|
|
11
|
-
`;)t++;return!0}return!1}function c(){if(e.slice(t,t+3)==="```"){if(t+=3,
|
|
6
|
+
`:c=0,s++;break;default:break loop}l++}}function p(){for(var e=``,n;n=v(),n!=`"`;)n==`\\`?(n=v(),n in t?e+=t[n]:n==`u`?e+=b():E()):e+=n;return e}function m(){var t=``,n=!0;e[l]==`-`&&(t+=v()),t+=e[l]==`0`?v():x(),e[l]==`.`&&(t+=v()+x(),n=!1),(e[l]==`e`||e[l]==`E`)&&(t+=v(),(e[l]==`+`||e[l]==`-`)&&(t+=v()),t+=x(),n=!1);var r=+t;return u&&n&&(r>2**53-1||r<-(2**53-1))?BigInt(t):r}function h(e){f();var t=[],n=0;if(v()==`]`)return t;for(y();;){var r=e+`/`+n;t.push(d(r)),f();var i=v();if(i==`]`)break;i!=`,`&&E(),f(),n++}return t}function g(e){f();var t={};if(v()==`}`)return t;for(y();;){var n=w();v()!=`"`&&E();var r=p(),i=e+`/`+a(r);C(i,`key`,n),S(i,`keyEnd`),f(),v()!=`:`&&E(),f(),t[r]=d(i),f();var o=v();if(o==`}`)break;o!=`,`&&E(),f()}return t}function _(e){for(var t=0;t<e.length;t++)v()!==e[t]&&E()}function v(){ee();var t=e[l];return l++,c++,t}function y(){l--,c--}function b(){for(var e=4,t=0;e--;){t<<=4;var r=v().toLowerCase();r>=`a`&&r<=`f`?t+=r.charCodeAt()-n+10:r>=`0`&&r<=`9`?t+=+r:E()}return String.fromCharCode(t)}function x(){for(var t=``;e[l]>=`0`&&e[l]<=`9`;)t+=v();if(t.length)return t;ee(),T()}function S(e,t){C(e,t,w())}function C(e,t,n){o[e]=o[e]||{},o[e][t]=n}function w(){return{line:s,column:c,pos:l}}function T(){throw SyntaxError(`Unexpected token `+e[l]+` in JSON at position `+l)}function E(){y(),T()}function ee(){if(l>=e.length)throw SyntaxError(`Unexpected end of JSON input`)}};var r=/~/g,i=/\//g;function a(e){return e.replace(r,`~0`).replace(i,`~1`)}})),zc=class extends Error{constructor(e,t){super(`${e} at position ${t}`),this.position=t}},Bc=32,Vc=10,Hc=9,Uc=13,Wc=160,Gc=8192,Kc=8202,qc=8239,Jc=8287,Yc=12288;function Xc(e){return/^[0-9A-Fa-f]$/.test(e)}function Zc(e){return e>=`0`&&e<=`9`}function Qc(e){return e>=` `}function $c(e){return`,:[]/{}()
|
|
7
|
+
+`.includes(e)}function el(e){return e>=`a`&&e<=`z`||e>=`A`&&e<=`Z`||e===`_`||e===`$`}function tl(e){return e>=`a`&&e<=`z`||e>=`A`&&e<=`Z`||e===`_`||e===`$`||e>=`0`&&e<=`9`}var nl=/^(http|https|ftp|mailto|file|data|irc):\/\/$/,rl=/^[A-Za-z0-9-._~:/?#@!$&'()*+;=]$/;function il(e){return`,[]/{}
|
|
8
|
+
+`.includes(e)}function al(e){return dl(e)||ol.test(e)}var ol=/^[[{\w-]$/;function sl(e){return e===`
|
|
9
|
+
`||e===`\r`||e===` `||e===`\b`||e===`\f`}function cl(e,t){let n=e.charCodeAt(t);return n===Bc||n===Vc||n===Hc||n===Uc}function ll(e,t){let n=e.charCodeAt(t);return n===Bc||n===Hc||n===Uc}function ul(e,t){let n=e.charCodeAt(t);return n===Wc||n>=Gc&&n<=Kc||n===qc||n===Jc||n===Yc}function dl(e){return fl(e)||ml(e)}function fl(e){return e===`"`||e===`“`||e===`”`}function pl(e){return e===`"`}function ml(e){return e===`'`||e===`‘`||e===`’`||e==="`"||e===`´`}function hl(e){return e===`'`}function gl(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=e.lastIndexOf(t);return r===-1?e:e.substring(0,r)+(n?``:e.substring(r+1))}function _l(e,t){let n=e.length;if(!cl(e,n-1))return e+t;for(;cl(e,n-1);)n--;return e.substring(0,n)+t+e.substring(n)}function vl(e,t,n){return e.substring(0,t)+e.substring(t+n)}function yl(e){return/[,\n][ \t\r]*$/.test(e)}var bl={"\b":`\\b`,"\f":`\\f`,"\n":`\\n`,"\r":`\\r`," ":`\\t`},xl={'"':`"`,"\\":`\\`,"/":`/`,b:`\b`,f:`\f`,n:`
|
|
10
|
+
`,r:`\r`,t:` `};function Sl(e){let t=0,n=``;c(),i()||te(),c();let r=l(`,`);for(r&&a(),al(e[t])&&yl(n)?(r||(n=_l(n,`,`)),h()):r&&(n=gl(n,`,`));e[t]===`}`||e[t]===`]`;)t++,a();if(t>=e.length)return n;ee();function i(){a();let e=p()||m()||g()||v()||y()||x(!1)||S();return a(),e}function a(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,n=t,r=o(e);do r=s(),r&&=o(e);while(r);return t>n}function o(r){let i=r?cl:ll,a=``;for(;;)if(i(e,t))a+=e[t],t++;else if(ul(e,t))a+=` `,t++;else break;return a.length>0?(n+=a,!0):!1}function s(){if(e[t]===`/`&&e[t+1]===`*`){for(;t<e.length&&!Cl(e,t);)t++;return t+=2,!0}if(e[t]===`/`&&e[t+1]===`/`){for(;t<e.length&&e[t]!==`
|
|
11
|
+
`;)t++;return!0}return!1}function c(){if(e.slice(t,t+3)==="```"){if(t+=3,el(e[t]))for(;t<e.length&&tl(e[t]);)t++;return a(),!0}return!1}function l(r){return e[t]===r?(n+=e[t],t++,!0):!1}function u(n){return e[t]===n?(t++,!0):!1}function d(){return u(`\\`)}function f(){return a(),e[t]===`.`&&e[t+1]===`.`&&e[t+2]===`.`?(t+=3,a(),u(`,`),!0):!1}function p(){if(e[t]===`{`){n+=`{`,t++,a(),u(`,`)&&a();let r=!0;for(;t<e.length&&e[t]!==`}`;){let o;if(r?(o=!0,r=!1):(o=l(`,`),o||(n=_l(n,`,`)),a()),f(),!(g()||x(!0))){e[t]===`}`||e[t]===`{`||e[t]===`]`||e[t]===`[`||e[t]===void 0?n=gl(n,`,`):D();break}a();let s=l(`:`),c=t>=e.length;s||(al(e[t])||c?n=_l(n,`:`):ne()),i()||(s||c?n+=`null`:ne())}return e[t]===`}`?(n+=`}`,t++):n=_l(n,`}`),!0}return!1}function m(){if(e[t]===`[`){n+=`[`,t++,a(),u(`,`)&&a();let r=!0;for(;t<e.length&&e[t]!==`]`;)if(r?r=!1:l(`,`)||(n=_l(n,`,`)),f(),!i()){n=gl(n,`,`);break}return e[t]===`]`?(n+=`]`,t++):n=_l(n,`]`),!0}return!1}function h(){let e=!0,t=!0;for(;t;)e?e=!1:l(`,`)||(n=_l(n,`,`)),t=i();t||(n=gl(n,`,`)),n=`[
|
|
12
12
|
${n}
|
|
13
|
-
]`}function g(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1,o=e[t]===`\\`;if(o&&=(t++,!0),cl(e[t])){let s=ul(e[t])?ul:fl(e[t])?fl:dl(e[t])?dl:ll,c=t,l=n.length,u=`"`;for(t++;;){if(t>=e.length){let i=C(t-1);return!r&&Xc(e.charAt(i))?(t=c,n=n.substring(0,l),g(!0)):(u=ml(u,`"`),n+=u,!0)}else if(t===i)return u=ml(u,`"`),n+=u,!0;else if(s(e[t])){let i=t,o=u.length;if(u+=`"`,t++,n+=u,a(!1),r||t>=e.length||Xc(e[t])||cl(e[t])||Jc(e[t]))return _(),!0;let s=C(i-1),d=e.charAt(s);if(d===`,`)return t=c,n=n.substring(0,l),g(!1,s);if(Xc(d))return t=c,n=n.substring(0,l),g(!0);n=n.substring(0,l),t=i+1,u=`${u.substring(0,o)}\\${u.substring(o)}`}else if(r&&tl(e[t])){if(e[t-1]===`:`&&$c.test(e.substring(c+1,t+2)))for(;t<e.length&&el.test(e[t]);)u+=e[t],t++;return u=ml(u,`"`),n+=u,_(),!0}else if(e[t]===`\\`){let n=e.charAt(t+1);if(vl[n]!==void 0)u+=e.slice(t,t+2),t+=2;else if(n===`u`){let n=2;for(;n<6&&ree(e[t+n]);)n++;n===6?(u+=e.slice(t,t+6),t+=6):t+n>=e.length?t=e.length:re()}else u+=n,t+=2}else{let n=e.charAt(t);n===`"`&&e[t-1]!==`\\`?(u+=`\\${n}`,t++):il(n)?(u+=_l[n],t++):(Yc(n)||E(n),u+=n,t++)}o&&d()}}return!1}function _(){let r=!1;for(a();e[t]===`+`;){r=!0,t++,a(),n=pl(n,`"`,!0);let e=n.length;n=g()?hl(n,e,1):ml(n,`"`)}return r}function v(){let r=t;if(e[t]===`-`){if(t++,w())return T(r),!0;if(!Jc(e[t]))return t=r,!1}for(;Jc(e[t]);)t++;if(e[t]===`.`){if(t++,w())return T(r),!0;if(!Jc(e[t]))return t=r,!1;for(;Jc(e[t]);)t++}if(e[t]===`e`||e[t]===`E`){if(t++,(e[t]===`-`||e[t]===`+`)&&t++,w())return T(r),!0;if(!Jc(e[t]))return t=r,!1;for(;Jc(e[t]);)t++}if(!w())return t=r,!1;if(t>r){let i=e.slice(r,t),a=/^0\d/.test(i);return n+=a?`"${i}"`:i,!0}return!1}function y(){return b(`true`,`true`)||b(`false`,`false`)||b(`null`,`null`)||b(`True`,`true`)||b(`False`,`false`)||b(`None`,`null`)}function b(r,i){return e.slice(t,t+r.length)===r?(n+=i,t+=r.length,!0):!1}function x(r){let a=t;if(Zc(e[t])){for(;t<e.length&&Qc(e[t]);)t++;let n=t;for(;al(e,n);)n++;if(e[n]===`(`)return t=n+1,i(),e[t]===`)`&&(t++,e[t]===`;`&&t++),!0}for(;t<e.length&&!tl(e[t])&&!cl(e[t])&&(!r||e[t]!==`:`);)t++;if(e[t-1]===`:`&&$c.test(e.substring(a,t+2)))for(;t<e.length&&el.test(e[t]);)t++;if(t>a){for(;al(e,t-1)&&t>0;)t--;let r=e.slice(a,t);return n+=r===`undefined`?`null`:JSON.stringify(r),e[t]===`"`&&t++,!0}}function S(){if(e[t]===`/`){let r=t;for(t++;t<e.length&&(e[t]!==`/`||e[t-1]===`\\`);)t++;return t++,n+=`"${e.substring(r,t)}"`,!0}}function C(t){let n=t;for(;n>0&&al(e,n);)n--;return n}function w(){return t>=e.length||Xc(e[t])||al(e,t)}function T(r){n+=`${e.slice(r,t)}0`}function E(e){throw new zc(`Invalid character ${JSON.stringify(e)}`,t)}function ee(){throw new zc(`Unexpected character ${JSON.stringify(e[t])}`,t)}function te(){throw new zc(`Unexpected end of json string`,e.length)}function D(){throw new zc(`Object key expected`,t)}function ne(){throw new zc(`Colon expected`,t)}function re(){throw new zc(`Invalid unicode character "${e.slice(t,t+6)}"`,t)}}function bl(e,t){return e[t]===`*`&&e[t+1]===`/`}var xl=typeof global==`object`&&global&&global.Object===Object&&global,Sl=typeof self==`object`&&self&&self.Object===Object&&self,Cl=xl||Sl||Function(`return this`)(),wl=Cl.Symbol,Tl=Object.prototype,El=Tl.hasOwnProperty,Dl=Tl.toString,Ol=wl?wl.toStringTag:void 0;function kl(e){var t=El.call(e,Ol),n=e[Ol];try{e[Ol]=void 0;var r=!0}catch{}var i=Dl.call(e);return r&&(t?e[Ol]=n:delete e[Ol]),i}var Al=Object.prototype.toString;function jl(e){return Al.call(e)}var Ml=`[object Null]`,Nl=`[object Undefined]`,Pl=wl?wl.toStringTag:void 0;function Fl(e){return e==null?e===void 0?Nl:Ml:Pl&&Pl in Object(e)?kl(e):jl(e)}function Il(e){return typeof e==`object`&&!!e}var Ll=`[object Symbol]`;function Rl(e){return typeof e==`symbol`||Il(e)&&Fl(e)==Ll}function zl(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var Bl=Array.isArray,Vl=1/0,Hl=wl?wl.prototype:void 0,Ul=Hl?Hl.toString:void 0;function Wl(e){if(typeof e==`string`)return e;if(Bl(e))return zl(e,Wl)+``;if(Rl(e))return Ul?Ul.call(e):``;var t=e+``;return t==`0`&&1/e==-Vl?`-0`:t}var Gl=/\s/;function Kl(e){for(var t=e.length;t--&&Gl.test(e.charAt(t)););return t}var ql=/^\s+/;function Jl(e){return e&&e.slice(0,Kl(e)+1).replace(ql,``)}function Yl(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}var Xl=NaN,Zl=/^[-+]0x[0-9a-f]+$/i,Ql=/^0b[01]+$/i,$l=/^0o[0-7]+$/i,eu=parseInt;function tu(e){if(typeof e==`number`)return e;if(Rl(e))return Xl;if(Yl(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=Yl(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=Jl(e);var n=Ql.test(e);return n||$l.test(e)?eu(e.slice(2),n?2:8):Zl.test(e)?Xl:+e}var nu=1/0,ru=17976931348623157e292;function iu(e){return e?(e=tu(e),e===nu||e===-nu?(e<0?-1:1)*ru:e===e?e:0):e===0?e:0}function au(e){var t=iu(e),n=t%1;return t===t?n?t-n:t:0}function ou(e){return e}var su=`[object AsyncFunction]`,cu=`[object Function]`,lu=`[object GeneratorFunction]`,uu=`[object Proxy]`;function du(e){if(!Yl(e))return!1;var t=Fl(e);return t==cu||t==lu||t==su||t==uu}var fu=Cl[`__core-js_shared__`],pu=function(){var e=/[^.]+$/.exec(fu&&fu.keys&&fu.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function mu(e){return!!pu&&pu in e}var hu=Function.prototype.toString;function gu(e){if(e!=null){try{return hu.call(e)}catch{}try{return e+``}catch{}}return``}var _u=/[\\^$.*+?()[\]{}|]/g,vu=/^\[object .+?Constructor\]$/,yu=Function.prototype,bu=Object.prototype,xu=yu.toString,Su=bu.hasOwnProperty,Cu=RegExp(`^`+xu.call(Su).replace(_u,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function wu(e){return!Yl(e)||mu(e)?!1:(du(e)?Cu:vu).test(gu(e))}function Tu(e,t){return e?.[t]}function Eu(e,t){var n=Tu(e,t);return wu(n)?n:void 0}var Du=Eu(Cl,`WeakMap`),Ou=Object.create,ku=function(){function e(){}return function(t){if(!Yl(t))return{};if(Ou)return Ou(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Au(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function ju(){}function Mu(e,t){var n=-1,r=e.length;for(t||=Array(r);++n<r;)t[n]=e[n];return t}var Nu=800,Pu=16,Fu=Date.now;function Iu(e){var t=0,n=0;return function(){var r=Fu(),i=Pu-(r-n);if(n=r,i>0){if(++t>=Nu)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function iee(e){return function(){return e}}var Lu=function(){try{var e=Eu(Object,`defineProperty`);return e({},``,{}),e}catch{}}(),Ru=Iu(Lu?function(e,t){return Lu(e,`toString`,{configurable:!0,enumerable:!1,value:iee(t),writable:!0})}:ou);function zu(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var Bu=9007199254740991,Vu=/^(?:0|[1-9]\d*)$/;function Hu(e,t){var n=typeof e;return t??=Bu,!!t&&(n==`number`||n!=`symbol`&&Vu.test(e))&&e>-1&&e%1==0&&e<t}function Uu(e,t,n){t==`__proto__`&&Lu?Lu(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Wu(e,t){return e===t||e!==e&&t!==t}var Gu=Object.prototype.hasOwnProperty;function Ku(e,t,n){var r=e[t];(!(Gu.call(e,t)&&Wu(r,n))||n===void 0&&!(t in e))&&Uu(e,t,n)}function qu(e,t,n,r){var i=!n;n||={};for(var a=-1,o=t.length;++a<o;){var s=t[a],c=r?r(n[s],e[s],s,n,e):void 0;c===void 0&&(c=e[s]),i?Uu(n,s,c):Ku(n,s,c)}return n}var Ju=Math.max;function Yu(e,t,n){return t=Ju(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,a=Ju(r.length-t,0),o=Array(a);++i<a;)o[i]=r[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=r[i];return s[t]=n(o),Au(e,this,s)}}function Xu(e,t){return Ru(Yu(e,t,ou),e+``)}var Zu=9007199254740991;function Qu(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=Zu}function $u(e){return e!=null&&Qu(e.length)&&!du(e)}function ed(e,t,n){if(!Yl(n))return!1;var r=typeof t;return(r==`number`?$u(n)&&Hu(t,n.length):r==`string`&&t in n)?Wu(n[t],e):!1}var td=Object.prototype;function nd(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||td)}function rd(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var id=`[object Arguments]`;function ad(e){return Il(e)&&Fl(e)==id}var od=Object.prototype,sd=od.hasOwnProperty,cd=od.propertyIsEnumerable,ld=ad(function(){return arguments}())?ad:function(e){return Il(e)&&sd.call(e,`callee`)&&!cd.call(e,`callee`)};function ud(){return!1}var dd=typeof exports==`object`&&exports&&!exports.nodeType&&exports,fd=dd&&typeof module==`object`&&module&&!module.nodeType&&module,pd=fd&&fd.exports===dd?Cl.Buffer:void 0,md=(pd?pd.isBuffer:void 0)||ud,hd=`[object Arguments]`,gd=`[object Array]`,_d=`[object Boolean]`,vd=`[object Date]`,yd=`[object Error]`,bd=`[object Function]`,xd=`[object Map]`,Sd=`[object Number]`,Cd=`[object Object]`,wd=`[object RegExp]`,Td=`[object Set]`,Ed=`[object String]`,Dd=`[object WeakMap]`,Od=`[object ArrayBuffer]`,kd=`[object DataView]`,Ad=`[object Float32Array]`,jd=`[object Float64Array]`,Md=`[object Int8Array]`,Nd=`[object Int16Array]`,Pd=`[object Int32Array]`,Fd=`[object Uint8Array]`,Id=`[object Uint8ClampedArray]`,Ld=`[object Uint16Array]`,Rd=`[object Uint32Array]`,zd={};zd[Ad]=zd[jd]=zd[Md]=zd[Nd]=zd[Pd]=zd[Fd]=zd[Id]=zd[Ld]=zd[Rd]=!0,zd[hd]=zd[gd]=zd[Od]=zd[_d]=zd[kd]=zd[vd]=zd[yd]=zd[bd]=zd[xd]=zd[Sd]=zd[Cd]=zd[wd]=zd[Td]=zd[Ed]=zd[Dd]=!1;function Bd(e){return Il(e)&&Qu(e.length)&&!!zd[Fl(e)]}function Vd(e){return function(t){return e(t)}}var Hd=typeof exports==`object`&&exports&&!exports.nodeType&&exports,Ud=Hd&&typeof module==`object`&&module&&!module.nodeType&&module,Wd=Ud&&Ud.exports===Hd&&xl.process,Gd=function(){try{return Ud&&Ud.require&&Ud.require(`util`).types||Wd&&Wd.binding&&Wd.binding(`util`)}catch{}}(),Kd=Gd&&Gd.isTypedArray,qd=Kd?Vd(Kd):Bd,Jd=Object.prototype.hasOwnProperty;function Yd(e,t){var n=Bl(e),r=!n&&ld(e),i=!n&&!r&&md(e),a=!n&&!r&&!i&&qd(e),o=n||r||i||a,s=o?rd(e.length,String):[],c=s.length;for(var l in e)(t||Jd.call(e,l))&&!(o&&(l==`length`||i&&(l==`offset`||l==`parent`)||a&&(l==`buffer`||l==`byteLength`||l==`byteOffset`)||Hu(l,c)))&&s.push(l);return s}function Xd(e,t){return function(n){return e(t(n))}}var Zd=Xd(Object.keys,Object),Qd=Object.prototype.hasOwnProperty;function $d(e){if(!nd(e))return Zd(e);var t=[];for(var n in Object(e))Qd.call(e,n)&&n!=`constructor`&&t.push(n);return t}function ef(e){return $u(e)?Yd(e):$d(e)}function tf(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var nf=Object.prototype.hasOwnProperty;function rf(e){if(!Yl(e))return tf(e);var t=nd(e),n=[];for(var r in e)r==`constructor`&&(t||!nf.call(e,r))||n.push(r);return n}function af(e){return $u(e)?Yd(e,!0):rf(e)}var of=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,sf=/^\w*$/;function cf(e,t){if(Bl(e))return!1;var n=typeof e;return n==`number`||n==`symbol`||n==`boolean`||e==null||Rl(e)?!0:sf.test(e)||!of.test(e)||t!=null&&e in Object(t)}var lf=Eu(Object,`create`);function uf(){this.__data__=lf?lf(null):{},this.size=0}function df(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}var ff=`__lodash_hash_undefined__`,pf=Object.prototype.hasOwnProperty;function mf(e){var t=this.__data__;if(lf){var n=t[e];return n===ff?void 0:n}return pf.call(t,e)?t[e]:void 0}var hf=Object.prototype.hasOwnProperty;function gf(e){var t=this.__data__;return lf?t[e]!==void 0:hf.call(t,e)}var _f=`__lodash_hash_undefined__`;function vf(e,t){var n=this.__data__;return this.size+=+!this.has(e),n[e]=lf&&t===void 0?_f:t,this}function yf(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}yf.prototype.clear=uf,yf.prototype.delete=df,yf.prototype.get=mf,yf.prototype.has=gf,yf.prototype.set=vf;function bf(){this.__data__=[],this.size=0}function xf(e,t){for(var n=e.length;n--;)if(Wu(e[n][0],t))return n;return-1}var Sf=Array.prototype.splice;function Cf(e){var t=this.__data__,n=xf(t,e);return n<0?!1:(n==t.length-1?t.pop():Sf.call(t,n,1),--this.size,!0)}function wf(e){var t=this.__data__,n=xf(t,e);return n<0?void 0:t[n][1]}function Tf(e){return xf(this.__data__,e)>-1}function Ef(e,t){var n=this.__data__,r=xf(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Df(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Df.prototype.clear=bf,Df.prototype.delete=Cf,Df.prototype.get=wf,Df.prototype.has=Tf,Df.prototype.set=Ef;var Of=Eu(Cl,`Map`);function kf(){this.size=0,this.__data__={hash:new yf,map:new(Of||Df),string:new yf}}function Af(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}function jf(e,t){var n=e.__data__;return Af(t)?n[typeof t==`string`?`string`:`hash`]:n.map}function Mf(e){var t=jf(this,e).delete(e);return this.size-=+!!t,t}function Nf(e){return jf(this,e).get(e)}function Pf(e){return jf(this,e).has(e)}function Ff(e,t){var n=jf(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function If(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}If.prototype.clear=kf,If.prototype.delete=Mf,If.prototype.get=Nf,If.prototype.has=Pf,If.prototype.set=Ff;var Lf=`Expected a function`;function Rf(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(Lf);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(Rf.Cache||If),n}Rf.Cache=If;var zf=500;function Bf(e){var t=Rf(e,function(e){return n.size===zf&&n.clear(),e}),n=t.cache;return t}var Vf=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Hf=/\\(\\)?/g,Uf=Bf(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(Vf,function(e,n,r,i){t.push(r?i.replace(Hf,`$1`):n||e)}),t});function Wf(e){return e==null?``:Wl(e)}function Gf(e,t){return Bl(e)?e:cf(e,t)?[e]:Uf(Wf(e))}var Kf=1/0;function qf(e){if(typeof e==`string`||Rl(e))return e;var t=e+``;return t==`0`&&1/e==-Kf?`-0`:t}function Jf(e,t){t=Gf(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[qf(t[n++])];return n&&n==r?e:void 0}function Yf(e,t,n){var r=e==null?void 0:Jf(e,t);return r===void 0?n:r}function Xf(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var Zf=wl?wl.isConcatSpreadable:void 0;function Qf(e){return Bl(e)||ld(e)||!!(Zf&&e&&e[Zf])}function $f(e,t,n,r,i){var a=-1,o=e.length;for(n||=Qf,i||=[];++a<o;){var s=e[a];t>0&&n(s)?t>1?$f(s,t-1,n,r,i):Xf(i,s):r||(i[i.length]=s)}return i}var ep=Xd(Object.getPrototypeOf,Object);function aee(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r<i;)a[r]=e[r+t];return a}function tp(){this.__data__=new Df,this.size=0}function np(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function rp(e){return this.__data__.get(e)}function ip(e){return this.__data__.has(e)}var ap=200;function op(e,t){var n=this.__data__;if(n instanceof Df){var r=n.__data__;if(!Of||r.length<ap-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new If(r)}return n.set(e,t),this.size=n.size,this}function sp(e){var t=this.__data__=new Df(e);this.size=t.size}sp.prototype.clear=tp,sp.prototype.delete=np,sp.prototype.get=rp,sp.prototype.has=ip,sp.prototype.set=op;function cp(e,t){return e&&qu(t,ef(t),e)}function lp(e,t){return e&&qu(t,af(t),e)}var up=typeof exports==`object`&&exports&&!exports.nodeType&&exports,dp=up&&typeof module==`object`&&module&&!module.nodeType&&module,fp=dp&&dp.exports===up?Cl.Buffer:void 0,pp=fp?fp.allocUnsafe:void 0;function mp(e,t){if(t)return e.slice();var n=e.length,r=pp?pp(n):new e.constructor(n);return e.copy(r),r}function hp(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}function gp(){return[]}var _p=Object.prototype.propertyIsEnumerable,vp=Object.getOwnPropertySymbols,yp=vp?function(e){return e==null?[]:(e=Object(e),hp(vp(e),function(t){return _p.call(e,t)}))}:gp;function bp(e,t){return qu(e,yp(e),t)}var xp=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)Xf(t,yp(e)),e=ep(e);return t}:gp;function Sp(e,t){return qu(e,xp(e),t)}function Cp(e,t,n){var r=t(e);return Bl(e)?r:Xf(r,n(e))}function wp(e){return Cp(e,ef,yp)}function Tp(e){return Cp(e,af,xp)}var Ep=Eu(Cl,`DataView`),Dp=Eu(Cl,`Promise`),Op=Eu(Cl,`Set`),kp=`[object Map]`,Ap=`[object Object]`,jp=`[object Promise]`,Mp=`[object Set]`,Np=`[object WeakMap]`,Pp=`[object DataView]`,Fp=gu(Ep),Ip=gu(Of),Lp=gu(Dp),Rp=gu(Op),zp=gu(Du),Bp=Fl;(Ep&&Bp(new Ep(new ArrayBuffer(1)))!=Pp||Of&&Bp(new Of)!=kp||Dp&&Bp(Dp.resolve())!=jp||Op&&Bp(new Op)!=Mp||Du&&Bp(new Du)!=Np)&&(Bp=function(e){var t=Fl(e),n=t==Ap?e.constructor:void 0,r=n?gu(n):``;if(r)switch(r){case Fp:return Pp;case Ip:return kp;case Lp:return jp;case Rp:return Mp;case zp:return Np}return t});var Vp=Bp,Hp=Object.prototype.hasOwnProperty;function Up(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]==`string`&&Hp.call(e,`index`)&&(n.index=e.index,n.input=e.input),n}var Wp=Cl.Uint8Array;function Gp(e){var t=new e.constructor(e.byteLength);return new Wp(t).set(new Wp(e)),t}function Kp(e,t){var n=t?Gp(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var qp=/\w*$/;function Jp(e){var t=new e.constructor(e.source,qp.exec(e));return t.lastIndex=e.lastIndex,t}var Yp=wl?wl.prototype:void 0,Xp=Yp?Yp.valueOf:void 0;function Zp(e){return Xp?Object(Xp.call(e)):{}}function Qp(e,t){var n=t?Gp(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var $p=`[object Boolean]`,em=`[object Date]`,tm=`[object Map]`,nm=`[object Number]`,rm=`[object RegExp]`,im=`[object Set]`,am=`[object String]`,om=`[object Symbol]`,sm=`[object ArrayBuffer]`,cm=`[object DataView]`,lm=`[object Float32Array]`,um=`[object Float64Array]`,dm=`[object Int8Array]`,fm=`[object Int16Array]`,pm=`[object Int32Array]`,mm=`[object Uint8Array]`,hm=`[object Uint8ClampedArray]`,gm=`[object Uint16Array]`,_m=`[object Uint32Array]`;function vm(e,t,n){var r=e.constructor;switch(t){case sm:return Gp(e);case $p:case em:return new r(+e);case cm:return Kp(e,n);case lm:case um:case dm:case fm:case pm:case mm:case hm:case gm:case _m:return Qp(e,n);case tm:return new r;case nm:case am:return new r(e);case rm:return Jp(e);case im:return new r;case om:return Zp(e)}}function ym(e){return typeof e.constructor==`function`&&!nd(e)?ku(ep(e)):{}}var bm=`[object Map]`;function xm(e){return Il(e)&&Vp(e)==bm}var Sm=Gd&&Gd.isMap,Cm=Sm?Vd(Sm):xm,wm=`[object Set]`;function Tm(e){return Il(e)&&Vp(e)==wm}var Em=Gd&&Gd.isSet,Dm=Em?Vd(Em):Tm,Om=1,km=2,Am=4,jm=`[object Arguments]`,Mm=`[object Array]`,Nm=`[object Boolean]`,Pm=`[object Date]`,Fm=`[object Error]`,Im=`[object Function]`,Lm=`[object GeneratorFunction]`,Rm=`[object Map]`,zm=`[object Number]`,Bm=`[object Object]`,Vm=`[object RegExp]`,Hm=`[object Set]`,Um=`[object String]`,Wm=`[object Symbol]`,Gm=`[object WeakMap]`,Km=`[object ArrayBuffer]`,qm=`[object DataView]`,Jm=`[object Float32Array]`,Ym=`[object Float64Array]`,Xm=`[object Int8Array]`,Zm=`[object Int16Array]`,Qm=`[object Int32Array]`,$m=`[object Uint8Array]`,eh=`[object Uint8ClampedArray]`,th=`[object Uint16Array]`,nh=`[object Uint32Array]`,rh={};rh[jm]=rh[Mm]=rh[Km]=rh[qm]=rh[Nm]=rh[Pm]=rh[Jm]=rh[Ym]=rh[Xm]=rh[Zm]=rh[Qm]=rh[Rm]=rh[zm]=rh[Bm]=rh[Vm]=rh[Hm]=rh[Um]=rh[Wm]=rh[$m]=rh[eh]=rh[th]=rh[nh]=!0,rh[Fm]=rh[Im]=rh[Gm]=!1;function ih(e,t,n,r,i,a){var o,s=t&Om,c=t&km,l=t&Am;if(n&&(o=i?n(e,r,i,a):n(e)),o!==void 0)return o;if(!Yl(e))return e;var u=Bl(e);if(u){if(o=Up(e),!s)return Mu(e,o)}else{var d=Vp(e),f=d==Im||d==Lm;if(md(e))return mp(e,s);if(d==Bm||d==jm||f&&!i){if(o=c||f?{}:ym(e),!s)return c?Sp(e,lp(o,e)):bp(e,cp(o,e))}else{if(!rh[d])return i?e:{};o=vm(e,d,s)}}a||=new sp;var p=a.get(e);if(p)return p;a.set(e,o),Dm(e)?e.forEach(function(r){o.add(ih(r,t,n,r,e,a))}):Cm(e)&&e.forEach(function(r,i){o.set(i,ih(r,t,n,i,e,a))});var m=u?void 0:(l?c?Tp:wp:c?af:ef)(e);return zu(m||e,function(r,i){m&&(i=r,r=e[i]),Ku(o,i,ih(r,t,n,i,e,a))}),o}var ah=1,oh=4;function sh(e){return ih(e,ah|oh)}var ch=1,lh=4;function uh(e,t){return t=typeof t==`function`?t:void 0,ih(e,ch|lh,t)}var dh=`__lodash_hash_undefined__`;function fh(e){return this.__data__.set(e,dh),this}function ph(e){return this.__data__.has(e)}function mh(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new If;++t<n;)this.add(e[t])}mh.prototype.add=mh.prototype.push=fh,mh.prototype.has=ph;function hh(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function gh(e,t){return e.has(t)}var _h=1,vh=2;function yh(e,t,n,r,i,a){var o=n&_h,s=e.length,c=t.length;if(s!=c&&!(o&&c>s))return!1;var l=a.get(e),u=a.get(t);if(l&&u)return l==t&&u==e;var d=-1,f=!0,p=n&vh?new mh:void 0;for(a.set(e,t),a.set(t,e);++d<s;){var m=e[d],h=t[d];if(r)var g=o?r(h,m,d,t,e,a):r(m,h,d,e,t,a);if(g!==void 0){if(g)continue;f=!1;break}if(p){if(!hh(t,function(e,t){if(!gh(p,t)&&(m===e||i(m,e,n,r,a)))return p.push(t)})){f=!1;break}}else if(!(m===h||i(m,h,n,r,a))){f=!1;break}}return a.delete(e),a.delete(t),f}function bh(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function xh(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var Sh=1,Ch=2,wh=`[object Boolean]`,Th=`[object Date]`,Eh=`[object Error]`,Dh=`[object Map]`,Oh=`[object Number]`,kh=`[object RegExp]`,Ah=`[object Set]`,jh=`[object String]`,Mh=`[object Symbol]`,Nh=`[object ArrayBuffer]`,Ph=`[object DataView]`,Fh=wl?wl.prototype:void 0,Ih=Fh?Fh.valueOf:void 0;function Lh(e,t,n,r,i,a,o){switch(n){case Ph:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Nh:return!(e.byteLength!=t.byteLength||!a(new Wp(e),new Wp(t)));case wh:case Th:case Oh:return Wu(+e,+t);case Eh:return e.name==t.name&&e.message==t.message;case kh:case jh:return e==t+``;case Dh:var s=bh;case Ah:var c=r&Sh;if(s||=xh,e.size!=t.size&&!c)return!1;var l=o.get(e);if(l)return l==t;r|=Ch,o.set(e,t);var u=yh(s(e),s(t),r,i,a,o);return o.delete(e),u;case Mh:if(Ih)return Ih.call(e)==Ih.call(t)}return!1}var Rh=1,zh=Object.prototype.hasOwnProperty;function Bh(e,t,n,r,i,a){var o=n&Rh,s=wp(e),c=s.length;if(c!=wp(t).length&&!o)return!1;for(var l=c;l--;){var u=s[l];if(!(o?u in t:zh.call(t,u)))return!1}var d=a.get(e),f=a.get(t);if(d&&f)return d==t&&f==e;var p=!0;a.set(e,t),a.set(t,e);for(var m=o;++l<c;){u=s[l];var h=e[u],g=t[u];if(r)var _=o?r(g,h,u,t,e,a):r(h,g,u,e,t,a);if(!(_===void 0?h===g||i(h,g,n,r,a):_)){p=!1;break}m||=u==`constructor`}if(p&&!m){var v=e.constructor,y=t.constructor;v!=y&&`constructor`in e&&`constructor`in t&&!(typeof v==`function`&&v instanceof v&&typeof y==`function`&&y instanceof y)&&(p=!1)}return a.delete(e),a.delete(t),p}var Vh=1,Hh=`[object Arguments]`,Uh=`[object Array]`,Wh=`[object Object]`,Gh=Object.prototype.hasOwnProperty;function Kh(e,t,n,r,i,a){var o=Bl(e),s=Bl(t),c=o?Uh:Vp(e),l=s?Uh:Vp(t);c=c==Hh?Wh:c,l=l==Hh?Wh:l;var u=c==Wh,d=l==Wh,f=c==l;if(f&&md(e)){if(!md(t))return!1;o=!0,u=!1}if(f&&!u)return a||=new sp,o||qd(e)?yh(e,t,n,r,i,a):Lh(e,t,c,n,r,i,a);if(!(n&Vh)){var p=u&&Gh.call(e,`__wrapped__`),m=d&&Gh.call(t,`__wrapped__`);if(p||m){var h=p?e.value():e,g=m?t.value():t;return a||=new sp,i(h,g,n,r,a)}}return f?(a||=new sp,Bh(e,t,n,r,i,a)):!1}function qh(e,t,n,r,i){return e===t?!0:e==null||t==null||!Il(e)&&!Il(t)?e!==e&&t!==t:Kh(e,t,n,r,qh,i)}var Jh=1,Yh=2;function Xh(e,t,n,r){var i=n.length,a=i,o=!r;if(e==null)return!a;for(e=Object(e);i--;){var s=n[i];if(o&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<a;){s=n[i];var c=s[0],l=e[c],u=s[1];if(o&&s[2]){if(l===void 0&&!(c in e))return!1}else{var d=new sp;if(r)var f=r(l,u,c,e,t,d);if(!(f===void 0?qh(u,l,Jh|Yh,r,d):f))return!1}}return!0}function Zh(e){return e===e&&!Yl(e)}function Qh(e){for(var t=ef(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Zh(i)]}return t}function $h(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function eg(e){var t=Qh(e);return t.length==1&&t[0][2]?$h(t[0][0],t[0][1]):function(n){return n===e||Xh(n,e,t)}}function tg(e,t){return e!=null&&t in Object(e)}function ng(e,t,n){t=Gf(t,e);for(var r=-1,i=t.length,a=!1;++r<i;){var o=qf(t[r]);if(!(a=e!=null&&n(e,o)))break;e=e[o]}return a||++r!=i?a:(i=e==null?0:e.length,!!i&&Qu(i)&&Hu(o,i)&&(Bl(e)||ld(e)))}function rg(e,t){return e!=null&&ng(e,t,tg)}var ig=1,ag=2;function og(e,t){return cf(e)&&Zh(t)?$h(qf(e),t):function(n){var r=Yf(n,e);return r===void 0&&r===t?rg(n,e):qh(t,r,ig|ag)}}function sg(e){return function(t){return t?.[e]}}function cg(e){return function(t){return Jf(t,e)}}function lg(e){return cf(e)?sg(qf(e)):cg(e)}function ug(e){return typeof e==`function`?e:e==null?ou:typeof e==`object`?Bl(e)?og(e[0],e[1]):eg(e):lg(e)}function dg(e,t,n,r){for(var i=-1,a=e==null?0:e.length;++i<a;){var o=e[i];t(r,o,n(o),e)}return r}function fg(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var c=o[e?s:++i];if(n(a[c],c,a)===!1)break}return t}}var pg=fg();function mg(e,t){return e&&pg(e,t,ef)}function hg(e,t){return function(n,r){if(n==null)return n;if(!$u(n))return e(n,r);for(var i=n.length,a=t?i:-1,o=Object(n);(t?a--:++a<i)&&r(o[a],a,o)!==!1;);return n}}var gg=hg(mg);function _g(e,t,n,r){return gg(e,function(e,i,a){t(r,e,n(e),a)}),r}function vg(e,t){return function(n,r){var i=Bl(n)?dg:_g,a=t?t():{};return i(n,e,ug(r,2),a)}}var yg=function(){return Cl.Date.now()},bg=`Expected a function`,xg=Math.max,Sg=Math.min;function Cg(e,t,n){var r,i,a,o,s,c,l=0,u=!1,d=!1,f=!0;if(typeof e!=`function`)throw TypeError(bg);t=tu(t)||0,Yl(n)&&(u=!!n.leading,d=`maxWait`in n,a=d?xg(tu(n.maxWait)||0,t):a,f=`trailing`in n?!!n.trailing:f);function p(t){var n=r,a=i;return r=i=void 0,l=t,o=e.apply(a,n),o}function m(e){return l=e,s=setTimeout(_,t),u?p(e):o}function h(e){var n=e-c,r=e-l,i=t-n;return d?Sg(i,a-r):i}function g(e){var n=e-c,r=e-l;return c===void 0||n>=t||n<0||d&&r>=a}function _(){var e=yg();if(g(e))return v(e);s=setTimeout(_,h(e))}function v(e){return s=void 0,f&&r?p(e):(r=i=void 0,o)}function y(){s!==void 0&&clearTimeout(s),l=0,r=c=i=s=void 0}function b(){return s===void 0?o:v(yg())}function x(){var e=yg(),n=g(e);if(r=arguments,i=this,c=e,n){if(s===void 0)return m(c);if(d)return clearTimeout(s),s=setTimeout(_,t),p(c)}return s===void 0&&(s=setTimeout(_,t)),o}return x.cancel=y,x.flush=b,x}function wg(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function Tg(e){return typeof e==`function`?e:ou}function Eg(e,t){for(var n=e==null?0:e.length;n--&&t(e[n],n,e)!==!1;);return e}var Dg=fg(!0);function Og(e,t){return e&&Dg(e,t,ef)}var kg=hg(Og,!0);function Ag(e,t){return(Bl(e)?Eg:kg)(e,Tg(t))}function jg(e){return e&&e.length?e[0]:void 0}function Mg(e,t){var n=-1,r=$u(e)?Array(e.length):[];return gg(e,function(e,i,a){r[++n]=t(e,i,a)}),r}function Ng(e,t){return(Bl(e)?zl:Mg)(e,ug(t,3))}var Pg=Object.prototype.hasOwnProperty,Fg=vg(function(e,t,n){Pg.call(e,n)?e[n].push(t):Uu(e,n,[t])});function Ig(e){return e!=null&&e.length?aee(e,0,-1):[]}var Lg=`[object Map]`,Rg=`[object Set]`,zg=Object.prototype.hasOwnProperty;function Bg(e){if(e==null)return!0;if($u(e)&&(Bl(e)||typeof e==`string`||typeof e.splice==`function`||md(e)||qd(e)||ld(e)))return!e.length;var t=Vp(e);if(t==Lg||t==Rg)return!e.size;if(nd(e))return!$d(e).length;for(var n in e)if(zg.call(e,n))return!1;return!0}function Vg(e,t){return qh(e,t)}function Hg(e,t){return e<t}function Ug(e,t){var n={};return t=ug(t,3),mg(e,function(e,r,i){Uu(n,r,t(e,r,i))}),n}function Wg(e,t,n){for(var r=-1,i=e.length;++r<i;){var a=e[r],o=t(a);if(o!=null&&(s===void 0?o===o&&!Rl(o):n(o,s)))var s=o,c=a}return c}function Gg(e,t){return e&&e.length?Wg(e,ug(t,2),Hg):void 0}function Kg(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}function qg(e,t){if(e!==t){var n=e!==void 0,r=e===null,i=e===e,a=Rl(e),o=t!==void 0,s=t===null,c=t===t,l=Rl(t);if(!s&&!l&&!a&&e>t||a&&o&&c&&!s&&!l||r&&o&&c||!n&&c||!i)return 1;if(!r&&!a&&!l&&e<t||l&&n&&i&&!r&&!a||s&&n&&i||!o&&i||!c)return-1}return 0}function Jg(e,t,n){for(var r=-1,i=e.criteria,a=t.criteria,o=i.length,s=n.length;++r<o;){var c=qg(i[r],a[r]);if(c)return r>=s?c:c*(n[r]==`desc`?-1:1)}return e.index-t.index}function Yg(e,t,n){t=t.length?zl(t,function(e){return Bl(e)?function(t){return Jf(t,e.length===1?e[0]:e)}:e}):[ou];var r=-1;return t=zl(t,Vd(ug)),Kg(Mg(e,function(e,n,i){return{criteria:zl(t,function(t){return t(e)}),index:++r,value:e}}),function(e,t){return Jg(e,t,n)})}var Xg=vg(function(e,t,n){e[+!n].push(t)},function(){return[[],[]]}),Zg=Math.ceil,Qg=Math.max;function $g(e,t,n,r){for(var i=-1,a=Qg(Zg((t-e)/(n||1)),0),o=Array(a);a--;)o[r?a:++i]=e,e+=n;return o}function e_(e){return function(t,n,r){return r&&typeof r!=`number`&&ed(t,n,r)&&(n=r=void 0),t=iu(t),n===void 0?(n=t,t=0):n=iu(n),r=r===void 0?t<n?1:-1:iu(r),$g(t,n,r,e)}}var t_=e_(),n_=Xu(function(e,t){if(e==null)return[];var n=t.length;return n>1&&ed(e,t[0],t[1])?t=[]:n>2&&ed(t[0],t[1],t[2])&&(t=[t[0]]),Yg(e,$f(t,1),[])}),r_=9007199254740991,i_=4294967295,a_=Math.min;function o_(e,t){if(e=au(e),e<1||e>r_)return[];var n=i_,r=a_(e,i_);t=Tg(t),e-=i_;for(var i=rd(r,t);++n<e;)t(n);return i}var s_=0;function c_(e){var t=++s_;return Wf(e)+t}var l_=n(Rc(),1),u_=e=>Array.isArray(e),d_=e=>e&&typeof e==`object`&&!u_(e),f_=e=>typeof e==`string`;function p_(e){return(...t)=>{let n=t.map(e=>__(e)),r=n[0],i=n[1];return n.length===1?t=>e(r(t)):n.length===2?t=>e(r(t),i(t)):t=>e(...n.map(e=>e(t)))}}var m_={pipe:(...e)=>{let t=e.map(e=>__(e));return e=>t.reduce((e,t)=>t(e),e)},object:e=>{let t=Object.keys(e).map(t=>[t,__(e[t])]);return e=>{let n={};for(let[r,i]of t)n[r]=i(e);return n}},array:(...e)=>{let t=e.map(e=>__(e));return e=>t.map(t=>t(e))},get:(...e)=>{if(e.length===0)return e=>e??null;if(e.length===1){let t=e[0];return e=>e?.[t]??null}return t=>{let n=t;for(let t of e)n=n?.[t];return n??null}},map:e=>{let t=__(e);return e=>e.map(t)},mapObject:e=>{let t=__(e);return e=>{let n={};for(let r of Object.keys(e)){let i=t({key:r,value:e[r]});n[i.key]=i.value}return n}},mapKeys:e=>{let t=__(e);return e=>{let n={};for(let r of Object.keys(e)){let i=t(r);n[i]=e[r]}return n}},mapValues:e=>{let t=__(e);return e=>{let n={};for(let r of Object.keys(e))n[r]=t(e[r]);return n}},filter:e=>{let t=__(e);return e=>e.filter(e=>h_(t(e)))},sort:(e=[`get`],t)=>{let n=__(e),r=t===`desc`?-1:1;function i(e,t){let i=n(e),a=n(t);return i>a?r:i<a?-r:0}return e=>e.slice().sort(i)},reverse:()=>e=>e.toReversed(),pick:(...e)=>{let t=e.map(([e,...t])=>[t[t.length-1],m_.get(...t)]),n=(e,t)=>{let n={};for(let[r,i]of t)n[r]=i(e);return n};return e=>u_(e)?e.map(e=>n(e,t)):n(e,t)},groupBy:e=>{let t=__(e);return e=>{let n={};for(let r of e){let e=t(r);n[e]?n[e].push(r):n[e]=[r]}return n}},keyBy:e=>{let t=__(e);return e=>{let n={};for(let r of e){let e=t(r);e in n||(n[e]=r)}return n}},flatten:()=>e=>e.flat(),join:(e=``)=>t=>t.join(e),split:p_((e,t)=>t===void 0?e.trim().split(/\s+/):e.split(t)),substring:p_((e,t,n)=>e.slice(Math.max(t,0),n)),uniq:()=>e=>[...new Set(e)],uniqBy:e=>t=>Object.values(m_.keyBy(e)(t)),limit:e=>t=>t.slice(0,Math.max(e,0)),size:()=>e=>e.length,keys:()=>Object.keys,values:()=>Object.values,prod:()=>e=>e.reduce((e,t)=>e*t),sum:()=>e=>e.reduce((e,t)=>e+t),average:()=>e=>m_.sum()(e)/e.length,min:()=>e=>Math.min(...e),max:()=>e=>Math.max(...e),and:p_((e,t)=>!!(e&&t)),or:p_((e,t)=>!!(e||t)),not:p_(e=>!e),exists:e=>{let t=e.slice(1),n=t.pop(),r=m_.get(...t);return e=>{let t=r(e);return!!t&&Object.hasOwnProperty.call(t,n)}},if:(e,t,n)=>{let r=__(e),i=__(t),a=__(n);return e=>h_(r(e))?i(e):a(e)},in:(e,t)=>{let n=__(e),r=__(t);return e=>r(e).includes(n(e))},"not in":(e,t)=>{let n=m_.in(e,t);return e=>!n(e)},regex:(e,t,n)=>{let r=new RegExp(t,n),i=__(e);return e=>r.test(i(e))},eq:p_((e,t)=>e===t),gt:p_((e,t)=>e>t),gte:p_((e,t)=>e>=t),lt:p_((e,t)=>e<t),lte:p_((e,t)=>e<=t),ne:p_((e,t)=>e!==t),add:p_((e,t)=>e+t),subtract:p_((e,t)=>e-t),multiply:p_((e,t)=>e*t),divide:p_((e,t)=>e/t),pow:p_((e,t)=>e**t),mod:p_((e,t)=>e%t),abs:p_(Math.abs),round:p_((e,t=0)=>+`${Math.round(+`${e}e${t}`)}e${-t}`),number:p_(e=>{let t=Number(e);return Number.isNaN(Number(e))?null:t}),string:p_(String)},h_=e=>e!==null&&e!==0&&e!==!1,g_=[];function __(e,t){g_.unshift({...m_,...g_[0],...t?.functions});try{let t=u_(e)?v_(e,g_[0]):d_(e)?y_(`Function notation ["object", {...}] expected but got ${JSON.stringify(e)}`):()=>e;return n=>{try{return t(n)}catch(t){throw t.jsonquery=[{data:n,query:e},...t.jsonquery??[]],t}}}finally{g_.shift()}}function v_(e,t){let[n,...r]=e,i=t[n];return i||y_(`Unknown function '${n}'`),i(...r)}function y_(e){throw Error(e)}var b_={and:`and`,or:`or`,eq:`==`,gt:`>`,gte:`>=`,lt:`<`,lte:`<=`,ne:`!=`,add:`+`,subtract:`-`,multiply:`*`,divide:`/`,pow:`^`,mod:`%`,in:`in`,"not in":`not in`},x_=/^[a-zA-Z_$][a-zA-Z\d_$]*$/,S_=/^[a-zA-Z_$][a-zA-Z\d_$]*/,C_=/^"(?:[^"\\]|\\.)*"/,w_=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?/,T_=/^(0|[1-9][0-9]*)/,E_=/^(true|false|null)/,D_=/^[ \n\t\r]+/;function O_(e,t){let n={...b_,...t?.operators},r=Object.keys(n).sort((e,t)=>t.length-e.length),i=()=>{v();let t=a();if(v(),e[x]===`|`){let n=[t];for(;e[x]===`|`;)x++,v(),n.push(a());return[`pipe`,...n]}return t},a=()=>{let t=o();v();for(let i of r){let r=n[i];if(e.substring(x,x+r.length)===r)return x+=r.length,v(),[i,t,o()]}return t},o=()=>{if(e[x]===`(`){x++;let e=i();return y(`)`),e}return s()},s=()=>{if(e[x]===`.`){let t=[];for(;e[x]===`.`;)x++,t.push(d()??f()??m()??b(`Property expected`));return[`get`,...t]}return c()},c=()=>{let n=x,r=f();if(v(),!r||e[x]!==`(`)return x=n,l();x++,!(t!=null&&t.functions[r])&&!m_[r]&&b(`Unknown function '${r}'`),v();let a=e[x]===`)`?[]:[i()];for(;x<e.length&&e[x]!==`)`;)v(),y(`,`),a.push(i());return y(`)`),[r,...a]},l=()=>{if(e[x]===`{`){x++,v();let t={},n=!0;for(;x<e.length&&e[x]!==`}`;){n?n=!1:(y(`,`),v());let e=d()??f()??m()??b(`Key expected`);v(),y(`:`),t[e]=i()}return y(`}`),[`object`,t]}return u()},u=()=>{if(e[x]===`[`){x++,v();let t=[],n=!0;for(;x<e.length&&e[x]!==`]`;)n?n=!1:(y(`,`),v()),t.push(i());return y(`]`),[`array`,...t]}return d()??p()??h()},d=()=>_(C_,JSON.parse),f=()=>_(S_,e=>e),p=()=>_(w_,JSON.parse),m=()=>_(T_,JSON.parse),h=()=>{let e=_(E_,JSON.parse);if(e!==void 0)return e;b(`Value expected`)},g=()=>{v(),x<e.length&&b(`Unexpected part '${e.substring(x)}'`)},_=(t,n)=>{let r=e.substring(x).match(t);if(r)return x+=r[0].length,n(r[0])},v=()=>_(D_,e=>e),y=t=>{e[x]!==t&&b(`Character '${t}' expected`),x++},b=(e,t=x)=>{throw SyntaxError(`${e} (pos: ${t})`)},x=0,S=i();return g(),S}var k_=40,A_=` `,j_=(e,t)=>{let n=t?.indentation??A_,r=(e,t)=>u_(e)?i(e,t):JSON.stringify(e),i=(e,i)=>{let[s,...l]=e;if(s===`get`&&l.length>0)return o(l);if(s===`pipe`)return c(l.map(e=>r(e,i+n)),[``,` | `,``],[``,`
|
|
13
|
+
]`}function g(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1,o=e[t]===`\\`;if(o&&=(t++,!0),dl(e[t])){let s=pl(e[t])?pl:hl(e[t])?hl:ml(e[t])?ml:fl,c=t,l=n.length,u=`"`;for(t++;;){if(t>=e.length){let i=C(t-1);return!r&&$c(e.charAt(i))?(t=c,n=n.substring(0,l),g(!0)):(u=_l(u,`"`),n+=u,!0)}else if(t===i)return u=_l(u,`"`),n+=u,!0;else if(s(e[t])){let i=t,o=u.length;if(u+=`"`,t++,n+=u,a(!1),r||t>=e.length||$c(e[t])||dl(e[t])||Zc(e[t]))return _(),!0;let s=C(i-1),d=e.charAt(s);if(d===`,`)return t=c,n=n.substring(0,l),g(!1,s);if($c(d))return t=c,n=n.substring(0,l),g(!0);n=n.substring(0,l),t=i+1,u=`${u.substring(0,o)}\\${u.substring(o)}`}else if(r&&il(e[t])){if(e[t-1]===`:`&&nl.test(e.substring(c+1,t+2)))for(;t<e.length&&rl.test(e[t]);)u+=e[t],t++;return u=_l(u,`"`),n+=u,_(),!0}else if(e[t]===`\\`){let n=e.charAt(t+1);if(xl[n]!==void 0)u+=e.slice(t,t+2),t+=2;else if(n===`u`){let n=2;for(;n<6&&Xc(e[t+n]);)n++;n===6?(u+=e.slice(t,t+6),t+=6):t+n>=e.length?t=e.length:re()}else u+=n,t+=2}else{let n=e.charAt(t);n===`"`&&e[t-1]!==`\\`?(u+=`\\${n}`,t++):sl(n)?(u+=bl[n],t++):(Qc(n)||E(n),u+=n,t++)}o&&d()}}return!1}function _(){let r=!1;for(a();e[t]===`+`;){r=!0,t++,a(),n=gl(n,`"`,!0);let e=n.length;n=g()?vl(n,e,1):_l(n,`"`)}return r}function v(){let r=t;if(e[t]===`-`){if(t++,w())return T(r),!0;if(!Zc(e[t]))return t=r,!1}for(;Zc(e[t]);)t++;if(e[t]===`.`){if(t++,w())return T(r),!0;if(!Zc(e[t]))return t=r,!1;for(;Zc(e[t]);)t++}if(e[t]===`e`||e[t]===`E`){if(t++,(e[t]===`-`||e[t]===`+`)&&t++,w())return T(r),!0;if(!Zc(e[t]))return t=r,!1;for(;Zc(e[t]);)t++}if(!w())return t=r,!1;if(t>r){let i=e.slice(r,t),a=/^0\d/.test(i);return n+=a?`"${i}"`:i,!0}return!1}function y(){return b(`true`,`true`)||b(`false`,`false`)||b(`null`,`null`)||b(`True`,`true`)||b(`False`,`false`)||b(`None`,`null`)}function b(r,i){return e.slice(t,t+r.length)===r?(n+=i,t+=r.length,!0):!1}function x(r){let a=t;if(el(e[t])){for(;t<e.length&&tl(e[t]);)t++;let n=t;for(;cl(e,n);)n++;if(e[n]===`(`)return t=n+1,i(),e[t]===`)`&&(t++,e[t]===`;`&&t++),!0}for(;t<e.length&&!il(e[t])&&!dl(e[t])&&(!r||e[t]!==`:`);)t++;if(e[t-1]===`:`&&nl.test(e.substring(a,t+2)))for(;t<e.length&&rl.test(e[t]);)t++;if(t>a){for(;cl(e,t-1)&&t>0;)t--;let r=e.slice(a,t);return n+=r===`undefined`?`null`:JSON.stringify(r),e[t]===`"`&&t++,!0}}function S(){if(e[t]===`/`){let r=t;for(t++;t<e.length&&(e[t]!==`/`||e[t-1]===`\\`);)t++;return t++,n+=`"${e.substring(r,t)}"`,!0}}function C(t){let n=t;for(;n>0&&cl(e,n);)n--;return n}function w(){return t>=e.length||$c(e[t])||cl(e,t)}function T(r){n+=`${e.slice(r,t)}0`}function E(e){throw new zc(`Invalid character ${JSON.stringify(e)}`,t)}function ee(){throw new zc(`Unexpected character ${JSON.stringify(e[t])}`,t)}function te(){throw new zc(`Unexpected end of json string`,e.length)}function D(){throw new zc(`Object key expected`,t)}function ne(){throw new zc(`Colon expected`,t)}function re(){throw new zc(`Invalid unicode character "${e.slice(t,t+6)}"`,t)}}function Cl(e,t){return e[t]===`*`&&e[t+1]===`/`}var wl=typeof global==`object`&&global&&global.Object===Object&&global,Tl=typeof self==`object`&&self&&self.Object===Object&&self,El=wl||Tl||Function(`return this`)(),Dl=El.Symbol,Ol=Object.prototype,kl=Ol.hasOwnProperty,Al=Ol.toString,jl=Dl?Dl.toStringTag:void 0;function Ml(e){var t=kl.call(e,jl),n=e[jl];try{e[jl]=void 0;var r=!0}catch{}var i=Al.call(e);return r&&(t?e[jl]=n:delete e[jl]),i}var Nl=Object.prototype.toString;function Pl(e){return Nl.call(e)}var Fl=`[object Null]`,Il=`[object Undefined]`,Ll=Dl?Dl.toStringTag:void 0;function Rl(e){return e==null?e===void 0?Il:Fl:Ll&&Ll in Object(e)?Ml(e):Pl(e)}function zl(e){return typeof e==`object`&&!!e}var Bl=`[object Symbol]`;function Vl(e){return typeof e==`symbol`||zl(e)&&Rl(e)==Bl}function Hl(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var Ul=Array.isArray,Wl=1/0,Gl=Dl?Dl.prototype:void 0,Kl=Gl?Gl.toString:void 0;function ql(e){if(typeof e==`string`)return e;if(Ul(e))return Hl(e,ql)+``;if(Vl(e))return Kl?Kl.call(e):``;var t=e+``;return t==`0`&&1/e==-Wl?`-0`:t}var Jl=/\s/;function Yl(e){for(var t=e.length;t--&&Jl.test(e.charAt(t)););return t}var Xl=/^\s+/;function Zl(e){return e&&e.slice(0,Yl(e)+1).replace(Xl,``)}function Ql(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}var $l=NaN,eu=/^[-+]0x[0-9a-f]+$/i,tu=/^0b[01]+$/i,nu=/^0o[0-7]+$/i,ru=parseInt;function iu(e){if(typeof e==`number`)return e;if(Vl(e))return $l;if(Ql(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=Ql(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=Zl(e);var n=tu.test(e);return n||nu.test(e)?ru(e.slice(2),n?2:8):eu.test(e)?$l:+e}var au=1/0,ou=17976931348623157e292;function su(e){return e?(e=iu(e),e===au||e===-au?(e<0?-1:1)*ou:e===e?e:0):e===0?e:0}function cu(e){var t=su(e),n=t%1;return t===t?n?t-n:t:0}function lu(e){return e}var uu=`[object AsyncFunction]`,du=`[object Function]`,fu=`[object GeneratorFunction]`,pu=`[object Proxy]`;function mu(e){if(!Ql(e))return!1;var t=Rl(e);return t==du||t==fu||t==uu||t==pu}var hu=El[`__core-js_shared__`],gu=function(){var e=/[^.]+$/.exec(hu&&hu.keys&&hu.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function _u(e){return!!gu&&gu in e}var vu=Function.prototype.toString;function yu(e){if(e!=null){try{return vu.call(e)}catch{}try{return e+``}catch{}}return``}var bu=/[\\^$.*+?()[\]{}|]/g,xu=/^\[object .+?Constructor\]$/,Su=Function.prototype,Cu=Object.prototype,wu=Su.toString,Tu=Cu.hasOwnProperty,Eu=RegExp(`^`+wu.call(Tu).replace(bu,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function Du(e){return!Ql(e)||_u(e)?!1:(mu(e)?Eu:xu).test(yu(e))}function Ou(e,t){return e?.[t]}function ku(e,t){var n=Ou(e,t);return Du(n)?n:void 0}var Au=ku(El,`WeakMap`),ju=Object.create,Mu=function(){function e(){}return function(t){if(!Ql(t))return{};if(ju)return ju(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Nu(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Pu(){}function Fu(e,t){var n=-1,r=e.length;for(t||=Array(r);++n<r;)t[n]=e[n];return t}var Iu=800,Lu=16,Ru=Date.now;function zu(e){var t=0,n=0;return function(){var r=Ru(),i=Lu-(r-n);if(n=r,i>0){if(++t>=Iu)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Bu(e){return function(){return e}}var Vu=function(){try{var e=ku(Object,`defineProperty`);return e({},``,{}),e}catch{}}(),Hu=zu(Vu?function(e,t){return Vu(e,`toString`,{configurable:!0,enumerable:!1,value:Bu(t),writable:!0})}:lu);function Uu(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var Wu=9007199254740991,Gu=/^(?:0|[1-9]\d*)$/;function Ku(e,t){var n=typeof e;return t??=Wu,!!t&&(n==`number`||n!=`symbol`&&Gu.test(e))&&e>-1&&e%1==0&&e<t}function qu(e,t,n){t==`__proto__`&&Vu?Vu(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Ju(e,t){return e===t||e!==e&&t!==t}var Yu=Object.prototype.hasOwnProperty;function Xu(e,t,n){var r=e[t];(!(Yu.call(e,t)&&Ju(r,n))||n===void 0&&!(t in e))&&qu(e,t,n)}function Zu(e,t,n,r){var i=!n;n||={};for(var a=-1,o=t.length;++a<o;){var s=t[a],c=r?r(n[s],e[s],s,n,e):void 0;c===void 0&&(c=e[s]),i?qu(n,s,c):Xu(n,s,c)}return n}var Qu=Math.max;function $u(e,t,n){return t=Qu(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,a=Qu(r.length-t,0),o=Array(a);++i<a;)o[i]=r[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=r[i];return s[t]=n(o),Nu(e,this,s)}}function ed(e,t){return Hu($u(e,t,lu),e+``)}var td=9007199254740991;function nd(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=td}function rd(e){return e!=null&&nd(e.length)&&!mu(e)}function id(e,t,n){if(!Ql(n))return!1;var r=typeof t;return(r==`number`?rd(n)&&Ku(t,n.length):r==`string`&&t in n)?Ju(n[t],e):!1}var ad=Object.prototype;function od(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||ad)}function sd(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var cd=`[object Arguments]`;function ld(e){return zl(e)&&Rl(e)==cd}var ud=Object.prototype,dd=ud.hasOwnProperty,fd=ud.propertyIsEnumerable,pd=ld(function(){return arguments}())?ld:function(e){return zl(e)&&dd.call(e,`callee`)&&!fd.call(e,`callee`)};function md(){return!1}var hd=typeof exports==`object`&&exports&&!exports.nodeType&&exports,gd=hd&&typeof module==`object`&&module&&!module.nodeType&&module,_d=gd&&gd.exports===hd?El.Buffer:void 0,vd=(_d?_d.isBuffer:void 0)||md,yd=`[object Arguments]`,bd=`[object Array]`,xd=`[object Boolean]`,Sd=`[object Date]`,Cd=`[object Error]`,wd=`[object Function]`,Td=`[object Map]`,Ed=`[object Number]`,Dd=`[object Object]`,Od=`[object RegExp]`,kd=`[object Set]`,Ad=`[object String]`,jd=`[object WeakMap]`,Md=`[object ArrayBuffer]`,Nd=`[object DataView]`,Pd=`[object Float32Array]`,Fd=`[object Float64Array]`,Id=`[object Int8Array]`,Ld=`[object Int16Array]`,Rd=`[object Int32Array]`,zd=`[object Uint8Array]`,Bd=`[object Uint8ClampedArray]`,Vd=`[object Uint16Array]`,Hd=`[object Uint32Array]`,Ud={};Ud[Pd]=Ud[Fd]=Ud[Id]=Ud[Ld]=Ud[Rd]=Ud[zd]=Ud[Bd]=Ud[Vd]=Ud[Hd]=!0,Ud[yd]=Ud[bd]=Ud[Md]=Ud[xd]=Ud[Nd]=Ud[Sd]=Ud[Cd]=Ud[wd]=Ud[Td]=Ud[Ed]=Ud[Dd]=Ud[Od]=Ud[kd]=Ud[Ad]=Ud[jd]=!1;function Wd(e){return zl(e)&&nd(e.length)&&!!Ud[Rl(e)]}function Gd(e){return function(t){return e(t)}}var Kd=typeof exports==`object`&&exports&&!exports.nodeType&&exports,qd=Kd&&typeof module==`object`&&module&&!module.nodeType&&module,Jd=qd&&qd.exports===Kd&&wl.process,Yd=function(){try{return qd&&qd.require&&qd.require(`util`).types||Jd&&Jd.binding&&Jd.binding(`util`)}catch{}}(),Xd=Yd&&Yd.isTypedArray,Zd=Xd?Gd(Xd):Wd,Qd=Object.prototype.hasOwnProperty;function $d(e,t){var n=Ul(e),r=!n&&pd(e),i=!n&&!r&&vd(e),a=!n&&!r&&!i&&Zd(e),o=n||r||i||a,s=o?sd(e.length,String):[],c=s.length;for(var l in e)(t||Qd.call(e,l))&&!(o&&(l==`length`||i&&(l==`offset`||l==`parent`)||a&&(l==`buffer`||l==`byteLength`||l==`byteOffset`)||Ku(l,c)))&&s.push(l);return s}function ef(e,t){return function(n){return e(t(n))}}var tf=ef(Object.keys,Object),nf=Object.prototype.hasOwnProperty;function rf(e){if(!od(e))return tf(e);var t=[];for(var n in Object(e))nf.call(e,n)&&n!=`constructor`&&t.push(n);return t}function af(e){return rd(e)?$d(e):rf(e)}function of(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var sf=Object.prototype.hasOwnProperty;function cf(e){if(!Ql(e))return of(e);var t=od(e),n=[];for(var r in e)r==`constructor`&&(t||!sf.call(e,r))||n.push(r);return n}function lf(e){return rd(e)?$d(e,!0):cf(e)}var uf=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,df=/^\w*$/;function ff(e,t){if(Ul(e))return!1;var n=typeof e;return n==`number`||n==`symbol`||n==`boolean`||e==null||Vl(e)?!0:df.test(e)||!uf.test(e)||t!=null&&e in Object(t)}var pf=ku(Object,`create`);function mf(){this.__data__=pf?pf(null):{},this.size=0}function hf(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}var gf=`__lodash_hash_undefined__`,_f=Object.prototype.hasOwnProperty;function vf(e){var t=this.__data__;if(pf){var n=t[e];return n===gf?void 0:n}return _f.call(t,e)?t[e]:void 0}var yf=Object.prototype.hasOwnProperty;function bf(e){var t=this.__data__;return pf?t[e]!==void 0:yf.call(t,e)}var xf=`__lodash_hash_undefined__`;function Sf(e,t){var n=this.__data__;return this.size+=+!this.has(e),n[e]=pf&&t===void 0?xf:t,this}function Cf(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Cf.prototype.clear=mf,Cf.prototype.delete=hf,Cf.prototype.get=vf,Cf.prototype.has=bf,Cf.prototype.set=Sf;function wf(){this.__data__=[],this.size=0}function Tf(e,t){for(var n=e.length;n--;)if(Ju(e[n][0],t))return n;return-1}var Ef=Array.prototype.splice;function Df(e){var t=this.__data__,n=Tf(t,e);return n<0?!1:(n==t.length-1?t.pop():Ef.call(t,n,1),--this.size,!0)}function Of(e){var t=this.__data__,n=Tf(t,e);return n<0?void 0:t[n][1]}function kf(e){return Tf(this.__data__,e)>-1}function Af(e,t){var n=this.__data__,r=Tf(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function jf(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}jf.prototype.clear=wf,jf.prototype.delete=Df,jf.prototype.get=Of,jf.prototype.has=kf,jf.prototype.set=Af;var Mf=ku(El,`Map`);function Nf(){this.size=0,this.__data__={hash:new Cf,map:new(Mf||jf),string:new Cf}}function Pf(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}function Ff(e,t){var n=e.__data__;return Pf(t)?n[typeof t==`string`?`string`:`hash`]:n.map}function If(e){var t=Ff(this,e).delete(e);return this.size-=+!!t,t}function Lf(e){return Ff(this,e).get(e)}function Rf(e){return Ff(this,e).has(e)}function zf(e,t){var n=Ff(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function Bf(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Bf.prototype.clear=Nf,Bf.prototype.delete=If,Bf.prototype.get=Lf,Bf.prototype.has=Rf,Bf.prototype.set=zf;var Vf=`Expected a function`;function Hf(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(Vf);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(Hf.Cache||Bf),n}Hf.Cache=Bf;var Uf=500;function Wf(e){var t=Hf(e,function(e){return n.size===Uf&&n.clear(),e}),n=t.cache;return t}var Gf=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Kf=/\\(\\)?/g,qf=Wf(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(Gf,function(e,n,r,i){t.push(r?i.replace(Kf,`$1`):n||e)}),t});function Jf(e){return e==null?``:ql(e)}function Yf(e,t){return Ul(e)?e:ff(e,t)?[e]:qf(Jf(e))}var Xf=1/0;function Zf(e){if(typeof e==`string`||Vl(e))return e;var t=e+``;return t==`0`&&1/e==-Xf?`-0`:t}function Qf(e,t){t=Yf(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[Zf(t[n++])];return n&&n==r?e:void 0}function $f(e,t,n){var r=e==null?void 0:Qf(e,t);return r===void 0?n:r}function ep(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var tp=Dl?Dl.isConcatSpreadable:void 0;function np(e){return Ul(e)||pd(e)||!!(tp&&e&&e[tp])}function rp(e,t,n,r,i){var a=-1,o=e.length;for(n||=np,i||=[];++a<o;){var s=e[a];t>0&&n(s)?t>1?rp(s,t-1,n,r,i):ep(i,s):r||(i[i.length]=s)}return i}var ip=ef(Object.getPrototypeOf,Object);function ap(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r<i;)a[r]=e[r+t];return a}function op(){this.__data__=new jf,this.size=0}function sp(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function cp(e){return this.__data__.get(e)}function lp(e){return this.__data__.has(e)}var up=200;function dp(e,t){var n=this.__data__;if(n instanceof jf){var r=n.__data__;if(!Mf||r.length<up-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Bf(r)}return n.set(e,t),this.size=n.size,this}function fp(e){var t=this.__data__=new jf(e);this.size=t.size}fp.prototype.clear=op,fp.prototype.delete=sp,fp.prototype.get=cp,fp.prototype.has=lp,fp.prototype.set=dp;function pp(e,t){return e&&Zu(t,af(t),e)}function mp(e,t){return e&&Zu(t,lf(t),e)}var hp=typeof exports==`object`&&exports&&!exports.nodeType&&exports,gp=hp&&typeof module==`object`&&module&&!module.nodeType&&module,_p=gp&&gp.exports===hp?El.Buffer:void 0,vp=_p?_p.allocUnsafe:void 0;function yp(e,t){if(t)return e.slice();var n=e.length,r=vp?vp(n):new e.constructor(n);return e.copy(r),r}function bp(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}function xp(){return[]}var Sp=Object.prototype.propertyIsEnumerable,Cp=Object.getOwnPropertySymbols,wp=Cp?function(e){return e==null?[]:(e=Object(e),bp(Cp(e),function(t){return Sp.call(e,t)}))}:xp;function Tp(e,t){return Zu(e,wp(e),t)}var Ep=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)ep(t,wp(e)),e=ip(e);return t}:xp;function Dp(e,t){return Zu(e,Ep(e),t)}function Op(e,t,n){var r=t(e);return Ul(e)?r:ep(r,n(e))}function kp(e){return Op(e,af,wp)}function Ap(e){return Op(e,lf,Ep)}var jp=ku(El,`DataView`),Mp=ku(El,`Promise`),Np=ku(El,`Set`),Pp=`[object Map]`,Fp=`[object Object]`,Ip=`[object Promise]`,Lp=`[object Set]`,Rp=`[object WeakMap]`,zp=`[object DataView]`,Bp=yu(jp),Vp=yu(Mf),Hp=yu(Mp),Up=yu(Np),Wp=yu(Au),Gp=Rl;(jp&&Gp(new jp(new ArrayBuffer(1)))!=zp||Mf&&Gp(new Mf)!=Pp||Mp&&Gp(Mp.resolve())!=Ip||Np&&Gp(new Np)!=Lp||Au&&Gp(new Au)!=Rp)&&(Gp=function(e){var t=Rl(e),n=t==Fp?e.constructor:void 0,r=n?yu(n):``;if(r)switch(r){case Bp:return zp;case Vp:return Pp;case Hp:return Ip;case Up:return Lp;case Wp:return Rp}return t});var Kp=Gp,qp=Object.prototype.hasOwnProperty;function Jp(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]==`string`&&qp.call(e,`index`)&&(n.index=e.index,n.input=e.input),n}var Yp=El.Uint8Array;function Xp(e){var t=new e.constructor(e.byteLength);return new Yp(t).set(new Yp(e)),t}function Zp(e,t){var n=t?Xp(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var Qp=/\w*$/;function $p(e){var t=new e.constructor(e.source,Qp.exec(e));return t.lastIndex=e.lastIndex,t}var em=Dl?Dl.prototype:void 0,tm=em?em.valueOf:void 0;function nm(e){return tm?Object(tm.call(e)):{}}function rm(e,t){var n=t?Xp(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var im=`[object Boolean]`,am=`[object Date]`,om=`[object Map]`,sm=`[object Number]`,cm=`[object RegExp]`,lm=`[object Set]`,um=`[object String]`,dm=`[object Symbol]`,fm=`[object ArrayBuffer]`,pm=`[object DataView]`,mm=`[object Float32Array]`,hm=`[object Float64Array]`,gm=`[object Int8Array]`,_m=`[object Int16Array]`,vm=`[object Int32Array]`,ym=`[object Uint8Array]`,bm=`[object Uint8ClampedArray]`,xm=`[object Uint16Array]`,Sm=`[object Uint32Array]`;function Cm(e,t,n){var r=e.constructor;switch(t){case fm:return Xp(e);case im:case am:return new r(+e);case pm:return Zp(e,n);case mm:case hm:case gm:case _m:case vm:case ym:case bm:case xm:case Sm:return rm(e,n);case om:return new r;case sm:case um:return new r(e);case cm:return $p(e);case lm:return new r;case dm:return nm(e)}}function wm(e){return typeof e.constructor==`function`&&!od(e)?Mu(ip(e)):{}}var Tm=`[object Map]`;function Em(e){return zl(e)&&Kp(e)==Tm}var Dm=Yd&&Yd.isMap,Om=Dm?Gd(Dm):Em,km=`[object Set]`;function Am(e){return zl(e)&&Kp(e)==km}var jm=Yd&&Yd.isSet,Mm=jm?Gd(jm):Am,Nm=1,Pm=2,Fm=4,Im=`[object Arguments]`,Lm=`[object Array]`,Rm=`[object Boolean]`,zm=`[object Date]`,Bm=`[object Error]`,Vm=`[object Function]`,Hm=`[object GeneratorFunction]`,Um=`[object Map]`,Wm=`[object Number]`,Gm=`[object Object]`,Km=`[object RegExp]`,qm=`[object Set]`,Jm=`[object String]`,Ym=`[object Symbol]`,Xm=`[object WeakMap]`,Zm=`[object ArrayBuffer]`,Qm=`[object DataView]`,$m=`[object Float32Array]`,eh=`[object Float64Array]`,th=`[object Int8Array]`,nh=`[object Int16Array]`,rh=`[object Int32Array]`,ih=`[object Uint8Array]`,ah=`[object Uint8ClampedArray]`,oh=`[object Uint16Array]`,sh=`[object Uint32Array]`,ch={};ch[Im]=ch[Lm]=ch[Zm]=ch[Qm]=ch[Rm]=ch[zm]=ch[$m]=ch[eh]=ch[th]=ch[nh]=ch[rh]=ch[Um]=ch[Wm]=ch[Gm]=ch[Km]=ch[qm]=ch[Jm]=ch[Ym]=ch[ih]=ch[ah]=ch[oh]=ch[sh]=!0,ch[Bm]=ch[Vm]=ch[Xm]=!1;function lh(e,t,n,r,i,a){var o,s=t&Nm,c=t&Pm,l=t&Fm;if(n&&(o=i?n(e,r,i,a):n(e)),o!==void 0)return o;if(!Ql(e))return e;var u=Ul(e);if(u){if(o=Jp(e),!s)return Fu(e,o)}else{var d=Kp(e),f=d==Vm||d==Hm;if(vd(e))return yp(e,s);if(d==Gm||d==Im||f&&!i){if(o=c||f?{}:wm(e),!s)return c?Dp(e,mp(o,e)):Tp(e,pp(o,e))}else{if(!ch[d])return i?e:{};o=Cm(e,d,s)}}a||=new fp;var p=a.get(e);if(p)return p;a.set(e,o),Mm(e)?e.forEach(function(r){o.add(lh(r,t,n,r,e,a))}):Om(e)&&e.forEach(function(r,i){o.set(i,lh(r,t,n,i,e,a))});var m=u?void 0:(l?c?Ap:kp:c?lf:af)(e);return Uu(m||e,function(r,i){m&&(i=r,r=e[i]),Xu(o,i,lh(r,t,n,i,e,a))}),o}var uh=1,dh=4;function fh(e){return lh(e,uh|dh)}var ph=1,mh=4;function hh(e,t){return t=typeof t==`function`?t:void 0,lh(e,ph|mh,t)}var gh=`__lodash_hash_undefined__`;function _h(e){return this.__data__.set(e,gh),this}function vh(e){return this.__data__.has(e)}function yh(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Bf;++t<n;)this.add(e[t])}yh.prototype.add=yh.prototype.push=_h,yh.prototype.has=vh;function bh(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function xh(e,t){return e.has(t)}var Sh=1,Ch=2;function wh(e,t,n,r,i,a){var o=n&Sh,s=e.length,c=t.length;if(s!=c&&!(o&&c>s))return!1;var l=a.get(e),u=a.get(t);if(l&&u)return l==t&&u==e;var d=-1,f=!0,p=n&Ch?new yh:void 0;for(a.set(e,t),a.set(t,e);++d<s;){var m=e[d],h=t[d];if(r)var g=o?r(h,m,d,t,e,a):r(m,h,d,e,t,a);if(g!==void 0){if(g)continue;f=!1;break}if(p){if(!bh(t,function(e,t){if(!xh(p,t)&&(m===e||i(m,e,n,r,a)))return p.push(t)})){f=!1;break}}else if(!(m===h||i(m,h,n,r,a))){f=!1;break}}return a.delete(e),a.delete(t),f}function Th(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function Eh(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var Dh=1,Oh=2,kh=`[object Boolean]`,Ah=`[object Date]`,jh=`[object Error]`,Mh=`[object Map]`,Nh=`[object Number]`,Ph=`[object RegExp]`,Fh=`[object Set]`,Ih=`[object String]`,Lh=`[object Symbol]`,Rh=`[object ArrayBuffer]`,zh=`[object DataView]`,Bh=Dl?Dl.prototype:void 0,Vh=Bh?Bh.valueOf:void 0;function Hh(e,t,n,r,i,a,o){switch(n){case zh:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Rh:return!(e.byteLength!=t.byteLength||!a(new Yp(e),new Yp(t)));case kh:case Ah:case Nh:return Ju(+e,+t);case jh:return e.name==t.name&&e.message==t.message;case Ph:case Ih:return e==t+``;case Mh:var s=Th;case Fh:var c=r&Dh;if(s||=Eh,e.size!=t.size&&!c)return!1;var l=o.get(e);if(l)return l==t;r|=Oh,o.set(e,t);var u=wh(s(e),s(t),r,i,a,o);return o.delete(e),u;case Lh:if(Vh)return Vh.call(e)==Vh.call(t)}return!1}var Uh=1,Wh=Object.prototype.hasOwnProperty;function Gh(e,t,n,r,i,a){var o=n&Uh,s=kp(e),c=s.length;if(c!=kp(t).length&&!o)return!1;for(var l=c;l--;){var u=s[l];if(!(o?u in t:Wh.call(t,u)))return!1}var d=a.get(e),f=a.get(t);if(d&&f)return d==t&&f==e;var p=!0;a.set(e,t),a.set(t,e);for(var m=o;++l<c;){u=s[l];var h=e[u],g=t[u];if(r)var _=o?r(g,h,u,t,e,a):r(h,g,u,e,t,a);if(!(_===void 0?h===g||i(h,g,n,r,a):_)){p=!1;break}m||=u==`constructor`}if(p&&!m){var v=e.constructor,y=t.constructor;v!=y&&`constructor`in e&&`constructor`in t&&!(typeof v==`function`&&v instanceof v&&typeof y==`function`&&y instanceof y)&&(p=!1)}return a.delete(e),a.delete(t),p}var Kh=1,qh=`[object Arguments]`,Jh=`[object Array]`,Yh=`[object Object]`,Xh=Object.prototype.hasOwnProperty;function Zh(e,t,n,r,i,a){var o=Ul(e),s=Ul(t),c=o?Jh:Kp(e),l=s?Jh:Kp(t);c=c==qh?Yh:c,l=l==qh?Yh:l;var u=c==Yh,d=l==Yh,f=c==l;if(f&&vd(e)){if(!vd(t))return!1;o=!0,u=!1}if(f&&!u)return a||=new fp,o||Zd(e)?wh(e,t,n,r,i,a):Hh(e,t,c,n,r,i,a);if(!(n&Kh)){var p=u&&Xh.call(e,`__wrapped__`),m=d&&Xh.call(t,`__wrapped__`);if(p||m){var h=p?e.value():e,g=m?t.value():t;return a||=new fp,i(h,g,n,r,a)}}return f?(a||=new fp,Gh(e,t,n,r,i,a)):!1}function Qh(e,t,n,r,i){return e===t?!0:e==null||t==null||!zl(e)&&!zl(t)?e!==e&&t!==t:Zh(e,t,n,r,Qh,i)}var $h=1,eg=2;function tg(e,t,n,r){var i=n.length,a=i,o=!r;if(e==null)return!a;for(e=Object(e);i--;){var s=n[i];if(o&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<a;){s=n[i];var c=s[0],l=e[c],u=s[1];if(o&&s[2]){if(l===void 0&&!(c in e))return!1}else{var d=new fp;if(r)var f=r(l,u,c,e,t,d);if(!(f===void 0?Qh(u,l,$h|eg,r,d):f))return!1}}return!0}function ng(e){return e===e&&!Ql(e)}function rg(e){for(var t=af(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,ng(i)]}return t}function ig(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function ag(e){var t=rg(e);return t.length==1&&t[0][2]?ig(t[0][0],t[0][1]):function(n){return n===e||tg(n,e,t)}}function og(e,t){return e!=null&&t in Object(e)}function sg(e,t,n){t=Yf(t,e);for(var r=-1,i=t.length,a=!1;++r<i;){var o=Zf(t[r]);if(!(a=e!=null&&n(e,o)))break;e=e[o]}return a||++r!=i?a:(i=e==null?0:e.length,!!i&&nd(i)&&Ku(o,i)&&(Ul(e)||pd(e)))}function cg(e,t){return e!=null&&sg(e,t,og)}var lg=1,ug=2;function dg(e,t){return ff(e)&&ng(t)?ig(Zf(e),t):function(n){var r=$f(n,e);return r===void 0&&r===t?cg(n,e):Qh(t,r,lg|ug)}}function fg(e){return function(t){return t?.[e]}}function pg(e){return function(t){return Qf(t,e)}}function mg(e){return ff(e)?fg(Zf(e)):pg(e)}function hg(e){return typeof e==`function`?e:e==null?lu:typeof e==`object`?Ul(e)?dg(e[0],e[1]):ag(e):mg(e)}function gg(e,t,n,r){for(var i=-1,a=e==null?0:e.length;++i<a;){var o=e[i];t(r,o,n(o),e)}return r}function _g(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var c=o[e?s:++i];if(n(a[c],c,a)===!1)break}return t}}var vg=_g();function yg(e,t){return e&&vg(e,t,af)}function bg(e,t){return function(n,r){if(n==null)return n;if(!rd(n))return e(n,r);for(var i=n.length,a=t?i:-1,o=Object(n);(t?a--:++a<i)&&r(o[a],a,o)!==!1;);return n}}var xg=bg(yg);function Sg(e,t,n,r){return xg(e,function(e,i,a){t(r,e,n(e),a)}),r}function Cg(e,t){return function(n,r){var i=Ul(n)?gg:Sg,a=t?t():{};return i(n,e,hg(r,2),a)}}var wg=function(){return El.Date.now()},Tg=`Expected a function`,Eg=Math.max,Dg=Math.min;function Og(e,t,n){var r,i,a,o,s,c,l=0,u=!1,d=!1,f=!0;if(typeof e!=`function`)throw TypeError(Tg);t=iu(t)||0,Ql(n)&&(u=!!n.leading,d=`maxWait`in n,a=d?Eg(iu(n.maxWait)||0,t):a,f=`trailing`in n?!!n.trailing:f);function p(t){var n=r,a=i;return r=i=void 0,l=t,o=e.apply(a,n),o}function m(e){return l=e,s=setTimeout(_,t),u?p(e):o}function h(e){var n=e-c,r=e-l,i=t-n;return d?Dg(i,a-r):i}function g(e){var n=e-c,r=e-l;return c===void 0||n>=t||n<0||d&&r>=a}function _(){var e=wg();if(g(e))return v(e);s=setTimeout(_,h(e))}function v(e){return s=void 0,f&&r?p(e):(r=i=void 0,o)}function y(){s!==void 0&&clearTimeout(s),l=0,r=c=i=s=void 0}function b(){return s===void 0?o:v(wg())}function x(){var e=wg(),n=g(e);if(r=arguments,i=this,c=e,n){if(s===void 0)return m(c);if(d)return clearTimeout(s),s=setTimeout(_,t),p(c)}return s===void 0&&(s=setTimeout(_,t)),o}return x.cancel=y,x.flush=b,x}function kg(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function Ag(e){return typeof e==`function`?e:lu}function jg(e,t){for(var n=e==null?0:e.length;n--&&t(e[n],n,e)!==!1;);return e}var iee=_g(!0);function aee(e,t){return e&&iee(e,t,af)}var oee=bg(aee,!0);function see(e,t){return(Ul(e)?jg:oee)(e,Ag(t))}function Mg(e){return e&&e.length?e[0]:void 0}function Ng(e,t){var n=-1,r=rd(e)?Array(e.length):[];return xg(e,function(e,i,a){r[++n]=t(e,i,a)}),r}function Pg(e,t){return(Ul(e)?Hl:Ng)(e,hg(t,3))}var Fg=Object.prototype.hasOwnProperty,Ig=Cg(function(e,t,n){Fg.call(e,n)?e[n].push(t):qu(e,n,[t])});function Lg(e){return e!=null&&e.length?ap(e,0,-1):[]}var Rg=`[object Map]`,zg=`[object Set]`,Bg=Object.prototype.hasOwnProperty;function Vg(e){if(e==null)return!0;if(rd(e)&&(Ul(e)||typeof e==`string`||typeof e.splice==`function`||vd(e)||Zd(e)||pd(e)))return!e.length;var t=Kp(e);if(t==Rg||t==zg)return!e.size;if(od(e))return!rf(e).length;for(var n in e)if(Bg.call(e,n))return!1;return!0}function Hg(e,t){return Qh(e,t)}function Ug(e,t){return e<t}function cee(e,t){var n={};return t=hg(t,3),yg(e,function(e,r,i){qu(n,r,t(e,r,i))}),n}function Wg(e,t,n){for(var r=-1,i=e.length;++r<i;){var a=e[r],o=t(a);if(o!=null&&(s===void 0?o===o&&!Vl(o):n(o,s)))var s=o,c=a}return c}function Gg(e,t){return e&&e.length?Wg(e,hg(t,2),Ug):void 0}function Kg(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}function qg(e,t){if(e!==t){var n=e!==void 0,r=e===null,i=e===e,a=Vl(e),o=t!==void 0,s=t===null,c=t===t,l=Vl(t);if(!s&&!l&&!a&&e>t||a&&o&&c&&!s&&!l||r&&o&&c||!n&&c||!i)return 1;if(!r&&!a&&!l&&e<t||l&&n&&i&&!r&&!a||s&&n&&i||!o&&i||!c)return-1}return 0}function Jg(e,t,n){for(var r=-1,i=e.criteria,a=t.criteria,o=i.length,s=n.length;++r<o;){var c=qg(i[r],a[r]);if(c)return r>=s?c:c*(n[r]==`desc`?-1:1)}return e.index-t.index}function Yg(e,t,n){t=t.length?Hl(t,function(e){return Ul(e)?function(t){return Qf(t,e.length===1?e[0]:e)}:e}):[lu];var r=-1;return t=Hl(t,Gd(hg)),Kg(Ng(e,function(e,n,i){return{criteria:Hl(t,function(t){return t(e)}),index:++r,value:e}}),function(e,t){return Jg(e,t,n)})}var Xg=Cg(function(e,t,n){e[+!n].push(t)},function(){return[[],[]]}),Zg=Math.ceil,Qg=Math.max;function $g(e,t,n,r){for(var i=-1,a=Qg(Zg((t-e)/(n||1)),0),o=Array(a);a--;)o[r?a:++i]=e,e+=n;return o}function e_(e){return function(t,n,r){return r&&typeof r!=`number`&&id(t,n,r)&&(n=r=void 0),t=su(t),n===void 0?(n=t,t=0):n=su(n),r=r===void 0?t<n?1:-1:su(r),$g(t,n,r,e)}}var t_=e_(),n_=ed(function(e,t){if(e==null)return[];var n=t.length;return n>1&&id(e,t[0],t[1])?t=[]:n>2&&id(t[0],t[1],t[2])&&(t=[t[0]]),Yg(e,rp(t,1),[])}),r_=9007199254740991,i_=4294967295,a_=Math.min;function o_(e,t){if(e=cu(e),e<1||e>r_)return[];var n=i_,r=a_(e,i_);t=Ag(t),e-=i_;for(var i=sd(r,t);++n<e;)t(n);return i}var s_=0;function c_(e){var t=++s_;return Jf(e)+t}var l_=n(Rc(),1),u_=e=>Array.isArray(e),d_=e=>e&&typeof e==`object`&&!u_(e),f_=e=>typeof e==`string`;function p_(e){return(...t)=>{let n=t.map(e=>__(e)),r=n[0],i=n[1];return n.length===1?t=>e(r(t)):n.length===2?t=>e(r(t),i(t)):t=>e(...n.map(e=>e(t)))}}var m_={pipe:(...e)=>{let t=e.map(e=>__(e));return e=>t.reduce((e,t)=>t(e),e)},object:e=>{let t=Object.keys(e).map(t=>[t,__(e[t])]);return e=>{let n={};for(let[r,i]of t)n[r]=i(e);return n}},array:(...e)=>{let t=e.map(e=>__(e));return e=>t.map(t=>t(e))},get:(...e)=>{if(e.length===0)return e=>e??null;if(e.length===1){let t=e[0];return e=>e?.[t]??null}return t=>{let n=t;for(let t of e)n=n?.[t];return n??null}},map:e=>{let t=__(e);return e=>e.map(t)},mapObject:e=>{let t=__(e);return e=>{let n={};for(let r of Object.keys(e)){let i=t({key:r,value:e[r]});n[i.key]=i.value}return n}},mapKeys:e=>{let t=__(e);return e=>{let n={};for(let r of Object.keys(e)){let i=t(r);n[i]=e[r]}return n}},mapValues:e=>{let t=__(e);return e=>{let n={};for(let r of Object.keys(e))n[r]=t(e[r]);return n}},filter:e=>{let t=__(e);return e=>e.filter(e=>h_(t(e)))},sort:(e=[`get`],t)=>{let n=__(e),r=t===`desc`?-1:1;function i(e,t){let i=n(e),a=n(t);return i>a?r:i<a?-r:0}return e=>e.slice().sort(i)},reverse:()=>e=>e.toReversed(),pick:(...e)=>{let t=e.map(([e,...t])=>[t[t.length-1],m_.get(...t)]),n=(e,t)=>{let n={};for(let[r,i]of t)n[r]=i(e);return n};return e=>u_(e)?e.map(e=>n(e,t)):n(e,t)},groupBy:e=>{let t=__(e);return e=>{let n={};for(let r of e){let e=t(r);n[e]?n[e].push(r):n[e]=[r]}return n}},keyBy:e=>{let t=__(e);return e=>{let n={};for(let r of e){let e=t(r);e in n||(n[e]=r)}return n}},flatten:()=>e=>e.flat(),join:(e=``)=>t=>t.join(e),split:p_((e,t)=>t===void 0?e.trim().split(/\s+/):e.split(t)),substring:p_((e,t,n)=>e.slice(Math.max(t,0),n)),uniq:()=>e=>[...new Set(e)],uniqBy:e=>t=>Object.values(m_.keyBy(e)(t)),limit:e=>t=>t.slice(0,Math.max(e,0)),size:()=>e=>e.length,keys:()=>Object.keys,values:()=>Object.values,prod:()=>e=>e.reduce((e,t)=>e*t),sum:()=>e=>e.reduce((e,t)=>e+t),average:()=>e=>m_.sum()(e)/e.length,min:()=>e=>Math.min(...e),max:()=>e=>Math.max(...e),and:p_((e,t)=>!!(e&&t)),or:p_((e,t)=>!!(e||t)),not:p_(e=>!e),exists:e=>{let t=e.slice(1),n=t.pop(),r=m_.get(...t);return e=>{let t=r(e);return!!t&&Object.hasOwnProperty.call(t,n)}},if:(e,t,n)=>{let r=__(e),i=__(t),a=__(n);return e=>h_(r(e))?i(e):a(e)},in:(e,t)=>{let n=__(e),r=__(t);return e=>r(e).includes(n(e))},"not in":(e,t)=>{let n=m_.in(e,t);return e=>!n(e)},regex:(e,t,n)=>{let r=new RegExp(t,n),i=__(e);return e=>r.test(i(e))},eq:p_((e,t)=>e===t),gt:p_((e,t)=>e>t),gte:p_((e,t)=>e>=t),lt:p_((e,t)=>e<t),lte:p_((e,t)=>e<=t),ne:p_((e,t)=>e!==t),add:p_((e,t)=>e+t),subtract:p_((e,t)=>e-t),multiply:p_((e,t)=>e*t),divide:p_((e,t)=>e/t),pow:p_((e,t)=>e**t),mod:p_((e,t)=>e%t),abs:p_(Math.abs),round:p_((e,t=0)=>+`${Math.round(+`${e}e${t}`)}e${-t}`),number:p_(e=>{let t=Number(e);return Number.isNaN(Number(e))?null:t}),string:p_(String)},h_=e=>e!==null&&e!==0&&e!==!1,g_=[];function __(e,t){g_.unshift({...m_,...g_[0],...t?.functions});try{let t=u_(e)?v_(e,g_[0]):d_(e)?y_(`Function notation ["object", {...}] expected but got ${JSON.stringify(e)}`):()=>e;return n=>{try{return t(n)}catch(t){throw t.jsonquery=[{data:n,query:e},...t.jsonquery??[]],t}}}finally{g_.shift()}}function v_(e,t){let[n,...r]=e,i=t[n];return i||y_(`Unknown function '${n}'`),i(...r)}function y_(e){throw Error(e)}var b_={and:`and`,or:`or`,eq:`==`,gt:`>`,gte:`>=`,lt:`<`,lte:`<=`,ne:`!=`,add:`+`,subtract:`-`,multiply:`*`,divide:`/`,pow:`^`,mod:`%`,in:`in`,"not in":`not in`},x_=/^[a-zA-Z_$][a-zA-Z\d_$]*$/,S_=/^[a-zA-Z_$][a-zA-Z\d_$]*/,C_=/^"(?:[^"\\]|\\.)*"/,w_=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?/,T_=/^(0|[1-9][0-9]*)/,E_=/^(true|false|null)/,D_=/^[ \n\t\r]+/;function O_(e,t){let n={...b_,...t?.operators},r=Object.keys(n).sort((e,t)=>t.length-e.length),i=()=>{v();let t=a();if(v(),e[x]===`|`){let n=[t];for(;e[x]===`|`;)x++,v(),n.push(a());return[`pipe`,...n]}return t},a=()=>{let t=o();v();for(let i of r){let r=n[i];if(e.substring(x,x+r.length)===r)return x+=r.length,v(),[i,t,o()]}return t},o=()=>{if(e[x]===`(`){x++;let e=i();return y(`)`),e}return s()},s=()=>{if(e[x]===`.`){let t=[];for(;e[x]===`.`;)x++,t.push(d()??f()??m()??b(`Property expected`));return[`get`,...t]}return c()},c=()=>{let n=x,r=f();if(v(),!r||e[x]!==`(`)return x=n,l();x++,!(t!=null&&t.functions[r])&&!m_[r]&&b(`Unknown function '${r}'`),v();let a=e[x]===`)`?[]:[i()];for(;x<e.length&&e[x]!==`)`;)v(),y(`,`),a.push(i());return y(`)`),[r,...a]},l=()=>{if(e[x]===`{`){x++,v();let t={},n=!0;for(;x<e.length&&e[x]!==`}`;){n?n=!1:(y(`,`),v());let e=d()??f()??m()??b(`Key expected`);v(),y(`:`),t[e]=i()}return y(`}`),[`object`,t]}return u()},u=()=>{if(e[x]===`[`){x++,v();let t=[],n=!0;for(;x<e.length&&e[x]!==`]`;)n?n=!1:(y(`,`),v()),t.push(i());return y(`]`),[`array`,...t]}return d()??p()??h()},d=()=>_(C_,JSON.parse),f=()=>_(S_,e=>e),p=()=>_(w_,JSON.parse),m=()=>_(T_,JSON.parse),h=()=>{let e=_(E_,JSON.parse);if(e!==void 0)return e;b(`Value expected`)},g=()=>{v(),x<e.length&&b(`Unexpected part '${e.substring(x)}'`)},_=(t,n)=>{let r=e.substring(x).match(t);if(r)return x+=r[0].length,n(r[0])},v=()=>_(D_,e=>e),y=t=>{e[x]!==t&&b(`Character '${t}' expected`),x++},b=(e,t=x)=>{throw SyntaxError(`${e} (pos: ${t})`)},x=0,S=i();return g(),S}var k_=40,A_=` `,j_=(e,t)=>{let n=t?.indentation??A_,r=(e,t)=>u_(e)?i(e,t):JSON.stringify(e),i=(e,i)=>{let[s,...l]=e;if(s===`get`&&l.length>0)return o(l);if(s===`pipe`)return c(l.map(e=>r(e,i+n)),[``,` | `,``],[``,`
|
|
14
14
|
${i+n}| `,``]);if(s===`object`)return a(l[0],i);if(s===`array`)return c(l.map(e=>r(e,i)),[`[`,`, `,`]`],[`[
|
|
15
15
|
${i+n}`,`,
|
|
16
16
|
${i+n}`,`
|
|
@@ -37,11 +37,11 @@ ${t}}`])},o=e=>e.map(e=>`.${s(e)}`).join(``),s=e=>x_.test(e)?e:JSON.stringify(e)
|
|
|
37
37
|
`)}static newName(){let e=kS[DS]||1;return kS[DS]=e+1,ES+e.toString(36)}static mount(e,t,n){let r=e[OS],i=n&&n.nonce;r?i&&r.setNonce(i):r=new MS(e,i),r.mount(Array.isArray(t)?t:[t],e)}},jS=new Map,MS=class{constructor(e,t){let n=e.ownerDocument||e,r=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let t=jS.get(n);if(t)return e[OS]=t;this.sheet=new r.CSSStyleSheet,jS.set(n,this)}else this.styleTag=n.createElement(`style`),t&&this.styleTag.setAttribute(`nonce`,t);this.modules=[],e[OS]=this}mount(e,t){let n=this.sheet,r=0,i=0;for(let t=0;t<e.length;t++){let a=e[t],o=this.modules.indexOf(a);if(o<i&&o>-1&&(this.modules.splice(o,1),i--,o=-1),o==-1){if(this.modules.splice(i++,0,a),n)for(let e=0;e<a.rules.length;e++)n.insertRule(a.rules[e],r++)}else{for(;i<o;)r+=this.modules[i++].rules.length;r+=a.rules.length,i++}}if(n)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let e=``;for(let t=0;t<this.modules.length;t++)e+=this.modules[t].getRules()+`
|
|
38
38
|
`;this.styleTag.textContent=e;let n=t.head||t;this.styleTag.parentNode!=n&&n.insertBefore(this.styleTag,n.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute(`nonce`)!=e&&this.styleTag.setAttribute(`nonce`,e)}},NS={8:`Backspace`,9:`Tab`,10:`Enter`,12:`NumLock`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,44:`PrintScreen`,45:`Insert`,46:`Delete`,59:`;`,61:`=`,91:`Meta`,92:`Meta`,106:`*`,107:`+`,108:`,`,109:`-`,110:`.`,111:`/`,144:`NumLock`,145:`ScrollLock`,160:`Shift`,161:`Shift`,162:`Control`,163:`Control`,164:`Alt`,165:`Alt`,173:`-`,186:`;`,187:`=`,188:`,`,189:`-`,190:`.`,191:`/`,192:"`",219:`[`,220:`\\`,221:`]`,222:`'`},PS={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`"`},FS=typeof navigator<`u`&&/Mac/.test(navigator.platform),IS=typeof navigator<`u`&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),LS=0;LS<10;LS++)NS[48+LS]=NS[96+LS]=String(LS);for(var LS=1;LS<=24;LS++)NS[LS+111]=`F`+LS;for(var LS=65;LS<=90;LS++)NS[LS]=String.fromCharCode(LS+32),PS[LS]=String.fromCharCode(LS);for(var RS in NS)PS.hasOwnProperty(RS)||(PS[RS]=NS[RS]);function zS(e){var t=!(FS&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||IS&&e.shiftKey&&e.key&&e.key.length==1||e.key==`Unidentified`)&&e.key||(e.shiftKey?PS:NS)[e.keyCode]||e.key||`Unidentified`;return t==`Esc`&&(t=`Escape`),t==`Del`&&(t=`Delete`),t==`Left`&&(t=`ArrowLeft`),t==`Up`&&(t=`ArrowUp`),t==`Right`&&(t=`ArrowRight`),t==`Down`&&(t=`ArrowDown`),t}function BS(e){let t;return t=e.nodeType==11?e.getSelection?e:e.ownerDocument:e,t.getSelection()}function VS(e,t){return t?e==t||e.contains(t.nodeType==1?t:t.parentNode):!1}function HS(e,t){if(!t.anchorNode)return!1;try{return VS(e,t.anchorNode)}catch{return!1}}function US(e){return e.nodeType==3?iC(e,0,e.nodeValue.length).getClientRects():e.nodeType==1?e.getClientRects():[]}function WS(e,t,n,r){return n?qS(e,t,n,r,-1)||qS(e,t,n,r,1):!1}function GS(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t}function KS(e){return e.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function qS(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:JS(e))){if(e.nodeName==`DIV`)return!1;let n=e.parentNode;if(!n||n.nodeType!=1)return!1;t=GS(e)+(i<0?0:1),e=n}else if(e.nodeType==1){if(e=e.childNodes[t+(i<0?-1:0)],e.nodeType==1&&e.contentEditable==`false`)return!1;t=i<0?JS(e):0}else return!1}}function JS(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function YS(e,t){let n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function XS(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function ZS(e,t){let n=t.width/e.offsetWidth,r=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(t.width-e.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(t.height-e.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function QS(e,t,n,r,i,a,o,s){let c=e.ownerDocument,l=c.defaultView||window;for(let u=e,d=!1;u&&!d;)if(u.nodeType==1){let e,f=u==c.body,p=1,m=1;if(f)e=XS(l);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:p,scaleY:m}=ZS(u,t)),e={left:t.left,right:t.left+u.clientWidth*p,top:t.top,bottom:t.top+u.clientHeight*m}}let h=0,g=0;if(i==`nearest`)t.top<e.top?(g=-(e.top-t.top+o),n>0&&t.bottom>e.bottom+g&&(g=t.bottom-e.bottom+g+o)):t.bottom>e.bottom&&(g=t.bottom-e.bottom+o,n<0&&t.top-g<e.top&&(g=-(e.top+g-t.top+o)));else{let r=t.bottom-t.top,a=e.bottom-e.top;g=(i==`center`&&r<=a?t.top+r/2-a/2:i==`start`||i==`center`&&n<0?t.top-o:t.bottom-a+o)-e.top}if(r==`nearest`?t.left<e.left?(h=-(e.left-t.left+a),n>0&&t.right>e.right+h&&(h=t.right-e.right+h+a)):t.right>e.right&&(h=t.right-e.right+a,n<0&&t.left<e.left+h&&(h=-(e.left+h-t.left+a))):h=(r==`center`?t.left+(t.right-t.left)/2-(e.right-e.left)/2:r==`start`==s?t.left-a:t.right-(e.right-e.left)+a)-e.left,h||g)if(f)l.scrollBy(h,g);else{let e=0,n=0;if(g){let e=u.scrollTop;u.scrollTop+=g/m,n=(u.scrollTop-e)*m}if(h){let t=u.scrollLeft;u.scrollLeft+=h/p,e=(u.scrollLeft-t)*p}t={left:t.left-e,top:t.top-n,right:t.right-e,bottom:t.bottom-n},e&&Math.abs(e-h)<1&&(r=`nearest`),n&&Math.abs(n-g)<1&&(i=`nearest`)}if(f)break;u=u.assignedSlot||u.parentNode}else if(u.nodeType==11)u=u.host;else break}function $S(e){let t=e.ownerDocument,n,r;for(let i=e.parentNode;i&&!(i==t.body||n&&r);)if(i.nodeType==1)!r&&i.scrollHeight>i.clientHeight&&(r=i),!n&&i.scrollWidth>i.clientWidth&&(n=i),i=i.assignedSlot||i.parentNode;else if(i.nodeType==11)i=i.host;else break;return{x:n,y:r}}var eC=class{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?JS(t):0),n,Math.min(e.focusOffset,n?JS(n):0))}set(e,t,n,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=r}},tC=null;function nC(e){if(e.setActive)return e.setActive();if(tC)return e.focus(tC);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(tC==null?{get preventScroll(){return tC={preventScroll:!0},!0}}:void 0),!tC){tC=!1;for(let e=0;e<t.length;){let n=t[e++],r=t[e++],i=t[e++];n.scrollTop!=r&&(n.scrollTop=r),n.scrollLeft!=i&&(n.scrollLeft=i)}}}var rC;function iC(e,t,n=t){let r=rC||=document.createRange();return r.setEnd(e,n),r.setStart(e,t),r}function aC(e,t,n,r){let i={key:t,code:t,keyCode:n,which:n,cancelable:!0};r&&({altKey:i.altKey,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,metaKey:i.metaKey}=r);let a=new KeyboardEvent(`keydown`,i);a.synthetic=!0,e.dispatchEvent(a);let o=new KeyboardEvent(`keyup`,i);return o.synthetic=!0,e.dispatchEvent(o),a.defaultPrevented||o.defaultPrevented}function oC(e){for(;e;){if(e&&(e.nodeType==9||e.nodeType==11&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}function sC(e){for(;e.attributes.length;)e.removeAttributeNode(e.attributes[0])}function cC(e,t){let n=t.focusNode,r=t.focusOffset;if(!n||t.anchorNode!=n||t.anchorOffset!=r)return!1;for(r=Math.min(r,JS(n));;)if(r){if(n.nodeType!=1)return!1;let e=n.childNodes[r-1];e.contentEditable==`false`?r--:(n=e,r=JS(n))}else if(n==e)return!0;else r=GS(n),n=n.parentNode}function lC(e){return e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function uC(e,t){for(let n=e,r=t;;)if(n.nodeType==3&&r>0)return{node:n,offset:r};else if(n.nodeType==1&&r>0){if(n.contentEditable==`false`)return null;n=n.childNodes[r-1],r=JS(n)}else if(n.parentNode&&!KS(n))r=GS(n),n=n.parentNode;else return null}function dC(e,t){for(let n=e,r=t;;)if(n.nodeType==3&&r<n.nodeValue.length)return{node:n,offset:r};else if(n.nodeType==1&&r<n.childNodes.length){if(n.contentEditable==`false`)return null;n=n.childNodes[r],r=0}else if(n.parentNode&&!KS(n))r=GS(n)+1,n=n.parentNode;else return null}var fC=class e{constructor(e,t,n=!0){this.node=e,this.offset=t,this.precise=n}static before(t,n){return new e(t.parentNode,GS(t),n)}static after(t,n){return new e(t.parentNode,GS(t)+1,n)}},pC=[],mC=class e{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 RangeError(`Invalid child in posBefore`)}posAfter(e){return this.posBefore(e)+e.length}sync(t,n){if(this.flags&2){let r=this.dom,i=null,a;for(let o of this.children){if(o.flags&7){if(!o.dom&&(a=i?i.nextSibling:r.firstChild)){let t=e.get(a);(!t||!t.parent&&t.canReuseDOM(o))&&o.reuseDOM(a)}o.sync(t,n),o.flags&=-8}if(a=i?i.nextSibling:r.firstChild,n&&!n.written&&n.node==r&&a!=o.dom&&(n.written=!0),o.dom.parentNode==r)for(;a&&a!=o.dom;)a=hC(a);else r.insertBefore(o.dom,a);i=o.dom}for(a=i?i.nextSibling:r.firstChild,a&&n&&n.node==r&&(n.written=!0);a;)a=hC(a)}else if(this.flags&1)for(let e of this.children)e.flags&7&&(e.sync(t,n),e.flags&=-8)}reuseDOM(e){}localPosFromDOM(t,n){let r;if(t==this.dom)r=this.dom.childNodes[n];else{let e=JS(t)==0?0:n==0?-1:1;for(;;){let n=t.parentNode;if(n==this.dom)break;e==0&&n.firstChild!=n.lastChild&&(e=t==n.firstChild?-1:1),t=n}r=e<0?t:t.nextSibling}if(r==this.dom.firstChild)return 0;for(;r&&!e.get(r);)r=r.nextSibling;if(!r)return this.length;for(let e=0,t=0;;e++){let n=this.children[e];if(n.dom==r)return t;t+=n.length+n.breakAfter}}domBoundsAround(e,t,n=0){let r=-1,i=-1,a=-1,o=-1;for(let s=0,c=n,l=n;s<this.children.length;s++){let n=this.children[s],u=c+n.length;if(c<e&&u>t)return n.domBoundsAround(e,t,c);if(u>=e&&r==-1&&(r=s,i=c),c>t&&n.dom.parentNode==this.dom){a=s,o=l;break}l=u,c=u+n.breakAfter}return{from:i,to:o<0?n+this.length:o,startDOM:(r?this.children[r-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:a<this.children.length&&a>=0?this.children[a].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.flags|=2),t.flags&1)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,n=pC){this.markDirty();for(let r=e;r<t;r++){let e=this.children[r];e.parent==this&&n.indexOf(e)<0&&e.destroy()}n.length<250?this.children.splice(e,t-e,...n):this.children=[].concat(this.children.slice(0,e),n,this.children.slice(t));for(let e=0;e<n.length;e++)n[e].setParent(this)}ignoreMutation(e){return!1}ignoreEvent(e){return!1}childCursor(e=this.length){return new gC(this.children,e,this.children.length)}childPos(e,t=1){return this.childCursor().findPos(e,t)}toString(){let e=this.constructor.name.replace(`View`,``);return e+(this.children.length?`(`+this.children.join()+`)`:this.length?`[`+(e==`Text`?this.text:this.length)+`]`:``)+(this.breakAfter?`#`:``)}static get(e){return e.cmView}get isEditable(){return!0}get isWidget(){return!1}get isHidden(){return!1}merge(e,t,n,r,i,a){return!1}become(e){return!1}canReuseDOM(e){return e.constructor==this.constructor&&!((this.flags|e.flags)&8)}getSide(){return 0}destroy(){for(let e of this.children)e.parent==this&&e.destroy();this.parent=null}};mC.prototype.breakAfter=0;function hC(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}var gC=class{constructor(e,t,n){this.children=e,this.pos=t,this.i=n,this.off=0}findPos(e,t=1){for(;;){if(e>this.pos||e==this.pos&&(t>0||this.i==0||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 _C(e,t,n,r,i,a,o,s,c){let{children:l}=e,u=l.length?l[t]:null,d=a.length?a[a.length-1]:null,f=d?d.breakAfter:o;if(!(t==r&&u&&!o&&!f&&a.length<2&&u.merge(n,i,a.length?d:null,n==0,s,c))){if(r<l.length){let e=l[r];e&&(i<e.length||e.breakAfter&&d?.breakAfter)?(t==r&&(e=e.split(i),i=0),!f&&d&&e.merge(0,i,d,!0,0,c)?a[a.length-1]=e:((i||e.children.length&&!e.children[0].length)&&e.merge(0,i,null,!1,0,c),a.push(e))):e?.breakAfter&&(d?d.breakAfter=1:o=1),r++}for(u&&(u.breakAfter=o,n>0&&(!o&&a.length&&u.merge(n,u.length,a[0],!1,s,0)?u.breakAfter=a.shift().breakAfter:(n<u.length||u.children.length&&u.children[u.children.length-1].length==0)&&u.merge(n,u.length,null,!1,s,0),t++));t<r&&a.length;)if(l[r-1].become(a[a.length-1]))r--,a.pop(),c=a.length?0:s;else if(l[t].become(a[0]))t++,a.shift(),s=a.length?0:c;else break;!a.length&&t&&r<l.length&&!l[t-1].breakAfter&&l[r].merge(0,0,l[t-1],!1,s,c)&&t--,(t<r||a.length)&&e.replaceChildren(t,r,a)}}function vC(e,t,n,r,i,a){let o=e.childCursor(),{i:s,off:c}=o.findPos(n,1),{i:l,off:u}=o.findPos(t,-1),d=t-n;for(let e of r)d+=e.length;e.length+=d,_C(e,l,u,s,c,r,0,i,a)}var yC=typeof navigator<`u`?navigator:{userAgent:``,vendor:``,platform:``},bC=typeof document<`u`?document:{documentElement:{style:{}}},xC=/Edge\/(\d+)/.exec(yC.userAgent),SC=/MSIE \d/.test(yC.userAgent),CC=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(yC.userAgent),wC=!!(SC||CC||xC),TC=!wC&&/gecko\/(\d+)/i.test(yC.userAgent),EC=!wC&&/Chrome\/(\d+)/.exec(yC.userAgent),DC=`webkitFontSmoothing`in bC.documentElement.style,OC=!wC&&/Apple Computer/.test(yC.vendor),kC=OC&&(/Mobile\/\w+/.test(yC.userAgent)||yC.maxTouchPoints>2),AC={mac:kC||/Mac/.test(yC.platform),windows:/Win/.test(yC.platform),linux:/Linux|X11/.test(yC.platform),ie:wC,ie_version:SC?bC.documentMode||6:CC?+CC[1]:xC?+xC[1]:0,gecko:TC,gecko_version:TC?+(/Firefox\/(\d+)/.exec(yC.userAgent)||[0,0])[1]:0,chrome:!!EC,chrome_version:EC?+EC[1]:0,ios:kC,android:/Android\b/.test(yC.userAgent),webkit:DC,safari:OC,webkit_version:DC?+(/\bAppleWebKit\/(\d+)/.exec(yC.userAgent)||[0,0])[1]:0,tabSize:bC.documentElement.style.tabSize==null?`-moz-tab-size`:`tab-size`},jC=256,MC=class e extends mC{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(t,n,r){return this.flags&8||r&&(!(r instanceof e)||this.length-(n-t)+r.length>jC||r.flags&8)?!1:(this.text=this.text.slice(0,t)+(r?r.text:``)+this.text.slice(n),this.markDirty(),!0)}split(t){let n=new e(this.text.slice(t));return this.text=this.text.slice(0,t),this.markDirty(),n.flags|=this.flags&8,n}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new fC(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 PC(this.dom,e,t)}},NC=class e extends mC{constructor(e,t=[],n=0){super(),this.mark=e,this.children=t,this.length=n;for(let e of t)e.setParent(this)}setAttrs(e){if(sC(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(t,n,r,i,a,o){return r&&(!(r instanceof e&&r.mark.eq(this.mark))||t&&a<=0||n<this.length&&o<=0)?!1:(vC(this,t,n,r?r.children.slice():[],a-1,o-1),this.markDirty(),!0)}split(t){let n=[],r=0,i=-1,a=0;for(let e of this.children){let o=r+e.length;o>t&&n.push(r<t?e.split(t-r):e),i<0&&r>=t&&(i=a),r=o,a++}let o=this.length-t;return this.length=t,i>-1&&(this.children.length=i,this.markDirty()),new e(this.mark,n,o)}domAtPos(e){return LC(this,e)}coordsAt(e,t){return zC(this,e,t)}};function PC(e,t,n){let r=e.nodeValue.length;t>r&&(t=r);let i=t,a=t,o=0;t==0&&n<0||t==r&&n>=0?AC.chrome||AC.gecko||(t?(i--,o=1):a<r&&(a++,o=-1)):n<0?i--:a<r&&a++;let s=iC(e,i,a).getClientRects();if(!s.length)return null;let c=s[(o?o<0:n>=0)?0:s.length-1];return AC.safari&&!o&&c.width==0&&(c=Array.prototype.find.call(s,e=>e.width)||c),o?YS(c,o<0):c||null}var FC=class e extends mC{static create(t,n,r){return new e(t,n,r)}constructor(e,t,n){super(),this.widget=e,this.length=t,this.side=n,this.prevWidget=null}split(t){let n=e.create(this.widget,this.length-t,this.side);return this.length-=t,n}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.widget.editable||(this.dom.contentEditable=`false`))}getSide(){return this.side}merge(t,n,r,i,a,o){return r&&(!(r instanceof e)||!this.widget.compare(r.widget)||t>0&&a<=0||n<this.length&&o<=0)?!1:(this.length=t+(r?r.length:0)+(this.length-n),!0)}become(t){return t instanceof e&&t.side==this.side&&this.widget.constructor==t.widget.constructor?(this.widget.compare(t.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=t.widget,this.length=t.length,!0):!1}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get overrideDOMText(){if(this.length==0)return Bb.empty;let e=this;for(;e.parent;)e=e.parent;let{view:t}=e,n=t&&t.state.doc,r=this.posAtStart;return n?n.slice(r,r+this.length):Bb.empty}domAtPos(e){return(this.length?e==0:this.side>0)?fC.before(this.dom):fC.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 r=this.dom.getClientRects(),i=null;if(!r.length)return null;let a=this.side?this.side<0:e>0;for(let t=a?r.length-1:0;i=r[t],!(e>0?t==0:t==r.length-1||i.top<i.bottom);t+=a?-1:1);return YS(i,!a)}get isEditable(){return!1}get isWidget(){return!0}get isHidden(){return this.widget.isHidden}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}},IC=class e extends mC{constructor(e){super(),this.side=e}get length(){return 0}merge(){return!1}become(t){return t instanceof e&&t.side==this.side}split(){return new e(this.side)}sync(){if(!this.dom){let e=document.createElement(`img`);e.className=`cm-widgetBuffer`,e.setAttribute(`aria-hidden`,`true`),this.setDOM(e)}}getSide(){return this.side}domAtPos(e){return this.side>0?fC.before(this.dom):fC.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return Bb.empty}get isHidden(){return!0}};MC.prototype.children=FC.prototype.children=IC.prototype.children=pC;function LC(e,t){let n=e.dom,{children:r}=e,i=0;for(let e=0;i<r.length;i++){let a=r[i],o=e+a.length;if(!(o==e&&a.getSide()<=0)){if(t>e&&t<o&&a.dom.parentNode==n)return a.domAtPos(t-e);if(t<=e)break;e=o}}for(let e=i;e>0;e--){let t=r[e-1];if(t.dom.parentNode==n)return t.domAtPos(t.length)}for(let e=i;e<r.length;e++){let t=r[e];if(t.dom.parentNode==n)return t.domAtPos(0)}return new fC(n,0)}function RC(e,t,n){let r,{children:i}=e;n>0&&t instanceof NC&&i.length&&(r=i[i.length-1])instanceof NC&&r.mark.eq(t.mark)?RC(r,t.children[0],n-1):(i.push(t),t.setParent(e)),e.length+=t.length}function zC(e,t,n){let r=null,i=-1,a=null,o=-1;function s(e,t){for(let c=0,l=0;c<e.children.length&&l<=t;c++){let u=e.children[c],d=l+u.length;d>=t&&(u.children.length?s(u,t-l):(!a||a.isHidden&&n>0)&&(d>t||l==d&&u.getSide()>0)?(a=u,o=t-l):(l<t||l==d&&u.getSide()<0&&!u.isHidden)&&(r=u,i=t-l)),l=d}}s(e,t);let c=(n<0?r:a)||r||a;return c?c.coordsAt(Math.max(0,c==r?i:o),n):BC(e)}function BC(e){let t=e.dom.lastChild;if(!t)return e.dom.getBoundingClientRect();let n=US(t);return n[n.length-1]||null}function VC(e,t){for(let n in e)n==`class`&&t.class?t.class+=` `+e.class:n==`style`&&t.style?t.style+=`;`+e.style:t[n]=e[n];return t}var HC=Object.create(null);function UC(e,t,n){if(e==t)return!0;e||=HC,t||=HC;let r=Object.keys(e),i=Object.keys(t);if(r.length-(n&&r.indexOf(n)>-1?1:0)!=i.length-(n&&i.indexOf(n)>-1?1:0))return!1;for(let a of r)if(a!=n&&(i.indexOf(a)==-1||e[a]!==t[a]))return!1;return!0}function WC(e,t,n){let r=!1;if(t)for(let i in t)n&&i in n||(r=!0,i==`style`?e.style.cssText=``:e.removeAttribute(i));if(n)for(let i in n)t&&t[i]==n[i]||(r=!0,i==`style`?e.style.cssText=n[i]:e.setAttribute(i,n[i]));return r}function GC(e){let t=Object.create(null);for(let n=0;n<e.attributes.length;n++){let r=e.attributes[n];t[r.name]=r.value}return t}var KC=class{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}get editable(){return!1}destroy(e){}},qC=(function(e){return e[e.Text=0]=`Text`,e[e.WidgetBefore=1]=`WidgetBefore`,e[e.WidgetAfter=2]=`WidgetAfter`,e[e.WidgetRange=3]=`WidgetRange`,e})(qC||={}),JC=class extends sS{constructor(e,t,n,r){super(),this.startSide=e,this.endSide=t,this.widget=n,this.spec=r}get heightRelevant(){return!1}static mark(e){return new YC(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 ZC(e,t,t,n,e.widget||null,!1)}static replace(e){let t=!!e.block,n,r;if(e.isBlockGap)n=-5e8,r=4e8;else{let{start:i,end:a}=QC(e,t);n=(i?t?-3e8:-1:5e8)-1,r=(a?t?2e8:1:-6e8)+1}return new ZC(e,n,r,t,e.widget||null,!0)}static line(e){return new XC(e)}static set(e,t=!1){return dS.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}};JC.none=dS.empty;var YC=class e extends JC{constructor(e){let{start:t,end:n}=QC(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(t){return this==t||t instanceof e&&this.tagName==t.tagName&&(this.class||this.attrs?.class)==(t.class||t.attrs?.class)&&UC(this.attrs,t.attrs,`class`)}range(e,t=e){if(e>=t)throw RangeError(`Mark decorations may not be empty`);return super.range(e,t)}};YC.prototype.point=!1;var XC=class e extends JC{constructor(e){super(-2e8,-2e8,null,e)}eq(t){return t instanceof e&&this.spec.class==t.spec.class&&UC(this.spec.attributes,t.spec.attributes)}range(e,t=e){if(t!=e)throw RangeError(`Line decoration ranges must be zero-length`);return super.range(e,t)}};XC.prototype.mapMode=ix.TrackBefore,XC.prototype.point=!0;var ZC=class e extends JC{constructor(e,t,n,r,i,a){super(t,n,i,e),this.block=r,this.isReplace=a,this.mapMode=r?t<=0?ix.TrackBefore:ix.TrackAfter:ix.TrackDel}get type(){return this.startSide==this.endSide?this.startSide<=0?qC.WidgetBefore:qC.WidgetAfter:qC.WidgetRange}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof e&&$C(this.widget,t.widget)&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw RangeError(`Invalid range for replacement decoration`);if(!this.isReplace&&t!=e)throw RangeError(`Widget decorations can only have zero-length ranges`);return super.range(e,t)}};ZC.prototype.point=!0;function QC(e,t=!1){let{inclusiveStart:n,inclusiveEnd:r}=e;return n??=e.inclusive,r??=e.inclusive,{start:n??t,end:r??t}}function $C(e,t){return e==t||!!(e&&t&&e.compare(t))}function ew(e,t,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=e?n[i]=Math.max(n[i],t):n.push(e,t)}var tw=class e extends mC{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(t,n,r,i,a,o){if(r){if(!(r instanceof e))return!1;this.dom||r.transferDOM(this)}return i&&this.setDeco(r?r.attrs:null),vC(this,t,n,r?r.children.slice():[],a,o),!0}split(t){let n=new e;if(n.breakAfter=this.breakAfter,this.length==0)return n;let{i:r,off:i}=this.childPos(t);i&&(n.append(this.children[r].split(i),0),this.children[r].merge(i,this.children[r].length,null,!1,0,0),r++);for(let e=r;e<this.children.length;e++)n.append(this.children[e],0);for(;r>0&&this.children[r-1].length==0;)this.children[--r].destroy();return this.children.length=r,this.markDirty(),this.length=t,n}transferDOM(e){this.dom&&=(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,null)}setDeco(e){UC(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){RC(this,e,t)}addLineDeco(e){let t=e.spec.attributes,n=e.spec.class;t&&(this.attrs=VC(t,this.attrs||{})),n&&(this.attrs=VC({class:n},this.attrs||{}))}domAtPos(e){return LC(this,e)}reuseDOM(e){e.nodeName==`DIV`&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?this.flags&4&&(sC(this.dom),this.dom.className=`cm-line`,this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement(`div`)),this.dom.className=`cm-line`,this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(WC(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add(`cm-line`),this.prevAttrs=void 0),super.sync(e,t);let n=this.dom.lastChild;for(;n&&mC.get(n)instanceof NC;)n=n.lastChild;if(!n||!this.length||n.nodeName!=`BR`&&mC.get(n)?.isEditable==0&&(!AC.ios||!this.children.some(e=>e instanceof MC))){let e=document.createElement(`BR`);e.cmIgnore=!0,this.dom.appendChild(e)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,t;for(let n of this.children){if(!(n instanceof MC)||/[^ -~]/.test(n.text))return null;let r=US(n.dom);if(r.length!=1)return null;e+=r[0].width,t=r[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(e,t){let n=zC(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){let r=(t-e.textHeight)/2;return{top:n.top+r,bottom:n.bottom-r,left:n.left,right:n.left}}}return n}become(t){return t instanceof e&&this.children.length==0&&t.children.length==0&&UC(this.attrs,t.attrs)&&this.breakAfter==t.breakAfter}covers(){return!0}static find(t,n){for(let r=0,i=0;r<t.children.length;r++){let a=t.children[r],o=i+a.length;if(o>=n){if(a instanceof e)return a;if(o>n)break}i=o+a.breakAfter}return null}},nw=class e extends mC{constructor(e,t,n){super(),this.widget=e,this.length=t,this.deco=n,this.breakAfter=0,this.prevWidget=null}merge(t,n,r,i,a,o){return r&&(!(r instanceof e)||!this.widget.compare(r.widget)||t>0&&a<=0||n<this.length&&o<=0)?!1:(this.length=t+(r?r.length:0)+(this.length-n),!0)}domAtPos(e){return e==0?fC.before(this.dom):fC.after(this.dom,e==this.length)}split(t){let n=this.length-t;this.length=t;let r=new e(this.widget,n,this.deco);return r.breakAfter=this.breakAfter,r}get children(){return pC}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.widget.editable||(this.dom.contentEditable=`false`))}get overrideDOMText(){return this.parent?this.parent.view.state.doc.slice(this.posAtStart,this.posAtEnd):Bb.empty}domBoundsAround(){return null}become(t){return t instanceof e&&t.widget.constructor==this.widget.constructor?(t.widget.compare(this.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=t.widget,this.length=t.length,this.deco=t.deco,this.breakAfter=t.breakAfter,!0):!1}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get isEditable(){return!1}get isWidget(){return!0}coordsAt(e,t){return this.widget.coordsAt(this.dom,e,t)||(this.widget instanceof rw?null:YS(this.dom.getBoundingClientRect(),this.length?e==0:t<=0))}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}covers(e){let{startSide:t,endSide:n}=this.deco;return t==n?!1:e<0?t<0:n>0}},rw=class extends KC{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement(`div`);return e.className=`cm-gap`,this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+`px`,!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}},iw=class e{constructor(e,t,n,r){this.doc=e,this.pos=t,this.end=n,this.disallowBlockEffectsFor=r,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text=``,this.textOff=0,this.cursor=e.iter(),this.skip=t}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof nw&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new tw),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&=(this.curLine.append(aw(new IC(-1),e),e.length),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 nw)&&this.getLine()}buildText(e,t,n){for(;e>0;){if(this.textOff==this.text.length){let{value:t,lineBreak:n,done:r}=this.cursor.next(this.skip);if(this.skip=0,r)throw 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}else this.text=t,this.textOff=0}let r=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-n)),this.getLine().append(aw(new MC(this.text.slice(this.textOff,this.textOff+r)),t),n),this.atCursorPos=!0,this.textOff+=r,e-=r,n=0}}span(e,t,n,r){this.buildText(t-e,n,r),this.pos=t,this.openStart<0&&(this.openStart=r)}point(e,t,n,r,i,a){if(this.disallowBlockEffectsFor[a]&&n instanceof ZC){if(n.block)throw RangeError(`Block decorations may not be specified via plugins`);if(t>this.doc.lineAt(this.pos).to)throw RangeError(`Decorations that replace line breaks may not be specified via plugins`)}let o=t-e;if(n instanceof ZC)if(n.block)n.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new nw(n.widget||ow.block,o,n));else{let a=FC.create(n.widget||ow.inline,o,o?0:n.startSide),s=this.atCursorPos&&!a.isEditable&&i<=r.length&&(e<t||n.startSide>0),c=!a.isEditable&&(e<t||i>r.length||n.startSide<=0),l=this.getLine();this.pendingBuffer==2&&!s&&!a.isEditable&&(this.pendingBuffer=0),this.flushBuffer(r),s&&(l.append(aw(new IC(1),r),i),i=r.length+Math.max(0,i-r.length)),l.append(aw(a,r),i),this.atCursorPos=c,this.pendingBuffer=c?e<t||i>r.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=r.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(n);o&&(this.textOff+o<=this.text.length?this.textOff+=o:(this.skip+=o-(this.text.length-this.textOff),this.text=``,this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=i)}static build(t,n,r,i,a){let o=new e(t,n,r,a);return o.openEnd=dS.spans(i,n,r,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}};function aw(e,t){for(let n of t)e=new NC(n,[e],e.length);return e}var ow=class extends KC{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}};ow.inline=new ow(`span`),ow.block=new ow(`div`);var sw=(function(e){return e[e.LTR=0]=`LTR`,e[e.RTL=1]=`RTL`,e})(sw||={}),cw=sw.LTR,lw=sw.RTL;function uw(e){let t=[];for(let n=0;n<e.length;n++)t.push(1<<e[n]);return t}var dw=uw(`88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008`),fw=uw(`4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333`),pw=Object.create(null),mw=[];for(let e of[`()`,`[]`,`{}`]){let t=e.charCodeAt(0),n=e.charCodeAt(1);pw[t]=n,pw[n]=-t}function hw(e){return e<=247?dw[e]:1424<=e&&e<=1524?2:1536<=e&&e<=1785?fw[e-1536]:1774<=e&&e<=2220?4:8192<=e&&e<=8204?256:64336<=e&&e<=65023?4:1}var gw=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/,_w=class{get dir(){return this.level%2?lw:cw}constructor(e,t,n){this.from=e,this.to=t,this.level=n}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,n,r){let i=-1;for(let a=0;a<e.length;a++){let o=e[a];if(o.from<=t&&o.to>=t){if(o.level==n)return a;(i<0||(r==0?e[i].level>o.level:r<0?o.from<t:o.to>t))&&(i=a)}}if(i<0)throw RangeError(`Index out of range`);return i}};function vw(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.from!=i.from||r.to!=i.to||r.direction!=i.direction||!vw(r.inner,i.inner))return!1}return!0}var yw=[];function bw(e,t,n,r,i){for(let a=0;a<=r.length;a++){let o=a?r[a-1].to:t,s=a<r.length?r[a].from:n,c=a?256:i;for(let t=o,n=c,r=c;t<s;t++){let i=hw(e.charCodeAt(t));i==512?i=n:i==8&&r==4&&(i=16),yw[t]=i==4?2:i,i&7&&(r=i),n=i}for(let e=o,t=c,r=c;e<s;e++){let i=yw[e];if(i==128)e<s-1&&t==yw[e+1]&&t&24?i=yw[e]=t:yw[e]=256;else if(i==64){let i=e+1;for(;i<s&&yw[i]==64;)i++;let a=e&&t==8||i<n&&yw[i]==8?r==1?1:8:256;for(let t=e;t<i;t++)yw[t]=a;e=i-1}else i==8&&r==1&&(yw[e]=1);t=i,i&7&&(r=i)}}}function xw(e,t,n,r,i){let a=i==1?2:1;for(let o=0,s=0,c=0;o<=r.length;o++){let l=o?r[o-1].to:t,u=o<r.length?r[o].from:n;for(let t=l,n,r,o;t<u;t++)if(r=pw[n=e.charCodeAt(t)])if(r<0){for(let e=s-3;e>=0;e-=3)if(mw[e+1]==-r){let n=mw[e+2],r=n&2?i:n&4?n&1?a:i:0;r&&(yw[t]=yw[mw[e]]=r),s=e;break}}else if(mw.length==189)break;else mw[s++]=t,mw[s++]=n,mw[s++]=c;else if((o=yw[t])==2||o==1){let e=o==i;c=+!e;for(let t=s-3;t>=0;t-=3){let n=mw[t+2];if(n&2)break;if(e)mw[t+2]|=2;else{if(n&4)break;mw[t+2]|=4}}}}}function Sw(e,t,n,r){for(let i=0,a=r;i<=n.length;i++){let o=i?n[i-1].to:e,s=i<n.length?n[i].from:t;for(let c=o;c<s;){let o=yw[c];if(o==256){let o=c+1;for(;;)if(o==s){if(i==n.length)break;o=n[i++].to,s=i<n.length?n[i].from:t}else if(yw[o]==256)o++;else break;let l=a==1,u=l==((o<t?yw[o]:r)==1)?l?1:2:r;for(let t=o,r=i,a=r?n[r-1].to:e;t>c;)t==a&&(t=n[--r].from,a=r?n[r-1].to:e),yw[--t]=u;c=o}else a=o,c++}}}function Cw(e,t,n,r,i,a,o){let s=r%2?2:1;if(r%2==i%2)for(let c=t,l=0;c<n;){let t=!0,u=!1;if(l==a.length||c<a[l].from){let e=yw[c];e!=s&&(t=!1,u=e==16)}let d=!t&&s==1?[]:null,f=t?r:r+1,p=c;run:for(;;)if(l<a.length&&p==a[l].from){if(u)break run;let m=a[l];if(!t)for(let e=m.to,t=l+1;;){if(e==n)break run;if(t<a.length&&a[t].from==e)e=a[t++].to;else if(yw[e]==s)break run;else break}l++,d?d.push(m):(m.from>c&&o.push(new _w(c,m.from,f)),ww(e,m.direction==cw==!(f%2)?r:r+1,i,m.inner,m.from,m.to,o),c=m.to),p=m.to}else if(p==n||(t?yw[p]!=s:yw[p]==s))break;else p++;d?Cw(e,c,p,r+1,i,d,o):c<p&&o.push(new _w(c,p,f)),c=p}else for(let c=n,l=a.length;c>t;){let n=!0,u=!1;if(!l||c>a[l-1].to){let e=yw[c-1];e!=s&&(n=!1,u=e==16)}let d=!n&&s==1?[]:null,f=n?r:r+1,p=c;run:for(;;)if(l&&p==a[l-1].to){if(u)break run;let m=a[--l];if(!n)for(let e=m.from,n=l;;){if(e==t)break run;if(n&&a[n-1].to==e)e=a[--n].from;else if(yw[e-1]==s)break run;else break}d?d.push(m):(m.to<c&&o.push(new _w(m.to,c,f)),ww(e,m.direction==cw==!(f%2)?r:r+1,i,m.inner,m.from,m.to,o),c=m.from),p=m.from}else if(p==t||(n?yw[p-1]!=s:yw[p-1]==s))break;else p--;d?Cw(e,p,c,r+1,i,d,o):p<c&&o.push(new _w(p,c,f)),c=p}}function ww(e,t,n,r,i,a,o){let s=t%2?2:1;bw(e,i,a,r,s),xw(e,i,a,r,s),Sw(i,a,r,s),Cw(e,i,a,t,n,r,o)}function Tw(e,t,n){if(!e)return[new _w(0,0,+(t==lw))];if(t==cw&&!n.length&&!gw.test(e))return Ew(e.length);if(n.length)for(;e.length>yw.length;)yw[yw.length]=256;let r=[],i=t==cw?0:1;return ww(e,i,i,n,0,e.length,r),r}function Ew(e){return[new _w(0,e,0)]}var Dw=``;function Ow(e,t,n,r,i){let a=r.head-e.from,o=_w.find(t,a,r.bidiLevel??-1,r.assoc),s=t[o],c=s.side(i,n);if(a==c){let e=o+=i?1:-1;if(e<0||e>=t.length)return null;s=t[o=e],a=s.side(!i,n),c=s.side(i,n)}let l=Zb(e.text,a,s.forward(i,n));(l<s.from||l>s.to)&&(l=c),Dw=e.text.slice(Math.min(a,l),Math.max(a,l));let u=o==(i?t.length-1:0)?null:t[o+(i?1:-1)];return u&&l==c&&u.level+ +!i<s.level?L.cursor(u.side(!i,n)+e.from,u.forward(i,n)?1:-1,u.level):L.cursor(l+e.from,s.forward(i,n)?-1:1,s.level)}function kw(e,t,n){for(let r=t;r<n;r++){let t=hw(e.charCodeAt(r));if(t==1)return cw;if(t==2||t==4)return lw}return cw}var Aw=gx.define(),jw=gx.define(),Mw=gx.define(),Nw=gx.define(),Pw=gx.define(),Fw=gx.define(),Iw=gx.define(),Lw=gx.define(),Rw=gx.define(),zw=gx.define({combine:e=>e.some(e=>e)}),Bw=gx.define({combine:e=>e.some(e=>e)}),Vw=gx.define(),Hw=class e{constructor(e,t=`nearest`,n=`nearest`,r=5,i=5,a=!1){this.range=e,this.y=t,this.x=n,this.yMargin=r,this.xMargin=i,this.isSnapshot=a}map(t){return t.empty?this:new e(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(t){return this.range.to<=t.doc.length?this:new e(L.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}},Uw=Wx.define({map:(e,t)=>e.map(t)}),Ww=Wx.define();function Gw(e,t,n){let r=e.facet(Nw);r.length?r[0](t):window.onerror?window.onerror(String(t),n,void 0,void 0,t):n?console.error(n+`:`,t):console.error(t)}var Kw=gx.define({combine:e=>e.length?e[0]:!0}),qw=0,Jw=gx.define(),Yw=class e{constructor(e,t,n,r,i){this.id=e,this.create=t,this.domEventHandlers=n,this.domEventObservers=r,this.extension=i(this)}static define(t,n){let{eventHandlers:r,eventObservers:i,provide:a,decorations:o}=n||{};return new e(qw++,t,r,i,e=>{let t=[Jw.of(e)];return o&&t.push($w.of(t=>{let n=t.plugin(e);return n?o(n):JC.none})),a&&t.push(a(e)),t})}static fromClass(t,n){return e.define(e=>new t(e),n)}},Xw=class{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(!this.value){if(this.spec)try{this.value=this.spec.create(e)}catch(t){Gw(e.state,t,`CodeMirror plugin crashed`),this.deactivate()}}else if(this.mustUpdate){let e=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(e)}catch(t){if(Gw(e.state,t,`CodeMirror plugin crashed`),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}return this}destroy(e){if(this.value?.destroy)try{this.value.destroy()}catch(t){Gw(e.state,t,`CodeMirror plugin crashed`)}}deactivate(){this.spec=this.value=null}},Zw=gx.define(),Qw=gx.define(),$w=gx.define(),eT=gx.define(),tT=gx.define(),nT=gx.define();function rT(e,t){let n=e.state.facet(nT);if(!n.length)return n;let r=n.map(t=>t instanceof Function?t(e):t),i=[];return dS.spans(r,t.from,t.to,{point(){},span(e,n,r,a){let o=e-t.from,s=n-t.from,c=i;for(let e=r.length-1;e>=0;e--,a--){let n=r[e].spec.bidiIsolate,i;if(n??=kw(t.text,o,s),a>0&&c.length&&(i=c[c.length-1]).to==o&&i.direction==n)i.to=s,c=i.inner;else{let e={from:o,to:s,direction:n,inner:[]};c.push(e),c=e.inner}}}}),i}var iT=gx.define();function aT(e){let t=0,n=0,r=0,i=0;for(let a of e.state.facet(iT)){let o=a(e);o&&(o.left!=null&&(t=Math.max(t,o.left)),o.right!=null&&(n=Math.max(n,o.right)),o.top!=null&&(r=Math.max(r,o.top)),o.bottom!=null&&(i=Math.max(i,o.bottom)))}return{left:t,right:n,top:r,bottom:i}}var oT=gx.define(),sT=class e{constructor(e,t,n,r){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r}join(t){return new e(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(e){let t=e.length,n=this;for(;t>0;t--){let r=e[t-1];if(!(r.fromA>n.toA)){if(r.toA<n.fromA)break;n=n.join(r),e.splice(t-1,1)}}return e.splice(t,0,n),e}static extendWithRanges(t,n){if(n.length==0)return t;let r=[];for(let i=0,a=0,o=0,s=0;;i++){let c=i==t.length?null:t[i],l=o-s,u=c?c.fromB:1e9;for(;a<n.length&&n[a]<u;){let t=n[a],i=n[a+1],o=Math.max(s,t),c=Math.min(u,i);if(o<=c&&new e(o+l,c+l,o,c).addToSet(r),i>u)break;a+=2}if(!c)return r;new e(c.fromA,c.toA,c.fromB,c.toB).addToSet(r),o=c.toA,s=c.toB}}},cT=class e{constructor(e,t,n){this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=ox.empty(this.startState.doc.length);for(let e of n)this.changes=this.changes.compose(e.changes);let r=[];this.changes.iterChangedRanges((e,t,n,i)=>r.push(new sT(e,t,n,i))),this.changedRanges=r}static create(t,n,r){return new e(t,n,r)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}},lT=class extends mC{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=JC.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new tw],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new sT(0,0,0,e.state.doc.length)],0,null)}update(e){let t=e.changedRanges;this.minWidth>0&&t.length&&(t.every(({fromA:e,toA:t})=>t<this.minWidthFrom||e>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let n=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(this.domChanged?.newSel?n=this.domChanged.newSel.head:!_T(e.changes,this.hasComposition)&&!e.selectionSet&&(n=e.state.selection.main.head));let r=n>-1?fT(this.view,e.changes,n):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:n,to:r}=this.hasComposition;t=new sT(n,r,e.changes.mapPos(n,-1),e.changes.mapPos(r,1)).addToSet(t.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(AC.ie||AC.chrome)&&!r&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let i=this.decorations,a=hT(i,this.updateDeco(),e.changes);return t=sT.extendWithRanges(t,a),!(this.flags&7)&&t.length==0?!1:(this.updateInner(t,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:r}=this.view;r.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+`px`,this.dom.style.flexBasis=this.minWidth?this.minWidth+`px`:``;let e=AC.chrome||AC.ios?{node:r.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,e),this.flags&=-8,e&&(e.written||r.selectionRange.focusNode!=e.node)&&(this.forceSelection=!0),this.dom.style.height=``}),this.markedForComposition.forEach(e=>e.flags&=-9);let i=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let e of this.children)e instanceof nw&&e.widget instanceof rw&&i.push(e.dom);r.updateGaps(i)}updateChildren(e,t,n){let r=n?n.range.addToSet(e.slice()):e,i=this.childCursor(t);for(let e=r.length-1;;e--){let t=e>=0?r[e]:null;if(!t)break;let{fromA:a,toA:o,fromB:s,toB:c}=t,l,u,d,f;if(n&&n.range.fromB<c&&n.range.toB>s){let e=iw.build(this.view.state.doc,s,n.range.fromB,this.decorations,this.dynamicDecorationMap),t=iw.build(this.view.state.doc,n.range.toB,c,this.decorations,this.dynamicDecorationMap);u=e.breakAtStart,d=e.openStart,f=t.openEnd;let r=this.compositionView(n);t.breakAtStart?r.breakAfter=1:t.content.length&&r.merge(r.length,r.length,t.content[0],!1,t.openStart,0)&&(r.breakAfter=t.content[0].breakAfter,t.content.shift()),e.content.length&&r.merge(0,0,e.content[e.content.length-1],!0,0,e.openEnd)&&e.content.pop(),l=e.content.concat(r).concat(t.content)}else ({content:l,breakAtStart:u,openStart:d,openEnd:f}=iw.build(this.view.state.doc,s,c,this.decorations,this.dynamicDecorationMap));let{i:p,off:m}=i.findPos(o,1),{i:h,off:g}=i.findPos(a,-1);_C(this,h,g,p,m,l,u,d,f)}n&&this.fixCompositionDOM(n)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let e of t.effects)e.is(Ww)&&(this.editContextFormatting=e.value)}compositionView(e){let t=new MC(e.text.nodeValue);t.flags|=8;for(let{deco:n}of e.marks)t=new NC(n,[t],t.length);let n=new tw;return n.append(t,0),n}fixCompositionDOM(e){let t=(e,t)=>{t.flags|=8|!!t.children.some(e=>e.flags&7),this.markedForComposition.add(t);let n=mC.get(e);n&&n!=t&&(n.dom=null),t.setDOM(e)},n=this.childPos(e.range.fromB,1),r=this.children[n.i];t(e.line,r);for(let i=e.marks.length-1;i>=-1;i--)n=r.childPos(n.off,1),r=r.children[n.i],t(i>=0?e.marks[i].node:e.text,r)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let n=this.view.root.activeElement,r=n==this.dom,i=!r&&!(this.view.state.facet(Kw)||this.dom.tabIndex>-1)&&HS(this.dom,this.view.observer.selectionRange)&&!(n&&this.dom.contains(n));if(!(r||t||i))return;let a=this.forceSelection;this.forceSelection=!1;let o=this.view.state.selection.main,s=this.moveToLine(this.domAtPos(o.anchor)),c=o.empty?s:this.moveToLine(this.domAtPos(o.head));if(AC.gecko&&o.empty&&!this.hasComposition&&uT(s)){let e=document.createTextNode(``);this.view.observer.ignore(()=>s.node.insertBefore(e,s.node.childNodes[s.offset]||null)),s=c=new fC(e,0),a=!0}let l=this.view.observer.selectionRange;(a||!l.focusNode||(!WS(s.node,s.offset,l.anchorNode,l.anchorOffset)||!WS(c.node,c.offset,l.focusNode,l.focusOffset))&&!this.suppressWidgetCursorChange(l,o))&&(this.view.observer.ignore(()=>{AC.android&&AC.chrome&&this.dom.contains(l.focusNode)&&gT(l.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let e=BS(this.view.root);if(e)if(o.empty){if(AC.gecko){let e=pT(s.node,s.offset);if(e&&e!=3){let t=(e==1?uC:dC)(s.node,s.offset);t&&(s=new fC(t.node,t.offset))}}e.collapse(s.node,s.offset),o.bidiLevel!=null&&e.caretBidiLevel!==void 0&&(e.caretBidiLevel=o.bidiLevel)}else if(e.extend){e.collapse(s.node,s.offset);try{e.extend(c.node,c.offset)}catch{}}else{let t=document.createRange();o.anchor>o.head&&([s,c]=[c,s]),t.setEnd(c.node,c.offset),t.setStart(s.node,s.offset),e.removeAllRanges(),e.addRange(t)}i&&this.view.root.activeElement==this.dom&&(this.dom.blur(),n&&n.focus())}),this.view.observer.setSelectionRange(s,c)),this.impreciseAnchor=s.precise?null:new fC(l.anchorNode,l.anchorOffset),this.impreciseHead=c.precise?null:new fC(l.focusNode,l.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&WS(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,n=BS(e.root),{anchorNode:r,anchorOffset:i}=e.observer.selectionRange;if(!n||!t.empty||!t.assoc||!n.modify)return;let a=tw.find(this,t.head);if(!a)return;let o=a.posAtStart;if(t.head==o||t.head==o+a.length)return;let s=this.coordsAt(t.head,-1),c=this.coordsAt(t.head,1);if(!s||!c||s.bottom>c.top)return;let l=this.domAtPos(t.head+t.assoc);n.collapse(l.node,l.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(r,i)}moveToLine(e){let t=this.dom,n;if(e.node!=t)return e;for(let r=e.offset;!n&&r<t.childNodes.length;r++){let e=mC.get(t.childNodes[r]);e instanceof tw&&(n=e.domAtPos(0))}for(let r=e.offset-1;!n&&r>=0;r--){let e=mC.get(t.childNodes[r]);e instanceof tw&&(n=e.domAtPos(e.length))}return n?new fC(n.node,n.offset,!0):e}nearest(e){for(let t=e;t;){let e=mC.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 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<this.children.length-1;){let e=this.children[t];if(n<e.length||e instanceof tw)break;t++,n=0}return this.children[t].domAtPos(n)}coordsAt(e,t){let n=null,r=0;for(let i=this.length,a=this.children.length-1;a>=0;a--){let o=this.children[a],s=i-o.breakAfter,c=s-o.length;if(s<e)break;if(c<=e&&(c<e||o.covers(-1))&&(s>e||o.covers(1))&&(!n||o instanceof tw&&!(n instanceof tw&&t>=0)))n=o,r=c;else if(n&&c==e&&s==e&&o instanceof nw&&Math.abs(t)<2){if(o.deco.startSide<0)break;a&&(n=null)}i=c}return n?n.coordsAt(e-r,t):null}coordsForChar(e){let{i:t,off:n}=this.childPos(e,1),r=this.children[t];if(!(r instanceof tw))return null;for(;r.children.length;){let{i:e,off:t}=r.childPos(n,1);for(;;e++){if(e==r.children.length)return null;if((r=r.children[e]).length)break}n=t}if(!(r instanceof MC))return null;let i=Zb(r.text,n);if(i==n)return null;let a=iC(r.dom,n,i).getClientRects();for(let e=0;e<a.length;e++){let t=a[e];if(e==a.length-1||t.top<t.bottom&&t.left<t.right)return t}return null}measureVisibleLineHeights(e){let t=[],{from:n,to:r}=e,i=this.view.contentDOM.clientWidth,a=i>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,o=-1,s=this.view.textDirection==sw.LTR;for(let e=0,c=0;c<this.children.length;c++){let l=this.children[c],u=e+l.length;if(u>r)break;if(e>=n){let n=l.dom.getBoundingClientRect();if(t.push(n.height),a){let t=l.dom.lastChild,r=t?US(t):[];if(r.length){let t=r[r.length-1],a=s?t.right-n.left:n.right-t.left;a>o&&(o=a,this.minWidth=i,this.minWidthFrom=e,this.minWidthTo=u)}}}e=u+l.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction==`rtl`?sw.RTL:sw.LTR}measureTextSize(){for(let e of this.children)if(e instanceof tw){let t=e.measureTextSize();if(t)return t}let e=document.createElement(`div`),t,n,r;return e.className=`cm-line`,e.style.width=`99999px`,e.style.position=`absolute`,e.textContent=`abc def ghi jkl mno pqr stu`,this.view.observer.ignore(()=>{this.dom.appendChild(e);let i=US(e.firstChild)[0];t=e.getBoundingClientRect().height,n=i?i.width/27:7,r=i?i.height:t,e.remove()}),{lineHeight:t,charWidth:n,textHeight:r}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new gC(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,r=0;;r++){let i=r==t.viewports.length?null:t.viewports[r],a=i?i.from-1:this.length;if(a>n){let r=(t.lineBlockAt(a).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(JC.replace({widget:new rw(r),block:!0,inclusive:!0,isBlockGap:!0}).range(n,a))}if(!i)break;n=i.to+1}return JC.set(e)}updateDeco(){let e=1,t=this.view.state.facet($w).map(t=>(this.dynamicDecorationMap[e++]=typeof t==`function`)?t(this.view):t),n=!1,r=this.view.state.facet(eT).map((e,t)=>{let r=typeof e==`function`;return r&&(n=!0),r?e(this.view):e});for(r.length&&(this.dynamicDecorationMap[e++]=n,t.push(dS.join(r))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;return this.decorations}scrollIntoView(e){if(e.isSnapshot){let t=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=t.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let t of this.view.state.facet(Vw))try{if(t(this.view,e.range,e))return!0}catch(e){Gw(this.view.state,e,`scroll handler`)}let{range:t}=e,n=this.coordsAt(t.head,t.empty?t.assoc:t.head>t.anchor?-1:1),r;if(!n)return;!t.empty&&(r=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(n={left:Math.min(n.left,r.left),top:Math.min(n.top,r.top),right:Math.max(n.right,r.right),bottom:Math.max(n.bottom,r.bottom)});let i=aT(this.view),a={left:n.left-i.left,top:n.top-i.top,right:n.right+i.right,bottom:n.bottom+i.bottom},{offsetWidth:o,offsetHeight:s}=this.view.scrollDOM;QS(this.view.scrollDOM,a,t.head<t.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,o),-o),Math.max(Math.min(e.yMargin,s),-s),this.view.textDirection==sw.LTR)}};function uT(e){return e.node.nodeType==1&&e.node.firstChild&&(e.offset==0||e.node.childNodes[e.offset-1].contentEditable==`false`)&&(e.offset==e.node.childNodes.length||e.node.childNodes[e.offset].contentEditable==`false`)}function dT(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let r=uC(n.focusNode,n.focusOffset),i=dC(n.focusNode,n.focusOffset),a=r||i;if(i&&r&&i.node!=r.node){let t=mC.get(i.node);if(!t||t instanceof MC&&t.text!=i.node.nodeValue)a=i;else if(e.docView.lastCompositionAfterCursor){let e=mC.get(r.node);!e||e instanceof MC&&e.text!=r.node.nodeValue||(a=i)}}if(e.docView.lastCompositionAfterCursor=a!=r,!a)return null;let o=t-a.offset;return{from:o,to:o+a.node.nodeValue.length,node:a.node}}function fT(e,t,n){let r=dT(e,n);if(!r)return null;let{node:i,from:a,to:o}=r,s=i.nodeValue;if(/[\n\r]/.test(s)||e.state.doc.sliceString(r.from,r.to)!=s)return null;let c=t.invertedDesc,l=new sT(c.mapPos(a),c.mapPos(o),a,o),u=[];for(let t=i.parentNode;;t=t.parentNode){let n=mC.get(t);if(n instanceof NC)u.push({node:t,deco:n.mark});else if(n instanceof tw||t.nodeName==`DIV`&&t.parentNode==e.contentDOM)return{range:l,text:i,marks:u,line:t};else if(t!=e.contentDOM)u.push({node:t,deco:new YC({inclusive:!0,attributes:GC(t),tagName:t.tagName.toLowerCase()})});else return null}}function pT(e,t){return e.nodeType==1?(t&&e.childNodes[t-1].contentEditable==`false`?1:0)|(t<e.childNodes.length&&e.childNodes[t].contentEditable==`false`?2:0):0}var mT=class{constructor(){this.changes=[]}compareRange(e,t){ew(e,t,this.changes)}comparePoint(e,t){ew(e,t,this.changes)}boundChange(e){ew(e,e,this.changes)}};function hT(e,t,n){let r=new mT;return dS.compare(e,t,n,r),r.changes}function gT(e,t){for(let n=e;n&&n!=t;n=n.assignedSlot||n.parentNode)if(n.nodeType==1&&n.contentEditable==`false`)return!0;return!1}function _T(e,t){let n=!1;return t&&e.iterChangedRanges((e,r)=>{e<t.to&&r>t.from&&(n=!0)}),n}function vT(e,t,n=1){let r=e.charCategorizer(t),i=e.doc.lineAt(t),a=t-i.from;if(i.length==0)return L.cursor(t);a==0?n=1:a==i.length&&(n=-1);let o=a,s=a;n<0?o=Zb(i.text,a,!1):s=Zb(i.text,a);let c=r(i.text.slice(o,s));for(;o>0;){let e=Zb(i.text,o,!1);if(r(i.text.slice(e,o))!=c)break;o=e}for(;s<i.length;){let e=Zb(i.text,s);if(r(i.text.slice(s,e))!=c)break;s=e}return L.range(o+i.from,s+i.from)}function yT(e,t){return t.left>e?t.left-e:Math.max(0,e-t.right)}function bT(e,t){return t.top>e?t.top-e:Math.max(0,e-t.bottom)}function xT(e,t){return e.top<t.bottom-1&&e.bottom>t.top+1}function ST(e,t){return t<e.top?{top:t,left:e.left,right:e.right,bottom:e.bottom}:e}function CT(e,t){return t>e.bottom?{top:e.top,left:e.left,right:e.right,bottom:t}:e}function wT(e,t,n){let r,i,a,o,s=!1,c,l,u,d;for(let f=e.firstChild;f;f=f.nextSibling){let e=US(f);for(let p=0;p<e.length;p++){let m=e[p];i&&xT(i,m)&&(m=ST(CT(m,i.bottom),i.top));let h=yT(t,m),g=bT(n,m);if(h==0&&g==0)return f.nodeType==3?TT(f,t,n):wT(f,t,n);if(!r||o>g||o==g&&a>h){r=f,i=m,a=h,o=g;let c=g?n<m.top?-1:1:h?t<m.left?-1:1:0;s=!c||(c>0?p<e.length-1:p>0)}h==0?n>m.bottom&&(!u||u.bottom<m.bottom)?(c=f,u=m):n<m.top&&(!d||d.top>m.top)&&(l=f,d=m):u&&xT(u,m)?u=CT(u,m.bottom):d&&xT(d,m)&&(d=ST(d,m.top))}}if(u&&u.bottom>=n?(r=c,i=u):d&&d.top<=n&&(r=l,i=d),!r)return{node:e,offset:0};let f=Math.max(i.left,Math.min(i.right,t));return r.nodeType==3?TT(r,f,n):s&&r.contentEditable!=`false`?wT(r,f,n):{node:e,offset:Array.prototype.indexOf.call(e.childNodes,r)+ +(t>=(i.left+i.right)/2)}}function TT(e,t,n){let r=e.nodeValue.length,i=-1,a=1e9,o=0;for(let s=0;s<r;s++){let r=iC(e,s,s+1).getClientRects();for(let c=0;c<r.length;c++){let l=r[c];if(l.top==l.bottom)continue;o||=t-l.left;let u=(l.top>n?l.top-n:n-l.bottom)-1;if(l.left-1<=t&&l.right+1>=t&&u<a){let n=t>=(l.left+l.right)/2,r=n;if((AC.chrome||AC.gecko)&&iC(e,s).getBoundingClientRect().left==l.right&&(r=!n),u<=0)return{node:e,offset:s+ +!!r};i=s+ +!!r,a=u}}}return{node:e,offset:i>-1?i:o>0?e.nodeValue.length:0}}function ET(e,t,n,r=-1){let i=e.contentDOM.getBoundingClientRect(),a=i.top+e.viewState.paddingTop,o,{docHeight:s}=e.viewState,{x:c,y:l}=t,u=l-a;if(u<0)return 0;if(u>s)return e.state.doc.length;for(let t=e.viewState.heightOracle.textHeight/2,i=!1;o=e.elementAtHeight(u),o.type!=qC.Text;)for(;u=r>0?o.bottom+t:o.top-t,!(u>=0&&u<=s);){if(i)return n?null:0;i=!0,r=-r}l=a+u;let d=o.from;if(d<e.viewport.from)return e.viewport.from==0?0:n?null:DT(e,i,o,c,l);if(d>e.viewport.to)return e.viewport.to==e.state.doc.length?e.state.doc.length:n?null:DT(e,i,o,c,l);let f=e.dom.ownerDocument,p=e.root.elementFromPoint?e.root:f,m=p.elementFromPoint(c,l);m&&!e.contentDOM.contains(m)&&(m=null),m||(c=Math.max(i.left+1,Math.min(i.right-1,c)),m=p.elementFromPoint(c,l),m&&!e.contentDOM.contains(m)&&(m=null));let h,g=-1;if(m&&e.docView.nearest(m)?.isEditable!=0){if(f.caretPositionFromPoint){let e=f.caretPositionFromPoint(c,l);e&&({offsetNode:h,offset:g}=e)}else if(f.caretRangeFromPoint){let t=f.caretRangeFromPoint(c,l);t&&({startContainer:h,startOffset:g}=t,(!e.contentDOM.contains(h)||AC.safari&&OT(h,g,c)||AC.chrome&&kT(h,g,c))&&(h=void 0))}h&&(g=Math.min(JS(h),g))}if(!h||!e.docView.dom.contains(h)){let t=tw.find(e.docView,d);if(!t)return u>o.top+o.height/2?o.to:o.from;({node:h,offset:g}=wT(t.dom,c,l))}let _=e.docView.nearest(h);if(!_)return null;if(_.isWidget&&_.dom?.nodeType==1){let e=_.dom.getBoundingClientRect();return t.y<e.top||t.y<=e.bottom&&t.x<=(e.left+e.right)/2?_.posAtStart:_.posAtEnd}else return _.localPosFromDOM(h,g)+_.posAtStart}function DT(e,t,n,r,i){let a=Math.round((r-t.left)*e.defaultCharacterWidth);if(e.lineWrapping&&n.height>e.defaultLineHeight*1.5){let t=e.viewState.heightOracle.textHeight,r=Math.floor((i-n.top-(e.defaultLineHeight-t)*.5)/t);a+=r*e.viewState.heightOracle.lineLength}let o=e.state.sliceDoc(n.from,n.to);return n.from+TS(o,a,e.state.tabSize)}function OT(e,t,n){let r;if(e.nodeType!=3||t!=(r=e.nodeValue.length))return!1;for(let t=e.nextSibling;t;t=t.nextSibling)if(t.nodeType!=1||t.nodeName!=`BR`)return!1;return iC(e,r-1,r).getBoundingClientRect().left>n}function kT(e,t,n){if(t!=0)return!1;for(let t=e;;){let e=t.parentNode;if(!e||e.nodeType!=1||e.firstChild!=t)return!1;if(e.classList.contains(`cm-line`))break;t=e}return n-(e.nodeType==1?e.getBoundingClientRect():iC(e,0,Math.max(e.nodeValue.length,1)).getBoundingClientRect()).left>5}function AT(e,t){let n=e.lineBlockAt(t);if(Array.isArray(n.type)){for(let e of n.type)if(e.to>t||e.to==t&&(e.to==n.to||e.type==qC.Text))return e}return n}function jT(e,t,n,r){let i=AT(e,t.head),a=!r||i.type!=qC.Text||!(e.lineWrapping||i.widgetLineBreaks)?null:e.coordsAtPos(t.assoc<0&&t.head>i.from?t.head-1:t.head);if(a){let t=e.dom.getBoundingClientRect(),r=e.textDirectionAt(i.from),o=e.posAtCoords({x:n==(r==sw.LTR)?t.right-1:t.left+1,y:(a.top+a.bottom)/2});if(o!=null)return L.cursor(o,n?-1:1)}return L.cursor(n?i.to:i.from,n?-1:1)}function MT(e,t,n,r){let i=e.state.doc.lineAt(t.head),a=e.bidiSpans(i),o=e.textDirectionAt(i.from);for(let s=t,c=null;;){let t=Ow(i,a,o,s,n),l=Dw;if(!t){if(i.number==(n?e.state.doc.lines:1))return s;l=`
|
|
39
39
|
`,i=e.state.doc.line(i.number+(n?1:-1)),a=e.bidiSpans(i),t=e.visualLineSide(i,!n)}if(!c){if(!r)return t;c=r(l)}else if(!c(l))return s;s=t}}function NT(e,t,n){let r=e.state.charCategorizer(t),i=r(n);return e=>{let t=r(e);return i==eS.Space&&(i=t),i==t}}function PT(e,t,n,r){let i=t.head,a=n?1:-1;if(i==(n?e.state.doc.length:0))return L.cursor(i,t.assoc);let o=t.goalColumn,s,c=e.contentDOM.getBoundingClientRect(),l=e.coordsAtPos(i,t.assoc||-1),u=e.documentTop;if(l)o??=l.left-c.left,s=a<0?l.top:l.bottom;else{let t=e.viewState.lineBlockAt(i);o??=Math.min(c.right-c.left,e.defaultCharacterWidth*(i-t.from)),s=(a<0?t.top:t.bottom)+u}let d=c.left+o,f=r??e.viewState.heightOracle.textHeight>>1;for(let t=0;;t+=10){let n=s+(f+t)*a,r=ET(e,{x:d,y:n},!1,a);if(n<c.top||n>c.bottom||(a<0?r<i:r>i)){let t=e.docView.coordsForChar(r),i=!t||n<t.top?-1:1;return L.cursor(r,i,void 0,o)}}}function FT(e,t,n){for(;;){let r=0;for(let i of e)i.between(t-1,t+1,(e,i,a)=>{if(t>e&&t<i){let a=r||n||(t-e<i-t?-1:1);t=a<0?e:i,r=a}});if(!r)return t}}function IT(e,t,n){let r=FT(e.state.facet(tT).map(t=>t(e)),n.from,t.head>n.from?-1:1);return r==n.from?n:L.cursor(r,r<n.from?1:-1)}var LT=``,RT=class{constructor(e,t){this.points=e,this.text=``,this.lineSeparator=t.facet(aS.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=LT}readRange(e,t){if(!e)return this;let n=e.parentNode;for(let r=e;;){this.findPointBefore(n,r);let e=this.text.length;this.readNode(r);let i=r.nextSibling;if(i==t)break;let a=mC.get(r),o=mC.get(i);(a&&o?a.breakAfter:(a?a.breakAfter:KS(r))||KS(i)&&(r.nodeName!=`BR`||r.cmIgnore)&&this.text.length>e)&&this.lineBreak(),r=i}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,r=this.lineSeparator?null:/\r\n?|\n/g;;){let i=-1,a=1,o;if(this.lineSeparator?(i=t.indexOf(this.lineSeparator,n),a=this.lineSeparator.length):(o=r.exec(t))&&(i=o.index,a=o[0].length),this.append(t.slice(n,i<0?t.length:i)),i<0)break;if(this.lineBreak(),a>1)for(let t of this.points)t.node==e&&t.pos>this.text.length&&(t.pos-=a-1);n=i+a}}readNode(e){if(e.cmIgnore)return;let t=mC.get(e),n=t&&t.overrideDOMText;if(n!=null){this.findPointInside(e,n.length);for(let e=n.iter();!e.next().done;)e.lineBreak?this.lineBreak():this.append(e.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName==`BR`?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let 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)(e.nodeType==3?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(zT(e,n.node,n.offset)?t:0))}};function zT(e,t,n){for(;;){if(!t||n<JS(t))return!1;if(t==e)return!0;n=GS(t)+1,t=t.parentNode}}var BT=class{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}},VT=class{constructor(e,t,n,r){this.typeOver=r,this.bounds=null,this.text=``,this.domChanged=t>-1;let{impreciseHead:i,impreciseAnchor:a}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,n,0))){let t=i||a?[]:KT(e),n=new RT(t,e.state);n.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=n.text,this.newSel=qT(t,this.bounds.from)}else{let t=e.observer.selectionRange,n=i&&i.node==t.focusNode&&i.offset==t.focusOffset||!VS(e.contentDOM,t.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(t.focusNode,t.focusOffset),r=a&&a.node==t.anchorNode&&a.offset==t.anchorOffset||!VS(e.contentDOM,t.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(t.anchorNode,t.anchorOffset),o=e.viewport;if((AC.ios||AC.chrome)&&e.state.selection.main.empty&&n!=r&&(o.from>0||o.to<e.state.doc.length)){let t=Math.min(n,r),i=Math.max(n,r),a=o.from-t,s=o.to-i;(a==0||a==1||t==0)&&(s==0||s==-1||i==e.state.doc.length)&&(n=0,r=e.state.doc.length)}this.newSel=L.single(r,n)}}};function HT(e,t){let n,{newSel:r}=t,i=e.state.selection.main,a=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:r,to:o}=t.bounds,s=i.from,c=null;(a===8||AC.android&&t.text.length<o-r)&&(s=i.to,c=`end`);let l=GT(e.state.doc.sliceString(r,o,LT),t.text,s-r,c);l&&(AC.chrome&&a==13&&l.toB==l.from+2&&t.text.slice(l.from,l.toB)==LT+LT&&l.toB--,n={from:r+l.from,to:r+l.toA,insert:Bb.of(t.text.slice(l.from,l.toB).split(LT))})}else r&&(!e.hasFocus&&e.state.facet(Kw)||r.main.eq(i))&&(r=null);if(!n&&!r)return!1;if(!n&&t.typeOver&&!i.empty&&r&&r.main.empty?n={from:i.from,to:i.to,insert:e.state.doc.slice(i.from,i.to)}:(AC.mac||AC.android)&&n&&n.from==n.to&&n.from==i.head-1&&/^\. ?$/.test(n.insert.toString())&&e.contentDOM.getAttribute(`autocorrect`)==`off`?(r&&n.insert.length==2&&(r=L.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:Bb.of([n.insert.toString().replace(`.`,` `)])}):n&&n.from>=i.from&&n.to<=i.to&&(n.from!=i.from||n.to!=i.to)&&i.to-i.from-(n.to-n.from)<=4?n={from:i.from,to:i.to,insert:e.state.doc.slice(i.from,n.from).append(n.insert).append(e.state.doc.slice(n.to,i.to))}:AC.chrome&&n&&n.from==n.to&&n.from==i.head&&n.insert.toString()==`
|
|
40
|
-
`&&e.lineWrapping&&(r&&=L.single(r.main.anchor-1,r.main.head-1),n={from:i.from,to:i.to,insert:Bb.of([` `])}),n)return UT(e,n,r,a);if(r&&!r.main.eq(i)){let t=!1,n=`select`;return e.inputState.lastSelectionTime>Date.now()-50&&(e.inputState.lastSelectionOrigin==`select`&&(t=!0),n=e.inputState.lastSelectionOrigin),e.dispatch({selection:r,scrollIntoView:t,userEvent:n}),!0}else return!1}function UT(e,t,n,r=-1){if(AC.ios&&e.inputState.flushIOSKey(t))return!0;let i=e.state.selection.main;if(AC.android&&(t.to==i.to&&(t.from==i.from||t.from==i.from-1&&e.state.sliceDoc(t.from,i.from)==` `)&&t.insert.length==1&&t.insert.lines==2&&aC(e.contentDOM,`Enter`,13)||(t.from==i.from-1&&t.to==i.to&&t.insert.length==0||r==8&&t.insert.length<t.to-t.from&&t.to>i.head)&&aC(e.contentDOM,`Backspace`,8)||t.from==i.from&&t.to==i.to+1&&t.insert.length==0&&aC(e.contentDOM,`Delete`,46)))return!0;let a=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let o,s=()=>o||=WT(e,t,n);return e.state.facet(Fw).some(n=>n(e,t.from,t.to,a,s))||e.dispatch(s()),!0}function WT(e,t,n){let r,i=e.state,a=i.selection.main;if(t.from>=a.from&&t.to<=a.to&&t.to-t.from>=(a.to-a.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let n=a.from<t.from?i.sliceDoc(a.from,t.from):``,o=a.to>t.to?i.sliceDoc(t.to,a.to):``;r=i.replaceSelection(e.state.toText(n+t.insert.sliceString(0,void 0,e.state.lineBreak)+o))}else{let o=i.changes(t),s=n&&n.main.to<=o.newLength?n.main:void 0;if(i.selection.ranges.length>1&&e.inputState.composing>=0&&t.to<=a.to&&t.to>=a.to-10){let c=e.state.sliceDoc(t.from,t.to),l,u=n&&dT(e,n.main.head);if(u){let e=t.insert.length-(t.to-t.from);l={from:u.from,to:u.to-e}}else l=e.state.doc.lineAt(a.head);let d=a.to-t.to,f=a.to-a.from;r=i.changeByRange(n=>{if(n.from==a.from&&n.to==a.to)return{changes:o,range:s||n.map(o)};let r=n.to-d,u=r-c.length;if(n.to-n.from!=f||e.state.sliceDoc(u,r)!=c||n.to>=l.from&&n.from<=l.to)return{range:n};let p=i.changes({from:u,to:r,insert:t.insert}),m=n.to-a.to;return{changes:p,range:s?L.range(Math.max(0,s.anchor+m),Math.max(0,s.head+m)):n.map(p)}})}else r={changes:o,selection:s&&i.selection.replaceRange(s)}}let o=`input.type`;return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,o+=`.compose`,e.inputState.compositionFirstChange&&(o+=`.start`,e.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:o,scrollIntoView:!0})}function GT(e,t,n,r){let i=Math.min(e.length,t.length),a=0;for(;a<i&&e.charCodeAt(a)==t.charCodeAt(a);)a++;if(a==i&&e.length==t.length)return null;let o=e.length,s=t.length;for(;o>0&&s>0&&e.charCodeAt(o-1)==t.charCodeAt(s-1);)o--,s--;if(r==`end`){let e=Math.max(0,a-Math.min(o,s));n-=o+e-a}if(o<a&&e.length<t.length){let e=n<=a&&n>=o?a-n:0;a-=e,s=a+(s-o),o=a}else if(s<a){let e=n<=a&&n>=s?a-n:0;a-=e,o=a+(o-s),s=a}return{from:a,toA:o,toB:s}}function KT(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}=e.observer.selectionRange;return n&&(t.push(new BT(n,r)),(i!=n||a!=r)&&t.push(new BT(i,a))),t}function qT(e,t){if(e.length==0)return null;let n=e[0].pos,r=e.length==2?e[1].pos:n;return n>-1&&r>-1?L.single(n+t,r+t):null}var JT=class{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,AC.safari&&e.contentDOM.addEventListener(`input`,()=>null),AC.gecko&&NE(e.contentDOM.ownerDocument)}handleEvent(e){!sE(this.view,e)||this.ignoreDuringComposition(e)||e.type==`keydown`&&this.keydown(e)||(this.view.updateState==0?this.runHandlers(e.type,e):Promise.resolve().then(()=>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=XT(e),n=this.handlers,r=this.view.contentDOM;for(let e in t)if(e!=`scroll`){let i=!t[e].handlers.length,a=n[e];a&&i!=!a.handlers.length&&(r.removeEventListener(e,this.handleEvent),a=null),a||r.addEventListener(e,this.handleEvent,{passive:i})}for(let e in n)e!=`scroll`&&!t[e]&&r.removeEventListener(e,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&$T.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),AC.android&&AC.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return AC.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((t=ZT.find(t=>t.keyCode==e.keyCode))&&!e.ctrlKey||QT.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key==`Enter`&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,aC(this.view.contentDOM,t.key,t.keyCode,t instanceof KeyboardEvent?t:void 0))}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:AC.safari&&!AC.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}};function YT(e,t){return(n,r)=>{try{return t.call(e,r,n)}catch(e){Gw(n.state,e)}}}function XT(e){let t=Object.create(null);function n(e){return t[e]||(t[e]={observers:[],handlers:[]})}for(let t of e){let e=t.spec;if(e&&e.domEventHandlers)for(let r in e.domEventHandlers){let i=e.domEventHandlers[r];i&&n(r).handlers.push(YT(t.value,i))}if(e&&e.domEventObservers)for(let r in e.domEventObservers){let i=e.domEventObservers[r];i&&n(r).observers.push(YT(t.value,i))}}for(let e in cE)n(e).handlers.push(cE[e]);for(let e in lE)n(e).observers.push(lE[e]);return t}var ZT=[{key:`Backspace`,keyCode:8,inputType:`deleteContentBackward`},{key:`Enter`,keyCode:13,inputType:`insertParagraph`},{key:`Enter`,keyCode:13,inputType:`insertLineBreak`},{key:`Delete`,keyCode:46,inputType:`deleteContentForward`}],QT=`dthko`,$T=[16,17,18,20,91,92,224,225],eE=6;function tE(e){return Math.max(0,e)*.7+8}function nE(e,t){return Math.max(Math.abs(e.clientX-t.clientX),Math.abs(e.clientY-t.clientY))}var rE=class{constructor(e,t,n,r){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=$S(e.contentDOM),this.atoms=e.state.facet(tT).map(t=>t(e));let i=e.contentDOM.ownerDocument;i.addEventListener(`mousemove`,this.move=this.move.bind(this)),i.addEventListener(`mouseup`,this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(aS.allowMultipleSelections)&&iE(e,t),this.dragging=oE(e,t)&&SE(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&nE(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,n=0,r=0,i=0,a=this.view.win.innerWidth,o=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:i,bottom:o}=this.scrollParents.y.getBoundingClientRect());let s=aT(this.view);e.clientX-s.left<=r+eE?t=-tE(r-e.clientX):e.clientX+s.right>=a-eE&&(t=tE(e.clientX-a)),e.clientY-s.top<=i+eE?n=-tE(i-e.clientY):e.clientY+s.bottom>=o-eE&&(n=tE(e.clientY-o)),this.setScrollSpeed(t,n)}up(e){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(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let n=0;n<e.ranges.length;n++){let r=e.ranges[n],i=null;if(r.empty){let e=FT(this.atoms,r.from,0);e!=r.from&&(i=L.cursor(e,-1))}else{let e=FT(this.atoms,r.from,-1),t=FT(this.atoms,r.to,1);(e!=r.from||t!=r.to)&&(i=L.range(r.from==r.anchor?e:t,r.from==r.head?e:t))}i&&(t||=e.ranges.slice(),t[n]=i)}return t?L.create(t,e.mainIndex):e}select(e){let{view:t}=this,n=this.skipAtoms(this.style.get(e,this.extend,this.multiple));(this.mustSelect||!n.eq(t.state.selection,this.dragging===!1))&&this.view.dispatch({selection:n,userEvent:`select.pointer`}),this.mustSelect=!1}update(e){e.transactions.some(e=>e.isUserEvent(`input.type`))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}};function iE(e,t){let n=e.state.facet(Aw);return n.length?n[0](t):AC.mac?t.metaKey:t.ctrlKey}function aE(e,t){let n=e.state.facet(jw);return n.length?n[0](t):AC.mac?!t.altKey:!t.ctrlKey}function oE(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let r=BS(e.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let e=0;e<i.length;e++){let n=i[e];if(n.left<=t.clientX&&n.right>=t.clientX&&n.top<=t.clientY&&n.bottom>=t.clientY)return!0}return!1}function sE(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target,r;n!=e.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=mC.get(n))&&r.ignoreEvent(t))return!1;return!0}var cE=Object.create(null),lE=Object.create(null),uE=AC.ie&&AC.ie_version<15||AC.ios&&AC.webkit_version<604;function dE(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(),pE(e,n.value)},50)}function fE(e,t,n){for(let r of e.facet(t))n=r(n,e);return n}function pE(e,t){t=fE(e.state,Lw,t);let{state:n}=e,r,i=1,a=n.toText(t),o=a.lines==n.selection.ranges.length;if(OE!=null&&n.selection.ranges.every(e=>e.empty)&&OE==a.toString()){let e=-1;r=n.changeByRange(r=>{let s=n.doc.lineAt(r.from);if(s.from==e)return{range:r};e=s.from;let c=n.toText((o?a.line(i++).text:t)+n.lineBreak);return{changes:{from:s.from,insert:c},range:L.cursor(r.from+c.length)}})}else r=o?n.changeByRange(e=>{let t=a.line(i++);return{changes:{from:e.from,to:e.to,insert:t.text},range:L.cursor(e.from+t.length)}}):n.replaceSelection(a);e.dispatch(r,{userEvent:`input.paste`,scrollIntoView:!0})}lE.scroll=e=>{e.inputState.lastScrollTop=e.scrollDOM.scrollTop,e.inputState.lastScrollLeft=e.scrollDOM.scrollLeft},cE.keydown=(e,t)=>(e.inputState.setSelectionOrigin(`select`),t.keyCode==27&&e.inputState.tabFocusMode!=0&&(e.inputState.tabFocusMode=Date.now()+2e3),!1),lE.touchstart=(e,t)=>{e.inputState.lastTouchTime=Date.now(),e.inputState.setSelectionOrigin(`select.pointer`)},lE.touchmove=e=>{e.inputState.setSelectionOrigin(`select.pointer`)},cE.mousedown=(e,t)=>{if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of e.state.facet(Mw))if(n=r(e,t),n)break;if(!n&&t.button==0&&(n=CE(e,t)),n){let r=!e.hasFocus;e.inputState.startMouseSelection(new rE(e,t,n,r)),r&&e.observer.ignore(()=>{nC(e.contentDOM);let t=e.root.activeElement;t&&!t.contains(e.contentDOM)&&t.blur()});let i=e.inputState.mouseSelection;if(i)return i.start(t),i.dragging===!1}return!1};function mE(e,t,n,r){if(r==1)return L.cursor(t,n);if(r==2)return vT(e.state,t,n);{let n=tw.find(e.docView,t),r=e.state.doc.lineAt(n?n.posAtEnd:t),i=n?n.posAtStart:r.from,a=n?n.posAtEnd:r.to;return a<e.state.doc.length&&a==r.to&&a++,L.range(i,a)}}var hE=(e,t,n)=>t>=n.top&&t<=n.bottom&&e>=n.left&&e<=n.right;function gE(e,t,n,r){let i=tw.find(e.docView,t);if(!i)return 1;let a=t-i.posAtStart;if(a==0)return 1;if(a==i.length)return-1;let o=i.coordsAt(a,-1);if(o&&hE(n,r,o))return-1;let s=i.coordsAt(a,1);return s&&hE(n,r,s)?1:o&&o.bottom>=r?-1:1}function _E(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1);return{pos:n,bias:gE(e,n,t.clientX,t.clientY)}}var vE=AC.ie&&AC.ie_version<=11,yE=null,bE=0,xE=0;function SE(e){if(!vE)return e.detail;let t=yE,n=xE;return yE=e,xE=Date.now(),bE=!t||n>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(bE+1)%3:1}function CE(e,t){let n=_E(e,t),r=SE(t),i=e.state.selection;return{update(e){e.docChanged&&(n.pos=e.changes.mapPos(n.pos),i=i.map(e.changes))},get(t,a,o){let s=_E(e,t),c,l=mE(e,s.pos,s.bias,r);if(n.pos!=s.pos&&!a){let t=mE(e,n.pos,n.bias,r),i=Math.min(t.from,l.from),a=Math.max(t.to,l.to);l=i<l.from?L.range(i,a):L.range(a,i)}return a?i.replaceRange(i.main.extend(l.from,l.to)):o&&r==1&&i.ranges.length>1&&(c=wE(i,s.pos))?c:o?i.addRange(l):L.create([l])}}}function wE(e,t){for(let n=0;n<e.ranges.length;n++){let{from:r,to:i}=e.ranges[n];if(r<=t&&i>=t)return L.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-+(e.mainIndex>n))}return null}cE.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let r=e.docView.nearest(t.target);if(r&&r.isWidget){let e=r.posAtStart,t=e+r.length;(e>=n.to||t<=n.from)&&(n=L.range(e,t))}}let{inputState:r}=e;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData(`Text`,fE(e.state,Rw,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed=`copyMove`),!1},cE.dragend=e=>(e.inputState.draggedContent=null,!1);function TE(e,t,n,r){if(n=fE(e.state,Lw,n),!n)return;let i=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:a}=e.inputState,o=r&&a&&aE(e,t)?{from:a.from,to:a.to}:null,s={from:i,insert:n},c=e.state.changes(o?[o,s]:s);e.focus(),e.dispatch({changes:c,selection:{anchor:c.mapPos(i,-1),head:c.mapPos(i,1)},userEvent:o?`move.drop`:`input.drop`}),e.inputState.draggedContent=null}cE.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,a=()=>{++i==n.length&&TE(e,t,r.filter(e=>e!=null).join(e.state.lineBreak),!1)};for(let e=0;e<n.length;e++){let t=new FileReader;t.onerror=a,t.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(t.result)||(r[e]=t.result),a()},t.readAsText(n[e])}return!0}else{let n=t.dataTransfer.getData(`Text`);if(n)return TE(e,t,n,!0),!0}return!1},cE.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=uE?null:t.clipboardData;return n?(pE(e,n.getData(`text/plain`)||n.getData(`text/uri-list`)),!0):(dE(e),!1)};function EE(e,t){let n=e.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement(`textarea`));r.style.cssText=`position: fixed; left: -10000px; top: 10px`,r.value=t,r.focus(),r.selectionEnd=t.length,r.selectionStart=0,setTimeout(()=>{r.remove(),e.focus()},50)}function DE(e){let t=[],n=[],r=!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 i=-1;for(let{from:r}of e.selection.ranges){let a=e.doc.lineAt(r);a.number>i&&(t.push(a.text),n.push({from:a.from,to:Math.min(e.doc.length,a.to+1)})),i=a.number}r=!0}return{text:fE(e,Rw,t.join(e.lineBreak)),ranges:n,linewise:r}}var OE=null;cE.copy=cE.cut=(e,t)=>{let{text:n,ranges:r,linewise:i}=DE(e.state);if(!n&&!i)return!1;OE=i?n:null,t.type==`cut`&&!e.state.readOnly&&e.dispatch({changes:r,scrollIntoView:!0,userEvent:`delete.cut`});let a=uE?null:t.clipboardData;return a?(a.clearData(),a.setData(`text/plain`,n),!0):(EE(e,n),!1)};var kE=Vx.define();function AE(e,t){let n=[];for(let r of e.facet(Iw)){let i=r(e,t);i&&n.push(i)}return n?e.update({effects:n,annotations:kE.of(!0)}):null}function jE(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=AE(e.state,t);n?e.dispatch(n):e.update([])}},10)}lE.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),jE(e)},lE.blur=e=>{e.observer.clearSelectionRange(),jE(e)},lE.compositionstart=lE.compositionupdate=e=>{e.observer.editContext||(e.inputState.compositionFirstChange??(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))},lE.compositionend=e=>{e.observer.editContext||(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,AC.chrome&&AC.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))},lE.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()},cE.beforeinput=(e,t)=>{if(t.inputType==`insertReplacementText`&&e.observer.editContext){let n=t.dataTransfer?.getData(`text/plain`),r=t.getTargetRanges();if(n&&r.length){let t=r[0];return UT(e,{from:e.posAtDOM(t.startContainer,t.startOffset),to:e.posAtDOM(t.endContainer,t.endOffset),insert:e.state.toText(n)},null),!0}}let n;if(AC.chrome&&AC.android&&(n=ZT.find(e=>e.inputType==t.inputType))&&(e.observer.delayAndroidKey(n.key,n.keyCode),n.key==`Backspace`||n.key==`Delete`)){let t=window.visualViewport?.height||0;setTimeout(()=>{(window.visualViewport?.height||0)>t+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())},100)}return AC.ios&&t.inputType==`deleteContentForward`&&e.observer.flushSoon(),AC.safari&&t.inputType==`insertText`&&e.inputState.composing>=0&&setTimeout(()=>lE.compositionend(e,t),20),!1};var ME=new Set;function NE(e){ME.has(e)||(ME.add(e),e.addEventListener(`copy`,()=>{}),e.addEventListener(`cut`,()=>{}))}var PE=[`pre-wrap`,`normal`,`pre-line`,`break-spaces`],FE=!1;function IE(){FE=!1}var LE=class{constructor(e){this.lineWrapping=e,this.doc=Bb.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}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 PE.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];r<0?n++:this.heightSamples[Math.floor(r*10)]||(t=!0,this.heightSamples[Math.floor(r*10)]=!0)}return t}refresh(e,t,n,r,i,a){let o=PE.indexOf(e)>-1,s=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=o;if(this.lineWrapping=o,this.lineHeight=t,this.charWidth=n,this.textHeight=r,this.lineLength=i,s){this.heightSamples={};for(let e=0;e<a.length;e++){let t=a[e];t<0?e++:this.heightSamples[Math.floor(t*10)]=!0}}return s}},RE=class{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}},zE=class e{constructor(e,t,n,r,i){this.from=e,this.length=t,this.top=n,this.height=r,this._content=i}get type(){return typeof this._content==`number`?qC.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof ZC?this._content.widget:null}get widgetLineBreaks(){return typeof this._content==`number`?this._content:0}join(t){let n=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(t._content)?t._content:[t]);return new e(this.from,this.length+t.length,this.top,this.height+t.height,n)}},BE=(function(e){return e[e.ByPos=0]=`ByPos`,e[e.ByHeight=1]=`ByHeight`,e[e.ByPosNoHeight=2]=`ByPosNoHeight`,e})(BE||={}),VE=.001,HE=class e{constructor(e,t,n=2){this.length=e,this.height=t,this.flags=n}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>VE&&(FE=!0),this.height=e)}replace(t,n,r){return e.of(r)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,r){let i=this,a=n.doc;for(let o=r.length-1;o>=0;o--){let{fromA:s,toA:c,fromB:l,toB:u}=r[o],d=i.lineAt(s,BE.ByPosNoHeight,n.setDoc(t),0,0),f=d.to>=c?d:i.lineAt(c,BE.ByPosNoHeight,n,0,0);for(u+=f.to-c,c=f.to;o>0&&d.from<=r[o-1].toA;)s=r[o-1].fromA,l=r[o-1].fromB,o--,s<d.from&&(d=i.lineAt(s,BE.ByPosNoHeight,n,0,0));l+=d.from-s,s=d.from;let p=XE.build(n.setDoc(a),e,l,u);i=UE(i,i.replace(s,c,p))}return i.updateHeight(n,0)}static empty(){return new GE(0,0)}static of(t){if(t.length==1)return t[0];let n=0,r=t.length,i=0,a=0;for(;;)if(n==r)if(i>a*2){let e=t[n-1];e.break?t.splice(--n,1,e.left,null,e.right):t.splice(--n,1,e.left,e.right),r+=1+e.break,i-=e.size}else if(a>i*2){let e=t[r];e.break?t.splice(r,1,e.left,null,e.right):t.splice(r,1,e.left,e.right),r+=2+e.break,a-=e.size}else break;else if(i<a){let e=t[n++];e&&(i+=e.size)}else{let e=t[--r];e&&(a+=e.size)}let o=0;return t[n-1]==null?(o=1,n--):t[n]??(o=1,r++),new qE(e.of(t.slice(0,n)),o,e.of(t.slice(r)))}};function UE(e,t){return e==t?e:(e.constructor!=t.constructor&&(FE=!0),t)}HE.prototype.size=1;var WE=class extends HE{constructor(e,t,n){super(e,t),this.deco=n}blockAt(e,t,n,r){return new zE(r,this.length,n,this.height,this.deco||0)}lineAt(e,t,n,r,i){return this.blockAt(0,n,r,i)}forEachLine(e,t,n,r,i,a){e<=i+this.length&&t>=i&&a(this.blockAt(0,n,r,i))}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more&&this.setHeight(r.heights[r.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}},GE=class e extends WE{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,n,r){return new zE(r,this.length,n,this.height,this.breaks)}replace(t,n,r){let i=r[0];return r.length==1&&(i instanceof e||i instanceof KE&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof KE?i=new e(i.length,this.height):i.height=this.height,this.outdated||(i.outdated=!1),i):HE.of(r)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more?this.setHeight(r.heights[r.index++]):(n||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:``}${this.widgetHeight?`:`+this.widgetHeight:``})`}},KE=class e extends HE{constructor(e){super(e,0)}heightMetrics(e,t){let n=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,i=r-n+1,a,o=0;if(e.lineWrapping){let t=Math.min(this.height,e.lineHeight*i);a=t/i,this.length>i+1&&(o=(this.height-t)/(this.length-i-1))}else a=this.height/i;return{firstLine:n,lastLine:r,perLine:a,perChar:o}}blockAt(e,t,n,r){let{firstLine:i,lastLine:a,perLine:o,perChar:s}=this.heightMetrics(t,r);if(t.lineWrapping){let i=r+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length)),a=t.doc.lineAt(i),c=o+a.length*s,l=Math.max(n,e-c/2);return new zE(a.from,a.length,l,c,0)}else{let r=Math.max(0,Math.min(a-i,Math.floor((e-n)/o))),{from:s,length:c}=t.doc.line(i+r);return new zE(s,c,n+o*r,o,0)}}lineAt(e,t,n,r,i){if(t==BE.ByHeight)return this.blockAt(e,n,r,i);if(t==BE.ByPosNoHeight){let{from:t,to:r}=n.doc.lineAt(e);return new zE(t,r-t,0,0,0)}let{firstLine:a,perLine:o,perChar:s}=this.heightMetrics(n,i),c=n.doc.lineAt(e),l=o+c.length*s,u=c.number-a,d=r+o*u+s*(c.from-i-u);return new zE(c.from,c.length,Math.max(r,Math.min(d,r+this.height-l)),l,0)}forEachLine(e,t,n,r,i,a){e=Math.max(e,i),t=Math.min(t,i+this.length);let{firstLine:o,perLine:s,perChar:c}=this.heightMetrics(n,i);for(let l=e,u=r;l<=t;){let t=n.doc.lineAt(l);if(l==e){let n=t.number-o;u+=s*n+c*(e-i-n)}let r=s+c*t.length;a(new zE(t.from,t.length,u,r,0)),u+=r,l=t.to+1}}replace(t,n,r){let i=this.length-n;if(i>0){let t=r[r.length-1];t instanceof e?r[r.length-1]=new e(t.length+i):r.push(null,new e(i-1))}if(t>0){let n=r[0];n instanceof e?r[0]=new e(t+n.length):r.unshift(new e(t-1),null)}return HE.of(r)}decomposeLeft(t,n){n.push(new e(t-1),null)}decomposeRight(t,n){n.push(null,new e(this.length-t-1))}updateHeight(t,n=0,r=!1,i){let a=n+this.length;if(i&&i.from<=n+this.length&&i.more){let r=[],o=Math.max(n,i.from),s=-1;for(i.from>n&&r.push(new e(i.from-n-1).updateHeight(t,n));o<=a&&i.more;){let e=t.doc.lineAt(o).length;r.length&&r.push(null);let n=i.heights[i.index++];s==-1?s=n:Math.abs(n-s)>=VE&&(s=-2);let a=new GE(e,n);a.outdated=!1,r.push(a),o+=e+1}o<=a&&r.push(null,new e(a-o).updateHeight(t,o));let c=HE.of(r);return(s<0||Math.abs(c.height-this.height)>=VE||Math.abs(s-this.heightMetrics(t,n).perLine)>=VE)&&(FE=!0),UE(this,c)}else (r||this.outdated)&&(this.setHeight(t.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}},qE=class extends HE{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 this.flags&1}blockAt(e,t,n,r){let i=n+this.left.height;return e<i?this.left.blockAt(e,t,n,r):this.right.blockAt(e,t,i,r+this.left.length+this.break)}lineAt(e,t,n,r,i){let a=r+this.left.height,o=i+this.left.length+this.break,s=t==BE.ByHeight?e<a:e<o,c=s?this.left.lineAt(e,t,n,r,i):this.right.lineAt(e,t,n,a,o);if(this.break||(s?c.to<o:c.from>o))return c;let l=t==BE.ByPosNoHeight?BE.ByPosNoHeight:BE.ByPos;return s?c.join(this.right.lineAt(o,l,n,a,o)):this.left.lineAt(o,l,n,r,i).join(c)}forEachLine(e,t,n,r,i,a){let o=r+this.left.height,s=i+this.left.length+this.break;if(this.break)e<s&&this.left.forEachLine(e,t,n,r,i,a),t>=s&&this.right.forEachLine(e,t,n,o,s,a);else{let c=this.lineAt(s,BE.ByPos,n,r,i);e<c.from&&this.left.forEachLine(e,c.from-1,n,r,i,a),c.to>=e&&c.from<=t&&a(c),t>c.to&&this.right.forEachLine(c.to+1,t,n,o,s,a)}}replace(e,t,n){let r=this.left.length+this.break;if(t<r)return this.balanced(this.left.replace(e,t,n),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,n));let i=[];e>0&&this.decomposeLeft(e,i);let a=i.length;for(let e of n)i.push(e);if(e>0&&JE(i,a-1),t<this.length){let e=i.length;this.decomposeRight(t,i),JE(i,e)}return HE.of(i)}decomposeLeft(e,t){let n=this.left.length;if(e<=n)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(n++,e>=n&&t.push(null)),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,r=n+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e<n&&this.left.decomposeRight(e,t),this.break&&e<r&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?HE.of(this.break?[e,null,t]:[e,t]):(this.left=UE(this.left,e),this.right=UE(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,n=!1,r){let{left:i,right:a}=this,o=t+i.length+this.break,s=null;return r&&r.from<=t+i.length&&r.more?s=i=i.updateHeight(e,t,n,r):i.updateHeight(e,t,n),r&&r.from<=o+a.length&&r.more?s=a=a.updateHeight(e,o,n,r):a.updateHeight(e,o,n),s?this.balanced(i,a):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?` `:`-`)+this.right}};function JE(e,t){let n,r;e[t]==null&&(n=e[t-1])instanceof KE&&(r=e[t+1])instanceof KE&&e.splice(t-1,3,new KE(n.length+1+r.length))}var YE=5,XE=class e{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 GE?n.length+=e-this.pos:(e>this.pos||!this.isCovered)&&this.nodes.push(new GE(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<t||n.heightRelevant){let r=n.widget?n.widget.estimatedHeight:0,i=n.widget?n.widget.lineBreaks:0;r<0&&(r=this.oracle.lineHeight);let a=t-e;n.block?this.addBlock(new WE(a,r,n)):(a||i||r>=YE)&&this.addLineDeco(r,i,a)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new GE(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let n=new KE(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 GE)return e;let t=new GE(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+=e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,n){let r=this.ensureLine();r.length+=n,r.collapsed+=n,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=t,this.writtenTo=this.pos+=n}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof GE)&&!this.isCovered?this.nodes.push(new GE(0,-1)):(this.writtenTo<this.pos||t==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let n=e;for(let e of this.nodes)e instanceof GE&&e.updateHeight(this.oracle,n),n+=e?e.length:1;return this.nodes}static build(t,n,r,i){let a=new e(r,t);return dS.spans(n,r,i,a,0),a.finish(r)}};function ZE(e,t,n){let r=new QE;return dS.compare(e,t,n,r,0),r.changes}var QE=class{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,n,r){(e<t||n&&n.heightRelevant||r&&r.heightRelevant)&&ew(e,t,this.changes,5)}};function $E(e,t){let n=e.getBoundingClientRect(),r=e.ownerDocument,i=r.defaultView||window,a=Math.max(0,n.left),o=Math.min(i.innerWidth,n.right),s=Math.max(0,n.top),c=Math.min(i.innerHeight,n.bottom);for(let t=e.parentNode;t&&t!=r.body;)if(t.nodeType==1){let n=t,r=window.getComputedStyle(n);if((n.scrollHeight>n.clientHeight||n.scrollWidth>n.clientWidth)&&r.overflow!=`visible`){let r=n.getBoundingClientRect();a=Math.max(a,r.left),o=Math.min(o,r.right),s=Math.max(s,r.top),c=Math.min(t==e.parentNode?i.innerHeight:c,r.bottom)}t=r.position==`absolute`||r.position==`fixed`?n.offsetParent:n.parentNode}else if(t.nodeType==11)t=t.host;else break;return{left:a-n.left,right:Math.max(a,o)-n.left,top:s-(n.top+t),bottom:Math.max(s,c)-(n.top+t)}}function eD(e){let t=e.getBoundingClientRect(),n=e.ownerDocument.defaultView||window;return t.left<n.innerWidth&&t.right>0&&t.top<n.innerHeight&&t.bottom>0}function tD(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}var nD=class{constructor(e,t,n,r){this.from=e,this.to=t,this.size=n,this.displaySize=r}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.from!=i.from||r.to!=i.to||r.size!=i.size)return!1}return!0}draw(e,t){return JC.replace({widget:new rD(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}},rD=class extends KC{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement(`div`);return this.vertical?e.style.height=this.size+`px`:(e.style.width=this.size+`px`,e.style.height=`2px`,e.style.display=`inline-block`),e}get estimatedHeight(){return this.vertical?this.size:-1}},iD=class{constructor(e){this.state=e,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scrollTop=0,this.scrolledToBottom=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=uD,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=sw.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let t=e.facet(Qw).some(e=>typeof e!=`function`&&e.class==`cm-lineWrapping`);this.heightOracle=new LE(t),this.stateDeco=e.facet($w).filter(e=>typeof e!=`function`),this.heightMap=HE.empty().applyChanges(this.stateDeco,Bb.empty,this.heightOracle.setDoc(e.doc),[new sT(0,0,0,e.doc.length)]);for(let e=0;e<2&&(this.viewport=this.getViewport(0,null),this.updateForViewport());e++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=JC.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 r=n?t.head:t.anchor;if(!e.some(({from:e,to:t})=>r>=e&&r<=t)){let{from:t,to:n}=this.lineBlockAt(r);e.push(new aD(t,n))}}return this.viewports=e.sort((e,t)=>e.from-t.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?uD:new dD(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(fD(e,this.scaler))})}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=this.state.facet($w).filter(e=>typeof e!=`function`);let r=e.changedRanges,i=sT.extendWithRanges(r,ZE(n,this.stateDeco,e?e.changes:ox.empty(this.state.doc.length))),a=this.heightMap.height,o=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);IE(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),i),(this.heightMap.height!=a||FE)&&(e.flags|=2),o?(this.scrollAnchorPos=e.changes.mapPos(o.from,-1),this.scrollAnchorHeight=o.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let s=i.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<s.from||t.range.head>s.to)||!this.viewportIsAppropriate(s))&&(s=this.getViewport(0,t));let c=s.from!=this.viewport.from||s.to!=this.viewport.to;this.viewport=s,e.flags|=this.updateForViewport(),(c||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(Bw)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,n=window.getComputedStyle(t),r=this.heightOracle,i=n.whiteSpace;this.defaultTextDirection=n.direction==`rtl`?sw.RTL:sw.LTR;let a=this.heightOracle.mustRefreshForWrapping(i),o=t.getBoundingClientRect(),s=a||this.mustMeasureContent||this.contentDOMHeight!=o.height;this.contentDOMHeight=o.height,this.mustMeasureContent=!1;let c=0,l=0;if(o.width&&o.height){let{scaleX:e,scaleY:n}=ZS(t,o);(e>.005&&Math.abs(this.scaleX-e)>.005||n>.005&&Math.abs(this.scaleY-n)>.005)&&(this.scaleX=e,this.scaleY=n,c|=16,a=s=!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,c|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(s=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=16);let f=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=f&&(this.scrollAnchorHeight=-1,this.scrollTop=f),this.scrolledToBottom=lC(e.scrollDOM);let p=(this.printing?tD:$E)(t,this.paddingTop),m=p.top-this.pixelViewport.top,h=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let g=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(g!=this.inView&&(this.inView=g,g&&(s=!0)),!this.inView&&!this.scrollTarget&&!eD(e.dom))return 0;let _=o.width;if((this.contentDOMWidth!=_||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=o.width,this.editorHeight=e.scrollDOM.clientHeight,c|=16),s){let t=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(t)&&(a=!0),a||r.lineWrapping&&Math.abs(_-this.contentDOMWidth)>r.charWidth){let{lineHeight:n,charWidth:o,textHeight:s}=e.docView.measureTextSize();a=n>0&&r.refresh(i,n,o,s,_/o,t),a&&(e.docView.minWidth=0,c|=16)}m>0&&h>0?l=Math.max(m,h):m<0&&h<0&&(l=Math.min(m,h)),IE();for(let n of this.viewports){let i=n.from==this.viewport.from?t:e.docView.measureVisibleLineHeights(n);this.heightMap=(a?HE.empty().applyChanges(this.stateDeco,Bb.empty,this.heightOracle,[new sT(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,a,new RE(n.from,i))}FE&&(c|=2)}let v=!this.viewportIsAppropriate(this.viewport,l)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return v&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(l,this.scrollTarget),c|=this.updateForViewport()),(c&2||v)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(a?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,i=this.heightOracle,{visibleTop:a,visibleBottom:o}=this,s=new aD(r.lineAt(a-n*1e3,BE.ByHeight,i,0,0).from,r.lineAt(o+(1-n)*1e3,BE.ByHeight,i,0,0).to);if(t){let{head:e}=t.range;if(e<s.from||e>s.to){let n=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),a=r.lineAt(e,BE.ByPos,i,0,0),o;o=t.y==`center`?(a.top+a.bottom)/2-n/2:t.y==`start`||t.y==`nearest`&&e<s.from?a.top:a.bottom-n,s=new aD(r.lineAt(o-1e3/2,BE.ByHeight,i,0,0).from,r.lineAt(o+n+1e3/2,BE.ByHeight,i,0,0).to)}}return s}mapViewport(e,t){let n=t.mapPos(e.from,-1),r=t.mapPos(e.to,1);return new aD(this.heightMap.lineAt(n,BE.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(r,BE.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},n=0){if(!this.inView)return!0;let{top:r}=this.heightMap.lineAt(e,BE.ByPos,this.heightOracle,0,0),{bottom:i}=this.heightMap.lineAt(t,BE.ByPos,this.heightOracle,0,0),{visibleTop:a,visibleBottom:o}=this;return(e==0||r<=a-Math.max(10,Math.min(-n,250)))&&(t==this.state.doc.length||i>=o+Math.max(10,Math.min(n,250)))&&r>a-2*1e3&&i<o+2*1e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let n=[];for(let r of e)t.touchesRange(r.from,r.to)||n.push(new nD(t.mapPos(r.from),t.mapPos(r.to),r.size,r.displaySize));return n}ensureLineGaps(e,t){let n=this.heightOracle.lineWrapping,r=n?1e4:2e3,i=r>>1,a=r<<1;if(this.defaultTextDirection!=sw.LTR&&!n)return[];let o=[],s=(r,a,c,l)=>{if(a-r<i)return;let u=this.state.selection.main,d=[u.from];u.empty||d.push(u.to);for(let e of d)if(e>r&&e<a){s(r,e-10,c,l),s(e+10,a,c,l);return}let f=lD(e,e=>e.from>=c.from&&e.to<=c.to&&Math.abs(e.from-r)<i&&Math.abs(e.to-a)<i&&!d.some(t=>e.from<t&&e.to>t));if(!f){if(a<c.to&&t&&n&&t.visibleRanges.some(e=>e.from<=a&&e.to>=a)){let e=t.moveToLineBoundary(L.cursor(a),!1,!0).head;e>r&&(a=e)}let e=this.gapSize(c,r,a,l);f=new nD(r,a,e,n||e<2e6?e:2e6)}o.push(f)},c=t=>{if(t.length<a||t.type!=qC.Text)return;let i=oD(t.from,t.to,this.stateDeco);if(i.total<a)return;let o=this.scrollTarget?this.scrollTarget.range.head:null,c,l;if(n){let e=r/this.heightOracle.lineLength*this.heightOracle.lineHeight,n,a;if(o!=null){let r=cD(i,o),s=((this.visibleBottom-this.visibleTop)/2+e)/t.height;n=r-s,a=r+s}else n=(this.visibleTop-t.top-e)/t.height,a=(this.visibleBottom-t.top+e)/t.height;c=sD(i,n),l=sD(i,a)}else{let n=i.total*this.heightOracle.charWidth,a=r*this.heightOracle.charWidth,s=0;if(n>2e6)for(let n of e)n.from>=t.from&&n.from<t.to&&n.size!=n.displaySize&&n.from*this.heightOracle.charWidth+s<this.pixelViewport.left&&(s=n.size-n.displaySize);let u=this.pixelViewport.left+s,d=this.pixelViewport.right+s,f,p;if(o!=null){let e=cD(i,o),t=((d-u)/2+a)/n;f=e-t,p=e+t}else f=(u-a)/n,p=(d+a)/n;c=sD(i,f),l=sD(i,p)}c>t.from&&s(t.from,c,t,i),l<t.to&&s(l,t.to,t,i)};for(let e of this.viewportLines)Array.isArray(e.type)?e.type.forEach(c):c(e);return o}gapSize(e,t,n,r){let i=cD(r,n)-cD(r,t);return this.heightOracle.lineWrapping?e.height*i:r.total*this.heightOracle.charWidth*i}updateLineGaps(e){nD.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=JC.set(e.map(e=>e.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let n=[];dS.spans(t,this.viewport.from,this.viewport.to,{span(e,t){n.push({from:e,to:t})},point(){}},20);let r=0;if(n.length!=this.visibleRanges.length)r=12;else for(let t=0;t<n.length&&!(r&8);t++){let i=this.visibleRanges[t],a=n[t];(i.from!=a.from||i.to!=a.to)&&(r|=4,e&&e.mapPos(i.from,-1)==a.from&&e.mapPos(i.to,1)==a.to||(r|=8))}return this.visibleRanges=n,r}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||fD(this.heightMap.lineAt(e,BE.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||fD(this.heightMap.lineAt(this.scaler.fromDOM(e),BE.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 fD(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}},aD=class{constructor(e,t){this.from=e,this.to=t}};function oD(e,t,n){let r=[],i=e,a=0;return dS.spans(n,e,t,{span(){},point(e,t){e>i&&(r.push({from:i,to:e}),a+=e-i),i=t}},20),i<t&&(r.push({from:i,to:t}),a+=t-i),{total:a,ranges:r}}function sD({total:e,ranges:t},n){if(n<=0)return t[0].from;if(n>=1)return t[t.length-1].to;let r=Math.floor(e*n);for(let e=0;;e++){let{from:n,to:i}=t[e],a=i-n;if(r<=a)return n+r;r-=a}}function cD(e,t){let n=0;for(let{from:r,to:i}of e.ranges){if(t<=i){n+=t-r;break}n+=i-r}return n/e.total}function lD(e,t){for(let n of e)if(t(n))return n}var uD={toDOM(e){return e},fromDOM(e){return e},scale:1,eq(e){return e==this}},dD=class e{constructor(e,t,n){let r=0,i=0,a=0;this.viewports=n.map(({from:n,to:i})=>{let a=t.lineAt(n,BE.ByPos,e,0,0).top,o=t.lineAt(i,BE.ByPos,e,0,0).bottom;return r+=o-a,{from:n,to:i,top:a,bottom:o,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(t.height-r);for(let e of this.viewports)e.domTop=a+(e.top-i)*this.scale,a=e.domBottom=e.domTop+(e.bottom-e.top),i=e.bottom}toDOM(e){for(let t=0,n=0,r=0;;t++){let i=t<this.viewports.length?this.viewports[t]:null;if(!i||e<i.top)return r+(e-n)*this.scale;if(e<=i.bottom)return i.domTop+(e-i.top);n=i.bottom,r=i.domBottom}}fromDOM(e){for(let t=0,n=0,r=0;;t++){let i=t<this.viewports.length?this.viewports[t]:null;if(!i||e<i.domTop)return n+(e-r)/this.scale;if(e<=i.domBottom)return i.top+(e-i.domTop);n=i.bottom,r=i.domBottom}}eq(t){return t instanceof e?this.scale==t.scale&&this.viewports.length==t.viewports.length&&this.viewports.every((e,n)=>e.from==t.viewports[n].from&&e.to==t.viewports[n].to):!1}};function fD(e,t){if(t.scale==1)return e;let n=t.toDOM(e.top),r=t.toDOM(e.bottom);return new zE(e.from,e.length,n,r-n,Array.isArray(e._content)?e._content.map(e=>fD(e,t)):e._content)}var pD=gx.define({combine:e=>e.join(` `)}),mD=gx.define({combine:e=>e.indexOf(!0)>-1}),hD=AS.newName(),gD=AS.newName(),_D=AS.newName(),vD={"&light":`.`+gD,"&dark":`.`+_D};function yD(e,t,n){return new AS(t,{finish(t){return/&/.test(t)?t.replace(/&\w*/,t=>{if(t==`&`)return e;if(!n||!n[t])throw RangeError(`Unsupported selector: ${t}`);return n[t]}):e+` `+t}})}var bD=yD(`.`+hD,{"&":{position:`relative !important`,boxSizing:`border-box`,"&.cm-focused":{outline:`1px dotted #212121`},display:`flex !important`,flexDirection:`column`},".cm-scroller":{display:`flex !important`,alignItems:`flex-start !important`,fontFamily:`monospace`,lineHeight:1.4,height:`100%`,overflowX:`auto`,position:`relative`,zIndex:0,overflowAnchor:`none`},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:`block`,whiteSpace:`pre`,wordWrap:`normal`,boxSizing:`border-box`,minHeight:`100%`,padding:`4px 0`,outline:`none`,"&[contenteditable=true]":{WebkitUserModify:`read-write-plaintext-only`}},".cm-lineWrapping":{whiteSpace_fallback:`pre-wrap`,whiteSpace:`break-spaces`,wordBreak:`break-word`,overflowWrap:`anywhere`,flexShrink:1},"&light .cm-content":{caretColor:`black`},"&dark .cm-content":{caretColor:`white`},".cm-line":{display:`block`,padding:`0 2px 0 6px`},".cm-layer":{position:`absolute`,left:0,top:0,contain:`size style`,"& > *":{position:`absolute`}},"&light .cm-selectionBackground":{background:`#d9d9d9`},"&dark .cm-selectionBackground":{background:`#222`},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:`#d7d4f0`},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:`#233`},".cm-cursorLayer":{pointerEvents:`none`},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:`steps(1) cm-blink 1.2s infinite`},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:`1.2px solid black`,marginLeft:`-0.6px`,pointerEvents:`none`},".cm-cursor":{display:`none`},"&dark .cm-cursor":{borderLeftColor:`#ddd`},".cm-dropCursor":{position:`absolute`},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:`block`},".cm-iso":{unicodeBidi:`isolate`},".cm-announced":{position:`fixed`,top:`-10000px`},"@media print":{".cm-announced":{display:`none`}},"&light .cm-activeLine":{backgroundColor:`#cceeff44`},"&dark .cm-activeLine":{backgroundColor:`#99eeff33`},"&light .cm-specialChar":{color:`red`},"&dark .cm-specialChar":{color:`#f78`},".cm-gutters":{flexShrink:0,display:`flex`,height:`100%`,boxSizing:`border-box`,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,zIndex:300},"&light .cm-panels":{backgroundColor:`#f5f5f5`,color:`black`},"&light .cm-panels-top":{borderBottom:`1px solid #ddd`},"&light .cm-panels-bottom":{borderTop:`1px solid #ddd`},"&dark .cm-panels":{backgroundColor:`#333338`,color:`white`},".cm-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":{backgroundImage:`radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)`,backgroundPosition:`center`},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:`auto 100%`,backgroundPosition:`right 90%`,backgroundRepeat:`no-repeat`},".cm-trailingSpace":{backgroundColor:`#ff332255`},".cm-button":{verticalAlign:`middle`,color:`inherit`,fontSize:`70%`,padding:`.2em 1em`,borderRadius:`1px`},"&light .cm-button":{backgroundImage:`linear-gradient(#eff1f5, #d9d9df)`,border:`1px solid #888`,"&:active":{backgroundImage:`linear-gradient(#b4b4b4, #d0d3d6)`}},"&dark .cm-button":{backgroundImage:`linear-gradient(#393939, #111)`,border:`1px solid #888`,"&:active":{backgroundImage:`linear-gradient(#111, #333)`}},".cm-textfield":{verticalAlign:`middle`,color:`inherit`,fontSize:`70%`,border:`1px solid silver`,padding:`.2em .5em`},"&light .cm-textfield":{backgroundColor:`white`},"&dark .cm-textfield":{border:`1px solid #555`,backgroundColor:`inherit`}},vD),xD={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},SD=AC.ie&&AC.ie_version<=11,CD=class{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new eC,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let e of t)this.queue.push(e);(AC.ie&&AC.ie_version<=11||AC.ios&&e.composing)&&t.some(e=>e.type==`childList`&&e.removedNodes.length||e.type==`characterData`&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&e.constructor.EDIT_CONTEXT!==!1&&!(AC.chrome&&AC.chrome_version<126)&&(this.editContext=new DD(e),e.state.facet(Kw)&&(e.contentDOM.editContext=this.editContext.editContext)),SD&&(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),window.matchMedia&&(this.printQuery=window.matchMedia(`print`)),typeof ResizeObserver==`function`&&(this.resizeScroll=new ResizeObserver(()=>{this.view.docView?.lastUpdate<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver==`function`&&(this.intersection=new IntersectionObserver(e=>{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.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type==`change`||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,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,r=this.selectionRange;if(n.state.facet(Kw)?n.root.activeElement!=this.dom:!HS(this.dom,r))return;let i=r.anchorNode&&n.docView.nearest(r.anchorNode);if(i&&i.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(AC.ie&&AC.ie_version<=11||AC.android&&AC.chrome)&&!n.state.selection.main.empty&&r.focusNode&&WS(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=BS(e.root);if(!t)return!1;let n=AC.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&ED(this.view,t)||t;if(!n||this.selectionRange.eq(n))return!1;let r=HS(this.dom,n);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&cC(this.dom,n)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(n),r&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let n=this.dom;n;)if(n.nodeType==1)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==n?e++:t||=this.scrollTargets.slice(0,e),t&&t.push(n),n=n.assignedSlot||n.parentNode;else if(n.nodeType==11)n=n.host;else break;if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let e of this.scrollTargets)e.removeEventListener(`scroll`,this.onScroll);for(let e of this.scrollTargets=t)e.addEventListener(`scroll`,this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||=(this.observer.observe(this.dom,xD),SD&&this.dom.addEventListener(`DOMCharacterDataModified`,this.onCharData),!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),SD&&this.dom.removeEventListener(`DOMCharacterDataModified`,this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){if(!this.delayedAndroidKey){let e=()=>{let e=this.delayedAndroidKey;e&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=e.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&e.force&&aC(this.dom,e.key,e.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(e)}(!this.delayedAndroidKey||e==`Enter`)&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!this.delayedAndroidKey?.force})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,n=-1,r=!1;for(let i of e){let e=this.readMutation(i);e&&(e.typeOver&&(r=!0),t==-1?{from:t,to:n}=e:(t=Math.min(e.from,t),n=Math.max(e.to,n)))}return{from:t,to:n,typeOver:r}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),r=this.selectionChanged&&HS(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let i=new VT(this.view,e,t,n);return this.view.docView.domChanged={newSel:i.newSel?i.newSel.main:null},i}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,r=HT(this.view,t);return this.view.state==n&&(t.domChanged||t.newSel&&!t.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),r}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty(e.type==`attributes`),e.type==`attributes`&&(t.flags|=4),e.type==`childList`){let n=wD(t,e.previousSibling||e.target.previousSibling,-1),r=wD(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:r?t.posBefore(r):t.posAtEnd,typeOver:!1}}else if(e.type==`characterData`)return{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue};else return null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener(`resize`,this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener(`change`,this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener(`beforeprint`,this.onPrint),e.addEventListener(`scroll`,this.onScroll),e.document.addEventListener(`selectionchange`,this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener(`scroll`,this.onScroll),e.removeEventListener(`resize`,this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener(`change`,this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener(`beforeprint`,this.onPrint),e.document.removeEventListener(`selectionchange`,this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(Kw)!=e.state.facet(Kw)&&(e.view.contentDOM.editContext=e.state.facet(Kw)?this.editContext.editContext:null))}destroy(){var e,t,n;this.stop(),(e=this.intersection)==null||e.disconnect(),(t=this.gapIntersection)==null||t.disconnect(),(n=this.resizeScroll)==null||n.disconnect();for(let e of this.scrollTargets)e.removeEventListener(`scroll`,this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}};function wD(e,t,n){for(;t;){let r=mC.get(t);if(r&&r.parent==e)return r;let i=t.parentNode;t=i==e.dom?n>0?t.nextSibling:t.previousSibling:i}return null}function TD(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,a=t.endOffset,o=e.docView.domAtPos(e.state.selection.main.anchor);return WS(o.node,o.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function ED(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return TD(e,n)}let n=null;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.contentDOM.addEventListener(`beforeinput`,r,!0),e.dom.ownerDocument.execCommand(`indent`),e.contentDOM.removeEventListener(`beforeinput`,r,!0),n?TD(e,n):null}var DD=class{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=t=>{let n=e.state.selection.main,{anchor:r,head:i}=n,a=this.toEditorPos(t.updateRangeStart),o=this.toEditorPos(t.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:t.updateRangeStart,editorBase:a,drifted:!1});let s={from:a,to:o,insert:Bb.of(t.text.split(`
|
|
41
|
-
`))};if(s.from==this.from&&r<this.from?s.from=r:s.to==this.to&&r>this.to&&(s.to=r),s.from==s.to&&!s.insert.length){let r=L.single(this.toEditorPos(t.selectionStart),this.toEditorPos(t.selectionEnd));r.main.eq(n)||e.dispatch({selection:r,userEvent:`select`});return}if((AC.mac||AC.android)&&s.from==i-1&&/^\. ?$/.test(t.text)&&e.contentDOM.getAttribute(`autocorrect`)==`off`&&(s={from:a,to:o,insert:Bb.of([t.text.replace(`.`,` `)])}),this.pendingContextChange=s,!e.state.readOnly){let n=this.to-this.from+(s.to-s.from+s.insert.length);UT(e,s,L.single(this.toEditorPos(t.selectionStart,n),this.toEditorPos(t.selectionEnd,n)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state))},this.handlers.characterboundsupdate=n=>{let r=[],i=null;for(let t=this.toEditorPos(n.rangeStart),a=this.toEditorPos(n.rangeEnd);t<a;t++){let n=e.coordsForChar(t);i=n&&new DOMRect(n.left,n.top,n.right-n.left,n.bottom-n.top)||i||new DOMRect,r.push(i)}t.updateCharacterBounds(n.rangeStart,r)},this.handlers.textformatupdate=t=>{let n=[];for(let e of t.getTextFormats()){let t=e.underlineStyle,r=e.underlineThickness;if(t!=`None`&&r!=`None`){let i=this.toEditorPos(e.rangeStart),a=this.toEditorPos(e.rangeEnd);if(i<a){let e=`text-decoration: underline ${t==`Dashed`?`dashed `:t==`Squiggle`?`wavy `:``}${r==`Thin`?1:2}px`;n.push(JC.mark({attributes:{style:e}}).range(i,a))}}}e.dispatch({effects:Ww.of(JC.set(n))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:t}=this.composing;this.composing=null,t&&this.reset(e.state)}};for(let e in this.handlers)t.addEventListener(e,this.handlers[e]);this.measureReq={read:e=>{this.editContext.updateControlBounds(e.contentDOM.getBoundingClientRect());let t=BS(e.root);t&&t.rangeCount&&this.editContext.updateSelectionBounds(t.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,n=!1,r=this.pendingContextChange;return e.changes.iterChanges((i,a,o,s,c)=>{if(n)return;let l=c.length-(a-i);if(r&&a>=r.to)if(r.from==i&&r.to==a&&r.insert.eq(c)){r=this.pendingContextChange=null,t+=l,this.to+=l;return}else r=null,this.revertPending(e.state);if(i+=t,a+=t,a<=this.from)this.from+=l,this.to+=l;else if(i<this.to){if(i<this.from||a>this.to||this.to-this.from+c.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(i),this.toContextPos(a),c.toString()),this.to+=l}t+=l}),r&&!n&&this.revertPending(e.state),!n}update(e){let t=this.pendingContextChange,n=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(n.from,n.to)&&e.transactions.some(e=>!e.isUserEvent(`input.type`)&&e.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),r=this.toContextPos(t.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(n,r)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let n=this.composing;return n&&n.drifted?n.editorBase+(e-n.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}},OD=class e{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||oC(e.parent)||document,this.viewState=new iD(e.state||aS.create(e)),e.scrollTo&&e.scrollTo.is(Uw)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Jw).map(e=>new Xw(e));for(let e of this.plugins)e.update(this);this.observer=new CD(this),this.inputState=new JT(this),this.inputState.ensureHandlers(this.plugins),this.docView=new lT(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),document.fonts?.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...e){let t=e.length==1&&e[0]instanceof Gx?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw Error(`Calls to EditorView.update are not allowed while an update is in progress`);let t=!1,n=!1,r,i=this.state;for(let t of e){if(t.startState!=i)throw RangeError(`Trying to update state with a transaction that doesn't start from the previous state.`);i=t.state}if(this.destroyed){this.viewState.state=i;return}let a=this.hasFocus,o=0,s=null;e.some(e=>e.annotation(kE))?(this.inputState.notifiedFocused=a,o=1):a!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=a,s=AE(i,a),s||(o=1));let c=this.observer.delayedAndroidKey,l=null;if(c?(this.observer.clearDelayedAndroidKey(),l=this.observer.readChange(),(l&&!this.state.doc.eq(i.doc)||!this.state.selection.eq(i.selection))&&(l=null)):this.observer.clear(),i.facet(aS.phrases)!=this.state.facet(aS.phrases))return this.setState(i);r=cT.create(this,i,e),r.flags|=o;let u=this.viewState.scrollTarget;try{this.updateState=2;for(let t of e){if(u&&=u.map(t.changes),t.scrollIntoView){let{main:e}=t.state.selection;u=new Hw(e.empty?e:L.cursor(e.head,e.head>e.anchor?-1:1))}for(let e of t.effects)e.is(Uw)&&(u=e.value.clip(this.state))}this.viewState.update(r,u),this.bidiCache=jD.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),t=this.docView.update(r),this.state.facet(oT)!=this.styleModules&&this.mountStyles(),n=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(e=>e.isUserEvent(`select.pointer`)))}finally{this.updateState=0}if(r.startState.facet(pD)!=r.state.facet(pD)&&(this.viewState.mustMeasureContent=!0),(t||n||u||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!r.empty)for(let e of this.state.facet(Pw))try{e(r)}catch(e){Gw(this.state,e,`update listener`)}(s||l)&&Promise.resolve().then(()=>{s&&this.state==s.startState&&this.dispatch(s),l&&!HT(this,l)&&c.force&&aC(this.contentDOM,c.key,c.keyCode)})}setState(e){if(this.updateState!=0)throw Error(`Calls to EditorView.setState are not allowed while an update is in progress`);if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let e of this.plugins)e.destroy(this);this.viewState=new iD(e),this.plugins=e.facet(Jw).map(e=>new Xw(e)),this.pluginMap.clear();for(let e of this.plugins)e.update(this);this.docView.destroy(),this.docView=new lT(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(Jw),n=e.state.facet(Jw);if(t!=n){let r=[];for(let i of n){let n=t.indexOf(i);if(n<0)r.push(new Xw(i));else{let t=this.plugins[n];t.mustUpdate=e,r.push(t)}}for(let t of this.plugins)t.mustUpdate!=e&&t.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let t of this.plugins)t.mustUpdate=e;for(let e=0;e<this.plugins.length;e++)this.plugins[e].update(this);t!=n&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(e){Gw(this.state,e,`doc view update listener`)}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,n=this.scrollDOM,r=n.scrollTop*this.scaleY,{scrollAnchorPos:i,scrollAnchorHeight:a}=this.viewState;Math.abs(r-this.viewState.scrollTop)>1&&(a=-1),this.viewState.scrollAnchorHeight=-1;try{for(let e=0;;e++){if(a<0)if(lC(n))i=-1,a=this.viewState.heightMap.height;else{let e=this.viewState.scrollAnchorAt(r);i=e.from,a=e.top}this.updateState=1;let o=this.viewState.measure(this);if(!o&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(e>5){console.warn(this.measureRequests.length?`Measure loop restarted more than 5 times`:`Viewport failed to stabilize`);break}let s=[];o&4||([this.measureRequests,s]=[s,this.measureRequests]);let c=s.map(e=>{try{return e.read(this)}catch(e){return Gw(this.state,e),AD}}),l=cT.create(this,this.state,[]),u=!1;l.flags|=o,t?t.flags|=o:t=l,this.updateState=2,l.empty||(this.updatePlugins(l),this.inputState.update(l),this.updateAttrs(),u=this.docView.update(l),u&&this.docViewUpdate());for(let e=0;e<s.length;e++)if(c[e]!=AD)try{let t=s[e];t.write&&t.write(c[e],this)}catch(e){Gw(this.state,e)}if(u&&this.docView.updateSelection(!0),!l.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,a=-1;continue}else{let e=(i<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(i).top)-a;if(e>1||e<-1){r+=e,n.scrollTop=r/this.scaleY,a=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let e of this.state.facet(Pw))e(t)}get themeClasses(){return hD+` `+(this.state.facet(mD)?_D:gD)+` `+this.state.facet(pD)}updateAttrs(){let e=MD(this,Zw,{class:`cm-editor`+(this.hasFocus?` cm-focused `:` `)+this.themeClasses}),t={spellcheck:`false`,autocorrect:`off`,autocapitalize:`off`,writingsuggestions:`false`,translate:`no`,contenteditable:this.state.facet(Kw)?`true`:`false`,class:`cm-content`,style:`${AC.tabSize}: ${this.state.tabSize}`,role:`textbox`,"aria-multiline":`true`};this.state.readOnly&&(t[`aria-readonly`]=`true`),MD(this,Qw,t);let n=this.observer.ignore(()=>{let n=WC(this.contentDOM,this.contentAttrs,t),r=WC(this.dom,this.editorAttrs,e);return n||r});return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(t){let n=!0;for(let r of t)for(let t of r.effects)if(t.is(e.announce)){n&&(this.announceDOM.textContent=``),n=!1;let e=this.announceDOM.appendChild(document.createElement(`div`));e.textContent=t.value}}mountStyles(){this.styleModules=this.state.facet(oT);let t=this.state.facet(e.cspNonce);AS.mount(this.root,this.styleModules.concat(bD).reverse(),t?{nonce:t}:void 0)}readMeasured(){if(this.updateState==2)throw Error(`Reading the editor layout isn't allowed during an update`);this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(t===void 0||t&&t.spec!=e)&&this.pluginMap.set(e,t=this.plugins.find(t=>t.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 IT(this,e,MT(this,e,t,n))}moveByGroup(e,t){return IT(this,e,MT(this,e,t,t=>NT(this,e.head,t)))}visualLineSide(e,t){let n=this.bidiSpans(e),r=this.textDirectionAt(e.from),i=n[t?n.length-1:0];return L.cursor(i.side(t,r)+e.from,i.forward(!t,r)?1:-1)}moveToLineBoundary(e,t,n=!0){return jT(this,e,t,n)}moveVertically(e,t,n){return IT(this,e,PT(this,e,t,n))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),ET(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let n=this.docView.coordsAt(e,t);if(!n||n.left==n.right)return n;let r=this.state.doc.lineAt(e),i=this.bidiSpans(r),a=i[_w.find(i,e-r.from,-1,t)];return YS(n,a.dir==sw.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(zw)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>kD)return Ew(e.length);let t=this.textDirectionAt(e.from),n;for(let r of this.bidiCache)if(r.from==e.from&&r.dir==t&&(r.fresh||vw(r.isolates,n=rT(this,e))))return r.order;n||=rT(this,e);let r=Tw(e.text,t,n);return this.bidiCache.push(new jD(e.from,e.to,t,n,!0,r)),r}get hasFocus(){return(this.dom.ownerDocument.hasFocus()||AC.safari&&this.inputState?.lastContextMenu>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{nC(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return Uw.of(new Hw(typeof e==`number`?L.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 Uw.of(new Hw(L.cursor(n.from),`start`,`start`,n.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e==`boolean`?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return Yw.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Yw.define(()=>({}),{eventObservers:e})}static theme(e,t){let n=AS.newName(),r=[pD.of(n),oT.of(yD(`.${n}`,e))];return t&&t.dark&&r.push(mD.of(!0)),r}static baseTheme(e){return Ex.lowest(oT.of(yD(`.`+hD,e,vD)))}static findFromDOM(e){let t=e.querySelector(`.cm-content`);return(t&&mC.get(t)||mC.get(e))?.rootView?.view||null}};OD.styleModule=oT,OD.inputHandler=Fw,OD.clipboardInputFilter=Lw,OD.clipboardOutputFilter=Rw,OD.scrollHandler=Vw,OD.focusChangeEffect=Iw,OD.perLineTextDirection=zw,OD.exceptionSink=Nw,OD.updateListener=Pw,OD.editable=Kw,OD.mouseSelectionStyle=Mw,OD.dragMovesSelection=jw,OD.clickAddsSelectionRange=Aw,OD.decorations=$w,OD.outerDecorations=eT,OD.atomicRanges=tT,OD.bidiIsolatedRanges=nT,OD.scrollMargins=iT,OD.darkTheme=mD,OD.cspNonce=gx.define({combine:e=>e.length?e[0]:``}),OD.contentAttributes=Qw,OD.editorAttributes=Zw,OD.lineWrapping=OD.contentAttributes.of({class:`cm-lineWrapping`}),OD.announce=Wx.define();var kD=4096,AD={},jD=class e{constructor(e,t,n,r,i,a){this.from=e,this.to=t,this.dir=n,this.isolates=r,this.fresh=i,this.order=a}static update(t,n){if(n.empty&&!t.some(e=>e.fresh))return t;let r=[],i=t.length?t[t.length-1].dir:sw.LTR;for(let a=Math.max(0,t.length-10);a<t.length;a++){let o=t[a];o.dir==i&&!n.touchesRange(o.from,o.to)&&r.push(new e(n.mapPos(o.from,1),n.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return r}};function MD(e,t,n){for(let r=e.state.facet(t),i=r.length-1;i>=0;i--){let t=r[i],a=typeof t==`function`?t(e):t;a&&VC(a,n)}return n}var ND=AC.mac?`mac`:AC.windows?`win`:AC.linux?`linux`:`key`;function PD(e,t){let n=e.split(/-(?!$)/),r=n[n.length-1];r==`Space`&&(r=` `);let i,a,o,s;for(let e=0;e<n.length-1;++e){let r=n[e];if(/^(cmd|meta|m)$/i.test(r))s=!0;else if(/^a(lt)?$/i.test(r))i=!0;else if(/^(c|ctrl|control)$/i.test(r))a=!0;else if(/^s(hift)?$/i.test(r))o=!0;else if(/^mod$/i.test(r))t==`mac`?s=!0:a=!0;else throw Error(`Unrecognized modifier name: `+r)}return i&&(r=`Alt-`+r),a&&(r=`Ctrl-`+r),s&&(r=`Meta-`+r),o&&(r=`Shift-`+r),r}function FD(e,t,n){return t.altKey&&(e=`Alt-`+e),t.ctrlKey&&(e=`Ctrl-`+e),t.metaKey&&(e=`Meta-`+e),n!==!1&&t.shiftKey&&(e=`Shift-`+e),e}var ID=Ex.default(OD.domEventHandlers({keydown(e,t){return GD(zD(t.state),e,t,`editor`)}})),LD=gx.define({enables:ID}),RD=new WeakMap;function zD(e){let t=e.facet(LD),n=RD.get(t);return n||RD.set(t,n=UD(t.reduce((e,t)=>e.concat(t),[]))),n}function BD(e,t,n){return GD(zD(e.state),t,e,n)}var VD=null,HD=4e3;function UD(e,t=ND){let n=Object.create(null),r=Object.create(null),i=(e,t)=>{let n=r[e];if(n==null)r[e]=t;else if(n!=t)throw Error(`Key binding `+e+` is used both as a regular binding and as a multi-stroke prefix`)},a=(e,r,a,o,s)=>{let c=n[e]||(n[e]=Object.create(null)),l=r.split(/ (?!$)/).map(e=>PD(e,t));for(let t=1;t<l.length;t++){let n=l.slice(0,t).join(` `);i(n,!0),c[n]||(c[n]={preventDefault:!0,stopPropagation:!1,run:[t=>{let r=VD={view:t,prefix:n,scope:e};return setTimeout(()=>{VD==r&&(VD=null)},HD),!0}]})}let u=l.join(` `);i(u,!1);let d=c[u]||(c[u]={preventDefault:!1,stopPropagation:!1,run:(c._any?.run)?.slice()||[]});a&&d.run.push(a),o&&(d.preventDefault=!0),s&&(d.stopPropagation=!0)};for(let r of e){let e=r.scope?r.scope.split(` `):[`editor`];if(r.any)for(let t of e){let e=n[t]||(n[t]=Object.create(null));e._any||={preventDefault:!1,stopPropagation:!1,run:[]};let{any:i}=r;for(let t in e)e[t].run.push(e=>i(e,WD))}let i=r[t]||r.key;if(i)for(let t of e)a(t,i,r.run,r.preventDefault,r.stopPropagation),r.shift&&a(t,`Shift-`+i,r.shift,r.preventDefault,r.stopPropagation)}return n}var WD=null;function GD(e,t,n,r){WD=t;let i=zS(t),a=nx(ex(i,0))==i.length&&i!=` `,o=``,s=!1,c=!1,l=!1;VD&&VD.view==n&&VD.scope==r&&(o=VD.prefix+` `,$T.indexOf(t.keyCode)<0&&(c=!0,VD=null));let u=new Set,d=e=>{if(e){for(let t of e.run)if(!u.has(t)&&(u.add(t),t(n)))return e.stopPropagation&&(l=!0),!0;e.preventDefault&&(e.stopPropagation&&(l=!0),c=!0)}return!1},f=e[r],p,m;return f&&(d(f[o+FD(i,t,!a)])?s=!0:a&&(t.altKey||t.metaKey||t.ctrlKey)&&!(AC.windows&&t.ctrlKey&&t.altKey)&&(p=NS[t.keyCode])&&p!=i?(d(f[o+FD(p,t,!0)])||t.shiftKey&&(m=PS[t.keyCode])!=i&&m!=p&&d(f[o+FD(m,t,!1)]))&&(s=!0):a&&t.shiftKey&&d(f[o+FD(i,t,!0)])&&(s=!0),!s&&d(f._any)&&(s=!0)),c&&(s=!0),s&&l&&t.stopPropagation(),WD=null,s}var KD=class e{constructor(e,t,n,r,i){this.className=e,this.left=t,this.top=n,this.width=r,this.height=i}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):!1}adjust(e){e.style.left=this.left+`px`,e.style.top=this.top+`px`,this.width!=null&&(e.style.width=this.width+`px`),e.style.height=this.height+`px`}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(t,n,r){if(r.empty){let i=t.coordsAtPos(r.head,r.assoc||1);if(!i)return[];let a=qD(t);return[new e(n,i.left-a.left,i.top-a.top,null,i.bottom-i.top)]}else return YD(t,n,r)}};function qD(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==sw.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function JD(e,t,n,r){let i=e.coordsAtPos(t,n*2);if(!i)return r;let a=e.dom.getBoundingClientRect(),o=(i.top+i.bottom)/2,s=e.posAtCoords({x:a.left+1,y:o}),c=e.posAtCoords({x:a.right-1,y:o});return s==null||c==null?r:{from:Math.max(r.from,Math.min(s,c)),to:Math.min(r.to,Math.max(s,c))}}function YD(e,t,n){if(n.to<=e.viewport.from||n.from>=e.viewport.to)return[];let r=Math.max(n.from,e.viewport.from),i=Math.min(n.to,e.viewport.to),a=e.textDirection==sw.LTR,o=e.contentDOM,s=o.getBoundingClientRect(),c=qD(e),l=o.querySelector(`.cm-line`),u=l&&window.getComputedStyle(l),d=s.left+(u?parseInt(u.paddingLeft)+Math.min(0,parseInt(u.textIndent)):0),f=s.right-(u?parseInt(u.paddingRight):0),p=AT(e,r),m=AT(e,i),h=p.type==qC.Text?p:null,g=m.type==qC.Text?m:null;if(h&&(e.lineWrapping||p.widgetLineBreaks)&&(h=JD(e,r,1,h)),g&&(e.lineWrapping||m.widgetLineBreaks)&&(g=JD(e,i,-1,g)),h&&g&&h.from==g.from&&h.to==g.to)return v(y(n.from,n.to,h));{let t=h?y(n.from,null,h):b(p,!1),r=g?y(null,n.to,g):b(m,!0),i=[];return(h||p).to<(g||m).from-(h&&g?1:0)||p.widgetLineBreaks>1&&t.bottom+e.defaultLineHeight/2<r.top?i.push(_(d,t.bottom,f,r.top)):t.bottom<r.top&&e.elementAtHeight((t.bottom+r.top)/2).type==qC.Text&&(t.bottom=r.top=(t.bottom+r.top)/2),v(t).concat(i).concat(v(r))}function _(e,n,r,i){return new KD(t,e-c.left,n-c.top,r-e,i-n)}function v({top:e,bottom:t,horizontal:n}){let r=[];for(let i=0;i<n.length;i+=2)r.push(_(n[i],e,n[i+1],t));return r}function y(t,n,r){let i=1e9,o=-1e9,s=[];function c(t,n,c,l,u){let p=e.coordsAtPos(t,t==r.to?-2:2),m=e.coordsAtPos(c,c==r.from?2:-2);!p||!m||(i=Math.min(p.top,m.top,i),o=Math.max(p.bottom,m.bottom,o),u==sw.LTR?s.push(a&&n?d:p.left,a&&l?f:m.right):s.push(!a&&l?d:m.left,!a&&n?f:p.right))}let l=t??r.from,u=n??r.to;for(let r of e.visibleRanges)if(r.to>l&&r.from<u)for(let i=Math.max(r.from,l),a=Math.min(r.to,u);;){let r=e.state.doc.lineAt(i);for(let o of e.bidiSpans(r)){let e=o.from+r.from,s=o.to+r.from;if(e>=a)break;s>i&&c(Math.max(e,i),t==null&&e<=l,Math.min(s,a),n==null&&s>=u,o.dir)}if(i=r.to+1,i>=a)break}return s.length==0&&c(l,t==null,u,n==null,e.textDirection),{top:i,bottom:o,horizontal:s}}function b(e,t){let n=s.top+(t?e.top:e.bottom);return{top:n,bottom:n,horizontal:[]}}}function XD(e,t){return e.constructor==t.constructor&&e.eq(t)}var ZD=class{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(QD)!=e.state.facet(QD)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,n=e.facet(QD);for(;t<n.length&&n[t]!=this.layer;)t++;this.dom.style.zIndex=String((this.layer.above?150:-1)-t)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:t}=this.view;(e!=this.scaleX||t!=this.scaleY)&&(this.scaleX=e,this.scaleY=t,this.dom.style.transform=`scale(${1/e}, ${1/t})`)}draw(e){if(e.length!=this.drawn.length||e.some((e,t)=>!XD(e,this.drawn[t]))){let t=this.dom.firstChild,n=0;for(let r of e)r.update&&t&&r.constructor&&this.drawn[n].constructor&&r.update(t,this.drawn[n])?(t=t.nextSibling,n++):this.dom.insertBefore(r.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()}},QD=gx.define();function $D(e){return[Yw.define(t=>new ZD(t,e)),QD.of(e)]}var eO=!(AC.ios&&AC.webkit&&AC.webkit_version<534),tO=gx.define({combine(e){return oS(e,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function nO(e={}){return[tO.of(e),iO,oO,cO,Bw.of(!0)]}function rO(e){return e.startState.facet(tO)!=e.state.facet(tO)}var iO=$D({above:!0,markers(e){let{state:t}=e,n=t.facet(tO),r=[];for(let i of t.selection.ranges){let a=i==t.selection.main;if(i.empty?!a||eO:n.drawRangeCursor){let t=a?`cm-cursor cm-cursor-primary`:`cm-cursor cm-cursor-secondary`,n=i.empty?i:L.cursor(i.head,i.head>i.anchor?-1:1);for(let i of KD.forRange(e,t,n))r.push(i)}}return r},update(e,t){e.transactions.some(e=>e.selection)&&(t.style.animationName=t.style.animationName==`cm-blink`?`cm-blink2`:`cm-blink`);let n=rO(e);return n&&aO(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){aO(t.state,e)},class:`cm-cursorLayer`});function aO(e,t){t.style.animationDuration=e.facet(tO).cursorBlinkRate+`ms`}var oO=$D({above:!1,markers(e){return e.state.selection.ranges.map(t=>t.empty?[]:KD.forRange(e,`cm-selectionBackground`,t)).reduce((e,t)=>e.concat(t))},update(e,t){return e.docChanged||e.selectionSet||e.viewportChanged||rO(e)},class:`cm-selectionLayer`}),sO={".cm-line":{"& ::selection, &::selection":{backgroundColor:`transparent !important`}},".cm-content":{"& :focus":{caretColor:`initial !important`,"&::selection, & ::selection":{backgroundColor:`Highlight !important`}}}};eO&&(sO[`.cm-line`].caretColor=sO[`.cm-content`].caretColor=`transparent !important`);var cO=Ex.highest(OD.theme(sO)),lO=Wx.define({map(e,t){return e==null?null:t.mapPos(e)}}),uO=Cx.define({create(){return null},update(e,t){return e!=null&&(e=t.changes.mapPos(e)),t.effects.reduce((e,t)=>t.is(lO)?t.value:e,e)}}),dO=Yw.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(uO);n==null?this.cursor!=null&&((t=this.cursor)==null||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement(`div`)),this.cursor.className=`cm-dropCursor`),(e.startState.field(uO)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field(uO),n=t!=null&&e.coordsAtPos(t);if(!n)return null;let r=e.scrollDOM.getBoundingClientRect();return{left:n.left-r.left+e.scrollDOM.scrollLeft*e.scaleX,top:n.top-r.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(uO)!=e&&this.view.dispatch({effects:lO.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 fO(){return[uO,dO]}function pO(e,t,n,r,i){t.lastIndex=0;for(let a=e.iterRange(n,r),o=n,s;!a.next().done;o+=a.value.length)if(!a.lineBreak)for(;s=t.exec(a.value);)i(o+s.index,s)}function mO(e,t){let n=e.visibleRanges;if(n.length==1&&n[0].from==e.viewport.from&&n[0].to==e.viewport.to)return n;let r=[];for(let{from:i,to:a}of n)i=Math.max(e.state.doc.lineAt(i).from,i-t),a=Math.min(e.state.doc.lineAt(a).to,a+t),r.length&&r[r.length-1].to>=i?r[r.length-1].to=a:r.push({from:i,to:a});return r}var hO=class{constructor(e){let{regexp:t,decoration:n,decorate:r,boundary:i,maxLength:a=1e3}=e;if(!t.global)throw RangeError(`The regular expression given to MatchDecorator should have its 'g' flag set`);if(this.regexp=t,r)this.addMatch=(e,t,n,i)=>r(i,n,n+e[0].length,e,t);else if(typeof n==`function`)this.addMatch=(e,t,r,i)=>{let a=n(e,t,r);a&&i(r,r+e[0].length,a)};else if(n)this.addMatch=(e,t,r,i)=>i(r,r+e[0].length,n);else throw RangeError(`Either 'decorate' or 'decoration' should be provided to MatchDecorator`);this.boundary=i,this.maxLength=a}createDeco(e){let t=new pS,n=t.add.bind(t);for(let{from:t,to:r}of mO(e,this.maxLength))pO(e.state.doc,this.regexp,t,r,(t,r)=>this.addMatch(r,e,t,n));return t.finish()}updateDeco(e,t){let n=1e9,r=-1;return e.docChanged&&e.changes.iterChanges((t,i,a,o)=>{o>=e.view.viewport.from&&a<=e.view.viewport.to&&(n=Math.min(a,n),r=Math.max(o,r))}),e.viewportMoved||r-n>1e3?this.createDeco(e.view):r>-1?this.updateRange(e.view,t.map(e.changes),n,r):t}updateRange(e,t,n,r){for(let i of e.visibleRanges){let a=Math.max(i.from,n),o=Math.min(i.to,r);if(o>a){let n=e.state.doc.lineAt(a),r=n.to<o?e.state.doc.lineAt(o):n,s=Math.max(i.from,n.from),c=Math.min(i.to,r.to);if(this.boundary){for(;a>n.from;a--)if(this.boundary.test(n.text[a-1-n.from])){s=a;break}for(;o<r.to;o++)if(this.boundary.test(r.text[o-r.from])){c=o;break}}let l=[],u,d=(e,t,n)=>l.push(n.range(e,t));if(n==r)for(this.regexp.lastIndex=s-n.from;(u=this.regexp.exec(n.text))&&u.index<c-n.from;)this.addMatch(u,e,u.index+n.from,d);else pO(e.state.doc,this.regexp,s,c,(t,n)=>this.addMatch(n,e,t,d));t=t.update({filterFrom:s,filterTo:c,filter:(e,t)=>e<s||t>c,add:l})}}return t}},gO=/x/.unicode==null?`g`:`gu`,_O=RegExp(`[\0-\b
|
|
42
|
-
--\u2028\u2029-]`,gO),vO={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`},yO=null;function bO(){if(yO==null&&typeof document<`u`&&document.body){let e=document.body.style;yO=(e.tabSize??e.MozTabSize)!=null}return yO||!1}var xO=gx.define({combine(e){let t=oS(e,{render:null,specialChars:_O,addSpecialChars:null});return(t.replaceTabs=!bO())&&(t.specialChars=RegExp(` |`+t.specialChars.source,gO)),t.addSpecialChars&&(t.specialChars=RegExp(t.specialChars.source+`|`+t.addSpecialChars.source,gO)),t}});function SO(e={}){return[xO.of(e),wO()]}var CO=null;function wO(){return CO||=Yw.fromClass(class{constructor(e){this.view=e,this.decorations=JC.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(xO)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new hO({regexp:e.specialChars,decoration:(t,n,r)=>{let{doc:i}=n.state,a=ex(t[0],0);if(a==9){let e=i.lineAt(r),t=n.state.tabSize,a=wS(e.text,t,r-e.from);return JC.replace({widget:new OO((t-a%t)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[a]||(this.decorationCache[a]=JC.replace({widget:new DO(e,a)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(xO);e.startState.facet(xO)==t?this.decorations=this.decorator.updateDeco(e,this.decorations):(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view))}},{decorations:e=>e.decorations})}var TO=`•`;function EO(e){return e>=32?TO:e==10?``:String.fromCharCode(9216+e)}var DO=class extends KC{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=EO(this.code),n=e.state.phrase(`Control character`)+` `+(vO[this.code]||`0x`+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,n,t);if(r)return r;let i=document.createElement(`span`);return i.textContent=t,i.title=n,i.setAttribute(`aria-label`,n),i.className=`cm-specialChar`,i}ignoreEvent(){return!1}},OO=class extends KC{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement(`span`);return e.textContent=` `,e.className=`cm-tab`,e.style.width=this.width+`px`,e}ignoreEvent(){return!1}};function kO(){return jO}var AO=JC.line({class:`cm-activeLine`}),jO=Yw.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 r of e.state.selection.ranges){let i=e.lineBlockAt(r.head);i.from>t&&(n.push(AO.range(i.from)),t=i.from)}return JC.set(n)}},{decorations:e=>e.decorations}),MO=2e3;function NO(e,t,n){let r=Math.min(t.line,n.line),i=Math.max(t.line,n.line),a=[];if(t.off>MO||n.off>MO||t.col<0||n.col<0){let o=Math.min(t.off,n.off),s=Math.max(t.off,n.off);for(let t=r;t<=i;t++){let n=e.doc.line(t);n.length<=s&&a.push(L.range(n.from+o,n.to+s))}}else{let o=Math.min(t.col,n.col),s=Math.max(t.col,n.col);for(let t=r;t<=i;t++){let n=e.doc.line(t),r=TS(n.text,o,e.tabSize,!0);if(r<0)a.push(L.cursor(n.to));else{let t=TS(n.text,s,e.tabSize);a.push(L.range(n.from+r,n.from+t))}}}return a}function PO(e,t){let n=e.coordsAtPos(e.viewport.from);return n?Math.round(Math.abs((n.left-t)/e.defaultCharacterWidth)):-1}function FO(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1),r=e.state.doc.lineAt(n),i=n-r.from,a=i>MO?-1:i==r.length?PO(e,t.clientX):wS(r.text,e.state.tabSize,n-r.from);return{line:r.number,col:a,off:i}}function IO(e,t){let n=FO(e,t),r=e.state.selection;return n?{update(e){if(e.docChanged){let t=e.changes.mapPos(e.startState.doc.line(n.line).from),i=e.state.doc.lineAt(t);n={line:i.number,col:n.col,off:Math.min(n.off,i.length)},r=r.map(e.changes)}},get(t,i,a){let o=FO(e,t);if(!o)return r;let s=NO(e.state,n,o);return s.length?a?L.create(s.concat(r.ranges)):L.create(s):r}}:null}function LO(e){let t=e?.eventFilter||(e=>e.altKey&&e.button==0);return OD.mouseSelectionStyle.of((e,n)=>t(n)?IO(e,n):null)}var RO={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},zO={style:`cursor: crosshair`};function BO(e={}){let[t,n]=RO[e.key||`Alt`],r=Yw.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[r,OD.contentAttributes.of(e=>e.plugin(r)?.isDown?zO:null)]}var VO=`-10000px`,HO=class{constructor(e,t,n,r){this.facet=t,this.createTooltipView=n,this.removeTooltipView=r,this.input=e.state.facet(t),this.tooltips=this.input.filter(e=>e);let i=null;this.tooltipViews=this.tooltips.map(e=>i=n(e,i))}update(e,t){var n;let r=e.state.facet(this.facet),i=r.filter(e=>e);if(r===this.input){for(let t of this.tooltipViews)t.update&&t.update(e);return!1}let a=[],o=t?[]:null;for(let n=0;n<i.length;n++){let r=i[n],s=-1;if(r){for(let e=0;e<this.tooltips.length;e++){let t=this.tooltips[e];t&&t.create==r.create&&(s=e)}if(s<0)a[n]=this.createTooltipView(r,n?a[n-1]:null),o&&(o[n]=!!r.above);else{let r=a[n]=this.tooltipViews[s];o&&(o[n]=t[s]),r.update&&r.update(e)}}}for(let e of this.tooltipViews)a.indexOf(e)<0&&(this.removeTooltipView(e),(n=e.destroy)==null||n.call(e));return t&&(o.forEach((e,n)=>t[n]=e),t.length=o.length),this.input=r,this.tooltips=i,this.tooltipViews=a,!0}};function UO(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}var WO=gx.define({combine:e=>({position:AC.ios?`absolute`:e.find(e=>e.position)?.position||`fixed`,parent:e.find(e=>e.parent)?.parent||null,tooltipSpace:e.find(e=>e.tooltipSpace)?.tooltipSpace||UO})}),GO=new WeakMap,KO=Yw.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(WO);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.resizeObserver=typeof ResizeObserver==`function`?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new HO(e,XO,(e,t)=>this.createTooltip(e,t),e=>{this.resizeObserver&&this.resizeObserver.unobserve(e.dom),e.dom.remove()}),this.above=this.manager.tooltips.map(e=>!!e.above),this.intersectionObserver=typeof IntersectionObserver==`function`?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,r=e.state.facet(WO);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let e of this.manager.tooltipViews)e.dom.style.position=this.position;n=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.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,t){let n=e.create(this.view),r=t?t.dom:null;if(n.dom.classList.add(`cm-tooltip`),e.arrow&&!n.dom.querySelector(`.cm-tooltip > .cm-tooltip-arrow`)){let e=document.createElement(`div`);e.className=`cm-tooltip-arrow`,n.dom.appendChild(e)}return n.dom.style.position=this.position,n.dom.style.top=VO,n.dom.style.left=`0px`,this.container.insertBefore(n.dom,r),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var e,t,n;this.view.win.removeEventListener(`resize`,this.measureSoon);for(let t of this.manager.tooltipViews)t.dom.remove(),(e=t.destroy)==null||e.call(t);this.parent&&this.container.remove(),(t=this.resizeObserver)==null||t.disconnect(),(n=this.intersectionObserver)==null||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=1,t=1,n=!1;if(this.position==`fixed`&&this.manager.tooltipViews.length){let{dom:e}=this.manager.tooltipViews[0];if(AC.gecko)n=e.offsetParent!=this.container.ownerDocument.body;else if(e.style.top==VO&&e.style.left==`0px`){let t=e.getBoundingClientRect();n=Math.abs(t.top+1e4)>1||Math.abs(t.left)>1}}if(n||this.position==`absolute`)if(this.parent){let n=this.parent.getBoundingClientRect();n.width&&n.height&&(e=n.width/this.parent.offsetWidth,t=n.height/this.parent.offsetHeight)}else ({scaleX:e,scaleY:t}=this.view.viewState);let r=this.view.scrollDOM.getBoundingClientRect(),i=aT(this.view);return{visible:{left:r.left+i.left,top:r.top+i.top,right:r.right-i.right,bottom:r.bottom-i.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((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(WO).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:n}}writeMeasure(e){if(e.makeAbsolute){this.madeAbsolute=!0,this.position=`absolute`;for(let e of this.manager.tooltipViews)e.dom.style.position=`absolute`}let{visible:t,space:n,scaleX:r,scaleY:i}=e,a=[];for(let o=0;o<this.manager.tooltips.length;o++){let s=this.manager.tooltips[o],c=this.manager.tooltipViews[o],{dom:l}=c,u=e.pos[o],d=e.size[o];if(!u||s.clip!==!1&&(u.bottom<=Math.max(t.top,n.top)||u.top>=Math.min(t.bottom,n.bottom)||u.right<Math.max(t.left,n.left)-.1||u.left>Math.min(t.right,n.right)+.1)){l.style.top=VO;continue}let f=s.arrow?c.dom.querySelector(`.cm-tooltip-arrow`):null,p=f?7:0,m=d.right-d.left,h=GO.get(c)??d.bottom-d.top,g=c.offset||YO,_=this.view.textDirection==sw.LTR,v=d.width>n.right-n.left?_?n.left:n.right-d.width:_?Math.max(n.left,Math.min(u.left-(f?14:0)+g.x,n.right-m)):Math.min(Math.max(n.left,u.left-m+(f?14:0)-g.x),n.right-m),y=this.above[o];!s.strictSide&&(y?u.top-h-p-g.y<n.top:u.bottom+h+p+g.y>n.bottom)&&y==n.bottom-u.bottom>u.top-n.top&&(y=this.above[o]=!y);let b=(y?u.top-n.top:n.bottom-u.bottom)-p;if(b<h&&c.resize!==!1){if(b<this.view.defaultLineHeight){l.style.top=VO;continue}GO.set(c,h),l.style.height=(h=b)/i+`px`}else l.style.height&&(l.style.height=``);let x=y?u.top-h-p-g.y:u.bottom+p+g.y,S=v+m;if(c.overlap!==!0)for(let e of a)e.left<S&&e.right>v&&e.top<x+h&&e.bottom>x&&(x=y?e.top-h-2-p:e.bottom+p+2);if(this.position==`absolute`?(l.style.top=(x-e.parent.top)/i+`px`,qO(l,(v-e.parent.left)/r)):(l.style.top=x/i+`px`,qO(l,v/r)),f){let e=u.left+(_?g.x:-g.x)-(v+14-7);f.style.left=e/r+`px`}c.overlap!==!0&&a.push({left:v,top:x,right:S,bottom:x+h}),l.classList.toggle(`cm-tooltip-above`,y),l.classList.toggle(`cm-tooltip-below`,!y),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=VO}},{eventObservers:{scroll(){this.maybeMeasure()}}});function qO(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+`px`)}var JO=OD.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:`border-box`},"&light .cm-tooltip":{border:`1px solid #bbb`,backgroundColor:`#f5f5f5`},"&light .cm-tooltip-section:not(:first-child)":{borderTop:`1px solid #bbb`},"&dark .cm-tooltip":{backgroundColor:`#333338`,color:`white`},".cm-tooltip-arrow":{height:`7px`,width:`14px`,position:`absolute`,zIndex:-1,overflow:`hidden`,"&:before, &:after":{content:`''`,position:`absolute`,width:0,height:0,borderLeft:`7px solid transparent`,borderRight:`7px solid transparent`},".cm-tooltip-above &":{bottom:`-7px`,"&:before":{borderTop:`7px solid #bbb`},"&:after":{borderTop:`7px solid #f5f5f5`,bottom:`1px`}},".cm-tooltip-below &":{top:`-7px`,"&:before":{borderBottom:`7px solid #bbb`},"&:after":{borderBottom:`7px solid #f5f5f5`,top:`1px`}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:`#333338`,borderBottomColor:`#333338`},"&:after":{borderTopColor:`transparent`,borderBottomColor:`transparent`}}}),YO={x:0,y:0},XO=gx.define({enables:[KO,JO]}),ZO=gx.define({combine:e=>e.reduce((e,t)=>e.concat(t),[])}),QO=class e{static create(t){return new e(t)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement(`div`),this.dom.classList.add(`cm-tooltip-hover`),this.manager=new HO(e,ZO,(e,t)=>this.createHostedView(e,t),e=>e.dom.remove())}createHostedView(e,t){let n=e.create(this.view);return n.dom.classList.add(`cm-tooltip-section`),this.dom.insertBefore(n.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&n.mount&&n.mount(this.view),n}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)==null||e.call(t)}passProp(e){let t;for(let n of this.manager.tooltipViews){let r=n[e];if(r!==void 0){if(t===void 0)t=r;else if(t!==r)return}}return t}get offset(){return this.passProp(`offset`)}get getCoords(){return this.passProp(`getCoords`)}get overlap(){return this.passProp(`overlap`)}get resize(){return this.passProp(`resize`)}},$O=XO.compute([ZO],e=>{let t=e.facet(ZO);return t.length===0?null:{pos:Math.min(...t.map(e=>e.pos)),end:Math.max(...t.map(e=>e.end??e.pos)),create:QO.create,above:t[0].above,arrow:t.some(e=>e.arrow)}}),ek=class{constructor(e,t,n,r,i){this.view=e,this.source=t,this.field=n,this.setHover=r,this.hoverTime=i,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.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:t}=this,n=e.docView.nearest(t.target);if(!n)return;let r,i=1;if(n instanceof FC)r=n.posAtStart;else{if(r=e.posAtCoords(t),r==null)return;let n=e.coordsAtPos(r);if(!n||t.y<n.top||t.y>n.bottom||t.x<n.left-e.defaultCharacterWidth||t.x>n.right+e.defaultCharacterWidth)return;let a=e.bidiSpans(e.state.doc.lineAt(r)).find(e=>e.from<=r&&e.to>=r),o=a&&a.dir==sw.RTL?-1:1;i=t.x<n.left?-o:o}let a=this.source(e,r,i);if(a?.then){let t=this.pending={pos:r};a.then(n=>{this.pending==t&&(this.pending=null,n&&!(Array.isArray(n)&&!n.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(n)?n:[n])}))},t=>Gw(e.state,t,`hover tooltip`))}else a&&!(Array.isArray(a)&&!a.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(a)?a:[a])})}get tooltip(){let e=this.view.plugin(KO),t=e?e.manager.tooltips.findIndex(e=>e.create==QO.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){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:t,tooltip:n}=this;if(t.length&&n&&!nk(n.dom,e)||this.pending){let{pos:n}=t[0]||this.pending,r=t[0]?.end??n;(n==r?this.view.posAtCoords(this.lastMove)!=n:!rk(this.view,n,r,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length){let{tooltip:t}=this;t&&t.dom.contains(e.relatedTarget)?this.watchTooltipLeave(t.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=n=>{e.removeEventListener(`mouseleave`,t),this.active.length&&!this.view.dom.contains(n.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener(`mouseleave`,t)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener(`mouseleave`,this.mouseleave),this.view.dom.removeEventListener(`mousemove`,this.mousemove)}},tk=4;function nk(e,t){let{left:n,right:r,top:i,bottom:a}=e.getBoundingClientRect(),o;if(o=e.querySelector(`.cm-tooltip-arrow`)){let e=o.getBoundingClientRect();i=Math.min(e.top,i),a=Math.max(e.bottom,a)}return t.clientX>=n-tk&&t.clientX<=r+tk&&t.clientY>=i-tk&&t.clientY<=a+tk}function rk(e,t,n,r,i,a){let o=e.scrollDOM.getBoundingClientRect(),s=e.documentTop+e.documentPadding.top+e.contentHeight;if(o.left>r||o.right<r||o.top>i||Math.min(o.bottom,s)<i)return!1;let c=e.posAtCoords({x:r,y:i},!1);return c>=t&&c<=n}function ik(e,t={}){let n=Wx.define(),r=Cx.define({create(){return[]},update(e,r){if(e.length&&(t.hideOnChange&&(r.docChanged||r.selection)?e=[]:t.hideOn&&(e=e.filter(e=>!t.hideOn(r,e))),r.docChanged)){let t=[];for(let n of e){let e=r.changes.mapPos(n.pos,-1,ix.TrackDel);if(e!=null){let i=Object.assign(Object.create(null),n);i.pos=e,i.end!=null&&(i.end=r.changes.mapPos(i.end)),t.push(i)}}e=t}for(let t of r.effects)t.is(n)&&(e=t.value),t.is(ok)&&(e=[]);return e},provide:e=>ZO.from(e)});return{active:r,extension:[r,Yw.define(i=>new ek(i,e,r,n,t.hoverTime||300)),$O]}}function ak(e,t){let n=e.plugin(KO);if(!n)return null;let r=n.manager.tooltips.indexOf(t);return r<0?null:n.manager.tooltipViews[r]}var ok=Wx.define(),sk=gx.define({combine(e){let t,n;for(let r of e)t||=r.topContainer,n||=r.bottomContainer;return{topContainer:t,bottomContainer:n}}});function ck(e,t){let n=e.plugin(lk),r=n?n.specs.indexOf(t):-1;return r>-1?n.panels[r]:null}var lk=Yw.fromClass(class{constructor(e){this.input=e.state.facet(fk),this.specs=this.input.filter(e=>e),this.panels=this.specs.map(t=>t(e));let t=e.state.facet(sk);this.top=new uk(e,!0,t.topContainer),this.bottom=new uk(e,!1,t.bottomContainer),this.top.sync(this.panels.filter(e=>e.top)),this.bottom.sync(this.panels.filter(e=>!e.top));for(let e of this.panels)e.dom.classList.add(`cm-panel`),e.mount&&e.mount()}update(e){let t=e.state.facet(sk);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new uk(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new uk(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(fk);if(n!=this.input){let t=n.filter(e=>e),r=[],i=[],a=[],o=[];for(let n of t){let t=this.specs.indexOf(n),s;t<0?(s=n(e.view),o.push(s)):(s=this.panels[t],s.update&&s.update(e)),r.push(s),(s.top?i:a).push(s)}this.specs=t,this.panels=r,this.top.sync(i),this.bottom.sync(a);for(let e of o)e.dom.classList.add(`cm-panel`),e.mount&&e.mount()}else for(let t of this.panels)t.update&&t.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>OD.scrollMargins.of(t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})}),uk=class{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(this.panels.length==0){this.dom&&=(this.dom.remove(),void 0);return}if(!this.dom){this.dom=document.createElement(`div`),this.dom.className=this.top?`cm-panels cm-panels-top`:`cm-panels cm-panels-bottom`,this.dom.style[this.top?`top`:`bottom`]=`0`;let 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=dk(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=dk(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 dk(e){let t=e.nextSibling;return e.remove(),t}var fk=gx.define({enables:lk}),pk=class extends sS{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}};pk.prototype.elementClass=``,pk.prototype.toDOM=void 0,pk.prototype.mapMode=ix.TrackBefore,pk.prototype.startSide=pk.prototype.endSide=-1,pk.prototype.point=!0;var mk=gx.define(),hk=gx.define(),gk={class:``,renderEmptyElements:!1,elementStyle:``,markers:()=>dS.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},_k=gx.define();function vk(e){return[bk(),_k.of(Object.assign(Object.assign({},gk),e))]}var yk=gx.define({combine:e=>e.some(e=>e)});function bk(e){let t=[xk];return e&&e.fixed===!1&&t.push(yk.of(!0)),t}var xk=Yw.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(_k).map(t=>new Tk(e,t));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!e.state.facet(yk),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,r=Math.min(t.to,n.to)-Math.max(t.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}e.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+`px`),this.view.state.facet(yk)!=!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=dS.iter(this.view.state.facet(mk),this.view.viewport.from),r=[],i=this.gutters.map(e=>new wk(e,this.view.viewport,-this.view.documentPadding.top));for(let e of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(e.type)){let t=!0;for(let a of e.type)if(a.type==qC.Text&&t){Ck(n,r,a.from);for(let e of i)e.line(this.view,a,r);t=!1}else if(a.widget)for(let e of i)e.widget(this.view,a)}else if(e.type==qC.Text){Ck(n,r,e.from);for(let t of i)t.line(this.view,e,r)}else if(e.widget)for(let t of i)t.widget(this.view,e);for(let e of i)e.finish();e&&this.view.scrollDOM.insertBefore(this.dom,t)}updateGutters(e){let t=e.startState.facet(_k),n=e.state.facet(_k),r=e.docChanged||e.heightChanged||e.viewportChanged||!dS.eq(e.startState.facet(mk),e.state.facet(mk),e.view.viewport.from,e.view.viewport.to);if(t==n)for(let t of this.gutters)t.update(e)&&(r=!0);else{r=!0;let i=[];for(let r of n){let n=t.indexOf(r);n<0?i.push(new Tk(this.view,r)):(this.gutters[n].update(e),i.push(this.gutters[n]))}for(let e of this.gutters)e.dom.remove(),i.indexOf(e)<0&&e.destroy();for(let e of i)this.dom.appendChild(e.dom);this.gutters=i}return r}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove()}},{provide:e=>OD.scrollMargins.of(t=>{let n=t.plugin(e);return!n||n.gutters.length==0||!n.fixed?null:t.textDirection==sw.LTR?{left:n.dom.offsetWidth*t.scaleX}:{right:n.dom.offsetWidth*t.scaleX}})});function Sk(e){return Array.isArray(e)?e:[e]}function Ck(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}var wk=class{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=dS.iter(e.markers,t.from)}addElement(e,t,n){let{gutter:r}=this,i=(t.top-this.height)/e.scaleY,a=t.height/e.scaleY;if(this.i==r.elements.length){let t=new Ek(e,a,i,n);r.elements.push(t),r.dom.appendChild(t.dom)}else r.elements[this.i].update(e,a,i,n);this.height=t.bottom,this.i++}line(e,t,n){let r=[];Ck(this.cursor,r,t.from),n.length&&(r=r.concat(n));let i=this.gutter.config.lineMarker(e,t,r);i&&r.unshift(i);let a=this.gutter;r.length==0&&!a.config.renderEmptyElements||this.addElement(e,t,r)}widget(e,t){let n=this.gutter.config.widgetMarker(e,t.widget,t),r=n?[n]:null;for(let n of e.state.facet(hk)){let i=n(e,t.widget,t);i&&(r||=[]).push(i)}r&&this.addElement(e,t,r)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}},Tk=class{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,r=>{let i=r.target,a;if(i!=this.dom&&this.dom.contains(i)){for(;i.parentNode!=this.dom;)i=i.parentNode;let e=i.getBoundingClientRect();a=(e.top+e.bottom)/2}else a=r.clientY;let o=e.lineBlockAtHeight(a-e.documentTop);t.domEventHandlers[n](e,o,r)&&r.preventDefault()});this.markers=Sk(t.markers(e)),t.initialSpacer&&(this.spacer=new Ek(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=Sk(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!dS.eq(this.markers,t,n.from,n.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}},Ek=class{constructor(e,t,n,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement(`div`),this.dom.className=`cm-gutterElement`,this.update(e,t,n,r)}update(e,t,n,r){this.height!=t&&(this.height=t,this.dom.style.height=t+`px`),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+`px`:``),Dk(this.markers,r)||this.setMarkers(e,r)}setMarkers(e,t){let n=`cm-gutterElement`,r=this.dom.firstChild;for(let i=0,a=0;;){let o=a,s=i<t.length?t[i++]:null,c=!1;if(s){let e=s.elementClass;e&&(n+=` `+e);for(let e=a;e<this.markers.length;e++)if(this.markers[e].compare(s)){o=e,c=!0;break}}else o=this.markers.length;for(;a<o;){let e=this.markers[a++];if(e.toDOM){e.destroy(r);let t=r.nextSibling;r.remove(),r=t}}if(!s)break;s.toDOM&&(c?r=r.nextSibling:this.dom.insertBefore(s.toDOM(e),r)),c&&a++}this.dom.className=n,this.markers=t}destroy(){this.setMarkers(null,[])}};function Dk(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].compare(t[n]))return!1;return!0}var Ok=gx.define(),kk=gx.define(),Ak=gx.define({combine(e){return oS(e,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let n=Object.assign({},e);for(let e in t){let r=n[e],i=t[e];n[e]=r?(e,t,n)=>r(e,t,n)||i(e,t,n):i}return n}})}}),jk=class extends pk{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}};function Mk(e,t){return e.state.facet(Ak).formatNumber(t,e.state)}var Nk=_k.compute([Ak],e=>({class:`cm-lineNumbers`,renderEmptyElements:!1,markers(e){return e.state.facet(Ok)},lineMarker(e,t,n){return n.some(e=>e.toDOM)?null:new jk(Mk(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,n)=>{for(let r of e.state.facet(kk)){let i=r(e,t,n);if(i)return i}return null},lineMarkerChange:e=>e.startState.facet(Ak)!=e.state.facet(Ak),initialSpacer(e){return new jk(Mk(e,Fk(e.state.doc.lines)))},updateSpacer(e,t){let n=Mk(t.view,Fk(t.view.state.doc.lines));return n==e.number?e:new jk(n)},domEventHandlers:e.facet(Ak).domEventHandlers}));function Pk(e={}){return[Ak.of(e),bk(),Nk]}function Fk(e){let t=9;for(;t<e;)t=t*10+9;return t}var Ik=new class extends pk{constructor(){super(...arguments),this.elementClass=`cm-activeLineGutter`}},Lk=mk.compute([`selection`],e=>{let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.head).from;i>n&&(n=i,t.push(Ik.range(i)))}return dS.of(t)});function Rk(){return Lk}var zk=1024,Bk=0,Vk=class{constructor(e,t){this.from=e,this.to=t}},Hk=class{constructor(e={}){this.id=Bk++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw Error(`This node type doesn't define a deserialize function`)})}add(e){if(this.perNode)throw RangeError(`Can't add per-node props to node types`);return typeof e!=`function`&&(e=Gk.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}};Hk.closedBy=new Hk({deserialize:e=>e.split(` `)}),Hk.openedBy=new Hk({deserialize:e=>e.split(` `)}),Hk.group=new Hk({deserialize:e=>e.split(` `)}),Hk.isolate=new Hk({deserialize:e=>{if(e&&e!=`rtl`&&e!=`ltr`&&e!=`auto`)throw RangeError(`Invalid value for isolate: `+e);return e||`auto`}}),Hk.contextHash=new Hk({perNode:!0}),Hk.lookAhead=new Hk({perNode:!0}),Hk.mounted=new Hk({perNode:!0});var Uk=class{constructor(e,t,n){this.tree=e,this.overlay=t,this.parser=n}static get(e){return e&&e.props&&e.props[Hk.mounted.id]}},Wk=Object.create(null),Gk=class e{constructor(e,t,n,r=0){this.name=e,this.props=t,this.id=n,this.flags=r}static define(t){let n=t.props&&t.props.length?Object.create(null):Wk,r=!!t.top|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),i=new e(t.name||``,n,t.id,r);if(t.props){for(let e of t.props)if(Array.isArray(e)||(e=e(i)),e){if(e[0].perNode)throw RangeError(`Can't store a per-node prop on a node type`);n[e[0].id]=e[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e==`string`){if(this.name==e)return!0;let t=this.prop(Hk.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let r of n.split(` `))t[r]=e[n];return e=>{for(let n=e.prop(Hk.group),r=-1;r<(n?n.length:0);r++){let i=t[r<0?e.name:n[r]];if(i)return i}}}};Gk.none=new Gk(``,Object.create(null),0,8);var Kk=class e{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw RangeError(`Node type ids should correspond to array positions when creating a node set`)}extend(...t){let n=[];for(let e of this.types){let r=null;for(let n of t){let t=n(e);t&&(r||=Object.assign({},e.props),r[t[0].id]=t[1])}n.push(r?new Gk(e.name,r,e.id,e.flags):e)}return new e(n)}},qk=new WeakMap,Jk=new WeakMap,Yk;(function(e){e[e.ExcludeBuffers=1]=`ExcludeBuffers`,e[e.IncludeAnonymous=2]=`IncludeAnonymous`,e[e.IgnoreMounts=4]=`IgnoreMounts`,e[e.IgnoreOverlays=8]=`IgnoreOverlays`})(Yk||={});var Xk=class e{constructor(e,t,n,r,i){if(this.type=e,this.children=t,this.positions=n,this.length=r,this.props=null,i&&i.length){this.props=Object.create(null);for(let[e,t]of i)this.props[typeof e==`number`?e:e.id]=t}}toString(){let e=Uk.get(this);if(e&&!e.overlay)return e.tree.toString();let t=``;for(let e of this.children){let n=e.toString();n&&(t&&(t+=`,`),t+=n)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?`(`+t+`)`:``):t}cursor(e=0){return new uA(this.topNode,e)}cursorAt(e,t=0,n=0){let r=new uA(qk.get(this)||this.topNode);return r.moveTo(e,t),qk.set(this,r._tree),r}get topNode(){return new nA(this,0,0,null)}resolve(e,t=0){let n=eA(qk.get(this)||this.topNode,e,t,!1);return qk.set(this,n),n}resolveInner(e,t=0){let n=eA(Jk.get(this)||this.topNode,e,t,!0);return Jk.set(this,n),n}resolveStack(e,t=0){return lA(this,e,t)}iterate(e){let{enter:t,leave:n,from:r=0,to:i=this.length}=e,a=e.mode||0,o=(a&Yk.IncludeAnonymous)>0;for(let e=this.cursor(a|Yk.IncludeAnonymous);;){let a=!1;if(e.from<=i&&e.to>=r&&(!o&&e.type.isAnonymous||t(e)!==!1)){if(e.firstChild())continue;a=!0}for(;a&&n&&(o||!e.type.isAnonymous)&&n(e),!e.nextSibling();){if(!e.parent())return;a=!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(t={}){return this.children.length<=8?this:hA(Gk.none,this.children,this.positions,0,this.children.length,0,this.length,(t,n,r)=>new e(this.type,t,n,r,this.propValues),t.makeTree||((t,n,r)=>new e(Gk.none,t,n,r)))}static build(e){return fA(e)}};Xk.empty=new Xk(Gk.none,[],[],0);var Zk=class e{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 e(this.buffer,this.index)}},Qk=class e{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return Gk.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(`,`)}childString(e){let t=this.buffer[e],n=this.buffer[e+3],r=this.set.types[t],i=r.name;if(/\W/.test(i)&&!r.isError&&(i=JSON.stringify(i)),e+=4,n==e)return i;let a=[];for(;e<n;)a.push(this.childString(e)),e=this.buffer[e+3];return i+`(`+a.join(`,`)+`)`}findChild(e,t,n,r,i){let{buffer:a}=this,o=-1;for(let s=e;s!=t&&!($k(i,r,a[s+1],a[s+2])&&(o=s,n>0));s=a[s+3]);return o}slice(t,n,r){let i=this.buffer,a=new Uint16Array(n-t),o=0;for(let e=t,s=0;e<n;){a[s++]=i[e++],a[s++]=i[e++]-r;let n=a[s++]=i[e++]-r;a[s++]=i[e++]-t,o=Math.max(o,n)}return new e(a,o,this.set)}};function $k(e,t,n,r){switch(e){case-2:return n<t;case-1:return r>=t&&n<t;case 0:return n<t&&r>t;case 1:return n<=t&&r>t;case 2:return r>t;case 4:return!0}}function eA(e,t,n,r){for(;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to<t);){let t=!r&&e instanceof nA&&e.index<0?null:e.parent;if(!t)return e;e=t}let i=r?0:Yk.IgnoreOverlays;if(r)for(let r=e,a=r.parent;a;r=a,a=r.parent)r instanceof nA&&r.index<0&&a.enter(t,n,i)?.from!=r.from&&(e=a);for(;;){let r=e.enter(t,n,i);if(!r)return e;e=r}}var tA=class{cursor(e=0){return new uA(this,e)}getChild(e,t=null,n=null){let r=rA(this,e,t,n);return r.length?r[0]:null}getChildren(e,t=null,n=null){return rA(this,e,t,n)}resolve(e,t=0){return eA(this,e,t,!1)}resolveInner(e,t=0){return eA(this,e,t,!0)}matchContext(e){return iA(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),n=this;for(;t;){let e=t.lastChild;if(!e||e.to!=t.to)break;e.type.isError&&e.from==e.to?(n=t,t=e.prevSibling):t=e}return n}get node(){return this}get next(){return this.parent}},nA=class e extends tA{constructor(e,t,n,r){super(),this._tree=e,this.from=t,this.index=n,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(t,n,r,i,a=0){for(let o=this;;){for(let{children:s,positions:c}=o._tree,l=n>0?s.length:-1;t!=l;t+=n){let l=s[t],u=c[t]+o.from;if($k(i,r,u,u+l.length)){if(l instanceof Qk){if(a&Yk.ExcludeBuffers)continue;let e=l.findChild(0,l.buffer.length,n,r-u,i);if(e>-1)return new oA(new aA(o,l,t,u),null,e)}else if(a&Yk.IncludeAnonymous||!l.type.isAnonymous||dA(l)){let s;if(!(a&Yk.IgnoreMounts)&&(s=Uk.get(l))&&!s.overlay)return new e(s.tree,u,t,o);let c=new e(l,u,t,o);return a&Yk.IncludeAnonymous||!c.type.isAnonymous?c:c.nextChild(n<0?l.children.length-1:0,n,r,i)}}}if(a&Yk.IncludeAnonymous||!o.type.isAnonymous||(t=o.index>=0?o.index+n:n<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(t,n,r=0){let i;if(!(r&Yk.IgnoreOverlays)&&(i=Uk.get(this._tree))&&i.overlay){let r=t-this.from;for(let{from:t,to:a}of i.overlay)if((n>0?t<=r:t<r)&&(n<0?a>=r:a>r))return new e(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}};function rA(e,t,n,r){let i=e.cursor(),a=[];if(!i.firstChild())return a;if(n!=null){for(let e=!1;!e;)if(e=i.type.is(n),!i.nextSibling())return a}for(;;){if(r!=null&&i.type.is(r))return a;if(i.type.is(t)&&a.push(i.node),!i.nextSibling())return r==null?a:[]}}function iA(e,t,n=t.length-1){for(let r=e;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(t[n]&&t[n]!=r.name)return!1;n--}}return!0}var aA=class{constructor(e,t,n,r){this.parent=e,this.buffer=t,this.index=n,this.start=r}},oA=class e extends tA{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(t,n,r){let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],t,n-this.context.start,r);return a<0?null:new e(this.context,this,a)}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(t,n,r=0){if(r&Yk.ExcludeBuffers)return null;let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,t-this.context.start,n);return a<0?null:new e(this.context,this,a)}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:t}=this.context,n=t.buffer[this.index+3];return n<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new e(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new e(this.context,this._parent,t.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,r=this.index+4,i=n.buffer[this.index+3];if(i>r){let a=n.buffer[this.index+1];e.push(n.slice(r,i,a)),t.push(0)}return new Xk(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}};function sA(e){if(!e.length)return null;let t=0,n=e[0];for(let r=1;r<e.length;r++){let i=e[r];(i.from>n.from||i.to<n.to)&&(n=i,t=r)}let r=n instanceof nA&&n.index<0?null:n.parent,i=e.slice();return r?i[t]=r:i.splice(t,1),new cA(i,n)}var cA=class{constructor(e,t){this.heads=e,this.node=t}get next(){return sA(this.heads)}};function lA(e,t,n){let r=e.resolveInner(t,n),i=null;for(let e=r instanceof nA?r:r.context.parent;e;e=e.parent)if(e.index<0){let a=e.parent;(i||=[r]).push(a.resolve(t,n)),e=a}else{let a=Uk.get(e.tree);if(a&&a.overlay&&a.overlay[0].from<=t&&a.overlay[a.overlay.length-1].to>=t){let o=new nA(a.tree,a.overlay[0].from+e.from,-1,e);(i||=[r]).push(eA(o,t,n,!1))}}return i?sA(i):r}var uA=class{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof nA)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let t=e._parent;t;t=t._parent)this.stack.unshift(t.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:n,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=n+r.buffer[e+1],this.to=n+r.buffer[e+2],!0}yield(e){return e?e instanceof nA?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:r}=this.buffer,i=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,n);return i<0?!1:(this.stack.push(this.index),this.yieldBuf(i))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?n&Yk.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Yk.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Yk.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let e=n<0?0:this.stack[n]+4;if(this.index!=e)return this.yieldBuf(t.findChild(e,this.index,-1,0,4))}else{let e=t.buffer[this.index+3];if(e<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(e)}return n<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let e=0;e<this.index;e++)if(r.buffer.buffer[e+3]<this.index)return!1;({index:t,parent:n}=r)}else ({index:t,_parent:n}=this._tree);for(;n;{index:t,_parent:n}=n)if(t>-1)for(let r=t+e,i=e<0?-1:n._tree.children.length;r!=i;r+=e){let e=n._tree.children[r];if(this.mode&Yk.IncludeAnonymous||e instanceof Qk||!e.type.isAnonymous||dA(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<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,n=0;if(e&&e.context==this.buffer)scan:for(let r=this.index,i=this.stack.length;i>=0;){for(let a=e;a;a=a._parent)if(a.index==r){if(r==this.index)return a;t=a,n=i+1;break scan}r=this.stack[--i]}for(let e=n;e<this.stack.length;e++)t=new oA(this.buffer,t,this.stack[e]);return this.bufferNode=new oA(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let n=0;;){let r=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){n++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&t&&t(this),r=this.type.isAnonymous,!n)return;if(this.nextSibling())break;this.parent(),n--,r=!0}}}matchContext(e){if(!this.buffer)return iA(this.node.parent,e);let{buffer:t}=this.buffer,{types:n}=t.set;for(let r=e.length-1,i=this.stack.length-1;r>=0;i--){if(i<0)return iA(this._tree,e,r);let a=n[t.buffer[this.stack[i]]];if(!a.isAnonymous){if(e[r]&&e[r]!=a.name)return!1;r--}}return!0}};function dA(e){return e.children.some(e=>e instanceof Qk||!e.type.isAnonymous||dA(e))}function fA(e){let{buffer:t,nodeSet:n,maxBufferLength:r=zk,reused:i=[],minRepeatType:a=n.types.length}=e,o=Array.isArray(t)?new Zk(t,t.length):t,s=n.types,c=0,l=0;function u(e,t,_,v,y,b){let{id:x,start:S,end:C,size:w}=o,T=l,E=c;for(;w<0;)if(o.next(),w==-1){let t=i[x];_.push(t),v.push(S-e);return}else if(w==-3){c=x;return}else if(w==-4){l=x;return}else throw RangeError(`Unrecognized record size: ${w}`);let ee=s[x],te,D,ne=S-e;if(C-S<=r&&(D=h(o.pos-t,y))){let t=new Uint16Array(D.size-D.skip),r=o.pos-D.size,i=t.length;for(;o.pos>r;)i=g(D.start,t,i);te=new Qk(t,C-D.start,n),ne=D.start-e}else{let e=o.pos-w;o.next();let t=[],n=[],i=x>=a?x:-1,s=0,c=C;for(;o.pos>e;)i>=0&&o.id==i&&o.size>=0?(o.end<=c-r&&(p(t,n,S,s,o.end,c,i,T,E),s=t.length,c=o.end),o.next()):b>2500?d(S,e,t,n):u(S,e,t,n,i,b+1);if(i>=0&&s>0&&s<t.length&&p(t,n,S,s,S,c,i,T,E),t.reverse(),n.reverse(),i>-1&&s>0){let e=f(ee,E);te=hA(ee,t,n,0,t.length,0,C-S,e,e)}else te=m(ee,t,n,C-S,T-C,E)}_.push(te),v.push(ne)}function d(e,t,i,a){let s=[],c=0,l=-1;for(;o.pos>t;){let{id:e,start:t,end:n,size:i}=o;if(i>4)o.next();else if(l>-1&&t<l)break;else l<0&&(l=n-r),s.push(e,t,n),c++,o.next()}if(c){let t=new Uint16Array(c*4),r=s[s.length-2];for(let e=s.length-3,n=0;e>=0;e-=3)t[n++]=s[e],t[n++]=s[e+1]-r,t[n++]=s[e+2]-r,t[n++]=n;i.push(new Qk(t,s[2]-r,n)),a.push(r-e)}}function f(e,t){return(n,r,i)=>{let a=0,o=n.length-1,s,c;if(o>=0&&(s=n[o])instanceof Xk){if(!o&&s.type==e&&s.length==i)return s;(c=s.prop(Hk.lookAhead))&&(a=r[o]+s.length+c)}return m(e,n,r,i,a,t)}}function p(e,t,r,i,a,o,s,c,l){let u=[],d=[];for(;e.length>i;)u.push(e.pop()),d.push(t.pop()+r-a);e.push(m(n.types[s],u,d,o-a,c-o,l)),t.push(a-r)}function m(e,t,n,r,i,a,o){if(a){let e=[Hk.contextHash,a];o=o?[e].concat(o):[e]}if(i>25){let e=[Hk.lookAhead,i];o=o?[e].concat(o):[e]}return new Xk(e,t,n,r,o)}function h(e,t){let n=o.fork(),i=0,s=0,c=0,l=n.end-r,u={size:0,start:0,skip:0};scan:for(let r=n.pos-e;n.pos>r;){let e=n.size;if(n.id==t&&e>=0){u.size=i,u.start=s,u.skip=c,c+=4,i+=4,n.next();continue}let o=n.pos-e;if(e<0||o<r||n.start<l)break;let d=n.id>=a?4:0,f=n.start;for(n.next();n.pos>o;){if(n.size<0)if(n.size==-3)d+=4;else break scan;else n.id>=a&&(d+=4);n.next()}s=f,i+=e,c+=d}return(t<0||i==e)&&(u.size=i,u.start=s,u.skip=c),u.size>4?u:void 0}function g(e,t,n){let{id:r,start:i,end:s,size:u}=o;if(o.next(),u>=0&&r<a){let a=n;if(u>4){let r=o.pos-(u-4);for(;o.pos>r;)n=g(e,t,n)}t[--n]=a,t[--n]=s-e,t[--n]=i-e,t[--n]=r}else u==-3?c=r:u==-4&&(l=r);return n}let _=[],v=[];for(;o.pos>0;)u(e.start||0,e.bufferStart||0,_,v,-1,0);let y=e.length??(_.length?v[0]+_[0].length:0);return new Xk(s[e.topID],_.reverse(),v.reverse(),y)}var pA=new WeakMap;function mA(e,t){if(!e.isAnonymous||t instanceof Qk||t.type!=e)return 1;let n=pA.get(t);if(n==null){n=1;for(let r of t.children){if(r.type!=e||!(r instanceof Xk)){n=1;break}n+=mA(e,r)}pA.set(t,n)}return n}function hA(e,t,n,r,i,a,o,s,c){let l=0;for(let n=r;n<i;n++)l+=mA(e,t[n]);let u=Math.ceil(l*1.5/8),d=[],f=[];function p(t,n,r,i,o){for(let s=r;s<i;){let r=s,l=n[s],m=mA(e,t[s]);for(s++;s<i;s++){let n=mA(e,t[s]);if(m+n>=u)break;m+=n}if(s==r+1){if(m>u){let e=t[r];p(e.children,e.positions,0,e.children.length,n[r]+o);continue}d.push(t[r])}else{let i=n[s-1]+t[s-1].length-l;d.push(hA(e,t,n,r,s,l,i,null,c))}f.push(l+o-a)}}return p(t,n,r,i,0),(s||c)(d,f,o)}var gA=class e{constructor(e,t,n,r,i=!1,a=!1){this.from=e,this.to=t,this.tree=n,this.offset=r,this.open=!!i|(a?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,n=[],r=!1){let i=[new e(0,t.length,t,0,!1,r)];for(let e of n)e.to>t.length&&i.push(e);return i}static applyChanges(t,n,r=128){if(!n.length)return t;let i=[],a=1,o=t.length?t[0]:null;for(let s=0,c=0,l=0;;s++){let u=s<n.length?n[s]:null,d=u?u.fromA:1e9;if(d-c>=r)for(;o&&o.from<d;){let n=o;if(c>=n.from||d<=n.to||l){let t=Math.max(n.from,c)-l,r=Math.min(n.to,d)-l;n=t>=r?null:new e(t,r,n.tree,n.offset+l,s>0,!!u)}if(n&&i.push(n),o.to>d)break;o=a<t.length?t[a++]:null}if(!u)break;c=u.toA,l=u.toA-u.toB}return i}},_A=class{startParse(e,t,n){return typeof e==`string`&&(e=new vA(e)),n=n?n.length?n.map(e=>new Vk(e.from,e.to)):[new Vk(0,0)]:[new Vk(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let r=this.startParse(e,t,n);for(;;){let e=r.advance();if(e)return e}}},vA=class{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 Hk({perNode:!0});var yA=0,bA=class e{constructor(e,t,n,r){this.name=e,this.set=t,this.base=n,this.modified=r,this.id=yA++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(t,n){let r=typeof t==`string`?t:`?`;if(t instanceof e&&(n=t),n?.base)throw Error(`Can not derive from a modified tag`);let i=new e(r,[],null,[]);if(i.set.push(i),n)for(let e of n.set)i.set.push(e);return i}static defineModifier(e){let t=new SA(e);return e=>e.modified.indexOf(t)>-1?e:SA.get(e.base||e,e.modified.concat(t).sort((e,t)=>e.id-t.id))}},xA=0,SA=class e{constructor(e){this.name=e,this.instances=[],this.id=xA++}static get(t,n){if(!n.length)return t;let r=n[0].instances.find(e=>e.base==t&&CA(n,e.modified));if(r)return r;let i=[],a=new bA(t.name,i,t,n);for(let e of n)e.instances.push(a);let o=wA(n);for(let n of t.set)if(!n.modified.length)for(let t of o)i.push(e.get(n,t));return a}};function CA(e,t){return e.length==t.length&&e.every((e,n)=>e==t[n])}function wA(e){let t=[[]];for(let n=0;n<e.length;n++)for(let r=0,i=t.length;r<i;r++)t.push(t[r].concat(e[n]));return t.sort((e,t)=>t.length-e.length)}function TA(e){let t=Object.create(null);for(let n in e){let r=e[n];Array.isArray(r)||(r=[r]);for(let e of n.split(` `))if(e){let n=[],i=2,a=e;for(let t=0;;){if(a==`...`&&t>0&&t+3==e.length){i=1;break}let r=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!r)throw RangeError(`Invalid path: `+e);if(n.push(r[0]==`*`?``:r[0][0]==`"`?JSON.parse(r[0]):r[0]),t+=r[0].length,t==e.length)break;let o=e[t++];if(t==e.length&&o==`!`){i=0;break}if(o!=`/`)throw RangeError(`Invalid path: `+e);a=e.slice(t)}let o=n.length-1,s=n[o];if(!s)throw RangeError(`Invalid path: `+e);t[s]=new DA(r,i,o>0?n.slice(0,o):null).sort(t[s])}}return EA.add(t)}var EA=new Hk,DA=class{constructor(e,t,n,r){this.tags=e,this.mode=t,this.context=n,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}};DA.empty=new DA([],2,null);function OA(e,t){let n=Object.create(null);for(let t of e)if(!Array.isArray(t.tag))n[t.tag.id]=t.class;else for(let e of t.tag)n[e.id]=t.class;let{scope:r,all:i=null}=t||{};return{style:e=>{let t=i;for(let r of e)for(let e of r.set){let r=n[e.id];if(r){t=t?t+` `+r:r;break}}return t},scope:r}}function kA(e,t){let n=null;for(let r of e){let e=r.style(t);e&&(n=n?n+` `+e:e)}return n}function AA(e,t,n,r=0,i=e.length){let a=new jA(r,Array.isArray(t)?t:[t],n);a.highlightRange(e.cursor(),r,i,``,a.highlighters),a.flush(i)}var jA=class{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,r,i){let{type:a,from:o,to:s}=e;if(o>=n||s<=t)return;a.isTop&&(i=this.highlighters.filter(e=>!e.scope||e.scope(a)));let c=r,l=MA(e)||DA.empty,u=kA(i,l.tags);if(u&&(c&&(c+=` `),c+=u,l.mode==1&&(r+=(r?` `:``)+u)),this.startSpan(Math.max(t,o),c),l.opaque)return;let d=e.tree&&e.tree.prop(Hk.mounted);if(d&&d.overlay){let a=e.node.enter(d.overlay[0].from+o,1),l=this.highlighters.filter(e=>!e.scope||e.scope(d.tree.type)),u=e.firstChild();for(let f=0,p=o;;f++){let m=f<d.overlay.length?d.overlay[f]:null,h=m?m.from+o:s,g=Math.max(t,p),_=Math.min(n,h);if(g<_&&u)for(;e.from<_&&(this.highlightRange(e,g,_,r,i),this.startSpan(Math.min(_,e.to),c),!(e.to>=h||!e.nextSibling())););if(!m||h>n)break;p=m.to+o,p>t&&(this.highlightRange(a.cursor(),Math.max(t,m.from+o),Math.min(n,p),``,l),this.startSpan(Math.min(n,p),c))}u&&e.parent()}else if(e.firstChild()){d&&(r=``);do{if(e.to<=t)continue;if(e.from>=n)break;this.highlightRange(e,t,n,r,i),this.startSpan(Math.min(n,e.to),c)}while(e.nextSibling());e.parent()}}};function MA(e){let t=e.type.prop(EA);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}var NA=bA.define,PA=NA(),FA=NA(),IA=NA(FA),LA=NA(FA),RA=NA(),zA=NA(RA),BA=NA(RA),VA=NA(),HA=NA(VA),UA=NA(),WA=NA(),GA=NA(),KA=NA(GA),qA=NA(),JA={comment:PA,lineComment:NA(PA),blockComment:NA(PA),docComment:NA(PA),name:FA,variableName:NA(FA),typeName:IA,tagName:NA(IA),propertyName:LA,attributeName:NA(LA),className:NA(FA),labelName:NA(FA),namespace:NA(FA),macroName:NA(FA),literal:RA,string:zA,docString:NA(zA),character:NA(zA),attributeValue:NA(zA),number:BA,integer:NA(BA),float:NA(BA),bool:NA(RA),regexp:NA(RA),escape:NA(RA),color:NA(RA),url:NA(RA),keyword:UA,self:NA(UA),null:NA(UA),atom:NA(UA),unit:NA(UA),modifier:NA(UA),operatorKeyword:NA(UA),controlKeyword:NA(UA),definitionKeyword:NA(UA),moduleKeyword:NA(UA),operator:WA,derefOperator:NA(WA),arithmeticOperator:NA(WA),logicOperator:NA(WA),bitwiseOperator:NA(WA),compareOperator:NA(WA),updateOperator:NA(WA),definitionOperator:NA(WA),typeOperator:NA(WA),controlOperator:NA(WA),punctuation:GA,separator:NA(GA),bracket:KA,angleBracket:NA(KA),squareBracket:NA(KA),paren:NA(KA),brace:NA(KA),content:VA,heading:HA,heading1:NA(HA),heading2:NA(HA),heading3:NA(HA),heading4:NA(HA),heading5:NA(HA),heading6:NA(HA),contentSeparator:NA(VA),list:NA(VA),quote:NA(VA),emphasis:NA(VA),strong:NA(VA),link:NA(VA),monospace:NA(VA),strikethrough:NA(VA),inserted:NA(),deleted:NA(),changed:NA(),invalid:NA(),meta:qA,documentMeta:NA(qA),annotation:NA(qA),processingInstruction:NA(qA),definition:bA.defineModifier(`definition`),constant:bA.defineModifier(`constant`),function:bA.defineModifier(`function`),standard:bA.defineModifier(`standard`),local:bA.defineModifier(`local`),special:bA.defineModifier(`special`)};for(let e in JA){let t=JA[e];t instanceof bA&&(t.name=e)}OA([{tag:JA.link,class:`tok-link`},{tag:JA.heading,class:`tok-heading`},{tag:JA.emphasis,class:`tok-emphasis`},{tag:JA.strong,class:`tok-strong`},{tag:JA.keyword,class:`tok-keyword`},{tag:JA.atom,class:`tok-atom`},{tag:JA.bool,class:`tok-bool`},{tag:JA.url,class:`tok-url`},{tag:JA.labelName,class:`tok-labelName`},{tag:JA.inserted,class:`tok-inserted`},{tag:JA.deleted,class:`tok-deleted`},{tag:JA.literal,class:`tok-literal`},{tag:JA.string,class:`tok-string`},{tag:JA.number,class:`tok-number`},{tag:[JA.regexp,JA.escape,JA.special(JA.string)],class:`tok-string2`},{tag:JA.variableName,class:`tok-variableName`},{tag:JA.local(JA.variableName),class:`tok-variableName tok-local`},{tag:JA.definition(JA.variableName),class:`tok-variableName tok-definition`},{tag:JA.special(JA.variableName),class:`tok-variableName2`},{tag:JA.definition(JA.propertyName),class:`tok-propertyName tok-definition`},{tag:JA.typeName,class:`tok-typeName`},{tag:JA.namespace,class:`tok-namespace`},{tag:JA.className,class:`tok-className`},{tag:JA.macroName,class:`tok-macroName`},{tag:JA.propertyName,class:`tok-propertyName`},{tag:JA.operator,class:`tok-operator`},{tag:JA.comment,class:`tok-comment`},{tag:JA.meta,class:`tok-meta`},{tag:JA.invalid,class:`tok-invalid`},{tag:JA.punctuation,class:`tok-punctuation`}]);var YA=new Hk;function XA(e){return gx.define({combine:e?t=>t.concat(e):void 0})}var ZA=new Hk,QA=class{constructor(e,t,n=[],r=``){this.data=e,this.name=r,aS.prototype.hasOwnProperty(`tree`)||Object.defineProperty(aS.prototype,`tree`,{get(){return tj(this)}}),this.parser=t,this.extension=[dj.of(this),aS.languageData.of((e,t,n)=>{let r=$A(e,t,n),i=r.type.prop(YA);if(!i)return[];let a=e.facet(i),o=r.type.prop(ZA);if(o){let i=r.resolve(t-r.from,n);for(let t of o)if(t.test(i,e)){let n=e.facet(t.facet);return t.type==`replace`?n:n.concat(a)}}return a})].concat(n)}isActiveAt(e,t,n=-1){return $A(e,t,n).type.prop(YA)==this.data}findRegions(e){let t=e.facet(dj);if(t?.data==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],r=(e,t)=>{if(e.prop(YA)==this.data){n.push({from:t,to:t+e.length});return}let i=e.prop(Hk.mounted);if(i){if(i.tree.prop(YA)==this.data){if(i.overlay)for(let e of i.overlay)n.push({from:e.from+t,to:e.to+t});else n.push({from:t,to:t+e.length});return}else if(i.overlay){let e=n.length;if(r(i.tree,i.overlay[0].from+t),n.length>e)return}}for(let n=0;n<e.children.length;n++){let i=e.children[n];i instanceof Xk&&r(i,e.positions[n]+t)}};return r(tj(e),0),n}get allowsNesting(){return!0}};QA.setState=Wx.define();function $A(e,t,n){let r=e.facet(dj),i=tj(e).topNode;if(!r||r.allowsNesting)for(let e=i;e;e=e.enter(t,n,Yk.ExcludeBuffers))e.type.isTop&&(i=e);return i}var ej=class e extends QA{constructor(e,t,n){super(e,t,[],n),this.parser=t}static define(t){let n=XA(t.languageData);return new e(n,t.parser.configure({props:[YA.add(e=>e.isTop?n:void 0)]}),t.name)}configure(t,n){return new e(this.data,this.parser.configure(t),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}};function tj(e){let t=e.field(QA.state,!1);return t?t.tree:Xk.empty}function nj(e,t,n=50){let r=e.field(QA.state,!1)?.context;if(!r)return null;let i=r.viewport;r.updateViewport({from:0,to:t});let a=r.isDone(t)||r.work(n,t)?r.tree:null;return r.updateViewport(i),a}var rj=class{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<n||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}},ij=null,aj=class e{constructor(e,t,n=[],r,i,a,o,s){this.parser=e,this.state=t,this.fragments=n,this.tree=r,this.treeLen=i,this.viewport=a,this.skipped=o,this.scheduleOn=s,this.parse=null,this.tempSkipped=[]}static create(t,n,r){return new e(t,n,[],Xk.empty,0,r,[],null)}startParse(){return this.parser.startParse(new rj(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=Xk.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{if(typeof e==`number`){let t=Date.now()+e;e=()=>Date.now()>t}for(this.parse||=this.startParse(),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let n=this.parse.advance();if(n)if(this.fragments=this.withoutTempSkipped(gA.addTree(n,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=this.parse.stoppedAt??this.state.doc.length,this.tree=n,this.parse=null,this.treeLen<(t??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(gA.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=ij;ij=this;try{return e()}finally{ij=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=oj(e,t.from,t.to);return e}changes(t,n){let{fragments:r,tree:i,treeLen:a,viewport:o,skipped:s}=this;if(this.takeTree(),!t.empty){let e=[];if(t.iterChangedRanges((t,n,r,i)=>e.push({fromA:t,toA:n,fromB:r,toB:i})),r=gA.applyChanges(r,e),i=Xk.empty,a=0,o={from:t.mapPos(o.from,-1),to:t.mapPos(o.to,1)},this.skipped.length){s=[];for(let e of this.skipped){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);n<r&&s.push({from:n,to:r})}}}return new e(this.parser,n,r,i,a,o,s,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let t=0;t<this.skipped.length;t++){let{from:n,to:r}=this.skipped[t];n<e.to&&r>e.from&&(this.fragments=oj(this.fragments,n,r),this.skipped.splice(t--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&=(this.takeTree(),null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends _A{createParse(t,n,r){let i=r[0].from,a=r[r.length-1].to;return{parsedPos:i,advance(){let t=ij;if(t){for(let e of r)t.tempSkipped.push(e);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=a,new Xk(Gk.none,[],[],a-i)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return ij}};function oj(e,t,n){return gA.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}var sj=class e{constructor(e){this.context=e,this.tree=e.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(t.changes,t.state),r=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new e(n)}static init(t){let n=Math.min(3e3,t.doc.length),r=aj.create(t.facet(dj).parser,t,{from:0,to:n});return r.work(20,n)||r.takeTree(),new e(r)}};QA.state=Cx.define({create:sj.init,update(e,t){for(let e of t.effects)if(e.is(QA.setState))return e.value;return t.startState.facet(dj)==t.state.facet(dj)?e.apply(t):sj.init(t.state)}});var cj=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<`u`&&(cj=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});var lj=typeof navigator<`u`&&navigator.scheduling?.isInputPending?()=>navigator.scheduling.isInputPending():null,uj=Yw.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(QA.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(QA.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=cj(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:n,viewport:{to:r}}=this.view,i=n.field(QA.state);if(i.tree==i.context.tree&&i.context.isDone(r+1e5))return;let a=Date.now()+Math.min(this.chunkBudget,100,e&&!lj?Math.max(25,e.timeRemaining()-5):1e9),o=i.context.treeLen<r&&n.doc.length>r+1e3,s=i.context.work(()=>lj&&lj()||Date.now()>a,r+(o?0:1e5));this.chunkBudget-=Date.now()-t,(s||this.chunkBudget<=0)&&(i.context.takeTree(),this.view.dispatch({effects:QA.setState.of(new sj(i.context))})),this.chunkBudget>0&&!(s&&!o)&&this.scheduleWork(),this.checkAsyncSchedule(i.context)}checkAsyncSchedule(e){e.scheduleOn&&=(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(e=>Gw(this.view.state,e)).then(()=>this.workScheduled--),null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),dj=gx.define({combine(e){return e.length?e[0]:null},enables:e=>[QA.state,uj,OD.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]}),fj=class{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}},pj=gx.define(),mj=gx.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 Error(`Invalid indent unit: `+JSON.stringify(e[0]));return t}});function hj(e){let t=e.facet(mj);return t.charCodeAt(0)==9?e.tabSize*t.length:t.length}function gj(e,t){let n=``,r=e.tabSize,i=e.facet(mj)[0];if(i==` `){for(;t>=r;)n+=` `,t-=r;i=` `}for(let e=0;e<t;e++)n+=i;return n}function _j(e,t){e instanceof aS&&(e=new vj(e));for(let n of e.state.facet(pj)){let r=n(e,t);if(r!==void 0)return r}let n=tj(e.state);return n.length>=t?bj(e,n,t):null}var vj=class{constructor(e,t={}){this.state=e,this.options=t,this.unit=hj(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:i}=this.options;return r!=null&&r>=n.from&&r<=n.to?i&&r==e?{text:``,from:e}:(t<0?r<e:r<=e)?{text:n.text.slice(r-n.from),from:r}:{text:n.text.slice(0,r-n.from),from:n.from}:n}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return``;let{text:n,from:r}=this.lineAt(e,t);return n.slice(e-r,Math.min(n.length,e+100-r))}column(e,t=1){let{text:n,from:r}=this.lineAt(e,t),i=this.countColumn(n,e-r),a=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return a>-1&&(i+=a-this.countColumn(n,n.search(/\S|$/))),i}countColumn(e,t=e.length){return wS(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:r}=this.lineAt(e,t),i=this.options.overrideIndentation;if(i){let e=i(r);if(e>-1)return e}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}},yj=new Hk;function bj(e,t,n){let r=t.resolveStack(n),i=t.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(i!=r.node){let e=[];for(let t=i;t&&!(t.from==r.node.from&&t.type==r.node.type);t=t.parent)e.push(t);for(let t=e.length-1;t>=0;t--)r={node:e[t],next:r}}return xj(r,e,n)}function xj(e,t,n){for(let r=e;r;r=r.next){let e=Cj(r.node);if(e)return e(Tj.create(t,n,r))}return 0}function Sj(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}function Cj(e){let t=e.type.prop(yj);if(t)return t;let n=e.firstChild,r;if(n&&(r=n.type.prop(Hk.closedBy))){let t=e.lastChild,n=t&&r.indexOf(t.name)>-1;return e=>Oj(e,!0,1,void 0,n&&!Sj(e)?t.from:void 0)}return e.parent==null?wj:null}function wj(){return 0}var Tj=class e extends vj{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(t,n,r){return new e(t,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(t.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(Ej(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return xj(this.context.next,this.base,this.pos)}};function Ej(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function Dj(e){let t=e.node,n=t.childAfter(t.from),r=t.lastChild;if(!n)return null;let i=e.options.simulateBreak,a=e.state.doc.lineAt(n.from),o=i==null||i<=a.from?a.to:Math.min(a.to,i);for(let e=n.to;;){let i=t.childAfter(e);if(!i||i==r)return null;if(!i.type.isSkipped){if(i.from>=o)return null;let e=/^ */.exec(a.text.slice(n.to-a.from))[0].length;return{from:n.from,to:n.to+e}}e=i.to}}function Oj(e,t,n,r,i){let a=e.textAfter,o=a.match(/^\s*/)[0].length,s=r&&a.slice(o,o+r.length)==r||i==e.pos+o,c=t?Dj(e):null;return c?s?e.column(c.from):e.column(c.to):e.baseIndent+(s?0:e.unit*n)}function kj({except:e,units:t=1}={}){return n=>{let r=e&&e.test(n.textAfter);return n.baseIndent+(r?0:t*n.unit)}}var Aj=200;function jj(){return aS.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:r}=e.newSelection.main,i=n.lineAt(r);if(r>i.from+Aj)return e;let a=n.sliceString(i.from,r);if(!t.some(e=>e.test(a)))return e;let{state:o}=e,s=-1,c=[];for(let{head:e}of o.selection.ranges){let t=o.doc.lineAt(e);if(t.from==s)continue;s=t.from;let n=_j(o,t.from);if(n==null)continue;let r=/^\s*/.exec(t.text)[0],i=gj(o,n);r!=i&&c.push({from:t.from,to:t.from+r.length,insert:i})}return c.length?[e,{changes:c,sequential:!0}]:e})}var Mj=gx.define(),Nj=new Hk;function Pj(e){let t=e.firstChild,n=e.lastChild;return t&&t.to<n.from?{from:t.to,to:n.type.isError?e.to:n.from}:null}function Fj(e,t,n){let r=tj(e);if(r.length<n)return null;let i=r.resolveStack(n,1),a=null;for(let o=i;o;o=o.next){let i=o.node;if(i.to<=n||i.from>n)continue;if(a&&i.from<t)break;let s=i.type.prop(Nj);if(s&&(i.to<r.length-50||r.length==e.doc.length||!Ij(i))){let r=s(i,e);r&&r.from<=n&&r.from>=t&&r.to>n&&(a=r)}}return a}function Ij(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}function Lj(e,t,n){for(let r of e.facet(Mj)){let i=r(e,t,n);if(i)return i}return Fj(e,t,n)}function Rj(e,t){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);return n>=r?void 0:{from:n,to:r}}var zj=Wx.define({map:Rj}),Bj=Wx.define({map:Rj});function Vj(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}var Hj=Cx.define({create(){return JC.none},update(e,t){e=e.map(t.changes);for(let n of t.effects)if(n.is(zj)&&!Wj(e,n.value.from,n.value.to)){let{preparePlaceholder:r}=t.state.facet($j),i=r?JC.replace({widget:new rM(r(t.state,n.value))}):nM;e=e.update({add:[i.range(n.value.from,n.value.to)]})}else n.is(Bj)&&(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:r}=t.selection.main;e.between(r,r,(e,t)=>{e<r&&t>r&&(n=!0)}),n&&(e=e.update({filterFrom:r,filterTo:r,filter:(e,t)=>t<=r||e>=r}))}return e},provide:e=>OD.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 RangeError(`Invalid JSON for fold state`);let t=[];for(let n=0;n<e.length;){let r=e[n++],i=e[n++];if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid JSON for fold state`);t.push(nM.range(r,i))}return JC.set(t,!0)}});function Uj(e,t,n){var r;let i=null;return(r=e.field(Hj,!1))==null||r.between(t,n,(e,t)=>{(!i||i.from>e)&&(i={from:e,to:t})}),i}function Wj(e,t,n){let r=!1;return e.between(t,t,(e,i)=>{e==t&&i==n&&(r=!0)}),r}function Gj(e,t){return e.field(Hj,!1)?t:t.concat(Wx.appendConfig.of(eM()))}var Kj=e=>{for(let t of Vj(e)){let n=Lj(e.state,t.from,t.to);if(n)return e.dispatch({effects:Gj(e.state,[zj.of(n),Jj(e,n)])}),!0}return!1},qj=e=>{if(!e.state.field(Hj,!1))return!1;let t=[];for(let n of Vj(e)){let r=Uj(e.state,n.from,n.to);r&&t.push(Bj.of(r),Jj(e,r,!1))}return t.length&&e.dispatch({effects:t}),t.length>0};function Jj(e,t,n=!0){let r=e.state.doc.lineAt(t.from).number,i=e.state.doc.lineAt(t.to).number;return OD.announce.of(`${e.state.phrase(n?`Folded lines`:`Unfolded lines`)} ${r} ${e.state.phrase(`to`)} ${i}.`)}var Yj=e=>{let{state:t}=e,n=[];for(let r=0;r<t.doc.length;){let i=e.lineBlockAt(r),a=Lj(t,i.from,i.to);a&&n.push(zj.of(a)),r=(a?e.lineBlockAt(a.to):i).to+1}return n.length&&e.dispatch({effects:Gj(e.state,n)}),!!n.length},Xj=e=>{let t=e.state.field(Hj,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,(e,t)=>{n.push(Bj.of({from:e,to:t}))}),e.dispatch({effects:n}),!0},Zj=[{key:`Ctrl-Shift-[`,mac:`Cmd-Alt-[`,run:Kj},{key:`Ctrl-Shift-]`,mac:`Cmd-Alt-]`,run:qj},{key:`Ctrl-Alt-[`,run:Yj},{key:`Ctrl-Alt-]`,run:Xj}],Qj={placeholderDOM:null,preparePlaceholder:null,placeholderText:`…`},$j=gx.define({combine(e){return oS(e,Qj)}});function eM(e){let t=[Hj,sM];return e&&t.push($j.of(e)),t}function tM(e,t){let{state:n}=e,r=n.facet($j),i=t=>{let n=e.lineBlockAt(e.posAtDOM(t.target)),r=Uj(e.state,n.from,n.to);r&&e.dispatch({effects:Bj.of(r)}),t.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(e,i,t);let a=document.createElement(`span`);return a.textContent=r.placeholderText,a.setAttribute(`aria-label`,n.phrase(`folded code`)),a.title=n.phrase(`unfold`),a.className=`cm-foldPlaceholder`,a.onclick=i,a}var nM=JC.replace({widget:new class extends KC{toDOM(e){return tM(e,null)}}}),rM=class extends KC{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return tM(e,this.value)}},iM={openText:`⌄`,closedText:`›`,markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1},aM=class extends pk{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 oM(e={}){let t=Object.assign(Object.assign({},iM),e),n=new aM(t,!0),r=new aM(t,!1),i=Yw.fromClass(class{constructor(e){this.from=e.viewport.from,this.markers=this.buildMarkers(e)}update(e){(e.docChanged||e.viewportChanged||e.startState.facet(dj)!=e.state.facet(dj)||e.startState.field(Hj,!1)!=e.state.field(Hj,!1)||tj(e.startState)!=tj(e.state)||t.foldingChanged(e))&&(this.markers=this.buildMarkers(e.view))}buildMarkers(e){let t=new pS;for(let i of e.viewportLineBlocks){let a=Uj(e.state,i.from,i.to)?r:Lj(e.state,i.from,i.to)?n:null;a&&t.add(i.from,i.from,a)}return t.finish()}}),{domEventHandlers:a}=t;return[i,vk({class:`cm-foldGutter`,markers(e){return e.plugin(i)?.markers||dS.empty},initialSpacer(){return new aM(t,!1)},domEventHandlers:Object.assign(Object.assign({},a),{click:(e,t,n)=>{if(a.click&&a.click(e,t,n))return!0;let r=Uj(e.state,t.from,t.to);if(r)return e.dispatch({effects:Bj.of(r)}),!0;let i=Lj(e.state,t.from,t.to);return i?(e.dispatch({effects:zj.of(i)}),!0):!1}})}),eM()]}var sM=OD.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`}}),cM=class e{constructor(e,t){this.specs=e;let n;function r(e){let t=AS.newName();return(n||=Object.create(null))[`.`+t]=e,t}let i=typeof t.all==`string`?t.all:t.all?r(t.all):void 0,a=t.scope;this.scope=a instanceof QA?e=>e.prop(YA)==a.data:a?e=>e==a:void 0,this.style=OA(e.map(e=>({tag:e.tag,class:e.class||r(Object.assign({},e,{tag:null}))})),{all:i}).style,this.module=n?new AS(n):null,this.themeType=t.themeType}static define(t,n){return new e(t,n||{})}},lM=gx.define(),uM=gx.define({combine(e){return e.length?[e[0]]:null}});function dM(e){let t=e.facet(lM);return t.length?t:e.facet(uM)}function fM(e,t){let n=[mM],r;return e instanceof cM&&(e.module&&n.push(OD.styleModule.of(e.module)),r=e.themeType),t?.fallback?n.push(uM.of(e)):r?n.push(lM.computeN([OD.darkTheme],t=>t.facet(OD.darkTheme)==(r==`dark`)?[e]:[])):n.push(lM.of(e)),n}var pM=class{constructor(e){this.markCache=Object.create(null),this.tree=tj(e.state),this.decorations=this.buildDeco(e,dM(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=tj(e.state),n=dM(e.state),r=n!=dM(e.startState),{viewport:i}=e.view,a=e.changes.mapPos(this.decoratedTo,1);t.length<i.to&&!r&&t.type==this.tree.type&&a>=i.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=a):(t!=this.tree||e.viewportChanged||r)&&(this.tree=t,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=i.to)}buildDeco(e,t){if(!t||!this.tree.length)return JC.none;let n=new pS;for(let{from:r,to:i}of e.visibleRanges)AA(this.tree,t,(e,t,r)=>{n.add(e,t,this.markCache[r]||(this.markCache[r]=JC.mark({class:r})))},r,i);return n.finish()}},mM=Ex.high(Yw.fromClass(pM,{decorations:e=>e.decorations})),hM=cM.define([{tag:JA.meta,color:`#404740`},{tag:JA.link,textDecoration:`underline`},{tag:JA.heading,textDecoration:`underline`,fontWeight:`bold`},{tag:JA.emphasis,fontStyle:`italic`},{tag:JA.strong,fontWeight:`bold`},{tag:JA.strikethrough,textDecoration:`line-through`},{tag:JA.keyword,color:`#708`},{tag:[JA.atom,JA.bool,JA.url,JA.contentSeparator,JA.labelName],color:`#219`},{tag:[JA.literal,JA.inserted],color:`#164`},{tag:[JA.string,JA.deleted],color:`#a11`},{tag:[JA.regexp,JA.escape,JA.special(JA.string)],color:`#e40`},{tag:JA.definition(JA.variableName),color:`#00f`},{tag:JA.local(JA.variableName),color:`#30a`},{tag:[JA.typeName,JA.namespace],color:`#085`},{tag:JA.className,color:`#167`},{tag:[JA.special(JA.variableName),JA.macroName],color:`#256`},{tag:JA.definition(JA.propertyName),color:`#00c`},{tag:JA.comment,color:`#940`},{tag:JA.invalid,color:`#f00`}]),gM=OD.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:`#328c8252`},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:`#bb555544`}}),_M=1e4,vM=`()[]{}`,yM=gx.define({combine(e){return oS(e,{afterCursor:!0,brackets:vM,maxScanDistance:_M,renderMatch:SM})}}),bM=JC.mark({class:`cm-matchingBracket`}),xM=JC.mark({class:`cm-nonmatchingBracket`});function SM(e){let t=[],n=e.matched?bM:xM;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}var CM=[Cx.define({create(){return JC.none},update(e,t){if(!t.docChanged&&!t.selection)return e;let n=[],r=t.state.facet(yM);for(let e of t.state.selection.ranges){if(!e.empty)continue;let i=OM(t.state,e.head,-1,r)||e.head>0&&OM(t.state,e.head-1,1,r)||r.afterCursor&&(OM(t.state,e.head,1,r)||e.head<t.state.doc.length&&OM(t.state,e.head+1,-1,r));i&&(n=n.concat(r.renderMatch(i,t.state)))}return JC.set(n,!0)},provide:e=>OD.decorations.from(e)}),gM];function wM(e={}){return[yM.of(e),CM]}var TM=new Hk;function EM(e,t,n){let r=e.prop(t<0?Hk.openedBy:Hk.closedBy);if(r)return r;if(e.name.length==1){let r=n.indexOf(e.name);if(r>-1&&r%2==+(t<0))return[n[r+t]]}return null}function DM(e){let t=e.type.prop(TM);return t?t(e.node):e}function OM(e,t,n,r={}){let i=r.maxScanDistance||_M,a=r.brackets||vM,o=tj(e),s=o.resolveInner(t,n);for(let r=s;r;r=r.parent){let i=EM(r.type,n,a);if(i&&r.from<r.to){let o=DM(r);if(o&&(n>0?t>=o.from&&t<o.to:t>o.from&&t<=o.to))return kM(e,t,n,r,o,i,a)}}return AM(e,t,n,o,s.type,i,a)}function kM(e,t,n,r,i,a,o){let s=r.parent,c={from:i.from,to:i.to},l=0,u=s?.cursor();if(u&&(n<0?u.childBefore(r.from):u.childAfter(r.to)))do if(n<0?u.to<=r.from:u.from>=r.to){if(l==0&&a.indexOf(u.type.name)>-1&&u.from<u.to){let e=DM(u);return{start:c,end:e?{from:e.from,to:e.to}:void 0,matched:!0}}else if(EM(u.type,n,o))l++;else if(EM(u.type,-n,o)){if(l==0){let e=DM(u);return{start:c,end:e&&e.from<e.to?{from:e.from,to:e.to}:void 0,matched:!1}}l--}}while(n<0?u.prevSibling():u.nextSibling());return{start:c,matched:!1}}function AM(e,t,n,r,i,a,o){let s=n<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),c=o.indexOf(s);if(c<0||c%2==0!=n>0)return null;let l={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 e=0;!u.next().done&&e<=a;){let a=u.value;n<0&&(e+=a.length);let s=t+e*n;for(let e=n>0?0:a.length-1,t=n>0?a.length:-1;e!=t;e+=n){let t=o.indexOf(a[e]);if(!(t<0||r.resolveInner(s+e,1).type!=i))if(t%2==0==n>0)d++;else if(d==1)return{start:l,end:{from:s+e,to:s+e+1},matched:t>>1==c>>1};else d--}n>0&&(e+=a.length)}return u.done?{start:l,matched:!1}:null}var jM=Object.create(null),MM=[Gk.none],NM=[],PM=Object.create(null),FM=Object.create(null);for(let[e,t]of[[`variable`,`variableName`],[`variable-2`,`variableName.special`],[`string-2`,`string.special`],[`def`,`variableName.definition`],[`tag`,`tagName`],[`attribute`,`attributeName`],[`type`,`typeName`],[`builtin`,`variableName.standard`],[`qualifier`,`modifier`],[`error`,`invalid`],[`header`,`heading`],[`property`,`propertyName`]])FM[e]=LM(jM,t);function IM(e,t){NM.indexOf(e)>-1||(NM.push(e),console.warn(t))}function LM(e,t){let n=[];for(let r of t.split(` `)){let t=[];for(let n of r.split(`.`)){let r=e[n]||JA[n];r?typeof r==`function`?t.length?t=t.map(r):IM(n,`Modifier ${n} used at start of tag`):t.length?IM(n,`Tag ${n} used as modifier`):t=Array.isArray(r)?r:[r]:IM(n,`Unknown highlighting tag ${n}`)}for(let e of t)n.push(e)}if(!n.length)return 0;let r=t.replace(/ /g,`_`),i=r+` `+n.map(e=>e.id),a=PM[i];if(a)return a.id;let o=PM[i]=Gk.define({id:MM.length,name:r,props:[TA({[r]:n})]});return MM.push(o),o.id}sw.RTL,sw.LTR;var RM=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=UM(e.state,n.from);return r.line?BM(e):r.block?HM(e):!1};function zM(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=e(t,n);return i?(r(n.update(i)),!0):!1}}var BM=zM(JM,0),VM=zM(qM,0),HM=zM((e,t)=>qM(e,t,KM(t)),0);function UM(e,t){let n=e.languageDataAt(`commentTokens`,t);return n.length?n[0]:{}}var WM=50;function GM(e,{open:t,close:n},r,i){let a=e.sliceDoc(r-WM,r),o=e.sliceDoc(i,i+WM),s=/\s*$/.exec(a)[0].length,c=/^\s*/.exec(o)[0].length,l=a.length-s;if(a.slice(l-t.length,l)==t&&o.slice(c,c+n.length)==n)return{open:{pos:r-s,margin:s&&1},close:{pos:i+c,margin:c&&1}};let u,d;i-r<=2*WM?u=d=e.sliceDoc(r,i):(u=e.sliceDoc(r,r+WM),d=e.sliceDoc(i-WM,i));let f=/^\s*/.exec(u)[0].length,p=/\s*$/.exec(d)[0].length,m=d.length-p-n.length;return u.slice(f,f+t.length)==t&&d.slice(m,m+n.length)==n?{open:{pos:r+f+t.length,margin:+!!/\s/.test(u.charAt(f+t.length))},close:{pos:i-p-n.length,margin:+!!/\s/.test(d.charAt(m-1))}}:null}function KM(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),i=n.to<=r.to?r:e.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let a=t.length-1;a>=0&&t[a].to>r.from?t[a].to=i.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return t}function qM(e,t,n=t.selection.ranges){let r=n.map(e=>UM(t,e.from).block);if(!r.every(e=>e))return null;let i=n.map((e,n)=>GM(t,r[n],e.from,e.to));if(e!=2&&!i.every(e=>e))return{changes:t.changes(n.map((e,t)=>i[t]?[]:[{from:e.from,insert:r[t].open+` `},{from:e.to,insert:` `+r[t].close}]))};if(e!=1&&i.some(e=>e)){let e=[];for(let t=0,n;t<i.length;t++)if(n=i[t]){let i=r[t],{open:a,close:o}=n;e.push({from:a.pos-i.open.length,to:a.pos+a.margin},{from:o.pos-o.margin,to:o.pos+i.close.length})}return{changes:e}}return null}function JM(e,t,n=t.selection.ranges){let r=[],i=-1;for(let{from:e,to:a}of n){let n=r.length,o=1e9,s=UM(t,e).line;if(s){for(let n=e;n<=a;){let c=t.doc.lineAt(n);if(c.from>i&&(e==a||a>c.from)){i=c.from;let e=/^\s*/.exec(c.text)[0].length,t=e==c.length,n=c.text.slice(e,e+s.length)==s?e:-1;e<c.text.length&&e<o&&(o=e),r.push({line:c,comment:n,token:s,indent:e,empty:t,single:!1})}n=c.to+1}if(o<1e9)for(let e=n;e<r.length;e++)r[e].indent<r[e].line.text.length&&(r[e].indent=o);r.length==n+1&&(r[n].single=!0)}}if(e!=2&&r.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:i,empty:a,single:o}of r)(o||!a)&&e.push({from:t.from+i,insert:n+` `});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}else if(e!=1&&r.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:i}of r)if(n>=0){let r=t.from+n,a=r+i.length;t.text[a-t.from]==` `&&a++,e.push({from:r,to:a})}return{changes:e}}return null}var YM=Vx.define(),XM=gx.define(),ZM=class e{constructor(e,t,n,r,i){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=i}setSelAfter(t){return new e(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){return{changes:this.changes?.toJSON(),mapped:this.mapped?.toJSON(),startSelection:this.startSelection?.toJSON(),selectionsAfter:this.selectionsAfter.map(e=>e.toJSON())}}static fromJSON(t){return new e(t.changes&&ox.fromJSON(t.changes),[],t.mapped&&ax.fromJSON(t.mapped),t.startSelection&&L.fromJSON(t.startSelection),t.selectionsAfter.map(L.fromJSON))}static fromTransaction(t,n){let r=nN;for(let e of t.startState.facet(XM)){let n=e(t);n.length&&(r=r.concat(n))}return!r.length&&t.changes.empty?null:new e(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,nN)}static selection(t){return new e(void 0,nN,void 0,void 0,t)}};function QM(e,t,n,r){let i=t+1>n+20?t-n-1:0,a=e.slice(i,t);return a.push(r),a}function $M(e,t){let n=[],r=!1;return e.iterChangedRanges((e,t)=>n.push(e,t)),t.iterChangedRanges((e,t,i,a)=>{for(let e=0;e<n.length;){let t=n[e++],o=n[e++];a>=t&&i<=o&&(r=!0)}}),r}function eN(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((e,n)=>e.empty!=t.ranges[n].empty).length===0}function tN(e,t){return e.length?t.length?e.concat(t):e:t}var nN=[],rN=200;function iN(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-rN));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),QM(e,e.length-1,1e9,n.setSelAfter(r)))}else return[ZM.selection([t])]}function aN(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 oN(e,t){if(!e.length)return e;let n=e.length,r=nN;for(;n;){let i=sN(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){let t=e.slice(0,n);return t[n-1]=i,t}else t=i.mapped,n--,r=i.selectionsAfter}return r.length?[ZM.selection(r)]:nN}function sN(e,t,n){let r=tN(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):nN,n);if(!e.changes)return ZM.selection(r);let i=e.changes.map(t),a=t.mapDesc(e.changes,!0),o=e.mapped?e.mapped.composeDesc(a):a;return new ZM(i,Wx.mapEffects(e.effects,t),o,e.startSelection.map(a),r)}var cN=/^(input\.type|delete)($|\.)/,lN=class e{constructor(e,t,n=0,r=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new e(this.done,this.undone):this}addChanges(t,n,r,i,a){let o=this.done,s=o[o.length-1];return o=s&&s.changes&&!s.changes.empty&&t.changes&&(!r||cN.test(r))&&(!s.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(a,$M(s.changes,t.changes))||r==`input.type.compose`)?QM(o,o.length-1,i.minDepth,new ZM(t.changes.compose(s.changes),tN(Wx.mapEffects(t.effects,s.changes),s.effects),s.mapped,s.startSelection,nN)):QM(o,o.length,i.minDepth,t),new e(o,nN,n,r)}addSelection(t,n,r,i){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:nN;return a.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&eN(a[a.length-1],t)?this:new e(iN(this.done,t),this.undone,n,r)}addMapping(t){return new e(oN(this.done,t),oN(this.undone,t),this.prevTime,this.prevUserEvent)}pop(e,t,n){let r=e==0?this.done:this.undone;if(r.length==0)return null;let i=r[r.length-1],a=i.selectionsAfter[0]||t.selection;if(n&&i.selectionsAfter.length)return t.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:YM.of({side:e,rest:aN(r),selection:a}),userEvent:e==0?`select.undo`:`select.redo`,scrollIntoView:!0});if(i.changes){let n=r.length==1?nN:r.slice(0,r.length-1);return i.mapped&&(n=oN(n,i.mapped)),t.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:YM.of({side:e,rest:n,selection:a}),filter:!1,userEvent:e==0?`undo`:`redo`,scrollIntoView:!0})}else return null}};lN.empty=new lN(nN,nN);function uN(e,t){return L.create(e.ranges.map(t),e.mainIndex)}function dN(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:`select`})}function fN({state:e,dispatch:t},n){let r=uN(e.selection,n);return r.eq(e.selection,!0)?!1:(t(dN(e,r)),!0)}function pN(e,t){return L.cursor(t?e.to:e.from)}function mN(e,t){return fN(e,n=>n.empty?e.moveByChar(n,t):pN(n,t))}function hN(e){return e.textDirectionAt(e.state.selection.main.head)==sw.LTR}var gN=e=>mN(e,!hN(e)),_N=e=>mN(e,hN(e));function vN(e,t){return fN(e,n=>n.empty?e.moveByGroup(n,t):pN(n,t))}var yN=e=>vN(e,!hN(e)),bN=e=>vN(e,hN(e));typeof Intl<`u`&&Intl.Segmenter;function xN(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function SN(e,t,n){let r=tj(e).resolveInner(t.head),i=n?Hk.closedBy:Hk.openedBy;for(let a=t.head;;){let t=n?r.childAfter(a):r.childBefore(a);if(!t)break;xN(e,t,i)?r=t:a=n?t.to:t.from}let a=r.type.prop(i),o,s;return s=a&&(o=n?OM(e,r.from,1):OM(e,r.to,-1))&&o.matched?n?o.end.to:o.end.from:n?r.to:r.from,L.cursor(s,n?-1:1)}var CN=e=>fN(e,t=>SN(e.state,t,!hN(e))),wN=e=>fN(e,t=>SN(e.state,t,hN(e)));function TN(e,t){return fN(e,n=>{if(!n.empty)return pN(n,t);let r=e.moveVertically(n,t);return r.head==n.head?e.moveToLineBoundary(n,t):r})}var EN=e=>TN(e,!1),DN=e=>TN(e,!0);function ON(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,i;if(t){for(let t of e.state.facet(OD.scrollMargins)){let i=t(e);i?.top&&(n=Math.max(i?.top,n)),i?.bottom&&(r=Math.max(i?.bottom,r))}i=e.scrollDOM.clientHeight-n-r}else i=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,i-5)}}function kN(e,t){let n=ON(e),{state:r}=e,i=uN(r.selection,r=>r.empty?e.moveVertically(r,t,n.height):pN(r,t));if(i.eq(r.selection))return!1;let a;if(n.selfScroll){let t=e.coordsAtPos(r.selection.main.head),o=e.scrollDOM.getBoundingClientRect(),s=o.top+n.marginTop,c=o.bottom-n.marginBottom;t&&t.top>s&&t.bottom<c&&(a=OD.scrollIntoView(i.main.head,{y:`start`,yMargin:t.top-s}))}return e.dispatch(dN(r,i),{effects:a}),!0}var AN=e=>kN(e,!1),jN=e=>kN(e,!0);function MN(e,t,n){let r=e.lineBlockAt(t.head),i=e.moveToLineBoundary(t,n);if(i.head==t.head&&i.head!=(n?r.to:r.from)&&(i=e.moveToLineBoundary(t,n,!1)),!n&&i.head==r.from&&r.length){let n=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;n&&t.head!=r.from+n&&(i=L.cursor(r.from+n))}return i}var NN=e=>fN(e,t=>MN(e,t,!0)),PN=e=>fN(e,t=>MN(e,t,!1)),FN=e=>fN(e,t=>MN(e,t,!hN(e))),IN=e=>fN(e,t=>MN(e,t,hN(e))),LN=e=>fN(e,t=>L.cursor(e.lineBlockAt(t.head).from,1)),RN=e=>fN(e,t=>L.cursor(e.lineBlockAt(t.head).to,-1));function zN(e,t,n){let r=!1,i=uN(e.selection,t=>{let i=OM(e,t.head,-1)||OM(e,t.head,1)||t.head>0&&OM(e,t.head-1,1)||t.head<e.doc.length&&OM(e,t.head+1,-1);if(!i||!i.end)return t;r=!0;let a=i.start.from==t.head?i.end.to:i.end.from;return n?L.range(t.anchor,a):L.cursor(a)});return r?(t(dN(e,i)),!0):!1}var BN=({state:e,dispatch:t})=>zN(e,t,!1);function VN(e,t){let n=uN(e.state.selection,e=>{let n=t(e);return L.range(e.anchor,n.head,n.goalColumn,n.bidiLevel||void 0)});return n.eq(e.state.selection)?!1:(e.dispatch(dN(e.state,n)),!0)}function HN(e,t){return VN(e,n=>e.moveByChar(n,t))}var UN=e=>HN(e,!hN(e)),WN=e=>HN(e,hN(e));function GN(e,t){return VN(e,n=>e.moveByGroup(n,t))}var KN=e=>GN(e,!hN(e)),qN=e=>GN(e,hN(e)),JN=e=>VN(e,t=>SN(e.state,t,!hN(e))),YN=e=>VN(e,t=>SN(e.state,t,hN(e)));function XN(e,t){return VN(e,n=>e.moveVertically(n,t))}var ZN=e=>XN(e,!1),QN=e=>XN(e,!0);function $N(e,t){return VN(e,n=>e.moveVertically(n,t,ON(e).height))}var eP=e=>$N(e,!1),tP=e=>$N(e,!0),nP=e=>VN(e,t=>MN(e,t,!0)),rP=e=>VN(e,t=>MN(e,t,!1)),iP=e=>VN(e,t=>MN(e,t,!hN(e))),aP=e=>VN(e,t=>MN(e,t,hN(e))),oP=e=>VN(e,t=>L.cursor(e.lineBlockAt(t.head).from)),sP=e=>VN(e,t=>L.cursor(e.lineBlockAt(t.head).to)),cP=({state:e,dispatch:t})=>(t(dN(e,{anchor:0})),!0),lP=({state:e,dispatch:t})=>(t(dN(e,{anchor:e.doc.length})),!0),uP=({state:e,dispatch:t})=>(t(dN(e,{anchor:e.selection.main.anchor,head:0})),!0),dP=({state:e,dispatch:t})=>(t(dN(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),fP=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:`select`})),!0),pP=({state:e,dispatch:t})=>{let n=kP(e).map(({from:t,to:n})=>L.range(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:L.create(n),userEvent:`select`})),!0},mP=({state:e,dispatch:t})=>{let n=uN(e.selection,t=>{let n=tj(e),r=n.resolveStack(t.from,1);if(t.empty){let e=n.resolveStack(t.from,-1);e.node.from>=r.node.from&&e.node.to<=r.node.to&&(r=e)}for(let e=r;e;e=e.next){let{node:n}=e;if((n.from<t.from&&n.to>=t.to||n.to>t.to&&n.from<=t.from)&&e.next)return L.range(n.to,n.from)}return t});return n.eq(e.selection)?!1:(t(dN(e,n)),!0)},hP=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=L.create([n.main]):n.main.empty||(r=L.create([L.cursor(n.main.head)])),r?(t(dN(e,r)),!0):!1};function gP(e,t){if(e.state.readOnly)return!1;let n=`delete.selection`,{state:r}=e,i=r.changeByRange(r=>{let{from:i,to:a}=r;if(i==a){let o=t(r);o<i?(n=`delete.backward`,o=_P(e,o,!1)):o>i&&(n=`delete.forward`,o=_P(e,o,!0)),i=Math.min(i,o),a=Math.max(a,o)}else i=_P(e,i,!1),a=_P(e,a,!0);return i==a?{range:r}:{changes:{from:i,to:a},range:L.cursor(i,i<r.head?-1:1)}});return i.changes.empty?!1:(e.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n==`delete.selection`?OD.announce.of(r.phrase(`Selection deleted`)):void 0})),!0)}function _P(e,t,n){if(e instanceof OD)for(let r of e.state.facet(OD.atomicRanges).map(t=>t(e)))r.between(t,t,(e,r)=>{e<t&&r>t&&(t=n?r:e)});return t}var vP=(e,t,n)=>gP(e,r=>{let i=r.from,{state:a}=e,o=a.doc.lineAt(i),s,c;if(n&&!t&&i>o.from&&i<o.from+200&&!/[^ \t]/.test(s=o.text.slice(0,i-o.from))){if(s[s.length-1]==` `)return i-1;let e=wS(s,a.tabSize)%hj(a)||hj(a);for(let t=0;t<e&&s[s.length-1-t]==` `;t++)i--;c=i}else c=Zb(o.text,i-o.from,t,t)+o.from,c==i&&o.number!=(t?a.doc.lines:1)?c+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(o.text.slice(c-o.from,i-o.from))&&(c=Zb(o.text,c-o.from,!1,!1)+o.from);return c}),yP=e=>vP(e,!1,!0),bP=e=>vP(e,!0,!1),xP=(e,t)=>gP(e,n=>{let r=n.head,{state:i}=e,a=i.doc.lineAt(r),o=i.charCategorizer(r);for(let e=null;;){if(r==(t?a.to:a.from)){r==n.head&&a.number!=(t?i.doc.lines:1)&&(r+=t?1:-1);break}let s=Zb(a.text,r-a.from,t)+a.from,c=a.text.slice(Math.min(r,s)-a.from,Math.max(r,s)-a.from),l=o(c);if(e!=null&&l!=e)break;(c!=` `||r!=n.head)&&(e=l),r=s}return r}),SP=e=>xP(e,!1),CP=e=>xP(e,!0),wP=e=>gP(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),TP=e=>gP(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),EP=e=>gP(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),DP=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:Bb.of([``,``])},range:L.cursor(e.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:`input`})),!0},OP=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(t=>{if(!t.empty||t.from==0||t.from==e.doc.length)return{range:t};let n=t.from,r=e.doc.lineAt(n),i=n==r.from?n-1:Zb(r.text,n-r.from,!1)+r.from,a=n==r.to?n+1:Zb(r.text,n-r.from,!0)+r.from;return{changes:{from:i,to:a,insert:e.doc.slice(n,a).append(e.doc.slice(i,n))},range:L.cursor(a)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:`move.character`})),!0)};function kP(e){let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.from),a=e.doc.lineAt(r.to);if(!r.empty&&r.to==a.from&&(a=e.doc.lineAt(r.to-1)),n>=i.number){let e=t[t.length-1];e.to=a.to,e.ranges.push(r)}else t.push({from:i.from,to:a.to,ranges:[r]});n=a.number+1}return t}function AP(e,t,n){if(e.readOnly)return!1;let r=[],i=[];for(let t of kP(e)){if(n?t.to==e.doc.length:t.from==0)continue;let a=e.doc.lineAt(n?t.to+1:t.from-1),o=a.length+1;if(n){r.push({from:t.to,to:a.to},{from:t.from,insert:a.text+e.lineBreak});for(let n of t.ranges)i.push(L.range(Math.min(e.doc.length,n.anchor+o),Math.min(e.doc.length,n.head+o)))}else{r.push({from:a.from,to:t.from},{from:t.to,insert:e.lineBreak+a.text});for(let e of t.ranges)i.push(L.range(e.anchor-o,e.head-o))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:L.create(i,e.selection.mainIndex),userEvent:`move.line`})),!0):!1}var jP=({state:e,dispatch:t})=>AP(e,t,!1),MP=({state:e,dispatch:t})=>AP(e,t,!0);function NP(e,t,n){if(e.readOnly)return!1;let r=[];for(let t of kP(e))n?r.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):r.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});return t(e.update({changes:r,scrollIntoView:!0,userEvent:`input.copyline`})),!0}var PP=({state:e,dispatch:t})=>NP(e,t,!1),FP=({state:e,dispatch:t})=>NP(e,t,!0),IP=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(kP(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),r=uN(t.selection,t=>{let n;if(e.lineWrapping){let r=e.lineBlockAt(t.head),i=e.coordsAtPos(t.head,t.assoc||1);i&&(n=r.bottom+e.documentTop-i.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:`delete.line`}),!0};function LP(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=tj(e).resolveInner(t),r=n.childBefore(t),i=n.childAfter(t),a;return r&&i&&r.to<=t&&i.from>=t&&(a=r.type.prop(Hk.closedBy))&&a.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}var RP=BP(!1),zP=BP(!0);function BP(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(n=>{let{from:r,to:i}=n,a=t.doc.lineAt(r),o=!e&&r==i&&LP(t,r);e&&(r=i=(i<=a.to?a:t.doc.lineAt(i)).to);let s=new vj(t,{simulateBreak:r,simulateDoubleBreak:!!o}),c=_j(s,r);for(c??=wS(/^\s*/.exec(t.doc.lineAt(r).text)[0],t.tabSize);i<a.to&&/\s/.test(a.text[i-a.from]);)i++;o?{from:r,to:i}=o:r>a.from&&r<a.from+100&&!/\S/.test(a.text.slice(0,r))&&(r=a.from);let l=[``,gj(t,c)];return o&&l.push(gj(t,s.lineIndent(a.from,-1))),{changes:{from:r,to:i,insert:Bb.of(l)},range:L.cursor(r+1+l[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:`input`})),!0}}function VP(e,t){let n=-1;return e.changeByRange(r=>{let i=[];for(let a=r.from;a<=r.to;){let o=e.doc.lineAt(a);o.number>n&&(r.empty||r.to>o.from)&&(t(o,i,r),n=o.number),a=o.to+1}let a=e.changes(i);return{changes:i,range:L.range(a.mapPos(r.anchor,1),a.mapPos(r.head,1))}})}var HP=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new vj(e,{overrideIndentation:e=>n[e]??-1}),i=VP(e,(t,i,a)=>{let o=_j(r,t.from);if(o==null)return;/\S/.test(t.text)||(o=0);let s=/^\s*/.exec(t.text)[0],c=gj(e,o);(s!=c||a.from<t.from+s.length)&&(n[t.from]=o,i.push({from:t.from,to:t.from+s.length,insert:c}))});return i.changes.empty||t(e.update(i,{userEvent:`indent`})),!0},UP=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(VP(e,(t,n)=>{n.push({from:t.from,insert:e.facet(mj)})}),{userEvent:`input.indent`})),!0),WP=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(VP(e,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let i=wS(r,e.tabSize),a=0,o=gj(e,Math.max(0,i-hj(e)));for(;a<r.length&&a<o.length&&r.charCodeAt(a)==o.charCodeAt(a);)a++;n.push({from:t.from+a,to:t.from+r.length,insert:o.slice(a)})}),{userEvent:`delete.dedent`})),!0),GP=e=>(e.setTabFocusMode(),!0),KP=[{key:`Ctrl-b`,run:gN,shift:UN,preventDefault:!0},{key:`Ctrl-f`,run:_N,shift:WN},{key:`Ctrl-p`,run:EN,shift:ZN},{key:`Ctrl-n`,run:DN,shift:QN},{key:`Ctrl-a`,run:LN,shift:oP},{key:`Ctrl-e`,run:RN,shift:sP},{key:`Ctrl-d`,run:bP},{key:`Ctrl-h`,run:yP},{key:`Ctrl-k`,run:wP},{key:`Ctrl-Alt-h`,run:SP},{key:`Ctrl-o`,run:DP},{key:`Ctrl-t`,run:OP},{key:`Ctrl-v`,run:jN}],qP=[{key:`ArrowLeft`,run:gN,shift:UN,preventDefault:!0},{key:`Mod-ArrowLeft`,mac:`Alt-ArrowLeft`,run:yN,shift:KN,preventDefault:!0},{mac:`Cmd-ArrowLeft`,run:FN,shift:iP,preventDefault:!0},{key:`ArrowRight`,run:_N,shift:WN,preventDefault:!0},{key:`Mod-ArrowRight`,mac:`Alt-ArrowRight`,run:bN,shift:qN,preventDefault:!0},{mac:`Cmd-ArrowRight`,run:IN,shift:aP,preventDefault:!0},{key:`ArrowUp`,run:EN,shift:ZN,preventDefault:!0},{mac:`Cmd-ArrowUp`,run:cP,shift:uP},{mac:`Ctrl-ArrowUp`,run:AN,shift:eP},{key:`ArrowDown`,run:DN,shift:QN,preventDefault:!0},{mac:`Cmd-ArrowDown`,run:lP,shift:dP},{mac:`Ctrl-ArrowDown`,run:jN,shift:tP},{key:`PageUp`,run:AN,shift:eP},{key:`PageDown`,run:jN,shift:tP},{key:`Home`,run:PN,shift:rP,preventDefault:!0},{key:`Mod-Home`,run:cP,shift:uP},{key:`End`,run:NN,shift:nP,preventDefault:!0},{key:`Mod-End`,run:lP,shift:dP},{key:`Enter`,run:RP,shift:RP},{key:`Mod-a`,run:fP},{key:`Backspace`,run:yP,shift:yP},{key:`Delete`,run:bP},{key:`Mod-Backspace`,mac:`Alt-Backspace`,run:SP},{key:`Mod-Delete`,mac:`Alt-Delete`,run:CP},{mac:`Mod-Backspace`,run:TP},{mac:`Mod-Delete`,run:EP}].concat(KP.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),JP=[{key:`Alt-ArrowLeft`,mac:`Ctrl-ArrowLeft`,run:CN,shift:JN},{key:`Alt-ArrowRight`,mac:`Ctrl-ArrowRight`,run:wN,shift:YN},{key:`Alt-ArrowUp`,run:jP},{key:`Shift-Alt-ArrowUp`,run:PP},{key:`Alt-ArrowDown`,run:MP},{key:`Shift-Alt-ArrowDown`,run:FP},{key:`Escape`,run:hP},{key:`Mod-Enter`,run:zP},{key:`Alt-l`,mac:`Ctrl-l`,run:pP},{key:`Mod-i`,run:mP,preventDefault:!0},{key:`Mod-[`,run:WP},{key:`Mod-]`,run:UP},{key:`Mod-Alt-\\`,run:HP},{key:`Shift-Mod-k`,run:IP},{key:`Shift-Mod-\\`,run:BN},{key:`Mod-/`,run:RM},{key:`Alt-A`,run:VM},{key:`Ctrl-m`,mac:`Shift-Alt-m`,run:GP}].concat(qP),YP={key:`Tab`,run:UP,shift:WP};function XP(){var e=arguments[0];typeof e==`string`&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&typeof n==`object`&&n.nodeType==null&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var i=n[r];typeof i==`string`?e.setAttribute(r,i):i!=null&&(e[r]=i)}t++}for(;t<arguments.length;t++)ZP(e,arguments[t]);return e}function ZP(e,t){if(typeof t==`string`)e.appendChild(document.createTextNode(t));else if(t!=null)if(t.nodeType!=null)e.appendChild(t);else if(Array.isArray(t))for(var n=0;n<t.length;n++)ZP(e,t[n]);else throw RangeError(`Unsupported child node: `+t)}var QP=class{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}},$P=class e{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(t,n,r){let i=t,a=r.facet(gF).markerFilter;a&&(i=a(i,r));let o=t.slice().sort((e,t)=>e.from-t.from||e.to-t.to),s=new pS,c=[],l=0;for(let e=0;;){let t=e==o.length?null:o[e];if(!t&&!c.length)break;let n,i;for(c.length?(n=l,i=c.reduce((e,t)=>Math.min(e,t.to),t&&t.from>n?t.from:1e8)):(n=t.from,i=t.to,c.push(t),e++);e<o.length;){let t=o[e];if(t.from==n&&(t.to>t.from||t.to==n))c.push(t),e++,i=Math.min(t.to,i);else{i=Math.min(t.from,i);break}}let a=DF(c);if(c.some(e=>e.from==e.to||e.from==e.to-1&&r.doc.lineAt(e.from).to==e.from))s.add(n,n,JC.widget({widget:new bF(a),diagnostics:c.slice()}));else{let e=c.reduce((e,t)=>t.markClass?e+` `+t.markClass:e,``);s.add(n,i,JC.mark({class:`cm-lintRange cm-lintRange-`+a+e,diagnostics:c.slice(),inclusiveEnd:c.some(e=>e.to>i)}))}l=i;for(let e=0;e<c.length;e++)c[e].to<=l&&c.splice(e--,1)}let u=s.finish();return new e(u,n,eF(u))}};function eF(e,t=null,n=0){let r=null;return e.between(n,1e9,(e,n,{spec:i})=>{if(!(t&&i.diagnostics.indexOf(t)<0))if(!r)r=new QP(e,n,t||i.diagnostics[0]);else if(i.diagnostics.indexOf(r.diagnostic)<0)return!1;else r=new QP(r.from,n,r.diagnostic)}),r}function tF(e,t){let n=t.pos,r=t.end||n,i=e.state.facet(gF).hideOn(e,n,r);if(i!=null)return i;let a=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(e=>e.is(iF))||e.changes.touchesRange(a.from,Math.max(a.to,r)))}function nF(e,t){return e.field(sF,!1)?t:t.concat(Wx.appendConfig.of(LF))}function rF(e,t){return{effects:nF(e,[iF.of(t)])}}var iF=Wx.define(),aF=Wx.define(),oF=Wx.define(),sF=Cx.define({create(){return new $P(JC.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,i=e.panel;if(e.selected){let i=t.changes.mapPos(e.selected.from,1);r=eF(n,e.selected.diagnostic,i)||eF(n,null,i)}!n.size&&i&&t.state.facet(gF).autoPanel&&(i=null),e=new $P(n,i,r)}for(let n of t.effects)if(n.is(iF)){let r=t.state.facet(gF).autoPanel?n.value.length?SF.open:null:e.panel;e=$P.init(n.value,r,t.state)}else n.is(aF)?e=new $P(e.diagnostics,n.value?SF.open:null,e.selected):n.is(oF)&&(e=new $P(e.diagnostics,e.panel,n.value));return e},provide:e=>[fk.from(e,e=>e.panel),OD.decorations.from(e,e=>e.diagnostics)]}),cF=JC.mark({class:`cm-lintRange cm-lintRange-active`});function lF(e,t,n){let{diagnostics:r}=e.state.field(sF),i,a=-1,o=-1;r.between(t-+(n<0),t+ +(n>0),(e,r,{spec:s})=>{if(t>=e&&t<=r&&(e==r||(t>e||n>0)&&(t<r||n<0)))return i=s.diagnostics,a=e,o=r,!1});let s=e.state.facet(gF).tooltipFilter;return i&&s&&(i=s(i,e.state)),i?{pos:a,end:o,above:e.state.doc.lineAt(a).to<o,create(){return{dom:uF(e,i)}}}:null}function uF(e,t){return XP(`ul`,{class:`cm-tooltip-lint`},t.map(t=>yF(e,t,!1)))}var dF=e=>{let t=e.state.field(sF,!1);(!t||!t.panel)&&e.dispatch({effects:nF(e.state,[aF.of(!0)])});let n=ck(e,SF.open);return n&&n.dom.querySelector(`.cm-panel-lint ul`).focus(),!0},fF=e=>{let t=e.state.field(sF,!1);return!t||!t.panel?!1:(e.dispatch({effects:aF.of(!1)}),!0)},pF=[{key:`Mod-Shift-m`,run:dF,preventDefault:!0},{key:`F8`,run:e=>{let t=e.state.field(sF,!1);if(!t)return!1;let n=e.state.selection.main,r=t.diagnostics.iter(n.to+1);return!r.value&&(r=t.diagnostics.iter(0),!r.value||r.from==n.from&&r.to==n.to)?!1:(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)}}],mF=Yw.fromClass(class{constructor(e){this.view=e,this.timeout=-1,this.set=!0;let{delay:t}=e.state.facet(gF);this.lintTime=Date.now()+t,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,t)}run(){clearTimeout(this.timeout);let e=Date.now();if(e<this.lintTime-10)this.timeout=setTimeout(this.run,this.lintTime-e);else{this.set=!1;let{state:e}=this.view,{sources:t}=e.facet(gF);t.length&&hF(t.map(e=>Promise.resolve(e(this.view))),t=>{this.view.state.doc==e.doc&&this.view.dispatch(rF(this.view.state,t.reduce((e,t)=>e.concat(t))))},e=>{Gw(this.view.state,e)})}}update(e){let t=e.state.facet(gF);(e.docChanged||t!=e.startState.facet(gF)||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)}});function hF(e,t,n){let r=[],i=-1;for(let a of e)a.then(n=>{r.push(n),clearTimeout(i),r.length==e.length?t(r):i=setTimeout(()=>t(r),200)},n)}var gF=gx.define({combine(e){return Object.assign({sources:e.map(e=>e.source).filter(e=>e!=null)},oS(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t}))}});function _F(e,t={}){return[gF.of({source:e,config:t}),mF,LF]}function vF(e){let t=[];if(e)actions:for(let{name:n}of e){for(let e=0;e<n.length;e++){let r=n[e];if(/[a-zA-Z]/.test(r)&&!t.some(e=>e.toLowerCase()==r.toLowerCase())){t.push(r);continue actions}}t.push(``)}return t}function yF(e,t,n){let r=n?vF(t.actions):[];return XP(`li`,{class:`cm-diagnostic cm-diagnostic-`+t.severity},XP(`span`,{class:`cm-diagnosticText`},t.renderMessage?t.renderMessage(e):t.message),t.actions?.map((n,i)=>{let a=!1,o=r=>{if(r.preventDefault(),a)return;a=!0;let i=eF(e.state.field(sF).diagnostics,t);i&&n.apply(e,i.from,i.to)},{name:s}=n,c=r[i]?s.indexOf(r[i]):-1,l=c<0?s:[s.slice(0,c),XP(`u`,s.slice(c,c+1)),s.slice(c+1)];return XP(`button`,{type:`button`,class:`cm-diagnosticAction`,onclick:o,onmousedown:o,"aria-label":` Action: ${s}${c<0?``:` (access key "${r[i]})"`}.`},l)}),t.source&&XP(`div`,{class:`cm-diagnosticSource`},t.source))}var bF=class extends KC{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return XP(`span`,{class:`cm-lintPoint cm-lintPoint-`+this.sev})}},xF=class{constructor(e,t){this.diagnostic=t,this.id=`item_`+Math.floor(Math.random()*4294967295).toString(16),this.dom=yF(e,t,!0),this.dom.id=this.id,this.dom.setAttribute(`role`,`option`)}},SF=class e{constructor(e){this.view=e,this.items=[];let t=t=>{if(t.keyCode==27)fF(this.view),this.view.focus();else if(t.keyCode==38||t.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(t.keyCode==40||t.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(t.keyCode==36)this.moveSelection(0);else if(t.keyCode==35)this.moveSelection(this.items.length-1);else if(t.keyCode==13)this.view.focus();else if(t.keyCode>=65&&t.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:n}=this.items[this.selectedIndex],r=vF(n.actions);for(let i=0;i<r.length;i++)if(r[i].toUpperCase().charCodeAt(0)==t.keyCode){let t=eF(this.view.state.field(sF).diagnostics,n);t&&n.actions[i].apply(e,t.from,t.to)}}else return;t.preventDefault()},n=e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)};this.list=XP(`ul`,{tabIndex:0,role:`listbox`,"aria-label":this.view.state.phrase(`Diagnostics`),onkeydown:t,onclick:n}),this.dom=XP(`div`,{class:`cm-panel-lint`},this.list,XP(`button`,{type:`button`,name:`close`,"aria-label":this.view.state.phrase(`close`),onclick:()=>fF(this.view)},`×`)),this.update()}get selectedIndex(){let e=this.view.state.field(sF).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(sF),n=0,r=!1,i=null,a=new Set;for(e.between(0,this.view.state.doc.length,(e,o,{spec:s})=>{for(let e of s.diagnostics){if(a.has(e))continue;a.add(e);let o=-1,s;for(let t=n;t<this.items.length;t++)if(this.items[t].diagnostic==e){o=t;break}o<0?(s=new xF(this.view,e),this.items.splice(n,0,s),r=!0):(s=this.items[o],o>n&&(this.items.splice(n,o-n),r=!0)),t&&s.diagnostic==t.diagnostic?s.dom.hasAttribute(`aria-selected`)||(s.dom.setAttribute(`aria-selected`,`true`),i=s):s.dom.hasAttribute(`aria-selected`)&&s.dom.removeAttribute(`aria-selected`),n++}});n<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();this.items.length==0&&(this.items.push(new xF(this.view,{from:-1,to:-1,severity:`info`,message:this.view.state.phrase(`No diagnostics`)})),r=!0),i?(this.list.setAttribute(`aria-activedescendant`,i.id),this.view.requestMeasure({key:this,read:()=>({sel:i.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.top<t.top?this.list.scrollTop-=(t.top-e.top)/n:e.bottom>t.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute(`aria-activedescendant`),r&&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=eF(this.view.state.field(sF).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:oF.of(t)})}static open(t){return new e(t)}};function CF(e,t=`viewBox="0 0 40 40"`){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}function wF(e){return CF(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,`width="6" height="3"`)}var TF=OD.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:wF(`#d11`)},".cm-lintRange-warning":{backgroundImage:wF(`orange`)},".cm-lintRange-info":{backgroundImage:wF(`#999`)},".cm-lintRange-hint":{backgroundImage:wF(`#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 EF(e){return e==`error`?4:e==`warning`?3:e==`info`?2:1}function DF(e){let t=`hint`,n=1;for(let r of e){let e=EF(r.severity);e>n&&(n=e,t=r.severity)}return t}var OF=class extends pk{constructor(e){super(),this.diagnostics=e,this.severity=DF(e)}toDOM(e){let t=document.createElement(`div`);t.className=`cm-lint-marker cm-lint-marker-`+this.severity;let n=this.diagnostics,r=e.state.facet(RF).tooltipFilter;return r&&(n=r(n,e.state)),n.length&&(t.onmouseover=()=>AF(e,t,n)),t}};function kF(e,t){let n=r=>{let i=t.getBoundingClientRect();if(!(r.clientX>i.left-10&&r.clientX<i.right+10&&r.clientY>i.top-10&&r.clientY<i.bottom+10)){for(let e=r.target;e;e=e.parentNode)if(e.nodeType==1&&e.classList.contains(`cm-tooltip-lint`))return;window.removeEventListener(`mousemove`,n),e.state.field(FF)&&e.dispatch({effects:PF.of(null)})}};window.addEventListener(`mousemove`,n)}function AF(e,t,n){function r(){let r=e.elementAtHeight(t.getBoundingClientRect().top+5-e.documentTop);e.coordsAtPos(r.from)&&e.dispatch({effects:PF.of({pos:r.from,above:!1,clip:!1,create(){return{dom:uF(e,n),getCoords:()=>t.getBoundingClientRect()}}})}),t.onmouseout=t.onmousemove=null,kF(e,t)}let{hoverTime:i}=e.state.facet(RF),a=setTimeout(r,i);t.onmouseout=()=>{clearTimeout(a),t.onmouseout=t.onmousemove=null},t.onmousemove=()=>{clearTimeout(a),a=setTimeout(r,i)}}function jF(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 r=[];for(let e in n)r.push(new OF(n[e]).range(+e));return dS.of(r,!0)}var MF=vk({class:`cm-gutter-lint`,markers:e=>e.state.field(NF),widgetMarker:(e,t,n)=>{let r=[];return e.state.field(NF).between(n.from,n.to,(e,t,i)=>{e>n.from&&e<n.to&&r.push(...i.diagnostics)}),r.length?new OF(r):null}}),NF=Cx.define({create(){return dS.empty},update(e,t){e=e.map(t.changes);let n=t.state.facet(RF).markerFilter;for(let r of t.effects)if(r.is(iF)){let i=r.value;n&&(i=n(i||[],t.state)),e=jF(t.state.doc,i.slice(0))}return e}}),PF=Wx.define(),FF=Cx.define({create(){return null},update(e,t){return e&&t.docChanged&&(e=tF(t,e)?null:Object.assign(Object.assign({},e),{pos:t.changes.mapPos(e.pos)})),t.effects.reduce((e,t)=>t.is(PF)?t.value:e,e)},provide:e=>XO.from(e)}),IF=OD.baseTheme({".cm-gutter-lint":{width:`1.4em`,"& .cm-gutterElement":{padding:`.2em`}},".cm-lint-marker":{width:`1em`,height:`1em`},".cm-lint-marker-info":{content:CF(`<path fill="#aaf" stroke="#77e" stroke-width="6" stroke-linejoin="round" d="M5 5L35 5L35 35L5 35Z"/>`)},".cm-lint-marker-warning":{content:CF(`<path fill="#fe8" stroke="#fd7" stroke-width="6" stroke-linejoin="round" d="M20 6L37 35L3 35Z"/>`)},".cm-lint-marker-error":{content:CF(`<circle cx="20" cy="20" r="15" fill="#f87" stroke="#f43" stroke-width="6"/>`)}}),LF=[sF,OD.decorations.compute([sF],e=>{let{selected:t,panel:n}=e.field(sF);return!t||!n||t.from==t.to?JC.none:JC.set([cF.range(t.from,t.to)])}),ik(lF,{hideOn:tF}),TF],RF=gx.define({combine(e){return oS(e,{hoverTime:300,markerFilter:null,tooltipFilter:null})}});function zF(e={}){return[RF.of(e),NF,MF,IF,FF]}var BF=class e{constructor(e,t,n,r,i,a,o,s,c,l=0,u){this.p=e,this.stack=t,this.state=n,this.reducePos=r,this.pos=i,this.score=a,this.buffer=o,this.bufferBase=s,this.curContext=c,this.lookAhead=l,this.parent=u}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?`!`+this.score:``}`}static start(t,n,r=0){let i=t.parser.context;return new e(t,[],n,r,r,0,[],0,i?new VF(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){let t=e>>19,n=e&65535,{parser:r}=this.p,i=this.reducePos<this.pos-25;i&&this.setLookAhead(this.pos);let a=r.dynamicPrecedence(n);if(a&&(this.score+=a),t==0){this.pushState(r.getGoto(this.state,n,!0),this.reducePos),n<r.minRepeatTerm&&this.storeNode(n,this.reducePos,this.reducePos,i?8:4,!0),this.reduceContext(n,this.reducePos);return}let o=this.stack.length-(t-1)*3-(e&262144?6:0),s=o?this.stack[o-2]:this.p.ranges[0].from,c=this.reducePos-s;c>=2e3&&!this.p.parser.nodeSet.types[n]?.isAnonymous&&(s==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSize<c&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=s,this.p.lastBigReductionSize=c));let l=o?this.stack[o-1]:0,u=this.bufferBase+this.buffer.length-l;if(n<r.minRepeatTerm||e&131072){let e=r.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(n,s,e,u+4,!0)}if(e&262144)this.state=this.stack[o];else{let e=this.stack[o-3];this.state=r.getGoto(e,n,!0)}for(;this.stack.length>o;)this.stack.pop();this.reduceContext(n,s)}storeNode(e,t,n,r=4,i=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let e=this,r=this.buffer.length;if(r==0&&e.parent&&(r=e.bufferBase-e.parent.bufferBase,e=e.parent),r>0&&e.buffer[r-4]==0&&e.buffer[r-1]>-1){if(t==n)return;if(e.buffer[r-2]>=t){e.buffer[r-2]=n;return}}}if(!i||this.pos==n)this.buffer.push(e,t,n,r);else{let i=this.buffer.length;if(i>0&&this.buffer[i-4]!=0){let e=!1;for(let t=i;t>0&&this.buffer[t-2]>n;t-=4)if(this.buffer[t-1]>=0){e=!0;break}if(e)for(;i>0&&this.buffer[i-2]>n;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4)}this.buffer[i]=e,this.buffer[i+1]=t,this.buffer[i+2]=n,this.buffer[i+3]=r}}shift(e,t,n,r){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=r,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,r,4);else{let i=e,{parser:a}=this.p;(r>this.pos||t<=a.maxNode)&&(this.pos=r,a.stateFlag(i,1)||(this.reducePos=r)),this.pushState(i,n),this.shiftContext(t,n),t<=a.maxNode&&this.buffer.push(t,n,r,4)}}apply(e,t,n,r){e&65536?this.reduce(e):this.shift(e,t,n,r)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(n,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let t=this,n=t.buffer.length;for(;n>0&&t.buffer[n-2]>t.reducePos;)n-=4;let r=t.buffer.slice(n),i=t.bufferBase+n;for(;t&&i==t.bufferBase;)t=t.parent;return new e(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,t)}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 HF(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(n==0)return!1;if(!(n&65536))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 r=0,i;r<t.length;r+=2)(i=t[r+1])!=this.state&&this.p.parser.hasAction(i,e)&&n.push(t[r],i);if(this.stack.length<120)for(let e=0;n.length<8&&e<t.length;e+=2){let r=t[e+1];n.some((e,t)=>t&1&&e==r)||n.push(t[e],r)}t=n}let n=[];for(let e=0;e<t.length&&n.length<4;e+=2){let r=t[e+1];if(r==this.state)continue;let i=this.split();i.pushState(r,this.pos),i.storeNode(0,i.pos,i.pos,4,!0),i.shiftContext(t[e],this.pos),i.reducePos=this.pos,i.score-=200,n.push(i)}return n}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if(!(t&65536))return!1;if(!e.validAction(this.state,t)){let n=t>>19,r=t&65535,i=this.stack.length-n*3;if(i<0||e.getGoto(this.stack[i],r,!1)<0){let e=this.findForcedReduction();if(e==null)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=(r,i)=>{if(!t.includes(r))return t.push(r),e.allActions(r,t=>{if(!(t&393216))if(t&65536){let n=(t>>19)-i;if(n>1){let r=t&65535,i=this.stack.length-n*3;if(i>=0&&e.getGoto(this.stack[i],r,!1)>=0)return n<<19|65536|r}}else{let e=n(t,i+1);if(e!=null)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(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new VF(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){e>this.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}},VF=class{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}},HF=class{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,n=e>>19;n==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(n-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}},UF=class e{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(t,n=t.bufferBase+t.buffer.length){return new e(t,n,n-t.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new e(this.stack,this.pos,this.index)}};function WF(e,t=Uint16Array){if(typeof e!=`string`)return e;let n=null;for(let r=0,i=0;r<e.length;){let a=0;for(;;){let t=e.charCodeAt(r++),n=!1;if(t==126){a=65535;break}t>=92&&t--,t>=34&&t--;let i=t-32;if(i>=46&&(i-=46,n=!0),a+=i,n)break;a*=46}n?n[i++]=a:n=new t(a)}return n}var GF=class{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}},KF=new GF,qF=class{constructor(e,t){this.input=e,this.ranges=t,this.chunk=``,this.chunkOff=0,this.chunk2=``,this.chunk2Pos=0,this.next=-1,this.token=KF,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,r=this.rangeIndex,i=this.pos+e;for(;i<n.from;){if(!r)return null;let e=this.ranges[--r];i-=n.from-e.to,n=e}for(;t<0?i>n.to:i>=n.to;){if(r==this.ranges.length-1)return null;let e=this.ranges[++r];i+=e.from-n.to,n=e}return i}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,r;if(t>=0&&t<this.chunk.length)n=this.pos+e,r=this.chunk.charCodeAt(t);else{let t=this.resolveOffset(e,1);if(t==null)return-1;if(n=t,n>=this.chunk2Pos&&n<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(n-this.chunk2Pos);else{let e=this.rangeIndex,t=this.range;for(;t.to<=n;)t=this.ranges[++e];this.chunk2=this.input.chunk(this.chunk2Pos=n),n+this.chunk2.length>t.to&&(this.chunk2=this.chunk2.slice(0,t.to-n)),r=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),r}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(n==null||n<this.token.start)throw RangeError(`Token end out of bounds`);this.token.value=e,this.token.end=n}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk=``,this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=KF,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk=``,this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n=``;for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(n+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return n}},JF=class{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;XF(this.data,e,t,this.id,n.data,n.tokenPrecTable)}};JF.prototype.contextual=JF.prototype.fallback=JF.prototype.extend=!1;var YF=class{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data=typeof e==`string`?WF(e):e}token(e,t){let n=e.pos,r=0;for(;;){let n=e.next<0,i=e.resolveOffset(1,1);if(XF(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(n||r++,i==null)break;e.reset(i,e.token)}r&&(e.reset(n,e.token),e.acceptToken(this.elseToken,r))}};YF.prototype.contextual=JF.prototype.fallback=JF.prototype.extend=!1;function XF(e,t,n,r,i,a){let o=0,s=1<<r,{dialect:c}=n.p.parser;scan:for(;(s&e[o])!=0;){let n=e[o+1];for(let r=o+3;r<n;r+=2)if((e[r+1]&s)>0){let n=e[r];if(c.allows(n)&&(t.token.value==-1||t.token.value==n||QF(n,t.token.value,i,a))){t.acceptToken(n);break}}let r=t.next,l=0,u=e[o+2];if(t.next<0&&u>l&&e[n+u*3-3]==65535){o=e[n+u*3-1];continue scan}for(;l<u;){let i=l+u>>1,a=n+i+(i<<1),s=e[a],c=e[a+1]||65536;if(r<s)u=i;else if(r>=c)l=i+1;else{o=e[a+2],t.advance();continue scan}}break}}function ZF(e,t,n){for(let r=t,i;(i=e[r])!=65535;r++)if(i==n)return r-t;return-1}function QF(e,t,n,r){let i=ZF(n,r,t);return i<0||ZF(n,r,e)<i}var $F=typeof process<`u`&&/\bparse\b/.test({}.LOG),eI=null;function tI(e,t,n){let r=e.cursor(Yk.IncludeAnonymous);for(r.moveTo(t);;)if(!(n<0?r.childBefore(t):r.childAfter(t)))for(;;){if((n<0?r.to<t:r.from>t)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,t-25)):Math.min(e.length,Math.max(r.from+1,t+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:e.length}}var nI=class{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?tI(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?tI(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let n=this.trees[t],r=this.index[t];if(r==n.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let i=n.children[r],a=this.start[t]+n.positions[r];if(a>e)return this.nextStart=a,null;if(i instanceof Xk){if(a==e){if(a<this.safeFrom)return null;let e=a+i.length;if(e<=this.safeTo){let t=i.prop(Hk.lookAhead);if(!t||e+t<this.fragment.to)return i}}this.index[t]++,a+i.length>=Math.max(this.safeFrom,e)&&(this.trees.push(i),this.start.push(a),this.index.push(0))}else this.index[t]++,this.nextStart=a+i.length}}},rI=class{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(e=>new GF)}getActions(e){let t=0,n=null,{parser:r}=e.p,{tokenizers:i}=r,a=r.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,s=0;for(let r=0;r<i.length;r++){if(!(1<<r&a))continue;let c=i[r],l=this.tokens[r];if(!(n&&!c.fallback)&&((c.contextual||l.start!=e.pos||l.mask!=a||l.context!=o)&&(this.updateCachedToken(l,c,e),l.mask=a,l.context=o),l.lookAhead>l.end+25&&(s=Math.max(l.lookAhead,s)),l.value!=0)){let r=t;if(l.extended>-1&&(t=this.addActions(e,l.extended,l.end,t)),t=this.addActions(e,l.value,l.end,t),!c.extend&&(n=l,t>r))break}}for(;this.actions.length>t;)this.actions.pop();return s&&e.setLookAhead(s),!n&&e.pos==this.stream.end&&(n=new GF,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 GF,{pos:n,p:r}=e;return t.start=n,t.end=Math.min(n+1,r.stream.end),t.value=n==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,n){let r=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(r,e),n),e.value>-1){let{parser:t}=n.p;for(let r=0;r<t.specialized.length;r++)if(t.specialized[r]==e.value){let i=t.specializers[r](this.stream.read(e.start,e.end),n);if(i>=0&&n.p.parser.dialect.allows(i>>1)){i&1?e.extended=i>>1:e.value=i>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,n,r){for(let t=0;t<r;t+=3)if(this.actions[t]==e)return r;return this.actions[r++]=e,this.actions[r++]=t,this.actions[r++]=n,r}addActions(e,t,n,r){let{state:i}=e,{parser:a}=e.p,{data:o}=a;for(let e=0;e<2;e++)for(let s=a.stateSlot(i,e?2:1);;s+=3){if(o[s]==65535)if(o[s+1]==1)s=cI(o,s+2);else{r==0&&o[s+1]==2&&(r=this.putAction(cI(o,s+2),t,n,r));break}o[s]==t&&(r=this.putAction(cI(o,s+1),t,n,r))}return r}},iI=class{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new qF(t,r),this.tokens=new rI(e,this.stream),this.topTerm=e.top[1];let{from:i}=r[0];this.stacks=[BF.start(this,e.top[0],i)],this.fragments=n.length&&this.stream.end-i>e.bufferLength*4?new nI(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,n=this.stacks=[],r,i;if(this.bigReductionCount>300&&e.length==1){let[t]=e;for(;t.forceReduce()&&t.stack.length&&t.stack[t.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let a=0;a<e.length;a++){let o=e[a];for(;;){if(this.tokens.mainToken=null,o.pos>t)n.push(o);else if(this.advanceStack(o,n,e))continue;else{r||(r=[],i=[]),r.push(o);let e=this.tokens.getMainToken(o);i.push(e.value,e.end)}break}}if(!n.length){let e=r&&lI(r);if(e)return $F&&console.log(`Finish with `+this.stackID(e)),this.stackToTree(e);if(this.parser.strict)throw $F&&r&&console.log(`Stuck with token `+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):`none`)),SyntaxError(`No parse at `+t);this.recovering||=5}if(this.recovering&&r){let e=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,i,n);if(e)return $F&&console.log(`Force-finish `+this.stackID(e)),this.stackToTree(e.forceAll())}if(this.recovering){let e=this.recovering==1?1:this.recovering*3;if(n.length>e)for(n.sort((e,t)=>t.score-e.score);n.length>e;)n.pop();n.some(e=>e.reducePos>t)&&this.recovering--}else if(n.length>1){outer:for(let e=0;e<n.length-1;e++){let t=n[e];for(let r=e+1;r<n.length;r++){let i=n[r];if(t.sameState(i)||t.buffer.length>500&&i.buffer.length>500)if((t.score-i.score||t.buffer.length-i.buffer.length)>0)n.splice(r--,1);else{n.splice(e--,1);continue outer}}}n.length>12&&n.splice(12,n.length-12)}this.minStackPos=n[0].pos;for(let e=1;e<n.length;e++)n[e].pos<this.minStackPos&&(this.minStackPos=n[e].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw RangeError(`Can't move stoppedAt forward`);this.stoppedAt=e}advanceStack(e,t,n){let r=e.pos,{parser:i}=this,a=$F?this.stackID(e)+` -> `:``;if(this.stoppedAt!=null&&r>this.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 o=this.fragments.nodeAt(r);o;){let r=this.parser.nodeSet.types[o.type.id]==o.type?i.getGoto(e.state,o.type.id):-1;if(r>-1&&o.length&&(!t||(o.prop(Hk.contextHash)||0)==n))return e.useNode(o,r),$F&&console.log(a+this.stackID(e)+` (via reuse of ${i.getName(o.type.id)})`),!0;if(!(o instanceof Xk)||o.children.length==0||o.positions[0]>0)break;let s=o.children[0];if(s instanceof Xk&&o.positions[0]==0)o=s;else break}}let o=i.stateSlot(e.state,4);if(o>0)return e.reduce(o),$F&&console.log(a+this.stackID(e)+` (via always-reduce ${i.getName(o&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let s=this.tokens.getActions(e);for(let o=0;o<s.length;){let c=s[o++],l=s[o++],u=s[o++],d=o==s.length||!n,f=d?e:e.split(),p=this.tokens.mainToken;if(f.apply(c,l,p?p.start:f.pos,u),$F&&console.log(a+this.stackID(f)+` (via ${c&65536?`reduce of ${i.getName(c&65535)}`:`shift`} for ${i.getName(l)} @ ${r}${f==e?``:`, split`})`),d)return!0;f.pos>r?t.push(f):n.push(f)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return aI(e,t),!0}}runRecovery(e,t,n){let r=null,i=!1;for(let a=0;a<e.length;a++){let o=e[a],s=t[a<<1],c=t[(a<<1)+1],l=$F?this.stackID(o)+` -> `:``;if(o.deadEnd&&(i||(i=!0,o.restart(),$F&&console.log(l+this.stackID(o)+` (restarted)`),this.advanceFully(o,n))))continue;let u=o.split(),d=l;for(let e=0;u.forceReduce()&&e<10&&($F&&console.log(d+this.stackID(u)+` (via force-reduce)`),!this.advanceFully(u,n));e++)$F&&(d=this.stackID(u)+` -> `);for(let e of o.recoverByInsert(s))$F&&console.log(l+this.stackID(e)+` (via recover-insert)`),this.advanceFully(e,n);this.stream.end>o.pos?(c==o.pos&&(c++,s=0),o.recoverByDelete(s,c),$F&&console.log(l+this.stackID(o)+` (via recover-delete ${this.parser.getName(s)})`),aI(o,n)):(!r||r.score<o.score)&&(r=o)}return r}stackToTree(e){return e.close(),Xk.build({buffer:UF.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(eI||=new WeakMap).get(e);return t||eI.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}};function aI(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(r.pos==e.pos&&r.sameState(e)){t[n].score<e.score&&(t[n]=e);return}}t.push(e)}var oI=class{constructor(e,t,n){this.source=e,this.flags=t,this.disabled=n}allows(e){return!this.disabled||this.disabled[e]==0}},sI=class e extends _A{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(` `);this.minRepeatTerm=t.length;for(let n=0;n<e.repeatNodeCount;n++)t.push(``);let n=Object.keys(e.topRules).map(t=>e.topRules[t][1]),r=[];for(let e=0;e<t.length;e++)r.push([]);function i(e,t,n){r[e].push([t,t.deserialize(String(n))])}if(e.nodeProps)for(let t of e.nodeProps){let e=t[0];typeof e==`string`&&(e=Hk[e]);for(let n=1;n<t.length;){let r=t[n++];if(r>=0)i(r,e,t[n++]);else{let a=t[n+-r];for(let o=-r;o>0;o--)i(t[n++],e,a);n++}}}this.nodeSet=new Kk(t.map((t,i)=>Gk.define({name:i>=this.minRepeatTerm?void 0:t,id:i,props:r[i],top:n.indexOf(i)>-1,error:i==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(i)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=zk;let a=WF(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let e=0;e<this.specializerSpecs.length;e++)this.specialized[e]=this.specializerSpecs[e].term;this.specializers=this.specializerSpecs.map(uI),this.states=WF(e.states,Uint32Array),this.data=WF(e.stateData),this.goto=WF(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(e=>typeof e==`number`?new JF(a,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 r=new iI(this,e,t,n);for(let i of this.wrappers)r=i(r,e,t,n);return r}getGoto(e,t,n=!1){let r=this.goto;if(t>=r[0])return-1;for(let i=r[t+1];;){let t=r[i++],a=t&1,o=r[i++];if(a&&n)return o;for(let n=i+(t>>1);i<n;i++)if(r[i]==e)return o;if(a)return-1}}hasAction(e,t){let n=this.data;for(let r=0;r<2;r++)for(let i=this.stateSlot(e,r?2:1),a;;i+=3){if((a=n[i])==65535)if(n[i+1]==1)a=n[i=cI(n,i+2)];else if(n[i+1]==2)return cI(n,i+2);else break;if(a==t||a==0)return cI(n,i+1)}return 0}stateSlot(e,t){return this.states[e*6+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,e=>e==t?!0:null)}allActions(e,t){let n=this.stateSlot(e,4),r=n?t(n):void 0;for(let n=this.stateSlot(e,1);r==null;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=cI(this.data,n+2);else break;r=t(cI(this.data,n+1))}return r}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=cI(this.data,n+2);else break;if(!(this.data[n+2]&1)){let e=this.data[n+1];t.some((t,n)=>n&1&&t==e)||t.push(this.data[n],e)}}return t}configure(t){let n=Object.assign(Object.create(e.prototype),this);if(t.props&&(n.nodeSet=this.nodeSet.extend(...t.props)),t.top){let e=this.topRules[t.top];if(!e)throw RangeError(`Invalid top rule name ${t.top}`);n.top=e}return t.tokenizers&&(n.tokenizers=this.tokenizers.map(e=>{let n=t.tokenizers.find(t=>t.from==e);return n?n.to:e})),t.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((e,r)=>{let i=t.specializers.find(t=>t.from==e.external);if(!i)return e;let a=Object.assign(Object.assign({},e),{external:i.to});return n.specializers[r]=uI(a),a})),t.contextTracker&&(n.context=t.contextTracker),t.dialect&&(n.dialect=this.parseDialect(t.dialect)),t.strict!=null&&(n.strict=t.strict),t.wrap&&(n.wrappers=n.wrappers.concat(t.wrap)),t.bufferLength!=null&&(n.bufferLength=t.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let r of e.split(` `)){let e=t.indexOf(r);e>=0&&(n[e]=!0)}let r=null;for(let e=0;e<t.length;e++)if(!n[e])for(let n=this.dialects[t[e]],i;(i=this.data[n++])!=65535;)(r||=new Uint8Array(this.maxTerm+1))[i]=1;return new oI(e,n,r)}static deserialize(t){return new e(t)}};function cI(e,t){return e[t]|e[t+1]<<16}function lI(e){let t=null;for(let n of e){let e=n.p.stoppedAt;(n.pos==n.p.stream.end||e!=null&&n.pos>e)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.score<n.score)&&(t=n)}return t}function uI(e){if(e.external){let t=+!!e.extend;return(n,r)=>e.external(n,r)<<1|t}return e.get}var dI=TA({String:JA.string,Number:JA.number,"True False":JA.bool,PropertyName:JA.propertyName,Null:JA.null,", :":JA.separator,"[ ]":JA.squareBracket,"{ }":JA.brace}),fI=sI.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:`#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O`,goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:`⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array`,maxTerm:25,nodeProps:[[`isolate`,-2,6,11,``],[`openedBy`,7,`{`,14,`[`],[`closedBy`,8,`}`,15,`]`]],propSources:[dI],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),pI=ej.define({name:`json`,parser:fI.configure({props:[yj.add({Object:kj({except:/^\s*\}/}),Array:kj({except:/^\s*\]/})}),Nj.add({"Object Array":Pj})]}),languageData:{closeBrackets:{brackets:[`[`,`{`,`"`]},indentOnInput:/^\s*[\}\]]$/}});function mI(){return new fj(pI)}var hI=typeof String.prototype.normalize==`function`?e=>e.normalize(`NFKD`):e=>e,gI=class{constructor(e,t,n=0,r=e.length,i,a){this.test=a,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer=``,this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=i?e=>i(hI(e)):hI,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 ex(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=tx(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=nx(e);let r=this.normalize(t);if(r.length)for(let e=0,i=n;;e++){let a=r.charCodeAt(e),o=this.match(a,i,this.bufferPos+this.bufferStart);if(e==r.length-1){if(o)return this.value=o,this;break}i==n&&e<t.length&&t.charCodeAt(e)==a&&i++}}}match(e,t,n){let r=null;for(let t=0;t<this.matches.length;t+=2){let i=this.matches[t],a=!1;this.query.charCodeAt(i)==e&&(i==this.query.length-1?r={from:this.matches[t+1],to:n}:(this.matches[t]++,a=!0)),a||(this.matches.splice(t,2),t-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?r={from:t,to:n}:this.matches.push(1,t)),r&&this.test&&!this.test(r.from,r.to,this.buffer,this.bufferStart)&&(r=null),r}};typeof Symbol<`u`&&(gI.prototype[Symbol.iterator]=function(){return this});var _I={from:-1,to:-1,match:/.*/.exec(``)},vI=`gm`+(/x/.unicode==null?``:`u`),yI=class{constructor(e,t,n,r=0,i=e.length){if(this.text=e,this.to=i,this.curLine=``,this.done=!1,this.value=_I,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new SI(e,t,n,r,i);this.re=new RegExp(t,vI+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.iter=e.iter();let a=e.lineAt(r);this.curLineStart=a.from,this.matchPos=CI(e,r),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine=``:(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine=``:this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=CI(this.text,r+ +(n==r)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}},bI=new WeakMap,xI=class e{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(t,n,r){let i=bI.get(t);if(!i||i.from>=r||i.to<=n){let i=new e(n,t.sliceString(n,r));return bI.set(t,i),i}if(i.from==n&&i.to==r)return i;let{text:a,from:o}=i;return o>n&&(a=t.sliceString(n,o)+a,o=n),i.to<r&&(a+=t.sliceString(i.to,r)),bI.set(t,new e(o,a)),new e(n,a.slice(n-o,r-o))}},SI=class{constructor(e,t,n,r,i){this.text=e,this.to=i,this.done=!1,this.value=_I,this.matchPos=CI(e,r),this.re=new RegExp(t,vI+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.flat=xI.get(e,r,this.chunkEnd(r+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let 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=CI(this.text,n+ +(e==n)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=xI.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}};typeof Symbol<`u`&&(yI.prototype[Symbol.iterator]=SI.prototype[Symbol.iterator]=function(){return this});function oee(e){try{return new RegExp(e,vI),!0}catch{return!1}}function CI(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}function wI(e){let t=XP(`input`,{class:`cm-textfield`,name:`line`,value:String(e.state.doc.lineAt(e.state.selection.main.head).number)}),n=XP(`form`,{class:`cm-gotoLine`,onkeydown:t=>{t.keyCode==27?(t.preventDefault(),e.dispatch({effects:TI.of(!1)}),e.focus()):t.keyCode==13&&(t.preventDefault(),r())},onsubmit:e=>{e.preventDefault(),r()}},XP(`label`,e.state.phrase(`Go to line`),`: `,t),` `,XP(`button`,{class:`cm-button`,type:`submit`},e.state.phrase(`go`)),XP(`button`,{name:`close`,onclick:()=>{e.dispatch({effects:TI.of(!1)}),e.focus()},"aria-label":e.state.phrase(`close`),type:`button`},[`×`]));function r(){let n=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!n)return;let{state:r}=e,i=r.doc.lineAt(r.selection.main.head),[,a,o,s,c]=n,l=s?+s.slice(1):0,u=o?+o:i.number;if(o&&c){let e=u/100;a&&(e=e*(a==`-`?-1:1)+i.number/r.doc.lines),u=Math.round(r.doc.lines*e)}else o&&a&&(u=u*(a==`-`?-1:1)+i.number);let d=r.doc.line(Math.max(1,Math.min(r.doc.lines,u))),f=L.cursor(d.from+Math.max(0,Math.min(l,d.length)));e.dispatch({effects:[TI.of(!1),OD.scrollIntoView(f.from,{y:`center`})],selection:f}),e.focus()}return{dom:n}}var TI=Wx.define(),EI=Cx.define({create(){return!0},update(e,t){for(let n of t.effects)n.is(TI)&&(e=n.value);return e},provide:e=>fk.from(e,e=>e?wI:null)}),DI=e=>{let t=ck(e,wI);if(!t){let n=[TI.of(!0)];e.state.field(EI,!1)??n.push(Wx.appendConfig.of([EI,OI])),e.dispatch({effects:n}),t=ck(e,wI)}return t&&t.dom.querySelector(`input`).select(),!0},OI=OD.baseTheme({".cm-panel.cm-gotoLine":{padding:`2px 6px 4px`,position:`relative`,"& label":{fontSize:`80%`},"& [name=close]":{position:`absolute`,top:`0`,bottom:`0`,right:`4px`,backgroundColor:`inherit`,border:`none`,font:`inherit`,padding:`0`}}}),kI={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},AI=gx.define({combine(e){return oS(e,kI,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function jI(e){let t=[LI,II];return e&&t.push(AI.of(e)),t}var MI=JC.mark({class:`cm-selectionMatch`}),NI=JC.mark({class:`cm-selectionMatch cm-selectionMatch-main`});function PI(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=eS.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=eS.Word)}function FI(e,t,n,r){return e(t.sliceDoc(n,n+1))==eS.Word&&e(t.sliceDoc(r-1,r))==eS.Word}var II=Yw.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(AI),{state:n}=e,r=n.selection;if(r.ranges.length>1)return JC.none;let i=r.main,a,o=null;if(i.empty){if(!t.highlightWordAroundCursor)return JC.none;let e=n.wordAt(i.head);if(!e)return JC.none;o=n.charCategorizer(i.head),a=n.sliceDoc(e.from,e.to)}else{let e=i.to-i.from;if(e<t.minSelectionLength||e>200)return JC.none;if(t.wholeWords){if(a=n.sliceDoc(i.from,i.to),o=n.charCategorizer(i.head),!(PI(o,n,i.from,i.to)&&FI(o,n,i.from,i.to)))return JC.none}else if(a=n.sliceDoc(i.from,i.to),!a)return JC.none}let s=[];for(let r of e.visibleRanges){let e=new gI(n.doc,a,r.from,r.to);for(;!e.next().done;){let{from:r,to:a}=e.value;if((!o||PI(o,n,r,a))&&(i.empty&&r<=i.from&&a>=i.to?s.push(NI.range(r,a)):(r>=i.to||a<=i.from)&&s.push(MI.range(r,a)),s.length>t.maxMatches))return JC.none}}return JC.set(s)}},{decorations:e=>e.decorations}),LI=OD.baseTheme({".cm-selectionMatch":{backgroundColor:`#99ff7780`},".cm-searchMatch .cm-selectionMatch":{backgroundColor:`transparent`}}),RI=({state:e,dispatch:t})=>{let{selection:n}=e,r=L.create(n.ranges.map(t=>e.wordAt(t.head)||L.cursor(t.head)),n.mainIndex);return r.eq(n)?!1:(t(e.update({selection:r})),!0)};function zI(e,t){let{main:n,ranges:r}=e.selection,i=e.wordAt(n.head),a=i&&i.from==n.from&&i.to==n.to;for(let n=!1,i=new gI(e.doc,t,r[r.length-1].to);;)if(i.next(),i.done){if(n)return null;i=new gI(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),n=!0}else{if(n&&r.some(e=>e.from==i.value.from))continue;if(a){let t=e.wordAt(i.value.from);if(!t||t.from!=i.value.from||t.to!=i.value.to)continue}return i.value}}var BI=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return RI({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=r))return!1;let i=zI(e,r);return i?(t(e.update({selection:e.selection.addRange(L.range(i.from,i.to),!1),effects:OD.scrollIntoView(i.to)})),!0):!1},VI=gx.define({combine(e){return oS(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new bL(e),scrollToMatch:e=>OD.scrollIntoView(e)})}});function HI(e){return e?[VI.of(e),EL]:EL}var UI=class{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||oee(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>t==`n`?`
|
|
43
|
-
`:t==`r`?`\r`: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 QI(this):new qI(this)}getCursor(e,t=0,n){let r=e.doc?e:aS.create({doc:e});return n??=r.doc.length,this.regexp?JI(this,r,t,n):GI(this,r,t,n)}},WI=class{constructor(e){this.spec=e}};function GI(e,t,n,r){return new gI(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:e=>e.toLowerCase(),e.wholeWord?KI(t.doc,t.charCategorizer(t.selection.main.head)):void 0)}function KI(e,t){return(n,r,i,a)=>((a>n||a+i.length<r)&&(a=Math.max(0,n-2),i=e.sliceString(a,Math.min(e.length,r+2))),(t(YI(i,n-a))!=eS.Word||t(XI(i,n-a))!=eS.Word)&&(t(XI(i,r-a))!=eS.Word||t(YI(i,r-a))!=eS.Word))}var qI=class extends WI{constructor(e){super(e)}nextMatch(e,t,n){let r=GI(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);r=GI(this.spec,e,0,n).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==n?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let n=Math.max(t,r-1e4-this.spec.unquoted.length),i=GI(this.spec,e,n,r),a=null;for(;!i.nextOverlapping().done;)a=i.value;if(a)return a;if(n==t)return null;r-=1e4}}prevMatch(e,t,n){let r=this.prevMatchInRange(e,0,t);return r||=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length),r&&(r.from!=t||r.to!=n)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=GI(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=GI(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}};function JI(e,t,n,r){return new yI(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:e.wholeWord?ZI(t.charCategorizer(t.selection.main.head)):void 0},n,r)}function YI(e,t){return e.slice(Zb(e,t,!1),t)}function XI(e,t){return e.slice(t,Zb(e,t))}function ZI(e){return(t,n,r)=>!r[0].length||(e(YI(r.input,r.index))!=eS.Word||e(XI(r.input,r.index))!=eS.Word)&&(e(XI(r.input,r.index+r[0].length))!=eS.Word||e(YI(r.input,r.index+r[0].length))!=eS.Word)}var QI=class extends WI{nextMatch(e,t,n){let r=JI(this.spec,e,n,e.doc.length).next();return r.done&&(r=JI(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let i=Math.max(t,n-r*1e4),a=JI(this.spec,e,i,n),o=null;for(;!a.next().done;)o=a.value;if(o&&(i==t||o.from>i+10))return o;if(i==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)=>{if(n==`&`)return e.match[0];if(n==`$`)return`$`;for(let t=n.length;t>0;t--){let r=+n.slice(0,t);if(r>0&&r<e.match.length)return e.match[r]+n.slice(t)}return t})}matchAll(e,t){let n=JI(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=JI(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}},$I=Wx.define(),eL=Wx.define(),tL=Cx.define({create(e){return new nL(mL(e).create(),null)},update(e,t){for(let n of t.effects)n.is($I)?e=new nL(n.value.create(),e.panel):n.is(eL)&&(e=new nL(e.query,n.value?pL:null));return e},provide:e=>fk.from(e,e=>e.panel)}),nL=class{constructor(e,t){this.query=e,this.panel=t}},rL=JC.mark({class:`cm-searchMatch`}),iL=JC.mark({class:`cm-searchMatch cm-searchMatch-selected`}),aL=Yw.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(tL))}update(e){let t=e.state.field(tL);(t!=e.startState.field(tL)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return JC.none;let{view:n}=this,r=new pS;for(let t=0,i=n.visibleRanges,a=i.length;t<a;t++){let{from:o,to:s}=i[t];for(;t<a-1&&s>i[t+1].from-500;)s=i[++t].to;e.highlight(n.state,o,s,(e,t)=>{let i=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);r.add(e,t,i?iL:rL)})}return r.finish()}},{decorations:e=>e.decorations});function oL(e){return t=>{let n=t.state.field(tL,!1);return n&&n.query.spec.valid?e(t,n):_L(t)}}var sL=oL((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let i=L.single(r.from,r.to),a=e.state.facet(VI);return e.dispatch({selection:i,effects:[wL(e,r),a.scrollToMatch(i.main,e)],userEvent:`select.search`}),gL(e),!0}),cL=oL((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n,r,r);if(!i)return!1;let a=L.single(i.from,i.to),o=e.state.facet(VI);return e.dispatch({selection:a,effects:[wL(e,i),o.scrollToMatch(a.main,e)],userEvent:`select.search`}),gL(e),!0}),lL=oL((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:L.create(n.map(e=>L.range(e.from,e.to))),userEvent:`select.search.matches`}),!0)}),uL=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,a=[],o=0;for(let t=new gI(e.doc,e.sliceDoc(r,i));!t.next().done;){if(a.length>1e3)return!1;t.value.from==r&&(o=a.length),a.push(L.range(t.value.from,t.value.to))}return t(e.update({selection:L.create(a,o),userEvent:`select.search.matches`})),!0},dL=oL((e,{query:t})=>{let{state:n}=e,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let a=t.nextMatch(n,r,r);if(!a)return!1;let o=a,s=[],c,l,u=[];if(o.from==r&&o.to==i&&(l=n.toText(t.getReplacement(o)),s.push({from:o.from,to:o.to,insert:l}),o=t.nextMatch(n,o.from,o.to),u.push(OD.announce.of(n.phrase(`replaced match on line $`,n.doc.lineAt(r).number)+`.`))),o){let t=s.length==0||s[0].from>=a.to?0:a.to-a.from-l.length;c=L.single(o.from-t,o.to-t),u.push(wL(e,o)),u.push(n.facet(VI).scrollToMatch(c.main,e))}return e.dispatch({changes:s,selection:c,effects:u,userEvent:`input.replace`}),!0}),fL=oL((e,{query:t})=>{if(e.state.readOnly)return!1;let n=t.matchAll(e.state,1e9).map(e=>{let{from:n,to:r}=e;return{from:n,to:r,insert:t.getReplacement(e)}});if(!n.length)return!1;let r=e.state.phrase(`replaced $ matches`,n.length)+`.`;return e.dispatch({changes:n,effects:OD.announce.of(r),userEvent:`input.replace.all`}),!0});function pL(e){return e.state.facet(VI).createPanel(e)}function mL(e,t){let n=e.selection.main,r=n.empty||n.to>n.from+100?``:e.sliceDoc(n.from,n.to);if(t&&!r)return t;let i=e.facet(VI);return new UI({search:t?.literal??i.literal?r:r.replace(/\n/g,`\\n`),caseSensitive:t?.caseSensitive??i.caseSensitive,literal:t?.literal??i.literal,regexp:t?.regexp??i.regexp,wholeWord:t?.wholeWord??i.wholeWord})}function hL(e){let t=ck(e,pL);return t&&t.dom.querySelector(`[main-field]`)}function gL(e){let t=hL(e);t&&t==e.root.activeElement&&t.select()}var _L=e=>{let t=e.state.field(tL,!1);if(t&&t.panel){let n=hL(e);if(n&&n!=e.root.activeElement){let r=mL(e.state,t.query.spec);r.valid&&e.dispatch({effects:$I.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[eL.of(!0),t?$I.of(mL(e.state,t.query.spec)):Wx.appendConfig.of(EL)]});return!0},vL=e=>{let t=e.state.field(tL,!1);if(!t||!t.panel)return!1;let n=ck(e,pL);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:eL.of(!1)}),!0},yL=[{key:`Mod-f`,run:_L,scope:`editor search-panel`},{key:`F3`,run:sL,shift:cL,scope:`editor search-panel`,preventDefault:!0},{key:`Mod-g`,run:sL,shift:cL,scope:`editor search-panel`,preventDefault:!0},{key:`Escape`,run:vL,scope:`editor search-panel`},{key:`Mod-Shift-l`,run:uL},{key:`Mod-Alt-g`,run:DI},{key:`Mod-d`,run:BI,preventDefault:!0}],bL=class{constructor(e){this.view=e;let t=this.query=e.state.field(tL).query.spec;this.commit=this.commit.bind(this),this.searchField=XP(`input`,{value:t.search,placeholder:xL(e,`Find`),"aria-label":xL(e,`Find`),class:`cm-textfield`,name:`search`,form:``,"main-field":`true`,onchange:this.commit,onkeyup:this.commit}),this.replaceField=XP(`input`,{value:t.replace,placeholder:xL(e,`Replace`),"aria-label":xL(e,`Replace`),class:`cm-textfield`,name:`replace`,form:``,onchange:this.commit,onkeyup:this.commit}),this.caseField=XP(`input`,{type:`checkbox`,name:`case`,form:``,checked:t.caseSensitive,onchange:this.commit}),this.reField=XP(`input`,{type:`checkbox`,name:`re`,form:``,checked:t.regexp,onchange:this.commit}),this.wordField=XP(`input`,{type:`checkbox`,name:`word`,form:``,checked:t.wholeWord,onchange:this.commit});function n(e,t,n){return XP(`button`,{class:`cm-button`,name:e,onclick:t,type:`button`},n)}this.dom=XP(`div`,{onkeydown:e=>this.keydown(e),class:`cm-search`},[this.searchField,n(`next`,()=>sL(e),[xL(e,`next`)]),n(`prev`,()=>cL(e),[xL(e,`previous`)]),n(`select`,()=>lL(e),[xL(e,`all`)]),XP(`label`,null,[this.caseField,xL(e,`match case`)]),XP(`label`,null,[this.reField,xL(e,`regexp`)]),XP(`label`,null,[this.wordField,xL(e,`by word`)]),...e.state.readOnly?[]:[XP(`br`),this.replaceField,n(`replace`,()=>dL(e),[xL(e,`replace`)]),n(`replaceAll`,()=>fL(e),[xL(e,`replace all`)])],XP(`button`,{name:`close`,onclick:()=>vL(e),"aria-label":xL(e,`close`),type:`button`},[`×`])])}commit(){let e=new UI({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:$I.of(e)}))}keydown(e){BD(this.view,e,`search-panel`)?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?cL:sL)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),dL(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is($I)&&!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(VI).top}};function xL(e,t){return e.state.phrase(t)}var SL=30,CL=/[\s\.,:;?!]/;function wL(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),i=e.state.doc.lineAt(n).to,a=Math.max(r.from,t-SL),o=Math.min(i,n+SL),s=e.state.sliceDoc(a,o);if(a!=r.from){for(let e=0;e<SL;e++)if(!CL.test(s[e+1])&&CL.test(s[e])){s=s.slice(e);break}}if(o!=i){for(let e=s.length-1;e>s.length-SL;e--)if(!CL.test(s[e-1])&&CL.test(s[e])){s=s.slice(0,e);break}}return OD.announce.of(`${e.state.phrase(`current match`)}. ${s} ${e.state.phrase(`on line`)} ${r.number}.`)}var TL=OD.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`}}),EL=[tL,Ex.low(aL),TL],DL=class{constructor(e,t,n,r){this.state=e,this.pos=t,this.explicit=n,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=tj(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),r=t.text.slice(n-t.from,this.pos-t.from),i=r.search(NL(e,!1));return i<0?null:{from:n+i,to:this.pos,text:r.slice(i)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,n){e==`abort`&&this.abortListeners&&(this.abortListeners.push(t),n&&n.onDocChange&&(this.abortOnDocChange=!0))}};function OL(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 kL(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<r.length;e++)n[r[e]]=!0}let r=OL(t)+OL(n)+`*$`;return[RegExp(`^`+r),new RegExp(r)]}function AL(e){let t=e.map(e=>typeof e==`string`?{label:e}:e),[n,r]=t.every(e=>/^\w+$/.test(e.label))?[/\w*$/,/\w+$/]:kL(t);return e=>{let i=e.matchBefore(r);return i||e.explicit?{from:i?i.from:e.pos,options:t,validFor:n}:null}}var jL=class{constructor(e,t,n,r){this.completion=e,this.source=t,this.match=n,this.score=r}};function ML(e){return e.selection.main.from}function NL(e,t){let{source:n}=e,r=t&&n[0]!=`^`,i=n[n.length-1]!=`$`;return!r&&!i?e:RegExp(`${r?`^`:``}(?:${n})${i?`$`:``}`,e.flags??(e.ignoreCase?`i`:``))}var PL=Vx.define();function FL(e,t,n,r){let{main:i}=e.selection,a=n-i.from,o=r-i.from;return Object.assign(Object.assign({},e.changeByRange(s=>{if(s!=i&&n!=r&&e.sliceDoc(s.from+a,s.from+o)!=e.sliceDoc(n,r))return{range:s};let c=e.toText(t);return{changes:{from:s.from+a,to:r==i.from?s.to:s.from+o,insert:c},range:L.cursor(s.from+a+c.length)}})),{scrollIntoView:!0,userEvent:`input.complete`})}var IL=new WeakMap;function LL(e){if(!Array.isArray(e))return e;let t=IL.get(e);return t||IL.set(e,t=AL(e)),t}var RL=Wx.define(),zL=Wx.define(),BL=class{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let n=ex(e,t),r=nx(n);this.chars.push(n);let i=e.slice(t,t+r),a=i.toUpperCase();this.folded.push(ex(a==i?i.toLowerCase():a,0)),t+=r}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:n,any:r,precise:i,byWord:a}=this;if(t.length==1){let r=ex(e,0),i=nx(r),a=i==e.length?0:-100;if(r!=t[0])if(r==n[0])a+=-200;else return null;return this.ret(a,[0,i])}let o=e.indexOf(this.pattern);if(o==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let s=t.length,c=0;if(o<0){for(let i=0,a=Math.min(e.length,200);i<a&&c<s;){let a=ex(e,i);(a==t[c]||a==n[c])&&(r[c++]=i),i+=nx(a)}if(c<s)return null}let l=0,u=0,d=!1,f=0,p=-1,m=-1,h=/[a-z]/.test(e),g=!0;for(let r=0,c=Math.min(e.length,200),_=0;r<c&&u<s;){let c=ex(e,r);o<0&&(l<s&&c==t[l]&&(i[l++]=r),f<s&&(c==t[f]||c==n[f]?(f==0&&(p=r),m=r+1,f++):f=0));let v,y=c<255?c>=48&&c<=57||c>=97&&c<=122?2:+(c>=65&&c<=90):(v=tx(c))==v.toLowerCase()?v==v.toUpperCase()?0:2:1;(!r||y==1&&h||_==0&&y!=0)&&(t[u]==c||n[u]==c&&(d=!0)?a[u++]=r:a.length&&(g=!1)),_=y,r+=nx(c)}return u==s&&a[0]==0&&g?this.result(-100+(d?-200:0),a,e):f==s&&p==0?this.ret(-200-e.length+(m==e.length?0:-100),[0,m]):o>-1?this.ret(-700-e.length,[o,o+this.pattern.length]):f==s?this.ret(-900-e.length,[p,m]):u==s?this.result(-100+(d?-200:0)+-700+(g?0:-1100),a,e):t.length==2?null:this.result((r[0]?-700:0)+-200+-1100,r,e)}result(e,t,n){let r=[],i=0;for(let e of t){let t=e+(this.astral?nx(ex(n,e)):1);i&&r[i-1]==e?r[i-1]=t:(r[i++]=e,r[i++]=t)}return this.ret(e-n.length,r)}},VL=class{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),n=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return n==null?null:(this.matched=[0,t.length],this.score=n+(e.length==this.pattern.length?0:-100),this)}},HL=gx.define({combine(e){return oS(e,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>``,optionClass:()=>``,aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:WL,filterStrict:!1,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=>UL(e(n),t(n)),optionClass:(e,t)=>n=>UL(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function UL(e,t){return e?t?e+` `+t:e:t}function WL(e,t,n,r,i,a){let o=e.textDirection==sw.RTL,s=o,c=!1,l=`top`,u,d,f=t.left-i.left,p=i.right-t.right,m=r.right-r.left,h=r.bottom-r.top;if(s&&f<Math.min(m,p)?s=!1:!s&&p<Math.min(m,f)&&(s=!0),m<=(s?f:p))u=Math.max(i.top,Math.min(n.top,i.bottom-h))-t.top,d=Math.min(400,s?f:p);else{c=!0,d=Math.min(400,(o?t.right:i.right-t.left)-30);let e=i.bottom-t.bottom;e>=h||e>t.top?u=n.bottom-t.top:(l=`bottom`,u=t.bottom-n.top)}let g=(t.bottom-t.top)/a.offsetHeight,_=(t.right-t.left)/a.offsetWidth;return{style:`${l}: ${u/g}px; max-width: ${d/_}px`,class:`cm-completionInfo-`+(c?o?`left-narrow`:`right-narrow`:s?`left`:`right`)}}function GL(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,r){let i=document.createElement(`span`);i.className=`cm-completionLabel`;let a=e.displayLabel||e.label,o=0;for(let e=0;e<r.length;){let t=r[e++],n=r[e++];t>o&&i.appendChild(document.createTextNode(a.slice(o,t)));let s=i.appendChild(document.createElement(`span`));s.appendChild(document.createTextNode(a.slice(t,n))),s.className=`cm-completionMatchedText`,o=n}return o<a.length&&i.appendChild(document.createTextNode(a.slice(o))),i},position:50},{render(e){if(!e.detail)return null;let t=document.createElement(`span`);return t.className=`cm-completionDetail`,t.textContent=e.detail,t},position:80}),t.sort((e,t)=>e.position-t.position).map(e=>e.render)}function KL(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 r=Math.floor((e-t)/n);return{from:e-(r+1)*n,to:e-r*n}}var qL=class{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 r=e.state.field(t),{options:i,selected:a}=r.open,o=e.state.facet(HL);this.optionContent=GL(o),this.optionClass=o.optionClass,this.tooltipClass=o.tooltipClass,this.range=KL(i.length,a,o.maxRenderedOptions),this.dom=document.createElement(`div`),this.dom.className=`cm-tooltip-autocomplete`,this.updateTooltipClass(e.state),this.dom.addEventListener(`mousedown`,n=>{let{options:r}=e.state.field(t).open;for(let t=n.target,i;t&&t!=this.dom;t=t.parentNode)if(t.nodeName==`LI`&&(i=/-(\d+)$/.exec(t.id))&&+i[1]<r.length){this.applyCompletion(e,r[+i[1]]),n.preventDefault();return}}),this.dom.addEventListener(`focusout`,t=>{let n=e.state.field(this.stateField,!1);n&&n.tooltip&&e.state.facet(HL).closeOnBlur&&t.relatedTarget!=e.contentDOM&&e.dispatch({effects:zL.of(null)})}),this.showOptions(i,r.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener(`scroll`,()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){let t=e.state.field(this.stateField),n=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),t!=n){let{options:r,selected:i,disabled:a}=t.open;(!n.open||n.open.options!=r)&&(this.range=KL(r.length,i,e.state.facet(HL).maxRenderedOptions),this.showOptions(r,t.id)),this.updateSel(),a!=n.open?.disabled&&this.dom.classList.toggle(`cm-tooltip-autocomplete-disabled`,!!a)}}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.from||t.selected>=this.range.to)&&(this.range=KL(t.options.length,t.selected,this.view.state.facet(HL).maxRenderedOptions),this.showOptions(t.options,e.id)),this.updateSelectedOption(t.selected)){this.destroyInfo();let{completion:n}=t.options[t.selected],{info:r}=n;if(!r)return;let i=typeof r==`string`?document.createTextNode(r):r(n);if(!i)return;`then`in i?i.then(t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t,n)}).catch(e=>Gw(this.view.state,e,`completion info`)):this.addInfoPane(i,n)}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement(`div`);if(n.className=`cm-tooltip cm-completionInfo`,e.nodeType!=null)n.appendChild(e),this.infoDestroy=null;else{let{dom:t,destroy:r}=e;n.appendChild(t),this.infoDestroy=r||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let n=this.list.firstChild,r=this.range.from;n;n=n.nextSibling,r++)n.nodeName!=`LI`||!n.id?r--:r==e?n.hasAttribute(`aria-selected`)||(n.setAttribute(`aria-selected`,`true`),t=n):n.hasAttribute(`aria-selected`)&&n.removeAttribute(`aria-selected`);return t&&YL(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(),r=e.getBoundingClientRect(),i=this.space;if(!i){let e=this.dom.ownerDocument.documentElement;i={left:0,top:0,right:e.clientWidth,bottom:e.clientHeight}}return r.top>Math.min(i.bottom,t.bottom)-10||r.bottom<Math.max(i.top,t.top)+10?null:this.view.state.facet(HL).positionInfo(this.view,t,r,n,i,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className=`cm-tooltip cm-completionInfo `+(e.class||``)):this.info.style.cssText=`top: -1e6px`)}createListBox(e,t,n){let r=document.createElement(`ul`);r.id=t,r.setAttribute(`role`,`listbox`),r.setAttribute(`aria-expanded`,`true`),r.setAttribute(`aria-label`,this.view.state.phrase(`Completions`)),r.addEventListener(`mousedown`,e=>{e.target==r&&e.preventDefault()});let i=null;for(let a=n.from;a<n.to;a++){let{completion:o,match:s}=e[a],{section:c}=o;if(c){let e=typeof c==`string`?c:c.name;if(e!=i&&(a>n.from||n.from==0))if(i=e,typeof c!=`string`&&c.header)r.appendChild(c.header(c));else{let t=r.appendChild(document.createElement(`completion-section`));t.textContent=e}}let l=r.appendChild(document.createElement(`li`));l.id=t+`-`+a,l.setAttribute(`role`,`option`);let u=this.optionClass(o);u&&(l.className=u);for(let e of this.optionContent){let t=e(o,this.view.state,this.view,s);t&&l.appendChild(t)}}return n.from&&r.classList.add(`cm-completionListIncompleteTop`),n.to<e.length&&r.classList.add(`cm-completionListIncompleteBottom`),r}destroyInfo(){this.info&&=(this.infoDestroy&&this.infoDestroy(),this.info.remove(),null)}destroy(){this.destroyInfo()}};function JL(e,t){return n=>new qL(n,e,t)}function YL(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=n.height/e.offsetHeight;r.top<n.top?e.scrollTop-=(n.top-r.top)/i:r.bottom>n.bottom&&(e.scrollTop+=(r.bottom-n.bottom)/i)}function XL(e){return(e.boost||0)*100+(e.apply?10:0)+(e.info?5:0)+ +!!e.type}function ZL(e,t){let n=[],r=null,i=e=>{n.push(e);let{section:t}=e.completion;if(t){r||=[];let e=typeof t==`string`?t:t.name;r.some(t=>t.name==e)||r.push(typeof t==`string`?{name:e}:t)}},a=t.facet(HL);for(let r of e)if(r.hasResult()){let e=r.result.getMatch;if(r.result.filter===!1)for(let t of r.result.options)i(new jL(t,r.source,e?e(t):[],1e9-n.length));else{let n=t.sliceDoc(r.from,r.to),o,s=a.filterStrict?new VL(n):new BL(n);for(let t of r.result.options)if(o=s.match(t.label)){let n=t.displayLabel?e?e(t,o.matched):[]:o.matched;i(new jL(t,r.source,n,o.score+(t.boost||0)))}}}if(r){let e=Object.create(null),t=0,i=(e,t)=>(e.rank??1e9)-(t.rank??1e9)||(e.name<t.name?-1:1);for(let n of r.sort(i))t-=1e5,e[n.name]=t;for(let t of n){let{section:n}=t.completion;n&&(t.score+=e[typeof n==`string`?n:n.name])}}let o=[],s=null,c=a.compareCompletions;for(let e of n.sort((e,t)=>t.score-e.score||c(e.completion,t.completion))){let t=e.completion;!s||s.label!=t.label||s.detail!=t.detail||s.type!=null&&t.type!=null&&s.type!=t.type||s.apply!=t.apply||s.boost!=t.boost?o.push(e):XL(e.completion)>XL(s)&&(o[o.length-1]=e),s=e.completion}return o}var QL=class e{constructor(e,t,n,r,i,a){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=r,this.selected=i,this.disabled=a}setSelected(t,n){return t==this.selected||t>=this.options.length?this:new e(this.options,rR(n,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,n,r,i,a,o){if(i&&!o&&t.some(e=>e.isPending))return i.setDisabled();let s=ZL(t,n);if(!s.length)return i&&t.some(e=>e.isPending)?i.setDisabled():null;let c=n.facet(HL).selectOnOpen?0:-1;if(i&&i.selected!=c&&i.selected!=-1){let e=i.options[i.selected].completion;for(let t=0;t<s.length;t++)if(s[t].completion==e){c=t;break}}return new e(s,rR(r,c),{pos:t.reduce((e,t)=>t.hasResult()?Math.min(e,t.from):e,1e8),create:pR,above:a.aboveCursor},i?i.timestamp:Date.now(),c,!1)}map(t){return new e(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:t.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}setDisabled(){return new e(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}},$L=class e{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new e(iR,`cm-ac-`+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:n}=t,r=n.facet(HL),i=(r.override||n.languageDataAt(`autocomplete`,ML(n)).map(LL)).map(e=>(this.active.find(t=>t.source==e)||new oR(e,+!!this.active.some(e=>e.state!=0))).update(t,r));i.length==this.active.length&&i.every((e,t)=>e==this.active[t])&&(i=this.active);let a=this.open,o=t.effects.some(e=>e.is(lR));a&&t.docChanged&&(a=a.map(t.changes)),t.selection||i.some(e=>e.hasResult()&&t.changes.touchesRange(e.from,e.to))||!eR(i,this.active)||o?a=QL.build(i,n,this.id,a,r,o):a&&a.disabled&&!i.some(e=>e.isPending)&&(a=null),!a&&i.every(e=>!e.isPending)&&i.some(e=>e.hasResult())&&(i=i.map(e=>e.hasResult()?new oR(e.source,0):e));for(let e of t.effects)e.is(uR)&&(a&&=a.setSelected(e.value,this.id));return i==this.active&&a==this.open?this:new e(i,this.id,a)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?tR:nR}};function eR(e,t){if(e==t)return!0;for(let n=0,r=0;;){for(;n<e.length&&!e[n].hasResult();)n++;for(;r<t.length&&!t[r].hasResult();)r++;let i=n==e.length,a=r==t.length;if(i||a)return i==a;if(e[n++].result!=t[r++].result)return!1}}var tR={"aria-autocomplete":`list`},nR={};function rR(e,t){let n={"aria-autocomplete":`list`,"aria-haspopup":`listbox`,"aria-controls":e};return t>-1&&(n[`aria-activedescendant`]=e+`-`+t),n}var iR=[];function aR(e,t){if(e.isUserEvent(`input.complete`)){let n=e.annotation(PL);if(n&&t.activateOnCompletion(n))return 12}let n=e.isUserEvent(`input.type`);return n&&t.activateOnTyping?5:n?1:e.isUserEvent(`delete.backward`)?2:e.selection?8:e.docChanged?16:0}var oR=class e{constructor(e,t,n=!1){this.source=e,this.state=t,this.explicit=n}hasResult(){return!1}get isPending(){return this.state==1}update(t,n){let r=aR(t,n),i=this;(r&8||r&16&&this.touches(t))&&(i=new e(i.source,0)),r&4&&i.state==0&&(i=new e(this.source,1)),i=i.updateFor(t,r);for(let n of t.effects)if(n.is(RL))i=new e(i.source,1,n.value);else if(n.is(zL))i=new e(i.source,0);else if(n.is(lR))for(let e of n.value)e.source==i.source&&(i=e);return i}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(ML(e.state))}},sR=class e extends oR{constructor(e,t,n,r,i,a){super(e,3,t),this.limit=n,this.result=r,this.from=i,this.to=a}hasResult(){return!0}updateFor(t,n){if(!(n&3))return this.map(t.changes);let r=this.result;r.map&&!t.changes.empty&&(r=r.map(r,t.changes));let i=t.changes.mapPos(this.from),a=t.changes.mapPos(this.to,1),o=ML(t.state);if(o>a||!r||n&2&&(ML(t.startState)==this.from||o<this.limit))return new oR(this.source,n&4?1:0);let s=t.changes.mapPos(this.limit);return cR(r.validFor,t.state,i,a)?new e(this.source,this.explicit,s,r,i,a):r.update&&(r=r.update(r,i,a,new DL(t.state,o,!1)))?new e(this.source,this.explicit,s,r,r.from,r.to??ML(t.state)):new oR(this.source,1,this.explicit)}map(t){return t.empty?this:(this.result.map?this.result.map(this.result,t):this.result)?new e(this.source,this.explicit,t.mapPos(this.limit),this.result,t.mapPos(this.from),t.mapPos(this.to,1)):new oR(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}};function cR(e,t,n,r){if(!e)return!1;let i=t.sliceDoc(n,r);return typeof e==`function`?e(i,n,r,t):NL(e,!0).test(i)}var lR=Wx.define({map(e,t){return e.map(e=>e.map(t))}}),uR=Wx.define(),dR=Cx.define({create(){return $L.start()},update(e,t){return e.update(t)},provide:e=>[XO.from(e,e=>e.tooltip),OD.contentAttributes.from(e,e=>e.attrs)]});function fR(e,t){let n=t.completion.apply||t.completion.label,r=e.state.field(dR).active.find(e=>e.source==t.source);return r instanceof sR?(typeof n==`string`?e.dispatch(Object.assign(Object.assign({},FL(e.state,n,r.from,r.to)),{annotations:PL.of(t.completion)})):n(e,t.completion,r.from,r.to),!0):!1}var pR=JL(dR,fR);function mR(e,t=`option`){return n=>{let r=n.state.field(dR,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<n.state.facet(HL).interactionDelay)return!1;let i=1,a;t==`page`&&(a=ak(n,r.open.tooltip))&&(i=Math.max(2,Math.floor(a.dom.offsetHeight/a.dom.querySelector(`li`).offsetHeight)-1));let{length:o}=r.open.options,s=r.open.selected>-1?r.open.selected+i*(e?1:-1):e?0:o-1;return s<0?s=t==`page`?0:o-1:s>=o&&(s=t==`page`?o-1:0),n.dispatch({effects:uR.of(s)}),!0}}var hR=e=>{let t=e.state.field(dR,!1);return e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(HL).interactionDelay?!1:fR(e,t.open.options[t.open.selected])},gR=e=>e.state.field(dR,!1)?(e.dispatch({effects:RL.of(!0)}),!0):!1,_R=e=>{let t=e.state.field(dR,!1);return!t||!t.active.some(e=>e.state!=0)?!1:(e.dispatch({effects:zL.of(null)}),!0)},vR=class{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}},yR=50,bR=1e3,xR=Yw.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of e.state.field(dR).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(dR),n=e.state.facet(HL);if(!e.selectionSet&&!e.docChanged&&e.startState.field(dR)==t)return;let r=e.transactions.some(e=>{let t=aR(e,n);return t&8||(e.selection||e.docChanged)&&!(t&3)});for(let t=0;t<this.running.length;t++){let n=this.running[t];if(r||n.context.abortOnDocChange&&e.docChanged||n.updates.length+e.transactions.length>yR&&Date.now()-n.time>bR){for(let e of n.context.abortListeners)try{e()}catch(e){Gw(this.view.state,e)}n.context.abortListeners=null,this.running.splice(t--,1)}else n.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(e=>e.effects.some(e=>e.is(RL)))&&(this.pendingStart=!0);let i=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(e=>e.isPending&&!this.running.some(t=>t.active.source==e.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let t of e.transactions)t.isUserEvent(`input.type`)?this.composing=2:this.composing==2&&t.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(dR);for(let e of t.active)e.isPending&&!this.running.some(t=>t.active.source==e.source)&&this.startQuery(e);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(HL).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=new DL(t,ML(t),e.explicit,this.view),r=new vR(e,n);this.running.push(r),Promise.resolve(e.source(n)).then(e=>{r.context.aborted||(r.done=e||null,this.scheduleAccept())},e=>{this.view.dispatch({effects:zL.of(null)}),Gw(this.view.state,e)})}scheduleAccept(){this.running.every(e=>e.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(HL).updateSyncTime))}accept(){this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(HL),n=this.view.state.field(dR);for(let r=0;r<this.running.length;r++){let i=this.running[r];if(i.done===void 0)continue;if(this.running.splice(r--,1),i.done){let n=ML(i.updates.length?i.updates[0].startState:this.view.state),r=Math.min(n,i.done.from+ +!i.active.explicit),a=new sR(i.active.source,i.active.explicit,r,i.done,i.done.from,i.done.to??n);for(let e of i.updates)a=a.update(e,t);if(a.hasResult()){e.push(a);continue}}let a=n.active.find(e=>e.source==i.active.source);if(a&&a.isPending)if(i.done==null){let n=new oR(i.active.source,0);for(let e of i.updates)n=n.update(e,t);n.isPending||e.push(n)}else this.startQuery(a)}(e.length||n.open&&n.open.disabled)&&this.view.dispatch({effects:lR.of(e)})}},{eventHandlers:{blur(e){let t=this.view.state.field(dR,!1);if(t&&t.tooltip&&this.view.state.facet(HL).closeOnBlur){let n=t.open&&ak(this.view,t.open.tooltip);(!n||!n.dom.contains(e.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:zL.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:RL.of(!1)}),20),this.composing=0}}}),SR=typeof navigator==`object`&&/Win/.test(navigator.platform),CR=Ex.highest(OD.domEventHandlers({keydown(e,t){let n=t.state.field(dR,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(SR&&e.altKey)||e.metaKey)return!1;let r=n.open.options[n.open.selected],i=n.active.find(e=>e.source==r.source),a=r.completion.commitCharacters||i.result.commitCharacters;return a&&a.indexOf(e.key)>-1&&fR(t,r),!1}})),wR=OD.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:`monospace`,whiteSpace:`nowrap`,overflow:`hidden auto`,maxWidth_fallback:`700px`,maxWidth:`min(700px, 95vw)`,minWidth:`250px`,maxHeight:`10em`,height:`100%`,listStyle:`none`,margin:0,padding:0,"& > li, & > completion-section":{padding:`1px 3px`,lineHeight:1.2},"& > li":{overflowX:`hidden`,textOverflow:`ellipsis`,cursor:`pointer`},"& > completion-section":{display:`list-item`,borderBottom:`1px solid silver`,paddingLeft:`0.5em`,opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:`#17c`,color:`white`},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:`#777`},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:`#347`,color:`white`},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:`#444`},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:`"···"`,opacity:.5,display:`block`,textAlign:`center`},".cm-tooltip.cm-completionInfo":{position:`absolute`,padding:`3px 9px`,width:`max-content`,maxWidth:`400px`,boxSizing:`border-box`,whiteSpace:`pre-line`},".cm-completionInfo.cm-completionInfo-left":{right:`100%`},".cm-completionInfo.cm-completionInfo-right":{left:`100%`},".cm-completionInfo.cm-completionInfo-left-narrow":{right:`30px`},".cm-completionInfo.cm-completionInfo-right-narrow":{left:`30px`},"&light .cm-snippetField":{backgroundColor:`#00000022`},"&dark .cm-snippetField":{backgroundColor:`#ffffff22`},".cm-snippetFieldPosition":{verticalAlign:`text-top`,width:0,height:`1.15em`,display:`inline-block`,margin:`0 -0.7px -.7em`,borderLeft:`1.4px dotted #888`},".cm-completionMatchedText":{textDecoration:`underline`},".cm-completionDetail":{marginLeft:`0.5em`,fontStyle:`italic`},".cm-completionIcon":{fontSize:`90%`,width:`.8em`,display:`inline-block`,textAlign:`center`,paddingRight:`.6em`,opacity:`0.6`,boxSizing:`content-box`},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:`'ƒ'`}},".cm-completionIcon-class":{"&:after":{content:`'○'`}},".cm-completionIcon-interface":{"&:after":{content:`'◌'`}},".cm-completionIcon-variable":{"&:after":{content:`'𝑥'`}},".cm-completionIcon-constant":{"&:after":{content:`'𝐶'`}},".cm-completionIcon-type":{"&:after":{content:`'𝑡'`}},".cm-completionIcon-enum":{"&:after":{content:`'∪'`}},".cm-completionIcon-property":{"&:after":{content:`'□'`}},".cm-completionIcon-keyword":{"&:after":{content:`'🔑︎'`}},".cm-completionIcon-namespace":{"&:after":{content:`'▢'`}},".cm-completionIcon-text":{"&:after":{content:`'abc'`,fontSize:`50%`,verticalAlign:`middle`}}}),TR={brackets:[`(`,`[`,`{`,`'`,`"`],before:`)]}:;>`,stringPrefixes:[]},ER=Wx.define({map(e,t){return t.mapPos(e,-1,ix.TrackAfter)??void 0}}),DR=new class extends sS{};DR.startSide=1,DR.endSide=-1;var OR=Cx.define({create(){return dS.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(ER)&&(e=e.update({add:[DR.range(n.value,n.value+1)]}));return e}});function kR(){return[PR,OR]}var AR=`()[]{}<>«»»«[]{}`;function jR(e){for(let t=0;t<16;t+=2)if(AR.charCodeAt(t)==e)return AR.charAt(t+1);return tx(e<128?e:e+1)}function MR(e,t){return e.languageDataAt(`closeBrackets`,t)[0]||TR}var NR=typeof navigator==`object`&&/Android\b/.test(navigator.userAgent),PR=OD.inputHandler.of((e,t,n,r)=>{if((NR?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let i=e.state.selection.main;if(r.length>2||r.length==2&&nx(ex(r,0))==1||t!=i.from||n!=i.to)return!1;let a=IR(e.state,r);return a?(e.dispatch(a),!0):!1}),FR=[{key:`Backspace`,run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=MR(e,e.selection.main.head).brackets||TR.brackets,r=null,i=e.changeByRange(t=>{if(t.empty){let r=zR(e.doc,t.head);for(let i of n)if(i==r&&RR(e.doc,t.head)==jR(ex(i,0)))return{changes:{from:t.head-i.length,to:t.head+i.length},range:L.cursor(t.head-i.length)}}return{range:r=t}});return r||t(e.update(i,{scrollIntoView:!0,userEvent:`delete.backward`})),!r}}];function IR(e,t){let n=MR(e,e.selection.main.head),r=n.brackets||TR.brackets;for(let i of r){let a=jR(ex(i,0));if(t==i)return a==i?HR(e,i,r.indexOf(i+i+i)>-1,n):BR(e,i,a,n.before||TR.before);if(t==a&&LR(e,e.selection.main.from))return VR(e,i,a)}return null}function LR(e,t){let n=!1;return e.field(OR).between(0,e.doc.length,e=>{e==t&&(n=!0)}),n}function RR(e,t){let n=e.sliceString(t,t+2);return n.slice(0,nx(ex(n,0)))}function zR(e,t){let n=e.sliceString(t-2,t);return nx(ex(n,0))==n.length?n:n.slice(1)}function BR(e,t,n,r){let i=null,a=e.changeByRange(a=>{if(!a.empty)return{changes:[{insert:t,from:a.from},{insert:n,from:a.to}],effects:ER.of(a.to+t.length),range:L.range(a.anchor+t.length,a.head+t.length)};let o=RR(e.doc,a.head);return!o||/\s/.test(o)||r.indexOf(o)>-1?{changes:{insert:t+n,from:a.head},effects:ER.of(a.head+t.length),range:L.cursor(a.head+t.length)}:{range:i=a}});return i?null:e.update(a,{scrollIntoView:!0,userEvent:`input.type`})}function VR(e,t,n){let r=null,i=e.changeByRange(t=>t.empty&&RR(e.doc,t.head)==n?{changes:{from:t.head,to:t.head+n.length,insert:n},range:L.cursor(t.head+n.length)}:r={range:t});return r?null:e.update(i,{scrollIntoView:!0,userEvent:`input.type`})}function HR(e,t,n,r){let i=r.stringPrefixes||TR.stringPrefixes,a=null,o=e.changeByRange(r=>{if(!r.empty)return{changes:[{insert:t,from:r.from},{insert:t,from:r.to}],effects:ER.of(r.to+t.length),range:L.range(r.anchor+t.length,r.head+t.length)};let o=r.head,s=RR(e.doc,o),c;if(s==t){if(UR(e,o))return{changes:{insert:t+t,from:o},effects:ER.of(o+t.length),range:L.cursor(o+t.length)};if(LR(e,o)){let r=n&&e.sliceDoc(o,o+t.length*3)==t+t+t?t+t+t:t;return{changes:{from:o,to:o+r.length,insert:r},range:L.cursor(o+r.length)}}}else if(n&&e.sliceDoc(o-2*t.length,o)==t+t&&(c=GR(e,o-2*t.length,i))>-1&&UR(e,c))return{changes:{insert:t+t+t+t,from:o},effects:ER.of(o+t.length),range:L.cursor(o+t.length)};else if(e.charCategorizer(o)(s)!=eS.Word&&GR(e,o,i)>-1&&!WR(e,o,t,i))return{changes:{insert:t+t,from:o},effects:ER.of(o+t.length),range:L.cursor(o+t.length)};return{range:a=r}});return a?null:e.update(o,{scrollIntoView:!0,userEvent:`input.type`})}function UR(e,t){let n=tj(e).resolveInner(t+1);return n.parent&&n.from==t}function WR(e,t,n,r){let i=tj(e).resolveInner(t,-1),a=r.reduce((e,t)=>Math.max(e,t.length),0);for(let o=0;o<5;o++){let o=e.sliceDoc(i.from,Math.min(i.to,i.from+n.length+a)),s=o.indexOf(n);if(!s||s>-1&&r.indexOf(o.slice(0,s))>-1){let t=i.firstChild;for(;t&&t.from==i.from&&t.to-t.from>n.length+s;){if(e.sliceDoc(t.to-n.length,t.to)==n)return!1;t=t.firstChild}return!0}let c=i.to==t&&i.parent;if(!c)break;i=c}return!1}function GR(e,t,n){let r=e.charCategorizer(t);if(r(e.sliceDoc(t-1,t))!=eS.Word)return t;for(let i of n){let n=t-i.length;if(e.sliceDoc(n,t)==i&&r(e.sliceDoc(n-1,n))!=eS.Word)return n}return-1}function KR(e={}){return[CR,dR,HL.of(e),xR,JR,wR]}var qR=[{key:`Ctrl-Space`,run:gR},{mac:"Alt-`",run:gR},{key:`Escape`,run:_R},{key:`ArrowDown`,run:mR(!0)},{key:`ArrowUp`,run:mR(!1)},{key:`PageDown`,run:mR(!0,`page`)},{key:`PageUp`,run:mR(!1,`page`)},{key:`Enter`,run:hR}],JR=Ex.highest(LD.computeN([HL],e=>e.facet(HL).defaultKeymap?[qR]:[]));function YR(e,t=e.state){let n=new Set;for(let{from:r,to:i}of e.visibleRanges){let e=r;for(;e<=i;){let r=t.doc.lineAt(e);n.has(r)||n.add(r),e=r.to+1}}return n}function XR(e){let t=e.selection.main.head;return e.doc.lineAt(t)}function ZR(e,t){let n=0;loop:for(let r=0;r<e.length;r++)switch(e[r]){case` `:case`\xA0`:n+=1;continue loop;case` `:n+=t-n%t;continue loop;case`\r`:continue loop;default:break loop}return n}var QR=gx.define({combine(e){return oS(e,{highlightActiveBlock:!0,hideFirstIndent:!1,markerType:`fullScope`,thickness:1})}}),$R=class{constructor(e,t,n,r){this.lines=e,this.state=t,this.map=new Map,this.unitWidth=n,this.markerType=r;for(let e of this.lines)this.add(e);this.state.facet(QR).highlightActiveBlock&&this.findAndSetActiveLines()}has(e){return this.map.has(typeof e==`number`?e:e.number)}get(e){let t=this.map.get(typeof e==`number`?e:e.number);if(!t)throw Error(`Line not found in indentation map`);return t}set(e,t,n){let r={line:e,col:t,level:n,empty:!e.text.trim().length};return this.map.set(r.line.number,r),r}add(e){if(this.has(e))return this.get(e);if(!e.length||!e.text.trim().length){if(e.number===1)return this.set(e,0,0);if(e.number===this.state.doc.lines){let t=this.closestNonEmpty(e,-1);return this.set(e,0,t.level)}let t=this.closestNonEmpty(e,-1),n=this.closestNonEmpty(e,1);return t.level>=n.level&&this.markerType!==`codeOnly`?this.set(e,0,t.level):t.empty&&t.level===0&&n.level!==0?this.set(e,0,0):n.level>t.level?this.set(e,0,t.level+1):this.set(e,0,n.level)}let t=ZR(e.text,this.state.tabSize),n=Math.floor(t/this.unitWidth);return this.set(e,t,n)}closestNonEmpty(e,t){let n=e.number+t;for(;t===-1?n>=1:n<=this.state.doc.lines;){if(this.has(n)){let e=this.get(n);if(!e.empty)return e}let e=this.state.doc.line(n);if(e.text.trim().length){let t=ZR(e.text,this.state.tabSize),n=Math.floor(t/this.unitWidth);return this.set(e,t,n)}n+=t}let r=this.state.doc.line(t===-1?1:this.state.doc.lines);return this.set(r,0,0)}findAndSetActiveLines(){let e=XR(this.state);if(!this.has(e))return;let t=this.get(e);if(this.has(t.line.number+1)){let e=this.get(t.line.number+1);e.level>t.level&&(t=e)}if(this.has(t.line.number-1)){let e=this.get(t.line.number-1);e.level>t.level&&(t=e)}if(t.level===0)return;t.active=t.level;let n,r;for(n=t.line.number;n>1;n--){if(!this.has(n-1))continue;let e=this.get(n-1);if(e.level<t.level)break;e.active=t.level}for(r=t.line.number;r<this.state.doc.lines;r++){if(!this.has(r+1))continue;let e=this.get(r+1);if(e.level<t.level)break;e.active=t.level}}};function ez(e){let t={light:`#F0F1F2`,dark:`#2B3245`,activeLight:`#E4E5E6`,activeDark:`#3C445C`},n=t;return e&&(n=Object.assign(Object.assign({},t),e)),OD.baseTheme({"&light":{"--indent-marker-bg-color":n.light,"--indent-marker-active-bg-color":n.activeLight},"&dark":{"--indent-marker-bg-color":n.dark,"--indent-marker-active-bg-color":n.activeDark},".cm-line":{position:`relative`},".cm-indent-markers::before":{content:`""`,position:`absolute`,top:0,left:`2px`,right:0,bottom:0,background:`var(--indent-markers)`,pointerEvents:`none`,zIndex:`-1`}})}function tz(e,t,n,r,i){return`${`repeating-linear-gradient(to right, var(${e}) 0 ${t}px, transparent ${t}px ${n}ch)`} ${r*n}.5ch/calc(${n*i}ch - 1px) no-repeat`}function nz(e,t,n,r,i){let{level:a,active:o}=e;if(i??=r,n&&a===0)return[];let s=+!!n,c=[];if(o!==void 0){let e=o-s-1;e>0&&c.push(tz(`--indent-marker-bg-color`,r,t,s,e)),c.push(tz(`--indent-marker-active-bg-color`,i,t,o-1,1)),o!==a&&c.push(tz(`--indent-marker-bg-color`,r,t,o,a-o))}else c.push(tz(`--indent-marker-bg-color`,r,t,s,a-s));return c.join(`,`)}var rz=class{constructor(e){this.view=e,this.unitWidth=hj(e.state),this.currentLineNumber=XR(e.state).number,this.generate(e.state)}update(e){let t=hj(e.state),n=t!==this.unitWidth;n&&(this.unitWidth=t);let r=XR(e.state).number,i=r!==this.currentLineNumber;this.currentLineNumber=r;let a=e.state.facet(QR).highlightActiveBlock&&i;(e.docChanged||e.viewportChanged||n||a)&&this.generate(e.state)}generate(e){let t=new pS,n=YR(this.view,e),{hideFirstIndent:r,markerType:i,thickness:a,activeThickness:o}=e.facet(QR),s=new $R(n,e,this.unitWidth,i);for(let e of n){let n=s.get(e.number);if(!n?.level)continue;let i=nz(n,this.unitWidth,r,a,o);t.add(e.from,e.from,JC.line({class:`cm-indent-markers`,attributes:{style:`--indent-markers: ${i}`}}))}this.decorations=t.finish()}};function iz(e={}){return[QR.of(e),ez(e.colors),Yw.fromClass(rz,{decorations:e=>e.decorations})]}var az,oz,sz,cz=[`mainAxis`,`crossAxis`,`fallbackPlacements`,`fallbackStrategy`,`fallbackAxisSideDirection`,`flipAlignment`],lz=[`mainAxis`,`crossAxis`,`limiter`];function uz(e,t){if(e==null)return{};var n,r,i=function(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function dz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function R(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?dz(Object(n),!0).forEach(function(t){yz(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dz(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function fz(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function pz(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){fz(a,r,i,o,s,`next`,e)}function s(e){fz(a,r,i,o,s,`throw`,e)}o(void 0)})}}function mz(e,t){gz(e,t),t.add(e)}function hz(e,t,n){gz(e,t),t.set(e,n)}function gz(e,t){if(t.has(e))throw TypeError(`Cannot initialize the same private elements twice on an object`)}function _z(e,t,n){return e.set(vz(e,t),n),n}function z(e,t){return e.get(vz(e,t))}function vz(e,t,n){if(typeof e==`function`?e===t:e.has(t))return arguments.length<3?t:n;throw TypeError(`Private element is not present on this object`)}function yz(e,t,n){return(t=function(e){var t=function(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}(e,`string`);return typeof t==`symbol`?t:t+``}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var bz,xz;typeof window<`u`&&((bz=(xz=window).__svelte??(xz.__svelte={})).v??(bz.v=new Set)).add(`5`);var Sz=!1;Sz=!0;var Cz=Symbol(),wz=`http://www.w3.org/1999/xhtml`,Tz=Array.isArray,Ez=Array.prototype.indexOf,Dz=Array.prototype.includes,Oz=Array.from,kz=Object.defineProperty,Az=Object.getOwnPropertyDescriptor,jz=Object.getOwnPropertyDescriptors,Mz=Object.prototype,Nz=Array.prototype,Pz=Object.getPrototypeOf,Fz=Object.isExtensible;function Iz(e){return typeof e==`function`}var Lz=()=>{};function Rz(e){return e()}function zz(e){for(var t=0;t<e.length;t++)e[t]()}function Bz(){var e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}var Vz=1<<24,Hz=16,Uz=32,Wz=64,Gz=512,Kz=1024,qz=2048,Jz=4096,Yz=8192,Xz=16384,Zz=32768,Qz=1<<25,$z=65536,eB=1<<17,tB=1<<19,nB=1<<25,rB=65536,iB=1<<21,aB=1<<23,oB=Symbol(`$state`),sB=Symbol(`legacy props`),cB=Symbol(``),lB=new class extends Error{constructor(){super(...arguments),yz(this,`name`,`StaleReactionError`),yz(this,`message`,"The reaction that called `getAbortSignal()` was re-run or destroyed")}},uB=!((az=globalThis.document)==null||!az.contentType)&&globalThis.document.contentType.includes(`xml`);function dB(e){throw Error(`https://svelte.dev/e/lifecycle_outside_component`)}function fB(e){return e===this.v}function pB(e,t){return e==e?e!==t||typeof e==`object`&&!!e||typeof e==`function`:t==t}function mB(e){return!pB(e,this.v)}var hB=null;function gB(e){hB=e}function _B(e){return xB().get(e)}function vB(e){hB={p:hB,i:!1,c:null,e:null,s:e,x:null,r:JH,l:Sz&&!(arguments.length>1&&arguments[1]!==void 0&&arguments[1])?{s:null,u:null,$:[]}:null}}function yB(e){var t=hB,n=t.e;if(n!==null)for(var r of(t.e=null,n))TH(r);return e!==void 0&&(t.x=e),t.i=!0,hB=t.p,e??{}}function bB(){return!Sz||hB!==null&&hB.l===null}function xB(e){var t;return hB===null&&dB(),(t=hB).c??(t.c=new Map(function(e){for(var t=e.p;t!==null;){var n=t.c;if(n!==null)return n;t=t.p}return null}(hB)||void 0))}var SB=[];function CB(){var e=SB;SB=[],zz(e)}function wB(e){if(SB.length===0&&!RB){var t=SB;queueMicrotask(()=>{t===SB&&CB()})}SB.push(e)}function TB(){for(;SB.length>0;)CB()}function EB(e){var t=JH;if(t===null)return GH.f|=aB,e;if((t.f&Zz)===0&&!(4&t.f))throw e;DB(e,t)}function DB(e,t){for(;t!==null;){if(128&t.f){if((t.f&Zz)===0)throw e;try{t.b.error(e);return}catch(t){e=t}}t=t.parent}throw e}var OB=-7169;function kB(e,t){e.f=e.f&OB|t}function AB(e){(e.f&Gz)!==0||e.deps===null?kB(e,Kz):kB(e,Jz)}function jB(e){if(e!==null)for(var t of e)2&t.f&&(t.f&rB)!==0&&(t.f^=rB,jB(t.deps))}function MB(e,t,n){(e.f&qz)===0?(e.f&Jz)!==0&&n.add(e):t.add(e),jB(e.deps),kB(e,Kz)}var NB=!1,PB=new Set,FB=null,IB=null,LB=null,RB=!1,zB=!1,BB=null,VB=null,HB=0,UB=1,WB=new WeakMap,GB=new WeakMap,KB=new WeakMap,qB=new WeakMap,JB=new WeakMap,YB=new WeakMap,XB=new WeakMap,ZB=new WeakMap,QB=new WeakMap,$B=new WeakMap,eV=new WeakMap,tV=new WeakMap,nV=new WeakSet,rV=class e{constructor(){mz(this,nV),yz(this,`id`,UB++),yz(this,`current`,new Map),yz(this,`previous`,new Map),hz(this,WB,new Set),hz(this,GB,new Set),hz(this,KB,new Map),hz(this,qB,new Map),hz(this,JB,null),hz(this,YB,[]),hz(this,XB,[]),hz(this,ZB,new Set),hz(this,QB,new Set),hz(this,$B,new Map),yz(this,`is_fork`,!1),hz(this,eV,!1),hz(this,tV,new Set)}skip_effect(e){z($B,this).has(e)||z($B,this).set(e,{d:[],m:[]})}unskip_effect(e){var t=z($B,this).get(e);if(t){for(var n of(z($B,this).delete(e),t.d))kB(n,qz),this.schedule(n);for(n of t.m)kB(n,Jz),this.schedule(n)}}capture(e,t){var n,r=arguments.length>2&&arguments[2]!==void 0&&arguments[2];(t===Cz||this.previous.has(e)||this.previous.set(e,t),(e.f&aB)===0)&&(this.current.set(e,[e.v,r]),(n=IB)==null||n.set(e,e.v))}activate(){FB=this}deactivate(){FB=null,IB=null}flush(){try{zB=!0,FB=this,vz(nV,this,oV).call(this)}finally{HB=0,LB=null,BB=null,VB=null,zB=!1,FB=null,IB=null,eH.clear()}}discard(){for(var e of z(GB,this))e(this);z(GB,this).clear(),PB.delete(this)}register_created_effect(e){z(XB,this).push(e)}increment(e,t){var n=z(KB,this).get(t)??0;if(z(KB,this).set(t,n+1),e){var r=z(qB,this).get(t)??0;z(qB,this).set(t,r+1)}}decrement(e,t,n){var r=z(KB,this).get(t)??0;if(r===1?z(KB,this).delete(t):z(KB,this).set(t,r-1),e){var i=z(qB,this).get(t)??0;i===1?z(qB,this).delete(t):z(qB,this).set(t,i-1)}z(eV,this)||n||(_z(eV,this,!0),wB(()=>{_z(eV,this,!1),this.flush()}))}transfer_effects(e,t){for(var n of e)z(ZB,this).add(n);for(var r of t)z(QB,this).add(r);e.clear(),t.clear()}oncommit(e){z(WB,this).add(e)}ondiscard(e){z(GB,this).add(e)}settled(){return(z(JB,this)??_z(JB,this,Bz())).promise}static ensure(){if(FB===null){var t=FB=new e;zB||(PB.add(FB),RB||wB(()=>{FB===t&&t.flush()}))}return FB}apply(){IB=null}schedule(e){var t;if(LB=e,(t=e.b)!=null&&t.is_pending&&16777228&e.f&&(e.f&Zz)===0)e.b.defer_effect(e);else{for(var n=e;n.parent!==null;){var r=(n=n.parent).f;if(!(BB===null||n!==JH||GH!==null&&2&GH.f))return;if(96&r){if((r&Kz)===0)return;n.f^=Kz}}z(YB,this).push(n)}}};function iV(){return this.is_fork||z(qB,this).size>0}function aV(){for(var e of z(tV,this))for(var t of z(qB,e).keys()){for(var n=!1,r=t;r.parent!==null;){if(z($B,this).has(r)){n=!0;break}r=r.parent}if(!n)return!0}return!1}function oV(){if(HB++>1e3&&(PB.delete(this),function(){try{(function(){throw Error(`https://svelte.dev/e/effect_update_depth_exceeded`)})()}catch(e){DB(e,LB)}}()),!vz(nV,this,iV).call(this)){for(var e of z(ZB,this))z(QB,this).delete(e),kB(e,qz),this.schedule(e);for(var t of z(QB,this))kB(t,Jz),this.schedule(t)}var n=z(YB,this);_z(YB,this,[]),this.apply();var r=BB=[],i=[],a=VB=[];for(var o of n)try{vz(nV,this,sV).call(this,o,r,i)}catch(e){throw _V(o),e}if(FB=null,a.length>0){var s=oz.ensure();for(var c of a)s.schedule(c)}if(BB=null,VB=null,vz(nV,this,iV).call(this)||vz(nV,this,aV).call(this))for(var[l,u]of(vz(nV,this,cV).call(this,i),vz(nV,this,cV).call(this,r),z($B,this)))gV(l,u);else{var d;for(var f of(z(KB,this).size===0&&PB.delete(this),z(ZB,this).clear(),z(QB,this).clear(),z(WB,this)))f(this);z(WB,this).clear(),fV(i),fV(r),(d=z(JB,this))==null||d.resolve()}var p,m=FB;if(z(YB,this).length>0){var h=m??=this;z(YB,h).push(...z(YB,this).filter(e=>!z(YB,h).includes(e)))}m!==null&&(PB.add(m),vz(nV,p=m,oV).call(p)),PB.has(this)||vz(nV,this,lV).call(this)}function sV(e,t,n){e.f^=Kz;for(var r=e.first;r!==null;){var i=r.f,a=!!(96&i);if(!(a&&(i&Kz)!==0||(i&Yz)!==0||z($B,this).has(r))&&r.fn!==null){a?r.f^=Kz:4&i?t.push(r):oU(r)&&((i&Hz)!==0&&z(QB,this).add(r),dU(r));var o=r.first;if(o!==null){r=o;continue}}for(;r!==null;){var s=r.next;if(s!==null){r=s;break}r=r.parent}}}function cV(e){for(var t=0;t<e.length;t+=1)MB(e[t],z(ZB,this),z(QB,this))}function lV(){for(var e of PB){var t=e.id<this.id,n=[];for(var[r,[i,a]]of this.current){if(e.current.has(r)){var o=e.current.get(r)[0];if(!t||i===o)continue;e.current.set(r,[i,a])}n.push(r)}var s=[...e.current.keys()].filter(e=>!this.current.has(e));if(s.length===0)t&&e.discard();else if(n.length>0){e.activate();var c=new Set,l=new Map;for(var u of n)pV(u,s,c,l);l=new Map;var d=[...e.current.keys()].filter(e=>!this.current.has(e)||this.current.get(e)[0]!==e);for(var f of z(XB,this))155648&f.f||!mV(f,d,l)||(4194320&f.f?(kB(f,qz),e.schedule(f)):z(ZB,e).add(f));if(z(YB,e).length>0){for(var p of(e.apply(),z(YB,e)))vz(nV,e,sV).call(e,p,[],[]);_z(YB,e,[])}e.deactivate()}}for(var m of PB)z(tV,m).has(this)&&(z(tV,m).delete(this),z(tV,m).size!==0||vz(nV,m,iV).call(m)||(m.activate(),vz(nV,m,oV).call(m)))}function uV(e){var t=RB;RB=!0;try{for(;;){if(TB(),FB===null)return;FB.flush()}}finally{RB=t}}oz=rV;var dV=null;function fV(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if(!(24576&r.f)&&oU(r)&&(dV=new Set,dU(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&IH(r),dV?.size>0)){for(var i of(eH.clear(),dV))if(!(24576&i.f)){for(var a=[i],o=i.parent;o!==null;)dV.has(o)&&(dV.delete(o),a.push(o)),o=o.parent;for(var s=a.length-1;s>=0;s--){var c=a[s];24576&c.f||dU(c)}}dV.clear()}}dV=null}}function pV(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(var i of e.reactions){var a=i.f;2&a?pV(i,t,n,r):4194320&a&&(a&qz)===0&&mV(i,t,r)&&(kB(i,qz),hV(i))}}function mV(e,t,n){var r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(var i of e.deps){if(Dz.call(t,i))return!0;if(2&i.f&&mV(i,t,n))return n.set(i,!0),!0}return n.set(e,!1),!1}function hV(e){FB.schedule(e)}function gV(e,t){if((e.f&Uz)===0||(e.f&Kz)===0){(e.f&qz)===0?(e.f&Jz)!==0&&t.m.push(e):t.d.push(e),kB(e,Kz);for(var n=e.first;n!==null;)gV(n,t),n=n.next}}function _V(e){kB(e,Kz);for(var t=e.first;t!==null;)_V(t),t=t.next}var vV=new WeakMap,yV=new WeakMap,bV=new WeakMap,xV=new WeakMap,SV=new WeakMap,CV=new WeakMap,wV=new WeakMap,TV=new WeakMap,EV=new WeakMap,DV=new WeakMap,OV=new WeakMap,kV=new WeakMap,AV=new WeakMap,jV=new WeakMap,MV=new WeakMap,NV=new WeakMap,PV=new WeakSet,FV=class{constructor(e,t,n,r){var i,a,o,s;mz(this,PV),yz(this,`parent`,void 0),yz(this,`is_pending`,!1),yz(this,`transform_error`,void 0),hz(this,vV,void 0),hz(this,yV,null),hz(this,bV,void 0),hz(this,xV,void 0),hz(this,SV,void 0),hz(this,CV,null),hz(this,wV,null),hz(this,TV,null),hz(this,EV,null),hz(this,DV,0),hz(this,OV,0),hz(this,kV,!1),hz(this,AV,new Set),hz(this,jV,new Set),hz(this,MV,null),hz(this,NV,(i=()=>(_z(MV,this,nH(z(DV,this))),()=>{_z(MV,this,null)}),o=0,s=nH(0),()=>{SH()&&(K(s),OH(()=>(o===0&&(a=q(()=>i(()=>sH(s)))),o+=1,()=>{wB(()=>{var e;--o==0&&((e=a)==null||e(),a=void 0,sH(s))})})))})),_z(vV,this,e),_z(bV,this,t),_z(xV,this,e=>{var t=JH;t.b=this,t.f|=128,n(e)}),this.parent=JH.b,this.transform_error=r??this.parent?.transform_error??(e=>e),_z(SV,this,kH(()=>{vz(PV,this,IV).call(this)},589824))}defer_effect(e){MB(e,z(AV,this),z(jV,this))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!z(bV,this).pending}update_pending_count(e,t){vz(PV,this,zV).call(this,e,t),_z(DV,this,z(DV,this)+e),z(MV,this)&&!z(kV,this)&&(_z(kV,this,!0),wB(()=>{_z(kV,this,!1),z(MV,this)&&aH(z(MV,this),z(DV,this))}))}get_effect_pending(){return z(NV,this).call(this),K(z(MV,this))}error(e){var t=z(bV,this).onerror,n=z(bV,this).failed;if(!t&&!n)throw e;z(CV,this)&&(PH(z(CV,this)),_z(CV,this,null)),z(wV,this)&&(PH(z(wV,this)),_z(wV,this,null)),z(TV,this)&&(PH(z(TV,this)),_z(TV,this,null));var r=!1,i=!1,a=()=>{r?console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`):(r=!0,i&&function(){throw Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`)}(),z(TV,this)!==null&&LH(z(TV,this),()=>{_z(TV,this,null)}),vz(PV,this,RV).call(this,()=>{vz(PV,this,IV).call(this)}))},o=e=>{try{i=!0,t?.(e,a),i=!1}catch(e){DB(e,z(SV,this)&&z(SV,this).parent)}n&&_z(TV,this,vz(PV,this,RV).call(this,()=>{try{return jH(()=>{var t=JH;t.b=this,t.f|=128,n(z(vV,this),()=>e,()=>a)})}catch(e){return DB(e,z(SV,this).parent),null}}))};wB(()=>{var t;try{t=this.transform_error(e)}catch(e){DB(e,z(SV,this)&&z(SV,this).parent);return}typeof t==`object`&&t&&typeof t.then==`function`?t.then(o,e=>DB(e,z(SV,this)&&z(SV,this).parent)):o(t)})}};function IV(){try{if(this.is_pending=this.has_pending_snippet(),_z(OV,this,0),_z(DV,this,0),_z(CV,this,jH(()=>{z(xV,this).call(this,z(vV,this))})),z(OV,this)>0){var e=_z(EV,this,document.createDocumentFragment());VH(z(CV,this),e);var t=z(bV,this).pending;_z(wV,this,jH(()=>t(z(vV,this))))}else vz(PV,this,LV).call(this,FB)}catch(e){this.error(e)}}function LV(e){this.is_pending=!1,e.transfer_effects(z(AV,this),z(jV,this))}function RV(e){var t=JH,n=GH,r=hB;YH(z(SV,this)),qH(z(SV,this)),gB(z(SV,this).ctx);try{return rV.ensure(),e()}catch(e){return EB(e),null}finally{YH(t),qH(n),gB(r)}}function zV(e,t){var n;this.has_pending_snippet()?(_z(OV,this,z(OV,this)+e),z(OV,this)===0&&(vz(PV,this,LV).call(this,t),z(wV,this)&&LH(z(wV,this),()=>{_z(wV,this,null)}),z(EV,this)&&(z(vV,this).before(z(EV,this)),_z(EV,this,null)))):this.parent&&vz(PV,n=this.parent,zV).call(n,e,t)}function BV(e,t,n,r){var i=bB()?UV:GV,a=e.filter(e=>!e.settled);if(n.length!==0||a.length!==0){var o,s,c,l,u=JH,d=(o=JH,s=GH,c=hB,l=FB,function(){var e=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];YH(o),qH(s),gB(c),e&&(o.f&Xz)===0&&(l?.activate(),l?.apply())}),f=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(e=>e.promise)):null;if(n.length!==0){var p=HV();f?f.then(()=>{d(),h(),VV()}):h()}else f.then(()=>m(t.map(i)))}else r(t.map(i));function m(e){d();try{r(e)}catch(e){(u.f&Xz)===0&&DB(e,u)}VV()}function h(){Promise.all(n.map(e=>function(e){var t=JH;t===null&&function(){throw Error(`https://svelte.dev/e/async_derived_orphan`)}();var n=void 0,r=nH(Cz),i=!GH,a=new Map;return function(e){xH(4718592,e)}(()=>{var o=JH,s=Bz();n=s.promise;try{Promise.resolve(e()).then(s.resolve,s.reject).finally(VV)}catch(e){s.reject(e),VV()}var c=FB;if(i){if((o.f&Zz)!==0)var l=HV();if(t.b.is_rendered()){var u;(u=a.get(c))==null||u.reject(lB),a.delete(c)}else{for(var d of a.values())d.reject(lB);a.clear()}a.set(c,s)}var f=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0;if(l&&l(t===lB),t!==lB&&(o.f&Xz)===0){if(c.activate(),t)r.f|=aB,aH(r,t);else for(var[n,i]of((r.f&aB)!==0&&(r.f^=aB),aH(r,e),a)){if(a.delete(n),n===c)break;i.reject(lB)}c.deactivate()}};s.promise.then(f,e=>f(null,e||`unknown`))}),CH(()=>{for(var e of a.values())e.reject(lB)}),new Promise(e=>{function t(i){function a(){i===n?e(r):t(n)}i.then(a,a)}t(n)})}(e))).then(e=>m([...t.map(i),...e])).catch(e=>DB(e,u)).finally(()=>p())}}function VV(){var e,t=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];YH(null),qH(null),gB(null),t&&((e=FB)==null||e.deactivate())}function HV(){var e=JH,t=e.b,n=FB,r=t.is_rendered();return t.update_pending_count(1,n),n.increment(r,e),function(){var i=arguments.length>0&&arguments[0]!==void 0&&arguments[0];t.update_pending_count(-1,n),n.decrement(r,e,i)}}function UV(e){var t=GH!==null&&2&GH.f?GH:null;return JH!==null&&(JH.f|=tB),{ctx:hB,deps:null,effects:null,equals:fB,f:2050,fn:e,reactions:null,rv:0,v:Cz,wv:0,parent:t??JH,ac:null}}function WV(e){var t=UV(e);return ZH(t),t}function GV(e){var t=UV(e);return t.equals=mB,t}function KV(e){var t,n=JH;YH(function(e){for(var t=e.parent;t!==null;){if(!(2&t.f))return(t.f&Xz)===0?t:null;t=t.parent}return null}(e));try{e.f&=-65537,function(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)PH(t[n])}}(e),t=cU(e)}finally{YH(n)}return t}function qV(e){var t,n,r,i=e.v,a=KV(e);if(!e.equals(a)&&(e.wv=aU(),!((t=FB)!=null&&t.is_fork&&e.deps!==null||(e.v=a,(n=FB)==null||n.capture(e,i,!0),e.deps!==null))))return void kB(e,Kz);UH||(IB===null?AB(e):(SH()||(r=FB)!=null&&r.is_fork)&&IB.set(e,a))}function JV(e){if(e.effects!==null)for(var t of e.effects)t.teardown&&dU(t)}var YV,XV,ZV,QV,$V=new Set,eH=new Map,tH=!1;function nH(e,t){return{f:0,v:e,reactions:null,equals:fB,rv:0,wv:0}}function rH(e,t){var n=nH(e);return ZH(n),n}function B(e){var t,n=arguments.length>1&&arguments[1]!==void 0&&arguments[1],r=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],i=nH(e);return(n||(i.equals=mB),Sz&&r&&hB!==null&&hB.l!==null)&&((t=hB.l).s??(t.s=[])).push(i),i}function iH(e,t){return V(e,q(()=>K(e))),t}function V(e,t){var n=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return GH===null||KH&&(GH.f&eB)===0||!bB()||!(4325394&GH.f)||XH!==null&&Dz.call(XH,e)||function(){throw Error(`https://svelte.dev/e/state_unsafe_mutation`)}(),aH(e,n?lH(t):t,VB)}function aH(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(!e.equals(t)){var r=e.v;UH?eH.set(e,t):eH.set(e,r),e.v=t;var i=rV.ensure();if(i.capture(e,r),2&e.f){var a=e;(e.f&qz)!==0&&KV(a),IB===null&&AB(a)}e.wv=aU(),cH(e,qz,n),!bB()||JH===null||(JH.f&Kz)===0||96&JH.f||(eU===null?function(e){eU=e}([e]):eU.push(e)),!i.is_fork&&$V.size>0&&!tH&&function(){for(var e of(tH=!1,$V))(e.f&Kz)!==0&&kB(e,Jz),oU(e)&&dU(e);$V.clear()}()}return t}function oH(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,n=K(e),r=t===1?n++:n--;return V(e,n),r}function sH(e){V(e,e.v+1)}function cH(e,t,n){var r=e.reactions;if(r!==null)for(var i=bB(),a=r.length,o=0;o<a;o++){var s=r[o],c=s.f;if(i||s!==JH){var l=(c&qz)===0;if(l&&kB(s,t),2&c){var u,d=s;(u=IB)==null||u.delete(d),(c&rB)===0&&(c&Gz&&(s.f|=rB),cH(d,Jz,n))}else if(l){var f=s;(c&Hz)!==0&&dV!==null&&dV.add(f),n===null?hV(f):n.push(f)}}}}function lH(e){if(typeof e!=`object`||!e||oB in e)return e;var t=Pz(e);if(t!==Mz&&t!==Nz)return e;var n=new Map,r=Tz(e),i=rH(0),a=rU,o=e=>{if(rU===a)return e();var t=GH,n=rU;qH(null),iU(a);var r=e();return qH(t),iU(n),r};return r&&n.set(`length`,rH(e.length)),new Proxy(e,{defineProperty(e,t,r){`value`in r&&!1!==r.configurable&&!1!==r.enumerable&&!1!==r.writable||function(){throw Error(`https://svelte.dev/e/state_descriptors_fixed`)}();var i=n.get(t);return i===void 0?o(()=>{var e=rH(r.value);return n.set(t,e),e}):V(i,r.value,!0),!0},deleteProperty(e,t){var r=n.get(t);if(r===void 0){if(t in e){var a=o(()=>rH(Cz));n.set(t,a),sH(i)}}else V(r,Cz),sH(i);return!0},get(t,r,i){var a;if(r===oB)return e;var s=n.get(r),c=r in t;if(s===void 0&&(!c||(a=Az(t,r))!=null&&a.writable)&&(s=o(()=>rH(lH(c?t[r]:Cz))),n.set(r,s)),s!==void 0){var l=K(s);return l===Cz?void 0:l}return Reflect.get(t,r,i)},getOwnPropertyDescriptor(e,t){var r=Reflect.getOwnPropertyDescriptor(e,t);if(r&&`value`in r){var i=n.get(t);i&&(r.value=K(i))}else if(r===void 0){var a=n.get(t),o=a?.v;if(a!==void 0&&o!==Cz)return{enumerable:!0,configurable:!0,value:o,writable:!0}}return r},has(e,t){var r;if(t===oB)return!0;var i=n.get(t),a=i!==void 0&&i.v!==Cz||Reflect.has(e,t);return(i!==void 0||JH!==null&&(!a||(r=Az(e,t))!=null&&r.writable))&&(i===void 0&&(i=o(()=>rH(a?lH(e[t]):Cz)),n.set(t,i)),K(i)===Cz)?!1:a},set(e,t,a,s){var c,l=n.get(t),u=t in e;if(r&&t===`length`)for(var d=a;d<l.v;d+=1){var f=n.get(d+``);f===void 0?d in e&&(f=o(()=>rH(Cz)),n.set(d+``,f)):V(f,Cz)}l===void 0?(!u||(c=Az(e,t))!=null&&c.writable)&&(V(l=o(()=>rH(void 0)),lH(a)),n.set(t,l)):(u=l.v!==Cz,V(l,o(()=>lH(a))));var p=Reflect.getOwnPropertyDescriptor(e,t);if(p!=null&&p.set&&p.set.call(s,a),!u){if(r&&typeof t==`string`){var m=n.get(`length`),h=Number(t);Number.isInteger(h)&&h>=m.v&&V(m,h+1)}sH(i)}return!0},ownKeys(e){K(i);var t=Reflect.ownKeys(e).filter(e=>{var t=n.get(e);return t===void 0||t.v!==Cz});for(var[r,a]of n)a.v===Cz||r in e||t.push(r);return t},setPrototypeOf(){(function(){throw Error(`https://svelte.dev/e/state_prototype_fixed`)})()}})}function uH(e){try{if(typeof e==`object`&&e&&oB in e)return e[oB]}catch{}return e}function dH(e,t){return Object.is(uH(e),uH(t))}function fH(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:``;return document.createTextNode(e)}function pH(e){return ZV.call(e)}function mH(e){return QV.call(e)}function H(e,t){return pH(e)}function hH(e){var t=pH(e);return t instanceof Comment&&t.data===``?mH(t):t}function U(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,n=e;t--;)n=mH(n);return n}function gH(e,t,n){return document.createElementNS(t??wz,e,void 0)}var _H=!1;function vH(e){var t=GH,n=JH;qH(null),YH(null);try{return e()}finally{qH(t),YH(n)}}function yH(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:n;e.addEventListener(t,()=>vH(n));var i=e.__on_r;e.__on_r=i?()=>{i(),r(!0)}:()=>r(!0),_H||(_H=!0,document.addEventListener(`reset`,e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(var t of e.target.elements){var n;(n=t.__on_r)==null||n.call(t)}})},{capture:!0}))}function bH(e){JH===null&&(GH===null&&function(){throw Error(`https://svelte.dev/e/effect_orphan`)}(),function(){throw Error(`https://svelte.dev/e/effect_in_unowned_derived`)}()),UH&&function(){throw Error(`https://svelte.dev/e/effect_in_teardown`)}()}function xH(e,t){var n,r=JH;r!==null&&(r.f&Yz)!==0&&(e|=Yz);var i={ctx:hB,deps:null,nodes:null,f:e|qz|Gz,first:null,fn:t,last:null,next:null,parent:r,b:r&&r.b,prev:null,teardown:null,wv:0,ac:null};(n=FB)==null||n.register_created_effect(i);var a=i;if(4&e)BB===null?rV.ensure().schedule(i):BB.push(i);else if(t!==null){try{dU(i)}catch(e){throw PH(i),e}a.deps===null&&a.teardown===null&&a.nodes===null&&a.first===a.last&&(a.f&tB)===0&&(a=a.first,(e&Hz)!==0&&(e&$z)!==0&&a!==null&&(a.f|=$z))}if(a!==null&&(a.parent=r,r!==null&&function(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}(a,r),GH!==null&&2&GH.f&&(e&Wz)===0)){var o=GH;(o.effects??=[]).push(a)}return i}function SH(){return GH!==null&&!KH}function CH(e){var t=xH(8,null);return kB(t,Kz),t.teardown=e,t}function wH(e){bH();var t=JH.f;if(!(!GH&&(t&Uz)!==0&&(t&Zz)===0))return TH(e);var n=hB;(n.e??=[]).push(e)}function TH(e){return xH(1048580,e)}function EH(e){return xH(4,e)}function W(e,t){var n={effect:null,ran:!1,deps:e};hB.l.$.push(n),n.effect=OH(()=>{if(e(),!n.ran){n.ran=!0;var r=JH;try{YH(r.parent),q(t)}finally{YH(r)}}})}function DH(){var e=hB;OH(()=>{for(var t of e.l.$){t.deps();var n=t.effect;(n.f&Kz)!==0&&n.deps!==null&&kB(n,Jz),oU(n)&&dU(n),t.ran=!1}})}function OH(e){return xH(8|(arguments.length>1&&arguments[1]!==void 0?arguments[1]:0),e)}function G(e){BV(arguments.length>3&&arguments[3]!==void 0?arguments[3]:[],arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],t=>{xH(8,()=>e(...t.map(K)))})}function kH(e){return xH(Hz|(arguments.length>1&&arguments[1]!==void 0?arguments[1]:0),e)}function AH(e){return xH(Vz|(arguments.length>1&&arguments[1]!==void 0?arguments[1]:0),e)}function jH(e){return xH(524320,e)}function MH(e){var t=e.teardown;if(t!==null){var n=UH,r=GH;WH(!0),qH(null);try{t.call(null)}finally{WH(n),qH(r)}}}function NH(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=e.first;e.first=e.last=null;for(var r,i=function(){var e=n.ac;e!==null&&vH(()=>{e.abort(lB)}),r=n.next,(n.f&Wz)===0?PH(n,t):n.parent=null,n=r};n!==null;)i()}function PH(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],n=!1;(t||262144&e.f)&&e.nodes!==null&&e.nodes.end!==null&&(FH(e.nodes.start,e.nodes.end),n=!0),kB(e,Qz),NH(e,t&&!n),uU(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(var i of r)i.stop();MH(e),e.f^=Qz,e.f|=Xz;var a=e.parent;a!==null&&a.first!==null&&IH(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function FH(e,t){for(;e!==null;){var n=e===t?null:mH(e);e.remove(),e=n}}function IH(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function LH(e,t){var n=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],r=[];RH(e,r,!0);var i=()=>{n&&PH(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||i();for(var s of r)s.out(o)}else i()}function RH(e,t,n){if((e.f&Yz)===0){e.f^=Yz;var r=e.nodes&&e.nodes.t;if(r!==null)for(var i of r)(i.is_global||n)&&t.push(i);for(var a=e.first;a!==null;){var o=a.next;RH(a,t,((a.f&$z)!==0||(a.f&Uz)!==0&&(e.f&Hz)!==0)&&n),a=o}}}function zH(e){BH(e,!0)}function BH(e,t){if((e.f&Yz)!==0){e.f^=Yz,(e.f&Kz)===0&&(kB(e,qz),rV.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next;BH(n,((n.f&$z)!==0||(n.f&Uz)!==0)&&t),n=r}var i=e.nodes&&e.nodes.t;if(i!==null)for(var a of i)(a.is_global||t)&&a.in()}}function VH(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:mH(n);t.append(n),n=i}}var HH=!1,UH=!1;function WH(e){UH=e}var GH=null,KH=!1;function qH(e){GH=e}var JH=null;function YH(e){JH=e}var XH=null;function ZH(e){GH!==null&&(XH===null?XH=[e]:XH.push(e))}var QH=null,$H=0,eU=null,tU=1,nU=0,rU=nU;function iU(e){rU=e}function aU(){return++tU}function oU(e){var t=e.f;if((t&qz)!==0)return!0;if(2&t&&(e.f&=-65537),(t&Jz)!==0){for(var n=e.deps,r=n.length,i=0;i<r;i++){var a=n[i];if(oU(a)&&qV(a),a.wv>e.wv)return!0}(t&Gz)!==0&&IB===null&&kB(e,Kz)}return!1}function sU(e,t){var n=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],r=e.reactions;if(r!==null&&(XH===null||!Dz.call(XH,e)))for(var i=0;i<r.length;i++){var a=r[i];2&a.f?sU(a,t,!1):t===a&&(n?kB(a,qz):(a.f&Kz)!==0&&kB(a,Jz),hV(a))}}function cU(e){var t=QH,n=$H,r=eU,i=GH,a=XH,o=hB,s=KH,c=rU,l=e.f;QH=null,$H=0,eU=null,GH=96&l?null:e,XH=null,gB(e.ctx),KH=!1,rU=++nU,e.ac!==null&&(vH(()=>{e.ac.abort(lB)}),e.ac=null);try{e.f|=iB;var u=(0,e.fn)();e.f|=Zz;var d=e.deps,f=FB?.is_fork;if(QH!==null){var p;if(f||uU(e,$H),d!==null&&$H>0)for(d.length=$H+QH.length,p=0;p<QH.length;p++)d[$H+p]=QH[p];else e.deps=d=QH;if(SH()&&(e.f&Gz)!==0)for(p=$H;p<d.length;p++){var m;((m=d[p]).reactions??(m.reactions=[])).push(e)}}else !f&&d!==null&&$H<d.length&&(uU(e,$H),d.length=$H);if(bB()&&eU!==null&&!KH&&d!==null&&!(6146&e.f))for(p=0;p<eU.length;p++)sU(eU[p],e);if(i!==null&&i!==e){if(nU++,i.deps!==null)for(var h=0;h<n;h+=1)i.deps[h].rv=nU;if(t!==null)for(var g of t)g.rv=nU;eU!==null&&(r===null?r=eU:r.push(...eU))}return(e.f&aB)!==0&&(e.f^=aB),u}catch(e){return EB(e)}finally{e.f^=iB,QH=t,$H=n,eU=r,GH=i,XH=a,gB(o),KH=s,rU=c}}function lU(e,t){var n=t.reactions;if(n!==null){var r=Ez.call(n,e);if(r!==-1){var i=n.length-1;i===0?n=t.reactions=null:(n[r]=n[i],n.pop())}}if(n===null&&2&t.f&&(QH===null||!Dz.call(QH,t))){var a=t;(a.f&Gz)!==0&&(a.f^=Gz,a.f&=-65537),AB(a),function(e){if(e.effects!==null)for(var t of e.effects){var n,r;(t.teardown||t.ac)&&((n=t.teardown)==null||n.call(t),(r=t.ac)==null||r.abort(lB),t.teardown=Lz,t.ac=null,uU(t,0),NH(t))}}(a),uU(a,0)}}function uU(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)lU(e,n[r])}function dU(e){var t=e.f;if((t&Xz)===0){kB(e,Kz);var n=JH,r=HH;JH=e,HH=!0;try{16777232&t?function(e){for(var t=e.first;t!==null;){var n=t.next;(t.f&Uz)===0&&PH(t),t=n}}(e):NH(e),MH(e);var i=cU(e);e.teardown=typeof i==`function`?i:null,e.wv=tU}finally{HH=r,JH=n}}}function fU(){return pU.apply(this,arguments)}function pU(){return(pU=pz(function*(){yield Promise.resolve(),uV()})).apply(this,arguments)}function K(e){var t,n=!!(2&e.f);if(GH!==null&&!KH&&!(JH!==null&&(JH.f&Xz)!==0||XH!==null&&Dz.call(XH,e))){var r=GH.deps;if((GH.f&iB)!==0)e.rv<nU&&(e.rv=nU,QH===null&&r!==null&&r[$H]===e?$H++:QH===null?QH=[e]:QH.push(e));else{var i;((i=GH).deps??(i.deps=[])).push(e);var a=e.reactions;a===null?e.reactions=[GH]:Dz.call(a,GH)||a.push(GH)}}if(UH&&eH.has(e))return eH.get(e);if(n){var o=e;if(UH){var s=o.v;return((o.f&Kz)===0&&o.reactions!==null||hU(o))&&(s=KV(o)),eH.set(o,s),s}var c=(o.f&Gz)===0&&!KH&&GH!==null&&(HH||(GH.f&Gz)!==0),l=(o.f&Zz)===0;oU(o)&&(c&&(o.f|=Gz),qV(o)),c&&!l&&(JV(o),mU(o))}if((t=IB)!=null&&t.has(e))return IB.get(e);if((e.f&aB)!==0)throw e.v;return e.v}function mU(e){if(e.f|=Gz,e.deps!==null)for(var t of e.deps)(t.reactions??=[]).push(e),2&t.f&&(t.f&Gz)===0&&(JV(t),mU(t))}function hU(e){if(e.v===Cz)return!0;if(e.deps===null)return!1;for(var t of e.deps)if(eH.has(t)||2&t.f&&hU(t))return!0;return!1}function q(e){var t=KH;try{return KH=!0,e()}finally{KH=t}}function J(e){if(typeof e==`object`&&e&&!(e instanceof EventTarget)){if(oB in e)gU(e);else if(!Array.isArray(e))for(var t in e){var n=e[t];typeof n==`object`&&n&&oB in n&&gU(n)}}}function gU(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new Set;if(!(typeof e!=`object`||!e||e instanceof EventTarget||t.has(e))){for(var n in t.add(e),e instanceof Date&&e.getTime(),e)try{gU(e[n],t)}catch{}var r=Pz(e);if(r!==Object.prototype&&r!==Array.prototype&&r!==Map.prototype&&r!==Set.prototype&&r!==Date.prototype){var i=jz(r);for(var a in i){var o=i[a].get;if(o)try{o.call(e)}catch{}}}}}var _U=Symbol(`events`),vU=new Set,yU=new Set;function bU(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};function i(e){if(r.capture||CU.call(t,e),!e.cancelBubble)return vH(()=>n?.call(this,e))}return e.startsWith(`pointer`)||e.startsWith(`touch`)||e===`wheel`?wB(()=>{t.addEventListener(e,i,r)}):t.addEventListener(e,i,r),i}function Y(e,t,n,r,i){var a={capture:r,passive:i},o=bU(e,t,n,a);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&CH(()=>{t.removeEventListener(e,o,a)})}function xU(e,t,n){(t[_U]??(t[_U]={}))[e]=n}function SU(e){for(var t=0;t<e.length;t++)vU.add(e[t]);for(var n of yU)n(e)}function CU(e){var t=this,n=t.ownerDocument,r=e.type,i=e.composedPath?.call(e)||[],a=i[0]||e.target,o=0,s=e===e&&e[_U];if(s){var c=i.indexOf(s);if(c!==-1&&(t===document||t===window))return void(e[_U]=t);var l=i.indexOf(t);if(l===-1)return;c<=l&&(o=c)}if((a=i[o]||e.target)!==t){kz(e,`currentTarget`,{configurable:!0,get:()=>a||n});var u=GH,d=JH;qH(null),YH(null);try{for(var f,p=[];a!==null;){var m=a.assignedSlot||a.parentNode||a.host||null;try{var h=a[_U]?.[r];h==null||a.disabled&&e.target!==a||h.call(a,e)}catch(e){f?p.push(e):f=e}if(e.cancelBubble||m===t||m===null)break;a=m}if(f){var g=function(e){queueMicrotask(()=>{throw e})};for(var _ of p)g(_);throw f}}finally{e[_U]=t,delete e.currentTarget,qH(u),YH(d)}}}var wU=(globalThis==null||(sz=globalThis.window)==null?void 0:sz.trustedTypes)&&globalThis.window.trustedTypes.createPolicy(`svelte-trusted-html`,{createHTML:e=>e});function TU(e){var t=gH(`template`);return t.innerHTML=function(e){return wU?.createHTML(e)??e}(e.replaceAll(`<!>`,`<!---->`)),t.content}function EU(e,t){var n=JH;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function X(e,t){var n,r=!!(1&t),i=!!(2&t),a=!e.startsWith(`<!>`);return()=>{n===void 0&&(n=TU(a?e:`<!>`+e),r||(n=pH(n)));var t=i||XV?document.importNode(n,!0):n.cloneNode(!0);return r?EU(pH(t),t.lastChild):EU(t,t),t}}function DU(e,t){return function(e,t){var n,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:`svg`,i=!e.startsWith(`<!>`),a=!!(1&t),o=`<${r}>${i?e:`<!>`+e}</${r}>`;return()=>{if(!n){var e=pH(TU(o));if(a)for(n=document.createDocumentFragment();pH(e);)n.appendChild(pH(e));else n=pH(e)}var t=n.cloneNode(!0);return a?EU(pH(t),t.lastChild):EU(t,t),t}}(e,t,`svg`)}function OU(){var e=fH((arguments.length>0&&arguments[0]!==void 0?arguments[0]:``)+``);return EU(e,e),e}function kU(){var e=document.createDocumentFragment(),t=document.createComment(``),n=fH();return e.append(t,n),EU(t,n),e}function Z(e,t){e!==null&&e.before(t)}var AU=[`beforeinput`,`click`,`change`,`dblclick`,`contextmenu`,`focusin`,`focusout`,`input`,`keydown`,`keyup`,`mousedown`,`mousemove`,`mouseout`,`mouseover`,`mouseup`,`pointerdown`,`pointermove`,`pointerout`,`pointerover`,`pointerup`,`touchend`,`touchmove`,`touchstart`],jU={formnovalidate:`formNoValidate`,ismap:`isMap`,nomodule:`noModule`,playsinline:`playsInline`,readonly:`readOnly`,defaultvalue:`defaultValue`,defaultchecked:`defaultChecked`,srcobject:`srcObject`,novalidate:`noValidate`,allowfullscreen:`allowFullscreen`,disablepictureinpicture:`disablePictureInPicture`,disableremoteplayback:`disableRemotePlayback`},MU=[`touchstart`,`touchmove`];function NU(e){return MU.includes(e)}function PU(e,t){var n=t==null?``:typeof t==`object`?`${t}`:t;n!==(e.__t??=e.nodeValue)&&(e.__t=n,e.nodeValue=`${n}`)}function FU(e,t){return function(e,t){var{target:n,anchor:r,props:i={},events:a,context:o,intro:s=!0,transformError:c}=t;(function(){if(YV===void 0){YV=window,XV=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;ZV=Az(t,`firstChild`).get,QV=Az(t,`nextSibling`).get,Fz(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),Fz(n)&&(n.__t=void 0)}})();var l=void 0,u=function(e){rV.ensure();var t=xH(524352,e);return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new Promise(n=>{e.outro?LH(t,()=>{PH(t),n(void 0)}):(PH(t),n(void 0))})}}(()=>{var t=r??n.appendChild(fH());(function(e,t,n,r){new FV(e,t,n,r)})(t,{pending:()=>{}},t=>{vB({}),o&&(hB.c=o),a&&(i.$$events=a),l=e(t,i)||{},yB()},c);var s=new Set,u=e=>{for(var t=0;t<e.length;t++){var r=e[t];if(!s.has(r)){s.add(r);var i=NU(r);for(var a of[n,document]){var o=IU.get(a);o===void 0&&(o=new Map,IU.set(a,o));var c=o.get(r);c===void 0?(a.addEventListener(r,CU,{passive:i}),o.set(r,1)):o.set(r,c+1)}}}};return u(Oz(vU)),yU.add(u),()=>{for(var e of s)for(var i of[n,document]){var a=IU.get(i),o=a.get(e);--o==0?(i.removeEventListener(e,CU),a.delete(e),a.size===0&&IU.delete(i)):a.set(e,o)}var c;(yU.delete(u),t!==r)&&((c=t.parentNode)==null||c.removeChild(t))}});return LU.set(l,u),l}(e,t)}var IU=new Map,LU=new WeakMap,RU=new WeakMap,zU=new WeakMap,BU=new WeakMap,VU=new WeakMap,HU=new WeakMap,UU=new WeakMap,WU=new WeakMap,GU=class{constructor(e){var t=this,n=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];yz(this,`anchor`,void 0),hz(this,RU,new Map),hz(this,zU,new Map),hz(this,BU,new Map),hz(this,VU,new Set),hz(this,HU,!0),hz(this,UU,e=>{if(z(RU,this).has(e)){var n=z(RU,this).get(e),r=z(zU,this).get(n);if(r)zH(r),z(VU,this).delete(n);else{var i=z(BU,this).get(n);i&&(z(zU,this).set(n,i.effect),z(BU,this).delete(n),i.fragment.lastChild.remove(),this.anchor.before(i.fragment),r=i.effect)}for(var[a,o]of z(RU,this)){if(z(RU,this).delete(a),a===e)break;var s=z(BU,this).get(o);s&&(PH(s.effect),z(BU,this).delete(o))}var c=function(e,i){if(e===n||z(VU,t).has(e))return 1;var a=()=>{if(Array.from(z(RU,t).values()).includes(e)){var n=document.createDocumentFragment();VH(i,n),n.append(fH()),z(BU,t).set(e,{effect:i,fragment:n})}else PH(i);z(VU,t).delete(e),z(zU,t).delete(e)};z(HU,t)||!r?(z(VU,t).add(e),LH(i,a,!1)):a()};for(var[l,u]of z(zU,this))c(l,u)}}),hz(this,WU,e=>{z(RU,this).delete(e);var t=Array.from(z(RU,this).values());for(var[n,r]of z(BU,this))t.includes(n)||(PH(r.effect),z(BU,this).delete(n))}),this.anchor=e,_z(HU,this,n)}ensure(e,t){var n=FB;!t||z(zU,this).has(e)||z(BU,this).has(e)||z(zU,this).set(e,jH(()=>t(this.anchor))),z(RU,this).set(n,e),z(UU,this).call(this,n)}};function KU(e){hB===null&&dB(),Sz&&hB.l!==null?XU(hB).m.push(e):wH(()=>{var t=q(e);if(typeof t==`function`)return t})}function qU(e){hB===null&&dB(),KU(()=>()=>q(e))}function JU(){var e=hB;return e===null&&dB(),(t,n,r)=>{var i=e.s.$$events?.[t];if(i){var a=Tz(i)?i.slice():[i],o=function(e,t){var{bubbles:n=!1,cancelable:r=!1}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return new CustomEvent(e,{detail:t,bubbles:n,cancelable:r})}(t,n,r);for(var s of a)s.call(e.x,o);return!o.defaultPrevented}return!0}}function YU(e){hB===null&&dB(),hB.l===null&&function(){throw Error(`https://svelte.dev/e/lifecycle_legacy_only`)}(),XU(hB).b.push(e)}function XU(e){var t=e.l;return t.u??={a:[],b:[],m:[]}}function Q(e,t){var n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=new GU(e);function i(e,t){r.ensure(e,t)}kH(()=>{var e=!1;t(function(t){e=!0,i(arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t)}),e||i(-1,null)},n?$z:0)}var ZU,QU=Symbol(`NaN`);function $U(e,t,n){var r=new GU(e),i=!bB();kH(()=>{var e=t();e!=e&&(e=QU),i&&typeof e==`object`&&e&&(e={}),r.ensure(e,n)})}function eW(e,t){return t}function tW(e,t){var n,r=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];if(e.pending.size>0)for(var i of(n=new Set,e.pending.values()))for(var a of i)n.add(e.items.get(a).e);for(var o=0;o<t.length;o++){var s,c=t[o];(s=n)!=null&&s.has(c)?(c.f|=nB,VH(c,document.createDocumentFragment())):PH(t[o],r)}}function nW(e,t,n,r,i){var a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:null,o=e,s=new Map;!(4&t)||(o=e.appendChild(fH()));var c,l=null,u=GV(()=>{var e=n();return Tz(e)?e:e==null?[]:Oz(e)}),d=new Map,f=!0;function p(e){(m.effect.f&Xz)===0&&(m.pending.delete(e),m.fallback=l,function(e,t,n,r,i){var a,o,s,c,l,u=!!(8&r),d=t.length,f=e.items,p=rW(e.effect.first),m=null,h=[],g=[];if(u)for(l=0;l<d;l+=1){var _;s=i(t[l],l),((c=f.get(s).e).f&nB)===0&&((_=c.nodes)==null||(_=_.a)==null||_.measure(),(o??=new Set).add(c))}for(l=0;l<d;l+=1){if(s=i(t[l],l),c=f.get(s).e,e.outrogroups!==null)for(var v of e.outrogroups)v.pending.delete(c),v.done.delete(c);var y;if((c.f&Yz)!==0&&(zH(c),u&&((y=c.nodes)==null||(y=y.a)==null||y.unfix(),(o??=new Set).delete(c))),(c.f&nB)!==0){if(c.f^=nB,c!==p){var b=m?m.next:p;c===e.effect.last&&(e.effect.last=c.prev),c.prev&&(c.prev.next=c.next),c.next&&(c.next.prev=c.prev),oW(e,m,c),oW(e,c,b),aW(c,b,n),h=[],g=[],p=rW((m=c).next);continue}aW(c,null,n)}if(c!==p){if(a!==void 0&&a.has(c)){if(h.length<g.length){var x,S=g[0];m=S.prev;var C=h[0],w=h[h.length-1];for(x=0;x<h.length;x+=1)aW(h[x],S,n);for(x=0;x<g.length;x+=1)a.delete(g[x]);oW(e,C.prev,w.next),oW(e,m,C),oW(e,w,S),p=S,m=w,--l,h=[],g=[]}else a.delete(c),aW(c,p,n),oW(e,c.prev,c.next),oW(e,c,m===null?e.effect.first:m.next),oW(e,m,c),m=c;continue}for(h=[],g=[];p!==null&&p!==c;)(a??=new Set).add(p),g.push(p),p=rW(p.next);if(p===null)continue}(c.f&nB)===0&&h.push(c),m=c,p=rW(c.next)}if(e.outrogroups!==null){for(var T of e.outrogroups){var E;T.pending.size===0&&(tW(e,Oz(T.done)),(E=e.outrogroups)==null||E.delete(T))}e.outrogroups.size===0&&(e.outrogroups=null)}if(p!==null||a!==void 0){var ee=[];if(a!==void 0)for(c of a)(c.f&Yz)===0&&ee.push(c);for(;p!==null;)(p.f&Yz)===0&&p!==e.fallback&&ee.push(p),p=rW(p.next);var te=ee.length;if(te>0){var D=4&r&&d===0?n:null;if(u){for(l=0;l<te;l+=1){var ne;(ne=ee[l].nodes)==null||(ne=ne.a)==null||ne.measure()}for(l=0;l<te;l+=1){var re;(re=ee[l].nodes)==null||(re=re.a)==null||re.fix()}}(function(e,t,n){for(var r,i=t.length,a=t.length,o=function(){var n=t[s];LH(n,()=>{if(r){if(r.pending.delete(n),r.done.add(n),r.pending.size===0){var t=e.outrogroups;tW(e,Oz(r.done)),t.delete(r),t.size===0&&(e.outrogroups=null)}}else --a},!1)},s=0;s<i;s++)o();if(a===0){var c=n!==null;if(c){var l=n,u=l.parentNode;u.textContent=``,u.append(l),e.items.clear()}tW(e,t,!c)}else r={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(r)})(e,ee,D)}}u&&wB(()=>{if(o!==void 0)for(c of o){var e;(e=c.nodes)==null||(e=e.a)==null||e.apply()}})}(m,c,o,t,r),l!==null&&(c.length===0?(l.f&nB)===0?zH(l):(l.f^=nB,aW(l,null,o)):LH(l,()=>{l=null})))}var m={effect:kH(()=>{for(var e=(c=K(u)).length,m=new Set,h=FB,g=0;g<e;g+=1){var _=c[g],v=r(_,g),y=f?null:s.get(v);y?(y.v&&aH(y.v,_),y.i&&aH(y.i,g)):(y=iW(s,f?o:ZU??=fH(),_,v,g,i,t,n),f||(y.e.f|=nB),s.set(v,y)),m.add(v)}(e===0&&a&&!l&&(f?l=jH(()=>a(o)):(l=jH(()=>a(ZU??=fH()))).f|=nB),e>m.size&&function(){throw Error(`https://svelte.dev/e/each_key_duplicate`)}(),f)||(d.set(h,m),p(h)),K(u)}),items:s,pending:d,outrogroups:null,fallback:l};f=!1}function rW(e){for(;e!==null&&(e.f&Uz)===0;)e=e.next;return e}function iW(e,t,n,r,i,a,o,s){var c=1&o?16&o?nH(n):B(n,!1,!1):null,l=2&o?nH(i):null;return{v:c,i:l,e:jH(()=>(a(t,c??n,l??i,s),()=>{e.delete(r)}))}}function aW(e,t,n){if(e.nodes)for(var r=e.nodes.start,i=e.nodes.end,a=t&&(t.f&nB)===0?t.nodes.start:n;r!==null;){var o=mH(r);if(a.before(r),r===i)return;r=o}}function oW(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function sW(e,t){var n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=arguments.length>3&&arguments[3]!==void 0&&arguments[3],i=arguments.length>4&&arguments[4]!==void 0&&arguments[4],a=e,o=``;if(n)var s=e;G(()=>{var e=JH;if(o!==(o=t()??``)){if(n)return e.nodes=null,s.innerHTML=o,void(o!==``&&EU(pH(s),s.lastChild));if(e.nodes!==null&&(FH(e.nodes.start,e.nodes.end),e.nodes=null),o!==``){var c=gH(r?`svg`:i?`math`:`template`,r?`http://www.w3.org/2000/svg`:i?`http://www.w3.org/1998/Math/MathML`:void 0);c.innerHTML=o;var l=r||i?c:c.content;if(EU(pH(l),l.lastChild),r||i)for(;pH(l);)a.before(pH(l));else a.before(l)}}})}function cW(e,t,n,r,i){var a=t.$$slots?.[n],o=!1;!0===a&&(a=t[n===`default`?`children`:n],o=!0),a===void 0?i!==null&&i(e):a(e,o?()=>r:r)}function lW(e,t,n){var r=new GU(e);kH(()=>{var e=t()??null;r.ensure(e,e&&(t=>n(t,e)))},$z)}function uW(e,t,n){EH(()=>{var r=q(()=>t(e,n?.())||{});if(n&&r!=null&&r.update){var i=!1,a={};OH(()=>{var e=n();J(e),i&&pB(a,e)&&(a=e,r.update(e))}),i=!0}if(r!=null&&r.destroy)return()=>r.destroy()})}function dW(e,t){var n,r=void 0;AH(()=>{r!==(r=t())&&(n&&=(PH(n),null),r&&(n=jH(()=>{EH(()=>r(e))})))})}function fW(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=fW(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function pW(e){return typeof e==`object`?function(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=fW(e))&&(r&&(r+=` `),r+=t);return r}(e):e??``}var mW=[...`
|
|
44
|
-
\r\f\xA0\v`];function hW(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1]?` !important;`:`;`,n=``;for(var r of Object.keys(e)){var i=e[r];i!=null&&i!==``&&(n+=` `+r+`: `+i+t)}return n}function gW(e){return e[0]!==`-`||e[1]!==`-`?e.toLowerCase():e}function _W(e,t,n,r,i,a){var o=e.__className;if(o!==n||o===void 0){var s=function(e,t,n){var r=e==null?``:``+e;if(t&&(r=r?r+` `+t:t),n){for(var i of Object.keys(n))if(n[i])r=r?r+` `+i:i;else if(r.length)for(var a=i.length,o=0;(o=r.indexOf(i,o))>=0;){var s=o+a;o!==0&&!mW.includes(r[o-1])||s!==r.length&&!mW.includes(r[s])?o=s:r=(o===0?``:r.substring(0,o))+r.substring(s+1)}}return r===``?null:r}(n,r,a);s==null?e.removeAttribute(`class`):t?e.className=s:e.setAttribute(`class`,s),e.__className=n}else if(a&&i!==a)for(var c in a){var l=!!a[c];i!=null&&l===!!i[c]||e.classList.toggle(c,l)}return a}function vW(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;for(var i in n){var a=n[i];t[i]!==a&&(n[i]==null?e.style.removeProperty(i):e.style.setProperty(i,a,r))}}function yW(e,t,n,r){if(e.__style!==t){var i=function(e,t){if(t){var n,r,i=``;if(Array.isArray(t)?(n=t[0],r=t[1]):n=t,e){e=String(e).replaceAll(/\s*\/\*.*?\*\/\s*/g,``).trim();var a=!1,o=0,s=!1,c=[];n&&c.push(...Object.keys(n).map(gW)),r&&c.push(...Object.keys(r).map(gW));for(var l=0,u=-1,d=e.length,f=0;f<d;f++){var p=e[f];if(s?p===`/`&&e[f-1]===`*`&&(s=!1):a?a===p&&(a=!1):p===`/`&&e[f+1]===`*`?s=!0:p===`"`||p===`'`?a=p:p===`(`?o++:p===`)`&&o--,!s&&!1===a&&o===0){if(p===`:`&&u===-1)u=f;else if(p===`;`||f===d-1){if(u!==-1){var m=gW(e.substring(l,u).trim());c.includes(m)||(p!==`;`&&f++,i+=` `+e.substring(l,f).trim()+`;`)}l=f+1,u=-1}}}}return n&&(i+=hW(n)),r&&(i+=hW(r,!0)),(i=i.trim())===``?null:i}return e==null?null:String(e)}(t,r);i==null?e.removeAttribute(`style`):e.style.cssText=i,e.__style=t}else r&&(Array.isArray(r)?(vW(e,n?.[0],r[0]),vW(e,n?.[1],r[1],`important`)):vW(e,n,r));return r}function bW(e,t){var n=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(e.multiple){if(t==null)return;if(!Tz(t))return void console.warn(`https://svelte.dev/e/select_multiple_invalid_value`);for(var r of e.options)r.selected=t.includes(SW(r))}else{for(r of e.options)if(dH(SW(r),t))return void(r.selected=!0);n&&t===void 0||(e.selectedIndex=-1)}}function xW(e){var t=new MutationObserver(()=>{bW(e,e.__value)});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`value`]}),CH(()=>{t.disconnect()})}function SW(e){return`__value`in e?e.__value:e.value}var CW=Symbol(`class`),wW=Symbol(`style`),TW=Symbol(`is custom element`),EW=Symbol(`is html`),DW=uB?`option`:`OPTION`,OW=uB?`select`:`SELECT`,kW=uB?`progress`:`PROGRESS`;function AW(e,t){var n=PW(e);n.value!==(n.value=t??void 0)&&(e.value!==t||t===0&&e.nodeName===kW)&&(e.value=t??``)}function jW(e,t,n,r){var i=PW(e);i[t]!==(i[t]=n)&&(t===`loading`&&(e[cB]=n),n==null?e.removeAttribute(t):typeof n!=`string`&&IW(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function MW(e,t,n,r){var i=PW(e),a=i[TW],o=!i[EW],s=t||{},c=e.nodeName===DW;for(var l in t)l in n||(n[l]=null);(n.class?n.class=pW(n.class):(r||n[CW])&&(n.class=null),n[wW])&&(n.style??=null);var u,d,f,p,m,h,g=IW(e),_=function(l){var _=n[l];if(c&&l===`value`&&_==null)return e.value=e.__value=``,s[l]=_,0;if(l===`class`)return u=e.namespaceURI===`http://www.w3.org/1999/xhtml`,_W(e,u,_,r,t?.[CW],n[CW]),s[l]=_,s[CW]=n[CW],0;if(l===`style`)return yW(e,_,t?.[wW],n[wW]),s[l]=_,s[wW]=n[wW],0;if(_===(d=s[l])&&(_!==void 0||!e.hasAttribute(l))||(s[l]=_,(f=l[0]+l[1])===`$$`))return 0;if(f===`on`){var v={},y=`$$`+l,b=l.slice(2);if(p=function(e){return AU.includes(e)}(b),function(e){return e.endsWith(`capture`)&&e!==`gotpointercapture`&&e!==`lostpointercapture`}(b)&&(b=b.slice(0,-7),v.capture=!0),!p&&d){if(_!=null)return 0;e.removeEventListener(b,s[y],v),s[y]=null}if(p)xU(b,e,_),SU([b]);else if(_!=null){function t(e){s[l].call(this,e)}s[y]=bU(b,e,t,v)}}else if(l===`style`)jW(e,l,_);else if(l===`autofocus`)(function(e,t){if(t){var n=document.body;e.autofocus=!0,wB(()=>{document.activeElement===n&&e.focus()})}})(e,!!_);else if(a||l!==`__value`&&(l!==`value`||_==null))if(l===`selected`&&c)(function(e,t){t?e.hasAttribute(`selected`)||e.setAttribute(`selected`,``):e.removeAttribute(`selected`)})(e,_);else if(m=l,o||(m=function(e){return e=e.toLowerCase(),jU[e]??e}(m)),h=m===`defaultValue`||m===`defaultChecked`,_!=null||a||h)h||g.includes(m)&&(a||typeof _!=`string`)?(e[m]=_,m in i&&(i[m]=Cz)):typeof _!=`function`&&jW(e,m,_);else if(i[l]=null,m===`value`||m===`checked`){var x=e,S=t===void 0;if(m===`value`){var C=x.defaultValue;x.removeAttribute(m),x.defaultValue=C,x.value=x.__value=S?C:null}else{var w=x.defaultChecked;x.removeAttribute(m),x.defaultChecked=w,x.checked=!!S&&w}}else e.removeAttribute(l);else e.value=e.__value=_};for(var v in n)_(v);return s}function NW(e,t){var n=arguments.length>5?arguments[5]:void 0,r=arguments.length>6&&arguments[6]!==void 0&&arguments[6],i=arguments.length>7&&arguments[7]!==void 0&&arguments[7];BV(arguments.length>4&&arguments[4]!==void 0?arguments[4]:[],arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],arguments.length>3&&arguments[3]!==void 0?arguments[3]:[],a=>{var o=void 0,s={},c=e.nodeName===OW,l=!1;if(AH(()=>{var u=t(...a.map(K)),d=MW(e,o,u,n,r,i);for(var f of(l&&c&&`value`in u&&bW(e,u.value),Object.getOwnPropertySymbols(s)))u[f]||PH(s[f]);for(var p of Object.getOwnPropertySymbols(u)){var m=u[p];p.description!==`@attach`||o&&m===o[p]||(s[p]&&PH(s[p]),s[p]=jH(()=>dW(e,()=>m))),d[p]=m}o=d}),c){var u=e;EH(()=>{bW(u,o.value,!0),xW(u)})}l=!0})}function PW(e){return e.__attributes??={[TW]:e.nodeName.includes(`-`),[EW]:e.namespaceURI===wz}}var FW=new Map;function IW(e){var t,n=e.getAttribute(`is`)||e.nodeName,r=FW.get(n);if(r)return r;FW.set(n,r=[]);for(var i=e,a=Element.prototype;a!==i;){for(var o in t=jz(i))t[o].set&&r.push(o);i=Pz(i)}return r}function LW(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t,r=new WeakSet;yH(e,`input`,function(){var i=pz(function*(i){var a=i?e.defaultValue:e.value;if(a=RW(e)?zW(a):a,n(a),FB!==null&&r.add(FB),yield fU(),a!==(a=t())){var o=e.selectionStart,s=e.selectionEnd,c=e.value.length;if(e.value=a??``,s!==null){var l=e.value.length;o===s&&s===c&&l>c?(e.selectionStart=l,e.selectionEnd=l):(e.selectionStart=o,e.selectionEnd=Math.min(s,l))}}});return function(e){return i.apply(this,arguments)}}()),q(t)==null&&e.value&&(n(RW(e)?zW(e.value):e.value),FB!==null&&r.add(FB)),OH(()=>{var n=t();if(e===document.activeElement){var i=FB;if(r.has(i))return}RW(e)&&n===zW(e.value)||(e.type!==`date`||n||e.value)&&n!==e.value&&(e.value=n??``)})}function RW(e){var t=e.type;return t===`number`||t===`range`}function zW(e){return e===``?null:+e}function BW(e,t,n){var r=Az(e,t);r&&r.set&&(e[t]=n,CH(()=>{e[t]=null}))}function VW(e,t){return e===t||e?.[oB]===t}function HW(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=hB.r,i=JH;return EH(()=>{var a,o;return OH(()=>{a=o,o=[],q(()=>{e!==n(...o)&&(t(e,...o),a&&VW(n(...a),e)&&t(null,...a))})}),()=>{for(var a=i;a!==r&&a.parent!==null&&a.parent.f&Qz;)a=a.parent;var s=a.teardown;a.teardown=()=>{o&&VW(n(...o),e)&&t(null,...o),s?.()}}}),e}function UW(e){return function(){var t=[...arguments];return t[0].stopPropagation(),e?.apply(this,t)}}function WW(e){return function(){var t=[...arguments];return t[0].preventDefault(),e?.apply(this,t)}}function GW(){var e=arguments.length>0&&arguments[0]!==void 0&&arguments[0],t=hB,n=t.l.u;if(n){var r,i=()=>J(t.s);if(e){var a=0,o={},s=UV(()=>{var e=!1,n=t.s;for(var r in n)n[r]!==o[r]&&(o[r]=n[r],e=!0);return e&&a++,a});i=()=>K(s)}n.b.length&&(r=()=>{KW(t,i),zz(n.b)},bH(),xH(1048584,r)),wH(()=>{var e=q(()=>n.m.map(Rz));return()=>{for(var t of e)typeof t==`function`&&t()}}),n.a.length&&wH(()=>{KW(t,i),zz(n.a)})}}function KW(e,t){if(e.l.s)for(var n of e.l.s)K(n);t()}function qW(e){var t=nH(0);return function(){return arguments.length===1?(V(t,K(t)+1),arguments[0]):(K(t),e())}}function JW(e,t){var n=e.$$events?.[t.type];for(var r of Tz(n)?n.slice():n==null?[]:[n])r.call(this,t)}var YW={get(e,t){if(!e.exclude.includes(t))return K(e.version),t in e.special?e.special[t]():e.props[t]},set(e,t,n){if(!(t in e.special)){var r=JH;try{YH(e.parent_effect),e.special[t]=$({get[t](){return e.props[t]}},t,4)}finally{YH(r)}}return e.special[t](n),oH(e.version),!0},getOwnPropertyDescriptor(e,t){if(!e.exclude.includes(t))return t in e.props?{enumerable:!0,configurable:!0,value:e.props[t]}:void 0},deleteProperty:(e,t)=>(e.exclude.includes(t)||(e.exclude.push(t),oH(e.version)),!0),has:(e,t)=>!e.exclude.includes(t)&&t in e.props,ownKeys:e=>Reflect.ownKeys(e.props).filter(t=>!e.exclude.includes(t))};function XW(e,t){return new Proxy({props:e,exclude:t,special:{},version:nH(0),parent_effect:JH},YW)}var ZW={get(e,t){for(var n=e.props.length;n--;){var r=e.props[n];if(Iz(r)&&(r=r()),typeof r==`object`&&r&&t in r)return r[t]}},set(e,t,n){for(var r=e.props.length;r--;){var i=e.props[r];Iz(i)&&(i=i());var a=Az(i,t);if(a&&a.set)return a.set(n),!0}return!1},getOwnPropertyDescriptor(e,t){for(var n=e.props.length;n--;){var r=e.props[n];if(Iz(r)&&(r=r()),typeof r==`object`&&r&&t in r){var i=Az(r,t);return i&&!i.configurable&&(i.configurable=!0),i}}},has(e,t){if(t===oB||t===sB)return!1;for(var n of e.props)if(Iz(n)&&(n=n()),n!=null&&t in n)return!0;return!1},ownKeys(e){var t=[];for(var n of e.props)if(Iz(n)&&(n=n()),n){for(var r in n)t.includes(r)||t.push(r);for(var i of Object.getOwnPropertySymbols(n))t.includes(i)||t.push(i)}return t}};function QW(){return new Proxy({props:[...arguments]},ZW)}function $(e,t,n,r){var i,a,o=!Sz||!!(2&n),s=!!(8&n),c=!!(16&n),l=r,u=!0,d=()=>(u&&(u=!1,l=c?q(r):r),l);if(s){var f=oB in e||sB in e;i=Az(e,t)?.set??(f&&t in e?n=>e[t]=n:void 0)}var p,m=!1;if(s?[a,m]=function(e){var t=NB;try{return NB=!1,[e(),NB]}finally{NB=t}}(()=>e[t]):a=e[t],a===void 0&&r!==void 0&&(a=d(),i&&(o&&function(){throw Error(`https://svelte.dev/e/props_invalid_value`)}(),i(a))),p=o?()=>{var n=e[t];return n===void 0?d():(u=!0,n)}:()=>{var n=e[t];return n!==void 0&&(l=void 0),n===void 0?l:n},o&&!(4&n))return p;if(i){var h=e.$$legacy;return function(e,t){return arguments.length>0?(o&&t&&!h&&!m||i(t?p():e),e):p()}}var g=!1,_=(1&n?UV:GV)(()=>(g=!1,p()));s&&K(_);var v=JH;return function(e,t){if(arguments.length>0){var n=t?K(_):o&&s?lH(e):e;return V(_,n),g=!0,l!==void 0&&(l=n),e}return UH&&g||(v.f&Xz)!==0?_.v:K(_)}}function $W(e){if(!(arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(e){var t=function(e){try{if(typeof window<`u`&&window.localStorage!==void 0)return window.localStorage[e]}catch{}}(`debug`);return t!=null&&t.endsWith(`*`)?e.startsWith(t.slice(0,-1)):e===t}(e)))return eG;var t=function(e){for(var t=0,n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return tG[Math.abs(t)%tG.length]}(e);return function(){var n=[...arguments];console.log(`%c${e}`,`color:${t}`,...n)}}function eG(){}var tG=[`#0000CC`,`#0099FF`,`#009400`,`#8dd200`,`#CCCC00`,`#CC9933`,`#ae04e7`,`#ff35d7`,`#FF3333`,`#FF6600`,`#FF9933`,`#FFCC33`],nG=0;function rG(){return++nG}function iG(e){return parseInt(e,10)}function aG(e){return oG.test(e)}var oG=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function sG(e){return typeof e==`object`&&!!e&&(e.constructor===void 0||e.constructor.name===`Object`)}function cG(e){return typeof e==`object`&&!!e&&(e.constructor===void 0||e.constructor.name===`Object`||e.constructor.name===`Array`)}function lG(e){return!0===e||!1===e}function uG(e){if(typeof e==`number`)return e>9466848e5&&isFinite(e)&&Math.floor(e)===e&&!isNaN(new Date(e).valueOf());if(typeof e==`bigint`)return uG(Number(e));try{var t=e&&e.valueOf();if(t!==e)return uG(t)}catch{return!1}return!1}function dG(e){(fG||=window.document.createElement(`div`)).style.color=``,fG.style.color=e;var t=fG.style.color;return t===``?void 0:t.replace(/\s+/g,``).toLowerCase()}var fG=void 0;function pG(e){return typeof e==`string`&&e.length<99&&!!dG(e)}function mG(e,t){if(typeof e==`number`||typeof e==`string`||typeof e==`boolean`||e===void 0)return typeof e;if(typeof e==`bigint`)return`number`;if(e===null)return`null`;if(Array.isArray(e))return`array`;if(sG(e))return`object`;var n=t.stringify(e);return n&&aG(n)?`number`:n===`true`||n===`false`?`boolean`:n===`null`?`null`:`unknown`}var hG=/^https?:\/\/\S+$/;function gG(e){return typeof e==`string`&&hG.test(e)}function _G(e,t){if(e===``)return``;var n=e.trim();return n===`null`?null:n===`true`||n!==`false`&&(aG(n)?t.parse(n):e)}var vG=[];function yG(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function bG(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n={};if(!Array.isArray(e))throw TypeError(`Array expected`);function r(e,i){(!Array.isArray(e)&&!sG(e)||t&&i.length>0)&&(n[_c(i)]=!0),sG(e)&&Object.keys(e).forEach(t=>{r(e[t],i.concat(t))})}for(var i=Math.min(e.length,1e4),a=0;a<i;a++)r(e[a],vG);return Object.keys(n).sort().map(gc)}function xG(e,t,n){if(!(t<=e))for(var r=e;r<t;r++)n(r)}function SG(e,t){return e.length>t?e.slice(0,t):e}function CG(e){return R({},e)}function wG(e){return Object.values(e)}function TG(e,t,n,r){var i=e.slice(0),a=i.splice(t,n);return i.splice.apply(i,[t+r,0,...a]),i}function EG(e,t,n){return e.slice(0,t).concat(n).concat(e.slice(t))}function DG(e,t){try{return t.parse(e)}catch{return t.parse(yl(e))}}function OG(e,t){try{return DG(e,t)}catch{return}}function kG(e,t){e=e.replace(jG,``);try{return t(e)}catch{}try{return t(`{`+e+`}`)}catch{}try{return t(`[`+e+`]`)}catch{}throw Error(`Failed to parse partial JSON`)}function AG(e){e=e.replace(jG,``);try{return yl(e)}catch{}try{var t=yl(`[`+e+`]`);return t.substring(1,t.length-1)}catch{}try{var n=yl(`{`+e+`}`);return n.substring(1,n.length-1)}catch{}throw Error(`Failed to repair partial JSON`)}var jG=/,\s*$/;function MG(e,t){var n=HG.exec(t);if(n){var r=iG(n[2]),i=function(e,t){for(var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:e.length,i=0,a=n;a<r;a++)e.charAt(a)===t&&i++;return i}(e,`
|
|
40
|
+
`&&e.lineWrapping&&(r&&=L.single(r.main.anchor-1,r.main.head-1),n={from:i.from,to:i.to,insert:Bb.of([` `])}),n)return UT(e,n,r,a);if(r&&!r.main.eq(i)){let t=!1,n=`select`;return e.inputState.lastSelectionTime>Date.now()-50&&(e.inputState.lastSelectionOrigin==`select`&&(t=!0),n=e.inputState.lastSelectionOrigin),e.dispatch({selection:r,scrollIntoView:t,userEvent:n}),!0}else return!1}function UT(e,t,n,r=-1){if(AC.ios&&e.inputState.flushIOSKey(t))return!0;let i=e.state.selection.main;if(AC.android&&(t.to==i.to&&(t.from==i.from||t.from==i.from-1&&e.state.sliceDoc(t.from,i.from)==` `)&&t.insert.length==1&&t.insert.lines==2&&aC(e.contentDOM,`Enter`,13)||(t.from==i.from-1&&t.to==i.to&&t.insert.length==0||r==8&&t.insert.length<t.to-t.from&&t.to>i.head)&&aC(e.contentDOM,`Backspace`,8)||t.from==i.from&&t.to==i.to+1&&t.insert.length==0&&aC(e.contentDOM,`Delete`,46)))return!0;let a=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let o,s=()=>o||=WT(e,t,n);return e.state.facet(Fw).some(n=>n(e,t.from,t.to,a,s))||e.dispatch(s()),!0}function WT(e,t,n){let r,i=e.state,a=i.selection.main;if(t.from>=a.from&&t.to<=a.to&&t.to-t.from>=(a.to-a.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let n=a.from<t.from?i.sliceDoc(a.from,t.from):``,o=a.to>t.to?i.sliceDoc(t.to,a.to):``;r=i.replaceSelection(e.state.toText(n+t.insert.sliceString(0,void 0,e.state.lineBreak)+o))}else{let o=i.changes(t),s=n&&n.main.to<=o.newLength?n.main:void 0;if(i.selection.ranges.length>1&&e.inputState.composing>=0&&t.to<=a.to&&t.to>=a.to-10){let c=e.state.sliceDoc(t.from,t.to),l,u=n&&dT(e,n.main.head);if(u){let e=t.insert.length-(t.to-t.from);l={from:u.from,to:u.to-e}}else l=e.state.doc.lineAt(a.head);let d=a.to-t.to,f=a.to-a.from;r=i.changeByRange(n=>{if(n.from==a.from&&n.to==a.to)return{changes:o,range:s||n.map(o)};let r=n.to-d,u=r-c.length;if(n.to-n.from!=f||e.state.sliceDoc(u,r)!=c||n.to>=l.from&&n.from<=l.to)return{range:n};let p=i.changes({from:u,to:r,insert:t.insert}),m=n.to-a.to;return{changes:p,range:s?L.range(Math.max(0,s.anchor+m),Math.max(0,s.head+m)):n.map(p)}})}else r={changes:o,selection:s&&i.selection.replaceRange(s)}}let o=`input.type`;return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,o+=`.compose`,e.inputState.compositionFirstChange&&(o+=`.start`,e.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:o,scrollIntoView:!0})}function GT(e,t,n,r){let i=Math.min(e.length,t.length),a=0;for(;a<i&&e.charCodeAt(a)==t.charCodeAt(a);)a++;if(a==i&&e.length==t.length)return null;let o=e.length,s=t.length;for(;o>0&&s>0&&e.charCodeAt(o-1)==t.charCodeAt(s-1);)o--,s--;if(r==`end`){let e=Math.max(0,a-Math.min(o,s));n-=o+e-a}if(o<a&&e.length<t.length){let e=n<=a&&n>=o?a-n:0;a-=e,s=a+(s-o),o=a}else if(s<a){let e=n<=a&&n>=s?a-n:0;a-=e,o=a+(o-s),s=a}return{from:a,toA:o,toB:s}}function KT(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}=e.observer.selectionRange;return n&&(t.push(new BT(n,r)),(i!=n||a!=r)&&t.push(new BT(i,a))),t}function qT(e,t){if(e.length==0)return null;let n=e[0].pos,r=e.length==2?e[1].pos:n;return n>-1&&r>-1?L.single(n+t,r+t):null}var JT=class{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,AC.safari&&e.contentDOM.addEventListener(`input`,()=>null),AC.gecko&&ME(e.contentDOM.ownerDocument)}handleEvent(e){!sE(this.view,e)||this.ignoreDuringComposition(e)||e.type==`keydown`&&this.keydown(e)||(this.view.updateState==0?this.runHandlers(e.type,e):Promise.resolve().then(()=>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=XT(e),n=this.handlers,r=this.view.contentDOM;for(let e in t)if(e!=`scroll`){let i=!t[e].handlers.length,a=n[e];a&&i!=!a.handlers.length&&(r.removeEventListener(e,this.handleEvent),a=null),a||r.addEventListener(e,this.handleEvent,{passive:i})}for(let e in n)e!=`scroll`&&!t[e]&&r.removeEventListener(e,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&$T.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),AC.android&&AC.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return AC.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((t=ZT.find(t=>t.keyCode==e.keyCode))&&!e.ctrlKey||QT.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key==`Enter`&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,aC(this.view.contentDOM,t.key,t.keyCode,t instanceof KeyboardEvent?t:void 0))}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:AC.safari&&!AC.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}};function YT(e,t){return(n,r)=>{try{return t.call(e,r,n)}catch(e){Gw(n.state,e)}}}function XT(e){let t=Object.create(null);function n(e){return t[e]||(t[e]={observers:[],handlers:[]})}for(let t of e){let e=t.spec;if(e&&e.domEventHandlers)for(let r in e.domEventHandlers){let i=e.domEventHandlers[r];i&&n(r).handlers.push(YT(t.value,i))}if(e&&e.domEventObservers)for(let r in e.domEventObservers){let i=e.domEventObservers[r];i&&n(r).observers.push(YT(t.value,i))}}for(let e in cE)n(e).handlers.push(cE[e]);for(let e in lE)n(e).observers.push(lE[e]);return t}var ZT=[{key:`Backspace`,keyCode:8,inputType:`deleteContentBackward`},{key:`Enter`,keyCode:13,inputType:`insertParagraph`},{key:`Enter`,keyCode:13,inputType:`insertLineBreak`},{key:`Delete`,keyCode:46,inputType:`deleteContentForward`}],QT=`dthko`,$T=[16,17,18,20,91,92,224,225],eE=6;function tE(e){return Math.max(0,e)*.7+8}function nE(e,t){return Math.max(Math.abs(e.clientX-t.clientX),Math.abs(e.clientY-t.clientY))}var rE=class{constructor(e,t,n,r){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=$S(e.contentDOM),this.atoms=e.state.facet(tT).map(t=>t(e));let i=e.contentDOM.ownerDocument;i.addEventListener(`mousemove`,this.move=this.move.bind(this)),i.addEventListener(`mouseup`,this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(aS.allowMultipleSelections)&&iE(e,t),this.dragging=oE(e,t)&&xE(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&nE(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,n=0,r=0,i=0,a=this.view.win.innerWidth,o=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:i,bottom:o}=this.scrollParents.y.getBoundingClientRect());let s=aT(this.view);e.clientX-s.left<=r+eE?t=-tE(r-e.clientX):e.clientX+s.right>=a-eE&&(t=tE(e.clientX-a)),e.clientY-s.top<=i+eE?n=-tE(i-e.clientY):e.clientY+s.bottom>=o-eE&&(n=tE(e.clientY-o)),this.setScrollSpeed(t,n)}up(e){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(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let n=0;n<e.ranges.length;n++){let r=e.ranges[n],i=null;if(r.empty){let e=FT(this.atoms,r.from,0);e!=r.from&&(i=L.cursor(e,-1))}else{let e=FT(this.atoms,r.from,-1),t=FT(this.atoms,r.to,1);(e!=r.from||t!=r.to)&&(i=L.range(r.from==r.anchor?e:t,r.from==r.head?e:t))}i&&(t||=e.ranges.slice(),t[n]=i)}return t?L.create(t,e.mainIndex):e}select(e){let{view:t}=this,n=this.skipAtoms(this.style.get(e,this.extend,this.multiple));(this.mustSelect||!n.eq(t.state.selection,this.dragging===!1))&&this.view.dispatch({selection:n,userEvent:`select.pointer`}),this.mustSelect=!1}update(e){e.transactions.some(e=>e.isUserEvent(`input.type`))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}};function iE(e,t){let n=e.state.facet(Aw);return n.length?n[0](t):AC.mac?t.metaKey:t.ctrlKey}function aE(e,t){let n=e.state.facet(jw);return n.length?n[0](t):AC.mac?!t.altKey:!t.ctrlKey}function oE(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let r=BS(e.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let e=0;e<i.length;e++){let n=i[e];if(n.left<=t.clientX&&n.right>=t.clientX&&n.top<=t.clientY&&n.bottom>=t.clientY)return!0}return!1}function sE(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target,r;n!=e.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=mC.get(n))&&r.ignoreEvent(t))return!1;return!0}var cE=Object.create(null),lE=Object.create(null),uE=AC.ie&&AC.ie_version<15||AC.ios&&AC.webkit_version<604;function lee(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(),fE(e,n.value)},50)}function dE(e,t,n){for(let r of e.facet(t))n=r(n,e);return n}function fE(e,t){t=dE(e.state,Lw,t);let{state:n}=e,r,i=1,a=n.toText(t),o=a.lines==n.selection.ranges.length;if(DE!=null&&n.selection.ranges.every(e=>e.empty)&&DE==a.toString()){let e=-1;r=n.changeByRange(r=>{let s=n.doc.lineAt(r.from);if(s.from==e)return{range:r};e=s.from;let c=n.toText((o?a.line(i++).text:t)+n.lineBreak);return{changes:{from:s.from,insert:c},range:L.cursor(r.from+c.length)}})}else r=o?n.changeByRange(e=>{let t=a.line(i++);return{changes:{from:e.from,to:e.to,insert:t.text},range:L.cursor(e.from+t.length)}}):n.replaceSelection(a);e.dispatch(r,{userEvent:`input.paste`,scrollIntoView:!0})}lE.scroll=e=>{e.inputState.lastScrollTop=e.scrollDOM.scrollTop,e.inputState.lastScrollLeft=e.scrollDOM.scrollLeft},cE.keydown=(e,t)=>(e.inputState.setSelectionOrigin(`select`),t.keyCode==27&&e.inputState.tabFocusMode!=0&&(e.inputState.tabFocusMode=Date.now()+2e3),!1),lE.touchstart=(e,t)=>{e.inputState.lastTouchTime=Date.now(),e.inputState.setSelectionOrigin(`select.pointer`)},lE.touchmove=e=>{e.inputState.setSelectionOrigin(`select.pointer`)},cE.mousedown=(e,t)=>{if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of e.state.facet(Mw))if(n=r(e,t),n)break;if(!n&&t.button==0&&(n=SE(e,t)),n){let r=!e.hasFocus;e.inputState.startMouseSelection(new rE(e,t,n,r)),r&&e.observer.ignore(()=>{nC(e.contentDOM);let t=e.root.activeElement;t&&!t.contains(e.contentDOM)&&t.blur()});let i=e.inputState.mouseSelection;if(i)return i.start(t),i.dragging===!1}return!1};function pE(e,t,n,r){if(r==1)return L.cursor(t,n);if(r==2)return vT(e.state,t,n);{let n=tw.find(e.docView,t),r=e.state.doc.lineAt(n?n.posAtEnd:t),i=n?n.posAtStart:r.from,a=n?n.posAtEnd:r.to;return a<e.state.doc.length&&a==r.to&&a++,L.range(i,a)}}var mE=(e,t,n)=>t>=n.top&&t<=n.bottom&&e>=n.left&&e<=n.right;function hE(e,t,n,r){let i=tw.find(e.docView,t);if(!i)return 1;let a=t-i.posAtStart;if(a==0)return 1;if(a==i.length)return-1;let o=i.coordsAt(a,-1);if(o&&mE(n,r,o))return-1;let s=i.coordsAt(a,1);return s&&mE(n,r,s)?1:o&&o.bottom>=r?-1:1}function gE(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1);return{pos:n,bias:hE(e,n,t.clientX,t.clientY)}}var _E=AC.ie&&AC.ie_version<=11,vE=null,yE=0,bE=0;function xE(e){if(!_E)return e.detail;let t=vE,n=bE;return vE=e,bE=Date.now(),yE=!t||n>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(yE+1)%3:1}function SE(e,t){let n=gE(e,t),r=xE(t),i=e.state.selection;return{update(e){e.docChanged&&(n.pos=e.changes.mapPos(n.pos),i=i.map(e.changes))},get(t,a,o){let s=gE(e,t),c,l=pE(e,s.pos,s.bias,r);if(n.pos!=s.pos&&!a){let t=pE(e,n.pos,n.bias,r),i=Math.min(t.from,l.from),a=Math.max(t.to,l.to);l=i<l.from?L.range(i,a):L.range(a,i)}return a?i.replaceRange(i.main.extend(l.from,l.to)):o&&r==1&&i.ranges.length>1&&(c=CE(i,s.pos))?c:o?i.addRange(l):L.create([l])}}}function CE(e,t){for(let n=0;n<e.ranges.length;n++){let{from:r,to:i}=e.ranges[n];if(r<=t&&i>=t)return L.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-+(e.mainIndex>n))}return null}cE.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let r=e.docView.nearest(t.target);if(r&&r.isWidget){let e=r.posAtStart,t=e+r.length;(e>=n.to||t<=n.from)&&(n=L.range(e,t))}}let{inputState:r}=e;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData(`Text`,dE(e.state,Rw,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed=`copyMove`),!1},cE.dragend=e=>(e.inputState.draggedContent=null,!1);function wE(e,t,n,r){if(n=dE(e.state,Lw,n),!n)return;let i=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:a}=e.inputState,o=r&&a&&aE(e,t)?{from:a.from,to:a.to}:null,s={from:i,insert:n},c=e.state.changes(o?[o,s]:s);e.focus(),e.dispatch({changes:c,selection:{anchor:c.mapPos(i,-1),head:c.mapPos(i,1)},userEvent:o?`move.drop`:`input.drop`}),e.inputState.draggedContent=null}cE.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,a=()=>{++i==n.length&&wE(e,t,r.filter(e=>e!=null).join(e.state.lineBreak),!1)};for(let e=0;e<n.length;e++){let t=new FileReader;t.onerror=a,t.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(t.result)||(r[e]=t.result),a()},t.readAsText(n[e])}return!0}else{let n=t.dataTransfer.getData(`Text`);if(n)return wE(e,t,n,!0),!0}return!1},cE.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=uE?null:t.clipboardData;return n?(fE(e,n.getData(`text/plain`)||n.getData(`text/uri-list`)),!0):(lee(e),!1)};function TE(e,t){let n=e.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement(`textarea`));r.style.cssText=`position: fixed; left: -10000px; top: 10px`,r.value=t,r.focus(),r.selectionEnd=t.length,r.selectionStart=0,setTimeout(()=>{r.remove(),e.focus()},50)}function EE(e){let t=[],n=[],r=!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 i=-1;for(let{from:r}of e.selection.ranges){let a=e.doc.lineAt(r);a.number>i&&(t.push(a.text),n.push({from:a.from,to:Math.min(e.doc.length,a.to+1)})),i=a.number}r=!0}return{text:dE(e,Rw,t.join(e.lineBreak)),ranges:n,linewise:r}}var DE=null;cE.copy=cE.cut=(e,t)=>{let{text:n,ranges:r,linewise:i}=EE(e.state);if(!n&&!i)return!1;DE=i?n:null,t.type==`cut`&&!e.state.readOnly&&e.dispatch({changes:r,scrollIntoView:!0,userEvent:`delete.cut`});let a=uE?null:t.clipboardData;return a?(a.clearData(),a.setData(`text/plain`,n),!0):(TE(e,n),!1)};var OE=Vx.define();function kE(e,t){let n=[];for(let r of e.facet(Iw)){let i=r(e,t);i&&n.push(i)}return n?e.update({effects:n,annotations:OE.of(!0)}):null}function AE(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=kE(e.state,t);n?e.dispatch(n):e.update([])}},10)}lE.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),AE(e)},lE.blur=e=>{e.observer.clearSelectionRange(),AE(e)},lE.compositionstart=lE.compositionupdate=e=>{e.observer.editContext||(e.inputState.compositionFirstChange??(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))},lE.compositionend=e=>{e.observer.editContext||(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,AC.chrome&&AC.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))},lE.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()},cE.beforeinput=(e,t)=>{if(t.inputType==`insertReplacementText`&&e.observer.editContext){let n=t.dataTransfer?.getData(`text/plain`),r=t.getTargetRanges();if(n&&r.length){let t=r[0];return UT(e,{from:e.posAtDOM(t.startContainer,t.startOffset),to:e.posAtDOM(t.endContainer,t.endOffset),insert:e.state.toText(n)},null),!0}}let n;if(AC.chrome&&AC.android&&(n=ZT.find(e=>e.inputType==t.inputType))&&(e.observer.delayAndroidKey(n.key,n.keyCode),n.key==`Backspace`||n.key==`Delete`)){let t=window.visualViewport?.height||0;setTimeout(()=>{(window.visualViewport?.height||0)>t+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())},100)}return AC.ios&&t.inputType==`deleteContentForward`&&e.observer.flushSoon(),AC.safari&&t.inputType==`insertText`&&e.inputState.composing>=0&&setTimeout(()=>lE.compositionend(e,t),20),!1};var jE=new Set;function ME(e){jE.has(e)||(jE.add(e),e.addEventListener(`copy`,()=>{}),e.addEventListener(`cut`,()=>{}))}var NE=[`pre-wrap`,`normal`,`pre-line`,`break-spaces`],PE=!1;function FE(){PE=!1}var IE=class{constructor(e){this.lineWrapping=e,this.doc=Bb.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}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 NE.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];r<0?n++:this.heightSamples[Math.floor(r*10)]||(t=!0,this.heightSamples[Math.floor(r*10)]=!0)}return t}refresh(e,t,n,r,i,a){let o=NE.indexOf(e)>-1,s=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=o;if(this.lineWrapping=o,this.lineHeight=t,this.charWidth=n,this.textHeight=r,this.lineLength=i,s){this.heightSamples={};for(let e=0;e<a.length;e++){let t=a[e];t<0?e++:this.heightSamples[Math.floor(t*10)]=!0}}return s}},LE=class{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}},RE=class e{constructor(e,t,n,r,i){this.from=e,this.length=t,this.top=n,this.height=r,this._content=i}get type(){return typeof this._content==`number`?qC.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof ZC?this._content.widget:null}get widgetLineBreaks(){return typeof this._content==`number`?this._content:0}join(t){let n=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(t._content)?t._content:[t]);return new e(this.from,this.length+t.length,this.top,this.height+t.height,n)}},zE=(function(e){return e[e.ByPos=0]=`ByPos`,e[e.ByHeight=1]=`ByHeight`,e[e.ByPosNoHeight=2]=`ByPosNoHeight`,e})(zE||={}),BE=.001,VE=class e{constructor(e,t,n=2){this.length=e,this.height=t,this.flags=n}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>BE&&(PE=!0),this.height=e)}replace(t,n,r){return e.of(r)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,r){let i=this,a=n.doc;for(let o=r.length-1;o>=0;o--){let{fromA:s,toA:c,fromB:l,toB:u}=r[o],d=i.lineAt(s,zE.ByPosNoHeight,n.setDoc(t),0,0),f=d.to>=c?d:i.lineAt(c,zE.ByPosNoHeight,n,0,0);for(u+=f.to-c,c=f.to;o>0&&d.from<=r[o-1].toA;)s=r[o-1].fromA,l=r[o-1].fromB,o--,s<d.from&&(d=i.lineAt(s,zE.ByPosNoHeight,n,0,0));l+=d.from-s,s=d.from;let p=YE.build(n.setDoc(a),e,l,u);i=HE(i,i.replace(s,c,p))}return i.updateHeight(n,0)}static empty(){return new WE(0,0)}static of(t){if(t.length==1)return t[0];let n=0,r=t.length,i=0,a=0;for(;;)if(n==r)if(i>a*2){let e=t[n-1];e.break?t.splice(--n,1,e.left,null,e.right):t.splice(--n,1,e.left,e.right),r+=1+e.break,i-=e.size}else if(a>i*2){let e=t[r];e.break?t.splice(r,1,e.left,null,e.right):t.splice(r,1,e.left,e.right),r+=2+e.break,a-=e.size}else break;else if(i<a){let e=t[n++];e&&(i+=e.size)}else{let e=t[--r];e&&(a+=e.size)}let o=0;return t[n-1]==null?(o=1,n--):t[n]??(o=1,r++),new KE(e.of(t.slice(0,n)),o,e.of(t.slice(r)))}};function HE(e,t){return e==t?e:(e.constructor!=t.constructor&&(PE=!0),t)}VE.prototype.size=1;var UE=class extends VE{constructor(e,t,n){super(e,t),this.deco=n}blockAt(e,t,n,r){return new RE(r,this.length,n,this.height,this.deco||0)}lineAt(e,t,n,r,i){return this.blockAt(0,n,r,i)}forEachLine(e,t,n,r,i,a){e<=i+this.length&&t>=i&&a(this.blockAt(0,n,r,i))}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more&&this.setHeight(r.heights[r.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}},WE=class e extends UE{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,n,r){return new RE(r,this.length,n,this.height,this.breaks)}replace(t,n,r){let i=r[0];return r.length==1&&(i instanceof e||i instanceof GE&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof GE?i=new e(i.length,this.height):i.height=this.height,this.outdated||(i.outdated=!1),i):VE.of(r)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more?this.setHeight(r.heights[r.index++]):(n||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:``}${this.widgetHeight?`:`+this.widgetHeight:``})`}},GE=class e extends VE{constructor(e){super(e,0)}heightMetrics(e,t){let n=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,i=r-n+1,a,o=0;if(e.lineWrapping){let t=Math.min(this.height,e.lineHeight*i);a=t/i,this.length>i+1&&(o=(this.height-t)/(this.length-i-1))}else a=this.height/i;return{firstLine:n,lastLine:r,perLine:a,perChar:o}}blockAt(e,t,n,r){let{firstLine:i,lastLine:a,perLine:o,perChar:s}=this.heightMetrics(t,r);if(t.lineWrapping){let i=r+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length)),a=t.doc.lineAt(i),c=o+a.length*s,l=Math.max(n,e-c/2);return new RE(a.from,a.length,l,c,0)}else{let r=Math.max(0,Math.min(a-i,Math.floor((e-n)/o))),{from:s,length:c}=t.doc.line(i+r);return new RE(s,c,n+o*r,o,0)}}lineAt(e,t,n,r,i){if(t==zE.ByHeight)return this.blockAt(e,n,r,i);if(t==zE.ByPosNoHeight){let{from:t,to:r}=n.doc.lineAt(e);return new RE(t,r-t,0,0,0)}let{firstLine:a,perLine:o,perChar:s}=this.heightMetrics(n,i),c=n.doc.lineAt(e),l=o+c.length*s,u=c.number-a,d=r+o*u+s*(c.from-i-u);return new RE(c.from,c.length,Math.max(r,Math.min(d,r+this.height-l)),l,0)}forEachLine(e,t,n,r,i,a){e=Math.max(e,i),t=Math.min(t,i+this.length);let{firstLine:o,perLine:s,perChar:c}=this.heightMetrics(n,i);for(let l=e,u=r;l<=t;){let t=n.doc.lineAt(l);if(l==e){let n=t.number-o;u+=s*n+c*(e-i-n)}let r=s+c*t.length;a(new RE(t.from,t.length,u,r,0)),u+=r,l=t.to+1}}replace(t,n,r){let i=this.length-n;if(i>0){let t=r[r.length-1];t instanceof e?r[r.length-1]=new e(t.length+i):r.push(null,new e(i-1))}if(t>0){let n=r[0];n instanceof e?r[0]=new e(t+n.length):r.unshift(new e(t-1),null)}return VE.of(r)}decomposeLeft(t,n){n.push(new e(t-1),null)}decomposeRight(t,n){n.push(null,new e(this.length-t-1))}updateHeight(t,n=0,r=!1,i){let a=n+this.length;if(i&&i.from<=n+this.length&&i.more){let r=[],o=Math.max(n,i.from),s=-1;for(i.from>n&&r.push(new e(i.from-n-1).updateHeight(t,n));o<=a&&i.more;){let e=t.doc.lineAt(o).length;r.length&&r.push(null);let n=i.heights[i.index++];s==-1?s=n:Math.abs(n-s)>=BE&&(s=-2);let a=new WE(e,n);a.outdated=!1,r.push(a),o+=e+1}o<=a&&r.push(null,new e(a-o).updateHeight(t,o));let c=VE.of(r);return(s<0||Math.abs(c.height-this.height)>=BE||Math.abs(s-this.heightMetrics(t,n).perLine)>=BE)&&(PE=!0),HE(this,c)}else (r||this.outdated)&&(this.setHeight(t.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}},KE=class extends VE{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 this.flags&1}blockAt(e,t,n,r){let i=n+this.left.height;return e<i?this.left.blockAt(e,t,n,r):this.right.blockAt(e,t,i,r+this.left.length+this.break)}lineAt(e,t,n,r,i){let a=r+this.left.height,o=i+this.left.length+this.break,s=t==zE.ByHeight?e<a:e<o,c=s?this.left.lineAt(e,t,n,r,i):this.right.lineAt(e,t,n,a,o);if(this.break||(s?c.to<o:c.from>o))return c;let l=t==zE.ByPosNoHeight?zE.ByPosNoHeight:zE.ByPos;return s?c.join(this.right.lineAt(o,l,n,a,o)):this.left.lineAt(o,l,n,r,i).join(c)}forEachLine(e,t,n,r,i,a){let o=r+this.left.height,s=i+this.left.length+this.break;if(this.break)e<s&&this.left.forEachLine(e,t,n,r,i,a),t>=s&&this.right.forEachLine(e,t,n,o,s,a);else{let c=this.lineAt(s,zE.ByPos,n,r,i);e<c.from&&this.left.forEachLine(e,c.from-1,n,r,i,a),c.to>=e&&c.from<=t&&a(c),t>c.to&&this.right.forEachLine(c.to+1,t,n,o,s,a)}}replace(e,t,n){let r=this.left.length+this.break;if(t<r)return this.balanced(this.left.replace(e,t,n),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,n));let i=[];e>0&&this.decomposeLeft(e,i);let a=i.length;for(let e of n)i.push(e);if(e>0&&qE(i,a-1),t<this.length){let e=i.length;this.decomposeRight(t,i),qE(i,e)}return VE.of(i)}decomposeLeft(e,t){let n=this.left.length;if(e<=n)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(n++,e>=n&&t.push(null)),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,r=n+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e<n&&this.left.decomposeRight(e,t),this.break&&e<r&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?VE.of(this.break?[e,null,t]:[e,t]):(this.left=HE(this.left,e),this.right=HE(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,n=!1,r){let{left:i,right:a}=this,o=t+i.length+this.break,s=null;return r&&r.from<=t+i.length&&r.more?s=i=i.updateHeight(e,t,n,r):i.updateHeight(e,t,n),r&&r.from<=o+a.length&&r.more?s=a=a.updateHeight(e,o,n,r):a.updateHeight(e,o,n),s?this.balanced(i,a):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?` `:`-`)+this.right}};function qE(e,t){let n,r;e[t]==null&&(n=e[t-1])instanceof GE&&(r=e[t+1])instanceof GE&&e.splice(t-1,3,new GE(n.length+1+r.length))}var JE=5,YE=class e{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 WE?n.length+=e-this.pos:(e>this.pos||!this.isCovered)&&this.nodes.push(new WE(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<t||n.heightRelevant){let r=n.widget?n.widget.estimatedHeight:0,i=n.widget?n.widget.lineBreaks:0;r<0&&(r=this.oracle.lineHeight);let a=t-e;n.block?this.addBlock(new UE(a,r,n)):(a||i||r>=JE)&&this.addLineDeco(r,i,a)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new WE(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let n=new GE(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 WE)return e;let t=new WE(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+=e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,n){let r=this.ensureLine();r.length+=n,r.collapsed+=n,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=t,this.writtenTo=this.pos+=n}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof WE)&&!this.isCovered?this.nodes.push(new WE(0,-1)):(this.writtenTo<this.pos||t==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let n=e;for(let e of this.nodes)e instanceof WE&&e.updateHeight(this.oracle,n),n+=e?e.length:1;return this.nodes}static build(t,n,r,i){let a=new e(r,t);return dS.spans(n,r,i,a,0),a.finish(r)}};function XE(e,t,n){let r=new ZE;return dS.compare(e,t,n,r,0),r.changes}var ZE=class{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,n,r){(e<t||n&&n.heightRelevant||r&&r.heightRelevant)&&ew(e,t,this.changes,5)}};function QE(e,t){let n=e.getBoundingClientRect(),r=e.ownerDocument,i=r.defaultView||window,a=Math.max(0,n.left),o=Math.min(i.innerWidth,n.right),s=Math.max(0,n.top),c=Math.min(i.innerHeight,n.bottom);for(let t=e.parentNode;t&&t!=r.body;)if(t.nodeType==1){let n=t,r=window.getComputedStyle(n);if((n.scrollHeight>n.clientHeight||n.scrollWidth>n.clientWidth)&&r.overflow!=`visible`){let r=n.getBoundingClientRect();a=Math.max(a,r.left),o=Math.min(o,r.right),s=Math.max(s,r.top),c=Math.min(t==e.parentNode?i.innerHeight:c,r.bottom)}t=r.position==`absolute`||r.position==`fixed`?n.offsetParent:n.parentNode}else if(t.nodeType==11)t=t.host;else break;return{left:a-n.left,right:Math.max(a,o)-n.left,top:s-(n.top+t),bottom:Math.max(s,c)-(n.top+t)}}function $E(e){let t=e.getBoundingClientRect(),n=e.ownerDocument.defaultView||window;return t.left<n.innerWidth&&t.right>0&&t.top<n.innerHeight&&t.bottom>0}function eD(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}var tD=class{constructor(e,t,n,r){this.from=e,this.to=t,this.size=n,this.displaySize=r}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.from!=i.from||r.to!=i.to||r.size!=i.size)return!1}return!0}draw(e,t){return JC.replace({widget:new nD(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}},nD=class extends KC{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement(`div`);return this.vertical?e.style.height=this.size+`px`:(e.style.width=this.size+`px`,e.style.height=`2px`,e.style.display=`inline-block`),e}get estimatedHeight(){return this.vertical?this.size:-1}},rD=class{constructor(e){this.state=e,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scrollTop=0,this.scrolledToBottom=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=lD,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=sw.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let t=e.facet(Qw).some(e=>typeof e!=`function`&&e.class==`cm-lineWrapping`);this.heightOracle=new IE(t),this.stateDeco=e.facet($w).filter(e=>typeof e!=`function`),this.heightMap=VE.empty().applyChanges(this.stateDeco,Bb.empty,this.heightOracle.setDoc(e.doc),[new sT(0,0,0,e.doc.length)]);for(let e=0;e<2&&(this.viewport=this.getViewport(0,null),this.updateForViewport());e++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=JC.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 r=n?t.head:t.anchor;if(!e.some(({from:e,to:t})=>r>=e&&r<=t)){let{from:t,to:n}=this.lineBlockAt(r);e.push(new iD(t,n))}}return this.viewports=e.sort((e,t)=>e.from-t.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?lD:new uD(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(dD(e,this.scaler))})}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=this.state.facet($w).filter(e=>typeof e!=`function`);let r=e.changedRanges,i=sT.extendWithRanges(r,XE(n,this.stateDeco,e?e.changes:ox.empty(this.state.doc.length))),a=this.heightMap.height,o=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);FE(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),i),(this.heightMap.height!=a||PE)&&(e.flags|=2),o?(this.scrollAnchorPos=e.changes.mapPos(o.from,-1),this.scrollAnchorHeight=o.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let s=i.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<s.from||t.range.head>s.to)||!this.viewportIsAppropriate(s))&&(s=this.getViewport(0,t));let c=s.from!=this.viewport.from||s.to!=this.viewport.to;this.viewport=s,e.flags|=this.updateForViewport(),(c||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(Bw)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,n=window.getComputedStyle(t),r=this.heightOracle,i=n.whiteSpace;this.defaultTextDirection=n.direction==`rtl`?sw.RTL:sw.LTR;let a=this.heightOracle.mustRefreshForWrapping(i),o=t.getBoundingClientRect(),s=a||this.mustMeasureContent||this.contentDOMHeight!=o.height;this.contentDOMHeight=o.height,this.mustMeasureContent=!1;let c=0,l=0;if(o.width&&o.height){let{scaleX:e,scaleY:n}=ZS(t,o);(e>.005&&Math.abs(this.scaleX-e)>.005||n>.005&&Math.abs(this.scaleY-n)>.005)&&(this.scaleX=e,this.scaleY=n,c|=16,a=s=!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,c|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(s=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=16);let f=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=f&&(this.scrollAnchorHeight=-1,this.scrollTop=f),this.scrolledToBottom=lC(e.scrollDOM);let p=(this.printing?eD:QE)(t,this.paddingTop),m=p.top-this.pixelViewport.top,h=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let g=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(g!=this.inView&&(this.inView=g,g&&(s=!0)),!this.inView&&!this.scrollTarget&&!$E(e.dom))return 0;let _=o.width;if((this.contentDOMWidth!=_||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=o.width,this.editorHeight=e.scrollDOM.clientHeight,c|=16),s){let t=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(t)&&(a=!0),a||r.lineWrapping&&Math.abs(_-this.contentDOMWidth)>r.charWidth){let{lineHeight:n,charWidth:o,textHeight:s}=e.docView.measureTextSize();a=n>0&&r.refresh(i,n,o,s,_/o,t),a&&(e.docView.minWidth=0,c|=16)}m>0&&h>0?l=Math.max(m,h):m<0&&h<0&&(l=Math.min(m,h)),FE();for(let n of this.viewports){let i=n.from==this.viewport.from?t:e.docView.measureVisibleLineHeights(n);this.heightMap=(a?VE.empty().applyChanges(this.stateDeco,Bb.empty,this.heightOracle,[new sT(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,a,new LE(n.from,i))}PE&&(c|=2)}let v=!this.viewportIsAppropriate(this.viewport,l)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return v&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(l,this.scrollTarget),c|=this.updateForViewport()),(c&2||v)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(a?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,i=this.heightOracle,{visibleTop:a,visibleBottom:o}=this,s=new iD(r.lineAt(a-n*1e3,zE.ByHeight,i,0,0).from,r.lineAt(o+(1-n)*1e3,zE.ByHeight,i,0,0).to);if(t){let{head:e}=t.range;if(e<s.from||e>s.to){let n=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),a=r.lineAt(e,zE.ByPos,i,0,0),o;o=t.y==`center`?(a.top+a.bottom)/2-n/2:t.y==`start`||t.y==`nearest`&&e<s.from?a.top:a.bottom-n,s=new iD(r.lineAt(o-1e3/2,zE.ByHeight,i,0,0).from,r.lineAt(o+n+1e3/2,zE.ByHeight,i,0,0).to)}}return s}mapViewport(e,t){let n=t.mapPos(e.from,-1),r=t.mapPos(e.to,1);return new iD(this.heightMap.lineAt(n,zE.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(r,zE.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},n=0){if(!this.inView)return!0;let{top:r}=this.heightMap.lineAt(e,zE.ByPos,this.heightOracle,0,0),{bottom:i}=this.heightMap.lineAt(t,zE.ByPos,this.heightOracle,0,0),{visibleTop:a,visibleBottom:o}=this;return(e==0||r<=a-Math.max(10,Math.min(-n,250)))&&(t==this.state.doc.length||i>=o+Math.max(10,Math.min(n,250)))&&r>a-2*1e3&&i<o+2*1e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let n=[];for(let r of e)t.touchesRange(r.from,r.to)||n.push(new tD(t.mapPos(r.from),t.mapPos(r.to),r.size,r.displaySize));return n}ensureLineGaps(e,t){let n=this.heightOracle.lineWrapping,r=n?1e4:2e3,i=r>>1,a=r<<1;if(this.defaultTextDirection!=sw.LTR&&!n)return[];let o=[],s=(r,a,c,l)=>{if(a-r<i)return;let u=this.state.selection.main,d=[u.from];u.empty||d.push(u.to);for(let e of d)if(e>r&&e<a){s(r,e-10,c,l),s(e+10,a,c,l);return}let f=cD(e,e=>e.from>=c.from&&e.to<=c.to&&Math.abs(e.from-r)<i&&Math.abs(e.to-a)<i&&!d.some(t=>e.from<t&&e.to>t));if(!f){if(a<c.to&&t&&n&&t.visibleRanges.some(e=>e.from<=a&&e.to>=a)){let e=t.moveToLineBoundary(L.cursor(a),!1,!0).head;e>r&&(a=e)}let e=this.gapSize(c,r,a,l);f=new tD(r,a,e,n||e<2e6?e:2e6)}o.push(f)},c=t=>{if(t.length<a||t.type!=qC.Text)return;let i=aD(t.from,t.to,this.stateDeco);if(i.total<a)return;let o=this.scrollTarget?this.scrollTarget.range.head:null,c,l;if(n){let e=r/this.heightOracle.lineLength*this.heightOracle.lineHeight,n,a;if(o!=null){let r=sD(i,o),s=((this.visibleBottom-this.visibleTop)/2+e)/t.height;n=r-s,a=r+s}else n=(this.visibleTop-t.top-e)/t.height,a=(this.visibleBottom-t.top+e)/t.height;c=oD(i,n),l=oD(i,a)}else{let n=i.total*this.heightOracle.charWidth,a=r*this.heightOracle.charWidth,s=0;if(n>2e6)for(let n of e)n.from>=t.from&&n.from<t.to&&n.size!=n.displaySize&&n.from*this.heightOracle.charWidth+s<this.pixelViewport.left&&(s=n.size-n.displaySize);let u=this.pixelViewport.left+s,d=this.pixelViewport.right+s,f,p;if(o!=null){let e=sD(i,o),t=((d-u)/2+a)/n;f=e-t,p=e+t}else f=(u-a)/n,p=(d+a)/n;c=oD(i,f),l=oD(i,p)}c>t.from&&s(t.from,c,t,i),l<t.to&&s(l,t.to,t,i)};for(let e of this.viewportLines)Array.isArray(e.type)?e.type.forEach(c):c(e);return o}gapSize(e,t,n,r){let i=sD(r,n)-sD(r,t);return this.heightOracle.lineWrapping?e.height*i:r.total*this.heightOracle.charWidth*i}updateLineGaps(e){tD.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=JC.set(e.map(e=>e.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let n=[];dS.spans(t,this.viewport.from,this.viewport.to,{span(e,t){n.push({from:e,to:t})},point(){}},20);let r=0;if(n.length!=this.visibleRanges.length)r=12;else for(let t=0;t<n.length&&!(r&8);t++){let i=this.visibleRanges[t],a=n[t];(i.from!=a.from||i.to!=a.to)&&(r|=4,e&&e.mapPos(i.from,-1)==a.from&&e.mapPos(i.to,1)==a.to||(r|=8))}return this.visibleRanges=n,r}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||dD(this.heightMap.lineAt(e,zE.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||dD(this.heightMap.lineAt(this.scaler.fromDOM(e),zE.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 dD(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}},iD=class{constructor(e,t){this.from=e,this.to=t}};function aD(e,t,n){let r=[],i=e,a=0;return dS.spans(n,e,t,{span(){},point(e,t){e>i&&(r.push({from:i,to:e}),a+=e-i),i=t}},20),i<t&&(r.push({from:i,to:t}),a+=t-i),{total:a,ranges:r}}function oD({total:e,ranges:t},n){if(n<=0)return t[0].from;if(n>=1)return t[t.length-1].to;let r=Math.floor(e*n);for(let e=0;;e++){let{from:n,to:i}=t[e],a=i-n;if(r<=a)return n+r;r-=a}}function sD(e,t){let n=0;for(let{from:r,to:i}of e.ranges){if(t<=i){n+=t-r;break}n+=i-r}return n/e.total}function cD(e,t){for(let n of e)if(t(n))return n}var lD={toDOM(e){return e},fromDOM(e){return e},scale:1,eq(e){return e==this}},uD=class e{constructor(e,t,n){let r=0,i=0,a=0;this.viewports=n.map(({from:n,to:i})=>{let a=t.lineAt(n,zE.ByPos,e,0,0).top,o=t.lineAt(i,zE.ByPos,e,0,0).bottom;return r+=o-a,{from:n,to:i,top:a,bottom:o,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(t.height-r);for(let e of this.viewports)e.domTop=a+(e.top-i)*this.scale,a=e.domBottom=e.domTop+(e.bottom-e.top),i=e.bottom}toDOM(e){for(let t=0,n=0,r=0;;t++){let i=t<this.viewports.length?this.viewports[t]:null;if(!i||e<i.top)return r+(e-n)*this.scale;if(e<=i.bottom)return i.domTop+(e-i.top);n=i.bottom,r=i.domBottom}}fromDOM(e){for(let t=0,n=0,r=0;;t++){let i=t<this.viewports.length?this.viewports[t]:null;if(!i||e<i.domTop)return n+(e-r)/this.scale;if(e<=i.domBottom)return i.top+(e-i.domTop);n=i.bottom,r=i.domBottom}}eq(t){return t instanceof e?this.scale==t.scale&&this.viewports.length==t.viewports.length&&this.viewports.every((e,n)=>e.from==t.viewports[n].from&&e.to==t.viewports[n].to):!1}};function dD(e,t){if(t.scale==1)return e;let n=t.toDOM(e.top),r=t.toDOM(e.bottom);return new RE(e.from,e.length,n,r-n,Array.isArray(e._content)?e._content.map(e=>dD(e,t)):e._content)}var fD=gx.define({combine:e=>e.join(` `)}),pD=gx.define({combine:e=>e.indexOf(!0)>-1}),mD=AS.newName(),hD=AS.newName(),gD=AS.newName(),_D={"&light":`.`+hD,"&dark":`.`+gD};function vD(e,t,n){return new AS(t,{finish(t){return/&/.test(t)?t.replace(/&\w*/,t=>{if(t==`&`)return e;if(!n||!n[t])throw RangeError(`Unsupported selector: ${t}`);return n[t]}):e+` `+t}})}var yD=vD(`.`+mD,{"&":{position:`relative !important`,boxSizing:`border-box`,"&.cm-focused":{outline:`1px dotted #212121`},display:`flex !important`,flexDirection:`column`},".cm-scroller":{display:`flex !important`,alignItems:`flex-start !important`,fontFamily:`monospace`,lineHeight:1.4,height:`100%`,overflowX:`auto`,position:`relative`,zIndex:0,overflowAnchor:`none`},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:`block`,whiteSpace:`pre`,wordWrap:`normal`,boxSizing:`border-box`,minHeight:`100%`,padding:`4px 0`,outline:`none`,"&[contenteditable=true]":{WebkitUserModify:`read-write-plaintext-only`}},".cm-lineWrapping":{whiteSpace_fallback:`pre-wrap`,whiteSpace:`break-spaces`,wordBreak:`break-word`,overflowWrap:`anywhere`,flexShrink:1},"&light .cm-content":{caretColor:`black`},"&dark .cm-content":{caretColor:`white`},".cm-line":{display:`block`,padding:`0 2px 0 6px`},".cm-layer":{position:`absolute`,left:0,top:0,contain:`size style`,"& > *":{position:`absolute`}},"&light .cm-selectionBackground":{background:`#d9d9d9`},"&dark .cm-selectionBackground":{background:`#222`},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:`#d7d4f0`},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:`#233`},".cm-cursorLayer":{pointerEvents:`none`},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:`steps(1) cm-blink 1.2s infinite`},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:`1.2px solid black`,marginLeft:`-0.6px`,pointerEvents:`none`},".cm-cursor":{display:`none`},"&dark .cm-cursor":{borderLeftColor:`#ddd`},".cm-dropCursor":{position:`absolute`},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:`block`},".cm-iso":{unicodeBidi:`isolate`},".cm-announced":{position:`fixed`,top:`-10000px`},"@media print":{".cm-announced":{display:`none`}},"&light .cm-activeLine":{backgroundColor:`#cceeff44`},"&dark .cm-activeLine":{backgroundColor:`#99eeff33`},"&light .cm-specialChar":{color:`red`},"&dark .cm-specialChar":{color:`#f78`},".cm-gutters":{flexShrink:0,display:`flex`,height:`100%`,boxSizing:`border-box`,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,zIndex:300},"&light .cm-panels":{backgroundColor:`#f5f5f5`,color:`black`},"&light .cm-panels-top":{borderBottom:`1px solid #ddd`},"&light .cm-panels-bottom":{borderTop:`1px solid #ddd`},"&dark .cm-panels":{backgroundColor:`#333338`,color:`white`},".cm-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":{backgroundImage:`radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)`,backgroundPosition:`center`},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:`auto 100%`,backgroundPosition:`right 90%`,backgroundRepeat:`no-repeat`},".cm-trailingSpace":{backgroundColor:`#ff332255`},".cm-button":{verticalAlign:`middle`,color:`inherit`,fontSize:`70%`,padding:`.2em 1em`,borderRadius:`1px`},"&light .cm-button":{backgroundImage:`linear-gradient(#eff1f5, #d9d9df)`,border:`1px solid #888`,"&:active":{backgroundImage:`linear-gradient(#b4b4b4, #d0d3d6)`}},"&dark .cm-button":{backgroundImage:`linear-gradient(#393939, #111)`,border:`1px solid #888`,"&:active":{backgroundImage:`linear-gradient(#111, #333)`}},".cm-textfield":{verticalAlign:`middle`,color:`inherit`,fontSize:`70%`,border:`1px solid silver`,padding:`.2em .5em`},"&light .cm-textfield":{backgroundColor:`white`},"&dark .cm-textfield":{border:`1px solid #555`,backgroundColor:`inherit`}},_D),bD={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},xD=AC.ie&&AC.ie_version<=11,SD=class{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new eC,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let e of t)this.queue.push(e);(AC.ie&&AC.ie_version<=11||AC.ios&&e.composing)&&t.some(e=>e.type==`childList`&&e.removedNodes.length||e.type==`characterData`&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&e.constructor.EDIT_CONTEXT!==!1&&!(AC.chrome&&AC.chrome_version<126)&&(this.editContext=new ED(e),e.state.facet(Kw)&&(e.contentDOM.editContext=this.editContext.editContext)),xD&&(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),window.matchMedia&&(this.printQuery=window.matchMedia(`print`)),typeof ResizeObserver==`function`&&(this.resizeScroll=new ResizeObserver(()=>{this.view.docView?.lastUpdate<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver==`function`&&(this.intersection=new IntersectionObserver(e=>{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.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type==`change`||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,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,r=this.selectionRange;if(n.state.facet(Kw)?n.root.activeElement!=this.dom:!HS(this.dom,r))return;let i=r.anchorNode&&n.docView.nearest(r.anchorNode);if(i&&i.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(AC.ie&&AC.ie_version<=11||AC.android&&AC.chrome)&&!n.state.selection.main.empty&&r.focusNode&&WS(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=BS(e.root);if(!t)return!1;let n=AC.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&TD(this.view,t)||t;if(!n||this.selectionRange.eq(n))return!1;let r=HS(this.dom,n);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&cC(this.dom,n)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(n),r&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let n=this.dom;n;)if(n.nodeType==1)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==n?e++:t||=this.scrollTargets.slice(0,e),t&&t.push(n),n=n.assignedSlot||n.parentNode;else if(n.nodeType==11)n=n.host;else break;if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let e of this.scrollTargets)e.removeEventListener(`scroll`,this.onScroll);for(let e of this.scrollTargets=t)e.addEventListener(`scroll`,this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||=(this.observer.observe(this.dom,bD),xD&&this.dom.addEventListener(`DOMCharacterDataModified`,this.onCharData),!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),xD&&this.dom.removeEventListener(`DOMCharacterDataModified`,this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){if(!this.delayedAndroidKey){let e=()=>{let e=this.delayedAndroidKey;e&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=e.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&e.force&&aC(this.dom,e.key,e.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(e)}(!this.delayedAndroidKey||e==`Enter`)&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!this.delayedAndroidKey?.force})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,n=-1,r=!1;for(let i of e){let e=this.readMutation(i);e&&(e.typeOver&&(r=!0),t==-1?{from:t,to:n}=e:(t=Math.min(e.from,t),n=Math.max(e.to,n)))}return{from:t,to:n,typeOver:r}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),r=this.selectionChanged&&HS(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let i=new VT(this.view,e,t,n);return this.view.docView.domChanged={newSel:i.newSel?i.newSel.main:null},i}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,r=HT(this.view,t);return this.view.state==n&&(t.domChanged||t.newSel&&!t.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),r}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty(e.type==`attributes`),e.type==`attributes`&&(t.flags|=4),e.type==`childList`){let n=CD(t,e.previousSibling||e.target.previousSibling,-1),r=CD(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:r?t.posBefore(r):t.posAtEnd,typeOver:!1}}else if(e.type==`characterData`)return{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue};else return null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener(`resize`,this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener(`change`,this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener(`beforeprint`,this.onPrint),e.addEventListener(`scroll`,this.onScroll),e.document.addEventListener(`selectionchange`,this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener(`scroll`,this.onScroll),e.removeEventListener(`resize`,this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener(`change`,this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener(`beforeprint`,this.onPrint),e.document.removeEventListener(`selectionchange`,this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(Kw)!=e.state.facet(Kw)&&(e.view.contentDOM.editContext=e.state.facet(Kw)?this.editContext.editContext:null))}destroy(){var e,t,n;this.stop(),(e=this.intersection)==null||e.disconnect(),(t=this.gapIntersection)==null||t.disconnect(),(n=this.resizeScroll)==null||n.disconnect();for(let e of this.scrollTargets)e.removeEventListener(`scroll`,this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}};function CD(e,t,n){for(;t;){let r=mC.get(t);if(r&&r.parent==e)return r;let i=t.parentNode;t=i==e.dom?n>0?t.nextSibling:t.previousSibling:i}return null}function wD(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,a=t.endOffset,o=e.docView.domAtPos(e.state.selection.main.anchor);return WS(o.node,o.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function TD(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return wD(e,n)}let n=null;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.contentDOM.addEventListener(`beforeinput`,r,!0),e.dom.ownerDocument.execCommand(`indent`),e.contentDOM.removeEventListener(`beforeinput`,r,!0),n?wD(e,n):null}var ED=class{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=t=>{let n=e.state.selection.main,{anchor:r,head:i}=n,a=this.toEditorPos(t.updateRangeStart),o=this.toEditorPos(t.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:t.updateRangeStart,editorBase:a,drifted:!1});let s={from:a,to:o,insert:Bb.of(t.text.split(`
|
|
41
|
+
`))};if(s.from==this.from&&r<this.from?s.from=r:s.to==this.to&&r>this.to&&(s.to=r),s.from==s.to&&!s.insert.length){let r=L.single(this.toEditorPos(t.selectionStart),this.toEditorPos(t.selectionEnd));r.main.eq(n)||e.dispatch({selection:r,userEvent:`select`});return}if((AC.mac||AC.android)&&s.from==i-1&&/^\. ?$/.test(t.text)&&e.contentDOM.getAttribute(`autocorrect`)==`off`&&(s={from:a,to:o,insert:Bb.of([t.text.replace(`.`,` `)])}),this.pendingContextChange=s,!e.state.readOnly){let n=this.to-this.from+(s.to-s.from+s.insert.length);UT(e,s,L.single(this.toEditorPos(t.selectionStart,n),this.toEditorPos(t.selectionEnd,n)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state))},this.handlers.characterboundsupdate=n=>{let r=[],i=null;for(let t=this.toEditorPos(n.rangeStart),a=this.toEditorPos(n.rangeEnd);t<a;t++){let n=e.coordsForChar(t);i=n&&new DOMRect(n.left,n.top,n.right-n.left,n.bottom-n.top)||i||new DOMRect,r.push(i)}t.updateCharacterBounds(n.rangeStart,r)},this.handlers.textformatupdate=t=>{let n=[];for(let e of t.getTextFormats()){let t=e.underlineStyle,r=e.underlineThickness;if(t!=`None`&&r!=`None`){let i=this.toEditorPos(e.rangeStart),a=this.toEditorPos(e.rangeEnd);if(i<a){let e=`text-decoration: underline ${t==`Dashed`?`dashed `:t==`Squiggle`?`wavy `:``}${r==`Thin`?1:2}px`;n.push(JC.mark({attributes:{style:e}}).range(i,a))}}}e.dispatch({effects:Ww.of(JC.set(n))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:t}=this.composing;this.composing=null,t&&this.reset(e.state)}};for(let e in this.handlers)t.addEventListener(e,this.handlers[e]);this.measureReq={read:e=>{this.editContext.updateControlBounds(e.contentDOM.getBoundingClientRect());let t=BS(e.root);t&&t.rangeCount&&this.editContext.updateSelectionBounds(t.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,n=!1,r=this.pendingContextChange;return e.changes.iterChanges((i,a,o,s,c)=>{if(n)return;let l=c.length-(a-i);if(r&&a>=r.to)if(r.from==i&&r.to==a&&r.insert.eq(c)){r=this.pendingContextChange=null,t+=l,this.to+=l;return}else r=null,this.revertPending(e.state);if(i+=t,a+=t,a<=this.from)this.from+=l,this.to+=l;else if(i<this.to){if(i<this.from||a>this.to||this.to-this.from+c.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(i),this.toContextPos(a),c.toString()),this.to+=l}t+=l}),r&&!n&&this.revertPending(e.state),!n}update(e){let t=this.pendingContextChange,n=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(n.from,n.to)&&e.transactions.some(e=>!e.isUserEvent(`input.type`)&&e.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),r=this.toContextPos(t.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(n,r)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let n=this.composing;return n&&n.drifted?n.editorBase+(e-n.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}},DD=class e{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||oC(e.parent)||document,this.viewState=new rD(e.state||aS.create(e)),e.scrollTo&&e.scrollTo.is(Uw)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Jw).map(e=>new Xw(e));for(let e of this.plugins)e.update(this);this.observer=new SD(this),this.inputState=new JT(this),this.inputState.ensureHandlers(this.plugins),this.docView=new lT(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),document.fonts?.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...e){let t=e.length==1&&e[0]instanceof Gx?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw Error(`Calls to EditorView.update are not allowed while an update is in progress`);let t=!1,n=!1,r,i=this.state;for(let t of e){if(t.startState!=i)throw RangeError(`Trying to update state with a transaction that doesn't start from the previous state.`);i=t.state}if(this.destroyed){this.viewState.state=i;return}let a=this.hasFocus,o=0,s=null;e.some(e=>e.annotation(OE))?(this.inputState.notifiedFocused=a,o=1):a!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=a,s=kE(i,a),s||(o=1));let c=this.observer.delayedAndroidKey,l=null;if(c?(this.observer.clearDelayedAndroidKey(),l=this.observer.readChange(),(l&&!this.state.doc.eq(i.doc)||!this.state.selection.eq(i.selection))&&(l=null)):this.observer.clear(),i.facet(aS.phrases)!=this.state.facet(aS.phrases))return this.setState(i);r=cT.create(this,i,e),r.flags|=o;let u=this.viewState.scrollTarget;try{this.updateState=2;for(let t of e){if(u&&=u.map(t.changes),t.scrollIntoView){let{main:e}=t.state.selection;u=new Hw(e.empty?e:L.cursor(e.head,e.head>e.anchor?-1:1))}for(let e of t.effects)e.is(Uw)&&(u=e.value.clip(this.state))}this.viewState.update(r,u),this.bidiCache=AD.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),t=this.docView.update(r),this.state.facet(oT)!=this.styleModules&&this.mountStyles(),n=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(e=>e.isUserEvent(`select.pointer`)))}finally{this.updateState=0}if(r.startState.facet(fD)!=r.state.facet(fD)&&(this.viewState.mustMeasureContent=!0),(t||n||u||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!r.empty)for(let e of this.state.facet(Pw))try{e(r)}catch(e){Gw(this.state,e,`update listener`)}(s||l)&&Promise.resolve().then(()=>{s&&this.state==s.startState&&this.dispatch(s),l&&!HT(this,l)&&c.force&&aC(this.contentDOM,c.key,c.keyCode)})}setState(e){if(this.updateState!=0)throw Error(`Calls to EditorView.setState are not allowed while an update is in progress`);if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let e of this.plugins)e.destroy(this);this.viewState=new rD(e),this.plugins=e.facet(Jw).map(e=>new Xw(e)),this.pluginMap.clear();for(let e of this.plugins)e.update(this);this.docView.destroy(),this.docView=new lT(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(Jw),n=e.state.facet(Jw);if(t!=n){let r=[];for(let i of n){let n=t.indexOf(i);if(n<0)r.push(new Xw(i));else{let t=this.plugins[n];t.mustUpdate=e,r.push(t)}}for(let t of this.plugins)t.mustUpdate!=e&&t.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let t of this.plugins)t.mustUpdate=e;for(let e=0;e<this.plugins.length;e++)this.plugins[e].update(this);t!=n&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(e){Gw(this.state,e,`doc view update listener`)}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,n=this.scrollDOM,r=n.scrollTop*this.scaleY,{scrollAnchorPos:i,scrollAnchorHeight:a}=this.viewState;Math.abs(r-this.viewState.scrollTop)>1&&(a=-1),this.viewState.scrollAnchorHeight=-1;try{for(let e=0;;e++){if(a<0)if(lC(n))i=-1,a=this.viewState.heightMap.height;else{let e=this.viewState.scrollAnchorAt(r);i=e.from,a=e.top}this.updateState=1;let o=this.viewState.measure(this);if(!o&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(e>5){console.warn(this.measureRequests.length?`Measure loop restarted more than 5 times`:`Viewport failed to stabilize`);break}let s=[];o&4||([this.measureRequests,s]=[s,this.measureRequests]);let c=s.map(e=>{try{return e.read(this)}catch(e){return Gw(this.state,e),kD}}),l=cT.create(this,this.state,[]),u=!1;l.flags|=o,t?t.flags|=o:t=l,this.updateState=2,l.empty||(this.updatePlugins(l),this.inputState.update(l),this.updateAttrs(),u=this.docView.update(l),u&&this.docViewUpdate());for(let e=0;e<s.length;e++)if(c[e]!=kD)try{let t=s[e];t.write&&t.write(c[e],this)}catch(e){Gw(this.state,e)}if(u&&this.docView.updateSelection(!0),!l.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,a=-1;continue}else{let e=(i<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(i).top)-a;if(e>1||e<-1){r+=e,n.scrollTop=r/this.scaleY,a=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let e of this.state.facet(Pw))e(t)}get themeClasses(){return mD+` `+(this.state.facet(pD)?gD:hD)+` `+this.state.facet(fD)}updateAttrs(){let e=jD(this,Zw,{class:`cm-editor`+(this.hasFocus?` cm-focused `:` `)+this.themeClasses}),t={spellcheck:`false`,autocorrect:`off`,autocapitalize:`off`,writingsuggestions:`false`,translate:`no`,contenteditable:this.state.facet(Kw)?`true`:`false`,class:`cm-content`,style:`${AC.tabSize}: ${this.state.tabSize}`,role:`textbox`,"aria-multiline":`true`};this.state.readOnly&&(t[`aria-readonly`]=`true`),jD(this,Qw,t);let n=this.observer.ignore(()=>{let n=WC(this.contentDOM,this.contentAttrs,t),r=WC(this.dom,this.editorAttrs,e);return n||r});return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(t){let n=!0;for(let r of t)for(let t of r.effects)if(t.is(e.announce)){n&&(this.announceDOM.textContent=``),n=!1;let e=this.announceDOM.appendChild(document.createElement(`div`));e.textContent=t.value}}mountStyles(){this.styleModules=this.state.facet(oT);let t=this.state.facet(e.cspNonce);AS.mount(this.root,this.styleModules.concat(yD).reverse(),t?{nonce:t}:void 0)}readMeasured(){if(this.updateState==2)throw Error(`Reading the editor layout isn't allowed during an update`);this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(t===void 0||t&&t.spec!=e)&&this.pluginMap.set(e,t=this.plugins.find(t=>t.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 IT(this,e,MT(this,e,t,n))}moveByGroup(e,t){return IT(this,e,MT(this,e,t,t=>NT(this,e.head,t)))}visualLineSide(e,t){let n=this.bidiSpans(e),r=this.textDirectionAt(e.from),i=n[t?n.length-1:0];return L.cursor(i.side(t,r)+e.from,i.forward(!t,r)?1:-1)}moveToLineBoundary(e,t,n=!0){return jT(this,e,t,n)}moveVertically(e,t,n){return IT(this,e,PT(this,e,t,n))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),ET(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let n=this.docView.coordsAt(e,t);if(!n||n.left==n.right)return n;let r=this.state.doc.lineAt(e),i=this.bidiSpans(r),a=i[_w.find(i,e-r.from,-1,t)];return YS(n,a.dir==sw.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(zw)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>OD)return Ew(e.length);let t=this.textDirectionAt(e.from),n;for(let r of this.bidiCache)if(r.from==e.from&&r.dir==t&&(r.fresh||vw(r.isolates,n=rT(this,e))))return r.order;n||=rT(this,e);let r=Tw(e.text,t,n);return this.bidiCache.push(new AD(e.from,e.to,t,n,!0,r)),r}get hasFocus(){return(this.dom.ownerDocument.hasFocus()||AC.safari&&this.inputState?.lastContextMenu>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{nC(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return Uw.of(new Hw(typeof e==`number`?L.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 Uw.of(new Hw(L.cursor(n.from),`start`,`start`,n.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e==`boolean`?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return Yw.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Yw.define(()=>({}),{eventObservers:e})}static theme(e,t){let n=AS.newName(),r=[fD.of(n),oT.of(vD(`.${n}`,e))];return t&&t.dark&&r.push(pD.of(!0)),r}static baseTheme(e){return Ex.lowest(oT.of(vD(`.`+mD,e,_D)))}static findFromDOM(e){let t=e.querySelector(`.cm-content`);return(t&&mC.get(t)||mC.get(e))?.rootView?.view||null}};DD.styleModule=oT,DD.inputHandler=Fw,DD.clipboardInputFilter=Lw,DD.clipboardOutputFilter=Rw,DD.scrollHandler=Vw,DD.focusChangeEffect=Iw,DD.perLineTextDirection=zw,DD.exceptionSink=Nw,DD.updateListener=Pw,DD.editable=Kw,DD.mouseSelectionStyle=Mw,DD.dragMovesSelection=jw,DD.clickAddsSelectionRange=Aw,DD.decorations=$w,DD.outerDecorations=eT,DD.atomicRanges=tT,DD.bidiIsolatedRanges=nT,DD.scrollMargins=iT,DD.darkTheme=pD,DD.cspNonce=gx.define({combine:e=>e.length?e[0]:``}),DD.contentAttributes=Qw,DD.editorAttributes=Zw,DD.lineWrapping=DD.contentAttributes.of({class:`cm-lineWrapping`}),DD.announce=Wx.define();var OD=4096,kD={},AD=class e{constructor(e,t,n,r,i,a){this.from=e,this.to=t,this.dir=n,this.isolates=r,this.fresh=i,this.order=a}static update(t,n){if(n.empty&&!t.some(e=>e.fresh))return t;let r=[],i=t.length?t[t.length-1].dir:sw.LTR;for(let a=Math.max(0,t.length-10);a<t.length;a++){let o=t[a];o.dir==i&&!n.touchesRange(o.from,o.to)&&r.push(new e(n.mapPos(o.from,1),n.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return r}};function jD(e,t,n){for(let r=e.state.facet(t),i=r.length-1;i>=0;i--){let t=r[i],a=typeof t==`function`?t(e):t;a&&VC(a,n)}return n}var MD=AC.mac?`mac`:AC.windows?`win`:AC.linux?`linux`:`key`;function ND(e,t){let n=e.split(/-(?!$)/),r=n[n.length-1];r==`Space`&&(r=` `);let i,a,o,s;for(let e=0;e<n.length-1;++e){let r=n[e];if(/^(cmd|meta|m)$/i.test(r))s=!0;else if(/^a(lt)?$/i.test(r))i=!0;else if(/^(c|ctrl|control)$/i.test(r))a=!0;else if(/^s(hift)?$/i.test(r))o=!0;else if(/^mod$/i.test(r))t==`mac`?s=!0:a=!0;else throw Error(`Unrecognized modifier name: `+r)}return i&&(r=`Alt-`+r),a&&(r=`Ctrl-`+r),s&&(r=`Meta-`+r),o&&(r=`Shift-`+r),r}function PD(e,t,n){return t.altKey&&(e=`Alt-`+e),t.ctrlKey&&(e=`Ctrl-`+e),t.metaKey&&(e=`Meta-`+e),n!==!1&&t.shiftKey&&(e=`Shift-`+e),e}var FD=Ex.default(DD.domEventHandlers({keydown(e,t){return WD(RD(t.state),e,t,`editor`)}})),ID=gx.define({enables:FD}),LD=new WeakMap;function RD(e){let t=e.facet(ID),n=LD.get(t);return n||LD.set(t,n=HD(t.reduce((e,t)=>e.concat(t),[]))),n}function zD(e,t,n){return WD(RD(e.state),t,e,n)}var BD=null,VD=4e3;function HD(e,t=MD){let n=Object.create(null),r=Object.create(null),i=(e,t)=>{let n=r[e];if(n==null)r[e]=t;else if(n!=t)throw Error(`Key binding `+e+` is used both as a regular binding and as a multi-stroke prefix`)},a=(e,r,a,o,s)=>{let c=n[e]||(n[e]=Object.create(null)),l=r.split(/ (?!$)/).map(e=>ND(e,t));for(let t=1;t<l.length;t++){let n=l.slice(0,t).join(` `);i(n,!0),c[n]||(c[n]={preventDefault:!0,stopPropagation:!1,run:[t=>{let r=BD={view:t,prefix:n,scope:e};return setTimeout(()=>{BD==r&&(BD=null)},VD),!0}]})}let u=l.join(` `);i(u,!1);let d=c[u]||(c[u]={preventDefault:!1,stopPropagation:!1,run:(c._any?.run)?.slice()||[]});a&&d.run.push(a),o&&(d.preventDefault=!0),s&&(d.stopPropagation=!0)};for(let r of e){let e=r.scope?r.scope.split(` `):[`editor`];if(r.any)for(let t of e){let e=n[t]||(n[t]=Object.create(null));e._any||={preventDefault:!1,stopPropagation:!1,run:[]};let{any:i}=r;for(let t in e)e[t].run.push(e=>i(e,UD))}let i=r[t]||r.key;if(i)for(let t of e)a(t,i,r.run,r.preventDefault,r.stopPropagation),r.shift&&a(t,`Shift-`+i,r.shift,r.preventDefault,r.stopPropagation)}return n}var UD=null;function WD(e,t,n,r){UD=t;let i=zS(t),a=nx(ex(i,0))==i.length&&i!=` `,o=``,s=!1,c=!1,l=!1;BD&&BD.view==n&&BD.scope==r&&(o=BD.prefix+` `,$T.indexOf(t.keyCode)<0&&(c=!0,BD=null));let u=new Set,d=e=>{if(e){for(let t of e.run)if(!u.has(t)&&(u.add(t),t(n)))return e.stopPropagation&&(l=!0),!0;e.preventDefault&&(e.stopPropagation&&(l=!0),c=!0)}return!1},f=e[r],p,m;return f&&(d(f[o+PD(i,t,!a)])?s=!0:a&&(t.altKey||t.metaKey||t.ctrlKey)&&!(AC.windows&&t.ctrlKey&&t.altKey)&&(p=NS[t.keyCode])&&p!=i?(d(f[o+PD(p,t,!0)])||t.shiftKey&&(m=PS[t.keyCode])!=i&&m!=p&&d(f[o+PD(m,t,!1)]))&&(s=!0):a&&t.shiftKey&&d(f[o+PD(i,t,!0)])&&(s=!0),!s&&d(f._any)&&(s=!0)),c&&(s=!0),s&&l&&t.stopPropagation(),UD=null,s}var GD=class e{constructor(e,t,n,r,i){this.className=e,this.left=t,this.top=n,this.width=r,this.height=i}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):!1}adjust(e){e.style.left=this.left+`px`,e.style.top=this.top+`px`,this.width!=null&&(e.style.width=this.width+`px`),e.style.height=this.height+`px`}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(t,n,r){if(r.empty){let i=t.coordsAtPos(r.head,r.assoc||1);if(!i)return[];let a=KD(t);return[new e(n,i.left-a.left,i.top-a.top,null,i.bottom-i.top)]}else return JD(t,n,r)}};function KD(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==sw.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function qD(e,t,n,r){let i=e.coordsAtPos(t,n*2);if(!i)return r;let a=e.dom.getBoundingClientRect(),o=(i.top+i.bottom)/2,s=e.posAtCoords({x:a.left+1,y:o}),c=e.posAtCoords({x:a.right-1,y:o});return s==null||c==null?r:{from:Math.max(r.from,Math.min(s,c)),to:Math.min(r.to,Math.max(s,c))}}function JD(e,t,n){if(n.to<=e.viewport.from||n.from>=e.viewport.to)return[];let r=Math.max(n.from,e.viewport.from),i=Math.min(n.to,e.viewport.to),a=e.textDirection==sw.LTR,o=e.contentDOM,s=o.getBoundingClientRect(),c=KD(e),l=o.querySelector(`.cm-line`),u=l&&window.getComputedStyle(l),d=s.left+(u?parseInt(u.paddingLeft)+Math.min(0,parseInt(u.textIndent)):0),f=s.right-(u?parseInt(u.paddingRight):0),p=AT(e,r),m=AT(e,i),h=p.type==qC.Text?p:null,g=m.type==qC.Text?m:null;if(h&&(e.lineWrapping||p.widgetLineBreaks)&&(h=qD(e,r,1,h)),g&&(e.lineWrapping||m.widgetLineBreaks)&&(g=qD(e,i,-1,g)),h&&g&&h.from==g.from&&h.to==g.to)return v(y(n.from,n.to,h));{let t=h?y(n.from,null,h):b(p,!1),r=g?y(null,n.to,g):b(m,!0),i=[];return(h||p).to<(g||m).from-(h&&g?1:0)||p.widgetLineBreaks>1&&t.bottom+e.defaultLineHeight/2<r.top?i.push(_(d,t.bottom,f,r.top)):t.bottom<r.top&&e.elementAtHeight((t.bottom+r.top)/2).type==qC.Text&&(t.bottom=r.top=(t.bottom+r.top)/2),v(t).concat(i).concat(v(r))}function _(e,n,r,i){return new GD(t,e-c.left,n-c.top,r-e,i-n)}function v({top:e,bottom:t,horizontal:n}){let r=[];for(let i=0;i<n.length;i+=2)r.push(_(n[i],e,n[i+1],t));return r}function y(t,n,r){let i=1e9,o=-1e9,s=[];function c(t,n,c,l,u){let p=e.coordsAtPos(t,t==r.to?-2:2),m=e.coordsAtPos(c,c==r.from?2:-2);!p||!m||(i=Math.min(p.top,m.top,i),o=Math.max(p.bottom,m.bottom,o),u==sw.LTR?s.push(a&&n?d:p.left,a&&l?f:m.right):s.push(!a&&l?d:m.left,!a&&n?f:p.right))}let l=t??r.from,u=n??r.to;for(let r of e.visibleRanges)if(r.to>l&&r.from<u)for(let i=Math.max(r.from,l),a=Math.min(r.to,u);;){let r=e.state.doc.lineAt(i);for(let o of e.bidiSpans(r)){let e=o.from+r.from,s=o.to+r.from;if(e>=a)break;s>i&&c(Math.max(e,i),t==null&&e<=l,Math.min(s,a),n==null&&s>=u,o.dir)}if(i=r.to+1,i>=a)break}return s.length==0&&c(l,t==null,u,n==null,e.textDirection),{top:i,bottom:o,horizontal:s}}function b(e,t){let n=s.top+(t?e.top:e.bottom);return{top:n,bottom:n,horizontal:[]}}}function YD(e,t){return e.constructor==t.constructor&&e.eq(t)}var XD=class{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(ZD)!=e.state.facet(ZD)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,n=e.facet(ZD);for(;t<n.length&&n[t]!=this.layer;)t++;this.dom.style.zIndex=String((this.layer.above?150:-1)-t)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:t}=this.view;(e!=this.scaleX||t!=this.scaleY)&&(this.scaleX=e,this.scaleY=t,this.dom.style.transform=`scale(${1/e}, ${1/t})`)}draw(e){if(e.length!=this.drawn.length||e.some((e,t)=>!YD(e,this.drawn[t]))){let t=this.dom.firstChild,n=0;for(let r of e)r.update&&t&&r.constructor&&this.drawn[n].constructor&&r.update(t,this.drawn[n])?(t=t.nextSibling,n++):this.dom.insertBefore(r.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()}},ZD=gx.define();function QD(e){return[Yw.define(t=>new XD(t,e)),ZD.of(e)]}var $D=!(AC.ios&&AC.webkit&&AC.webkit_version<534),eO=gx.define({combine(e){return oS(e,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function tO(e={}){return[eO.of(e),rO,aO,sO,Bw.of(!0)]}function nO(e){return e.startState.facet(eO)!=e.state.facet(eO)}var rO=QD({above:!0,markers(e){let{state:t}=e,n=t.facet(eO),r=[];for(let i of t.selection.ranges){let a=i==t.selection.main;if(i.empty?!a||$D:n.drawRangeCursor){let t=a?`cm-cursor cm-cursor-primary`:`cm-cursor cm-cursor-secondary`,n=i.empty?i:L.cursor(i.head,i.head>i.anchor?-1:1);for(let i of GD.forRange(e,t,n))r.push(i)}}return r},update(e,t){e.transactions.some(e=>e.selection)&&(t.style.animationName=t.style.animationName==`cm-blink`?`cm-blink2`:`cm-blink`);let n=nO(e);return n&&iO(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){iO(t.state,e)},class:`cm-cursorLayer`});function iO(e,t){t.style.animationDuration=e.facet(eO).cursorBlinkRate+`ms`}var aO=QD({above:!1,markers(e){return e.state.selection.ranges.map(t=>t.empty?[]:GD.forRange(e,`cm-selectionBackground`,t)).reduce((e,t)=>e.concat(t))},update(e,t){return e.docChanged||e.selectionSet||e.viewportChanged||nO(e)},class:`cm-selectionLayer`}),oO={".cm-line":{"& ::selection, &::selection":{backgroundColor:`transparent !important`}},".cm-content":{"& :focus":{caretColor:`initial !important`,"&::selection, & ::selection":{backgroundColor:`Highlight !important`}}}};$D&&(oO[`.cm-line`].caretColor=oO[`.cm-content`].caretColor=`transparent !important`);var sO=Ex.highest(DD.theme(oO)),cO=Wx.define({map(e,t){return e==null?null:t.mapPos(e)}}),lO=Cx.define({create(){return null},update(e,t){return e!=null&&(e=t.changes.mapPos(e)),t.effects.reduce((e,t)=>t.is(cO)?t.value:e,e)}}),uO=Yw.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(lO);n==null?this.cursor!=null&&((t=this.cursor)==null||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement(`div`)),this.cursor.className=`cm-dropCursor`),(e.startState.field(lO)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field(lO),n=t!=null&&e.coordsAtPos(t);if(!n)return null;let r=e.scrollDOM.getBoundingClientRect();return{left:n.left-r.left+e.scrollDOM.scrollLeft*e.scaleX,top:n.top-r.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(lO)!=e&&this.view.dispatch({effects:cO.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 dO(){return[lO,uO]}function fO(e,t,n,r,i){t.lastIndex=0;for(let a=e.iterRange(n,r),o=n,s;!a.next().done;o+=a.value.length)if(!a.lineBreak)for(;s=t.exec(a.value);)i(o+s.index,s)}function pO(e,t){let n=e.visibleRanges;if(n.length==1&&n[0].from==e.viewport.from&&n[0].to==e.viewport.to)return n;let r=[];for(let{from:i,to:a}of n)i=Math.max(e.state.doc.lineAt(i).from,i-t),a=Math.min(e.state.doc.lineAt(a).to,a+t),r.length&&r[r.length-1].to>=i?r[r.length-1].to=a:r.push({from:i,to:a});return r}var mO=class{constructor(e){let{regexp:t,decoration:n,decorate:r,boundary:i,maxLength:a=1e3}=e;if(!t.global)throw RangeError(`The regular expression given to MatchDecorator should have its 'g' flag set`);if(this.regexp=t,r)this.addMatch=(e,t,n,i)=>r(i,n,n+e[0].length,e,t);else if(typeof n==`function`)this.addMatch=(e,t,r,i)=>{let a=n(e,t,r);a&&i(r,r+e[0].length,a)};else if(n)this.addMatch=(e,t,r,i)=>i(r,r+e[0].length,n);else throw RangeError(`Either 'decorate' or 'decoration' should be provided to MatchDecorator`);this.boundary=i,this.maxLength=a}createDeco(e){let t=new pS,n=t.add.bind(t);for(let{from:t,to:r}of pO(e,this.maxLength))fO(e.state.doc,this.regexp,t,r,(t,r)=>this.addMatch(r,e,t,n));return t.finish()}updateDeco(e,t){let n=1e9,r=-1;return e.docChanged&&e.changes.iterChanges((t,i,a,o)=>{o>=e.view.viewport.from&&a<=e.view.viewport.to&&(n=Math.min(a,n),r=Math.max(o,r))}),e.viewportMoved||r-n>1e3?this.createDeco(e.view):r>-1?this.updateRange(e.view,t.map(e.changes),n,r):t}updateRange(e,t,n,r){for(let i of e.visibleRanges){let a=Math.max(i.from,n),o=Math.min(i.to,r);if(o>a){let n=e.state.doc.lineAt(a),r=n.to<o?e.state.doc.lineAt(o):n,s=Math.max(i.from,n.from),c=Math.min(i.to,r.to);if(this.boundary){for(;a>n.from;a--)if(this.boundary.test(n.text[a-1-n.from])){s=a;break}for(;o<r.to;o++)if(this.boundary.test(r.text[o-r.from])){c=o;break}}let l=[],u,d=(e,t,n)=>l.push(n.range(e,t));if(n==r)for(this.regexp.lastIndex=s-n.from;(u=this.regexp.exec(n.text))&&u.index<c-n.from;)this.addMatch(u,e,u.index+n.from,d);else fO(e.state.doc,this.regexp,s,c,(t,n)=>this.addMatch(n,e,t,d));t=t.update({filterFrom:s,filterTo:c,filter:(e,t)=>e<s||t>c,add:l})}}return t}},hO=/x/.unicode==null?`g`:`gu`,gO=RegExp(`[\0-\b
|
|
42
|
+
--\u2028\u2029-]`,hO),_O={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`},vO=null;function yO(){if(vO==null&&typeof document<`u`&&document.body){let e=document.body.style;vO=(e.tabSize??e.MozTabSize)!=null}return vO||!1}var bO=gx.define({combine(e){let t=oS(e,{render:null,specialChars:gO,addSpecialChars:null});return(t.replaceTabs=!yO())&&(t.specialChars=RegExp(` |`+t.specialChars.source,hO)),t.addSpecialChars&&(t.specialChars=RegExp(t.specialChars.source+`|`+t.addSpecialChars.source,hO)),t}});function xO(e={}){return[bO.of(e),CO()]}var SO=null;function CO(){return SO||=Yw.fromClass(class{constructor(e){this.view=e,this.decorations=JC.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(bO)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new mO({regexp:e.specialChars,decoration:(t,n,r)=>{let{doc:i}=n.state,a=ex(t[0],0);if(a==9){let e=i.lineAt(r),t=n.state.tabSize,a=wS(e.text,t,r-e.from);return JC.replace({widget:new DO((t-a%t)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[a]||(this.decorationCache[a]=JC.replace({widget:new EO(e,a)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(bO);e.startState.facet(bO)==t?this.decorations=this.decorator.updateDeco(e,this.decorations):(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view))}},{decorations:e=>e.decorations})}var wO=`•`;function TO(e){return e>=32?wO:e==10?``:String.fromCharCode(9216+e)}var EO=class extends KC{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=TO(this.code),n=e.state.phrase(`Control character`)+` `+(_O[this.code]||`0x`+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,n,t);if(r)return r;let i=document.createElement(`span`);return i.textContent=t,i.title=n,i.setAttribute(`aria-label`,n),i.className=`cm-specialChar`,i}ignoreEvent(){return!1}},DO=class extends KC{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement(`span`);return e.textContent=` `,e.className=`cm-tab`,e.style.width=this.width+`px`,e}ignoreEvent(){return!1}};function OO(){return AO}var kO=JC.line({class:`cm-activeLine`}),AO=Yw.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 r of e.state.selection.ranges){let i=e.lineBlockAt(r.head);i.from>t&&(n.push(kO.range(i.from)),t=i.from)}return JC.set(n)}},{decorations:e=>e.decorations}),jO=2e3;function MO(e,t,n){let r=Math.min(t.line,n.line),i=Math.max(t.line,n.line),a=[];if(t.off>jO||n.off>jO||t.col<0||n.col<0){let o=Math.min(t.off,n.off),s=Math.max(t.off,n.off);for(let t=r;t<=i;t++){let n=e.doc.line(t);n.length<=s&&a.push(L.range(n.from+o,n.to+s))}}else{let o=Math.min(t.col,n.col),s=Math.max(t.col,n.col);for(let t=r;t<=i;t++){let n=e.doc.line(t),r=TS(n.text,o,e.tabSize,!0);if(r<0)a.push(L.cursor(n.to));else{let t=TS(n.text,s,e.tabSize);a.push(L.range(n.from+r,n.from+t))}}}return a}function NO(e,t){let n=e.coordsAtPos(e.viewport.from);return n?Math.round(Math.abs((n.left-t)/e.defaultCharacterWidth)):-1}function PO(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1),r=e.state.doc.lineAt(n),i=n-r.from,a=i>jO?-1:i==r.length?NO(e,t.clientX):wS(r.text,e.state.tabSize,n-r.from);return{line:r.number,col:a,off:i}}function FO(e,t){let n=PO(e,t),r=e.state.selection;return n?{update(e){if(e.docChanged){let t=e.changes.mapPos(e.startState.doc.line(n.line).from),i=e.state.doc.lineAt(t);n={line:i.number,col:n.col,off:Math.min(n.off,i.length)},r=r.map(e.changes)}},get(t,i,a){let o=PO(e,t);if(!o)return r;let s=MO(e.state,n,o);return s.length?a?L.create(s.concat(r.ranges)):L.create(s):r}}:null}function IO(e){let t=e?.eventFilter||(e=>e.altKey&&e.button==0);return DD.mouseSelectionStyle.of((e,n)=>t(n)?FO(e,n):null)}var LO={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},RO={style:`cursor: crosshair`};function zO(e={}){let[t,n]=LO[e.key||`Alt`],r=Yw.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[r,DD.contentAttributes.of(e=>e.plugin(r)?.isDown?RO:null)]}var BO=`-10000px`,VO=class{constructor(e,t,n,r){this.facet=t,this.createTooltipView=n,this.removeTooltipView=r,this.input=e.state.facet(t),this.tooltips=this.input.filter(e=>e);let i=null;this.tooltipViews=this.tooltips.map(e=>i=n(e,i))}update(e,t){var n;let r=e.state.facet(this.facet),i=r.filter(e=>e);if(r===this.input){for(let t of this.tooltipViews)t.update&&t.update(e);return!1}let a=[],o=t?[]:null;for(let n=0;n<i.length;n++){let r=i[n],s=-1;if(r){for(let e=0;e<this.tooltips.length;e++){let t=this.tooltips[e];t&&t.create==r.create&&(s=e)}if(s<0)a[n]=this.createTooltipView(r,n?a[n-1]:null),o&&(o[n]=!!r.above);else{let r=a[n]=this.tooltipViews[s];o&&(o[n]=t[s]),r.update&&r.update(e)}}}for(let e of this.tooltipViews)a.indexOf(e)<0&&(this.removeTooltipView(e),(n=e.destroy)==null||n.call(e));return t&&(o.forEach((e,n)=>t[n]=e),t.length=o.length),this.input=r,this.tooltips=i,this.tooltipViews=a,!0}};function HO(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}var UO=gx.define({combine:e=>({position:AC.ios?`absolute`:e.find(e=>e.position)?.position||`fixed`,parent:e.find(e=>e.parent)?.parent||null,tooltipSpace:e.find(e=>e.tooltipSpace)?.tooltipSpace||HO})}),WO=new WeakMap,GO=Yw.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(UO);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.resizeObserver=typeof ResizeObserver==`function`?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new VO(e,YO,(e,t)=>this.createTooltip(e,t),e=>{this.resizeObserver&&this.resizeObserver.unobserve(e.dom),e.dom.remove()}),this.above=this.manager.tooltips.map(e=>!!e.above),this.intersectionObserver=typeof IntersectionObserver==`function`?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,r=e.state.facet(UO);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let e of this.manager.tooltipViews)e.dom.style.position=this.position;n=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.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,t){let n=e.create(this.view),r=t?t.dom:null;if(n.dom.classList.add(`cm-tooltip`),e.arrow&&!n.dom.querySelector(`.cm-tooltip > .cm-tooltip-arrow`)){let e=document.createElement(`div`);e.className=`cm-tooltip-arrow`,n.dom.appendChild(e)}return n.dom.style.position=this.position,n.dom.style.top=BO,n.dom.style.left=`0px`,this.container.insertBefore(n.dom,r),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var e,t,n;this.view.win.removeEventListener(`resize`,this.measureSoon);for(let t of this.manager.tooltipViews)t.dom.remove(),(e=t.destroy)==null||e.call(t);this.parent&&this.container.remove(),(t=this.resizeObserver)==null||t.disconnect(),(n=this.intersectionObserver)==null||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=1,t=1,n=!1;if(this.position==`fixed`&&this.manager.tooltipViews.length){let{dom:e}=this.manager.tooltipViews[0];if(AC.gecko)n=e.offsetParent!=this.container.ownerDocument.body;else if(e.style.top==BO&&e.style.left==`0px`){let t=e.getBoundingClientRect();n=Math.abs(t.top+1e4)>1||Math.abs(t.left)>1}}if(n||this.position==`absolute`)if(this.parent){let n=this.parent.getBoundingClientRect();n.width&&n.height&&(e=n.width/this.parent.offsetWidth,t=n.height/this.parent.offsetHeight)}else ({scaleX:e,scaleY:t}=this.view.viewState);let r=this.view.scrollDOM.getBoundingClientRect(),i=aT(this.view);return{visible:{left:r.left+i.left,top:r.top+i.top,right:r.right-i.right,bottom:r.bottom-i.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((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(UO).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:n}}writeMeasure(e){if(e.makeAbsolute){this.madeAbsolute=!0,this.position=`absolute`;for(let e of this.manager.tooltipViews)e.dom.style.position=`absolute`}let{visible:t,space:n,scaleX:r,scaleY:i}=e,a=[];for(let o=0;o<this.manager.tooltips.length;o++){let s=this.manager.tooltips[o],c=this.manager.tooltipViews[o],{dom:l}=c,u=e.pos[o],d=e.size[o];if(!u||s.clip!==!1&&(u.bottom<=Math.max(t.top,n.top)||u.top>=Math.min(t.bottom,n.bottom)||u.right<Math.max(t.left,n.left)-.1||u.left>Math.min(t.right,n.right)+.1)){l.style.top=BO;continue}let f=s.arrow?c.dom.querySelector(`.cm-tooltip-arrow`):null,p=f?7:0,m=d.right-d.left,h=WO.get(c)??d.bottom-d.top,g=c.offset||JO,_=this.view.textDirection==sw.LTR,v=d.width>n.right-n.left?_?n.left:n.right-d.width:_?Math.max(n.left,Math.min(u.left-(f?14:0)+g.x,n.right-m)):Math.min(Math.max(n.left,u.left-m+(f?14:0)-g.x),n.right-m),y=this.above[o];!s.strictSide&&(y?u.top-h-p-g.y<n.top:u.bottom+h+p+g.y>n.bottom)&&y==n.bottom-u.bottom>u.top-n.top&&(y=this.above[o]=!y);let b=(y?u.top-n.top:n.bottom-u.bottom)-p;if(b<h&&c.resize!==!1){if(b<this.view.defaultLineHeight){l.style.top=BO;continue}WO.set(c,h),l.style.height=(h=b)/i+`px`}else l.style.height&&(l.style.height=``);let x=y?u.top-h-p-g.y:u.bottom+p+g.y,S=v+m;if(c.overlap!==!0)for(let e of a)e.left<S&&e.right>v&&e.top<x+h&&e.bottom>x&&(x=y?e.top-h-2-p:e.bottom+p+2);if(this.position==`absolute`?(l.style.top=(x-e.parent.top)/i+`px`,KO(l,(v-e.parent.left)/r)):(l.style.top=x/i+`px`,KO(l,v/r)),f){let e=u.left+(_?g.x:-g.x)-(v+14-7);f.style.left=e/r+`px`}c.overlap!==!0&&a.push({left:v,top:x,right:S,bottom:x+h}),l.classList.toggle(`cm-tooltip-above`,y),l.classList.toggle(`cm-tooltip-below`,!y),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=BO}},{eventObservers:{scroll(){this.maybeMeasure()}}});function KO(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+`px`)}var qO=DD.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:`border-box`},"&light .cm-tooltip":{border:`1px solid #bbb`,backgroundColor:`#f5f5f5`},"&light .cm-tooltip-section:not(:first-child)":{borderTop:`1px solid #bbb`},"&dark .cm-tooltip":{backgroundColor:`#333338`,color:`white`},".cm-tooltip-arrow":{height:`7px`,width:`14px`,position:`absolute`,zIndex:-1,overflow:`hidden`,"&:before, &:after":{content:`''`,position:`absolute`,width:0,height:0,borderLeft:`7px solid transparent`,borderRight:`7px solid transparent`},".cm-tooltip-above &":{bottom:`-7px`,"&:before":{borderTop:`7px solid #bbb`},"&:after":{borderTop:`7px solid #f5f5f5`,bottom:`1px`}},".cm-tooltip-below &":{top:`-7px`,"&:before":{borderBottom:`7px solid #bbb`},"&:after":{borderBottom:`7px solid #f5f5f5`,top:`1px`}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:`#333338`,borderBottomColor:`#333338`},"&:after":{borderTopColor:`transparent`,borderBottomColor:`transparent`}}}),JO={x:0,y:0},YO=gx.define({enables:[GO,qO]}),XO=gx.define({combine:e=>e.reduce((e,t)=>e.concat(t),[])}),ZO=class e{static create(t){return new e(t)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement(`div`),this.dom.classList.add(`cm-tooltip-hover`),this.manager=new VO(e,XO,(e,t)=>this.createHostedView(e,t),e=>e.dom.remove())}createHostedView(e,t){let n=e.create(this.view);return n.dom.classList.add(`cm-tooltip-section`),this.dom.insertBefore(n.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&n.mount&&n.mount(this.view),n}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)==null||e.call(t)}passProp(e){let t;for(let n of this.manager.tooltipViews){let r=n[e];if(r!==void 0){if(t===void 0)t=r;else if(t!==r)return}}return t}get offset(){return this.passProp(`offset`)}get getCoords(){return this.passProp(`getCoords`)}get overlap(){return this.passProp(`overlap`)}get resize(){return this.passProp(`resize`)}},QO=YO.compute([XO],e=>{let t=e.facet(XO);return t.length===0?null:{pos:Math.min(...t.map(e=>e.pos)),end:Math.max(...t.map(e=>e.end??e.pos)),create:ZO.create,above:t[0].above,arrow:t.some(e=>e.arrow)}}),$O=class{constructor(e,t,n,r,i){this.view=e,this.source=t,this.field=n,this.setHover=r,this.hoverTime=i,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.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:t}=this,n=e.docView.nearest(t.target);if(!n)return;let r,i=1;if(n instanceof FC)r=n.posAtStart;else{if(r=e.posAtCoords(t),r==null)return;let n=e.coordsAtPos(r);if(!n||t.y<n.top||t.y>n.bottom||t.x<n.left-e.defaultCharacterWidth||t.x>n.right+e.defaultCharacterWidth)return;let a=e.bidiSpans(e.state.doc.lineAt(r)).find(e=>e.from<=r&&e.to>=r),o=a&&a.dir==sw.RTL?-1:1;i=t.x<n.left?-o:o}let a=this.source(e,r,i);if(a?.then){let t=this.pending={pos:r};a.then(n=>{this.pending==t&&(this.pending=null,n&&!(Array.isArray(n)&&!n.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(n)?n:[n])}))},t=>Gw(e.state,t,`hover tooltip`))}else a&&!(Array.isArray(a)&&!a.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(a)?a:[a])})}get tooltip(){let e=this.view.plugin(GO),t=e?e.manager.tooltips.findIndex(e=>e.create==ZO.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){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:t,tooltip:n}=this;if(t.length&&n&&!tk(n.dom,e)||this.pending){let{pos:n}=t[0]||this.pending,r=t[0]?.end??n;(n==r?this.view.posAtCoords(this.lastMove)!=n:!nk(this.view,n,r,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length){let{tooltip:t}=this;t&&t.dom.contains(e.relatedTarget)?this.watchTooltipLeave(t.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=n=>{e.removeEventListener(`mouseleave`,t),this.active.length&&!this.view.dom.contains(n.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener(`mouseleave`,t)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener(`mouseleave`,this.mouseleave),this.view.dom.removeEventListener(`mousemove`,this.mousemove)}},ek=4;function tk(e,t){let{left:n,right:r,top:i,bottom:a}=e.getBoundingClientRect(),o;if(o=e.querySelector(`.cm-tooltip-arrow`)){let e=o.getBoundingClientRect();i=Math.min(e.top,i),a=Math.max(e.bottom,a)}return t.clientX>=n-ek&&t.clientX<=r+ek&&t.clientY>=i-ek&&t.clientY<=a+ek}function nk(e,t,n,r,i,a){let o=e.scrollDOM.getBoundingClientRect(),s=e.documentTop+e.documentPadding.top+e.contentHeight;if(o.left>r||o.right<r||o.top>i||Math.min(o.bottom,s)<i)return!1;let c=e.posAtCoords({x:r,y:i},!1);return c>=t&&c<=n}function rk(e,t={}){let n=Wx.define(),r=Cx.define({create(){return[]},update(e,r){if(e.length&&(t.hideOnChange&&(r.docChanged||r.selection)?e=[]:t.hideOn&&(e=e.filter(e=>!t.hideOn(r,e))),r.docChanged)){let t=[];for(let n of e){let e=r.changes.mapPos(n.pos,-1,ix.TrackDel);if(e!=null){let i=Object.assign(Object.create(null),n);i.pos=e,i.end!=null&&(i.end=r.changes.mapPos(i.end)),t.push(i)}}e=t}for(let t of r.effects)t.is(n)&&(e=t.value),t.is(ak)&&(e=[]);return e},provide:e=>XO.from(e)});return{active:r,extension:[r,Yw.define(i=>new $O(i,e,r,n,t.hoverTime||300)),QO]}}function ik(e,t){let n=e.plugin(GO);if(!n)return null;let r=n.manager.tooltips.indexOf(t);return r<0?null:n.manager.tooltipViews[r]}var ak=Wx.define(),ok=gx.define({combine(e){let t,n;for(let r of e)t||=r.topContainer,n||=r.bottomContainer;return{topContainer:t,bottomContainer:n}}});function sk(e,t){let n=e.plugin(ck),r=n?n.specs.indexOf(t):-1;return r>-1?n.panels[r]:null}var ck=Yw.fromClass(class{constructor(e){this.input=e.state.facet(dk),this.specs=this.input.filter(e=>e),this.panels=this.specs.map(t=>t(e));let t=e.state.facet(ok);this.top=new lk(e,!0,t.topContainer),this.bottom=new lk(e,!1,t.bottomContainer),this.top.sync(this.panels.filter(e=>e.top)),this.bottom.sync(this.panels.filter(e=>!e.top));for(let e of this.panels)e.dom.classList.add(`cm-panel`),e.mount&&e.mount()}update(e){let t=e.state.facet(ok);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new lk(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new lk(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(dk);if(n!=this.input){let t=n.filter(e=>e),r=[],i=[],a=[],o=[];for(let n of t){let t=this.specs.indexOf(n),s;t<0?(s=n(e.view),o.push(s)):(s=this.panels[t],s.update&&s.update(e)),r.push(s),(s.top?i:a).push(s)}this.specs=t,this.panels=r,this.top.sync(i),this.bottom.sync(a);for(let e of o)e.dom.classList.add(`cm-panel`),e.mount&&e.mount()}else for(let t of this.panels)t.update&&t.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>DD.scrollMargins.of(t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})}),lk=class{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(this.panels.length==0){this.dom&&=(this.dom.remove(),void 0);return}if(!this.dom){this.dom=document.createElement(`div`),this.dom.className=this.top?`cm-panels cm-panels-top`:`cm-panels cm-panels-bottom`,this.dom.style[this.top?`top`:`bottom`]=`0`;let 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=uk(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=uk(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 uk(e){let t=e.nextSibling;return e.remove(),t}var dk=gx.define({enables:ck}),fk=class extends sS{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}};fk.prototype.elementClass=``,fk.prototype.toDOM=void 0,fk.prototype.mapMode=ix.TrackBefore,fk.prototype.startSide=fk.prototype.endSide=-1,fk.prototype.point=!0;var pk=gx.define(),mk=gx.define(),hk={class:``,renderEmptyElements:!1,elementStyle:``,markers:()=>dS.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},gk=gx.define();function _k(e){return[yk(),gk.of(Object.assign(Object.assign({},hk),e))]}var vk=gx.define({combine:e=>e.some(e=>e)});function yk(e){let t=[bk];return e&&e.fixed===!1&&t.push(vk.of(!0)),t}var bk=Yw.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(gk).map(t=>new wk(e,t));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!e.state.facet(vk),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,r=Math.min(t.to,n.to)-Math.max(t.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}e.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+`px`),this.view.state.facet(vk)!=!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=dS.iter(this.view.state.facet(pk),this.view.viewport.from),r=[],i=this.gutters.map(e=>new Ck(e,this.view.viewport,-this.view.documentPadding.top));for(let e of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(e.type)){let t=!0;for(let a of e.type)if(a.type==qC.Text&&t){Sk(n,r,a.from);for(let e of i)e.line(this.view,a,r);t=!1}else if(a.widget)for(let e of i)e.widget(this.view,a)}else if(e.type==qC.Text){Sk(n,r,e.from);for(let t of i)t.line(this.view,e,r)}else if(e.widget)for(let t of i)t.widget(this.view,e);for(let e of i)e.finish();e&&this.view.scrollDOM.insertBefore(this.dom,t)}updateGutters(e){let t=e.startState.facet(gk),n=e.state.facet(gk),r=e.docChanged||e.heightChanged||e.viewportChanged||!dS.eq(e.startState.facet(pk),e.state.facet(pk),e.view.viewport.from,e.view.viewport.to);if(t==n)for(let t of this.gutters)t.update(e)&&(r=!0);else{r=!0;let i=[];for(let r of n){let n=t.indexOf(r);n<0?i.push(new wk(this.view,r)):(this.gutters[n].update(e),i.push(this.gutters[n]))}for(let e of this.gutters)e.dom.remove(),i.indexOf(e)<0&&e.destroy();for(let e of i)this.dom.appendChild(e.dom);this.gutters=i}return r}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove()}},{provide:e=>DD.scrollMargins.of(t=>{let n=t.plugin(e);return!n||n.gutters.length==0||!n.fixed?null:t.textDirection==sw.LTR?{left:n.dom.offsetWidth*t.scaleX}:{right:n.dom.offsetWidth*t.scaleX}})});function xk(e){return Array.isArray(e)?e:[e]}function Sk(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}var Ck=class{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=dS.iter(e.markers,t.from)}addElement(e,t,n){let{gutter:r}=this,i=(t.top-this.height)/e.scaleY,a=t.height/e.scaleY;if(this.i==r.elements.length){let t=new Tk(e,a,i,n);r.elements.push(t),r.dom.appendChild(t.dom)}else r.elements[this.i].update(e,a,i,n);this.height=t.bottom,this.i++}line(e,t,n){let r=[];Sk(this.cursor,r,t.from),n.length&&(r=r.concat(n));let i=this.gutter.config.lineMarker(e,t,r);i&&r.unshift(i);let a=this.gutter;r.length==0&&!a.config.renderEmptyElements||this.addElement(e,t,r)}widget(e,t){let n=this.gutter.config.widgetMarker(e,t.widget,t),r=n?[n]:null;for(let n of e.state.facet(mk)){let i=n(e,t.widget,t);i&&(r||=[]).push(i)}r&&this.addElement(e,t,r)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}},wk=class{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,r=>{let i=r.target,a;if(i!=this.dom&&this.dom.contains(i)){for(;i.parentNode!=this.dom;)i=i.parentNode;let e=i.getBoundingClientRect();a=(e.top+e.bottom)/2}else a=r.clientY;let o=e.lineBlockAtHeight(a-e.documentTop);t.domEventHandlers[n](e,o,r)&&r.preventDefault()});this.markers=xk(t.markers(e)),t.initialSpacer&&(this.spacer=new Tk(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=xk(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!dS.eq(this.markers,t,n.from,n.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}},Tk=class{constructor(e,t,n,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement(`div`),this.dom.className=`cm-gutterElement`,this.update(e,t,n,r)}update(e,t,n,r){this.height!=t&&(this.height=t,this.dom.style.height=t+`px`),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+`px`:``),Ek(this.markers,r)||this.setMarkers(e,r)}setMarkers(e,t){let n=`cm-gutterElement`,r=this.dom.firstChild;for(let i=0,a=0;;){let o=a,s=i<t.length?t[i++]:null,c=!1;if(s){let e=s.elementClass;e&&(n+=` `+e);for(let e=a;e<this.markers.length;e++)if(this.markers[e].compare(s)){o=e,c=!0;break}}else o=this.markers.length;for(;a<o;){let e=this.markers[a++];if(e.toDOM){e.destroy(r);let t=r.nextSibling;r.remove(),r=t}}if(!s)break;s.toDOM&&(c?r=r.nextSibling:this.dom.insertBefore(s.toDOM(e),r)),c&&a++}this.dom.className=n,this.markers=t}destroy(){this.setMarkers(null,[])}};function Ek(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].compare(t[n]))return!1;return!0}var Dk=gx.define(),Ok=gx.define(),kk=gx.define({combine(e){return oS(e,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let n=Object.assign({},e);for(let e in t){let r=n[e],i=t[e];n[e]=r?(e,t,n)=>r(e,t,n)||i(e,t,n):i}return n}})}}),Ak=class extends fk{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}};function jk(e,t){return e.state.facet(kk).formatNumber(t,e.state)}var Mk=gk.compute([kk],e=>({class:`cm-lineNumbers`,renderEmptyElements:!1,markers(e){return e.state.facet(Dk)},lineMarker(e,t,n){return n.some(e=>e.toDOM)?null:new Ak(jk(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,n)=>{for(let r of e.state.facet(Ok)){let i=r(e,t,n);if(i)return i}return null},lineMarkerChange:e=>e.startState.facet(kk)!=e.state.facet(kk),initialSpacer(e){return new Ak(jk(e,Pk(e.state.doc.lines)))},updateSpacer(e,t){let n=jk(t.view,Pk(t.view.state.doc.lines));return n==e.number?e:new Ak(n)},domEventHandlers:e.facet(kk).domEventHandlers}));function Nk(e={}){return[kk.of(e),yk(),Mk]}function Pk(e){let t=9;for(;t<e;)t=t*10+9;return t}var Fk=new class extends fk{constructor(){super(...arguments),this.elementClass=`cm-activeLineGutter`}},Ik=pk.compute([`selection`],e=>{let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.head).from;i>n&&(n=i,t.push(Fk.range(i)))}return dS.of(t)});function Lk(){return Ik}var Rk=1024,zk=0,Bk=class{constructor(e,t){this.from=e,this.to=t}},Vk=class{constructor(e={}){this.id=zk++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw Error(`This node type doesn't define a deserialize function`)})}add(e){if(this.perNode)throw RangeError(`Can't add per-node props to node types`);return typeof e!=`function`&&(e=Wk.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}};Vk.closedBy=new Vk({deserialize:e=>e.split(` `)}),Vk.openedBy=new Vk({deserialize:e=>e.split(` `)}),Vk.group=new Vk({deserialize:e=>e.split(` `)}),Vk.isolate=new Vk({deserialize:e=>{if(e&&e!=`rtl`&&e!=`ltr`&&e!=`auto`)throw RangeError(`Invalid value for isolate: `+e);return e||`auto`}}),Vk.contextHash=new Vk({perNode:!0}),Vk.lookAhead=new Vk({perNode:!0}),Vk.mounted=new Vk({perNode:!0});var Hk=class{constructor(e,t,n){this.tree=e,this.overlay=t,this.parser=n}static get(e){return e&&e.props&&e.props[Vk.mounted.id]}},Uk=Object.create(null),Wk=class e{constructor(e,t,n,r=0){this.name=e,this.props=t,this.id=n,this.flags=r}static define(t){let n=t.props&&t.props.length?Object.create(null):Uk,r=!!t.top|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),i=new e(t.name||``,n,t.id,r);if(t.props){for(let e of t.props)if(Array.isArray(e)||(e=e(i)),e){if(e[0].perNode)throw RangeError(`Can't store a per-node prop on a node type`);n[e[0].id]=e[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e==`string`){if(this.name==e)return!0;let t=this.prop(Vk.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let r of n.split(` `))t[r]=e[n];return e=>{for(let n=e.prop(Vk.group),r=-1;r<(n?n.length:0);r++){let i=t[r<0?e.name:n[r]];if(i)return i}}}};Wk.none=new Wk(``,Object.create(null),0,8);var Gk=class e{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw RangeError(`Node type ids should correspond to array positions when creating a node set`)}extend(...t){let n=[];for(let e of this.types){let r=null;for(let n of t){let t=n(e);t&&(r||=Object.assign({},e.props),r[t[0].id]=t[1])}n.push(r?new Wk(e.name,r,e.id,e.flags):e)}return new e(n)}},Kk=new WeakMap,qk=new WeakMap,Jk;(function(e){e[e.ExcludeBuffers=1]=`ExcludeBuffers`,e[e.IncludeAnonymous=2]=`IncludeAnonymous`,e[e.IgnoreMounts=4]=`IgnoreMounts`,e[e.IgnoreOverlays=8]=`IgnoreOverlays`})(Jk||={});var Yk=class e{constructor(e,t,n,r,i){if(this.type=e,this.children=t,this.positions=n,this.length=r,this.props=null,i&&i.length){this.props=Object.create(null);for(let[e,t]of i)this.props[typeof e==`number`?e:e.id]=t}}toString(){let e=Hk.get(this);if(e&&!e.overlay)return e.tree.toString();let t=``;for(let e of this.children){let n=e.toString();n&&(t&&(t+=`,`),t+=n)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?`(`+t+`)`:``):t}cursor(e=0){return new lA(this.topNode,e)}cursorAt(e,t=0,n=0){let r=new lA(Kk.get(this)||this.topNode);return r.moveTo(e,t),Kk.set(this,r._tree),r}get topNode(){return new tA(this,0,0,null)}resolve(e,t=0){let n=$k(Kk.get(this)||this.topNode,e,t,!1);return Kk.set(this,n),n}resolveInner(e,t=0){let n=$k(qk.get(this)||this.topNode,e,t,!0);return qk.set(this,n),n}resolveStack(e,t=0){return cA(this,e,t)}iterate(e){let{enter:t,leave:n,from:r=0,to:i=this.length}=e,a=e.mode||0,o=(a&Jk.IncludeAnonymous)>0;for(let e=this.cursor(a|Jk.IncludeAnonymous);;){let a=!1;if(e.from<=i&&e.to>=r&&(!o&&e.type.isAnonymous||t(e)!==!1)){if(e.firstChild())continue;a=!0}for(;a&&n&&(o||!e.type.isAnonymous)&&n(e),!e.nextSibling();){if(!e.parent())return;a=!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(t={}){return this.children.length<=8?this:mA(Wk.none,this.children,this.positions,0,this.children.length,0,this.length,(t,n,r)=>new e(this.type,t,n,r,this.propValues),t.makeTree||((t,n,r)=>new e(Wk.none,t,n,r)))}static build(e){return dA(e)}};Yk.empty=new Yk(Wk.none,[],[],0);var Xk=class e{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 e(this.buffer,this.index)}},Zk=class e{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return Wk.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(`,`)}childString(e){let t=this.buffer[e],n=this.buffer[e+3],r=this.set.types[t],i=r.name;if(/\W/.test(i)&&!r.isError&&(i=JSON.stringify(i)),e+=4,n==e)return i;let a=[];for(;e<n;)a.push(this.childString(e)),e=this.buffer[e+3];return i+`(`+a.join(`,`)+`)`}findChild(e,t,n,r,i){let{buffer:a}=this,o=-1;for(let s=e;s!=t&&!(Qk(i,r,a[s+1],a[s+2])&&(o=s,n>0));s=a[s+3]);return o}slice(t,n,r){let i=this.buffer,a=new Uint16Array(n-t),o=0;for(let e=t,s=0;e<n;){a[s++]=i[e++],a[s++]=i[e++]-r;let n=a[s++]=i[e++]-r;a[s++]=i[e++]-t,o=Math.max(o,n)}return new e(a,o,this.set)}};function Qk(e,t,n,r){switch(e){case-2:return n<t;case-1:return r>=t&&n<t;case 0:return n<t&&r>t;case 1:return n<=t&&r>t;case 2:return r>t;case 4:return!0}}function $k(e,t,n,r){for(;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to<t);){let t=!r&&e instanceof tA&&e.index<0?null:e.parent;if(!t)return e;e=t}let i=r?0:Jk.IgnoreOverlays;if(r)for(let r=e,a=r.parent;a;r=a,a=r.parent)r instanceof tA&&r.index<0&&a.enter(t,n,i)?.from!=r.from&&(e=a);for(;;){let r=e.enter(t,n,i);if(!r)return e;e=r}}var eA=class{cursor(e=0){return new lA(this,e)}getChild(e,t=null,n=null){let r=nA(this,e,t,n);return r.length?r[0]:null}getChildren(e,t=null,n=null){return nA(this,e,t,n)}resolve(e,t=0){return $k(this,e,t,!1)}resolveInner(e,t=0){return $k(this,e,t,!0)}matchContext(e){return rA(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),n=this;for(;t;){let e=t.lastChild;if(!e||e.to!=t.to)break;e.type.isError&&e.from==e.to?(n=t,t=e.prevSibling):t=e}return n}get node(){return this}get next(){return this.parent}},tA=class e extends eA{constructor(e,t,n,r){super(),this._tree=e,this.from=t,this.index=n,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(t,n,r,i,a=0){for(let o=this;;){for(let{children:s,positions:c}=o._tree,l=n>0?s.length:-1;t!=l;t+=n){let l=s[t],u=c[t]+o.from;if(Qk(i,r,u,u+l.length)){if(l instanceof Zk){if(a&Jk.ExcludeBuffers)continue;let e=l.findChild(0,l.buffer.length,n,r-u,i);if(e>-1)return new aA(new iA(o,l,t,u),null,e)}else if(a&Jk.IncludeAnonymous||!l.type.isAnonymous||uA(l)){let s;if(!(a&Jk.IgnoreMounts)&&(s=Hk.get(l))&&!s.overlay)return new e(s.tree,u,t,o);let c=new e(l,u,t,o);return a&Jk.IncludeAnonymous||!c.type.isAnonymous?c:c.nextChild(n<0?l.children.length-1:0,n,r,i)}}}if(a&Jk.IncludeAnonymous||!o.type.isAnonymous||(t=o.index>=0?o.index+n:n<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(t,n,r=0){let i;if(!(r&Jk.IgnoreOverlays)&&(i=Hk.get(this._tree))&&i.overlay){let r=t-this.from;for(let{from:t,to:a}of i.overlay)if((n>0?t<=r:t<r)&&(n<0?a>=r:a>r))return new e(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}};function nA(e,t,n,r){let i=e.cursor(),a=[];if(!i.firstChild())return a;if(n!=null){for(let e=!1;!e;)if(e=i.type.is(n),!i.nextSibling())return a}for(;;){if(r!=null&&i.type.is(r))return a;if(i.type.is(t)&&a.push(i.node),!i.nextSibling())return r==null?a:[]}}function rA(e,t,n=t.length-1){for(let r=e;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(t[n]&&t[n]!=r.name)return!1;n--}}return!0}var iA=class{constructor(e,t,n,r){this.parent=e,this.buffer=t,this.index=n,this.start=r}},aA=class e extends eA{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(t,n,r){let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],t,n-this.context.start,r);return a<0?null:new e(this.context,this,a)}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(t,n,r=0){if(r&Jk.ExcludeBuffers)return null;let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,t-this.context.start,n);return a<0?null:new e(this.context,this,a)}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:t}=this.context,n=t.buffer[this.index+3];return n<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new e(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new e(this.context,this._parent,t.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,r=this.index+4,i=n.buffer[this.index+3];if(i>r){let a=n.buffer[this.index+1];e.push(n.slice(r,i,a)),t.push(0)}return new Yk(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}};function oA(e){if(!e.length)return null;let t=0,n=e[0];for(let r=1;r<e.length;r++){let i=e[r];(i.from>n.from||i.to<n.to)&&(n=i,t=r)}let r=n instanceof tA&&n.index<0?null:n.parent,i=e.slice();return r?i[t]=r:i.splice(t,1),new sA(i,n)}var sA=class{constructor(e,t){this.heads=e,this.node=t}get next(){return oA(this.heads)}};function cA(e,t,n){let r=e.resolveInner(t,n),i=null;for(let e=r instanceof tA?r:r.context.parent;e;e=e.parent)if(e.index<0){let a=e.parent;(i||=[r]).push(a.resolve(t,n)),e=a}else{let a=Hk.get(e.tree);if(a&&a.overlay&&a.overlay[0].from<=t&&a.overlay[a.overlay.length-1].to>=t){let o=new tA(a.tree,a.overlay[0].from+e.from,-1,e);(i||=[r]).push($k(o,t,n,!1))}}return i?oA(i):r}var lA=class{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof tA)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let t=e._parent;t;t=t._parent)this.stack.unshift(t.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:n,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=n+r.buffer[e+1],this.to=n+r.buffer[e+2],!0}yield(e){return e?e instanceof tA?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:r}=this.buffer,i=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,n);return i<0?!1:(this.stack.push(this.index),this.yieldBuf(i))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?n&Jk.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Jk.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Jk.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let e=n<0?0:this.stack[n]+4;if(this.index!=e)return this.yieldBuf(t.findChild(e,this.index,-1,0,4))}else{let e=t.buffer[this.index+3];if(e<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(e)}return n<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let e=0;e<this.index;e++)if(r.buffer.buffer[e+3]<this.index)return!1;({index:t,parent:n}=r)}else ({index:t,_parent:n}=this._tree);for(;n;{index:t,_parent:n}=n)if(t>-1)for(let r=t+e,i=e<0?-1:n._tree.children.length;r!=i;r+=e){let e=n._tree.children[r];if(this.mode&Jk.IncludeAnonymous||e instanceof Zk||!e.type.isAnonymous||uA(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<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,n=0;if(e&&e.context==this.buffer)scan:for(let r=this.index,i=this.stack.length;i>=0;){for(let a=e;a;a=a._parent)if(a.index==r){if(r==this.index)return a;t=a,n=i+1;break scan}r=this.stack[--i]}for(let e=n;e<this.stack.length;e++)t=new aA(this.buffer,t,this.stack[e]);return this.bufferNode=new aA(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let n=0;;){let r=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){n++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&t&&t(this),r=this.type.isAnonymous,!n)return;if(this.nextSibling())break;this.parent(),n--,r=!0}}}matchContext(e){if(!this.buffer)return rA(this.node.parent,e);let{buffer:t}=this.buffer,{types:n}=t.set;for(let r=e.length-1,i=this.stack.length-1;r>=0;i--){if(i<0)return rA(this._tree,e,r);let a=n[t.buffer[this.stack[i]]];if(!a.isAnonymous){if(e[r]&&e[r]!=a.name)return!1;r--}}return!0}};function uA(e){return e.children.some(e=>e instanceof Zk||!e.type.isAnonymous||uA(e))}function dA(e){let{buffer:t,nodeSet:n,maxBufferLength:r=Rk,reused:i=[],minRepeatType:a=n.types.length}=e,o=Array.isArray(t)?new Xk(t,t.length):t,s=n.types,c=0,l=0;function u(e,t,_,v,y,b){let{id:x,start:S,end:C,size:w}=o,T=l,E=c;for(;w<0;)if(o.next(),w==-1){let t=i[x];_.push(t),v.push(S-e);return}else if(w==-3){c=x;return}else if(w==-4){l=x;return}else throw RangeError(`Unrecognized record size: ${w}`);let ee=s[x],te,D,ne=S-e;if(C-S<=r&&(D=h(o.pos-t,y))){let t=new Uint16Array(D.size-D.skip),r=o.pos-D.size,i=t.length;for(;o.pos>r;)i=g(D.start,t,i);te=new Zk(t,C-D.start,n),ne=D.start-e}else{let e=o.pos-w;o.next();let t=[],n=[],i=x>=a?x:-1,s=0,c=C;for(;o.pos>e;)i>=0&&o.id==i&&o.size>=0?(o.end<=c-r&&(p(t,n,S,s,o.end,c,i,T,E),s=t.length,c=o.end),o.next()):b>2500?d(S,e,t,n):u(S,e,t,n,i,b+1);if(i>=0&&s>0&&s<t.length&&p(t,n,S,s,S,c,i,T,E),t.reverse(),n.reverse(),i>-1&&s>0){let e=f(ee,E);te=mA(ee,t,n,0,t.length,0,C-S,e,e)}else te=m(ee,t,n,C-S,T-C,E)}_.push(te),v.push(ne)}function d(e,t,i,a){let s=[],c=0,l=-1;for(;o.pos>t;){let{id:e,start:t,end:n,size:i}=o;if(i>4)o.next();else if(l>-1&&t<l)break;else l<0&&(l=n-r),s.push(e,t,n),c++,o.next()}if(c){let t=new Uint16Array(c*4),r=s[s.length-2];for(let e=s.length-3,n=0;e>=0;e-=3)t[n++]=s[e],t[n++]=s[e+1]-r,t[n++]=s[e+2]-r,t[n++]=n;i.push(new Zk(t,s[2]-r,n)),a.push(r-e)}}function f(e,t){return(n,r,i)=>{let a=0,o=n.length-1,s,c;if(o>=0&&(s=n[o])instanceof Yk){if(!o&&s.type==e&&s.length==i)return s;(c=s.prop(Vk.lookAhead))&&(a=r[o]+s.length+c)}return m(e,n,r,i,a,t)}}function p(e,t,r,i,a,o,s,c,l){let u=[],d=[];for(;e.length>i;)u.push(e.pop()),d.push(t.pop()+r-a);e.push(m(n.types[s],u,d,o-a,c-o,l)),t.push(a-r)}function m(e,t,n,r,i,a,o){if(a){let e=[Vk.contextHash,a];o=o?[e].concat(o):[e]}if(i>25){let e=[Vk.lookAhead,i];o=o?[e].concat(o):[e]}return new Yk(e,t,n,r,o)}function h(e,t){let n=o.fork(),i=0,s=0,c=0,l=n.end-r,u={size:0,start:0,skip:0};scan:for(let r=n.pos-e;n.pos>r;){let e=n.size;if(n.id==t&&e>=0){u.size=i,u.start=s,u.skip=c,c+=4,i+=4,n.next();continue}let o=n.pos-e;if(e<0||o<r||n.start<l)break;let d=n.id>=a?4:0,f=n.start;for(n.next();n.pos>o;){if(n.size<0)if(n.size==-3)d+=4;else break scan;else n.id>=a&&(d+=4);n.next()}s=f,i+=e,c+=d}return(t<0||i==e)&&(u.size=i,u.start=s,u.skip=c),u.size>4?u:void 0}function g(e,t,n){let{id:r,start:i,end:s,size:u}=o;if(o.next(),u>=0&&r<a){let a=n;if(u>4){let r=o.pos-(u-4);for(;o.pos>r;)n=g(e,t,n)}t[--n]=a,t[--n]=s-e,t[--n]=i-e,t[--n]=r}else u==-3?c=r:u==-4&&(l=r);return n}let _=[],v=[];for(;o.pos>0;)u(e.start||0,e.bufferStart||0,_,v,-1,0);let y=e.length??(_.length?v[0]+_[0].length:0);return new Yk(s[e.topID],_.reverse(),v.reverse(),y)}var fA=new WeakMap;function pA(e,t){if(!e.isAnonymous||t instanceof Zk||t.type!=e)return 1;let n=fA.get(t);if(n==null){n=1;for(let r of t.children){if(r.type!=e||!(r instanceof Yk)){n=1;break}n+=pA(e,r)}fA.set(t,n)}return n}function mA(e,t,n,r,i,a,o,s,c){let l=0;for(let n=r;n<i;n++)l+=pA(e,t[n]);let u=Math.ceil(l*1.5/8),d=[],f=[];function p(t,n,r,i,o){for(let s=r;s<i;){let r=s,l=n[s],m=pA(e,t[s]);for(s++;s<i;s++){let n=pA(e,t[s]);if(m+n>=u)break;m+=n}if(s==r+1){if(m>u){let e=t[r];p(e.children,e.positions,0,e.children.length,n[r]+o);continue}d.push(t[r])}else{let i=n[s-1]+t[s-1].length-l;d.push(mA(e,t,n,r,s,l,i,null,c))}f.push(l+o-a)}}return p(t,n,r,i,0),(s||c)(d,f,o)}var hA=class e{constructor(e,t,n,r,i=!1,a=!1){this.from=e,this.to=t,this.tree=n,this.offset=r,this.open=!!i|(a?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,n=[],r=!1){let i=[new e(0,t.length,t,0,!1,r)];for(let e of n)e.to>t.length&&i.push(e);return i}static applyChanges(t,n,r=128){if(!n.length)return t;let i=[],a=1,o=t.length?t[0]:null;for(let s=0,c=0,l=0;;s++){let u=s<n.length?n[s]:null,d=u?u.fromA:1e9;if(d-c>=r)for(;o&&o.from<d;){let n=o;if(c>=n.from||d<=n.to||l){let t=Math.max(n.from,c)-l,r=Math.min(n.to,d)-l;n=t>=r?null:new e(t,r,n.tree,n.offset+l,s>0,!!u)}if(n&&i.push(n),o.to>d)break;o=a<t.length?t[a++]:null}if(!u)break;c=u.toA,l=u.toA-u.toB}return i}},gA=class{startParse(e,t,n){return typeof e==`string`&&(e=new _A(e)),n=n?n.length?n.map(e=>new Bk(e.from,e.to)):[new Bk(0,0)]:[new Bk(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let r=this.startParse(e,t,n);for(;;){let e=r.advance();if(e)return e}}},_A=class{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 Vk({perNode:!0});var vA=0,yA=class e{constructor(e,t,n,r){this.name=e,this.set=t,this.base=n,this.modified=r,this.id=vA++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(t,n){let r=typeof t==`string`?t:`?`;if(t instanceof e&&(n=t),n?.base)throw Error(`Can not derive from a modified tag`);let i=new e(r,[],null,[]);if(i.set.push(i),n)for(let e of n.set)i.set.push(e);return i}static defineModifier(e){let t=new xA(e);return e=>e.modified.indexOf(t)>-1?e:xA.get(e.base||e,e.modified.concat(t).sort((e,t)=>e.id-t.id))}},bA=0,xA=class e{constructor(e){this.name=e,this.instances=[],this.id=bA++}static get(t,n){if(!n.length)return t;let r=n[0].instances.find(e=>e.base==t&&SA(n,e.modified));if(r)return r;let i=[],a=new yA(t.name,i,t,n);for(let e of n)e.instances.push(a);let o=CA(n);for(let n of t.set)if(!n.modified.length)for(let t of o)i.push(e.get(n,t));return a}};function SA(e,t){return e.length==t.length&&e.every((e,n)=>e==t[n])}function CA(e){let t=[[]];for(let n=0;n<e.length;n++)for(let r=0,i=t.length;r<i;r++)t.push(t[r].concat(e[n]));return t.sort((e,t)=>t.length-e.length)}function wA(e){let t=Object.create(null);for(let n in e){let r=e[n];Array.isArray(r)||(r=[r]);for(let e of n.split(` `))if(e){let n=[],i=2,a=e;for(let t=0;;){if(a==`...`&&t>0&&t+3==e.length){i=1;break}let r=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!r)throw RangeError(`Invalid path: `+e);if(n.push(r[0]==`*`?``:r[0][0]==`"`?JSON.parse(r[0]):r[0]),t+=r[0].length,t==e.length)break;let o=e[t++];if(t==e.length&&o==`!`){i=0;break}if(o!=`/`)throw RangeError(`Invalid path: `+e);a=e.slice(t)}let o=n.length-1,s=n[o];if(!s)throw RangeError(`Invalid path: `+e);t[s]=new EA(r,i,o>0?n.slice(0,o):null).sort(t[s])}}return TA.add(t)}var TA=new Vk,EA=class{constructor(e,t,n,r){this.tags=e,this.mode=t,this.context=n,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}};EA.empty=new EA([],2,null);function DA(e,t){let n=Object.create(null);for(let t of e)if(!Array.isArray(t.tag))n[t.tag.id]=t.class;else for(let e of t.tag)n[e.id]=t.class;let{scope:r,all:i=null}=t||{};return{style:e=>{let t=i;for(let r of e)for(let e of r.set){let r=n[e.id];if(r){t=t?t+` `+r:r;break}}return t},scope:r}}function OA(e,t){let n=null;for(let r of e){let e=r.style(t);e&&(n=n?n+` `+e:e)}return n}function kA(e,t,n,r=0,i=e.length){let a=new AA(r,Array.isArray(t)?t:[t],n);a.highlightRange(e.cursor(),r,i,``,a.highlighters),a.flush(i)}var AA=class{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,r,i){let{type:a,from:o,to:s}=e;if(o>=n||s<=t)return;a.isTop&&(i=this.highlighters.filter(e=>!e.scope||e.scope(a)));let c=r,l=jA(e)||EA.empty,u=OA(i,l.tags);if(u&&(c&&(c+=` `),c+=u,l.mode==1&&(r+=(r?` `:``)+u)),this.startSpan(Math.max(t,o),c),l.opaque)return;let d=e.tree&&e.tree.prop(Vk.mounted);if(d&&d.overlay){let a=e.node.enter(d.overlay[0].from+o,1),l=this.highlighters.filter(e=>!e.scope||e.scope(d.tree.type)),u=e.firstChild();for(let f=0,p=o;;f++){let m=f<d.overlay.length?d.overlay[f]:null,h=m?m.from+o:s,g=Math.max(t,p),_=Math.min(n,h);if(g<_&&u)for(;e.from<_&&(this.highlightRange(e,g,_,r,i),this.startSpan(Math.min(_,e.to),c),!(e.to>=h||!e.nextSibling())););if(!m||h>n)break;p=m.to+o,p>t&&(this.highlightRange(a.cursor(),Math.max(t,m.from+o),Math.min(n,p),``,l),this.startSpan(Math.min(n,p),c))}u&&e.parent()}else if(e.firstChild()){d&&(r=``);do{if(e.to<=t)continue;if(e.from>=n)break;this.highlightRange(e,t,n,r,i),this.startSpan(Math.min(n,e.to),c)}while(e.nextSibling());e.parent()}}};function jA(e){let t=e.type.prop(TA);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}var MA=yA.define,NA=MA(),PA=MA(),FA=MA(PA),IA=MA(PA),LA=MA(),RA=MA(LA),zA=MA(LA),BA=MA(),VA=MA(BA),HA=MA(),UA=MA(),WA=MA(),GA=MA(WA),KA=MA(),qA={comment:NA,lineComment:MA(NA),blockComment:MA(NA),docComment:MA(NA),name:PA,variableName:MA(PA),typeName:FA,tagName:MA(FA),propertyName:IA,attributeName:MA(IA),className:MA(PA),labelName:MA(PA),namespace:MA(PA),macroName:MA(PA),literal:LA,string:RA,docString:MA(RA),character:MA(RA),attributeValue:MA(RA),number:zA,integer:MA(zA),float:MA(zA),bool:MA(LA),regexp:MA(LA),escape:MA(LA),color:MA(LA),url:MA(LA),keyword:HA,self:MA(HA),null:MA(HA),atom:MA(HA),unit:MA(HA),modifier:MA(HA),operatorKeyword:MA(HA),controlKeyword:MA(HA),definitionKeyword:MA(HA),moduleKeyword:MA(HA),operator:UA,derefOperator:MA(UA),arithmeticOperator:MA(UA),logicOperator:MA(UA),bitwiseOperator:MA(UA),compareOperator:MA(UA),updateOperator:MA(UA),definitionOperator:MA(UA),typeOperator:MA(UA),controlOperator:MA(UA),punctuation:WA,separator:MA(WA),bracket:GA,angleBracket:MA(GA),squareBracket:MA(GA),paren:MA(GA),brace:MA(GA),content:BA,heading:VA,heading1:MA(VA),heading2:MA(VA),heading3:MA(VA),heading4:MA(VA),heading5:MA(VA),heading6:MA(VA),contentSeparator:MA(BA),list:MA(BA),quote:MA(BA),emphasis:MA(BA),strong:MA(BA),link:MA(BA),monospace:MA(BA),strikethrough:MA(BA),inserted:MA(),deleted:MA(),changed:MA(),invalid:MA(),meta:KA,documentMeta:MA(KA),annotation:MA(KA),processingInstruction:MA(KA),definition:yA.defineModifier(`definition`),constant:yA.defineModifier(`constant`),function:yA.defineModifier(`function`),standard:yA.defineModifier(`standard`),local:yA.defineModifier(`local`),special:yA.defineModifier(`special`)};for(let e in qA){let t=qA[e];t instanceof yA&&(t.name=e)}DA([{tag:qA.link,class:`tok-link`},{tag:qA.heading,class:`tok-heading`},{tag:qA.emphasis,class:`tok-emphasis`},{tag:qA.strong,class:`tok-strong`},{tag:qA.keyword,class:`tok-keyword`},{tag:qA.atom,class:`tok-atom`},{tag:qA.bool,class:`tok-bool`},{tag:qA.url,class:`tok-url`},{tag:qA.labelName,class:`tok-labelName`},{tag:qA.inserted,class:`tok-inserted`},{tag:qA.deleted,class:`tok-deleted`},{tag:qA.literal,class:`tok-literal`},{tag:qA.string,class:`tok-string`},{tag:qA.number,class:`tok-number`},{tag:[qA.regexp,qA.escape,qA.special(qA.string)],class:`tok-string2`},{tag:qA.variableName,class:`tok-variableName`},{tag:qA.local(qA.variableName),class:`tok-variableName tok-local`},{tag:qA.definition(qA.variableName),class:`tok-variableName tok-definition`},{tag:qA.special(qA.variableName),class:`tok-variableName2`},{tag:qA.definition(qA.propertyName),class:`tok-propertyName tok-definition`},{tag:qA.typeName,class:`tok-typeName`},{tag:qA.namespace,class:`tok-namespace`},{tag:qA.className,class:`tok-className`},{tag:qA.macroName,class:`tok-macroName`},{tag:qA.propertyName,class:`tok-propertyName`},{tag:qA.operator,class:`tok-operator`},{tag:qA.comment,class:`tok-comment`},{tag:qA.meta,class:`tok-meta`},{tag:qA.invalid,class:`tok-invalid`},{tag:qA.punctuation,class:`tok-punctuation`}]);var JA=new Vk;function YA(e){return gx.define({combine:e?t=>t.concat(e):void 0})}var XA=new Vk,ZA=class{constructor(e,t,n=[],r=``){this.data=e,this.name=r,aS.prototype.hasOwnProperty(`tree`)||Object.defineProperty(aS.prototype,`tree`,{get(){return ej(this)}}),this.parser=t,this.extension=[uj.of(this),aS.languageData.of((e,t,n)=>{let r=QA(e,t,n),i=r.type.prop(JA);if(!i)return[];let a=e.facet(i),o=r.type.prop(XA);if(o){let i=r.resolve(t-r.from,n);for(let t of o)if(t.test(i,e)){let n=e.facet(t.facet);return t.type==`replace`?n:n.concat(a)}}return a})].concat(n)}isActiveAt(e,t,n=-1){return QA(e,t,n).type.prop(JA)==this.data}findRegions(e){let t=e.facet(uj);if(t?.data==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],r=(e,t)=>{if(e.prop(JA)==this.data){n.push({from:t,to:t+e.length});return}let i=e.prop(Vk.mounted);if(i){if(i.tree.prop(JA)==this.data){if(i.overlay)for(let e of i.overlay)n.push({from:e.from+t,to:e.to+t});else n.push({from:t,to:t+e.length});return}else if(i.overlay){let e=n.length;if(r(i.tree,i.overlay[0].from+t),n.length>e)return}}for(let n=0;n<e.children.length;n++){let i=e.children[n];i instanceof Yk&&r(i,e.positions[n]+t)}};return r(ej(e),0),n}get allowsNesting(){return!0}};ZA.setState=Wx.define();function QA(e,t,n){let r=e.facet(uj),i=ej(e).topNode;if(!r||r.allowsNesting)for(let e=i;e;e=e.enter(t,n,Jk.ExcludeBuffers))e.type.isTop&&(i=e);return i}var $A=class e extends ZA{constructor(e,t,n){super(e,t,[],n),this.parser=t}static define(t){let n=YA(t.languageData);return new e(n,t.parser.configure({props:[JA.add(e=>e.isTop?n:void 0)]}),t.name)}configure(t,n){return new e(this.data,this.parser.configure(t),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}};function ej(e){let t=e.field(ZA.state,!1);return t?t.tree:Yk.empty}function tj(e,t,n=50){let r=e.field(ZA.state,!1)?.context;if(!r)return null;let i=r.viewport;r.updateViewport({from:0,to:t});let a=r.isDone(t)||r.work(n,t)?r.tree:null;return r.updateViewport(i),a}var nj=class{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<n||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}},rj=null,ij=class e{constructor(e,t,n=[],r,i,a,o,s){this.parser=e,this.state=t,this.fragments=n,this.tree=r,this.treeLen=i,this.viewport=a,this.skipped=o,this.scheduleOn=s,this.parse=null,this.tempSkipped=[]}static create(t,n,r){return new e(t,n,[],Yk.empty,0,r,[],null)}startParse(){return this.parser.startParse(new nj(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=Yk.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{if(typeof e==`number`){let t=Date.now()+e;e=()=>Date.now()>t}for(this.parse||=this.startParse(),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let n=this.parse.advance();if(n)if(this.fragments=this.withoutTempSkipped(hA.addTree(n,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=this.parse.stoppedAt??this.state.doc.length,this.tree=n,this.parse=null,this.treeLen<(t??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(hA.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=rj;rj=this;try{return e()}finally{rj=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=aj(e,t.from,t.to);return e}changes(t,n){let{fragments:r,tree:i,treeLen:a,viewport:o,skipped:s}=this;if(this.takeTree(),!t.empty){let e=[];if(t.iterChangedRanges((t,n,r,i)=>e.push({fromA:t,toA:n,fromB:r,toB:i})),r=hA.applyChanges(r,e),i=Yk.empty,a=0,o={from:t.mapPos(o.from,-1),to:t.mapPos(o.to,1)},this.skipped.length){s=[];for(let e of this.skipped){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);n<r&&s.push({from:n,to:r})}}}return new e(this.parser,n,r,i,a,o,s,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let t=0;t<this.skipped.length;t++){let{from:n,to:r}=this.skipped[t];n<e.to&&r>e.from&&(this.fragments=aj(this.fragments,n,r),this.skipped.splice(t--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&=(this.takeTree(),null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends gA{createParse(t,n,r){let i=r[0].from,a=r[r.length-1].to;return{parsedPos:i,advance(){let t=rj;if(t){for(let e of r)t.tempSkipped.push(e);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=a,new Yk(Wk.none,[],[],a-i)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return rj}};function aj(e,t,n){return hA.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}var oj=class e{constructor(e){this.context=e,this.tree=e.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(t.changes,t.state),r=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new e(n)}static init(t){let n=Math.min(3e3,t.doc.length),r=ij.create(t.facet(uj).parser,t,{from:0,to:n});return r.work(20,n)||r.takeTree(),new e(r)}};ZA.state=Cx.define({create:oj.init,update(e,t){for(let e of t.effects)if(e.is(ZA.setState))return e.value;return t.startState.facet(uj)==t.state.facet(uj)?e.apply(t):oj.init(t.state)}});var sj=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<`u`&&(sj=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});var cj=typeof navigator<`u`&&navigator.scheduling?.isInputPending?()=>navigator.scheduling.isInputPending():null,lj=Yw.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(ZA.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(ZA.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=sj(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:n,viewport:{to:r}}=this.view,i=n.field(ZA.state);if(i.tree==i.context.tree&&i.context.isDone(r+1e5))return;let a=Date.now()+Math.min(this.chunkBudget,100,e&&!cj?Math.max(25,e.timeRemaining()-5):1e9),o=i.context.treeLen<r&&n.doc.length>r+1e3,s=i.context.work(()=>cj&&cj()||Date.now()>a,r+(o?0:1e5));this.chunkBudget-=Date.now()-t,(s||this.chunkBudget<=0)&&(i.context.takeTree(),this.view.dispatch({effects:ZA.setState.of(new oj(i.context))})),this.chunkBudget>0&&!(s&&!o)&&this.scheduleWork(),this.checkAsyncSchedule(i.context)}checkAsyncSchedule(e){e.scheduleOn&&=(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(e=>Gw(this.view.state,e)).then(()=>this.workScheduled--),null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),uj=gx.define({combine(e){return e.length?e[0]:null},enables:e=>[ZA.state,lj,DD.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]}),dj=class{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}},fj=gx.define(),pj=gx.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 Error(`Invalid indent unit: `+JSON.stringify(e[0]));return t}});function mj(e){let t=e.facet(pj);return t.charCodeAt(0)==9?e.tabSize*t.length:t.length}function hj(e,t){let n=``,r=e.tabSize,i=e.facet(pj)[0];if(i==` `){for(;t>=r;)n+=` `,t-=r;i=` `}for(let e=0;e<t;e++)n+=i;return n}function gj(e,t){e instanceof aS&&(e=new _j(e));for(let n of e.state.facet(fj)){let r=n(e,t);if(r!==void 0)return r}let n=ej(e.state);return n.length>=t?yj(e,n,t):null}var _j=class{constructor(e,t={}){this.state=e,this.options=t,this.unit=mj(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:i}=this.options;return r!=null&&r>=n.from&&r<=n.to?i&&r==e?{text:``,from:e}:(t<0?r<e:r<=e)?{text:n.text.slice(r-n.from),from:r}:{text:n.text.slice(0,r-n.from),from:n.from}:n}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return``;let{text:n,from:r}=this.lineAt(e,t);return n.slice(e-r,Math.min(n.length,e+100-r))}column(e,t=1){let{text:n,from:r}=this.lineAt(e,t),i=this.countColumn(n,e-r),a=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return a>-1&&(i+=a-this.countColumn(n,n.search(/\S|$/))),i}countColumn(e,t=e.length){return wS(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:r}=this.lineAt(e,t),i=this.options.overrideIndentation;if(i){let e=i(r);if(e>-1)return e}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}},vj=new Vk;function yj(e,t,n){let r=t.resolveStack(n),i=t.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(i!=r.node){let e=[];for(let t=i;t&&!(t.from==r.node.from&&t.type==r.node.type);t=t.parent)e.push(t);for(let t=e.length-1;t>=0;t--)r={node:e[t],next:r}}return bj(r,e,n)}function bj(e,t,n){for(let r=e;r;r=r.next){let e=Sj(r.node);if(e)return e(wj.create(t,n,r))}return 0}function xj(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}function Sj(e){let t=e.type.prop(vj);if(t)return t;let n=e.firstChild,r;if(n&&(r=n.type.prop(Vk.closedBy))){let t=e.lastChild,n=t&&r.indexOf(t.name)>-1;return e=>Dj(e,!0,1,void 0,n&&!xj(e)?t.from:void 0)}return e.parent==null?Cj:null}function Cj(){return 0}var wj=class e extends _j{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(t,n,r){return new e(t,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(t.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(Tj(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return bj(this.context.next,this.base,this.pos)}};function Tj(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function Ej(e){let t=e.node,n=t.childAfter(t.from),r=t.lastChild;if(!n)return null;let i=e.options.simulateBreak,a=e.state.doc.lineAt(n.from),o=i==null||i<=a.from?a.to:Math.min(a.to,i);for(let e=n.to;;){let i=t.childAfter(e);if(!i||i==r)return null;if(!i.type.isSkipped){if(i.from>=o)return null;let e=/^ */.exec(a.text.slice(n.to-a.from))[0].length;return{from:n.from,to:n.to+e}}e=i.to}}function Dj(e,t,n,r,i){let a=e.textAfter,o=a.match(/^\s*/)[0].length,s=r&&a.slice(o,o+r.length)==r||i==e.pos+o,c=t?Ej(e):null;return c?s?e.column(c.from):e.column(c.to):e.baseIndent+(s?0:e.unit*n)}function Oj({except:e,units:t=1}={}){return n=>{let r=e&&e.test(n.textAfter);return n.baseIndent+(r?0:t*n.unit)}}var kj=200;function Aj(){return aS.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:r}=e.newSelection.main,i=n.lineAt(r);if(r>i.from+kj)return e;let a=n.sliceString(i.from,r);if(!t.some(e=>e.test(a)))return e;let{state:o}=e,s=-1,c=[];for(let{head:e}of o.selection.ranges){let t=o.doc.lineAt(e);if(t.from==s)continue;s=t.from;let n=gj(o,t.from);if(n==null)continue;let r=/^\s*/.exec(t.text)[0],i=hj(o,n);r!=i&&c.push({from:t.from,to:t.from+r.length,insert:i})}return c.length?[e,{changes:c,sequential:!0}]:e})}var jj=gx.define(),Mj=new Vk;function Nj(e){let t=e.firstChild,n=e.lastChild;return t&&t.to<n.from?{from:t.to,to:n.type.isError?e.to:n.from}:null}function Pj(e,t,n){let r=ej(e);if(r.length<n)return null;let i=r.resolveStack(n,1),a=null;for(let o=i;o;o=o.next){let i=o.node;if(i.to<=n||i.from>n)continue;if(a&&i.from<t)break;let s=i.type.prop(Mj);if(s&&(i.to<r.length-50||r.length==e.doc.length||!Fj(i))){let r=s(i,e);r&&r.from<=n&&r.from>=t&&r.to>n&&(a=r)}}return a}function Fj(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}function Ij(e,t,n){for(let r of e.facet(jj)){let i=r(e,t,n);if(i)return i}return Pj(e,t,n)}function Lj(e,t){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);return n>=r?void 0:{from:n,to:r}}var Rj=Wx.define({map:Lj}),zj=Wx.define({map:Lj});function Bj(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}var Vj=Cx.define({create(){return JC.none},update(e,t){e=e.map(t.changes);for(let n of t.effects)if(n.is(Rj)&&!Uj(e,n.value.from,n.value.to)){let{preparePlaceholder:r}=t.state.facet(Qj),i=r?JC.replace({widget:new nM(r(t.state,n.value))}):tM;e=e.update({add:[i.range(n.value.from,n.value.to)]})}else n.is(zj)&&(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:r}=t.selection.main;e.between(r,r,(e,t)=>{e<r&&t>r&&(n=!0)}),n&&(e=e.update({filterFrom:r,filterTo:r,filter:(e,t)=>t<=r||e>=r}))}return e},provide:e=>DD.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 RangeError(`Invalid JSON for fold state`);let t=[];for(let n=0;n<e.length;){let r=e[n++],i=e[n++];if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid JSON for fold state`);t.push(tM.range(r,i))}return JC.set(t,!0)}});function Hj(e,t,n){var r;let i=null;return(r=e.field(Vj,!1))==null||r.between(t,n,(e,t)=>{(!i||i.from>e)&&(i={from:e,to:t})}),i}function Uj(e,t,n){let r=!1;return e.between(t,t,(e,i)=>{e==t&&i==n&&(r=!0)}),r}function Wj(e,t){return e.field(Vj,!1)?t:t.concat(Wx.appendConfig.of($j()))}var Gj=e=>{for(let t of Bj(e)){let n=Ij(e.state,t.from,t.to);if(n)return e.dispatch({effects:Wj(e.state,[Rj.of(n),qj(e,n)])}),!0}return!1},Kj=e=>{if(!e.state.field(Vj,!1))return!1;let t=[];for(let n of Bj(e)){let r=Hj(e.state,n.from,n.to);r&&t.push(zj.of(r),qj(e,r,!1))}return t.length&&e.dispatch({effects:t}),t.length>0};function qj(e,t,n=!0){let r=e.state.doc.lineAt(t.from).number,i=e.state.doc.lineAt(t.to).number;return DD.announce.of(`${e.state.phrase(n?`Folded lines`:`Unfolded lines`)} ${r} ${e.state.phrase(`to`)} ${i}.`)}var Jj=e=>{let{state:t}=e,n=[];for(let r=0;r<t.doc.length;){let i=e.lineBlockAt(r),a=Ij(t,i.from,i.to);a&&n.push(Rj.of(a)),r=(a?e.lineBlockAt(a.to):i).to+1}return n.length&&e.dispatch({effects:Wj(e.state,n)}),!!n.length},Yj=e=>{let t=e.state.field(Vj,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,(e,t)=>{n.push(zj.of({from:e,to:t}))}),e.dispatch({effects:n}),!0},Xj=[{key:`Ctrl-Shift-[`,mac:`Cmd-Alt-[`,run:Gj},{key:`Ctrl-Shift-]`,mac:`Cmd-Alt-]`,run:Kj},{key:`Ctrl-Alt-[`,run:Jj},{key:`Ctrl-Alt-]`,run:Yj}],Zj={placeholderDOM:null,preparePlaceholder:null,placeholderText:`…`},Qj=gx.define({combine(e){return oS(e,Zj)}});function $j(e){let t=[Vj,oM];return e&&t.push(Qj.of(e)),t}function eM(e,t){let{state:n}=e,r=n.facet(Qj),i=t=>{let n=e.lineBlockAt(e.posAtDOM(t.target)),r=Hj(e.state,n.from,n.to);r&&e.dispatch({effects:zj.of(r)}),t.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(e,i,t);let a=document.createElement(`span`);return a.textContent=r.placeholderText,a.setAttribute(`aria-label`,n.phrase(`folded code`)),a.title=n.phrase(`unfold`),a.className=`cm-foldPlaceholder`,a.onclick=i,a}var tM=JC.replace({widget:new class extends KC{toDOM(e){return eM(e,null)}}}),nM=class extends KC{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return eM(e,this.value)}},rM={openText:`⌄`,closedText:`›`,markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1},iM=class extends fk{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 aM(e={}){let t=Object.assign(Object.assign({},rM),e),n=new iM(t,!0),r=new iM(t,!1),i=Yw.fromClass(class{constructor(e){this.from=e.viewport.from,this.markers=this.buildMarkers(e)}update(e){(e.docChanged||e.viewportChanged||e.startState.facet(uj)!=e.state.facet(uj)||e.startState.field(Vj,!1)!=e.state.field(Vj,!1)||ej(e.startState)!=ej(e.state)||t.foldingChanged(e))&&(this.markers=this.buildMarkers(e.view))}buildMarkers(e){let t=new pS;for(let i of e.viewportLineBlocks){let a=Hj(e.state,i.from,i.to)?r:Ij(e.state,i.from,i.to)?n:null;a&&t.add(i.from,i.from,a)}return t.finish()}}),{domEventHandlers:a}=t;return[i,_k({class:`cm-foldGutter`,markers(e){return e.plugin(i)?.markers||dS.empty},initialSpacer(){return new iM(t,!1)},domEventHandlers:Object.assign(Object.assign({},a),{click:(e,t,n)=>{if(a.click&&a.click(e,t,n))return!0;let r=Hj(e.state,t.from,t.to);if(r)return e.dispatch({effects:zj.of(r)}),!0;let i=Ij(e.state,t.from,t.to);return i?(e.dispatch({effects:Rj.of(i)}),!0):!1}})}),$j()]}var oM=DD.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`}}),sM=class e{constructor(e,t){this.specs=e;let n;function r(e){let t=AS.newName();return(n||=Object.create(null))[`.`+t]=e,t}let i=typeof t.all==`string`?t.all:t.all?r(t.all):void 0,a=t.scope;this.scope=a instanceof ZA?e=>e.prop(JA)==a.data:a?e=>e==a:void 0,this.style=DA(e.map(e=>({tag:e.tag,class:e.class||r(Object.assign({},e,{tag:null}))})),{all:i}).style,this.module=n?new AS(n):null,this.themeType=t.themeType}static define(t,n){return new e(t,n||{})}},cM=gx.define(),lM=gx.define({combine(e){return e.length?[e[0]]:null}});function uM(e){let t=e.facet(cM);return t.length?t:e.facet(lM)}function dM(e,t){let n=[pM],r;return e instanceof sM&&(e.module&&n.push(DD.styleModule.of(e.module)),r=e.themeType),t?.fallback?n.push(lM.of(e)):r?n.push(cM.computeN([DD.darkTheme],t=>t.facet(DD.darkTheme)==(r==`dark`)?[e]:[])):n.push(cM.of(e)),n}var fM=class{constructor(e){this.markCache=Object.create(null),this.tree=ej(e.state),this.decorations=this.buildDeco(e,uM(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=ej(e.state),n=uM(e.state),r=n!=uM(e.startState),{viewport:i}=e.view,a=e.changes.mapPos(this.decoratedTo,1);t.length<i.to&&!r&&t.type==this.tree.type&&a>=i.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=a):(t!=this.tree||e.viewportChanged||r)&&(this.tree=t,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=i.to)}buildDeco(e,t){if(!t||!this.tree.length)return JC.none;let n=new pS;for(let{from:r,to:i}of e.visibleRanges)kA(this.tree,t,(e,t,r)=>{n.add(e,t,this.markCache[r]||(this.markCache[r]=JC.mark({class:r})))},r,i);return n.finish()}},pM=Ex.high(Yw.fromClass(fM,{decorations:e=>e.decorations})),mM=sM.define([{tag:qA.meta,color:`#404740`},{tag:qA.link,textDecoration:`underline`},{tag:qA.heading,textDecoration:`underline`,fontWeight:`bold`},{tag:qA.emphasis,fontStyle:`italic`},{tag:qA.strong,fontWeight:`bold`},{tag:qA.strikethrough,textDecoration:`line-through`},{tag:qA.keyword,color:`#708`},{tag:[qA.atom,qA.bool,qA.url,qA.contentSeparator,qA.labelName],color:`#219`},{tag:[qA.literal,qA.inserted],color:`#164`},{tag:[qA.string,qA.deleted],color:`#a11`},{tag:[qA.regexp,qA.escape,qA.special(qA.string)],color:`#e40`},{tag:qA.definition(qA.variableName),color:`#00f`},{tag:qA.local(qA.variableName),color:`#30a`},{tag:[qA.typeName,qA.namespace],color:`#085`},{tag:qA.className,color:`#167`},{tag:[qA.special(qA.variableName),qA.macroName],color:`#256`},{tag:qA.definition(qA.propertyName),color:`#00c`},{tag:qA.comment,color:`#940`},{tag:qA.invalid,color:`#f00`}]),hM=DD.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:`#328c8252`},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:`#bb555544`}}),gM=1e4,_M=`()[]{}`,vM=gx.define({combine(e){return oS(e,{afterCursor:!0,brackets:_M,maxScanDistance:gM,renderMatch:xM})}}),yM=JC.mark({class:`cm-matchingBracket`}),bM=JC.mark({class:`cm-nonmatchingBracket`});function xM(e){let t=[],n=e.matched?yM:bM;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}var SM=[Cx.define({create(){return JC.none},update(e,t){if(!t.docChanged&&!t.selection)return e;let n=[],r=t.state.facet(vM);for(let e of t.state.selection.ranges){if(!e.empty)continue;let i=DM(t.state,e.head,-1,r)||e.head>0&&DM(t.state,e.head-1,1,r)||r.afterCursor&&(DM(t.state,e.head,1,r)||e.head<t.state.doc.length&&DM(t.state,e.head+1,-1,r));i&&(n=n.concat(r.renderMatch(i,t.state)))}return JC.set(n,!0)},provide:e=>DD.decorations.from(e)}),hM];function CM(e={}){return[vM.of(e),SM]}var wM=new Vk;function TM(e,t,n){let r=e.prop(t<0?Vk.openedBy:Vk.closedBy);if(r)return r;if(e.name.length==1){let r=n.indexOf(e.name);if(r>-1&&r%2==+(t<0))return[n[r+t]]}return null}function EM(e){let t=e.type.prop(wM);return t?t(e.node):e}function DM(e,t,n,r={}){let i=r.maxScanDistance||gM,a=r.brackets||_M,o=ej(e),s=o.resolveInner(t,n);for(let r=s;r;r=r.parent){let i=TM(r.type,n,a);if(i&&r.from<r.to){let o=EM(r);if(o&&(n>0?t>=o.from&&t<o.to:t>o.from&&t<=o.to))return OM(e,t,n,r,o,i,a)}}return kM(e,t,n,o,s.type,i,a)}function OM(e,t,n,r,i,a,o){let s=r.parent,c={from:i.from,to:i.to},l=0,u=s?.cursor();if(u&&(n<0?u.childBefore(r.from):u.childAfter(r.to)))do if(n<0?u.to<=r.from:u.from>=r.to){if(l==0&&a.indexOf(u.type.name)>-1&&u.from<u.to){let e=EM(u);return{start:c,end:e?{from:e.from,to:e.to}:void 0,matched:!0}}else if(TM(u.type,n,o))l++;else if(TM(u.type,-n,o)){if(l==0){let e=EM(u);return{start:c,end:e&&e.from<e.to?{from:e.from,to:e.to}:void 0,matched:!1}}l--}}while(n<0?u.prevSibling():u.nextSibling());return{start:c,matched:!1}}function kM(e,t,n,r,i,a,o){let s=n<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),c=o.indexOf(s);if(c<0||c%2==0!=n>0)return null;let l={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 e=0;!u.next().done&&e<=a;){let a=u.value;n<0&&(e+=a.length);let s=t+e*n;for(let e=n>0?0:a.length-1,t=n>0?a.length:-1;e!=t;e+=n){let t=o.indexOf(a[e]);if(!(t<0||r.resolveInner(s+e,1).type!=i))if(t%2==0==n>0)d++;else if(d==1)return{start:l,end:{from:s+e,to:s+e+1},matched:t>>1==c>>1};else d--}n>0&&(e+=a.length)}return u.done?{start:l,matched:!1}:null}var AM=Object.create(null),jM=[Wk.none],MM=[],NM=Object.create(null),PM=Object.create(null);for(let[e,t]of[[`variable`,`variableName`],[`variable-2`,`variableName.special`],[`string-2`,`string.special`],[`def`,`variableName.definition`],[`tag`,`tagName`],[`attribute`,`attributeName`],[`type`,`typeName`],[`builtin`,`variableName.standard`],[`qualifier`,`modifier`],[`error`,`invalid`],[`header`,`heading`],[`property`,`propertyName`]])PM[e]=IM(AM,t);function FM(e,t){MM.indexOf(e)>-1||(MM.push(e),console.warn(t))}function IM(e,t){let n=[];for(let r of t.split(` `)){let t=[];for(let n of r.split(`.`)){let r=e[n]||qA[n];r?typeof r==`function`?t.length?t=t.map(r):FM(n,`Modifier ${n} used at start of tag`):t.length?FM(n,`Tag ${n} used as modifier`):t=Array.isArray(r)?r:[r]:FM(n,`Unknown highlighting tag ${n}`)}for(let e of t)n.push(e)}if(!n.length)return 0;let r=t.replace(/ /g,`_`),i=r+` `+n.map(e=>e.id),a=NM[i];if(a)return a.id;let o=NM[i]=Wk.define({id:jM.length,name:r,props:[wA({[r]:n})]});return jM.push(o),o.id}sw.RTL,sw.LTR;var LM=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=HM(e.state,n.from);return r.line?zM(e):r.block?VM(e):!1};function RM(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=e(t,n);return i?(r(n.update(i)),!0):!1}}var zM=RM(qM,0),BM=RM(KM,0),VM=RM((e,t)=>KM(e,t,GM(t)),0);function HM(e,t){let n=e.languageDataAt(`commentTokens`,t);return n.length?n[0]:{}}var UM=50;function WM(e,{open:t,close:n},r,i){let a=e.sliceDoc(r-UM,r),o=e.sliceDoc(i,i+UM),s=/\s*$/.exec(a)[0].length,c=/^\s*/.exec(o)[0].length,l=a.length-s;if(a.slice(l-t.length,l)==t&&o.slice(c,c+n.length)==n)return{open:{pos:r-s,margin:s&&1},close:{pos:i+c,margin:c&&1}};let u,d;i-r<=2*UM?u=d=e.sliceDoc(r,i):(u=e.sliceDoc(r,r+UM),d=e.sliceDoc(i-UM,i));let f=/^\s*/.exec(u)[0].length,p=/\s*$/.exec(d)[0].length,m=d.length-p-n.length;return u.slice(f,f+t.length)==t&&d.slice(m,m+n.length)==n?{open:{pos:r+f+t.length,margin:+!!/\s/.test(u.charAt(f+t.length))},close:{pos:i-p-n.length,margin:+!!/\s/.test(d.charAt(m-1))}}:null}function GM(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),i=n.to<=r.to?r:e.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let a=t.length-1;a>=0&&t[a].to>r.from?t[a].to=i.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return t}function KM(e,t,n=t.selection.ranges){let r=n.map(e=>HM(t,e.from).block);if(!r.every(e=>e))return null;let i=n.map((e,n)=>WM(t,r[n],e.from,e.to));if(e!=2&&!i.every(e=>e))return{changes:t.changes(n.map((e,t)=>i[t]?[]:[{from:e.from,insert:r[t].open+` `},{from:e.to,insert:` `+r[t].close}]))};if(e!=1&&i.some(e=>e)){let e=[];for(let t=0,n;t<i.length;t++)if(n=i[t]){let i=r[t],{open:a,close:o}=n;e.push({from:a.pos-i.open.length,to:a.pos+a.margin},{from:o.pos-o.margin,to:o.pos+i.close.length})}return{changes:e}}return null}function qM(e,t,n=t.selection.ranges){let r=[],i=-1;for(let{from:e,to:a}of n){let n=r.length,o=1e9,s=HM(t,e).line;if(s){for(let n=e;n<=a;){let c=t.doc.lineAt(n);if(c.from>i&&(e==a||a>c.from)){i=c.from;let e=/^\s*/.exec(c.text)[0].length,t=e==c.length,n=c.text.slice(e,e+s.length)==s?e:-1;e<c.text.length&&e<o&&(o=e),r.push({line:c,comment:n,token:s,indent:e,empty:t,single:!1})}n=c.to+1}if(o<1e9)for(let e=n;e<r.length;e++)r[e].indent<r[e].line.text.length&&(r[e].indent=o);r.length==n+1&&(r[n].single=!0)}}if(e!=2&&r.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:i,empty:a,single:o}of r)(o||!a)&&e.push({from:t.from+i,insert:n+` `});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}else if(e!=1&&r.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:i}of r)if(n>=0){let r=t.from+n,a=r+i.length;t.text[a-t.from]==` `&&a++,e.push({from:r,to:a})}return{changes:e}}return null}var JM=Vx.define(),YM=gx.define(),XM=class e{constructor(e,t,n,r,i){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=i}setSelAfter(t){return new e(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){return{changes:this.changes?.toJSON(),mapped:this.mapped?.toJSON(),startSelection:this.startSelection?.toJSON(),selectionsAfter:this.selectionsAfter.map(e=>e.toJSON())}}static fromJSON(t){return new e(t.changes&&ox.fromJSON(t.changes),[],t.mapped&&ax.fromJSON(t.mapped),t.startSelection&&L.fromJSON(t.startSelection),t.selectionsAfter.map(L.fromJSON))}static fromTransaction(t,n){let r=tN;for(let e of t.startState.facet(YM)){let n=e(t);n.length&&(r=r.concat(n))}return!r.length&&t.changes.empty?null:new e(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,tN)}static selection(t){return new e(void 0,tN,void 0,void 0,t)}};function ZM(e,t,n,r){let i=t+1>n+20?t-n-1:0,a=e.slice(i,t);return a.push(r),a}function QM(e,t){let n=[],r=!1;return e.iterChangedRanges((e,t)=>n.push(e,t)),t.iterChangedRanges((e,t,i,a)=>{for(let e=0;e<n.length;){let t=n[e++],o=n[e++];a>=t&&i<=o&&(r=!0)}}),r}function $M(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((e,n)=>e.empty!=t.ranges[n].empty).length===0}function eN(e,t){return e.length?t.length?e.concat(t):e:t}var tN=[],nN=200;function rN(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-nN));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),ZM(e,e.length-1,1e9,n.setSelAfter(r)))}else return[XM.selection([t])]}function iN(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 aN(e,t){if(!e.length)return e;let n=e.length,r=tN;for(;n;){let i=oN(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){let t=e.slice(0,n);return t[n-1]=i,t}else t=i.mapped,n--,r=i.selectionsAfter}return r.length?[XM.selection(r)]:tN}function oN(e,t,n){let r=eN(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):tN,n);if(!e.changes)return XM.selection(r);let i=e.changes.map(t),a=t.mapDesc(e.changes,!0),o=e.mapped?e.mapped.composeDesc(a):a;return new XM(i,Wx.mapEffects(e.effects,t),o,e.startSelection.map(a),r)}var sN=/^(input\.type|delete)($|\.)/,cN=class e{constructor(e,t,n=0,r=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new e(this.done,this.undone):this}addChanges(t,n,r,i,a){let o=this.done,s=o[o.length-1];return o=s&&s.changes&&!s.changes.empty&&t.changes&&(!r||sN.test(r))&&(!s.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(a,QM(s.changes,t.changes))||r==`input.type.compose`)?ZM(o,o.length-1,i.minDepth,new XM(t.changes.compose(s.changes),eN(Wx.mapEffects(t.effects,s.changes),s.effects),s.mapped,s.startSelection,tN)):ZM(o,o.length,i.minDepth,t),new e(o,tN,n,r)}addSelection(t,n,r,i){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:tN;return a.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&$M(a[a.length-1],t)?this:new e(rN(this.done,t),this.undone,n,r)}addMapping(t){return new e(aN(this.done,t),aN(this.undone,t),this.prevTime,this.prevUserEvent)}pop(e,t,n){let r=e==0?this.done:this.undone;if(r.length==0)return null;let i=r[r.length-1],a=i.selectionsAfter[0]||t.selection;if(n&&i.selectionsAfter.length)return t.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:JM.of({side:e,rest:iN(r),selection:a}),userEvent:e==0?`select.undo`:`select.redo`,scrollIntoView:!0});if(i.changes){let n=r.length==1?tN:r.slice(0,r.length-1);return i.mapped&&(n=aN(n,i.mapped)),t.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:JM.of({side:e,rest:n,selection:a}),filter:!1,userEvent:e==0?`undo`:`redo`,scrollIntoView:!0})}else return null}};cN.empty=new cN(tN,tN);function lN(e,t){return L.create(e.ranges.map(t),e.mainIndex)}function uN(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:`select`})}function dN({state:e,dispatch:t},n){let r=lN(e.selection,n);return r.eq(e.selection,!0)?!1:(t(uN(e,r)),!0)}function fN(e,t){return L.cursor(t?e.to:e.from)}function pN(e,t){return dN(e,n=>n.empty?e.moveByChar(n,t):fN(n,t))}function mN(e){return e.textDirectionAt(e.state.selection.main.head)==sw.LTR}var hN=e=>pN(e,!mN(e)),gN=e=>pN(e,mN(e));function _N(e,t){return dN(e,n=>n.empty?e.moveByGroup(n,t):fN(n,t))}var vN=e=>_N(e,!mN(e)),yN=e=>_N(e,mN(e));typeof Intl<`u`&&Intl.Segmenter;function bN(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function xN(e,t,n){let r=ej(e).resolveInner(t.head),i=n?Vk.closedBy:Vk.openedBy;for(let a=t.head;;){let t=n?r.childAfter(a):r.childBefore(a);if(!t)break;bN(e,t,i)?r=t:a=n?t.to:t.from}let a=r.type.prop(i),o,s;return s=a&&(o=n?DM(e,r.from,1):DM(e,r.to,-1))&&o.matched?n?o.end.to:o.end.from:n?r.to:r.from,L.cursor(s,n?-1:1)}var SN=e=>dN(e,t=>xN(e.state,t,!mN(e))),CN=e=>dN(e,t=>xN(e.state,t,mN(e)));function wN(e,t){return dN(e,n=>{if(!n.empty)return fN(n,t);let r=e.moveVertically(n,t);return r.head==n.head?e.moveToLineBoundary(n,t):r})}var TN=e=>wN(e,!1),EN=e=>wN(e,!0);function DN(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,i;if(t){for(let t of e.state.facet(DD.scrollMargins)){let i=t(e);i?.top&&(n=Math.max(i?.top,n)),i?.bottom&&(r=Math.max(i?.bottom,r))}i=e.scrollDOM.clientHeight-n-r}else i=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,i-5)}}function ON(e,t){let n=DN(e),{state:r}=e,i=lN(r.selection,r=>r.empty?e.moveVertically(r,t,n.height):fN(r,t));if(i.eq(r.selection))return!1;let a;if(n.selfScroll){let t=e.coordsAtPos(r.selection.main.head),o=e.scrollDOM.getBoundingClientRect(),s=o.top+n.marginTop,c=o.bottom-n.marginBottom;t&&t.top>s&&t.bottom<c&&(a=DD.scrollIntoView(i.main.head,{y:`start`,yMargin:t.top-s}))}return e.dispatch(uN(r,i),{effects:a}),!0}var kN=e=>ON(e,!1),AN=e=>ON(e,!0);function jN(e,t,n){let r=e.lineBlockAt(t.head),i=e.moveToLineBoundary(t,n);if(i.head==t.head&&i.head!=(n?r.to:r.from)&&(i=e.moveToLineBoundary(t,n,!1)),!n&&i.head==r.from&&r.length){let n=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;n&&t.head!=r.from+n&&(i=L.cursor(r.from+n))}return i}var MN=e=>dN(e,t=>jN(e,t,!0)),NN=e=>dN(e,t=>jN(e,t,!1)),PN=e=>dN(e,t=>jN(e,t,!mN(e))),FN=e=>dN(e,t=>jN(e,t,mN(e))),IN=e=>dN(e,t=>L.cursor(e.lineBlockAt(t.head).from,1)),LN=e=>dN(e,t=>L.cursor(e.lineBlockAt(t.head).to,-1));function RN(e,t,n){let r=!1,i=lN(e.selection,t=>{let i=DM(e,t.head,-1)||DM(e,t.head,1)||t.head>0&&DM(e,t.head-1,1)||t.head<e.doc.length&&DM(e,t.head+1,-1);if(!i||!i.end)return t;r=!0;let a=i.start.from==t.head?i.end.to:i.end.from;return n?L.range(t.anchor,a):L.cursor(a)});return r?(t(uN(e,i)),!0):!1}var zN=({state:e,dispatch:t})=>RN(e,t,!1);function BN(e,t){let n=lN(e.state.selection,e=>{let n=t(e);return L.range(e.anchor,n.head,n.goalColumn,n.bidiLevel||void 0)});return n.eq(e.state.selection)?!1:(e.dispatch(uN(e.state,n)),!0)}function VN(e,t){return BN(e,n=>e.moveByChar(n,t))}var HN=e=>VN(e,!mN(e)),UN=e=>VN(e,mN(e));function WN(e,t){return BN(e,n=>e.moveByGroup(n,t))}var GN=e=>WN(e,!mN(e)),KN=e=>WN(e,mN(e)),qN=e=>BN(e,t=>xN(e.state,t,!mN(e))),JN=e=>BN(e,t=>xN(e.state,t,mN(e)));function YN(e,t){return BN(e,n=>e.moveVertically(n,t))}var XN=e=>YN(e,!1),ZN=e=>YN(e,!0);function QN(e,t){return BN(e,n=>e.moveVertically(n,t,DN(e).height))}var $N=e=>QN(e,!1),eP=e=>QN(e,!0),tP=e=>BN(e,t=>jN(e,t,!0)),nP=e=>BN(e,t=>jN(e,t,!1)),rP=e=>BN(e,t=>jN(e,t,!mN(e))),iP=e=>BN(e,t=>jN(e,t,mN(e))),aP=e=>BN(e,t=>L.cursor(e.lineBlockAt(t.head).from)),oP=e=>BN(e,t=>L.cursor(e.lineBlockAt(t.head).to)),sP=({state:e,dispatch:t})=>(t(uN(e,{anchor:0})),!0),cP=({state:e,dispatch:t})=>(t(uN(e,{anchor:e.doc.length})),!0),lP=({state:e,dispatch:t})=>(t(uN(e,{anchor:e.selection.main.anchor,head:0})),!0),uP=({state:e,dispatch:t})=>(t(uN(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),dP=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:`select`})),!0),fP=({state:e,dispatch:t})=>{let n=OP(e).map(({from:t,to:n})=>L.range(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:L.create(n),userEvent:`select`})),!0},pP=({state:e,dispatch:t})=>{let n=lN(e.selection,t=>{let n=ej(e),r=n.resolveStack(t.from,1);if(t.empty){let e=n.resolveStack(t.from,-1);e.node.from>=r.node.from&&e.node.to<=r.node.to&&(r=e)}for(let e=r;e;e=e.next){let{node:n}=e;if((n.from<t.from&&n.to>=t.to||n.to>t.to&&n.from<=t.from)&&e.next)return L.range(n.to,n.from)}return t});return n.eq(e.selection)?!1:(t(uN(e,n)),!0)},mP=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=L.create([n.main]):n.main.empty||(r=L.create([L.cursor(n.main.head)])),r?(t(uN(e,r)),!0):!1};function hP(e,t){if(e.state.readOnly)return!1;let n=`delete.selection`,{state:r}=e,i=r.changeByRange(r=>{let{from:i,to:a}=r;if(i==a){let o=t(r);o<i?(n=`delete.backward`,o=gP(e,o,!1)):o>i&&(n=`delete.forward`,o=gP(e,o,!0)),i=Math.min(i,o),a=Math.max(a,o)}else i=gP(e,i,!1),a=gP(e,a,!0);return i==a?{range:r}:{changes:{from:i,to:a},range:L.cursor(i,i<r.head?-1:1)}});return i.changes.empty?!1:(e.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n==`delete.selection`?DD.announce.of(r.phrase(`Selection deleted`)):void 0})),!0)}function gP(e,t,n){if(e instanceof DD)for(let r of e.state.facet(DD.atomicRanges).map(t=>t(e)))r.between(t,t,(e,r)=>{e<t&&r>t&&(t=n?r:e)});return t}var _P=(e,t,n)=>hP(e,r=>{let i=r.from,{state:a}=e,o=a.doc.lineAt(i),s,c;if(n&&!t&&i>o.from&&i<o.from+200&&!/[^ \t]/.test(s=o.text.slice(0,i-o.from))){if(s[s.length-1]==` `)return i-1;let e=wS(s,a.tabSize)%mj(a)||mj(a);for(let t=0;t<e&&s[s.length-1-t]==` `;t++)i--;c=i}else c=Zb(o.text,i-o.from,t,t)+o.from,c==i&&o.number!=(t?a.doc.lines:1)?c+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(o.text.slice(c-o.from,i-o.from))&&(c=Zb(o.text,c-o.from,!1,!1)+o.from);return c}),vP=e=>_P(e,!1,!0),yP=e=>_P(e,!0,!1),bP=(e,t)=>hP(e,n=>{let r=n.head,{state:i}=e,a=i.doc.lineAt(r),o=i.charCategorizer(r);for(let e=null;;){if(r==(t?a.to:a.from)){r==n.head&&a.number!=(t?i.doc.lines:1)&&(r+=t?1:-1);break}let s=Zb(a.text,r-a.from,t)+a.from,c=a.text.slice(Math.min(r,s)-a.from,Math.max(r,s)-a.from),l=o(c);if(e!=null&&l!=e)break;(c!=` `||r!=n.head)&&(e=l),r=s}return r}),xP=e=>bP(e,!1),SP=e=>bP(e,!0),CP=e=>hP(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),wP=e=>hP(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),TP=e=>hP(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),EP=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:Bb.of([``,``])},range:L.cursor(e.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:`input`})),!0},DP=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(t=>{if(!t.empty||t.from==0||t.from==e.doc.length)return{range:t};let n=t.from,r=e.doc.lineAt(n),i=n==r.from?n-1:Zb(r.text,n-r.from,!1)+r.from,a=n==r.to?n+1:Zb(r.text,n-r.from,!0)+r.from;return{changes:{from:i,to:a,insert:e.doc.slice(n,a).append(e.doc.slice(i,n))},range:L.cursor(a)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:`move.character`})),!0)};function OP(e){let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.from),a=e.doc.lineAt(r.to);if(!r.empty&&r.to==a.from&&(a=e.doc.lineAt(r.to-1)),n>=i.number){let e=t[t.length-1];e.to=a.to,e.ranges.push(r)}else t.push({from:i.from,to:a.to,ranges:[r]});n=a.number+1}return t}function kP(e,t,n){if(e.readOnly)return!1;let r=[],i=[];for(let t of OP(e)){if(n?t.to==e.doc.length:t.from==0)continue;let a=e.doc.lineAt(n?t.to+1:t.from-1),o=a.length+1;if(n){r.push({from:t.to,to:a.to},{from:t.from,insert:a.text+e.lineBreak});for(let n of t.ranges)i.push(L.range(Math.min(e.doc.length,n.anchor+o),Math.min(e.doc.length,n.head+o)))}else{r.push({from:a.from,to:t.from},{from:t.to,insert:e.lineBreak+a.text});for(let e of t.ranges)i.push(L.range(e.anchor-o,e.head-o))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:L.create(i,e.selection.mainIndex),userEvent:`move.line`})),!0):!1}var AP=({state:e,dispatch:t})=>kP(e,t,!1),jP=({state:e,dispatch:t})=>kP(e,t,!0);function MP(e,t,n){if(e.readOnly)return!1;let r=[];for(let t of OP(e))n?r.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):r.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});return t(e.update({changes:r,scrollIntoView:!0,userEvent:`input.copyline`})),!0}var NP=({state:e,dispatch:t})=>MP(e,t,!1),PP=({state:e,dispatch:t})=>MP(e,t,!0),FP=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(OP(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),r=lN(t.selection,t=>{let n;if(e.lineWrapping){let r=e.lineBlockAt(t.head),i=e.coordsAtPos(t.head,t.assoc||1);i&&(n=r.bottom+e.documentTop-i.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:`delete.line`}),!0};function IP(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=ej(e).resolveInner(t),r=n.childBefore(t),i=n.childAfter(t),a;return r&&i&&r.to<=t&&i.from>=t&&(a=r.type.prop(Vk.closedBy))&&a.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}var LP=zP(!1),RP=zP(!0);function zP(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(n=>{let{from:r,to:i}=n,a=t.doc.lineAt(r),o=!e&&r==i&&IP(t,r);e&&(r=i=(i<=a.to?a:t.doc.lineAt(i)).to);let s=new _j(t,{simulateBreak:r,simulateDoubleBreak:!!o}),c=gj(s,r);for(c??=wS(/^\s*/.exec(t.doc.lineAt(r).text)[0],t.tabSize);i<a.to&&/\s/.test(a.text[i-a.from]);)i++;o?{from:r,to:i}=o:r>a.from&&r<a.from+100&&!/\S/.test(a.text.slice(0,r))&&(r=a.from);let l=[``,hj(t,c)];return o&&l.push(hj(t,s.lineIndent(a.from,-1))),{changes:{from:r,to:i,insert:Bb.of(l)},range:L.cursor(r+1+l[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:`input`})),!0}}function BP(e,t){let n=-1;return e.changeByRange(r=>{let i=[];for(let a=r.from;a<=r.to;){let o=e.doc.lineAt(a);o.number>n&&(r.empty||r.to>o.from)&&(t(o,i,r),n=o.number),a=o.to+1}let a=e.changes(i);return{changes:i,range:L.range(a.mapPos(r.anchor,1),a.mapPos(r.head,1))}})}var VP=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new _j(e,{overrideIndentation:e=>n[e]??-1}),i=BP(e,(t,i,a)=>{let o=gj(r,t.from);if(o==null)return;/\S/.test(t.text)||(o=0);let s=/^\s*/.exec(t.text)[0],c=hj(e,o);(s!=c||a.from<t.from+s.length)&&(n[t.from]=o,i.push({from:t.from,to:t.from+s.length,insert:c}))});return i.changes.empty||t(e.update(i,{userEvent:`indent`})),!0},HP=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(BP(e,(t,n)=>{n.push({from:t.from,insert:e.facet(pj)})}),{userEvent:`input.indent`})),!0),UP=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(BP(e,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let i=wS(r,e.tabSize),a=0,o=hj(e,Math.max(0,i-mj(e)));for(;a<r.length&&a<o.length&&r.charCodeAt(a)==o.charCodeAt(a);)a++;n.push({from:t.from+a,to:t.from+r.length,insert:o.slice(a)})}),{userEvent:`delete.dedent`})),!0),WP=e=>(e.setTabFocusMode(),!0),GP=[{key:`Ctrl-b`,run:hN,shift:HN,preventDefault:!0},{key:`Ctrl-f`,run:gN,shift:UN},{key:`Ctrl-p`,run:TN,shift:XN},{key:`Ctrl-n`,run:EN,shift:ZN},{key:`Ctrl-a`,run:IN,shift:aP},{key:`Ctrl-e`,run:LN,shift:oP},{key:`Ctrl-d`,run:yP},{key:`Ctrl-h`,run:vP},{key:`Ctrl-k`,run:CP},{key:`Ctrl-Alt-h`,run:xP},{key:`Ctrl-o`,run:EP},{key:`Ctrl-t`,run:DP},{key:`Ctrl-v`,run:AN}],KP=[{key:`ArrowLeft`,run:hN,shift:HN,preventDefault:!0},{key:`Mod-ArrowLeft`,mac:`Alt-ArrowLeft`,run:vN,shift:GN,preventDefault:!0},{mac:`Cmd-ArrowLeft`,run:PN,shift:rP,preventDefault:!0},{key:`ArrowRight`,run:gN,shift:UN,preventDefault:!0},{key:`Mod-ArrowRight`,mac:`Alt-ArrowRight`,run:yN,shift:KN,preventDefault:!0},{mac:`Cmd-ArrowRight`,run:FN,shift:iP,preventDefault:!0},{key:`ArrowUp`,run:TN,shift:XN,preventDefault:!0},{mac:`Cmd-ArrowUp`,run:sP,shift:lP},{mac:`Ctrl-ArrowUp`,run:kN,shift:$N},{key:`ArrowDown`,run:EN,shift:ZN,preventDefault:!0},{mac:`Cmd-ArrowDown`,run:cP,shift:uP},{mac:`Ctrl-ArrowDown`,run:AN,shift:eP},{key:`PageUp`,run:kN,shift:$N},{key:`PageDown`,run:AN,shift:eP},{key:`Home`,run:NN,shift:nP,preventDefault:!0},{key:`Mod-Home`,run:sP,shift:lP},{key:`End`,run:MN,shift:tP,preventDefault:!0},{key:`Mod-End`,run:cP,shift:uP},{key:`Enter`,run:LP,shift:LP},{key:`Mod-a`,run:dP},{key:`Backspace`,run:vP,shift:vP},{key:`Delete`,run:yP},{key:`Mod-Backspace`,mac:`Alt-Backspace`,run:xP},{key:`Mod-Delete`,mac:`Alt-Delete`,run:SP},{mac:`Mod-Backspace`,run:wP},{mac:`Mod-Delete`,run:TP}].concat(GP.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),qP=[{key:`Alt-ArrowLeft`,mac:`Ctrl-ArrowLeft`,run:SN,shift:qN},{key:`Alt-ArrowRight`,mac:`Ctrl-ArrowRight`,run:CN,shift:JN},{key:`Alt-ArrowUp`,run:AP},{key:`Shift-Alt-ArrowUp`,run:NP},{key:`Alt-ArrowDown`,run:jP},{key:`Shift-Alt-ArrowDown`,run:PP},{key:`Escape`,run:mP},{key:`Mod-Enter`,run:RP},{key:`Alt-l`,mac:`Ctrl-l`,run:fP},{key:`Mod-i`,run:pP,preventDefault:!0},{key:`Mod-[`,run:UP},{key:`Mod-]`,run:HP},{key:`Mod-Alt-\\`,run:VP},{key:`Shift-Mod-k`,run:FP},{key:`Shift-Mod-\\`,run:zN},{key:`Mod-/`,run:LM},{key:`Alt-A`,run:BM},{key:`Ctrl-m`,mac:`Shift-Alt-m`,run:WP}].concat(KP),JP={key:`Tab`,run:HP,shift:UP};function YP(){var e=arguments[0];typeof e==`string`&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&typeof n==`object`&&n.nodeType==null&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var i=n[r];typeof i==`string`?e.setAttribute(r,i):i!=null&&(e[r]=i)}t++}for(;t<arguments.length;t++)XP(e,arguments[t]);return e}function XP(e,t){if(typeof t==`string`)e.appendChild(document.createTextNode(t));else if(t!=null)if(t.nodeType!=null)e.appendChild(t);else if(Array.isArray(t))for(var n=0;n<t.length;n++)XP(e,t[n]);else throw RangeError(`Unsupported child node: `+t)}var ZP=class{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}},QP=class e{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(t,n,r){let i=t,a=r.facet(hF).markerFilter;a&&(i=a(i,r));let o=t.slice().sort((e,t)=>e.from-t.from||e.to-t.to),s=new pS,c=[],l=0;for(let e=0;;){let t=e==o.length?null:o[e];if(!t&&!c.length)break;let n,i;for(c.length?(n=l,i=c.reduce((e,t)=>Math.min(e,t.to),t&&t.from>n?t.from:1e8)):(n=t.from,i=t.to,c.push(t),e++);e<o.length;){let t=o[e];if(t.from==n&&(t.to>t.from||t.to==n))c.push(t),e++,i=Math.min(t.to,i);else{i=Math.min(t.from,i);break}}let a=EF(c);if(c.some(e=>e.from==e.to||e.from==e.to-1&&r.doc.lineAt(e.from).to==e.from))s.add(n,n,JC.widget({widget:new yF(a),diagnostics:c.slice()}));else{let e=c.reduce((e,t)=>t.markClass?e+` `+t.markClass:e,``);s.add(n,i,JC.mark({class:`cm-lintRange cm-lintRange-`+a+e,diagnostics:c.slice(),inclusiveEnd:c.some(e=>e.to>i)}))}l=i;for(let e=0;e<c.length;e++)c[e].to<=l&&c.splice(e--,1)}let u=s.finish();return new e(u,n,$P(u))}};function $P(e,t=null,n=0){let r=null;return e.between(n,1e9,(e,n,{spec:i})=>{if(!(t&&i.diagnostics.indexOf(t)<0))if(!r)r=new ZP(e,n,t||i.diagnostics[0]);else if(i.diagnostics.indexOf(r.diagnostic)<0)return!1;else r=new ZP(r.from,n,r.diagnostic)}),r}function eF(e,t){let n=t.pos,r=t.end||n,i=e.state.facet(hF).hideOn(e,n,r);if(i!=null)return i;let a=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(e=>e.is(rF))||e.changes.touchesRange(a.from,Math.max(a.to,r)))}function tF(e,t){return e.field(oF,!1)?t:t.concat(Wx.appendConfig.of(IF))}function nF(e,t){return{effects:tF(e,[rF.of(t)])}}var rF=Wx.define(),iF=Wx.define(),aF=Wx.define(),oF=Cx.define({create(){return new QP(JC.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,i=e.panel;if(e.selected){let i=t.changes.mapPos(e.selected.from,1);r=$P(n,e.selected.diagnostic,i)||$P(n,null,i)}!n.size&&i&&t.state.facet(hF).autoPanel&&(i=null),e=new QP(n,i,r)}for(let n of t.effects)if(n.is(rF)){let r=t.state.facet(hF).autoPanel?n.value.length?xF.open:null:e.panel;e=QP.init(n.value,r,t.state)}else n.is(iF)?e=new QP(e.diagnostics,n.value?xF.open:null,e.selected):n.is(aF)&&(e=new QP(e.diagnostics,e.panel,n.value));return e},provide:e=>[dk.from(e,e=>e.panel),DD.decorations.from(e,e=>e.diagnostics)]}),sF=JC.mark({class:`cm-lintRange cm-lintRange-active`});function cF(e,t,n){let{diagnostics:r}=e.state.field(oF),i,a=-1,o=-1;r.between(t-+(n<0),t+ +(n>0),(e,r,{spec:s})=>{if(t>=e&&t<=r&&(e==r||(t>e||n>0)&&(t<r||n<0)))return i=s.diagnostics,a=e,o=r,!1});let s=e.state.facet(hF).tooltipFilter;return i&&s&&(i=s(i,e.state)),i?{pos:a,end:o,above:e.state.doc.lineAt(a).to<o,create(){return{dom:lF(e,i)}}}:null}function lF(e,t){return YP(`ul`,{class:`cm-tooltip-lint`},t.map(t=>vF(e,t,!1)))}var uF=e=>{let t=e.state.field(oF,!1);(!t||!t.panel)&&e.dispatch({effects:tF(e.state,[iF.of(!0)])});let n=sk(e,xF.open);return n&&n.dom.querySelector(`.cm-panel-lint ul`).focus(),!0},dF=e=>{let t=e.state.field(oF,!1);return!t||!t.panel?!1:(e.dispatch({effects:iF.of(!1)}),!0)},fF=[{key:`Mod-Shift-m`,run:uF,preventDefault:!0},{key:`F8`,run:e=>{let t=e.state.field(oF,!1);if(!t)return!1;let n=e.state.selection.main,r=t.diagnostics.iter(n.to+1);return!r.value&&(r=t.diagnostics.iter(0),!r.value||r.from==n.from&&r.to==n.to)?!1:(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)}}],pF=Yw.fromClass(class{constructor(e){this.view=e,this.timeout=-1,this.set=!0;let{delay:t}=e.state.facet(hF);this.lintTime=Date.now()+t,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,t)}run(){clearTimeout(this.timeout);let e=Date.now();if(e<this.lintTime-10)this.timeout=setTimeout(this.run,this.lintTime-e);else{this.set=!1;let{state:e}=this.view,{sources:t}=e.facet(hF);t.length&&mF(t.map(e=>Promise.resolve(e(this.view))),t=>{this.view.state.doc==e.doc&&this.view.dispatch(nF(this.view.state,t.reduce((e,t)=>e.concat(t))))},e=>{Gw(this.view.state,e)})}}update(e){let t=e.state.facet(hF);(e.docChanged||t!=e.startState.facet(hF)||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)}});function mF(e,t,n){let r=[],i=-1;for(let a of e)a.then(n=>{r.push(n),clearTimeout(i),r.length==e.length?t(r):i=setTimeout(()=>t(r),200)},n)}var hF=gx.define({combine(e){return Object.assign({sources:e.map(e=>e.source).filter(e=>e!=null)},oS(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t}))}});function gF(e,t={}){return[hF.of({source:e,config:t}),pF,IF]}function _F(e){let t=[];if(e)actions:for(let{name:n}of e){for(let e=0;e<n.length;e++){let r=n[e];if(/[a-zA-Z]/.test(r)&&!t.some(e=>e.toLowerCase()==r.toLowerCase())){t.push(r);continue actions}}t.push(``)}return t}function vF(e,t,n){let r=n?_F(t.actions):[];return YP(`li`,{class:`cm-diagnostic cm-diagnostic-`+t.severity},YP(`span`,{class:`cm-diagnosticText`},t.renderMessage?t.renderMessage(e):t.message),t.actions?.map((n,i)=>{let a=!1,o=r=>{if(r.preventDefault(),a)return;a=!0;let i=$P(e.state.field(oF).diagnostics,t);i&&n.apply(e,i.from,i.to)},{name:s}=n,c=r[i]?s.indexOf(r[i]):-1,l=c<0?s:[s.slice(0,c),YP(`u`,s.slice(c,c+1)),s.slice(c+1)];return YP(`button`,{type:`button`,class:`cm-diagnosticAction`,onclick:o,onmousedown:o,"aria-label":` Action: ${s}${c<0?``:` (access key "${r[i]})"`}.`},l)}),t.source&&YP(`div`,{class:`cm-diagnosticSource`},t.source))}var yF=class extends KC{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return YP(`span`,{class:`cm-lintPoint cm-lintPoint-`+this.sev})}},bF=class{constructor(e,t){this.diagnostic=t,this.id=`item_`+Math.floor(Math.random()*4294967295).toString(16),this.dom=vF(e,t,!0),this.dom.id=this.id,this.dom.setAttribute(`role`,`option`)}},xF=class e{constructor(e){this.view=e,this.items=[];let t=t=>{if(t.keyCode==27)dF(this.view),this.view.focus();else if(t.keyCode==38||t.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(t.keyCode==40||t.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(t.keyCode==36)this.moveSelection(0);else if(t.keyCode==35)this.moveSelection(this.items.length-1);else if(t.keyCode==13)this.view.focus();else if(t.keyCode>=65&&t.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:n}=this.items[this.selectedIndex],r=_F(n.actions);for(let i=0;i<r.length;i++)if(r[i].toUpperCase().charCodeAt(0)==t.keyCode){let t=$P(this.view.state.field(oF).diagnostics,n);t&&n.actions[i].apply(e,t.from,t.to)}}else return;t.preventDefault()},n=e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)};this.list=YP(`ul`,{tabIndex:0,role:`listbox`,"aria-label":this.view.state.phrase(`Diagnostics`),onkeydown:t,onclick:n}),this.dom=YP(`div`,{class:`cm-panel-lint`},this.list,YP(`button`,{type:`button`,name:`close`,"aria-label":this.view.state.phrase(`close`),onclick:()=>dF(this.view)},`×`)),this.update()}get selectedIndex(){let e=this.view.state.field(oF).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(oF),n=0,r=!1,i=null,a=new Set;for(e.between(0,this.view.state.doc.length,(e,o,{spec:s})=>{for(let e of s.diagnostics){if(a.has(e))continue;a.add(e);let o=-1,s;for(let t=n;t<this.items.length;t++)if(this.items[t].diagnostic==e){o=t;break}o<0?(s=new bF(this.view,e),this.items.splice(n,0,s),r=!0):(s=this.items[o],o>n&&(this.items.splice(n,o-n),r=!0)),t&&s.diagnostic==t.diagnostic?s.dom.hasAttribute(`aria-selected`)||(s.dom.setAttribute(`aria-selected`,`true`),i=s):s.dom.hasAttribute(`aria-selected`)&&s.dom.removeAttribute(`aria-selected`),n++}});n<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();this.items.length==0&&(this.items.push(new bF(this.view,{from:-1,to:-1,severity:`info`,message:this.view.state.phrase(`No diagnostics`)})),r=!0),i?(this.list.setAttribute(`aria-activedescendant`,i.id),this.view.requestMeasure({key:this,read:()=>({sel:i.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.top<t.top?this.list.scrollTop-=(t.top-e.top)/n:e.bottom>t.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute(`aria-activedescendant`),r&&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=$P(this.view.state.field(oF).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:aF.of(t)})}static open(t){return new e(t)}};function SF(e,t=`viewBox="0 0 40 40"`){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}function CF(e){return SF(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,`width="6" height="3"`)}var wF=DD.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:CF(`#d11`)},".cm-lintRange-warning":{backgroundImage:CF(`orange`)},".cm-lintRange-info":{backgroundImage:CF(`#999`)},".cm-lintRange-hint":{backgroundImage:CF(`#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 TF(e){return e==`error`?4:e==`warning`?3:e==`info`?2:1}function EF(e){let t=`hint`,n=1;for(let r of e){let e=TF(r.severity);e>n&&(n=e,t=r.severity)}return t}var DF=class extends fk{constructor(e){super(),this.diagnostics=e,this.severity=EF(e)}toDOM(e){let t=document.createElement(`div`);t.className=`cm-lint-marker cm-lint-marker-`+this.severity;let n=this.diagnostics,r=e.state.facet(LF).tooltipFilter;return r&&(n=r(n,e.state)),n.length&&(t.onmouseover=()=>kF(e,t,n)),t}};function OF(e,t){let n=r=>{let i=t.getBoundingClientRect();if(!(r.clientX>i.left-10&&r.clientX<i.right+10&&r.clientY>i.top-10&&r.clientY<i.bottom+10)){for(let e=r.target;e;e=e.parentNode)if(e.nodeType==1&&e.classList.contains(`cm-tooltip-lint`))return;window.removeEventListener(`mousemove`,n),e.state.field(PF)&&e.dispatch({effects:NF.of(null)})}};window.addEventListener(`mousemove`,n)}function kF(e,t,n){function r(){let r=e.elementAtHeight(t.getBoundingClientRect().top+5-e.documentTop);e.coordsAtPos(r.from)&&e.dispatch({effects:NF.of({pos:r.from,above:!1,clip:!1,create(){return{dom:lF(e,n),getCoords:()=>t.getBoundingClientRect()}}})}),t.onmouseout=t.onmousemove=null,OF(e,t)}let{hoverTime:i}=e.state.facet(LF),a=setTimeout(r,i);t.onmouseout=()=>{clearTimeout(a),t.onmouseout=t.onmousemove=null},t.onmousemove=()=>{clearTimeout(a),a=setTimeout(r,i)}}function AF(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 r=[];for(let e in n)r.push(new DF(n[e]).range(+e));return dS.of(r,!0)}var jF=_k({class:`cm-gutter-lint`,markers:e=>e.state.field(MF),widgetMarker:(e,t,n)=>{let r=[];return e.state.field(MF).between(n.from,n.to,(e,t,i)=>{e>n.from&&e<n.to&&r.push(...i.diagnostics)}),r.length?new DF(r):null}}),MF=Cx.define({create(){return dS.empty},update(e,t){e=e.map(t.changes);let n=t.state.facet(LF).markerFilter;for(let r of t.effects)if(r.is(rF)){let i=r.value;n&&(i=n(i||[],t.state)),e=AF(t.state.doc,i.slice(0))}return e}}),NF=Wx.define(),PF=Cx.define({create(){return null},update(e,t){return e&&t.docChanged&&(e=eF(t,e)?null:Object.assign(Object.assign({},e),{pos:t.changes.mapPos(e.pos)})),t.effects.reduce((e,t)=>t.is(NF)?t.value:e,e)},provide:e=>YO.from(e)}),FF=DD.baseTheme({".cm-gutter-lint":{width:`1.4em`,"& .cm-gutterElement":{padding:`.2em`}},".cm-lint-marker":{width:`1em`,height:`1em`},".cm-lint-marker-info":{content:SF(`<path fill="#aaf" stroke="#77e" stroke-width="6" stroke-linejoin="round" d="M5 5L35 5L35 35L5 35Z"/>`)},".cm-lint-marker-warning":{content:SF(`<path fill="#fe8" stroke="#fd7" stroke-width="6" stroke-linejoin="round" d="M20 6L37 35L3 35Z"/>`)},".cm-lint-marker-error":{content:SF(`<circle cx="20" cy="20" r="15" fill="#f87" stroke="#f43" stroke-width="6"/>`)}}),IF=[oF,DD.decorations.compute([oF],e=>{let{selected:t,panel:n}=e.field(oF);return!t||!n||t.from==t.to?JC.none:JC.set([sF.range(t.from,t.to)])}),rk(cF,{hideOn:eF}),wF],LF=gx.define({combine(e){return oS(e,{hoverTime:300,markerFilter:null,tooltipFilter:null})}});function RF(e={}){return[LF.of(e),MF,jF,FF,PF]}var zF=class e{constructor(e,t,n,r,i,a,o,s,c,l=0,u){this.p=e,this.stack=t,this.state=n,this.reducePos=r,this.pos=i,this.score=a,this.buffer=o,this.bufferBase=s,this.curContext=c,this.lookAhead=l,this.parent=u}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?`!`+this.score:``}`}static start(t,n,r=0){let i=t.parser.context;return new e(t,[],n,r,r,0,[],0,i?new BF(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){let t=e>>19,n=e&65535,{parser:r}=this.p,i=this.reducePos<this.pos-25;i&&this.setLookAhead(this.pos);let a=r.dynamicPrecedence(n);if(a&&(this.score+=a),t==0){this.pushState(r.getGoto(this.state,n,!0),this.reducePos),n<r.minRepeatTerm&&this.storeNode(n,this.reducePos,this.reducePos,i?8:4,!0),this.reduceContext(n,this.reducePos);return}let o=this.stack.length-(t-1)*3-(e&262144?6:0),s=o?this.stack[o-2]:this.p.ranges[0].from,c=this.reducePos-s;c>=2e3&&!this.p.parser.nodeSet.types[n]?.isAnonymous&&(s==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSize<c&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=s,this.p.lastBigReductionSize=c));let l=o?this.stack[o-1]:0,u=this.bufferBase+this.buffer.length-l;if(n<r.minRepeatTerm||e&131072){let e=r.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(n,s,e,u+4,!0)}if(e&262144)this.state=this.stack[o];else{let e=this.stack[o-3];this.state=r.getGoto(e,n,!0)}for(;this.stack.length>o;)this.stack.pop();this.reduceContext(n,s)}storeNode(e,t,n,r=4,i=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let e=this,r=this.buffer.length;if(r==0&&e.parent&&(r=e.bufferBase-e.parent.bufferBase,e=e.parent),r>0&&e.buffer[r-4]==0&&e.buffer[r-1]>-1){if(t==n)return;if(e.buffer[r-2]>=t){e.buffer[r-2]=n;return}}}if(!i||this.pos==n)this.buffer.push(e,t,n,r);else{let i=this.buffer.length;if(i>0&&this.buffer[i-4]!=0){let e=!1;for(let t=i;t>0&&this.buffer[t-2]>n;t-=4)if(this.buffer[t-1]>=0){e=!0;break}if(e)for(;i>0&&this.buffer[i-2]>n;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4)}this.buffer[i]=e,this.buffer[i+1]=t,this.buffer[i+2]=n,this.buffer[i+3]=r}}shift(e,t,n,r){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=r,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,r,4);else{let i=e,{parser:a}=this.p;(r>this.pos||t<=a.maxNode)&&(this.pos=r,a.stateFlag(i,1)||(this.reducePos=r)),this.pushState(i,n),this.shiftContext(t,n),t<=a.maxNode&&this.buffer.push(t,n,r,4)}}apply(e,t,n,r){e&65536?this.reduce(e):this.shift(e,t,n,r)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(n,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let t=this,n=t.buffer.length;for(;n>0&&t.buffer[n-2]>t.reducePos;)n-=4;let r=t.buffer.slice(n),i=t.bufferBase+n;for(;t&&i==t.bufferBase;)t=t.parent;return new e(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,t)}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 VF(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(n==0)return!1;if(!(n&65536))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 r=0,i;r<t.length;r+=2)(i=t[r+1])!=this.state&&this.p.parser.hasAction(i,e)&&n.push(t[r],i);if(this.stack.length<120)for(let e=0;n.length<8&&e<t.length;e+=2){let r=t[e+1];n.some((e,t)=>t&1&&e==r)||n.push(t[e],r)}t=n}let n=[];for(let e=0;e<t.length&&n.length<4;e+=2){let r=t[e+1];if(r==this.state)continue;let i=this.split();i.pushState(r,this.pos),i.storeNode(0,i.pos,i.pos,4,!0),i.shiftContext(t[e],this.pos),i.reducePos=this.pos,i.score-=200,n.push(i)}return n}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if(!(t&65536))return!1;if(!e.validAction(this.state,t)){let n=t>>19,r=t&65535,i=this.stack.length-n*3;if(i<0||e.getGoto(this.stack[i],r,!1)<0){let e=this.findForcedReduction();if(e==null)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=(r,i)=>{if(!t.includes(r))return t.push(r),e.allActions(r,t=>{if(!(t&393216))if(t&65536){let n=(t>>19)-i;if(n>1){let r=t&65535,i=this.stack.length-n*3;if(i>=0&&e.getGoto(this.stack[i],r,!1)>=0)return n<<19|65536|r}}else{let e=n(t,i+1);if(e!=null)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(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new BF(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){e>this.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}},BF=class{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}},VF=class{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,n=e>>19;n==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(n-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}},HF=class e{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(t,n=t.bufferBase+t.buffer.length){return new e(t,n,n-t.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new e(this.stack,this.pos,this.index)}};function UF(e,t=Uint16Array){if(typeof e!=`string`)return e;let n=null;for(let r=0,i=0;r<e.length;){let a=0;for(;;){let t=e.charCodeAt(r++),n=!1;if(t==126){a=65535;break}t>=92&&t--,t>=34&&t--;let i=t-32;if(i>=46&&(i-=46,n=!0),a+=i,n)break;a*=46}n?n[i++]=a:n=new t(a)}return n}var WF=class{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}},GF=new WF,KF=class{constructor(e,t){this.input=e,this.ranges=t,this.chunk=``,this.chunkOff=0,this.chunk2=``,this.chunk2Pos=0,this.next=-1,this.token=GF,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,r=this.rangeIndex,i=this.pos+e;for(;i<n.from;){if(!r)return null;let e=this.ranges[--r];i-=n.from-e.to,n=e}for(;t<0?i>n.to:i>=n.to;){if(r==this.ranges.length-1)return null;let e=this.ranges[++r];i+=e.from-n.to,n=e}return i}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,r;if(t>=0&&t<this.chunk.length)n=this.pos+e,r=this.chunk.charCodeAt(t);else{let t=this.resolveOffset(e,1);if(t==null)return-1;if(n=t,n>=this.chunk2Pos&&n<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(n-this.chunk2Pos);else{let e=this.rangeIndex,t=this.range;for(;t.to<=n;)t=this.ranges[++e];this.chunk2=this.input.chunk(this.chunk2Pos=n),n+this.chunk2.length>t.to&&(this.chunk2=this.chunk2.slice(0,t.to-n)),r=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),r}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(n==null||n<this.token.start)throw RangeError(`Token end out of bounds`);this.token.value=e,this.token.end=n}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk=``,this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=GF,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk=``,this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n=``;for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(n+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return n}},qF=class{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;YF(this.data,e,t,this.id,n.data,n.tokenPrecTable)}};qF.prototype.contextual=qF.prototype.fallback=qF.prototype.extend=!1;var JF=class{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data=typeof e==`string`?UF(e):e}token(e,t){let n=e.pos,r=0;for(;;){let n=e.next<0,i=e.resolveOffset(1,1);if(YF(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(n||r++,i==null)break;e.reset(i,e.token)}r&&(e.reset(n,e.token),e.acceptToken(this.elseToken,r))}};JF.prototype.contextual=qF.prototype.fallback=qF.prototype.extend=!1;function YF(e,t,n,r,i,a){let o=0,s=1<<r,{dialect:c}=n.p.parser;scan:for(;(s&e[o])!=0;){let n=e[o+1];for(let r=o+3;r<n;r+=2)if((e[r+1]&s)>0){let n=e[r];if(c.allows(n)&&(t.token.value==-1||t.token.value==n||ZF(n,t.token.value,i,a))){t.acceptToken(n);break}}let r=t.next,l=0,u=e[o+2];if(t.next<0&&u>l&&e[n+u*3-3]==65535){o=e[n+u*3-1];continue scan}for(;l<u;){let i=l+u>>1,a=n+i+(i<<1),s=e[a],c=e[a+1]||65536;if(r<s)u=i;else if(r>=c)l=i+1;else{o=e[a+2],t.advance();continue scan}}break}}function XF(e,t,n){for(let r=t,i;(i=e[r])!=65535;r++)if(i==n)return r-t;return-1}function ZF(e,t,n,r){let i=XF(n,r,t);return i<0||XF(n,r,e)<i}var QF=typeof process<`u`&&/\bparse\b/.test({}.LOG),$F=null;function eI(e,t,n){let r=e.cursor(Jk.IncludeAnonymous);for(r.moveTo(t);;)if(!(n<0?r.childBefore(t):r.childAfter(t)))for(;;){if((n<0?r.to<t:r.from>t)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,t-25)):Math.min(e.length,Math.max(r.from+1,t+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:e.length}}var tI=class{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?eI(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?eI(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let n=this.trees[t],r=this.index[t];if(r==n.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let i=n.children[r],a=this.start[t]+n.positions[r];if(a>e)return this.nextStart=a,null;if(i instanceof Yk){if(a==e){if(a<this.safeFrom)return null;let e=a+i.length;if(e<=this.safeTo){let t=i.prop(Vk.lookAhead);if(!t||e+t<this.fragment.to)return i}}this.index[t]++,a+i.length>=Math.max(this.safeFrom,e)&&(this.trees.push(i),this.start.push(a),this.index.push(0))}else this.index[t]++,this.nextStart=a+i.length}}},nI=class{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(e=>new WF)}getActions(e){let t=0,n=null,{parser:r}=e.p,{tokenizers:i}=r,a=r.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,s=0;for(let r=0;r<i.length;r++){if(!(1<<r&a))continue;let c=i[r],l=this.tokens[r];if(!(n&&!c.fallback)&&((c.contextual||l.start!=e.pos||l.mask!=a||l.context!=o)&&(this.updateCachedToken(l,c,e),l.mask=a,l.context=o),l.lookAhead>l.end+25&&(s=Math.max(l.lookAhead,s)),l.value!=0)){let r=t;if(l.extended>-1&&(t=this.addActions(e,l.extended,l.end,t)),t=this.addActions(e,l.value,l.end,t),!c.extend&&(n=l,t>r))break}}for(;this.actions.length>t;)this.actions.pop();return s&&e.setLookAhead(s),!n&&e.pos==this.stream.end&&(n=new WF,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 WF,{pos:n,p:r}=e;return t.start=n,t.end=Math.min(n+1,r.stream.end),t.value=n==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,n){let r=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(r,e),n),e.value>-1){let{parser:t}=n.p;for(let r=0;r<t.specialized.length;r++)if(t.specialized[r]==e.value){let i=t.specializers[r](this.stream.read(e.start,e.end),n);if(i>=0&&n.p.parser.dialect.allows(i>>1)){i&1?e.extended=i>>1:e.value=i>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,n,r){for(let t=0;t<r;t+=3)if(this.actions[t]==e)return r;return this.actions[r++]=e,this.actions[r++]=t,this.actions[r++]=n,r}addActions(e,t,n,r){let{state:i}=e,{parser:a}=e.p,{data:o}=a;for(let e=0;e<2;e++)for(let s=a.stateSlot(i,e?2:1);;s+=3){if(o[s]==65535)if(o[s+1]==1)s=sI(o,s+2);else{r==0&&o[s+1]==2&&(r=this.putAction(sI(o,s+2),t,n,r));break}o[s]==t&&(r=this.putAction(sI(o,s+1),t,n,r))}return r}},rI=class{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new KF(t,r),this.tokens=new nI(e,this.stream),this.topTerm=e.top[1];let{from:i}=r[0];this.stacks=[zF.start(this,e.top[0],i)],this.fragments=n.length&&this.stream.end-i>e.bufferLength*4?new tI(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,n=this.stacks=[],r,i;if(this.bigReductionCount>300&&e.length==1){let[t]=e;for(;t.forceReduce()&&t.stack.length&&t.stack[t.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let a=0;a<e.length;a++){let o=e[a];for(;;){if(this.tokens.mainToken=null,o.pos>t)n.push(o);else if(this.advanceStack(o,n,e))continue;else{r||(r=[],i=[]),r.push(o);let e=this.tokens.getMainToken(o);i.push(e.value,e.end)}break}}if(!n.length){let e=r&&cI(r);if(e)return QF&&console.log(`Finish with `+this.stackID(e)),this.stackToTree(e);if(this.parser.strict)throw QF&&r&&console.log(`Stuck with token `+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):`none`)),SyntaxError(`No parse at `+t);this.recovering||=5}if(this.recovering&&r){let e=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,i,n);if(e)return QF&&console.log(`Force-finish `+this.stackID(e)),this.stackToTree(e.forceAll())}if(this.recovering){let e=this.recovering==1?1:this.recovering*3;if(n.length>e)for(n.sort((e,t)=>t.score-e.score);n.length>e;)n.pop();n.some(e=>e.reducePos>t)&&this.recovering--}else if(n.length>1){outer:for(let e=0;e<n.length-1;e++){let t=n[e];for(let r=e+1;r<n.length;r++){let i=n[r];if(t.sameState(i)||t.buffer.length>500&&i.buffer.length>500)if((t.score-i.score||t.buffer.length-i.buffer.length)>0)n.splice(r--,1);else{n.splice(e--,1);continue outer}}}n.length>12&&n.splice(12,n.length-12)}this.minStackPos=n[0].pos;for(let e=1;e<n.length;e++)n[e].pos<this.minStackPos&&(this.minStackPos=n[e].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw RangeError(`Can't move stoppedAt forward`);this.stoppedAt=e}advanceStack(e,t,n){let r=e.pos,{parser:i}=this,a=QF?this.stackID(e)+` -> `:``;if(this.stoppedAt!=null&&r>this.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 o=this.fragments.nodeAt(r);o;){let r=this.parser.nodeSet.types[o.type.id]==o.type?i.getGoto(e.state,o.type.id):-1;if(r>-1&&o.length&&(!t||(o.prop(Vk.contextHash)||0)==n))return e.useNode(o,r),QF&&console.log(a+this.stackID(e)+` (via reuse of ${i.getName(o.type.id)})`),!0;if(!(o instanceof Yk)||o.children.length==0||o.positions[0]>0)break;let s=o.children[0];if(s instanceof Yk&&o.positions[0]==0)o=s;else break}}let o=i.stateSlot(e.state,4);if(o>0)return e.reduce(o),QF&&console.log(a+this.stackID(e)+` (via always-reduce ${i.getName(o&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let s=this.tokens.getActions(e);for(let o=0;o<s.length;){let c=s[o++],l=s[o++],u=s[o++],d=o==s.length||!n,f=d?e:e.split(),p=this.tokens.mainToken;if(f.apply(c,l,p?p.start:f.pos,u),QF&&console.log(a+this.stackID(f)+` (via ${c&65536?`reduce of ${i.getName(c&65535)}`:`shift`} for ${i.getName(l)} @ ${r}${f==e?``:`, split`})`),d)return!0;f.pos>r?t.push(f):n.push(f)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return iI(e,t),!0}}runRecovery(e,t,n){let r=null,i=!1;for(let a=0;a<e.length;a++){let o=e[a],s=t[a<<1],c=t[(a<<1)+1],l=QF?this.stackID(o)+` -> `:``;if(o.deadEnd&&(i||(i=!0,o.restart(),QF&&console.log(l+this.stackID(o)+` (restarted)`),this.advanceFully(o,n))))continue;let u=o.split(),d=l;for(let e=0;u.forceReduce()&&e<10&&(QF&&console.log(d+this.stackID(u)+` (via force-reduce)`),!this.advanceFully(u,n));e++)QF&&(d=this.stackID(u)+` -> `);for(let e of o.recoverByInsert(s))QF&&console.log(l+this.stackID(e)+` (via recover-insert)`),this.advanceFully(e,n);this.stream.end>o.pos?(c==o.pos&&(c++,s=0),o.recoverByDelete(s,c),QF&&console.log(l+this.stackID(o)+` (via recover-delete ${this.parser.getName(s)})`),iI(o,n)):(!r||r.score<o.score)&&(r=o)}return r}stackToTree(e){return e.close(),Yk.build({buffer:HF.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=($F||=new WeakMap).get(e);return t||$F.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}};function iI(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(r.pos==e.pos&&r.sameState(e)){t[n].score<e.score&&(t[n]=e);return}}t.push(e)}var aI=class{constructor(e,t,n){this.source=e,this.flags=t,this.disabled=n}allows(e){return!this.disabled||this.disabled[e]==0}},oI=class e extends gA{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(` `);this.minRepeatTerm=t.length;for(let n=0;n<e.repeatNodeCount;n++)t.push(``);let n=Object.keys(e.topRules).map(t=>e.topRules[t][1]),r=[];for(let e=0;e<t.length;e++)r.push([]);function i(e,t,n){r[e].push([t,t.deserialize(String(n))])}if(e.nodeProps)for(let t of e.nodeProps){let e=t[0];typeof e==`string`&&(e=Vk[e]);for(let n=1;n<t.length;){let r=t[n++];if(r>=0)i(r,e,t[n++]);else{let a=t[n+-r];for(let o=-r;o>0;o--)i(t[n++],e,a);n++}}}this.nodeSet=new Gk(t.map((t,i)=>Wk.define({name:i>=this.minRepeatTerm?void 0:t,id:i,props:r[i],top:n.indexOf(i)>-1,error:i==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(i)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=Rk;let a=UF(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let e=0;e<this.specializerSpecs.length;e++)this.specialized[e]=this.specializerSpecs[e].term;this.specializers=this.specializerSpecs.map(lI),this.states=UF(e.states,Uint32Array),this.data=UF(e.stateData),this.goto=UF(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(e=>typeof e==`number`?new qF(a,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 r=new rI(this,e,t,n);for(let i of this.wrappers)r=i(r,e,t,n);return r}getGoto(e,t,n=!1){let r=this.goto;if(t>=r[0])return-1;for(let i=r[t+1];;){let t=r[i++],a=t&1,o=r[i++];if(a&&n)return o;for(let n=i+(t>>1);i<n;i++)if(r[i]==e)return o;if(a)return-1}}hasAction(e,t){let n=this.data;for(let r=0;r<2;r++)for(let i=this.stateSlot(e,r?2:1),a;;i+=3){if((a=n[i])==65535)if(n[i+1]==1)a=n[i=sI(n,i+2)];else if(n[i+1]==2)return sI(n,i+2);else break;if(a==t||a==0)return sI(n,i+1)}return 0}stateSlot(e,t){return this.states[e*6+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,e=>e==t?!0:null)}allActions(e,t){let n=this.stateSlot(e,4),r=n?t(n):void 0;for(let n=this.stateSlot(e,1);r==null;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=sI(this.data,n+2);else break;r=t(sI(this.data,n+1))}return r}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=sI(this.data,n+2);else break;if(!(this.data[n+2]&1)){let e=this.data[n+1];t.some((t,n)=>n&1&&t==e)||t.push(this.data[n],e)}}return t}configure(t){let n=Object.assign(Object.create(e.prototype),this);if(t.props&&(n.nodeSet=this.nodeSet.extend(...t.props)),t.top){let e=this.topRules[t.top];if(!e)throw RangeError(`Invalid top rule name ${t.top}`);n.top=e}return t.tokenizers&&(n.tokenizers=this.tokenizers.map(e=>{let n=t.tokenizers.find(t=>t.from==e);return n?n.to:e})),t.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((e,r)=>{let i=t.specializers.find(t=>t.from==e.external);if(!i)return e;let a=Object.assign(Object.assign({},e),{external:i.to});return n.specializers[r]=lI(a),a})),t.contextTracker&&(n.context=t.contextTracker),t.dialect&&(n.dialect=this.parseDialect(t.dialect)),t.strict!=null&&(n.strict=t.strict),t.wrap&&(n.wrappers=n.wrappers.concat(t.wrap)),t.bufferLength!=null&&(n.bufferLength=t.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let r of e.split(` `)){let e=t.indexOf(r);e>=0&&(n[e]=!0)}let r=null;for(let e=0;e<t.length;e++)if(!n[e])for(let n=this.dialects[t[e]],i;(i=this.data[n++])!=65535;)(r||=new Uint8Array(this.maxTerm+1))[i]=1;return new aI(e,n,r)}static deserialize(t){return new e(t)}};function sI(e,t){return e[t]|e[t+1]<<16}function cI(e){let t=null;for(let n of e){let e=n.p.stoppedAt;(n.pos==n.p.stream.end||e!=null&&n.pos>e)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.score<n.score)&&(t=n)}return t}function lI(e){if(e.external){let t=+!!e.extend;return(n,r)=>e.external(n,r)<<1|t}return e.get}var uI=wA({String:qA.string,Number:qA.number,"True False":qA.bool,PropertyName:qA.propertyName,Null:qA.null,", :":qA.separator,"[ ]":qA.squareBracket,"{ }":qA.brace}),dI=oI.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:`#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O`,goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:`⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array`,maxTerm:25,nodeProps:[[`isolate`,-2,6,11,``],[`openedBy`,7,`{`,14,`[`],[`closedBy`,8,`}`,15,`]`]],propSources:[uI],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),fI=$A.define({name:`json`,parser:dI.configure({props:[vj.add({Object:Oj({except:/^\s*\}/}),Array:Oj({except:/^\s*\]/})}),Mj.add({"Object Array":Nj})]}),languageData:{closeBrackets:{brackets:[`[`,`{`,`"`]},indentOnInput:/^\s*[\}\]]$/}});function pI(){return new dj(fI)}var mI=typeof String.prototype.normalize==`function`?e=>e.normalize(`NFKD`):e=>e,hI=class{constructor(e,t,n=0,r=e.length,i,a){this.test=a,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer=``,this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=i?e=>i(mI(e)):mI,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 ex(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=tx(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=nx(e);let r=this.normalize(t);if(r.length)for(let e=0,i=n;;e++){let a=r.charCodeAt(e),o=this.match(a,i,this.bufferPos+this.bufferStart);if(e==r.length-1){if(o)return this.value=o,this;break}i==n&&e<t.length&&t.charCodeAt(e)==a&&i++}}}match(e,t,n){let r=null;for(let t=0;t<this.matches.length;t+=2){let i=this.matches[t],a=!1;this.query.charCodeAt(i)==e&&(i==this.query.length-1?r={from:this.matches[t+1],to:n}:(this.matches[t]++,a=!0)),a||(this.matches.splice(t,2),t-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?r={from:t,to:n}:this.matches.push(1,t)),r&&this.test&&!this.test(r.from,r.to,this.buffer,this.bufferStart)&&(r=null),r}};typeof Symbol<`u`&&(hI.prototype[Symbol.iterator]=function(){return this});var gI={from:-1,to:-1,match:/.*/.exec(``)},_I=`gm`+(/x/.unicode==null?``:`u`),vI=class{constructor(e,t,n,r=0,i=e.length){if(this.text=e,this.to=i,this.curLine=``,this.done=!1,this.value=gI,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new xI(e,t,n,r,i);this.re=new RegExp(t,_I+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.iter=e.iter();let a=e.lineAt(r);this.curLineStart=a.from,this.matchPos=CI(e,r),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine=``:(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine=``:this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=CI(this.text,r+ +(n==r)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}},yI=new WeakMap,bI=class e{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(t,n,r){let i=yI.get(t);if(!i||i.from>=r||i.to<=n){let i=new e(n,t.sliceString(n,r));return yI.set(t,i),i}if(i.from==n&&i.to==r)return i;let{text:a,from:o}=i;return o>n&&(a=t.sliceString(n,o)+a,o=n),i.to<r&&(a+=t.sliceString(i.to,r)),yI.set(t,new e(o,a)),new e(n,a.slice(n-o,r-o))}},xI=class{constructor(e,t,n,r,i){this.text=e,this.to=i,this.done=!1,this.value=gI,this.matchPos=CI(e,r),this.re=new RegExp(t,_I+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.flat=bI.get(e,r,this.chunkEnd(r+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let 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=CI(this.text,n+ +(e==n)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=bI.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}};typeof Symbol<`u`&&(vI.prototype[Symbol.iterator]=xI.prototype[Symbol.iterator]=function(){return this});function SI(e){try{return new RegExp(e,_I),!0}catch{return!1}}function CI(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}function wI(e){let t=YP(`input`,{class:`cm-textfield`,name:`line`,value:String(e.state.doc.lineAt(e.state.selection.main.head).number)}),n=YP(`form`,{class:`cm-gotoLine`,onkeydown:t=>{t.keyCode==27?(t.preventDefault(),e.dispatch({effects:TI.of(!1)}),e.focus()):t.keyCode==13&&(t.preventDefault(),r())},onsubmit:e=>{e.preventDefault(),r()}},YP(`label`,e.state.phrase(`Go to line`),`: `,t),` `,YP(`button`,{class:`cm-button`,type:`submit`},e.state.phrase(`go`)),YP(`button`,{name:`close`,onclick:()=>{e.dispatch({effects:TI.of(!1)}),e.focus()},"aria-label":e.state.phrase(`close`),type:`button`},[`×`]));function r(){let n=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!n)return;let{state:r}=e,i=r.doc.lineAt(r.selection.main.head),[,a,o,s,c]=n,l=s?+s.slice(1):0,u=o?+o:i.number;if(o&&c){let e=u/100;a&&(e=e*(a==`-`?-1:1)+i.number/r.doc.lines),u=Math.round(r.doc.lines*e)}else o&&a&&(u=u*(a==`-`?-1:1)+i.number);let d=r.doc.line(Math.max(1,Math.min(r.doc.lines,u))),f=L.cursor(d.from+Math.max(0,Math.min(l,d.length)));e.dispatch({effects:[TI.of(!1),DD.scrollIntoView(f.from,{y:`center`})],selection:f}),e.focus()}return{dom:n}}var TI=Wx.define(),EI=Cx.define({create(){return!0},update(e,t){for(let n of t.effects)n.is(TI)&&(e=n.value);return e},provide:e=>dk.from(e,e=>e?wI:null)}),DI=e=>{let t=sk(e,wI);if(!t){let n=[TI.of(!0)];e.state.field(EI,!1)??n.push(Wx.appendConfig.of([EI,OI])),e.dispatch({effects:n}),t=sk(e,wI)}return t&&t.dom.querySelector(`input`).select(),!0},OI=DD.baseTheme({".cm-panel.cm-gotoLine":{padding:`2px 6px 4px`,position:`relative`,"& label":{fontSize:`80%`},"& [name=close]":{position:`absolute`,top:`0`,bottom:`0`,right:`4px`,backgroundColor:`inherit`,border:`none`,font:`inherit`,padding:`0`}}}),kI={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},AI=gx.define({combine(e){return oS(e,kI,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function jI(e){let t=[LI,II];return e&&t.push(AI.of(e)),t}var MI=JC.mark({class:`cm-selectionMatch`}),NI=JC.mark({class:`cm-selectionMatch cm-selectionMatch-main`});function PI(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=eS.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=eS.Word)}function FI(e,t,n,r){return e(t.sliceDoc(n,n+1))==eS.Word&&e(t.sliceDoc(r-1,r))==eS.Word}var II=Yw.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(AI),{state:n}=e,r=n.selection;if(r.ranges.length>1)return JC.none;let i=r.main,a,o=null;if(i.empty){if(!t.highlightWordAroundCursor)return JC.none;let e=n.wordAt(i.head);if(!e)return JC.none;o=n.charCategorizer(i.head),a=n.sliceDoc(e.from,e.to)}else{let e=i.to-i.from;if(e<t.minSelectionLength||e>200)return JC.none;if(t.wholeWords){if(a=n.sliceDoc(i.from,i.to),o=n.charCategorizer(i.head),!(PI(o,n,i.from,i.to)&&FI(o,n,i.from,i.to)))return JC.none}else if(a=n.sliceDoc(i.from,i.to),!a)return JC.none}let s=[];for(let r of e.visibleRanges){let e=new hI(n.doc,a,r.from,r.to);for(;!e.next().done;){let{from:r,to:a}=e.value;if((!o||PI(o,n,r,a))&&(i.empty&&r<=i.from&&a>=i.to?s.push(NI.range(r,a)):(r>=i.to||a<=i.from)&&s.push(MI.range(r,a)),s.length>t.maxMatches))return JC.none}}return JC.set(s)}},{decorations:e=>e.decorations}),LI=DD.baseTheme({".cm-selectionMatch":{backgroundColor:`#99ff7780`},".cm-searchMatch .cm-selectionMatch":{backgroundColor:`transparent`}}),RI=({state:e,dispatch:t})=>{let{selection:n}=e,r=L.create(n.ranges.map(t=>e.wordAt(t.head)||L.cursor(t.head)),n.mainIndex);return r.eq(n)?!1:(t(e.update({selection:r})),!0)};function zI(e,t){let{main:n,ranges:r}=e.selection,i=e.wordAt(n.head),a=i&&i.from==n.from&&i.to==n.to;for(let n=!1,i=new hI(e.doc,t,r[r.length-1].to);;)if(i.next(),i.done){if(n)return null;i=new hI(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),n=!0}else{if(n&&r.some(e=>e.from==i.value.from))continue;if(a){let t=e.wordAt(i.value.from);if(!t||t.from!=i.value.from||t.to!=i.value.to)continue}return i.value}}var BI=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return RI({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=r))return!1;let i=zI(e,r);return i?(t(e.update({selection:e.selection.addRange(L.range(i.from,i.to),!1),effects:DD.scrollIntoView(i.to)})),!0):!1},VI=gx.define({combine(e){return oS(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new bL(e),scrollToMatch:e=>DD.scrollIntoView(e)})}});function HI(e){return e?[VI.of(e),EL]:EL}var UI=class{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||SI(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>t==`n`?`
|
|
43
|
+
`:t==`r`?`\r`: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 QI(this):new qI(this)}getCursor(e,t=0,n){let r=e.doc?e:aS.create({doc:e});return n??=r.doc.length,this.regexp?JI(this,r,t,n):GI(this,r,t,n)}},WI=class{constructor(e){this.spec=e}};function GI(e,t,n,r){return new hI(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:e=>e.toLowerCase(),e.wholeWord?KI(t.doc,t.charCategorizer(t.selection.main.head)):void 0)}function KI(e,t){return(n,r,i,a)=>((a>n||a+i.length<r)&&(a=Math.max(0,n-2),i=e.sliceString(a,Math.min(e.length,r+2))),(t(YI(i,n-a))!=eS.Word||t(XI(i,n-a))!=eS.Word)&&(t(XI(i,r-a))!=eS.Word||t(YI(i,r-a))!=eS.Word))}var qI=class extends WI{constructor(e){super(e)}nextMatch(e,t,n){let r=GI(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);r=GI(this.spec,e,0,n).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==n?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let n=Math.max(t,r-1e4-this.spec.unquoted.length),i=GI(this.spec,e,n,r),a=null;for(;!i.nextOverlapping().done;)a=i.value;if(a)return a;if(n==t)return null;r-=1e4}}prevMatch(e,t,n){let r=this.prevMatchInRange(e,0,t);return r||=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length),r&&(r.from!=t||r.to!=n)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=GI(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=GI(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}};function JI(e,t,n,r){return new vI(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:e.wholeWord?ZI(t.charCategorizer(t.selection.main.head)):void 0},n,r)}function YI(e,t){return e.slice(Zb(e,t,!1),t)}function XI(e,t){return e.slice(t,Zb(e,t))}function ZI(e){return(t,n,r)=>!r[0].length||(e(YI(r.input,r.index))!=eS.Word||e(XI(r.input,r.index))!=eS.Word)&&(e(XI(r.input,r.index+r[0].length))!=eS.Word||e(YI(r.input,r.index+r[0].length))!=eS.Word)}var QI=class extends WI{nextMatch(e,t,n){let r=JI(this.spec,e,n,e.doc.length).next();return r.done&&(r=JI(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let i=Math.max(t,n-r*1e4),a=JI(this.spec,e,i,n),o=null;for(;!a.next().done;)o=a.value;if(o&&(i==t||o.from>i+10))return o;if(i==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)=>{if(n==`&`)return e.match[0];if(n==`$`)return`$`;for(let t=n.length;t>0;t--){let r=+n.slice(0,t);if(r>0&&r<e.match.length)return e.match[r]+n.slice(t)}return t})}matchAll(e,t){let n=JI(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=JI(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}},$I=Wx.define(),eL=Wx.define(),tL=Cx.define({create(e){return new nL(mL(e).create(),null)},update(e,t){for(let n of t.effects)n.is($I)?e=new nL(n.value.create(),e.panel):n.is(eL)&&(e=new nL(e.query,n.value?pL:null));return e},provide:e=>dk.from(e,e=>e.panel)}),nL=class{constructor(e,t){this.query=e,this.panel=t}},rL=JC.mark({class:`cm-searchMatch`}),iL=JC.mark({class:`cm-searchMatch cm-searchMatch-selected`}),aL=Yw.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(tL))}update(e){let t=e.state.field(tL);(t!=e.startState.field(tL)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return JC.none;let{view:n}=this,r=new pS;for(let t=0,i=n.visibleRanges,a=i.length;t<a;t++){let{from:o,to:s}=i[t];for(;t<a-1&&s>i[t+1].from-500;)s=i[++t].to;e.highlight(n.state,o,s,(e,t)=>{let i=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);r.add(e,t,i?iL:rL)})}return r.finish()}},{decorations:e=>e.decorations});function oL(e){return t=>{let n=t.state.field(tL,!1);return n&&n.query.spec.valid?e(t,n):_L(t)}}var sL=oL((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let i=L.single(r.from,r.to),a=e.state.facet(VI);return e.dispatch({selection:i,effects:[wL(e,r),a.scrollToMatch(i.main,e)],userEvent:`select.search`}),gL(e),!0}),cL=oL((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n,r,r);if(!i)return!1;let a=L.single(i.from,i.to),o=e.state.facet(VI);return e.dispatch({selection:a,effects:[wL(e,i),o.scrollToMatch(a.main,e)],userEvent:`select.search`}),gL(e),!0}),lL=oL((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:L.create(n.map(e=>L.range(e.from,e.to))),userEvent:`select.search.matches`}),!0)}),uL=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,a=[],o=0;for(let t=new hI(e.doc,e.sliceDoc(r,i));!t.next().done;){if(a.length>1e3)return!1;t.value.from==r&&(o=a.length),a.push(L.range(t.value.from,t.value.to))}return t(e.update({selection:L.create(a,o),userEvent:`select.search.matches`})),!0},dL=oL((e,{query:t})=>{let{state:n}=e,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let a=t.nextMatch(n,r,r);if(!a)return!1;let o=a,s=[],c,l,u=[];if(o.from==r&&o.to==i&&(l=n.toText(t.getReplacement(o)),s.push({from:o.from,to:o.to,insert:l}),o=t.nextMatch(n,o.from,o.to),u.push(DD.announce.of(n.phrase(`replaced match on line $`,n.doc.lineAt(r).number)+`.`))),o){let t=s.length==0||s[0].from>=a.to?0:a.to-a.from-l.length;c=L.single(o.from-t,o.to-t),u.push(wL(e,o)),u.push(n.facet(VI).scrollToMatch(c.main,e))}return e.dispatch({changes:s,selection:c,effects:u,userEvent:`input.replace`}),!0}),fL=oL((e,{query:t})=>{if(e.state.readOnly)return!1;let n=t.matchAll(e.state,1e9).map(e=>{let{from:n,to:r}=e;return{from:n,to:r,insert:t.getReplacement(e)}});if(!n.length)return!1;let r=e.state.phrase(`replaced $ matches`,n.length)+`.`;return e.dispatch({changes:n,effects:DD.announce.of(r),userEvent:`input.replace.all`}),!0});function pL(e){return e.state.facet(VI).createPanel(e)}function mL(e,t){let n=e.selection.main,r=n.empty||n.to>n.from+100?``:e.sliceDoc(n.from,n.to);if(t&&!r)return t;let i=e.facet(VI);return new UI({search:t?.literal??i.literal?r:r.replace(/\n/g,`\\n`),caseSensitive:t?.caseSensitive??i.caseSensitive,literal:t?.literal??i.literal,regexp:t?.regexp??i.regexp,wholeWord:t?.wholeWord??i.wholeWord})}function hL(e){let t=sk(e,pL);return t&&t.dom.querySelector(`[main-field]`)}function gL(e){let t=hL(e);t&&t==e.root.activeElement&&t.select()}var _L=e=>{let t=e.state.field(tL,!1);if(t&&t.panel){let n=hL(e);if(n&&n!=e.root.activeElement){let r=mL(e.state,t.query.spec);r.valid&&e.dispatch({effects:$I.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[eL.of(!0),t?$I.of(mL(e.state,t.query.spec)):Wx.appendConfig.of(EL)]});return!0},vL=e=>{let t=e.state.field(tL,!1);if(!t||!t.panel)return!1;let n=sk(e,pL);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:eL.of(!1)}),!0},yL=[{key:`Mod-f`,run:_L,scope:`editor search-panel`},{key:`F3`,run:sL,shift:cL,scope:`editor search-panel`,preventDefault:!0},{key:`Mod-g`,run:sL,shift:cL,scope:`editor search-panel`,preventDefault:!0},{key:`Escape`,run:vL,scope:`editor search-panel`},{key:`Mod-Shift-l`,run:uL},{key:`Mod-Alt-g`,run:DI},{key:`Mod-d`,run:BI,preventDefault:!0}],bL=class{constructor(e){this.view=e;let t=this.query=e.state.field(tL).query.spec;this.commit=this.commit.bind(this),this.searchField=YP(`input`,{value:t.search,placeholder:xL(e,`Find`),"aria-label":xL(e,`Find`),class:`cm-textfield`,name:`search`,form:``,"main-field":`true`,onchange:this.commit,onkeyup:this.commit}),this.replaceField=YP(`input`,{value:t.replace,placeholder:xL(e,`Replace`),"aria-label":xL(e,`Replace`),class:`cm-textfield`,name:`replace`,form:``,onchange:this.commit,onkeyup:this.commit}),this.caseField=YP(`input`,{type:`checkbox`,name:`case`,form:``,checked:t.caseSensitive,onchange:this.commit}),this.reField=YP(`input`,{type:`checkbox`,name:`re`,form:``,checked:t.regexp,onchange:this.commit}),this.wordField=YP(`input`,{type:`checkbox`,name:`word`,form:``,checked:t.wholeWord,onchange:this.commit});function n(e,t,n){return YP(`button`,{class:`cm-button`,name:e,onclick:t,type:`button`},n)}this.dom=YP(`div`,{onkeydown:e=>this.keydown(e),class:`cm-search`},[this.searchField,n(`next`,()=>sL(e),[xL(e,`next`)]),n(`prev`,()=>cL(e),[xL(e,`previous`)]),n(`select`,()=>lL(e),[xL(e,`all`)]),YP(`label`,null,[this.caseField,xL(e,`match case`)]),YP(`label`,null,[this.reField,xL(e,`regexp`)]),YP(`label`,null,[this.wordField,xL(e,`by word`)]),...e.state.readOnly?[]:[YP(`br`),this.replaceField,n(`replace`,()=>dL(e),[xL(e,`replace`)]),n(`replaceAll`,()=>fL(e),[xL(e,`replace all`)])],YP(`button`,{name:`close`,onclick:()=>vL(e),"aria-label":xL(e,`close`),type:`button`},[`×`])])}commit(){let e=new UI({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:$I.of(e)}))}keydown(e){zD(this.view,e,`search-panel`)?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?cL:sL)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),dL(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is($I)&&!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(VI).top}};function xL(e,t){return e.state.phrase(t)}var SL=30,CL=/[\s\.,:;?!]/;function wL(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),i=e.state.doc.lineAt(n).to,a=Math.max(r.from,t-SL),o=Math.min(i,n+SL),s=e.state.sliceDoc(a,o);if(a!=r.from){for(let e=0;e<SL;e++)if(!CL.test(s[e+1])&&CL.test(s[e])){s=s.slice(e);break}}if(o!=i){for(let e=s.length-1;e>s.length-SL;e--)if(!CL.test(s[e-1])&&CL.test(s[e])){s=s.slice(0,e);break}}return DD.announce.of(`${e.state.phrase(`current match`)}. ${s} ${e.state.phrase(`on line`)} ${r.number}.`)}var TL=DD.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`}}),EL=[tL,Ex.low(aL),TL],DL=class{constructor(e,t,n,r){this.state=e,this.pos=t,this.explicit=n,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=ej(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),r=t.text.slice(n-t.from,this.pos-t.from),i=r.search(NL(e,!1));return i<0?null:{from:n+i,to:this.pos,text:r.slice(i)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,n){e==`abort`&&this.abortListeners&&(this.abortListeners.push(t),n&&n.onDocChange&&(this.abortOnDocChange=!0))}};function OL(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 kL(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<r.length;e++)n[r[e]]=!0}let r=OL(t)+OL(n)+`*$`;return[RegExp(`^`+r),new RegExp(r)]}function AL(e){let t=e.map(e=>typeof e==`string`?{label:e}:e),[n,r]=t.every(e=>/^\w+$/.test(e.label))?[/\w*$/,/\w+$/]:kL(t);return e=>{let i=e.matchBefore(r);return i||e.explicit?{from:i?i.from:e.pos,options:t,validFor:n}:null}}var jL=class{constructor(e,t,n,r){this.completion=e,this.source=t,this.match=n,this.score=r}};function ML(e){return e.selection.main.from}function NL(e,t){let{source:n}=e,r=t&&n[0]!=`^`,i=n[n.length-1]!=`$`;return!r&&!i?e:RegExp(`${r?`^`:``}(?:${n})${i?`$`:``}`,e.flags??(e.ignoreCase?`i`:``))}var PL=Vx.define();function FL(e,t,n,r){let{main:i}=e.selection,a=n-i.from,o=r-i.from;return Object.assign(Object.assign({},e.changeByRange(s=>{if(s!=i&&n!=r&&e.sliceDoc(s.from+a,s.from+o)!=e.sliceDoc(n,r))return{range:s};let c=e.toText(t);return{changes:{from:s.from+a,to:r==i.from?s.to:s.from+o,insert:c},range:L.cursor(s.from+a+c.length)}})),{scrollIntoView:!0,userEvent:`input.complete`})}var IL=new WeakMap;function LL(e){if(!Array.isArray(e))return e;let t=IL.get(e);return t||IL.set(e,t=AL(e)),t}var RL=Wx.define(),zL=Wx.define(),BL=class{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let n=ex(e,t),r=nx(n);this.chars.push(n);let i=e.slice(t,t+r),a=i.toUpperCase();this.folded.push(ex(a==i?i.toLowerCase():a,0)),t+=r}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:n,any:r,precise:i,byWord:a}=this;if(t.length==1){let r=ex(e,0),i=nx(r),a=i==e.length?0:-100;if(r!=t[0])if(r==n[0])a+=-200;else return null;return this.ret(a,[0,i])}let o=e.indexOf(this.pattern);if(o==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let s=t.length,c=0;if(o<0){for(let i=0,a=Math.min(e.length,200);i<a&&c<s;){let a=ex(e,i);(a==t[c]||a==n[c])&&(r[c++]=i),i+=nx(a)}if(c<s)return null}let l=0,u=0,d=!1,f=0,p=-1,m=-1,h=/[a-z]/.test(e),g=!0;for(let r=0,c=Math.min(e.length,200),_=0;r<c&&u<s;){let c=ex(e,r);o<0&&(l<s&&c==t[l]&&(i[l++]=r),f<s&&(c==t[f]||c==n[f]?(f==0&&(p=r),m=r+1,f++):f=0));let v,y=c<255?c>=48&&c<=57||c>=97&&c<=122?2:+(c>=65&&c<=90):(v=tx(c))==v.toLowerCase()?v==v.toUpperCase()?0:2:1;(!r||y==1&&h||_==0&&y!=0)&&(t[u]==c||n[u]==c&&(d=!0)?a[u++]=r:a.length&&(g=!1)),_=y,r+=nx(c)}return u==s&&a[0]==0&&g?this.result(-100+(d?-200:0),a,e):f==s&&p==0?this.ret(-200-e.length+(m==e.length?0:-100),[0,m]):o>-1?this.ret(-700-e.length,[o,o+this.pattern.length]):f==s?this.ret(-900-e.length,[p,m]):u==s?this.result(-100+(d?-200:0)+-700+(g?0:-1100),a,e):t.length==2?null:this.result((r[0]?-700:0)+-200+-1100,r,e)}result(e,t,n){let r=[],i=0;for(let e of t){let t=e+(this.astral?nx(ex(n,e)):1);i&&r[i-1]==e?r[i-1]=t:(r[i++]=e,r[i++]=t)}return this.ret(e-n.length,r)}},VL=class{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),n=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return n==null?null:(this.matched=[0,t.length],this.score=n+(e.length==this.pattern.length?0:-100),this)}},HL=gx.define({combine(e){return oS(e,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>``,optionClass:()=>``,aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:WL,filterStrict:!1,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=>UL(e(n),t(n)),optionClass:(e,t)=>n=>UL(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function UL(e,t){return e?t?e+` `+t:e:t}function WL(e,t,n,r,i,a){let o=e.textDirection==sw.RTL,s=o,c=!1,l=`top`,u,d,f=t.left-i.left,p=i.right-t.right,m=r.right-r.left,h=r.bottom-r.top;if(s&&f<Math.min(m,p)?s=!1:!s&&p<Math.min(m,f)&&(s=!0),m<=(s?f:p))u=Math.max(i.top,Math.min(n.top,i.bottom-h))-t.top,d=Math.min(400,s?f:p);else{c=!0,d=Math.min(400,(o?t.right:i.right-t.left)-30);let e=i.bottom-t.bottom;e>=h||e>t.top?u=n.bottom-t.top:(l=`bottom`,u=t.bottom-n.top)}let g=(t.bottom-t.top)/a.offsetHeight,_=(t.right-t.left)/a.offsetWidth;return{style:`${l}: ${u/g}px; max-width: ${d/_}px`,class:`cm-completionInfo-`+(c?o?`left-narrow`:`right-narrow`:s?`left`:`right`)}}function GL(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,r){let i=document.createElement(`span`);i.className=`cm-completionLabel`;let a=e.displayLabel||e.label,o=0;for(let e=0;e<r.length;){let t=r[e++],n=r[e++];t>o&&i.appendChild(document.createTextNode(a.slice(o,t)));let s=i.appendChild(document.createElement(`span`));s.appendChild(document.createTextNode(a.slice(t,n))),s.className=`cm-completionMatchedText`,o=n}return o<a.length&&i.appendChild(document.createTextNode(a.slice(o))),i},position:50},{render(e){if(!e.detail)return null;let t=document.createElement(`span`);return t.className=`cm-completionDetail`,t.textContent=e.detail,t},position:80}),t.sort((e,t)=>e.position-t.position).map(e=>e.render)}function KL(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 r=Math.floor((e-t)/n);return{from:e-(r+1)*n,to:e-r*n}}var qL=class{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 r=e.state.field(t),{options:i,selected:a}=r.open,o=e.state.facet(HL);this.optionContent=GL(o),this.optionClass=o.optionClass,this.tooltipClass=o.tooltipClass,this.range=KL(i.length,a,o.maxRenderedOptions),this.dom=document.createElement(`div`),this.dom.className=`cm-tooltip-autocomplete`,this.updateTooltipClass(e.state),this.dom.addEventListener(`mousedown`,n=>{let{options:r}=e.state.field(t).open;for(let t=n.target,i;t&&t!=this.dom;t=t.parentNode)if(t.nodeName==`LI`&&(i=/-(\d+)$/.exec(t.id))&&+i[1]<r.length){this.applyCompletion(e,r[+i[1]]),n.preventDefault();return}}),this.dom.addEventListener(`focusout`,t=>{let n=e.state.field(this.stateField,!1);n&&n.tooltip&&e.state.facet(HL).closeOnBlur&&t.relatedTarget!=e.contentDOM&&e.dispatch({effects:zL.of(null)})}),this.showOptions(i,r.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener(`scroll`,()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){let t=e.state.field(this.stateField),n=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),t!=n){let{options:r,selected:i,disabled:a}=t.open;(!n.open||n.open.options!=r)&&(this.range=KL(r.length,i,e.state.facet(HL).maxRenderedOptions),this.showOptions(r,t.id)),this.updateSel(),a!=n.open?.disabled&&this.dom.classList.toggle(`cm-tooltip-autocomplete-disabled`,!!a)}}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.from||t.selected>=this.range.to)&&(this.range=KL(t.options.length,t.selected,this.view.state.facet(HL).maxRenderedOptions),this.showOptions(t.options,e.id)),this.updateSelectedOption(t.selected)){this.destroyInfo();let{completion:n}=t.options[t.selected],{info:r}=n;if(!r)return;let i=typeof r==`string`?document.createTextNode(r):r(n);if(!i)return;`then`in i?i.then(t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t,n)}).catch(e=>Gw(this.view.state,e,`completion info`)):this.addInfoPane(i,n)}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement(`div`);if(n.className=`cm-tooltip cm-completionInfo`,e.nodeType!=null)n.appendChild(e),this.infoDestroy=null;else{let{dom:t,destroy:r}=e;n.appendChild(t),this.infoDestroy=r||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let n=this.list.firstChild,r=this.range.from;n;n=n.nextSibling,r++)n.nodeName!=`LI`||!n.id?r--:r==e?n.hasAttribute(`aria-selected`)||(n.setAttribute(`aria-selected`,`true`),t=n):n.hasAttribute(`aria-selected`)&&n.removeAttribute(`aria-selected`);return t&&YL(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(),r=e.getBoundingClientRect(),i=this.space;if(!i){let e=this.dom.ownerDocument.documentElement;i={left:0,top:0,right:e.clientWidth,bottom:e.clientHeight}}return r.top>Math.min(i.bottom,t.bottom)-10||r.bottom<Math.max(i.top,t.top)+10?null:this.view.state.facet(HL).positionInfo(this.view,t,r,n,i,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className=`cm-tooltip cm-completionInfo `+(e.class||``)):this.info.style.cssText=`top: -1e6px`)}createListBox(e,t,n){let r=document.createElement(`ul`);r.id=t,r.setAttribute(`role`,`listbox`),r.setAttribute(`aria-expanded`,`true`),r.setAttribute(`aria-label`,this.view.state.phrase(`Completions`)),r.addEventListener(`mousedown`,e=>{e.target==r&&e.preventDefault()});let i=null;for(let a=n.from;a<n.to;a++){let{completion:o,match:s}=e[a],{section:c}=o;if(c){let e=typeof c==`string`?c:c.name;if(e!=i&&(a>n.from||n.from==0))if(i=e,typeof c!=`string`&&c.header)r.appendChild(c.header(c));else{let t=r.appendChild(document.createElement(`completion-section`));t.textContent=e}}let l=r.appendChild(document.createElement(`li`));l.id=t+`-`+a,l.setAttribute(`role`,`option`);let u=this.optionClass(o);u&&(l.className=u);for(let e of this.optionContent){let t=e(o,this.view.state,this.view,s);t&&l.appendChild(t)}}return n.from&&r.classList.add(`cm-completionListIncompleteTop`),n.to<e.length&&r.classList.add(`cm-completionListIncompleteBottom`),r}destroyInfo(){this.info&&=(this.infoDestroy&&this.infoDestroy(),this.info.remove(),null)}destroy(){this.destroyInfo()}};function JL(e,t){return n=>new qL(n,e,t)}function YL(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=n.height/e.offsetHeight;r.top<n.top?e.scrollTop-=(n.top-r.top)/i:r.bottom>n.bottom&&(e.scrollTop+=(r.bottom-n.bottom)/i)}function XL(e){return(e.boost||0)*100+(e.apply?10:0)+(e.info?5:0)+ +!!e.type}function ZL(e,t){let n=[],r=null,i=e=>{n.push(e);let{section:t}=e.completion;if(t){r||=[];let e=typeof t==`string`?t:t.name;r.some(t=>t.name==e)||r.push(typeof t==`string`?{name:e}:t)}},a=t.facet(HL);for(let r of e)if(r.hasResult()){let e=r.result.getMatch;if(r.result.filter===!1)for(let t of r.result.options)i(new jL(t,r.source,e?e(t):[],1e9-n.length));else{let n=t.sliceDoc(r.from,r.to),o,s=a.filterStrict?new VL(n):new BL(n);for(let t of r.result.options)if(o=s.match(t.label)){let n=t.displayLabel?e?e(t,o.matched):[]:o.matched;i(new jL(t,r.source,n,o.score+(t.boost||0)))}}}if(r){let e=Object.create(null),t=0,i=(e,t)=>(e.rank??1e9)-(t.rank??1e9)||(e.name<t.name?-1:1);for(let n of r.sort(i))t-=1e5,e[n.name]=t;for(let t of n){let{section:n}=t.completion;n&&(t.score+=e[typeof n==`string`?n:n.name])}}let o=[],s=null,c=a.compareCompletions;for(let e of n.sort((e,t)=>t.score-e.score||c(e.completion,t.completion))){let t=e.completion;!s||s.label!=t.label||s.detail!=t.detail||s.type!=null&&t.type!=null&&s.type!=t.type||s.apply!=t.apply||s.boost!=t.boost?o.push(e):XL(e.completion)>XL(s)&&(o[o.length-1]=e),s=e.completion}return o}var QL=class e{constructor(e,t,n,r,i,a){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=r,this.selected=i,this.disabled=a}setSelected(t,n){return t==this.selected||t>=this.options.length?this:new e(this.options,rR(n,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,n,r,i,a,o){if(i&&!o&&t.some(e=>e.isPending))return i.setDisabled();let s=ZL(t,n);if(!s.length)return i&&t.some(e=>e.isPending)?i.setDisabled():null;let c=n.facet(HL).selectOnOpen?0:-1;if(i&&i.selected!=c&&i.selected!=-1){let e=i.options[i.selected].completion;for(let t=0;t<s.length;t++)if(s[t].completion==e){c=t;break}}return new e(s,rR(r,c),{pos:t.reduce((e,t)=>t.hasResult()?Math.min(e,t.from):e,1e8),create:pR,above:a.aboveCursor},i?i.timestamp:Date.now(),c,!1)}map(t){return new e(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:t.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}setDisabled(){return new e(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}},$L=class e{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new e(iR,`cm-ac-`+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:n}=t,r=n.facet(HL),i=(r.override||n.languageDataAt(`autocomplete`,ML(n)).map(LL)).map(e=>(this.active.find(t=>t.source==e)||new oR(e,+!!this.active.some(e=>e.state!=0))).update(t,r));i.length==this.active.length&&i.every((e,t)=>e==this.active[t])&&(i=this.active);let a=this.open,o=t.effects.some(e=>e.is(lR));a&&t.docChanged&&(a=a.map(t.changes)),t.selection||i.some(e=>e.hasResult()&&t.changes.touchesRange(e.from,e.to))||!eR(i,this.active)||o?a=QL.build(i,n,this.id,a,r,o):a&&a.disabled&&!i.some(e=>e.isPending)&&(a=null),!a&&i.every(e=>!e.isPending)&&i.some(e=>e.hasResult())&&(i=i.map(e=>e.hasResult()?new oR(e.source,0):e));for(let e of t.effects)e.is(uR)&&(a&&=a.setSelected(e.value,this.id));return i==this.active&&a==this.open?this:new e(i,this.id,a)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?tR:nR}};function eR(e,t){if(e==t)return!0;for(let n=0,r=0;;){for(;n<e.length&&!e[n].hasResult();)n++;for(;r<t.length&&!t[r].hasResult();)r++;let i=n==e.length,a=r==t.length;if(i||a)return i==a;if(e[n++].result!=t[r++].result)return!1}}var tR={"aria-autocomplete":`list`},nR={};function rR(e,t){let n={"aria-autocomplete":`list`,"aria-haspopup":`listbox`,"aria-controls":e};return t>-1&&(n[`aria-activedescendant`]=e+`-`+t),n}var iR=[];function aR(e,t){if(e.isUserEvent(`input.complete`)){let n=e.annotation(PL);if(n&&t.activateOnCompletion(n))return 12}let n=e.isUserEvent(`input.type`);return n&&t.activateOnTyping?5:n?1:e.isUserEvent(`delete.backward`)?2:e.selection?8:e.docChanged?16:0}var oR=class e{constructor(e,t,n=!1){this.source=e,this.state=t,this.explicit=n}hasResult(){return!1}get isPending(){return this.state==1}update(t,n){let r=aR(t,n),i=this;(r&8||r&16&&this.touches(t))&&(i=new e(i.source,0)),r&4&&i.state==0&&(i=new e(this.source,1)),i=i.updateFor(t,r);for(let n of t.effects)if(n.is(RL))i=new e(i.source,1,n.value);else if(n.is(zL))i=new e(i.source,0);else if(n.is(lR))for(let e of n.value)e.source==i.source&&(i=e);return i}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(ML(e.state))}},sR=class e extends oR{constructor(e,t,n,r,i,a){super(e,3,t),this.limit=n,this.result=r,this.from=i,this.to=a}hasResult(){return!0}updateFor(t,n){if(!(n&3))return this.map(t.changes);let r=this.result;r.map&&!t.changes.empty&&(r=r.map(r,t.changes));let i=t.changes.mapPos(this.from),a=t.changes.mapPos(this.to,1),o=ML(t.state);if(o>a||!r||n&2&&(ML(t.startState)==this.from||o<this.limit))return new oR(this.source,n&4?1:0);let s=t.changes.mapPos(this.limit);return cR(r.validFor,t.state,i,a)?new e(this.source,this.explicit,s,r,i,a):r.update&&(r=r.update(r,i,a,new DL(t.state,o,!1)))?new e(this.source,this.explicit,s,r,r.from,r.to??ML(t.state)):new oR(this.source,1,this.explicit)}map(t){return t.empty?this:(this.result.map?this.result.map(this.result,t):this.result)?new e(this.source,this.explicit,t.mapPos(this.limit),this.result,t.mapPos(this.from),t.mapPos(this.to,1)):new oR(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}};function cR(e,t,n,r){if(!e)return!1;let i=t.sliceDoc(n,r);return typeof e==`function`?e(i,n,r,t):NL(e,!0).test(i)}var lR=Wx.define({map(e,t){return e.map(e=>e.map(t))}}),uR=Wx.define(),dR=Cx.define({create(){return $L.start()},update(e,t){return e.update(t)},provide:e=>[YO.from(e,e=>e.tooltip),DD.contentAttributes.from(e,e=>e.attrs)]});function fR(e,t){let n=t.completion.apply||t.completion.label,r=e.state.field(dR).active.find(e=>e.source==t.source);return r instanceof sR?(typeof n==`string`?e.dispatch(Object.assign(Object.assign({},FL(e.state,n,r.from,r.to)),{annotations:PL.of(t.completion)})):n(e,t.completion,r.from,r.to),!0):!1}var pR=JL(dR,fR);function mR(e,t=`option`){return n=>{let r=n.state.field(dR,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<n.state.facet(HL).interactionDelay)return!1;let i=1,a;t==`page`&&(a=ik(n,r.open.tooltip))&&(i=Math.max(2,Math.floor(a.dom.offsetHeight/a.dom.querySelector(`li`).offsetHeight)-1));let{length:o}=r.open.options,s=r.open.selected>-1?r.open.selected+i*(e?1:-1):e?0:o-1;return s<0?s=t==`page`?0:o-1:s>=o&&(s=t==`page`?o-1:0),n.dispatch({effects:uR.of(s)}),!0}}var hR=e=>{let t=e.state.field(dR,!1);return e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(HL).interactionDelay?!1:fR(e,t.open.options[t.open.selected])},gR=e=>e.state.field(dR,!1)?(e.dispatch({effects:RL.of(!0)}),!0):!1,_R=e=>{let t=e.state.field(dR,!1);return!t||!t.active.some(e=>e.state!=0)?!1:(e.dispatch({effects:zL.of(null)}),!0)},vR=class{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}},yR=50,bR=1e3,xR=Yw.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of e.state.field(dR).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(dR),n=e.state.facet(HL);if(!e.selectionSet&&!e.docChanged&&e.startState.field(dR)==t)return;let r=e.transactions.some(e=>{let t=aR(e,n);return t&8||(e.selection||e.docChanged)&&!(t&3)});for(let t=0;t<this.running.length;t++){let n=this.running[t];if(r||n.context.abortOnDocChange&&e.docChanged||n.updates.length+e.transactions.length>yR&&Date.now()-n.time>bR){for(let e of n.context.abortListeners)try{e()}catch(e){Gw(this.view.state,e)}n.context.abortListeners=null,this.running.splice(t--,1)}else n.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(e=>e.effects.some(e=>e.is(RL)))&&(this.pendingStart=!0);let i=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(e=>e.isPending&&!this.running.some(t=>t.active.source==e.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let t of e.transactions)t.isUserEvent(`input.type`)?this.composing=2:this.composing==2&&t.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(dR);for(let e of t.active)e.isPending&&!this.running.some(t=>t.active.source==e.source)&&this.startQuery(e);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(HL).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=new DL(t,ML(t),e.explicit,this.view),r=new vR(e,n);this.running.push(r),Promise.resolve(e.source(n)).then(e=>{r.context.aborted||(r.done=e||null,this.scheduleAccept())},e=>{this.view.dispatch({effects:zL.of(null)}),Gw(this.view.state,e)})}scheduleAccept(){this.running.every(e=>e.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(HL).updateSyncTime))}accept(){this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(HL),n=this.view.state.field(dR);for(let r=0;r<this.running.length;r++){let i=this.running[r];if(i.done===void 0)continue;if(this.running.splice(r--,1),i.done){let n=ML(i.updates.length?i.updates[0].startState:this.view.state),r=Math.min(n,i.done.from+ +!i.active.explicit),a=new sR(i.active.source,i.active.explicit,r,i.done,i.done.from,i.done.to??n);for(let e of i.updates)a=a.update(e,t);if(a.hasResult()){e.push(a);continue}}let a=n.active.find(e=>e.source==i.active.source);if(a&&a.isPending)if(i.done==null){let n=new oR(i.active.source,0);for(let e of i.updates)n=n.update(e,t);n.isPending||e.push(n)}else this.startQuery(a)}(e.length||n.open&&n.open.disabled)&&this.view.dispatch({effects:lR.of(e)})}},{eventHandlers:{blur(e){let t=this.view.state.field(dR,!1);if(t&&t.tooltip&&this.view.state.facet(HL).closeOnBlur){let n=t.open&&ik(this.view,t.open.tooltip);(!n||!n.dom.contains(e.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:zL.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:RL.of(!1)}),20),this.composing=0}}}),SR=typeof navigator==`object`&&/Win/.test(navigator.platform),CR=Ex.highest(DD.domEventHandlers({keydown(e,t){let n=t.state.field(dR,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(SR&&e.altKey)||e.metaKey)return!1;let r=n.open.options[n.open.selected],i=n.active.find(e=>e.source==r.source),a=r.completion.commitCharacters||i.result.commitCharacters;return a&&a.indexOf(e.key)>-1&&fR(t,r),!1}})),wR=DD.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:`monospace`,whiteSpace:`nowrap`,overflow:`hidden auto`,maxWidth_fallback:`700px`,maxWidth:`min(700px, 95vw)`,minWidth:`250px`,maxHeight:`10em`,height:`100%`,listStyle:`none`,margin:0,padding:0,"& > li, & > completion-section":{padding:`1px 3px`,lineHeight:1.2},"& > li":{overflowX:`hidden`,textOverflow:`ellipsis`,cursor:`pointer`},"& > completion-section":{display:`list-item`,borderBottom:`1px solid silver`,paddingLeft:`0.5em`,opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:`#17c`,color:`white`},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:`#777`},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:`#347`,color:`white`},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:`#444`},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:`"···"`,opacity:.5,display:`block`,textAlign:`center`},".cm-tooltip.cm-completionInfo":{position:`absolute`,padding:`3px 9px`,width:`max-content`,maxWidth:`400px`,boxSizing:`border-box`,whiteSpace:`pre-line`},".cm-completionInfo.cm-completionInfo-left":{right:`100%`},".cm-completionInfo.cm-completionInfo-right":{left:`100%`},".cm-completionInfo.cm-completionInfo-left-narrow":{right:`30px`},".cm-completionInfo.cm-completionInfo-right-narrow":{left:`30px`},"&light .cm-snippetField":{backgroundColor:`#00000022`},"&dark .cm-snippetField":{backgroundColor:`#ffffff22`},".cm-snippetFieldPosition":{verticalAlign:`text-top`,width:0,height:`1.15em`,display:`inline-block`,margin:`0 -0.7px -.7em`,borderLeft:`1.4px dotted #888`},".cm-completionMatchedText":{textDecoration:`underline`},".cm-completionDetail":{marginLeft:`0.5em`,fontStyle:`italic`},".cm-completionIcon":{fontSize:`90%`,width:`.8em`,display:`inline-block`,textAlign:`center`,paddingRight:`.6em`,opacity:`0.6`,boxSizing:`content-box`},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:`'ƒ'`}},".cm-completionIcon-class":{"&:after":{content:`'○'`}},".cm-completionIcon-interface":{"&:after":{content:`'◌'`}},".cm-completionIcon-variable":{"&:after":{content:`'𝑥'`}},".cm-completionIcon-constant":{"&:after":{content:`'𝐶'`}},".cm-completionIcon-type":{"&:after":{content:`'𝑡'`}},".cm-completionIcon-enum":{"&:after":{content:`'∪'`}},".cm-completionIcon-property":{"&:after":{content:`'□'`}},".cm-completionIcon-keyword":{"&:after":{content:`'🔑︎'`}},".cm-completionIcon-namespace":{"&:after":{content:`'▢'`}},".cm-completionIcon-text":{"&:after":{content:`'abc'`,fontSize:`50%`,verticalAlign:`middle`}}}),TR={brackets:[`(`,`[`,`{`,`'`,`"`],before:`)]}:;>`,stringPrefixes:[]},ER=Wx.define({map(e,t){return t.mapPos(e,-1,ix.TrackAfter)??void 0}}),DR=new class extends sS{};DR.startSide=1,DR.endSide=-1;var OR=Cx.define({create(){return dS.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(ER)&&(e=e.update({add:[DR.range(n.value,n.value+1)]}));return e}});function kR(){return[PR,OR]}var AR=`()[]{}<>«»»«[]{}`;function jR(e){for(let t=0;t<16;t+=2)if(AR.charCodeAt(t)==e)return AR.charAt(t+1);return tx(e<128?e:e+1)}function MR(e,t){return e.languageDataAt(`closeBrackets`,t)[0]||TR}var NR=typeof navigator==`object`&&/Android\b/.test(navigator.userAgent),PR=DD.inputHandler.of((e,t,n,r)=>{if((NR?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let i=e.state.selection.main;if(r.length>2||r.length==2&&nx(ex(r,0))==1||t!=i.from||n!=i.to)return!1;let a=IR(e.state,r);return a?(e.dispatch(a),!0):!1}),FR=[{key:`Backspace`,run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=MR(e,e.selection.main.head).brackets||TR.brackets,r=null,i=e.changeByRange(t=>{if(t.empty){let r=zR(e.doc,t.head);for(let i of n)if(i==r&&RR(e.doc,t.head)==jR(ex(i,0)))return{changes:{from:t.head-i.length,to:t.head+i.length},range:L.cursor(t.head-i.length)}}return{range:r=t}});return r||t(e.update(i,{scrollIntoView:!0,userEvent:`delete.backward`})),!r}}];function IR(e,t){let n=MR(e,e.selection.main.head),r=n.brackets||TR.brackets;for(let i of r){let a=jR(ex(i,0));if(t==i)return a==i?HR(e,i,r.indexOf(i+i+i)>-1,n):BR(e,i,a,n.before||TR.before);if(t==a&&LR(e,e.selection.main.from))return VR(e,i,a)}return null}function LR(e,t){let n=!1;return e.field(OR).between(0,e.doc.length,e=>{e==t&&(n=!0)}),n}function RR(e,t){let n=e.sliceString(t,t+2);return n.slice(0,nx(ex(n,0)))}function zR(e,t){let n=e.sliceString(t-2,t);return nx(ex(n,0))==n.length?n:n.slice(1)}function BR(e,t,n,r){let i=null,a=e.changeByRange(a=>{if(!a.empty)return{changes:[{insert:t,from:a.from},{insert:n,from:a.to}],effects:ER.of(a.to+t.length),range:L.range(a.anchor+t.length,a.head+t.length)};let o=RR(e.doc,a.head);return!o||/\s/.test(o)||r.indexOf(o)>-1?{changes:{insert:t+n,from:a.head},effects:ER.of(a.head+t.length),range:L.cursor(a.head+t.length)}:{range:i=a}});return i?null:e.update(a,{scrollIntoView:!0,userEvent:`input.type`})}function VR(e,t,n){let r=null,i=e.changeByRange(t=>t.empty&&RR(e.doc,t.head)==n?{changes:{from:t.head,to:t.head+n.length,insert:n},range:L.cursor(t.head+n.length)}:r={range:t});return r?null:e.update(i,{scrollIntoView:!0,userEvent:`input.type`})}function HR(e,t,n,r){let i=r.stringPrefixes||TR.stringPrefixes,a=null,o=e.changeByRange(r=>{if(!r.empty)return{changes:[{insert:t,from:r.from},{insert:t,from:r.to}],effects:ER.of(r.to+t.length),range:L.range(r.anchor+t.length,r.head+t.length)};let o=r.head,s=RR(e.doc,o),c;if(s==t){if(UR(e,o))return{changes:{insert:t+t,from:o},effects:ER.of(o+t.length),range:L.cursor(o+t.length)};if(LR(e,o)){let r=n&&e.sliceDoc(o,o+t.length*3)==t+t+t?t+t+t:t;return{changes:{from:o,to:o+r.length,insert:r},range:L.cursor(o+r.length)}}}else if(n&&e.sliceDoc(o-2*t.length,o)==t+t&&(c=GR(e,o-2*t.length,i))>-1&&UR(e,c))return{changes:{insert:t+t+t+t,from:o},effects:ER.of(o+t.length),range:L.cursor(o+t.length)};else if(e.charCategorizer(o)(s)!=eS.Word&&GR(e,o,i)>-1&&!WR(e,o,t,i))return{changes:{insert:t+t,from:o},effects:ER.of(o+t.length),range:L.cursor(o+t.length)};return{range:a=r}});return a?null:e.update(o,{scrollIntoView:!0,userEvent:`input.type`})}function UR(e,t){let n=ej(e).resolveInner(t+1);return n.parent&&n.from==t}function WR(e,t,n,r){let i=ej(e).resolveInner(t,-1),a=r.reduce((e,t)=>Math.max(e,t.length),0);for(let o=0;o<5;o++){let o=e.sliceDoc(i.from,Math.min(i.to,i.from+n.length+a)),s=o.indexOf(n);if(!s||s>-1&&r.indexOf(o.slice(0,s))>-1){let t=i.firstChild;for(;t&&t.from==i.from&&t.to-t.from>n.length+s;){if(e.sliceDoc(t.to-n.length,t.to)==n)return!1;t=t.firstChild}return!0}let c=i.to==t&&i.parent;if(!c)break;i=c}return!1}function GR(e,t,n){let r=e.charCategorizer(t);if(r(e.sliceDoc(t-1,t))!=eS.Word)return t;for(let i of n){let n=t-i.length;if(e.sliceDoc(n,t)==i&&r(e.sliceDoc(n-1,n))!=eS.Word)return n}return-1}function KR(e={}){return[CR,dR,HL.of(e),xR,JR,wR]}var qR=[{key:`Ctrl-Space`,run:gR},{mac:"Alt-`",run:gR},{key:`Escape`,run:_R},{key:`ArrowDown`,run:mR(!0)},{key:`ArrowUp`,run:mR(!1)},{key:`PageDown`,run:mR(!0,`page`)},{key:`PageUp`,run:mR(!1,`page`)},{key:`Enter`,run:hR}],JR=Ex.highest(ID.computeN([HL],e=>e.facet(HL).defaultKeymap?[qR]:[]));function YR(e,t=e.state){let n=new Set;for(let{from:r,to:i}of e.visibleRanges){let e=r;for(;e<=i;){let r=t.doc.lineAt(e);n.has(r)||n.add(r),e=r.to+1}}return n}function XR(e){let t=e.selection.main.head;return e.doc.lineAt(t)}function ZR(e,t){let n=0;loop:for(let r=0;r<e.length;r++)switch(e[r]){case` `:case`\xA0`:n+=1;continue loop;case` `:n+=t-n%t;continue loop;case`\r`:continue loop;default:break loop}return n}var QR=gx.define({combine(e){return oS(e,{highlightActiveBlock:!0,hideFirstIndent:!1,markerType:`fullScope`,thickness:1})}}),$R=class{constructor(e,t,n,r){this.lines=e,this.state=t,this.map=new Map,this.unitWidth=n,this.markerType=r;for(let e of this.lines)this.add(e);this.state.facet(QR).highlightActiveBlock&&this.findAndSetActiveLines()}has(e){return this.map.has(typeof e==`number`?e:e.number)}get(e){let t=this.map.get(typeof e==`number`?e:e.number);if(!t)throw Error(`Line not found in indentation map`);return t}set(e,t,n){let r={line:e,col:t,level:n,empty:!e.text.trim().length};return this.map.set(r.line.number,r),r}add(e){if(this.has(e))return this.get(e);if(!e.length||!e.text.trim().length){if(e.number===1)return this.set(e,0,0);if(e.number===this.state.doc.lines){let t=this.closestNonEmpty(e,-1);return this.set(e,0,t.level)}let t=this.closestNonEmpty(e,-1),n=this.closestNonEmpty(e,1);return t.level>=n.level&&this.markerType!==`codeOnly`?this.set(e,0,t.level):t.empty&&t.level===0&&n.level!==0?this.set(e,0,0):n.level>t.level?this.set(e,0,t.level+1):this.set(e,0,n.level)}let t=ZR(e.text,this.state.tabSize),n=Math.floor(t/this.unitWidth);return this.set(e,t,n)}closestNonEmpty(e,t){let n=e.number+t;for(;t===-1?n>=1:n<=this.state.doc.lines;){if(this.has(n)){let e=this.get(n);if(!e.empty)return e}let e=this.state.doc.line(n);if(e.text.trim().length){let t=ZR(e.text,this.state.tabSize),n=Math.floor(t/this.unitWidth);return this.set(e,t,n)}n+=t}let r=this.state.doc.line(t===-1?1:this.state.doc.lines);return this.set(r,0,0)}findAndSetActiveLines(){let e=XR(this.state);if(!this.has(e))return;let t=this.get(e);if(this.has(t.line.number+1)){let e=this.get(t.line.number+1);e.level>t.level&&(t=e)}if(this.has(t.line.number-1)){let e=this.get(t.line.number-1);e.level>t.level&&(t=e)}if(t.level===0)return;t.active=t.level;let n,r;for(n=t.line.number;n>1;n--){if(!this.has(n-1))continue;let e=this.get(n-1);if(e.level<t.level)break;e.active=t.level}for(r=t.line.number;r<this.state.doc.lines;r++){if(!this.has(r+1))continue;let e=this.get(r+1);if(e.level<t.level)break;e.active=t.level}}};function ez(e){let t={light:`#F0F1F2`,dark:`#2B3245`,activeLight:`#E4E5E6`,activeDark:`#3C445C`},n=t;return e&&(n=Object.assign(Object.assign({},t),e)),DD.baseTheme({"&light":{"--indent-marker-bg-color":n.light,"--indent-marker-active-bg-color":n.activeLight},"&dark":{"--indent-marker-bg-color":n.dark,"--indent-marker-active-bg-color":n.activeDark},".cm-line":{position:`relative`},".cm-indent-markers::before":{content:`""`,position:`absolute`,top:0,left:`2px`,right:0,bottom:0,background:`var(--indent-markers)`,pointerEvents:`none`,zIndex:`-1`}})}function tz(e,t,n,r,i){return`${`repeating-linear-gradient(to right, var(${e}) 0 ${t}px, transparent ${t}px ${n}ch)`} ${r*n}.5ch/calc(${n*i}ch - 1px) no-repeat`}function nz(e,t,n,r,i){let{level:a,active:o}=e;if(i??=r,n&&a===0)return[];let s=+!!n,c=[];if(o!==void 0){let e=o-s-1;e>0&&c.push(tz(`--indent-marker-bg-color`,r,t,s,e)),c.push(tz(`--indent-marker-active-bg-color`,i,t,o-1,1)),o!==a&&c.push(tz(`--indent-marker-bg-color`,r,t,o,a-o))}else c.push(tz(`--indent-marker-bg-color`,r,t,s,a-s));return c.join(`,`)}var rz=class{constructor(e){this.view=e,this.unitWidth=mj(e.state),this.currentLineNumber=XR(e.state).number,this.generate(e.state)}update(e){let t=mj(e.state),n=t!==this.unitWidth;n&&(this.unitWidth=t);let r=XR(e.state).number,i=r!==this.currentLineNumber;this.currentLineNumber=r;let a=e.state.facet(QR).highlightActiveBlock&&i;(e.docChanged||e.viewportChanged||n||a)&&this.generate(e.state)}generate(e){let t=new pS,n=YR(this.view,e),{hideFirstIndent:r,markerType:i,thickness:a,activeThickness:o}=e.facet(QR),s=new $R(n,e,this.unitWidth,i);for(let e of n){let n=s.get(e.number);if(!n?.level)continue;let i=nz(n,this.unitWidth,r,a,o);t.add(e.from,e.from,JC.line({class:`cm-indent-markers`,attributes:{style:`--indent-markers: ${i}`}}))}this.decorations=t.finish()}};function iz(e={}){return[QR.of(e),ez(e.colors),Yw.fromClass(rz,{decorations:e=>e.decorations})]}var az,oz,sz,cz=[`mainAxis`,`crossAxis`,`fallbackPlacements`,`fallbackStrategy`,`fallbackAxisSideDirection`,`flipAlignment`],lz=[`mainAxis`,`crossAxis`,`limiter`];function uz(e,t){if(e==null)return{};var n,r,i=function(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function dz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function R(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?dz(Object(n),!0).forEach(function(t){yz(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dz(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function fz(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function pz(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){fz(a,r,i,o,s,`next`,e)}function s(e){fz(a,r,i,o,s,`throw`,e)}o(void 0)})}}function mz(e,t){gz(e,t),t.add(e)}function hz(e,t,n){gz(e,t),t.set(e,n)}function gz(e,t){if(t.has(e))throw TypeError(`Cannot initialize the same private elements twice on an object`)}function _z(e,t,n){return e.set(vz(e,t),n),n}function z(e,t){return e.get(vz(e,t))}function vz(e,t,n){if(typeof e==`function`?e===t:e.has(t))return arguments.length<3?t:n;throw TypeError(`Private element is not present on this object`)}function yz(e,t,n){return(t=function(e){var t=function(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}(e,`string`);return typeof t==`symbol`?t:t+``}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var bz,xz;typeof window<`u`&&((bz=(xz=window).__svelte??(xz.__svelte={})).v??(bz.v=new Set)).add(`5`);var Sz=!1;Sz=!0;var Cz=Symbol(),wz=`http://www.w3.org/1999/xhtml`,Tz=Array.isArray,Ez=Array.prototype.indexOf,Dz=Array.prototype.includes,Oz=Array.from,kz=Object.defineProperty,Az=Object.getOwnPropertyDescriptor,jz=Object.getOwnPropertyDescriptors,Mz=Object.prototype,Nz=Array.prototype,Pz=Object.getPrototypeOf,Fz=Object.isExtensible;function Iz(e){return typeof e==`function`}var Lz=()=>{};function Rz(e){return e()}function zz(e){for(var t=0;t<e.length;t++)e[t]()}function Bz(){var e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}var Vz=1<<24,Hz=16,Uz=32,Wz=64,Gz=512,Kz=1024,qz=2048,Jz=4096,Yz=8192,Xz=16384,Zz=32768,Qz=1<<25,$z=65536,eB=1<<17,tB=1<<19,nB=1<<25,rB=65536,iB=1<<21,aB=1<<23,oB=Symbol(`$state`),sB=Symbol(`legacy props`),cB=Symbol(``),lB=new class extends Error{constructor(){super(...arguments),yz(this,`name`,`StaleReactionError`),yz(this,`message`,"The reaction that called `getAbortSignal()` was re-run or destroyed")}},uB=!((az=globalThis.document)==null||!az.contentType)&&globalThis.document.contentType.includes(`xml`);function dB(e){throw Error(`https://svelte.dev/e/lifecycle_outside_component`)}function fB(e){return e===this.v}function pB(e,t){return e==e?e!==t||typeof e==`object`&&!!e||typeof e==`function`:t==t}function mB(e){return!pB(e,this.v)}var hB=null;function gB(e){hB=e}function _B(e){return xB().get(e)}function vB(e){hB={p:hB,i:!1,c:null,e:null,s:e,x:null,r:JH,l:Sz&&!(arguments.length>1&&arguments[1]!==void 0&&arguments[1])?{s:null,u:null,$:[]}:null}}function yB(e){var t=hB,n=t.e;if(n!==null)for(var r of(t.e=null,n))TH(r);return e!==void 0&&(t.x=e),t.i=!0,hB=t.p,e??{}}function bB(){return!Sz||hB!==null&&hB.l===null}function xB(e){var t;return hB===null&&dB(),(t=hB).c??(t.c=new Map(function(e){for(var t=e.p;t!==null;){var n=t.c;if(n!==null)return n;t=t.p}return null}(hB)||void 0))}var SB=[];function CB(){var e=SB;SB=[],zz(e)}function wB(e){if(SB.length===0&&!RB){var t=SB;queueMicrotask(()=>{t===SB&&CB()})}SB.push(e)}function TB(){for(;SB.length>0;)CB()}function EB(e){var t=JH;if(t===null)return GH.f|=aB,e;if((t.f&Zz)===0&&!(4&t.f))throw e;DB(e,t)}function DB(e,t){for(;t!==null;){if(128&t.f){if((t.f&Zz)===0)throw e;try{t.b.error(e);return}catch(t){e=t}}t=t.parent}throw e}var OB=-7169;function kB(e,t){e.f=e.f&OB|t}function AB(e){(e.f&Gz)!==0||e.deps===null?kB(e,Kz):kB(e,Jz)}function jB(e){if(e!==null)for(var t of e)2&t.f&&(t.f&rB)!==0&&(t.f^=rB,jB(t.deps))}function MB(e,t,n){(e.f&qz)===0?(e.f&Jz)!==0&&n.add(e):t.add(e),jB(e.deps),kB(e,Kz)}var NB=!1,PB=new Set,FB=null,IB=null,LB=null,RB=!1,zB=!1,BB=null,VB=null,HB=0,UB=1,WB=new WeakMap,GB=new WeakMap,KB=new WeakMap,qB=new WeakMap,JB=new WeakMap,YB=new WeakMap,XB=new WeakMap,ZB=new WeakMap,QB=new WeakMap,$B=new WeakMap,eV=new WeakMap,tV=new WeakMap,nV=new WeakSet,rV=class e{constructor(){mz(this,nV),yz(this,`id`,UB++),yz(this,`current`,new Map),yz(this,`previous`,new Map),hz(this,WB,new Set),hz(this,GB,new Set),hz(this,KB,new Map),hz(this,qB,new Map),hz(this,JB,null),hz(this,YB,[]),hz(this,XB,[]),hz(this,ZB,new Set),hz(this,QB,new Set),hz(this,$B,new Map),yz(this,`is_fork`,!1),hz(this,eV,!1),hz(this,tV,new Set)}skip_effect(e){z($B,this).has(e)||z($B,this).set(e,{d:[],m:[]})}unskip_effect(e){var t=z($B,this).get(e);if(t){for(var n of(z($B,this).delete(e),t.d))kB(n,qz),this.schedule(n);for(n of t.m)kB(n,Jz),this.schedule(n)}}capture(e,t){var n,r=arguments.length>2&&arguments[2]!==void 0&&arguments[2];(t===Cz||this.previous.has(e)||this.previous.set(e,t),(e.f&aB)===0)&&(this.current.set(e,[e.v,r]),(n=IB)==null||n.set(e,e.v))}activate(){FB=this}deactivate(){FB=null,IB=null}flush(){try{zB=!0,FB=this,vz(nV,this,oV).call(this)}finally{HB=0,LB=null,BB=null,VB=null,zB=!1,FB=null,IB=null,eH.clear()}}discard(){for(var e of z(GB,this))e(this);z(GB,this).clear(),PB.delete(this)}register_created_effect(e){z(XB,this).push(e)}increment(e,t){var n=z(KB,this).get(t)??0;if(z(KB,this).set(t,n+1),e){var r=z(qB,this).get(t)??0;z(qB,this).set(t,r+1)}}decrement(e,t,n){var r=z(KB,this).get(t)??0;if(r===1?z(KB,this).delete(t):z(KB,this).set(t,r-1),e){var i=z(qB,this).get(t)??0;i===1?z(qB,this).delete(t):z(qB,this).set(t,i-1)}z(eV,this)||n||(_z(eV,this,!0),wB(()=>{_z(eV,this,!1),this.flush()}))}transfer_effects(e,t){for(var n of e)z(ZB,this).add(n);for(var r of t)z(QB,this).add(r);e.clear(),t.clear()}oncommit(e){z(WB,this).add(e)}ondiscard(e){z(GB,this).add(e)}settled(){return(z(JB,this)??_z(JB,this,Bz())).promise}static ensure(){if(FB===null){var t=FB=new e;zB||(PB.add(FB),RB||wB(()=>{FB===t&&t.flush()}))}return FB}apply(){IB=null}schedule(e){var t;if(LB=e,(t=e.b)!=null&&t.is_pending&&16777228&e.f&&(e.f&Zz)===0)e.b.defer_effect(e);else{for(var n=e;n.parent!==null;){var r=(n=n.parent).f;if(!(BB===null||n!==JH||GH!==null&&2&GH.f))return;if(96&r){if((r&Kz)===0)return;n.f^=Kz}}z(YB,this).push(n)}}};function iV(){return this.is_fork||z(qB,this).size>0}function aV(){for(var e of z(tV,this))for(var t of z(qB,e).keys()){for(var n=!1,r=t;r.parent!==null;){if(z($B,this).has(r)){n=!0;break}r=r.parent}if(!n)return!0}return!1}function oV(){if(HB++>1e3&&(PB.delete(this),function(){try{(function(){throw Error(`https://svelte.dev/e/effect_update_depth_exceeded`)})()}catch(e){DB(e,LB)}}()),!vz(nV,this,iV).call(this)){for(var e of z(ZB,this))z(QB,this).delete(e),kB(e,qz),this.schedule(e);for(var t of z(QB,this))kB(t,Jz),this.schedule(t)}var n=z(YB,this);_z(YB,this,[]),this.apply();var r=BB=[],i=[],a=VB=[];for(var o of n)try{vz(nV,this,sV).call(this,o,r,i)}catch(e){throw _V(o),e}if(FB=null,a.length>0){var s=oz.ensure();for(var c of a)s.schedule(c)}if(BB=null,VB=null,vz(nV,this,iV).call(this)||vz(nV,this,aV).call(this))for(var[l,u]of(vz(nV,this,cV).call(this,i),vz(nV,this,cV).call(this,r),z($B,this)))gV(l,u);else{var d;for(var f of(z(KB,this).size===0&&PB.delete(this),z(ZB,this).clear(),z(QB,this).clear(),z(WB,this)))f(this);z(WB,this).clear(),fV(i),fV(r),(d=z(JB,this))==null||d.resolve()}var p,m=FB;if(z(YB,this).length>0){var h=m??=this;z(YB,h).push(...z(YB,this).filter(e=>!z(YB,h).includes(e)))}m!==null&&(PB.add(m),vz(nV,p=m,oV).call(p)),PB.has(this)||vz(nV,this,lV).call(this)}function sV(e,t,n){e.f^=Kz;for(var r=e.first;r!==null;){var i=r.f,a=!!(96&i);if(!(a&&(i&Kz)!==0||(i&Yz)!==0||z($B,this).has(r))&&r.fn!==null){a?r.f^=Kz:4&i?t.push(r):oU(r)&&((i&Hz)!==0&&z(QB,this).add(r),dU(r));var o=r.first;if(o!==null){r=o;continue}}for(;r!==null;){var s=r.next;if(s!==null){r=s;break}r=r.parent}}}function cV(e){for(var t=0;t<e.length;t+=1)MB(e[t],z(ZB,this),z(QB,this))}function lV(){for(var e of PB){var t=e.id<this.id,n=[];for(var[r,[i,a]]of this.current){if(e.current.has(r)){var o=e.current.get(r)[0];if(!t||i===o)continue;e.current.set(r,[i,a])}n.push(r)}var s=[...e.current.keys()].filter(e=>!this.current.has(e));if(s.length===0)t&&e.discard();else if(n.length>0){e.activate();var c=new Set,l=new Map;for(var u of n)pV(u,s,c,l);l=new Map;var d=[...e.current.keys()].filter(e=>!this.current.has(e)||this.current.get(e)[0]!==e);for(var f of z(XB,this))155648&f.f||!mV(f,d,l)||(4194320&f.f?(kB(f,qz),e.schedule(f)):z(ZB,e).add(f));if(z(YB,e).length>0){for(var p of(e.apply(),z(YB,e)))vz(nV,e,sV).call(e,p,[],[]);_z(YB,e,[])}e.deactivate()}}for(var m of PB)z(tV,m).has(this)&&(z(tV,m).delete(this),z(tV,m).size!==0||vz(nV,m,iV).call(m)||(m.activate(),vz(nV,m,oV).call(m)))}function uV(e){var t=RB;RB=!0;try{for(;;){if(TB(),FB===null)return;FB.flush()}}finally{RB=t}}oz=rV;var dV=null;function fV(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if(!(24576&r.f)&&oU(r)&&(dV=new Set,dU(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&IH(r),dV?.size>0)){for(var i of(eH.clear(),dV))if(!(24576&i.f)){for(var a=[i],o=i.parent;o!==null;)dV.has(o)&&(dV.delete(o),a.push(o)),o=o.parent;for(var s=a.length-1;s>=0;s--){var c=a[s];24576&c.f||dU(c)}}dV.clear()}}dV=null}}function pV(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(var i of e.reactions){var a=i.f;2&a?pV(i,t,n,r):4194320&a&&(a&qz)===0&&mV(i,t,r)&&(kB(i,qz),hV(i))}}function mV(e,t,n){var r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(var i of e.deps){if(Dz.call(t,i))return!0;if(2&i.f&&mV(i,t,n))return n.set(i,!0),!0}return n.set(e,!1),!1}function hV(e){FB.schedule(e)}function gV(e,t){if((e.f&Uz)===0||(e.f&Kz)===0){(e.f&qz)===0?(e.f&Jz)!==0&&t.m.push(e):t.d.push(e),kB(e,Kz);for(var n=e.first;n!==null;)gV(n,t),n=n.next}}function _V(e){kB(e,Kz);for(var t=e.first;t!==null;)_V(t),t=t.next}var vV=new WeakMap,yV=new WeakMap,bV=new WeakMap,xV=new WeakMap,SV=new WeakMap,CV=new WeakMap,wV=new WeakMap,TV=new WeakMap,EV=new WeakMap,DV=new WeakMap,OV=new WeakMap,kV=new WeakMap,AV=new WeakMap,jV=new WeakMap,MV=new WeakMap,NV=new WeakMap,PV=new WeakSet,FV=class{constructor(e,t,n,r){var i,a,o,s;mz(this,PV),yz(this,`parent`,void 0),yz(this,`is_pending`,!1),yz(this,`transform_error`,void 0),hz(this,vV,void 0),hz(this,yV,null),hz(this,bV,void 0),hz(this,xV,void 0),hz(this,SV,void 0),hz(this,CV,null),hz(this,wV,null),hz(this,TV,null),hz(this,EV,null),hz(this,DV,0),hz(this,OV,0),hz(this,kV,!1),hz(this,AV,new Set),hz(this,jV,new Set),hz(this,MV,null),hz(this,NV,(i=()=>(_z(MV,this,nH(z(DV,this))),()=>{_z(MV,this,null)}),o=0,s=nH(0),()=>{SH()&&(K(s),OH(()=>(o===0&&(a=q(()=>i(()=>sH(s)))),o+=1,()=>{wB(()=>{var e;--o==0&&((e=a)==null||e(),a=void 0,sH(s))})})))})),_z(vV,this,e),_z(bV,this,t),_z(xV,this,e=>{var t=JH;t.b=this,t.f|=128,n(e)}),this.parent=JH.b,this.transform_error=r??this.parent?.transform_error??(e=>e),_z(SV,this,kH(()=>{vz(PV,this,IV).call(this)},589824))}defer_effect(e){MB(e,z(AV,this),z(jV,this))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!z(bV,this).pending}update_pending_count(e,t){vz(PV,this,zV).call(this,e,t),_z(DV,this,z(DV,this)+e),z(MV,this)&&!z(kV,this)&&(_z(kV,this,!0),wB(()=>{_z(kV,this,!1),z(MV,this)&&aH(z(MV,this),z(DV,this))}))}get_effect_pending(){return z(NV,this).call(this),K(z(MV,this))}error(e){var t=z(bV,this).onerror,n=z(bV,this).failed;if(!t&&!n)throw e;z(CV,this)&&(PH(z(CV,this)),_z(CV,this,null)),z(wV,this)&&(PH(z(wV,this)),_z(wV,this,null)),z(TV,this)&&(PH(z(TV,this)),_z(TV,this,null));var r=!1,i=!1,a=()=>{r?console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`):(r=!0,i&&function(){throw Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`)}(),z(TV,this)!==null&&LH(z(TV,this),()=>{_z(TV,this,null)}),vz(PV,this,RV).call(this,()=>{vz(PV,this,IV).call(this)}))},o=e=>{try{i=!0,t?.(e,a),i=!1}catch(e){DB(e,z(SV,this)&&z(SV,this).parent)}n&&_z(TV,this,vz(PV,this,RV).call(this,()=>{try{return jH(()=>{var t=JH;t.b=this,t.f|=128,n(z(vV,this),()=>e,()=>a)})}catch(e){return DB(e,z(SV,this).parent),null}}))};wB(()=>{var t;try{t=this.transform_error(e)}catch(e){DB(e,z(SV,this)&&z(SV,this).parent);return}typeof t==`object`&&t&&typeof t.then==`function`?t.then(o,e=>DB(e,z(SV,this)&&z(SV,this).parent)):o(t)})}};function IV(){try{if(this.is_pending=this.has_pending_snippet(),_z(OV,this,0),_z(DV,this,0),_z(CV,this,jH(()=>{z(xV,this).call(this,z(vV,this))})),z(OV,this)>0){var e=_z(EV,this,document.createDocumentFragment());VH(z(CV,this),e);var t=z(bV,this).pending;_z(wV,this,jH(()=>t(z(vV,this))))}else vz(PV,this,LV).call(this,FB)}catch(e){this.error(e)}}function LV(e){this.is_pending=!1,e.transfer_effects(z(AV,this),z(jV,this))}function RV(e){var t=JH,n=GH,r=hB;YH(z(SV,this)),qH(z(SV,this)),gB(z(SV,this).ctx);try{return rV.ensure(),e()}catch(e){return EB(e),null}finally{YH(t),qH(n),gB(r)}}function zV(e,t){var n;this.has_pending_snippet()?(_z(OV,this,z(OV,this)+e),z(OV,this)===0&&(vz(PV,this,LV).call(this,t),z(wV,this)&&LH(z(wV,this),()=>{_z(wV,this,null)}),z(EV,this)&&(z(vV,this).before(z(EV,this)),_z(EV,this,null)))):this.parent&&vz(PV,n=this.parent,zV).call(n,e,t)}function BV(e,t,n,r){var i=bB()?UV:GV,a=e.filter(e=>!e.settled);if(n.length!==0||a.length!==0){var o,s,c,l,u=JH,d=(o=JH,s=GH,c=hB,l=FB,function(){var e=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];YH(o),qH(s),gB(c),e&&(o.f&Xz)===0&&(l?.activate(),l?.apply())}),f=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(e=>e.promise)):null;if(n.length!==0){var p=HV();f?f.then(()=>{d(),h(),VV()}):h()}else f.then(()=>m(t.map(i)))}else r(t.map(i));function m(e){d();try{r(e)}catch(e){(u.f&Xz)===0&&DB(e,u)}VV()}function h(){Promise.all(n.map(e=>function(e){var t=JH;t===null&&function(){throw Error(`https://svelte.dev/e/async_derived_orphan`)}();var n=void 0,r=nH(Cz),i=!GH,a=new Map;return function(e){xH(4718592,e)}(()=>{var o=JH,s=Bz();n=s.promise;try{Promise.resolve(e()).then(s.resolve,s.reject).finally(VV)}catch(e){s.reject(e),VV()}var c=FB;if(i){if((o.f&Zz)!==0)var l=HV();if(t.b.is_rendered()){var u;(u=a.get(c))==null||u.reject(lB),a.delete(c)}else{for(var d of a.values())d.reject(lB);a.clear()}a.set(c,s)}var f=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0;if(l&&l(t===lB),t!==lB&&(o.f&Xz)===0){if(c.activate(),t)r.f|=aB,aH(r,t);else for(var[n,i]of((r.f&aB)!==0&&(r.f^=aB),aH(r,e),a)){if(a.delete(n),n===c)break;i.reject(lB)}c.deactivate()}};s.promise.then(f,e=>f(null,e||`unknown`))}),CH(()=>{for(var e of a.values())e.reject(lB)}),new Promise(e=>{function t(i){function a(){i===n?e(r):t(n)}i.then(a,a)}t(n)})}(e))).then(e=>m([...t.map(i),...e])).catch(e=>DB(e,u)).finally(()=>p())}}function VV(){var e,t=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];YH(null),qH(null),gB(null),t&&((e=FB)==null||e.deactivate())}function HV(){var e=JH,t=e.b,n=FB,r=t.is_rendered();return t.update_pending_count(1,n),n.increment(r,e),function(){var i=arguments.length>0&&arguments[0]!==void 0&&arguments[0];t.update_pending_count(-1,n),n.decrement(r,e,i)}}function UV(e){var t=GH!==null&&2&GH.f?GH:null;return JH!==null&&(JH.f|=tB),{ctx:hB,deps:null,effects:null,equals:fB,f:2050,fn:e,reactions:null,rv:0,v:Cz,wv:0,parent:t??JH,ac:null}}function WV(e){var t=UV(e);return ZH(t),t}function GV(e){var t=UV(e);return t.equals=mB,t}function KV(e){var t,n=JH;YH(function(e){for(var t=e.parent;t!==null;){if(!(2&t.f))return(t.f&Xz)===0?t:null;t=t.parent}return null}(e));try{e.f&=-65537,function(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)PH(t[n])}}(e),t=cU(e)}finally{YH(n)}return t}function qV(e){var t,n,r,i=e.v,a=KV(e);if(!e.equals(a)&&(e.wv=aU(),!((t=FB)!=null&&t.is_fork&&e.deps!==null||(e.v=a,(n=FB)==null||n.capture(e,i,!0),e.deps!==null))))return void kB(e,Kz);UH||(IB===null?AB(e):(SH()||(r=FB)!=null&&r.is_fork)&&IB.set(e,a))}function JV(e){if(e.effects!==null)for(var t of e.effects)t.teardown&&dU(t)}var YV,XV,ZV,QV,$V=new Set,eH=new Map,tH=!1;function nH(e,t){return{f:0,v:e,reactions:null,equals:fB,rv:0,wv:0}}function rH(e,t){var n=nH(e);return ZH(n),n}function B(e){var t,n=arguments.length>1&&arguments[1]!==void 0&&arguments[1],r=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],i=nH(e);return(n||(i.equals=mB),Sz&&r&&hB!==null&&hB.l!==null)&&((t=hB.l).s??(t.s=[])).push(i),i}function iH(e,t){return V(e,q(()=>K(e))),t}function V(e,t){var n=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return GH===null||KH&&(GH.f&eB)===0||!bB()||!(4325394&GH.f)||XH!==null&&Dz.call(XH,e)||function(){throw Error(`https://svelte.dev/e/state_unsafe_mutation`)}(),aH(e,n?lH(t):t,VB)}function aH(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(!e.equals(t)){var r=e.v;UH?eH.set(e,t):eH.set(e,r),e.v=t;var i=rV.ensure();if(i.capture(e,r),2&e.f){var a=e;(e.f&qz)!==0&&KV(a),IB===null&&AB(a)}e.wv=aU(),cH(e,qz,n),!bB()||JH===null||(JH.f&Kz)===0||96&JH.f||(eU===null?function(e){eU=e}([e]):eU.push(e)),!i.is_fork&&$V.size>0&&!tH&&function(){for(var e of(tH=!1,$V))(e.f&Kz)!==0&&kB(e,Jz),oU(e)&&dU(e);$V.clear()}()}return t}function oH(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,n=K(e),r=t===1?n++:n--;return V(e,n),r}function sH(e){V(e,e.v+1)}function cH(e,t,n){var r=e.reactions;if(r!==null)for(var i=bB(),a=r.length,o=0;o<a;o++){var s=r[o],c=s.f;if(i||s!==JH){var l=(c&qz)===0;if(l&&kB(s,t),2&c){var u,d=s;(u=IB)==null||u.delete(d),(c&rB)===0&&(c&Gz&&(s.f|=rB),cH(d,Jz,n))}else if(l){var f=s;(c&Hz)!==0&&dV!==null&&dV.add(f),n===null?hV(f):n.push(f)}}}}function lH(e){if(typeof e!=`object`||!e||oB in e)return e;var t=Pz(e);if(t!==Mz&&t!==Nz)return e;var n=new Map,r=Tz(e),i=rH(0),a=rU,o=e=>{if(rU===a)return e();var t=GH,n=rU;qH(null),iU(a);var r=e();return qH(t),iU(n),r};return r&&n.set(`length`,rH(e.length)),new Proxy(e,{defineProperty(e,t,r){`value`in r&&!1!==r.configurable&&!1!==r.enumerable&&!1!==r.writable||function(){throw Error(`https://svelte.dev/e/state_descriptors_fixed`)}();var i=n.get(t);return i===void 0?o(()=>{var e=rH(r.value);return n.set(t,e),e}):V(i,r.value,!0),!0},deleteProperty(e,t){var r=n.get(t);if(r===void 0){if(t in e){var a=o(()=>rH(Cz));n.set(t,a),sH(i)}}else V(r,Cz),sH(i);return!0},get(t,r,i){var a;if(r===oB)return e;var s=n.get(r),c=r in t;if(s===void 0&&(!c||(a=Az(t,r))!=null&&a.writable)&&(s=o(()=>rH(lH(c?t[r]:Cz))),n.set(r,s)),s!==void 0){var l=K(s);return l===Cz?void 0:l}return Reflect.get(t,r,i)},getOwnPropertyDescriptor(e,t){var r=Reflect.getOwnPropertyDescriptor(e,t);if(r&&`value`in r){var i=n.get(t);i&&(r.value=K(i))}else if(r===void 0){var a=n.get(t),o=a?.v;if(a!==void 0&&o!==Cz)return{enumerable:!0,configurable:!0,value:o,writable:!0}}return r},has(e,t){var r;if(t===oB)return!0;var i=n.get(t),a=i!==void 0&&i.v!==Cz||Reflect.has(e,t);return(i!==void 0||JH!==null&&(!a||(r=Az(e,t))!=null&&r.writable))&&(i===void 0&&(i=o(()=>rH(a?lH(e[t]):Cz)),n.set(t,i)),K(i)===Cz)?!1:a},set(e,t,a,s){var c,l=n.get(t),u=t in e;if(r&&t===`length`)for(var d=a;d<l.v;d+=1){var f=n.get(d+``);f===void 0?d in e&&(f=o(()=>rH(Cz)),n.set(d+``,f)):V(f,Cz)}l===void 0?(!u||(c=Az(e,t))!=null&&c.writable)&&(V(l=o(()=>rH(void 0)),lH(a)),n.set(t,l)):(u=l.v!==Cz,V(l,o(()=>lH(a))));var p=Reflect.getOwnPropertyDescriptor(e,t);if(p!=null&&p.set&&p.set.call(s,a),!u){if(r&&typeof t==`string`){var m=n.get(`length`),h=Number(t);Number.isInteger(h)&&h>=m.v&&V(m,h+1)}sH(i)}return!0},ownKeys(e){K(i);var t=Reflect.ownKeys(e).filter(e=>{var t=n.get(e);return t===void 0||t.v!==Cz});for(var[r,a]of n)a.v===Cz||r in e||t.push(r);return t},setPrototypeOf(){(function(){throw Error(`https://svelte.dev/e/state_prototype_fixed`)})()}})}function uH(e){try{if(typeof e==`object`&&e&&oB in e)return e[oB]}catch{}return e}function dH(e,t){return Object.is(uH(e),uH(t))}function fH(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:``;return document.createTextNode(e)}function pH(e){return ZV.call(e)}function mH(e){return QV.call(e)}function H(e,t){return pH(e)}function hH(e){var t=pH(e);return t instanceof Comment&&t.data===``?mH(t):t}function U(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,n=e;t--;)n=mH(n);return n}function gH(e,t,n){return document.createElementNS(t??wz,e,void 0)}var _H=!1;function vH(e){var t=GH,n=JH;qH(null),YH(null);try{return e()}finally{qH(t),YH(n)}}function yH(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:n;e.addEventListener(t,()=>vH(n));var i=e.__on_r;e.__on_r=i?()=>{i(),r(!0)}:()=>r(!0),_H||(_H=!0,document.addEventListener(`reset`,e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(var t of e.target.elements){var n;(n=t.__on_r)==null||n.call(t)}})},{capture:!0}))}function bH(e){JH===null&&(GH===null&&function(){throw Error(`https://svelte.dev/e/effect_orphan`)}(),function(){throw Error(`https://svelte.dev/e/effect_in_unowned_derived`)}()),UH&&function(){throw Error(`https://svelte.dev/e/effect_in_teardown`)}()}function xH(e,t){var n,r=JH;r!==null&&(r.f&Yz)!==0&&(e|=Yz);var i={ctx:hB,deps:null,nodes:null,f:e|qz|Gz,first:null,fn:t,last:null,next:null,parent:r,b:r&&r.b,prev:null,teardown:null,wv:0,ac:null};(n=FB)==null||n.register_created_effect(i);var a=i;if(4&e)BB===null?rV.ensure().schedule(i):BB.push(i);else if(t!==null){try{dU(i)}catch(e){throw PH(i),e}a.deps===null&&a.teardown===null&&a.nodes===null&&a.first===a.last&&(a.f&tB)===0&&(a=a.first,(e&Hz)!==0&&(e&$z)!==0&&a!==null&&(a.f|=$z))}if(a!==null&&(a.parent=r,r!==null&&function(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}(a,r),GH!==null&&2&GH.f&&(e&Wz)===0)){var o=GH;(o.effects??=[]).push(a)}return i}function SH(){return GH!==null&&!KH}function CH(e){var t=xH(8,null);return kB(t,Kz),t.teardown=e,t}function wH(e){bH();var t=JH.f;if(!(!GH&&(t&Uz)!==0&&(t&Zz)===0))return TH(e);var n=hB;(n.e??=[]).push(e)}function TH(e){return xH(1048580,e)}function EH(e){return xH(4,e)}function W(e,t){var n={effect:null,ran:!1,deps:e};hB.l.$.push(n),n.effect=OH(()=>{if(e(),!n.ran){n.ran=!0;var r=JH;try{YH(r.parent),q(t)}finally{YH(r)}}})}function DH(){var e=hB;OH(()=>{for(var t of e.l.$){t.deps();var n=t.effect;(n.f&Kz)!==0&&n.deps!==null&&kB(n,Jz),oU(n)&&dU(n),t.ran=!1}})}function OH(e){return xH(8|(arguments.length>1&&arguments[1]!==void 0?arguments[1]:0),e)}function G(e){BV(arguments.length>3&&arguments[3]!==void 0?arguments[3]:[],arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],t=>{xH(8,()=>e(...t.map(K)))})}function kH(e){return xH(Hz|(arguments.length>1&&arguments[1]!==void 0?arguments[1]:0),e)}function AH(e){return xH(Vz|(arguments.length>1&&arguments[1]!==void 0?arguments[1]:0),e)}function jH(e){return xH(524320,e)}function MH(e){var t=e.teardown;if(t!==null){var n=UH,r=GH;WH(!0),qH(null);try{t.call(null)}finally{WH(n),qH(r)}}}function NH(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=e.first;e.first=e.last=null;for(var r,i=function(){var e=n.ac;e!==null&&vH(()=>{e.abort(lB)}),r=n.next,(n.f&Wz)===0?PH(n,t):n.parent=null,n=r};n!==null;)i()}function PH(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],n=!1;(t||262144&e.f)&&e.nodes!==null&&e.nodes.end!==null&&(FH(e.nodes.start,e.nodes.end),n=!0),kB(e,Qz),NH(e,t&&!n),uU(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(var i of r)i.stop();MH(e),e.f^=Qz,e.f|=Xz;var a=e.parent;a!==null&&a.first!==null&&IH(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function FH(e,t){for(;e!==null;){var n=e===t?null:mH(e);e.remove(),e=n}}function IH(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function LH(e,t){var n=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],r=[];RH(e,r,!0);var i=()=>{n&&PH(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||i();for(var s of r)s.out(o)}else i()}function RH(e,t,n){if((e.f&Yz)===0){e.f^=Yz;var r=e.nodes&&e.nodes.t;if(r!==null)for(var i of r)(i.is_global||n)&&t.push(i);for(var a=e.first;a!==null;){var o=a.next;RH(a,t,((a.f&$z)!==0||(a.f&Uz)!==0&&(e.f&Hz)!==0)&&n),a=o}}}function zH(e){BH(e,!0)}function BH(e,t){if((e.f&Yz)!==0){e.f^=Yz,(e.f&Kz)===0&&(kB(e,qz),rV.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next;BH(n,((n.f&$z)!==0||(n.f&Uz)!==0)&&t),n=r}var i=e.nodes&&e.nodes.t;if(i!==null)for(var a of i)(a.is_global||t)&&a.in()}}function VH(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:mH(n);t.append(n),n=i}}var HH=!1,UH=!1;function WH(e){UH=e}var GH=null,KH=!1;function qH(e){GH=e}var JH=null;function YH(e){JH=e}var XH=null;function ZH(e){GH!==null&&(XH===null?XH=[e]:XH.push(e))}var QH=null,$H=0,eU=null,tU=1,nU=0,rU=nU;function iU(e){rU=e}function aU(){return++tU}function oU(e){var t=e.f;if((t&qz)!==0)return!0;if(2&t&&(e.f&=-65537),(t&Jz)!==0){for(var n=e.deps,r=n.length,i=0;i<r;i++){var a=n[i];if(oU(a)&&qV(a),a.wv>e.wv)return!0}(t&Gz)!==0&&IB===null&&kB(e,Kz)}return!1}function sU(e,t){var n=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],r=e.reactions;if(r!==null&&(XH===null||!Dz.call(XH,e)))for(var i=0;i<r.length;i++){var a=r[i];2&a.f?sU(a,t,!1):t===a&&(n?kB(a,qz):(a.f&Kz)!==0&&kB(a,Jz),hV(a))}}function cU(e){var t=QH,n=$H,r=eU,i=GH,a=XH,o=hB,s=KH,c=rU,l=e.f;QH=null,$H=0,eU=null,GH=96&l?null:e,XH=null,gB(e.ctx),KH=!1,rU=++nU,e.ac!==null&&(vH(()=>{e.ac.abort(lB)}),e.ac=null);try{e.f|=iB;var u=(0,e.fn)();e.f|=Zz;var d=e.deps,f=FB?.is_fork;if(QH!==null){var p;if(f||uU(e,$H),d!==null&&$H>0)for(d.length=$H+QH.length,p=0;p<QH.length;p++)d[$H+p]=QH[p];else e.deps=d=QH;if(SH()&&(e.f&Gz)!==0)for(p=$H;p<d.length;p++){var m;((m=d[p]).reactions??(m.reactions=[])).push(e)}}else !f&&d!==null&&$H<d.length&&(uU(e,$H),d.length=$H);if(bB()&&eU!==null&&!KH&&d!==null&&!(6146&e.f))for(p=0;p<eU.length;p++)sU(eU[p],e);if(i!==null&&i!==e){if(nU++,i.deps!==null)for(var h=0;h<n;h+=1)i.deps[h].rv=nU;if(t!==null)for(var g of t)g.rv=nU;eU!==null&&(r===null?r=eU:r.push(...eU))}return(e.f&aB)!==0&&(e.f^=aB),u}catch(e){return EB(e)}finally{e.f^=iB,QH=t,$H=n,eU=r,GH=i,XH=a,gB(o),KH=s,rU=c}}function lU(e,t){var n=t.reactions;if(n!==null){var r=Ez.call(n,e);if(r!==-1){var i=n.length-1;i===0?n=t.reactions=null:(n[r]=n[i],n.pop())}}if(n===null&&2&t.f&&(QH===null||!Dz.call(QH,t))){var a=t;(a.f&Gz)!==0&&(a.f^=Gz,a.f&=-65537),AB(a),function(e){if(e.effects!==null)for(var t of e.effects){var n,r;(t.teardown||t.ac)&&((n=t.teardown)==null||n.call(t),(r=t.ac)==null||r.abort(lB),t.teardown=Lz,t.ac=null,uU(t,0),NH(t))}}(a),uU(a,0)}}function uU(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)lU(e,n[r])}function dU(e){var t=e.f;if((t&Xz)===0){kB(e,Kz);var n=JH,r=HH;JH=e,HH=!0;try{16777232&t?function(e){for(var t=e.first;t!==null;){var n=t.next;(t.f&Uz)===0&&PH(t),t=n}}(e):NH(e),MH(e);var i=cU(e);e.teardown=typeof i==`function`?i:null,e.wv=tU}finally{HH=r,JH=n}}}function fU(){return pU.apply(this,arguments)}function pU(){return(pU=pz(function*(){yield Promise.resolve(),uV()})).apply(this,arguments)}function K(e){var t,n=!!(2&e.f);if(GH!==null&&!KH&&!(JH!==null&&(JH.f&Xz)!==0||XH!==null&&Dz.call(XH,e))){var r=GH.deps;if((GH.f&iB)!==0)e.rv<nU&&(e.rv=nU,QH===null&&r!==null&&r[$H]===e?$H++:QH===null?QH=[e]:QH.push(e));else{var i;((i=GH).deps??(i.deps=[])).push(e);var a=e.reactions;a===null?e.reactions=[GH]:Dz.call(a,GH)||a.push(GH)}}if(UH&&eH.has(e))return eH.get(e);if(n){var o=e;if(UH){var s=o.v;return((o.f&Kz)===0&&o.reactions!==null||hU(o))&&(s=KV(o)),eH.set(o,s),s}var c=(o.f&Gz)===0&&!KH&&GH!==null&&(HH||(GH.f&Gz)!==0),l=(o.f&Zz)===0;oU(o)&&(c&&(o.f|=Gz),qV(o)),c&&!l&&(JV(o),mU(o))}if((t=IB)!=null&&t.has(e))return IB.get(e);if((e.f&aB)!==0)throw e.v;return e.v}function mU(e){if(e.f|=Gz,e.deps!==null)for(var t of e.deps)(t.reactions??=[]).push(e),2&t.f&&(t.f&Gz)===0&&(JV(t),mU(t))}function hU(e){if(e.v===Cz)return!0;if(e.deps===null)return!1;for(var t of e.deps)if(eH.has(t)||2&t.f&&hU(t))return!0;return!1}function q(e){var t=KH;try{return KH=!0,e()}finally{KH=t}}function J(e){if(typeof e==`object`&&e&&!(e instanceof EventTarget)){if(oB in e)gU(e);else if(!Array.isArray(e))for(var t in e){var n=e[t];typeof n==`object`&&n&&oB in n&&gU(n)}}}function gU(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new Set;if(!(typeof e!=`object`||!e||e instanceof EventTarget||t.has(e))){for(var n in t.add(e),e instanceof Date&&e.getTime(),e)try{gU(e[n],t)}catch{}var r=Pz(e);if(r!==Object.prototype&&r!==Array.prototype&&r!==Map.prototype&&r!==Set.prototype&&r!==Date.prototype){var i=jz(r);for(var a in i){var o=i[a].get;if(o)try{o.call(e)}catch{}}}}}var _U=Symbol(`events`),vU=new Set,yU=new Set;function bU(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};function i(e){if(r.capture||CU.call(t,e),!e.cancelBubble)return vH(()=>n?.call(this,e))}return e.startsWith(`pointer`)||e.startsWith(`touch`)||e===`wheel`?wB(()=>{t.addEventListener(e,i,r)}):t.addEventListener(e,i,r),i}function Y(e,t,n,r,i){var a={capture:r,passive:i},o=bU(e,t,n,a);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&CH(()=>{t.removeEventListener(e,o,a)})}function xU(e,t,n){(t[_U]??(t[_U]={}))[e]=n}function SU(e){for(var t=0;t<e.length;t++)vU.add(e[t]);for(var n of yU)n(e)}function CU(e){var t=this,n=t.ownerDocument,r=e.type,i=e.composedPath?.call(e)||[],a=i[0]||e.target,o=0,s=e===e&&e[_U];if(s){var c=i.indexOf(s);if(c!==-1&&(t===document||t===window))return void(e[_U]=t);var l=i.indexOf(t);if(l===-1)return;c<=l&&(o=c)}if((a=i[o]||e.target)!==t){kz(e,`currentTarget`,{configurable:!0,get:()=>a||n});var u=GH,d=JH;qH(null),YH(null);try{for(var f,p=[];a!==null;){var m=a.assignedSlot||a.parentNode||a.host||null;try{var h=a[_U]?.[r];h==null||a.disabled&&e.target!==a||h.call(a,e)}catch(e){f?p.push(e):f=e}if(e.cancelBubble||m===t||m===null)break;a=m}if(f){var g=function(e){queueMicrotask(()=>{throw e})};for(var _ of p)g(_);throw f}}finally{e[_U]=t,delete e.currentTarget,qH(u),YH(d)}}}var wU=(globalThis==null||(sz=globalThis.window)==null?void 0:sz.trustedTypes)&&globalThis.window.trustedTypes.createPolicy(`svelte-trusted-html`,{createHTML:e=>e});function TU(e){var t=gH(`template`);return t.innerHTML=function(e){return wU?.createHTML(e)??e}(e.replaceAll(`<!>`,`<!---->`)),t.content}function EU(e,t){var n=JH;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function X(e,t){var n,r=!!(1&t),i=!!(2&t),a=!e.startsWith(`<!>`);return()=>{n===void 0&&(n=TU(a?e:`<!>`+e),r||(n=pH(n)));var t=i||XV?document.importNode(n,!0):n.cloneNode(!0);return r?EU(pH(t),t.lastChild):EU(t,t),t}}function DU(e,t){return function(e,t){var n,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:`svg`,i=!e.startsWith(`<!>`),a=!!(1&t),o=`<${r}>${i?e:`<!>`+e}</${r}>`;return()=>{if(!n){var e=pH(TU(o));if(a)for(n=document.createDocumentFragment();pH(e);)n.appendChild(pH(e));else n=pH(e)}var t=n.cloneNode(!0);return a?EU(pH(t),t.lastChild):EU(t,t),t}}(e,t,`svg`)}function OU(){var e=fH((arguments.length>0&&arguments[0]!==void 0?arguments[0]:``)+``);return EU(e,e),e}function kU(){var e=document.createDocumentFragment(),t=document.createComment(``),n=fH();return e.append(t,n),EU(t,n),e}function Z(e,t){e!==null&&e.before(t)}var AU=[`beforeinput`,`click`,`change`,`dblclick`,`contextmenu`,`focusin`,`focusout`,`input`,`keydown`,`keyup`,`mousedown`,`mousemove`,`mouseout`,`mouseover`,`mouseup`,`pointerdown`,`pointermove`,`pointerout`,`pointerover`,`pointerup`,`touchend`,`touchmove`,`touchstart`],jU={formnovalidate:`formNoValidate`,ismap:`isMap`,nomodule:`noModule`,playsinline:`playsInline`,readonly:`readOnly`,defaultvalue:`defaultValue`,defaultchecked:`defaultChecked`,srcobject:`srcObject`,novalidate:`noValidate`,allowfullscreen:`allowFullscreen`,disablepictureinpicture:`disablePictureInPicture`,disableremoteplayback:`disableRemotePlayback`},MU=[`touchstart`,`touchmove`];function NU(e){return MU.includes(e)}function PU(e,t){var n=t==null?``:typeof t==`object`?`${t}`:t;n!==(e.__t??=e.nodeValue)&&(e.__t=n,e.nodeValue=`${n}`)}function FU(e,t){return function(e,t){var{target:n,anchor:r,props:i={},events:a,context:o,intro:s=!0,transformError:c}=t;(function(){if(YV===void 0){YV=window,XV=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;ZV=Az(t,`firstChild`).get,QV=Az(t,`nextSibling`).get,Fz(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),Fz(n)&&(n.__t=void 0)}})();var l=void 0,u=function(e){rV.ensure();var t=xH(524352,e);return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new Promise(n=>{e.outro?LH(t,()=>{PH(t),n(void 0)}):(PH(t),n(void 0))})}}(()=>{var t=r??n.appendChild(fH());(function(e,t,n,r){new FV(e,t,n,r)})(t,{pending:()=>{}},t=>{vB({}),o&&(hB.c=o),a&&(i.$$events=a),l=e(t,i)||{},yB()},c);var s=new Set,u=e=>{for(var t=0;t<e.length;t++){var r=e[t];if(!s.has(r)){s.add(r);var i=NU(r);for(var a of[n,document]){var o=IU.get(a);o===void 0&&(o=new Map,IU.set(a,o));var c=o.get(r);c===void 0?(a.addEventListener(r,CU,{passive:i}),o.set(r,1)):o.set(r,c+1)}}}};return u(Oz(vU)),yU.add(u),()=>{for(var e of s)for(var i of[n,document]){var a=IU.get(i),o=a.get(e);--o==0?(i.removeEventListener(e,CU),a.delete(e),a.size===0&&IU.delete(i)):a.set(e,o)}var c;(yU.delete(u),t!==r)&&((c=t.parentNode)==null||c.removeChild(t))}});return LU.set(l,u),l}(e,t)}var IU=new Map,LU=new WeakMap,RU=new WeakMap,zU=new WeakMap,BU=new WeakMap,VU=new WeakMap,HU=new WeakMap,UU=new WeakMap,WU=new WeakMap,GU=class{constructor(e){var t=this,n=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];yz(this,`anchor`,void 0),hz(this,RU,new Map),hz(this,zU,new Map),hz(this,BU,new Map),hz(this,VU,new Set),hz(this,HU,!0),hz(this,UU,e=>{if(z(RU,this).has(e)){var n=z(RU,this).get(e),r=z(zU,this).get(n);if(r)zH(r),z(VU,this).delete(n);else{var i=z(BU,this).get(n);i&&(z(zU,this).set(n,i.effect),z(BU,this).delete(n),i.fragment.lastChild.remove(),this.anchor.before(i.fragment),r=i.effect)}for(var[a,o]of z(RU,this)){if(z(RU,this).delete(a),a===e)break;var s=z(BU,this).get(o);s&&(PH(s.effect),z(BU,this).delete(o))}var c=function(e,i){if(e===n||z(VU,t).has(e))return 1;var a=()=>{if(Array.from(z(RU,t).values()).includes(e)){var n=document.createDocumentFragment();VH(i,n),n.append(fH()),z(BU,t).set(e,{effect:i,fragment:n})}else PH(i);z(VU,t).delete(e),z(zU,t).delete(e)};z(HU,t)||!r?(z(VU,t).add(e),LH(i,a,!1)):a()};for(var[l,u]of z(zU,this))c(l,u)}}),hz(this,WU,e=>{z(RU,this).delete(e);var t=Array.from(z(RU,this).values());for(var[n,r]of z(BU,this))t.includes(n)||(PH(r.effect),z(BU,this).delete(n))}),this.anchor=e,_z(HU,this,n)}ensure(e,t){var n=FB;!t||z(zU,this).has(e)||z(BU,this).has(e)||z(zU,this).set(e,jH(()=>t(this.anchor))),z(RU,this).set(n,e),z(UU,this).call(this,n)}};function KU(e){hB===null&&dB(),Sz&&hB.l!==null?XU(hB).m.push(e):wH(()=>{var t=q(e);if(typeof t==`function`)return t})}function qU(e){hB===null&&dB(),KU(()=>()=>q(e))}function JU(){var e=hB;return e===null&&dB(),(t,n,r)=>{var i=e.s.$$events?.[t];if(i){var a=Tz(i)?i.slice():[i],o=function(e,t){var{bubbles:n=!1,cancelable:r=!1}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return new CustomEvent(e,{detail:t,bubbles:n,cancelable:r})}(t,n,r);for(var s of a)s.call(e.x,o);return!o.defaultPrevented}return!0}}function YU(e){hB===null&&dB(),hB.l===null&&function(){throw Error(`https://svelte.dev/e/lifecycle_legacy_only`)}(),XU(hB).b.push(e)}function XU(e){var t=e.l;return t.u??={a:[],b:[],m:[]}}function Q(e,t){var n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=new GU(e);function i(e,t){r.ensure(e,t)}kH(()=>{var e=!1;t(function(t){e=!0,i(arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t)}),e||i(-1,null)},n?$z:0)}var ZU,QU=Symbol(`NaN`);function $U(e,t,n){var r=new GU(e),i=!bB();kH(()=>{var e=t();e!=e&&(e=QU),i&&typeof e==`object`&&e&&(e={}),r.ensure(e,n)})}function eW(e,t){return t}function tW(e,t){var n,r=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];if(e.pending.size>0)for(var i of(n=new Set,e.pending.values()))for(var a of i)n.add(e.items.get(a).e);for(var o=0;o<t.length;o++){var s,c=t[o];(s=n)!=null&&s.has(c)?(c.f|=nB,VH(c,document.createDocumentFragment())):PH(t[o],r)}}function nW(e,t,n,r,i){var a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:null,o=e,s=new Map;!(4&t)||(o=e.appendChild(fH()));var c,l=null,u=GV(()=>{var e=n();return Tz(e)?e:e==null?[]:Oz(e)}),d=new Map,f=!0;function p(e){(m.effect.f&Xz)===0&&(m.pending.delete(e),m.fallback=l,function(e,t,n,r,i){var a,o,s,c,l,u=!!(8&r),d=t.length,f=e.items,p=rW(e.effect.first),m=null,h=[],g=[];if(u)for(l=0;l<d;l+=1){var _;s=i(t[l],l),((c=f.get(s).e).f&nB)===0&&((_=c.nodes)==null||(_=_.a)==null||_.measure(),(o??=new Set).add(c))}for(l=0;l<d;l+=1){if(s=i(t[l],l),c=f.get(s).e,e.outrogroups!==null)for(var v of e.outrogroups)v.pending.delete(c),v.done.delete(c);var y;if((c.f&Yz)!==0&&(zH(c),u&&((y=c.nodes)==null||(y=y.a)==null||y.unfix(),(o??=new Set).delete(c))),(c.f&nB)!==0){if(c.f^=nB,c!==p){var b=m?m.next:p;c===e.effect.last&&(e.effect.last=c.prev),c.prev&&(c.prev.next=c.next),c.next&&(c.next.prev=c.prev),oW(e,m,c),oW(e,c,b),aW(c,b,n),h=[],g=[],p=rW((m=c).next);continue}aW(c,null,n)}if(c!==p){if(a!==void 0&&a.has(c)){if(h.length<g.length){var x,S=g[0];m=S.prev;var C=h[0],w=h[h.length-1];for(x=0;x<h.length;x+=1)aW(h[x],S,n);for(x=0;x<g.length;x+=1)a.delete(g[x]);oW(e,C.prev,w.next),oW(e,m,C),oW(e,w,S),p=S,m=w,--l,h=[],g=[]}else a.delete(c),aW(c,p,n),oW(e,c.prev,c.next),oW(e,c,m===null?e.effect.first:m.next),oW(e,m,c),m=c;continue}for(h=[],g=[];p!==null&&p!==c;)(a??=new Set).add(p),g.push(p),p=rW(p.next);if(p===null)continue}(c.f&nB)===0&&h.push(c),m=c,p=rW(c.next)}if(e.outrogroups!==null){for(var T of e.outrogroups){var E;T.pending.size===0&&(tW(e,Oz(T.done)),(E=e.outrogroups)==null||E.delete(T))}e.outrogroups.size===0&&(e.outrogroups=null)}if(p!==null||a!==void 0){var ee=[];if(a!==void 0)for(c of a)(c.f&Yz)===0&&ee.push(c);for(;p!==null;)(p.f&Yz)===0&&p!==e.fallback&&ee.push(p),p=rW(p.next);var te=ee.length;if(te>0){var D=4&r&&d===0?n:null;if(u){for(l=0;l<te;l+=1){var ne;(ne=ee[l].nodes)==null||(ne=ne.a)==null||ne.measure()}for(l=0;l<te;l+=1){var re;(re=ee[l].nodes)==null||(re=re.a)==null||re.fix()}}(function(e,t,n){for(var r,i=t.length,a=t.length,o=function(){var n=t[s];LH(n,()=>{if(r){if(r.pending.delete(n),r.done.add(n),r.pending.size===0){var t=e.outrogroups;tW(e,Oz(r.done)),t.delete(r),t.size===0&&(e.outrogroups=null)}}else --a},!1)},s=0;s<i;s++)o();if(a===0){var c=n!==null;if(c){var l=n,u=l.parentNode;u.textContent=``,u.append(l),e.items.clear()}tW(e,t,!c)}else r={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(r)})(e,ee,D)}}u&&wB(()=>{if(o!==void 0)for(c of o){var e;(e=c.nodes)==null||(e=e.a)==null||e.apply()}})}(m,c,o,t,r),l!==null&&(c.length===0?(l.f&nB)===0?zH(l):(l.f^=nB,aW(l,null,o)):LH(l,()=>{l=null})))}var m={effect:kH(()=>{for(var e=(c=K(u)).length,m=new Set,h=FB,g=0;g<e;g+=1){var _=c[g],v=r(_,g),y=f?null:s.get(v);y?(y.v&&aH(y.v,_),y.i&&aH(y.i,g)):(y=iW(s,f?o:ZU??=fH(),_,v,g,i,t,n),f||(y.e.f|=nB),s.set(v,y)),m.add(v)}(e===0&&a&&!l&&(f?l=jH(()=>a(o)):(l=jH(()=>a(ZU??=fH()))).f|=nB),e>m.size&&function(){throw Error(`https://svelte.dev/e/each_key_duplicate`)}(),f)||(d.set(h,m),p(h)),K(u)}),items:s,pending:d,outrogroups:null,fallback:l};f=!1}function rW(e){for(;e!==null&&(e.f&Uz)===0;)e=e.next;return e}function iW(e,t,n,r,i,a,o,s){var c=1&o?16&o?nH(n):B(n,!1,!1):null,l=2&o?nH(i):null;return{v:c,i:l,e:jH(()=>(a(t,c??n,l??i,s),()=>{e.delete(r)}))}}function aW(e,t,n){if(e.nodes)for(var r=e.nodes.start,i=e.nodes.end,a=t&&(t.f&nB)===0?t.nodes.start:n;r!==null;){var o=mH(r);if(a.before(r),r===i)return;r=o}}function oW(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function sW(e,t){var n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=arguments.length>3&&arguments[3]!==void 0&&arguments[3],i=arguments.length>4&&arguments[4]!==void 0&&arguments[4],a=e,o=``;if(n)var s=e;G(()=>{var e=JH;if(o!==(o=t()??``)){if(n)return e.nodes=null,s.innerHTML=o,void(o!==``&&EU(pH(s),s.lastChild));if(e.nodes!==null&&(FH(e.nodes.start,e.nodes.end),e.nodes=null),o!==``){var c=gH(r?`svg`:i?`math`:`template`,r?`http://www.w3.org/2000/svg`:i?`http://www.w3.org/1998/Math/MathML`:void 0);c.innerHTML=o;var l=r||i?c:c.content;if(EU(pH(l),l.lastChild),r||i)for(;pH(l);)a.before(pH(l));else a.before(l)}}})}function cW(e,t,n,r,i){var a=t.$$slots?.[n],o=!1;!0===a&&(a=t[n===`default`?`children`:n],o=!0),a===void 0?i!==null&&i(e):a(e,o?()=>r:r)}function lW(e,t,n){var r=new GU(e);kH(()=>{var e=t()??null;r.ensure(e,e&&(t=>n(t,e)))},$z)}function uW(e,t,n){EH(()=>{var r=q(()=>t(e,n?.())||{});if(n&&r!=null&&r.update){var i=!1,a={};OH(()=>{var e=n();J(e),i&&pB(a,e)&&(a=e,r.update(e))}),i=!0}if(r!=null&&r.destroy)return()=>r.destroy()})}function dW(e,t){var n,r=void 0;AH(()=>{r!==(r=t())&&(n&&=(PH(n),null),r&&(n=jH(()=>{EH(()=>r(e))})))})}function fW(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=fW(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function pW(e){return typeof e==`object`?function(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=fW(e))&&(r&&(r+=` `),r+=t);return r}(e):e??``}var mW=[...`
|
|
44
|
+
\r\f\xA0\v`];function hW(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1]?` !important;`:`;`,n=``;for(var r of Object.keys(e)){var i=e[r];i!=null&&i!==``&&(n+=` `+r+`: `+i+t)}return n}function gW(e){return e[0]!==`-`||e[1]!==`-`?e.toLowerCase():e}function _W(e,t,n,r,i,a){var o=e.__className;if(o!==n||o===void 0){var s=function(e,t,n){var r=e==null?``:``+e;if(t&&(r=r?r+` `+t:t),n){for(var i of Object.keys(n))if(n[i])r=r?r+` `+i:i;else if(r.length)for(var a=i.length,o=0;(o=r.indexOf(i,o))>=0;){var s=o+a;o!==0&&!mW.includes(r[o-1])||s!==r.length&&!mW.includes(r[s])?o=s:r=(o===0?``:r.substring(0,o))+r.substring(s+1)}}return r===``?null:r}(n,r,a);s==null?e.removeAttribute(`class`):t?e.className=s:e.setAttribute(`class`,s),e.__className=n}else if(a&&i!==a)for(var c in a){var l=!!a[c];i!=null&&l===!!i[c]||e.classList.toggle(c,l)}return a}function vW(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;for(var i in n){var a=n[i];t[i]!==a&&(n[i]==null?e.style.removeProperty(i):e.style.setProperty(i,a,r))}}function yW(e,t,n,r){if(e.__style!==t){var i=function(e,t){if(t){var n,r,i=``;if(Array.isArray(t)?(n=t[0],r=t[1]):n=t,e){e=String(e).replaceAll(/\s*\/\*.*?\*\/\s*/g,``).trim();var a=!1,o=0,s=!1,c=[];n&&c.push(...Object.keys(n).map(gW)),r&&c.push(...Object.keys(r).map(gW));for(var l=0,u=-1,d=e.length,f=0;f<d;f++){var p=e[f];if(s?p===`/`&&e[f-1]===`*`&&(s=!1):a?a===p&&(a=!1):p===`/`&&e[f+1]===`*`?s=!0:p===`"`||p===`'`?a=p:p===`(`?o++:p===`)`&&o--,!s&&!1===a&&o===0){if(p===`:`&&u===-1)u=f;else if(p===`;`||f===d-1){if(u!==-1){var m=gW(e.substring(l,u).trim());c.includes(m)||(p!==`;`&&f++,i+=` `+e.substring(l,f).trim()+`;`)}l=f+1,u=-1}}}}return n&&(i+=hW(n)),r&&(i+=hW(r,!0)),(i=i.trim())===``?null:i}return e==null?null:String(e)}(t,r);i==null?e.removeAttribute(`style`):e.style.cssText=i,e.__style=t}else r&&(Array.isArray(r)?(vW(e,n?.[0],r[0]),vW(e,n?.[1],r[1],`important`)):vW(e,n,r));return r}function bW(e,t){var n=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(e.multiple){if(t==null)return;if(!Tz(t))return void console.warn(`https://svelte.dev/e/select_multiple_invalid_value`);for(var r of e.options)r.selected=t.includes(SW(r))}else{for(r of e.options)if(dH(SW(r),t))return void(r.selected=!0);n&&t===void 0||(e.selectedIndex=-1)}}function xW(e){var t=new MutationObserver(()=>{bW(e,e.__value)});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`value`]}),CH(()=>{t.disconnect()})}function SW(e){return`__value`in e?e.__value:e.value}var CW=Symbol(`class`),wW=Symbol(`style`),TW=Symbol(`is custom element`),EW=Symbol(`is html`),DW=uB?`option`:`OPTION`,OW=uB?`select`:`SELECT`,kW=uB?`progress`:`PROGRESS`;function AW(e,t){var n=PW(e);n.value!==(n.value=t??void 0)&&(e.value!==t||t===0&&e.nodeName===kW)&&(e.value=t??``)}function jW(e,t,n,r){var i=PW(e);i[t]!==(i[t]=n)&&(t===`loading`&&(e[cB]=n),n==null?e.removeAttribute(t):typeof n!=`string`&&IW(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function MW(e,t,n,r){var i=PW(e),a=i[TW],o=!i[EW],s=t||{},c=e.nodeName===DW;for(var l in t)l in n||(n[l]=null);(n.class?n.class=pW(n.class):(r||n[CW])&&(n.class=null),n[wW])&&(n.style??=null);var u,d,f,p,m,h,g=IW(e),_=function(l){var _=n[l];if(c&&l===`value`&&_==null)return e.value=e.__value=``,s[l]=_,0;if(l===`class`)return u=e.namespaceURI===`http://www.w3.org/1999/xhtml`,_W(e,u,_,r,t?.[CW],n[CW]),s[l]=_,s[CW]=n[CW],0;if(l===`style`)return yW(e,_,t?.[wW],n[wW]),s[l]=_,s[wW]=n[wW],0;if(_===(d=s[l])&&(_!==void 0||!e.hasAttribute(l))||(s[l]=_,(f=l[0]+l[1])===`$$`))return 0;if(f===`on`){var v={},y=`$$`+l,b=l.slice(2);if(p=function(e){return AU.includes(e)}(b),function(e){return e.endsWith(`capture`)&&e!==`gotpointercapture`&&e!==`lostpointercapture`}(b)&&(b=b.slice(0,-7),v.capture=!0),!p&&d){if(_!=null)return 0;e.removeEventListener(b,s[y],v),s[y]=null}if(p)xU(b,e,_),SU([b]);else if(_!=null){function t(e){s[l].call(this,e)}s[y]=bU(b,e,t,v)}}else if(l===`style`)jW(e,l,_);else if(l===`autofocus`)(function(e,t){if(t){var n=document.body;e.autofocus=!0,wB(()=>{document.activeElement===n&&e.focus()})}})(e,!!_);else if(a||l!==`__value`&&(l!==`value`||_==null))if(l===`selected`&&c)(function(e,t){t?e.hasAttribute(`selected`)||e.setAttribute(`selected`,``):e.removeAttribute(`selected`)})(e,_);else if(m=l,o||(m=function(e){return e=e.toLowerCase(),jU[e]??e}(m)),h=m===`defaultValue`||m===`defaultChecked`,_!=null||a||h)h||g.includes(m)&&(a||typeof _!=`string`)?(e[m]=_,m in i&&(i[m]=Cz)):typeof _!=`function`&&jW(e,m,_);else if(i[l]=null,m===`value`||m===`checked`){var x=e,S=t===void 0;if(m===`value`){var C=x.defaultValue;x.removeAttribute(m),x.defaultValue=C,x.value=x.__value=S?C:null}else{var w=x.defaultChecked;x.removeAttribute(m),x.defaultChecked=w,x.checked=!!S&&w}}else e.removeAttribute(l);else e.value=e.__value=_};for(var v in n)_(v);return s}function NW(e,t){var n=arguments.length>5?arguments[5]:void 0,r=arguments.length>6&&arguments[6]!==void 0&&arguments[6],i=arguments.length>7&&arguments[7]!==void 0&&arguments[7];BV(arguments.length>4&&arguments[4]!==void 0?arguments[4]:[],arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],arguments.length>3&&arguments[3]!==void 0?arguments[3]:[],a=>{var o=void 0,s={},c=e.nodeName===OW,l=!1;if(AH(()=>{var u=t(...a.map(K)),d=MW(e,o,u,n,r,i);for(var f of(l&&c&&`value`in u&&bW(e,u.value),Object.getOwnPropertySymbols(s)))u[f]||PH(s[f]);for(var p of Object.getOwnPropertySymbols(u)){var m=u[p];p.description!==`@attach`||o&&m===o[p]||(s[p]&&PH(s[p]),s[p]=jH(()=>dW(e,()=>m))),d[p]=m}o=d}),c){var u=e;EH(()=>{bW(u,o.value,!0),xW(u)})}l=!0})}function PW(e){return e.__attributes??={[TW]:e.nodeName.includes(`-`),[EW]:e.namespaceURI===wz}}var FW=new Map;function IW(e){var t,n=e.getAttribute(`is`)||e.nodeName,r=FW.get(n);if(r)return r;FW.set(n,r=[]);for(var i=e,a=Element.prototype;a!==i;){for(var o in t=jz(i))t[o].set&&r.push(o);i=Pz(i)}return r}function LW(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t,r=new WeakSet;yH(e,`input`,function(){var i=pz(function*(i){var a=i?e.defaultValue:e.value;if(a=RW(e)?zW(a):a,n(a),FB!==null&&r.add(FB),yield fU(),a!==(a=t())){var o=e.selectionStart,s=e.selectionEnd,c=e.value.length;if(e.value=a??``,s!==null){var l=e.value.length;o===s&&s===c&&l>c?(e.selectionStart=l,e.selectionEnd=l):(e.selectionStart=o,e.selectionEnd=Math.min(s,l))}}});return function(e){return i.apply(this,arguments)}}()),q(t)==null&&e.value&&(n(RW(e)?zW(e.value):e.value),FB!==null&&r.add(FB)),OH(()=>{var n=t();if(e===document.activeElement){var i=FB;if(r.has(i))return}RW(e)&&n===zW(e.value)||(e.type!==`date`||n||e.value)&&n!==e.value&&(e.value=n??``)})}function RW(e){var t=e.type;return t===`number`||t===`range`}function zW(e){return e===``?null:+e}function BW(e,t,n){var r=Az(e,t);r&&r.set&&(e[t]=n,CH(()=>{e[t]=null}))}function VW(e,t){return e===t||e?.[oB]===t}function HW(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=hB.r,i=JH;return EH(()=>{var a,o;return OH(()=>{a=o,o=[],q(()=>{e!==n(...o)&&(t(e,...o),a&&VW(n(...a),e)&&t(null,...a))})}),()=>{for(var a=i;a!==r&&a.parent!==null&&a.parent.f&Qz;)a=a.parent;var s=a.teardown;a.teardown=()=>{o&&VW(n(...o),e)&&t(null,...o),s?.()}}}),e}function UW(e){return function(){var t=[...arguments];return t[0].stopPropagation(),e?.apply(this,t)}}function WW(e){return function(){var t=[...arguments];return t[0].preventDefault(),e?.apply(this,t)}}function GW(){var e=arguments.length>0&&arguments[0]!==void 0&&arguments[0],t=hB,n=t.l.u;if(n){var r,i=()=>J(t.s);if(e){var a=0,o={},s=UV(()=>{var e=!1,n=t.s;for(var r in n)n[r]!==o[r]&&(o[r]=n[r],e=!0);return e&&a++,a});i=()=>K(s)}n.b.length&&(r=()=>{KW(t,i),zz(n.b)},bH(),xH(1048584,r)),wH(()=>{var e=q(()=>n.m.map(Rz));return()=>{for(var t of e)typeof t==`function`&&t()}}),n.a.length&&wH(()=>{KW(t,i),zz(n.a)})}}function KW(e,t){if(e.l.s)for(var n of e.l.s)K(n);t()}function qW(e){var t=nH(0);return function(){return arguments.length===1?(V(t,K(t)+1),arguments[0]):(K(t),e())}}function JW(e,t){var n=e.$$events?.[t.type];for(var r of Tz(n)?n.slice():n==null?[]:[n])r.call(this,t)}var YW={get(e,t){if(!e.exclude.includes(t))return K(e.version),t in e.special?e.special[t]():e.props[t]},set(e,t,n){if(!(t in e.special)){var r=JH;try{YH(e.parent_effect),e.special[t]=$({get[t](){return e.props[t]}},t,4)}finally{YH(r)}}return e.special[t](n),oH(e.version),!0},getOwnPropertyDescriptor(e,t){if(!e.exclude.includes(t))return t in e.props?{enumerable:!0,configurable:!0,value:e.props[t]}:void 0},deleteProperty:(e,t)=>(e.exclude.includes(t)||(e.exclude.push(t),oH(e.version)),!0),has:(e,t)=>!e.exclude.includes(t)&&t in e.props,ownKeys:e=>Reflect.ownKeys(e.props).filter(t=>!e.exclude.includes(t))};function XW(e,t){return new Proxy({props:e,exclude:t,special:{},version:nH(0),parent_effect:JH},YW)}var ZW={get(e,t){for(var n=e.props.length;n--;){var r=e.props[n];if(Iz(r)&&(r=r()),typeof r==`object`&&r&&t in r)return r[t]}},set(e,t,n){for(var r=e.props.length;r--;){var i=e.props[r];Iz(i)&&(i=i());var a=Az(i,t);if(a&&a.set)return a.set(n),!0}return!1},getOwnPropertyDescriptor(e,t){for(var n=e.props.length;n--;){var r=e.props[n];if(Iz(r)&&(r=r()),typeof r==`object`&&r&&t in r){var i=Az(r,t);return i&&!i.configurable&&(i.configurable=!0),i}}},has(e,t){if(t===oB||t===sB)return!1;for(var n of e.props)if(Iz(n)&&(n=n()),n!=null&&t in n)return!0;return!1},ownKeys(e){var t=[];for(var n of e.props)if(Iz(n)&&(n=n()),n){for(var r in n)t.includes(r)||t.push(r);for(var i of Object.getOwnPropertySymbols(n))t.includes(i)||t.push(i)}return t}};function QW(){return new Proxy({props:[...arguments]},ZW)}function $(e,t,n,r){var i,a,o=!Sz||!!(2&n),s=!!(8&n),c=!!(16&n),l=r,u=!0,d=()=>(u&&(u=!1,l=c?q(r):r),l);if(s){var f=oB in e||sB in e;i=Az(e,t)?.set??(f&&t in e?n=>e[t]=n:void 0)}var p,m=!1;if(s?[a,m]=function(e){var t=NB;try{return NB=!1,[e(),NB]}finally{NB=t}}(()=>e[t]):a=e[t],a===void 0&&r!==void 0&&(a=d(),i&&(o&&function(){throw Error(`https://svelte.dev/e/props_invalid_value`)}(),i(a))),p=o?()=>{var n=e[t];return n===void 0?d():(u=!0,n)}:()=>{var n=e[t];return n!==void 0&&(l=void 0),n===void 0?l:n},o&&!(4&n))return p;if(i){var h=e.$$legacy;return function(e,t){return arguments.length>0?(o&&t&&!h&&!m||i(t?p():e),e):p()}}var g=!1,_=(1&n?UV:GV)(()=>(g=!1,p()));s&&K(_);var v=JH;return function(e,t){if(arguments.length>0){var n=t?K(_):o&&s?lH(e):e;return V(_,n),g=!0,l!==void 0&&(l=n),e}return UH&&g||(v.f&Xz)!==0?_.v:K(_)}}function $W(e){if(!(arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(e){var t=function(e){try{if(typeof window<`u`&&window.localStorage!==void 0)return window.localStorage[e]}catch{}}(`debug`);return t!=null&&t.endsWith(`*`)?e.startsWith(t.slice(0,-1)):e===t}(e)))return eG;var t=function(e){for(var t=0,n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return tG[Math.abs(t)%tG.length]}(e);return function(){var n=[...arguments];console.log(`%c${e}`,`color:${t}`,...n)}}function eG(){}var tG=[`#0000CC`,`#0099FF`,`#009400`,`#8dd200`,`#CCCC00`,`#CC9933`,`#ae04e7`,`#ff35d7`,`#FF3333`,`#FF6600`,`#FF9933`,`#FFCC33`],nG=0;function rG(){return++nG}function iG(e){return parseInt(e,10)}function aG(e){return oG.test(e)}var oG=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function sG(e){return typeof e==`object`&&!!e&&(e.constructor===void 0||e.constructor.name===`Object`)}function cG(e){return typeof e==`object`&&!!e&&(e.constructor===void 0||e.constructor.name===`Object`||e.constructor.name===`Array`)}function lG(e){return!0===e||!1===e}function uG(e){if(typeof e==`number`)return e>9466848e5&&isFinite(e)&&Math.floor(e)===e&&!isNaN(new Date(e).valueOf());if(typeof e==`bigint`)return uG(Number(e));try{var t=e&&e.valueOf();if(t!==e)return uG(t)}catch{return!1}return!1}function dG(e){(fG||=window.document.createElement(`div`)).style.color=``,fG.style.color=e;var t=fG.style.color;return t===``?void 0:t.replace(/\s+/g,``).toLowerCase()}var fG=void 0;function pG(e){return typeof e==`string`&&e.length<99&&!!dG(e)}function mG(e,t){if(typeof e==`number`||typeof e==`string`||typeof e==`boolean`||e===void 0)return typeof e;if(typeof e==`bigint`)return`number`;if(e===null)return`null`;if(Array.isArray(e))return`array`;if(sG(e))return`object`;var n=t.stringify(e);return n&&aG(n)?`number`:n===`true`||n===`false`?`boolean`:n===`null`?`null`:`unknown`}var hG=/^https?:\/\/\S+$/;function gG(e){return typeof e==`string`&&hG.test(e)}function _G(e,t){if(e===``)return``;var n=e.trim();return n===`null`?null:n===`true`||n!==`false`&&(aG(n)?t.parse(n):e)}var vG=[];function yG(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function bG(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n={};if(!Array.isArray(e))throw TypeError(`Array expected`);function r(e,i){(!Array.isArray(e)&&!sG(e)||t&&i.length>0)&&(n[_c(i)]=!0),sG(e)&&Object.keys(e).forEach(t=>{r(e[t],i.concat(t))})}for(var i=Math.min(e.length,1e4),a=0;a<i;a++)r(e[a],vG);return Object.keys(n).sort().map(gc)}function xG(e,t,n){if(!(t<=e))for(var r=e;r<t;r++)n(r)}function SG(e,t){return e.length>t?e.slice(0,t):e}function CG(e){return R({},e)}function wG(e){return Object.values(e)}function TG(e,t,n,r){var i=e.slice(0),a=i.splice(t,n);return i.splice.apply(i,[t+r,0,...a]),i}function EG(e,t,n){return e.slice(0,t).concat(n).concat(e.slice(t))}function DG(e,t){try{return t.parse(e)}catch{return t.parse(Sl(e))}}function OG(e,t){try{return DG(e,t)}catch{return}}function kG(e,t){e=e.replace(jG,``);try{return t(e)}catch{}try{return t(`{`+e+`}`)}catch{}try{return t(`[`+e+`]`)}catch{}throw Error(`Failed to parse partial JSON`)}function AG(e){e=e.replace(jG,``);try{return Sl(e)}catch{}try{var t=Sl(`[`+e+`]`);return t.substring(1,t.length-1)}catch{}try{var n=Sl(`{`+e+`}`);return n.substring(1,n.length-1)}catch{}throw Error(`Failed to repair partial JSON`)}var jG=/,\s*$/;function MG(e,t){var n=HG.exec(t);if(n){var r=iG(n[2]),i=function(e,t){for(var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:e.length,i=0,a=n;a<r;a++)e.charAt(a)===t&&i++;return i}(e,`
|
|
45
45
|
`,0,r),a=r-e.lastIndexOf(`
|
|
46
46
|
`,r)-1;return{position:r,line:i,column:a,message:t.replace(HG,()=>`line ${i+1} column ${a+1}`)}}var o=UG.exec(t),s=o?iG(o[1]):void 0,c=s===void 0?void 0:s-1,l=WG.exec(t),u=l?iG(l[1]):void 0,d=u===void 0?void 0:u-1;return{position:c!==void 0&&d!==void 0?function(e,t,n){for(var r=e.indexOf(`
|
|
47
47
|
`),i=1;i<t&&r!==-1;)r=e.indexOf(`
|
|
@@ -50,7 +50,7 @@ ${t}}`])},o=e=>e.map(e=>`.${s(e)}`).join(``),s=e=>x_.test(e)?e:JSON.stringify(e)
|
|
|
50
50
|
`||e===`\r`||e===` `?e:`\\u`+(`000`+e.codePointAt(0)?.toString(16)).slice(-4))}function sK(e){return e.replace(/\\u[a-fA-F0-9]{4}/g,e=>{try{var t=JSON.parse(`"`+e+`"`);return cK[t]||t}catch{return e}})}var cK={'"':`\\"`,"\\":`\\\\`,"\b":`\\b`,"\f":`\\f`,"\n":`\\n`,"\r":`\\r`," ":`\\t`},lK={'\\"':`"`,"\\\\":`\\`,"\\/":`/`,"\\b":`\b`,"\\f":`\f`,"\\n":`
|
|
51
51
|
`,"\\r":`\r`,"\\t":` `};function uK(e){return e.replace(/["\b\f\n\r\t\\]/g,e=>cK[e]||e)}function dK(e){return e.replace(/\\["bfnrt\\]/g,e=>lK[e]||e)}function fK(e){return typeof e==`string`?e.endsWith(`
|
|
52
52
|
`)?e+`
|
|
53
|
-
`:e:String(e)}function pK(e,t){return hK(e,e=>e.nodeName.toUpperCase()===t.toUpperCase())}function mK(e,t,n){return hK(e,e=>function(e,t,n){return typeof e.getAttribute==`function`&&e.getAttribute(t)===n}(e,t,n))}function hK(e,t){return!!gK(e,t)}function gK(e,t){for(var n=e;n&&!t(n);)n=n.parentNode;return n}function _K(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)??void 0}function vK(e){var t=_K(e)?.document.activeElement;return!!t&&hK(t,t=>t===e)}function yK(e,t){return gK(e,e=>e.nodeName===t)}function bK(e){return mK(e,`data-type`,`selectable-key`)?JG.key:mK(e,`data-type`,`selectable-value`)?JG.value:mK(e,`data-type`,`insert-selection-area-inside`)?JG.inside:mK(e,`data-type`,`insert-selection-area-after`)?JG.after:JG.multi}function xK(e){return encodeURIComponent(_c(e))}function SK(e){var t=gK(e,e=>!(e==null||!e.hasAttribute)&&e.hasAttribute(`data-path`))?.getAttribute(`data-path`)??void 0;return t?gc(decodeURIComponent(t)):void 0}function CK(e){var{allElements:t,currentElement:n,direction:r,hasPrio:i=()=>!0,margin:a=10}=e,o=
|
|
53
|
+
`:e:String(e)}function pK(e,t){return hK(e,e=>e.nodeName.toUpperCase()===t.toUpperCase())}function mK(e,t,n){return hK(e,e=>function(e,t,n){return typeof e.getAttribute==`function`&&e.getAttribute(t)===n}(e,t,n))}function hK(e,t){return!!gK(e,t)}function gK(e,t){for(var n=e;n&&!t(n);)n=n.parentNode;return n}function _K(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)??void 0}function vK(e){var t=_K(e)?.document.activeElement;return!!t&&hK(t,t=>t===e)}function yK(e,t){return gK(e,e=>e.nodeName===t)}function bK(e){return mK(e,`data-type`,`selectable-key`)?JG.key:mK(e,`data-type`,`selectable-value`)?JG.value:mK(e,`data-type`,`insert-selection-area-inside`)?JG.inside:mK(e,`data-type`,`insert-selection-area-after`)?JG.after:JG.multi}function xK(e){return encodeURIComponent(_c(e))}function SK(e){var t=gK(e,e=>!(e==null||!e.hasAttribute)&&e.hasAttribute(`data-path`))?.getAttribute(`data-path`)??void 0;return t?gc(decodeURIComponent(t)):void 0}function CK(e){var{allElements:t,currentElement:n,direction:r,hasPrio:i=()=>!0,margin:a=10}=e,o=Pg(t.filter(function(e){var t=e.getBoundingClientRect();return t.width>0&&t.height>0}),c),s=c(n);function c(e){var t=e.getBoundingClientRect();return{x:t.left+t.width/2,y:t.top+t.height/2,rect:t,element:e}}function l(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,r=e.x-t.x,i=(e.y-t.y)*n;return Math.sqrt(r*r+i*i)}var u=e=>l(e,s);if(r===`Left`||r===`Right`){var d=r===`Left`?o.filter(e=>{return t=s,e.rect.left+a<t.rect.left;var t}):o.filter(e=>{return t=s,e.rect.right>t.rect.right+a;var t});return(Gg(d.filter(e=>{return t=e,n=s,Math.abs(t.y-n.y)<a;var t,n}),u)||Gg(d,e=>l(e,s,10)))?.element}if(r===`Up`||r===`Down`){var f=r===`Up`?o.filter(e=>{return t=s,e.y+a<t.y;var t}):o.filter(e=>{return t=s,e.y>t.y+a;var t});return(Gg(f.filter(e=>i(e.element)),u)||Gg(f,u))?.element}}function wK(){var e,t,n;return typeof navigator<`u`&&(e=((t=navigator)==null||(t=t.platform)==null?void 0:t.toUpperCase().includes(`MAC`))??((n=navigator)==null||(n=n.userAgentData)==null||(n=n.platform)==null?void 0:n.toUpperCase().includes(`MAC`)))!=null&&e}function TK(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`+`,n=[];EK(e,arguments.length>2&&arguments[2]!==void 0?arguments[2]:wK)&&n.push(`Ctrl`),e.altKey&&n.push(`Alt`),e.shiftKey&&n.push(`Shift`);var r=e.key.length===1?e.key.toUpperCase():e.key;return r in DK||n.push(r),n.join(t)}function EK(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:wK;return e.ctrlKey||e.metaKey&&t()}var DK={Ctrl:!0,Command:!0,Control:!0,Alt:!0,Option:!0,Shift:!0};function OK(e,t){t===void 0&&(t={});var n=t.insertAt;if(e&&typeof document<`u`){var r=document.head||document.getElementsByTagName(`head`)[0],i=document.createElement(`style`);i.type=`text/css`,n===`top`&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}OK(`.jse-absolute-popup.svelte-enkkpn {
|
|
54
54
|
position: relative;
|
|
55
55
|
left: 0;
|
|
56
56
|
top: 0;
|
|
@@ -215,9 +215,9 @@ ${t}}`])},o=e=>e.map(e=>`.${s(e)}`).join(``),s=e=>x_.test(e)?e:JSON.stringify(e)
|
|
|
215
215
|
|
|
216
216
|
.jse-color-picker-button.svelte-13mgyo6:not(.jse-readonly) {
|
|
217
217
|
cursor: pointer;
|
|
218
|
-
}`);var XK=X(`<button type="button"></button>`);function ZK(e,t){vB(t,!1);var n=B(void 0,!0),r=B(void 0,!0),{openAbsolutePopup:i}=_B(`absolute-popup`),a=$(t,`path`,9),o=$(t,`value`,9),s=$(t,`readOnly`,9),c=$(t,`onPatch`,9),l=$(t,`focus`,9);function u(e){c()([{op:`replace`,path:_c(a()),value:e}]),d()}function d(){l()()}W(()=>J(o()),()=>{V(n,dG(o()))}),W(()=>(J(s()),J(o())),()=>{V(r,s()?`Color ${o()}`:`Click to open a color picker`)}),DH(),GW(!0);var f,p=XK();G(()=>{f=_W(p,1,`jse-color-picker-button svelte-13mgyo6`,null,f,{"jse-readonly":s()}),yW(p,`background: ${K(n)??``}`),jW(p,`title`,K(r)),jW(p,`aria-label`,K(r))}),Y(`click`,p,function(e){if(!s()){var t=e.target,n=t.getBoundingClientRect().top,r=(_K(t)?.innerHeight??0)-n<300&&n>300;i(YK,{color:o(),onChange:u,showOnTop:r},{anchor:t,closeOnOuterClick:!0,onClose:d,offsetTop:18,offsetLeft:-8,height:300})}}),Z(e,p),yB()}var QK=1e3,$K=100,eq=100,tq=2e4,nq=[{start:0,end:$K}],rq=1048576,iq=1048576,aq=`Insert or paste contents, enter [ insert a new array, enter { to insert a new object, or start typing to insert a new value`,oq=`Open context menu (Click here, right click on the selection, or use the context menu button or Ctrl+Q)`,sq=`hover-insert-inside`,cq=`hover-insert-after`,lq=`hover-collection`,uq=`valid`,dq=`repairable`,fq=336,pq=260,mq=100,hq={[QG.asc]:`ascending`,[QG.desc]:`descending`};function gq(e){for(var t=n_(e,e=>e.start),n=[t[0]],r=0;r<t.length;r++){var i=n.length-1,a=n[i],o=t[r];o.start<=a.end?n[i]={start:Math.min(a.start,o.start),end:Math.max(a.end,o.end)}:n.push(o)}return n}function _q(e){return vq(e)+$K}function vq(e){return Math.floor(e/$K)*$K}function yq(e){return!!e&&(e.type===`space`||!0===e.space)}function bq(e){return!!e&&(e.type===`separator`||!0===e.separator)}function xq(e){return!!e&&e.type===`label`&&typeof e.text==`string`}function Sq(e){return!!e&&typeof e.onClick==`function`}function Cq(e){return!!e&&e.type===`dropdown-button`&&Sq(e.main)&&Array.isArray(e.items)}function wq(e){return!!e&&e.type===`row`&&Array.isArray(e.items)}function Tq(e){return!!e&&e.type===`column`&&Array.isArray(e.items)}function Eq(e){return sG(e)&&sG(e.parseError)}function Dq(e){return sG(e)&&Array.isArray(e.validationErrors)}function Oq(e){return sG(e)&&Array.isArray(e.path)&&typeof e.message==`string`&&`severity`in e}function kq(e){return sG(e)&&Oq(e)&&typeof e.isChildError==`boolean`}function Aq(e){return sG(e)&&typeof e.action==`function`&&sG(e.props)}function jq(e){return e!==void 0&&e.type===`object`}function Mq(e){return e!==void 0&&e.type===`array`}function Nq(e){return e!==void 0&&e.type===`value`}function Pq(e){return jq(e)||Mq(e)}function Fq(e){return e!==void 0&&Array.isArray(e.searchResults)}function Iq(e){return!!e&&e.type===`tree`}function Lq(e){return!!e&&e.type===`text`}function Rq(e){return!!e&&e.type===`mode`}function zq(e){var{json:t,expand:n}=e,r=function(e){var{json:t,factory:n}=e;return Array.isArray(t)?n.createArrayDocumentState():sG(t)?n.createObjectDocumentState():t===void 0?void 0:n.createValueDocumentState()}({json:t,factory:Hq});return n&&r?Jq(t,r,[],n):r}function Bq(){var{expanded:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{expanded:!1};return{type:`array`,expanded:e,visibleSections:nq,items:[]}}function Vq(){var{expanded:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{expanded:!1};return{type:`object`,expanded:e,properties:{}}}var Hq={createObjectDocumentState:Vq,createArrayDocumentState:Bq,createValueDocumentState:function(){return{type:`value`}}};function Uq(e,t,n,r){var{createObjectDocumentState:i,createArrayDocumentState:a,createValueDocumentState:o}=r;return function e(t,n,r){if(Array.isArray(t)){var s=Mq(n)?n:a();if(r.length===0)return s;var c=iG(r[0]),l=e(t[c],s.items[c],r.slice(1));return uc(s,[`items`,r[0]],l)}if(sG(t)){var u=jq(n)?n:i();if(r.length===0)return u;var d=r[0],f=e(t[d],u.properties[d],r.slice(1));return uc(u,[`properties`,d],f)}return Nq(n)?n:o()}(e,t,n)}function Wq(e,t){return Gq(e,t,arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],(e,t)=>{if(e!==void 0&&t!==void 0)return Array.isArray(e)?Mq(t)?t:Bq({expanded:!!Pq(t)&&t.expanded}):sG(e)?jq(t)?t:Vq({expanded:!!Pq(t)&&t.expanded}):Nq(t)?t:void 0},()=>!0)}function Gq(e,t,n,r,i){var a=r(e,t,n);if(Array.isArray(e)&&Mq(a)&&i(a)){var o=[];return Kq(e,a.visibleSections,t=>{var s=n.concat(String(t)),c=Gq(e[t],a.items[t],s,r,i);c!==void 0&&(o[t]=c)}),yG(o,a.items)?a:R(R({},a),{},{items:o})}if(sG(e)&&jq(a)&&i(a)){var s={};return Object.keys(e).forEach(t=>{var o=n.concat(t),c=Gq(e[t],a.properties[t],o,r,i);c!==void 0&&(s[t]=c)}),yG(Object.values(s),Object.values(a.properties))?a:R(R({},a),{},{properties:s})}return a}function Kq(e,t,n){t.forEach(t=>{var{start:r,end:i}=t;xG(r,Math.min(e.length,i),n)})}function qq(e,t){for(var n=e,r=[],i=0;i<t.length;){if(Array.isArray(n)){var a=t[i];r.push(`items`,a),n=n[iG(a)]}else{if(!sG(n))throw Error(`Cannot convert path: Object or Array expected at index ${i}`);var o=t[i];r.push(`properties`,o),n=n[o]}i++}return r}function Jq(e,t,n,r){for(var i=t,a=function(t){var r=n.slice(0,t);i=nJ(e,i,r,(e,r)=>{var i=Pq(r)&&!r.expanded?R(R({},r),{},{expanded:!0}):r;return Mq(i)?function(e,t){if(function(e,t){return e.some(e=>t>=e.start&&t<e.end)}(e.visibleSections,t))return e;var n=vq(t),r={start:n,end:_q(n)};return R(R({},e),{},{visibleSections:gq(e.visibleSections.concat(r))})}(i,iG(n[t])):i})},o=0;o<n.length;o++)a(o);return nJ(e,i,n,(e,t)=>function(e,t,n,r){return Gq(e,t,n,(e,t,n)=>Array.isArray(e)&&r(n)?Mq(t)?t.expanded?t:R(R({},t),{},{expanded:!0}):Bq({expanded:!0}):sG(e)&&r(n)?jq(t)?t.expanded?t:R(R({},t),{},{expanded:!0}):Vq({expanded:!0}):t,e=>Pq(e)&&e.expanded)}(e,t,[],r))}function Yq(e,t,n,r){return nJ(e,t,n,(e,t)=>r?function(e,t,n){return Gq(e,t,n,(e,t)=>Xq(t),()=>!0)}(e,t,n):Xq(t))}function Xq(e){return Mq(e)&&e.expanded?R(R({},e),{},{expanded:!1,visibleSections:nq}):jq(e)&&e.expanded?R(R({},e),{},{expanded:!1}):e}function Zq(e,t,n){var r={json:e,documentState:t},i=n.reduce((e,t)=>({json:bc(e.json,[t]),documentState:Qq(e.json,e.documentState,t)}),r);return{json:i.json,documentState:Wq(i.json,i.documentState)}}function Qq(e,t,n){if(Xs(n))return rJ(e,t,n,void 0);if(Zs(n))return iJ(e,t,n);if(Qs(n)){var r=Ac(e,n.path),i=oJ(e,t,r);return i?tJ(e,t,r,{type:`value`,enforceString:i}):t}return $s(n)||ec(n)?function(e,t,n){if(ec(n)&&n.from===n.path)return t;var r=t,i=Ac(e,n.from),a=$q(e,r,i);return ec(n)&&(r=iJ(e,r,{path:n.from})),r=rJ(e,r,{path:n.path},a),r}(e,t,n):t}function $q(e,t,n){try{return lc(t,qq(e,n))}catch{return}}function eJ(e,t,n,r,i){return fc(Uq(e,t,n,i),qq(e,n),t=>r(lc(e,n),t))}function tJ(e,t,n,r){return function(e,t,n,r,i){return uc(Uq(e,t,n,i),qq(e,n),r)}(e,t,n,r,Hq)}function nJ(e,t,n,r){return eJ(e,t,n,r,Hq)}function rJ(e,t,n,r){var i=Ac(e,n.path),a=t;return a=nJ(e,a,Ig(i),(e,t)=>{if(!Mq(t))return t;var n=iG(wg(i)),{items:a,visibleSections:o}=t;return R(R({},t),{},{items:n<a.length?EG(a,n,r===void 0?[,]:[r]):a,visibleSections:aJ(o,n,1)})}),tJ(e,a,i,r)}function iJ(e,t,n){var r=Ac(e,n.path),i=Ig(r),a=lc(e,i);return Array.isArray(a)?nJ(e,t,i,(e,t)=>{if(!Mq(t))return t;var n=iG(wg(r)),{items:i,visibleSections:a}=t;return R(R({},t),{},{items:i.slice(0,n).concat(i.slice(n+1)),visibleSections:aJ(a,n,-1)})}):function(e,t,n){return hc(t,qq(e,n))?pc(t,qq(e,n)):t}(e,t,r)}function aJ(e,t,n){return function(e){for(var t=e.slice(0),n=1;n<t.length;)t[n-1].end===t[n].start&&(t[n-1]={start:t[n-1].start,end:t[n].end},t.splice(n)),n++;return t}(e.map(e=>({start:e.start>t?e.start+n:e.start,end:e.end>t?e.end+n:e.end})))}function oJ(e,t,n){var r,i=lc(e,n),a=$q(e,t,n),o=Nq(a)?a.enforceString:void 0;return typeof o==`boolean`?o:typeof(r=i)==`string`&&typeof _G(r,JSON)!=`string`}function sJ(e,t){var n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=e.indexOf(t);return r===-1?[]:n?e.slice(r):e.slice(r+1)}function cJ(e,t){var n=[];return function e(t,r,i){n.push(i),Js(t)&&Mq(r)&&r.expanded&&Kq(t,r.visibleSections,n=>{e(t[n],r.items[n],i.concat(String(n)))}),Ys(t)&&jq(r)&&r.expanded&&Object.keys(t).forEach(n=>{e(t[n],r.properties[n],i.concat(n))})}(e,t,[]),n}function lJ(e,t){var n=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],r=[];return function i(a,o){r.push({path:o,type:YG.value});var s=$q(e,t,o);a&&Pq(s)&&s.expanded&&(n&&r.push({path:o,type:YG.inside}),Js(a)&&Kq(a,Mq(s)?s.visibleSections:nq,e=>{var t=o.concat(String(e));i(a[e],t),n&&r.push({path:t,type:YG.after})}),Ys(a)&&Object.keys(a).forEach(e=>{var t=o.concat(e);r.push({path:t,type:YG.key}),i(a[e],t),n&&r.push({path:t,type:YG.after})}))}(e,[]),r}function uJ(e,t,n){var r=cJ(e,t),i=r.map(_c).indexOf(_c(n));if(i!==-1&&i<r.length-1)return r[i+1]}function dJ(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:10240;return Jq(e,t,n,BG({json:lc(e,n)},r)?pJ:hJ)}function fJ(e,t,n){var r=$q(e,t,n);return Pq(r)&&r.expanded?t:dJ(e,t,n)}function pJ(e){return e.length===0||e.length===1&&e[0]===`0`}function mJ(e){return e.length===0}function hJ(){return!0}function gJ(){return!1}function _J(e){return e&&e.type===JG.after||!1}function vJ(e){return e&&e.type===JG.inside||!1}function yJ(e){return e&&e.type===JG.key||!1}function bJ(e){return e&&e.type===JG.value||!1}function xJ(e){return e&&e.type===JG.multi||!1}function SJ(e){return xJ(e)&&Vg(e.focusPath,e.anchorPath)}function CJ(e){return xJ(e)||_J(e)||vJ(e)||yJ(e)||bJ(e)}function wJ(e){return e&&e.type===JG.text||!1}function TJ(e,t){var n=[];return function(e,t,n){if(t){var r=tY(t),i=eY(t);if(Vg(r,i))return n(r);if(e!==void 0){var a=NJ(r,i);if(r.length===a.length||i.length===a.length)return n(a);var o=WJ(r,i),s=DJ(e,o),c=OJ(e,o),l=$J(e,o,s),u=$J(e,o,c);if(!(l===-1||u===-1)){var d=lc(e,a);if(Ys(d)){for(var f=Object.keys(d),p=l;p<=u;p++){var m=n(a.concat(f[p]));if(m!==void 0)return m}return}if(Js(d)){for(var h=l;h<=u;h++){var g=n(a.concat(String(h)));if(g!==void 0)return g}return}throw Error(`Failed to create selection`)}}}}(e,t,e=>{n.push(e)}),n}function EJ(e){return vJ(e)?e.path:Ig(eY(e))}function DJ(e,t){if(!xJ(t))return t.path;var n=$J(e,t,t.anchorPath);return $J(e,t,t.focusPath)<n?t.focusPath:t.anchorPath}function OJ(e,t){if(!xJ(t))return t.path;var n=$J(e,t,t.anchorPath);return $J(e,t,t.focusPath)>n?t.focusPath:t.anchorPath}function kJ(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0&&arguments[3];if(n){var i=r?eY(n):DJ(e,n),a=function(e,t,n){var r=cJ(e,t),i=r.map(_c),a=_c(n),o=i.indexOf(a);if(o!==-1&&o>0)return r[o-1]}(e,t,i);if(r)return vJ(n)||_J(n)?a===void 0?void 0:WJ(i,i):a===void 0?void 0:WJ(tY(n),a);if(_J(n)||vJ(n))return BJ(i);if(yJ(n)){if(a===void 0||a.length===0)return;var o=lc(e,Ig(a));return Array.isArray(o)||Bg(a)?BJ(a):RJ(a)}return bJ(n),a===void 0?void 0:BJ(a)}}function AJ(e,t,n,r){if(!n)return{caret:void 0,previous:void 0,next:void 0};var i=lJ(e,t,r),a=i.findIndex(e=>Vg(e.path,eY(n))&&String(e.type)===String(n.type));return{caret:a===-1?void 0:i[a],previous:a!==-1&&a>0?i[a-1]:void 0,next:a!==-1&&a<i.length-1?i[a+1]:void 0}}function jJ(e,t){for(var n=cJ(e,t),r=0;r<n.length-1&&n[r+1].length>n[r].length;)r++;var i=n[r];return i===void 0||i.length===0||Array.isArray(lc(e,Ig(i)))?BJ(i):RJ(i)}function MJ(e,t){if(t.length===1){var n=jg(t);if(n.op===`replace`)return BJ(Ac(e,n.path))}if(!Bg(t)&&t.every(e=>e.op===`move`)){var r=jg(t),i=t.slice(1);if(($s(r)||ec(r))&&r.from!==r.path&&i.every(e=>($s(e)||ec(e))&&e.from===e.path))return RJ(Ac(e,r.path))}var a=t.filter(e=>e.op!==`test`&&e.op!==`remove`&&(e.op!==`move`||e.from!==e.path)&&typeof e.path==`string`).map(t=>Ac(e,t.path));if(!Bg(a))return{type:JG.multi,anchorPath:jg(a),focusPath:wg(a)}}function NJ(e,t){for(var n=0;n<e.length&&n<t.length&&e[n]===t[n];)n++;return e.slice(0,n)}function PJ(e){return yJ(e)||bJ(e)||SJ(e)}function FJ(e,t){return PJ(t)&&cG(lc(e,eY(t)))?eY(t):Ig(eY(t))}function IJ(e,t){if(e.length<t.length)return!1;for(var n=0;n<t.length;n++)if(e[n]!==t[n])return!1;return!0}function LJ(e){if(KJ(e)){var{type:t,path:n}=e;return{type:t,path:n}}return e}function RJ(e){return{type:JG.key,path:e}}function zJ(e,t){return{type:JG.key,path:e,edit:!0,initialValue:t}}function BJ(e){return{type:JG.value,path:e}}function VJ(e,t){return{type:JG.value,path:e,edit:!0,initialValue:t}}function HJ(e){return{type:JG.inside,path:e}}function UJ(e){return{type:JG.after,path:e}}function WJ(e,t){var n=NJ(e,t),r=e.length>n.length&&t.length>n.length;return{type:JG.multi,anchorPath:r?n.concat(e[n.length]):n,focusPath:r?n.concat(t[n.length]):n}}function GJ(e,t,n,r){if(yJ(t))return String(wg(t.path));if(bJ(t)){var i=lc(e,t.path);return typeof i==`string`?i:r.stringify(i,null,n)}if(xJ(t)){if(Bg(t.focusPath))return r.stringify(e,null,n);var a=lc(e,EJ(t));if(Array.isArray(a)){if(SJ(t)){var o=lc(e,t.focusPath);return r.stringify(o,null,n)}return TJ(e,t).map(t=>{var i=lc(e,t);return`${r.stringify(i,null,n)},`}).join(`
|
|
219
|
-
`)}return TJ(e,t).map(t=>{var i=
|
|
220
|
-
`)}}function KJ(e){return(yJ(e)||bJ(e))&&!0===e.edit}function qJ(e){return yJ(e)||bJ(e)||xJ(e)}function JJ(e){return yJ(e)||bJ(e)||SJ(e)}function YJ(e){switch(e.type){case YG.key:return RJ(e.path);case YG.value:return BJ(e.path);case YG.after:return UJ(e.path);case YG.inside:return HJ(e.path)}}function XJ(e,t){switch(e){case JG.key:return RJ(t);case JG.value:return BJ(t);case JG.after:return UJ(t);case JG.inside:return HJ(t);case JG.multi:case JG.text:return WJ(t,t)}}function ZJ(e,t,n){if(t)return QJ(e,t,n)||IJ(xJ(t)?
|
|
218
|
+
}`);var XK=X(`<button type="button"></button>`);function ZK(e,t){vB(t,!1);var n=B(void 0,!0),r=B(void 0,!0),{openAbsolutePopup:i}=_B(`absolute-popup`),a=$(t,`path`,9),o=$(t,`value`,9),s=$(t,`readOnly`,9),c=$(t,`onPatch`,9),l=$(t,`focus`,9);function u(e){c()([{op:`replace`,path:_c(a()),value:e}]),d()}function d(){l()()}W(()=>J(o()),()=>{V(n,dG(o()))}),W(()=>(J(s()),J(o())),()=>{V(r,s()?`Color ${o()}`:`Click to open a color picker`)}),DH(),GW(!0);var f,p=XK();G(()=>{f=_W(p,1,`jse-color-picker-button svelte-13mgyo6`,null,f,{"jse-readonly":s()}),yW(p,`background: ${K(n)??``}`),jW(p,`title`,K(r)),jW(p,`aria-label`,K(r))}),Y(`click`,p,function(e){if(!s()){var t=e.target,n=t.getBoundingClientRect().top,r=(_K(t)?.innerHeight??0)-n<300&&n>300;i(YK,{color:o(),onChange:u,showOnTop:r},{anchor:t,closeOnOuterClick:!0,onClose:d,offsetTop:18,offsetLeft:-8,height:300})}}),Z(e,p),yB()}var QK=1e3,$K=100,eq=100,tq=2e4,nq=[{start:0,end:$K}],rq=1048576,iq=1048576,aq=`Insert or paste contents, enter [ insert a new array, enter { to insert a new object, or start typing to insert a new value`,oq=`Open context menu (Click here, right click on the selection, or use the context menu button or Ctrl+Q)`,sq=`hover-insert-inside`,cq=`hover-insert-after`,lq=`hover-collection`,uq=`valid`,dq=`repairable`,fq=336,pq=260,mq=100,hq={[QG.asc]:`ascending`,[QG.desc]:`descending`};function gq(e){for(var t=n_(e,e=>e.start),n=[t[0]],r=0;r<t.length;r++){var i=n.length-1,a=n[i],o=t[r];o.start<=a.end?n[i]={start:Math.min(a.start,o.start),end:Math.max(a.end,o.end)}:n.push(o)}return n}function _q(e){return vq(e)+$K}function vq(e){return Math.floor(e/$K)*$K}function yq(e){return!!e&&(e.type===`space`||!0===e.space)}function bq(e){return!!e&&(e.type===`separator`||!0===e.separator)}function xq(e){return!!e&&e.type===`label`&&typeof e.text==`string`}function Sq(e){return!!e&&typeof e.onClick==`function`}function Cq(e){return!!e&&e.type===`dropdown-button`&&Sq(e.main)&&Array.isArray(e.items)}function wq(e){return!!e&&e.type===`row`&&Array.isArray(e.items)}function Tq(e){return!!e&&e.type===`column`&&Array.isArray(e.items)}function Eq(e){return sG(e)&&sG(e.parseError)}function Dq(e){return sG(e)&&Array.isArray(e.validationErrors)}function Oq(e){return sG(e)&&Array.isArray(e.path)&&typeof e.message==`string`&&`severity`in e}function kq(e){return sG(e)&&Oq(e)&&typeof e.isChildError==`boolean`}function Aq(e){return sG(e)&&typeof e.action==`function`&&sG(e.props)}function jq(e){return e!==void 0&&e.type===`object`}function Mq(e){return e!==void 0&&e.type===`array`}function Nq(e){return e!==void 0&&e.type===`value`}function Pq(e){return jq(e)||Mq(e)}function Fq(e){return e!==void 0&&Array.isArray(e.searchResults)}function Iq(e){return!!e&&e.type===`tree`}function Lq(e){return!!e&&e.type===`text`}function Rq(e){return!!e&&e.type===`mode`}function zq(e){var{json:t,expand:n}=e,r=function(e){var{json:t,factory:n}=e;return Array.isArray(t)?n.createArrayDocumentState():sG(t)?n.createObjectDocumentState():t===void 0?void 0:n.createValueDocumentState()}({json:t,factory:Hq});return n&&r?Jq(t,r,[],n):r}function Bq(){var{expanded:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{expanded:!1};return{type:`array`,expanded:e,visibleSections:nq,items:[]}}function Vq(){var{expanded:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{expanded:!1};return{type:`object`,expanded:e,properties:{}}}var Hq={createObjectDocumentState:Vq,createArrayDocumentState:Bq,createValueDocumentState:function(){return{type:`value`}}};function Uq(e,t,n,r){var{createObjectDocumentState:i,createArrayDocumentState:a,createValueDocumentState:o}=r;return function e(t,n,r){if(Array.isArray(t)){var s=Mq(n)?n:a();if(r.length===0)return s;var c=iG(r[0]),l=e(t[c],s.items[c],r.slice(1));return uc(s,[`items`,r[0]],l)}if(sG(t)){var u=jq(n)?n:i();if(r.length===0)return u;var d=r[0],f=e(t[d],u.properties[d],r.slice(1));return uc(u,[`properties`,d],f)}return Nq(n)?n:o()}(e,t,n)}function Wq(e,t){return Gq(e,t,arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],(e,t)=>{if(e!==void 0&&t!==void 0)return Array.isArray(e)?Mq(t)?t:Bq({expanded:!!Pq(t)&&t.expanded}):sG(e)?jq(t)?t:Vq({expanded:!!Pq(t)&&t.expanded}):Nq(t)?t:void 0},()=>!0)}function Gq(e,t,n,r,i){var a=r(e,t,n);if(Array.isArray(e)&&Mq(a)&&i(a)){var o=[];return Kq(e,a.visibleSections,t=>{var s=n.concat(String(t)),c=Gq(e[t],a.items[t],s,r,i);c!==void 0&&(o[t]=c)}),yG(o,a.items)?a:R(R({},a),{},{items:o})}if(sG(e)&&jq(a)&&i(a)){var s={};return Object.keys(e).forEach(t=>{var o=n.concat(t),c=Gq(e[t],a.properties[t],o,r,i);c!==void 0&&(s[t]=c)}),yG(Object.values(s),Object.values(a.properties))?a:R(R({},a),{},{properties:s})}return a}function Kq(e,t,n){t.forEach(t=>{var{start:r,end:i}=t;xG(r,Math.min(e.length,i),n)})}function qq(e,t){for(var n=e,r=[],i=0;i<t.length;){if(Array.isArray(n)){var a=t[i];r.push(`items`,a),n=n[iG(a)]}else{if(!sG(n))throw Error(`Cannot convert path: Object or Array expected at index ${i}`);var o=t[i];r.push(`properties`,o),n=n[o]}i++}return r}function Jq(e,t,n,r){for(var i=t,a=function(t){var r=n.slice(0,t);i=nJ(e,i,r,(e,r)=>{var i=Pq(r)&&!r.expanded?R(R({},r),{},{expanded:!0}):r;return Mq(i)?function(e,t){if(function(e,t){return e.some(e=>t>=e.start&&t<e.end)}(e.visibleSections,t))return e;var n=vq(t),r={start:n,end:_q(n)};return R(R({},e),{},{visibleSections:gq(e.visibleSections.concat(r))})}(i,iG(n[t])):i})},o=0;o<n.length;o++)a(o);return nJ(e,i,n,(e,t)=>function(e,t,n,r){return Gq(e,t,n,(e,t,n)=>Array.isArray(e)&&r(n)?Mq(t)?t.expanded?t:R(R({},t),{},{expanded:!0}):Bq({expanded:!0}):sG(e)&&r(n)?jq(t)?t.expanded?t:R(R({},t),{},{expanded:!0}):Vq({expanded:!0}):t,e=>Pq(e)&&e.expanded)}(e,t,[],r))}function Yq(e,t,n,r){return nJ(e,t,n,(e,t)=>r?function(e,t,n){return Gq(e,t,n,(e,t)=>Xq(t),()=>!0)}(e,t,n):Xq(t))}function Xq(e){return Mq(e)&&e.expanded?R(R({},e),{},{expanded:!1,visibleSections:nq}):jq(e)&&e.expanded?R(R({},e),{},{expanded:!1}):e}function Zq(e,t,n){var r={json:e,documentState:t},i=n.reduce((e,t)=>({json:bc(e.json,[t]),documentState:Qq(e.json,e.documentState,t)}),r);return{json:i.json,documentState:Wq(i.json,i.documentState)}}function Qq(e,t,n){if(Xs(n))return rJ(e,t,n,void 0);if(Zs(n))return iJ(e,t,n);if(Qs(n)){var r=Ac(e,n.path),i=oJ(e,t,r);return i?tJ(e,t,r,{type:`value`,enforceString:i}):t}return $s(n)||ec(n)?function(e,t,n){if(ec(n)&&n.from===n.path)return t;var r=t,i=Ac(e,n.from),a=$q(e,r,i);return ec(n)&&(r=iJ(e,r,{path:n.from})),r=rJ(e,r,{path:n.path},a),r}(e,t,n):t}function $q(e,t,n){try{return lc(t,qq(e,n))}catch{return}}function eJ(e,t,n,r,i){return fc(Uq(e,t,n,i),qq(e,n),t=>r(lc(e,n),t))}function tJ(e,t,n,r){return function(e,t,n,r,i){return uc(Uq(e,t,n,i),qq(e,n),r)}(e,t,n,r,Hq)}function nJ(e,t,n,r){return eJ(e,t,n,r,Hq)}function rJ(e,t,n,r){var i=Ac(e,n.path),a=t;return a=nJ(e,a,Lg(i),(e,t)=>{if(!Mq(t))return t;var n=iG(kg(i)),{items:a,visibleSections:o}=t;return R(R({},t),{},{items:n<a.length?EG(a,n,r===void 0?[,]:[r]):a,visibleSections:aJ(o,n,1)})}),tJ(e,a,i,r)}function iJ(e,t,n){var r=Ac(e,n.path),i=Lg(r),a=lc(e,i);return Array.isArray(a)?nJ(e,t,i,(e,t)=>{if(!Mq(t))return t;var n=iG(kg(r)),{items:i,visibleSections:a}=t;return R(R({},t),{},{items:i.slice(0,n).concat(i.slice(n+1)),visibleSections:aJ(a,n,-1)})}):function(e,t,n){return hc(t,qq(e,n))?pc(t,qq(e,n)):t}(e,t,r)}function aJ(e,t,n){return function(e){for(var t=e.slice(0),n=1;n<t.length;)t[n-1].end===t[n].start&&(t[n-1]={start:t[n-1].start,end:t[n].end},t.splice(n)),n++;return t}(e.map(e=>({start:e.start>t?e.start+n:e.start,end:e.end>t?e.end+n:e.end})))}function oJ(e,t,n){var r,i=lc(e,n),a=$q(e,t,n),o=Nq(a)?a.enforceString:void 0;return typeof o==`boolean`?o:typeof(r=i)==`string`&&typeof _G(r,JSON)!=`string`}function sJ(e,t){var n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=e.indexOf(t);return r===-1?[]:n?e.slice(r):e.slice(r+1)}function cJ(e,t){var n=[];return function e(t,r,i){n.push(i),Js(t)&&Mq(r)&&r.expanded&&Kq(t,r.visibleSections,n=>{e(t[n],r.items[n],i.concat(String(n)))}),Ys(t)&&jq(r)&&r.expanded&&Object.keys(t).forEach(n=>{e(t[n],r.properties[n],i.concat(n))})}(e,t,[]),n}function lJ(e,t){var n=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],r=[];return function i(a,o){r.push({path:o,type:YG.value});var s=$q(e,t,o);a&&Pq(s)&&s.expanded&&(n&&r.push({path:o,type:YG.inside}),Js(a)&&Kq(a,Mq(s)?s.visibleSections:nq,e=>{var t=o.concat(String(e));i(a[e],t),n&&r.push({path:t,type:YG.after})}),Ys(a)&&Object.keys(a).forEach(e=>{var t=o.concat(e);r.push({path:t,type:YG.key}),i(a[e],t),n&&r.push({path:t,type:YG.after})}))}(e,[]),r}function uJ(e,t,n){var r=cJ(e,t),i=r.map(_c).indexOf(_c(n));if(i!==-1&&i<r.length-1)return r[i+1]}function dJ(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:10240;return Jq(e,t,n,BG({json:lc(e,n)},r)?pJ:hJ)}function fJ(e,t,n){var r=$q(e,t,n);return Pq(r)&&r.expanded?t:dJ(e,t,n)}function pJ(e){return e.length===0||e.length===1&&e[0]===`0`}function mJ(e){return e.length===0}function hJ(){return!0}function gJ(){return!1}function _J(e){return e&&e.type===JG.after||!1}function vJ(e){return e&&e.type===JG.inside||!1}function yJ(e){return e&&e.type===JG.key||!1}function bJ(e){return e&&e.type===JG.value||!1}function xJ(e){return e&&e.type===JG.multi||!1}function SJ(e){return xJ(e)&&Hg(e.focusPath,e.anchorPath)}function CJ(e){return xJ(e)||_J(e)||vJ(e)||yJ(e)||bJ(e)}function wJ(e){return e&&e.type===JG.text||!1}function TJ(e,t){var n=[];return function(e,t,n){if(t){var r=tY(t),i=eY(t);if(Hg(r,i))return n(r);if(e!==void 0){var a=NJ(r,i);if(r.length===a.length||i.length===a.length)return n(a);var o=WJ(r,i),s=DJ(e,o),c=OJ(e,o),l=$J(e,o,s),u=$J(e,o,c);if(!(l===-1||u===-1)){var d=lc(e,a);if(Ys(d)){for(var f=Object.keys(d),p=l;p<=u;p++){var m=n(a.concat(f[p]));if(m!==void 0)return m}return}if(Js(d)){for(var h=l;h<=u;h++){var g=n(a.concat(String(h)));if(g!==void 0)return g}return}throw Error(`Failed to create selection`)}}}}(e,t,e=>{n.push(e)}),n}function EJ(e){return vJ(e)?e.path:Lg(eY(e))}function DJ(e,t){if(!xJ(t))return t.path;var n=$J(e,t,t.anchorPath);return $J(e,t,t.focusPath)<n?t.focusPath:t.anchorPath}function OJ(e,t){if(!xJ(t))return t.path;var n=$J(e,t,t.anchorPath);return $J(e,t,t.focusPath)>n?t.focusPath:t.anchorPath}function kJ(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0&&arguments[3];if(n){var i=r?eY(n):DJ(e,n),a=function(e,t,n){var r=cJ(e,t),i=r.map(_c),a=_c(n),o=i.indexOf(a);if(o!==-1&&o>0)return r[o-1]}(e,t,i);if(r)return vJ(n)||_J(n)?a===void 0?void 0:WJ(i,i):a===void 0?void 0:WJ(tY(n),a);if(_J(n)||vJ(n))return BJ(i);if(yJ(n)){if(a===void 0||a.length===0)return;var o=lc(e,Lg(a));return Array.isArray(o)||Vg(a)?BJ(a):RJ(a)}return bJ(n),a===void 0?void 0:BJ(a)}}function AJ(e,t,n,r){if(!n)return{caret:void 0,previous:void 0,next:void 0};var i=lJ(e,t,r),a=i.findIndex(e=>Hg(e.path,eY(n))&&String(e.type)===String(n.type));return{caret:a===-1?void 0:i[a],previous:a!==-1&&a>0?i[a-1]:void 0,next:a!==-1&&a<i.length-1?i[a+1]:void 0}}function jJ(e,t){for(var n=cJ(e,t),r=0;r<n.length-1&&n[r+1].length>n[r].length;)r++;var i=n[r];return i===void 0||i.length===0||Array.isArray(lc(e,Lg(i)))?BJ(i):RJ(i)}function MJ(e,t){if(t.length===1){var n=Mg(t);if(n.op===`replace`)return BJ(Ac(e,n.path))}if(!Vg(t)&&t.every(e=>e.op===`move`)){var r=Mg(t),i=t.slice(1);if(($s(r)||ec(r))&&r.from!==r.path&&i.every(e=>($s(e)||ec(e))&&e.from===e.path))return RJ(Ac(e,r.path))}var a=t.filter(e=>e.op!==`test`&&e.op!==`remove`&&(e.op!==`move`||e.from!==e.path)&&typeof e.path==`string`).map(t=>Ac(e,t.path));if(!Vg(a))return{type:JG.multi,anchorPath:Mg(a),focusPath:kg(a)}}function NJ(e,t){for(var n=0;n<e.length&&n<t.length&&e[n]===t[n];)n++;return e.slice(0,n)}function PJ(e){return yJ(e)||bJ(e)||SJ(e)}function FJ(e,t){return PJ(t)&&cG(lc(e,eY(t)))?eY(t):Lg(eY(t))}function IJ(e,t){if(e.length<t.length)return!1;for(var n=0;n<t.length;n++)if(e[n]!==t[n])return!1;return!0}function LJ(e){if(KJ(e)){var{type:t,path:n}=e;return{type:t,path:n}}return e}function RJ(e){return{type:JG.key,path:e}}function zJ(e,t){return{type:JG.key,path:e,edit:!0,initialValue:t}}function BJ(e){return{type:JG.value,path:e}}function VJ(e,t){return{type:JG.value,path:e,edit:!0,initialValue:t}}function HJ(e){return{type:JG.inside,path:e}}function UJ(e){return{type:JG.after,path:e}}function WJ(e,t){var n=NJ(e,t),r=e.length>n.length&&t.length>n.length;return{type:JG.multi,anchorPath:r?n.concat(e[n.length]):n,focusPath:r?n.concat(t[n.length]):n}}function GJ(e,t,n,r){if(yJ(t))return String(kg(t.path));if(bJ(t)){var i=lc(e,t.path);return typeof i==`string`?i:r.stringify(i,null,n)}if(xJ(t)){if(Vg(t.focusPath))return r.stringify(e,null,n);var a=lc(e,EJ(t));if(Array.isArray(a)){if(SJ(t)){var o=lc(e,t.focusPath);return r.stringify(o,null,n)}return TJ(e,t).map(t=>{var i=lc(e,t);return`${r.stringify(i,null,n)},`}).join(`
|
|
219
|
+
`)}return TJ(e,t).map(t=>{var i=kg(t),a=lc(e,t);return`${r.stringify(i)}: ${r.stringify(a,null,n)},`}).join(`
|
|
220
|
+
`)}}function KJ(e){return(yJ(e)||bJ(e))&&!0===e.edit}function qJ(e){return yJ(e)||bJ(e)||xJ(e)}function JJ(e){return yJ(e)||bJ(e)||SJ(e)}function YJ(e){switch(e.type){case YG.key:return RJ(e.path);case YG.value:return BJ(e.path);case YG.after:return UJ(e.path);case YG.inside:return HJ(e.path)}}function XJ(e,t){switch(e){case JG.key:return RJ(t);case JG.value:return BJ(t);case JG.after:return UJ(t);case JG.inside:return HJ(t);case JG.multi:case JG.text:return WJ(t,t)}}function ZJ(e,t,n){if(t)return QJ(e,t,n)||IJ(xJ(t)?Lg(t.focusPath):t.path,n)?t:void 0}function QJ(e,t,n){if(e===void 0||!t)return!1;if(yJ(t)||vJ(t)||_J(t))return Hg(t.path,n);if(bJ(t))return IJ(n,t.path);if(xJ(t)){var r=DJ(e,t),i=OJ(e,t),a=Lg(t.focusPath);if(!IJ(n,a)||n.length<=a.length)return!1;var o=$J(e,t,r),s=$J(e,t,i),c=$J(e,t,n);return c!==-1&&c>=o&&c<=s}return!1}function $J(e,t,n){var r=Lg(t.focusPath);if(!IJ(n,r)||n.length<=r.length)return-1;var i=n[r.length],a=lc(e,r);if(Ys(a))return Object.keys(a).indexOf(i);if(Js(a)){var o=iG(i);if(o<a.length)return o}return-1}function eY(e){return xJ(e)?e.focusPath:e.path}function tY(e){return xJ(e)?e.anchorPath:e.path}function nY(){for(var e=[],t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];for(var i of n)if(typeof i==`string`&&e.push(i),i&&typeof i==`object`)for(var a in i)Object.hasOwnProperty.call(i,a)&&i[a]&&e.push(a);return e.join(` `)}function rY(e,t,n){return nY(`jse-value`,`jse-`+mG(e,n),{"jse-url":gG(e),"jse-empty":typeof e==`string`&&e.length===0,"jse-table-cell":t===qG.table})}OK(`/* over all fonts, sizes, and colors */
|
|
221
221
|
/* "consolas" for Windows, "menlo" for Mac with fallback to "monaco", 'Ubuntu Mono' for Ubuntu */
|
|
222
222
|
/* (at Mac this font looks too large at 14px, but 13px is too small for the font on Windows) */
|
|
223
223
|
/* main, menu, modal */
|
|
@@ -294,7 +294,7 @@ div.jse-editable-div.jse-empty.svelte-1r0oryi:not(:focus) {
|
|
|
294
294
|
div.jse-editable-div.jse-empty.svelte-1r0oryi::after {
|
|
295
295
|
pointer-events: none;
|
|
296
296
|
color: var(--jse-tag-background, rgba(0, 0, 0, 0.2));
|
|
297
|
-
}`);var iY=X(`<div role="textbox" tabindex="0" contenteditable="true" spellcheck="false"></div>`);function aY(e,t){vB(t,!1);var n=$W(`jsoneditor:EditableDiv`),r=$(t,`value`,9),i=$(t,`initialValue`,9),a=$(t,`shortText`,9,!1),o=$(t,`label`,9),s=$(t,`onChange`,9),c=$(t,`onCancel`,9),l=$(t,`onFind`,9),u=$(t,`onPaste`,9,ju),d=$(t,`onValueClass`,9,()=>``),f=B(void 0,!0),p=B(void 0,!0),m=!1;function h(){return K(f)?function(e){return e.replace(/\n$/,``)}(K(f).innerText):``}function g(e){K(f)&&iH(f,K(f).innerText=fK(e))}KU(()=>{n(`onMount`,{value:r(),initialValue:i()}),g(i()===void 0?r():i()),K(f)&&function(e){if(e.firstChild!=null){var t=document.createRange(),n=window.getSelection();t.setStart(e,1),t.collapse(!0),n?.removeAllRanges(),n?.addRange(t)}else e.focus()}(K(f))}),qU(()=>{var e=h();n(`onDestroy`,{closed:m,value:r(),newValue:e}),m||e===r()||s()(e,$G.no)}),W(()=>(J(d()),J(r())),()=>{V(p,d()(r()))}),DH(),GW(!0);var _=iY();HW(_,e=>V(f,e),()=>K(f)),G(e=>{jW(_,`aria-label`,o()),_W(_,1,e,`svelte-1r0oryi`)},[()=>pW((J(nY),K(p),J(a()),q(()=>nY(`jse-editable-div`,K(p),{"jse-short-text":a()}))))]),Y(`input`,_,function(){var e=h();e===``&&g(``),V(p,d()(e))}),Y(`keydown`,_,function(e){e.stopPropagation();var t=TK(e);if(t===`Escape`&&(e.preventDefault(),m=!0,c()()),t===`Enter`||t===`Tab`){e.preventDefault(),m=!0;var n=h();s()(n,$G.nextInside)}t===`Ctrl+F`&&(e.preventDefault(),l()(!1)),t===`Ctrl+H`&&(e.preventDefault(),l()(!0))}),Y(`paste`,_,function(e){if(e.stopPropagation(),u()&&e.clipboardData){var t=e.clipboardData.getData(`text/plain`);u()(t)}}),Y(`blur`,_,function(){var e=document.hasFocus(),t=h();n(`handleBlur`,{hasFocus:e,closed:m,value:r(),newValue:t}),document.hasFocus()&&!m&&(m=!0,t!==r()&&s()(t,$G.self))}),Z(e,_),yB()}function oY(e,t){vB(t,!1);var n=$(t,`path`,9),r=$(t,`value`,9),i=$(t,`selection`,9),a=$(t,`mode`,9),o=$(t,`parser`,9),s=$(t,`normalization`,9),c=$(t,`enforceString`,9),l=$(t,`onPatch`,9),u=$(t,`onPasteJson`,9),d=$(t,`onSelect`,9),f=$(t,`onFind`,9),p=$(t,`focus`,9),m=$(t,`findNextInside`,9);function h(e){return c()?e:_G(e,o())}function g(){d()(BJ(n())),p()()}GW(!0);var _=GV(()=>(J(s()),J(r()),q(()=>s().escapeValue(r())))),v=GV(()=>(J(KJ),J(i()),q(()=>KJ(i())?i().initialValue:void 0)));aY(e,{get value(){return K(_)},get initialValue(){return K(v)},label:`Edit value`,onChange:function(e,t){l()([{op:`replace`,path:_c(n()),value:h(s().unescapeValue(e))}],(e,r,i)=>{if(!i||Vg(n(),eY(i)))return{state:r,selection:t===$G.nextInside?m()(n()):BJ(n())}}),p()()},onCancel:g,onPaste:function(e){try{var t=o().parse(e);cG(t)&&u()({path:n(),contents:t,onPasteAsJson:()=>{g();var e=[{op:`replace`,path:_c(n()),value:t}];l()(e,(e,t)=>({state:dJ(e,t,n())}))}})}catch{}},get onFind(){return f()},onValueClass:function(e){return rY(h(s().unescapeValue(e)),a(),o())}}),yB()}function sY(e,t,n){var r=Ig(t),i=lc(e,r);if(Js(i)){var a=iG(wg(t));return n.map((e,t)=>({op:`add`,path:_c(r.concat(String(a+t))),value:e.value}))}if(Ys(i)){var o=wg(t),s=Object.keys(i),c=o===void 0?[]:sJ(s,o,!0);return[...n.map(e=>{var t=PK(e.key,s);return{op:`add`,path:_c(r.concat(t)),value:e.value}}),...c.map(e=>mY(r,e))]}throw Error(`Cannot create insert operations: parent must be an Object or Array`)}function cY(e,t,n){var r=lc(e,t);if(Array.isArray(r)){var i=r.length;return n.map((e,n)=>({op:`add`,path:_c(t.concat(String(i+n))),value:e.value}))}return n.map(e=>{var n=PK(e.key,Object.keys(r));return{op:`add`,path:_c(t.concat(n)),value:e.value}})}function lY(e,t,n,r){var i=PK(r,t.filter(e=>e!==n)),a=sJ(t,n,!1);return[{op:`move`,from:_c(e.concat(n)),path:_c(e.concat(i))},...a.map(t=>mY(e,t))]}function uY(e,t){var n=wg(t);if(Bg(n))throw Error(`Cannot duplicate root object`);var r=Ig(n),i=wg(n),a=lc(e,r);if(Js(a)){var o=wg(t),s=o?iG(wg(o))+1:0;return[...t.map((e,t)=>({op:`copy`,from:_c(e),path:_c(r.concat(String(t+s)))}))]}if(Ys(a)){var c=Object.keys(a),l=i===void 0?[]:sJ(c,i,!1);return[...t.map(e=>{var t=PK(wg(e),c);return{op:`copy`,from:_c(e),path:_c(r.concat(t))}}),...l.map(e=>mY(r,e))]}throw Error(`Cannot create duplicate operations: parent must be an Object or Array`)}function dY(e,t){if(bJ(t))return[{op:`move`,from:_c(t.path),path:``}];if(!xJ(t))throw Error(`Cannot create extract operations: parent must be an Object or Array`);var n=lc(e,Ig(t.focusPath));if(Js(n))return[{op:`replace`,path:``,value:TJ(e,t).map(e=>n[iG(wg(e))])}];if(Ys(n)){var r={};return TJ(e,t).forEach(e=>{var t=String(wg(e));r[t]=n[t]}),[{op:`replace`,path:``,value:r}]}throw Error(`Cannot extract: unsupported type of selection `+JSON.stringify(t))}function fY(e,t,n,r){if(yJ(t)){var i=OG(n,r),a=Ig(t.path),o=lc(e,a);return lY(a,Object.keys(o),wg(t.path),typeof i==`string`?i:n)}if(bJ(t)||xJ(t)&&Bg(t.focusPath))try{return[{op:`replace`,path:_c(eY(t)),value:kG(n,e=>DG(e,r))}]}catch{return[{op:`replace`,path:_c(eY(t)),value:n}]}if(xJ(t)){var s=hY(n,r);return function(e,t,n){var r=Ig(jg(t)),i=lc(e,r);if(Js(i)){var a=jg(t),o=a?iG(wg(a)):0;return[...pY(t),...n.map((e,t)=>({op:`add`,path:_c(r.concat(String(t+o))),value:e.value}))]}if(Ys(i)){var s=wg(t),c=Ig(s),l=wg(s),u=Object.keys(i),d=l===void 0?[]:sJ(u,l,!1),f=new Set(t.map(e=>wg(e))),p=u.filter(e=>!f.has(e));return[...pY(t),...n.map(e=>{var t=PK(e.key,p);return{op:`add`,path:_c(c.concat(t)),value:e.value}}),...d.map(e=>mY(c,e))]}throw Error(`Cannot create replace operations: parent must be an Object or Array`)}(e,TJ(e,t),s)}if(_J(t)){var c=hY(n,r),l=t.path,u=Ig(l),d=lc(e,u);if(Js(d)){var f=iG(wg(l));return sY(e,u.concat(String(f+1)),c)}if(Ys(d)){var p=String(wg(l)),m=Object.keys(d);if(Bg(m)||wg(m)===p)return cY(e,u,c);var h=m[m.indexOf(p)+1];return sY(e,u.concat(h),c)}throw Error(`Cannot create insert operations: parent must be an Object or Array`)}if(vJ(t)){var g=hY(n,r),_=t.path,v=lc(e,_);if(Js(v))return sY(e,_.concat(`0`),g);if(Ys(v)){var y=Object.keys(v);if(Bg(y))return cY(e,_,g);var b=jg(y);return sY(e,_.concat(b),g)}throw Error(`Cannot create insert operations: parent must be an Object or Array`)}throw Error(`Cannot insert: unsupported type of selection `+JSON.stringify(t))}function pY(e){return e.map(e=>({op:`remove`,path:_c(e)})).reverse()}function mY(e,t){return{op:`move`,from:_c(e.concat(t)),path:_c(e.concat(t))}}function hY(e,t){var n=/^\s*{/.test(e),r=/^\s*\[/.test(e),i=OG(e,t),a=i===void 0?kG(e,e=>DG(e,t)):i;return n&&sG(a)||r&&Array.isArray(a)?[{key:`New item`,value:a}]:Array.isArray(a)?a.map((e,t)=>({key:`New item `+t,value:e})):sG(a)?Object.keys(a).map(e=>({key:e,value:a[e]})):[{key:`New item`,value:a}]}function gY(e,t){if(yJ(t)){var n=Ig(t.path),r=lc(e,n),i=lY(n,Object.keys(r),wg(t.path),``);return{operations:i,newSelection:MJ(e,i)}}if(bJ(t))return{operations:[{op:`replace`,path:_c(t.path),value:``}],newSelection:t};if(xJ(t)){var a=TJ(e,t),o=pY(a),s=wg(a);if(Bg(s))return{operations:[{op:`replace`,path:``,value:``}],newSelection:BJ([])};var c=Ig(s),l=lc(e,c);if(Js(l)){var u=iG(wg(jg(a)));return{operations:o,newSelection:u===0?HJ(c):UJ(c.concat(String(u-1)))}}if(Ys(l)){var d=Object.keys(l),f=wg(jg(a)),p=d.indexOf(f),m=d[p-1];return{operations:o,newSelection:p===0?HJ(c):UJ(c.concat(m))}}throw Error(`Cannot create remove operations: parent must be an Object or Array`)}throw Error(`Cannot remove: unsupported type of selection `+JSON.stringify(t))}function _Y(e,t){return Mc(e,function(e,t){if(Bg(t)||!t.every(ec))return t;var n=[];for(var r of t){var i=vY(gc(r.from)),a=vY(gc(r.path));if(!i||!a)return t;n.push({from:i,path:a,operation:r})}var o=n[0].path.parent;if(!Ys(lc(e,o))||!n.every(e=>function(e,t){return Vg(e.from.parent,t)&&Vg(e.path.parent,t)}(e,o)))return t;var s=function(e,t){var n=Object.keys(t),r=n.slice();for(var i of e){var a=r.indexOf(i.from.key);a!==-1&&(r.splice(a,1),r.push(i.path.key))}for(var o=0;o<n.length&&n[o]===r[o];)o++;return r[o]}(n,e),c=e=>e.operation,l=n.filter(e=>e.operation.from!==e.operation.path);return l.some(e=>e.path.key===s)?l.map(c):[mY(o,s),...l.map(c)]}(e,t),{before:(e,t,n)=>{if(Zs(t)){var r=gc(t.path);return{revertOperations:[...n,...yY(e,r)]}}if(ec(t)){var i=gc(t.from);return{revertOperations:t.from===t.path?[t,...yY(e,i)]:[...n,...yY(e,i)]}}return{document:e}}})}function vY(e){return e.length>0?{parent:Ig(e),key:wg(e)}:void 0}function yY(e,t){var n=Ig(t),r=wg(t),i=lc(e,n);return Ys(i)?sJ(Object.keys(i),r,!1).map(e=>mY(n,e)):[]}function bY(e){var t=e.activeIndex<e.items.length-1?e.activeIndex+1:e.items.length>0?0:-1,n=e.items[t],r=e.items.map((e,n)=>R(R({},e),{},{active:n===t}));return R(R({},e),{},{items:r,activeItem:n,activeIndex:t})}function xY(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=e.toLowerCase(),i=n?.maxResults??1/0,a=n?.columns,o=[],s=[];function c(e){o.length>=i||o.push(e)}function l(e,t){if(Js(t)){var n=s.length;s.push(`0`);for(var r=0;r<t.length;r++)if(s[n]=String(r),l(e,t[r]),o.length>=i)return;s.pop()}else if(Ys(t)){var a=Object.keys(t),u=s.length;for(var d of(s.push(``),a))if(s[u]=d,SY(d,e,s,ZG.key,c),l(e,t[d]),o.length>=i)return;s.pop()}else SY(String(t),e,s,ZG.value,c)}if(e===``)return[];if(a){if(!Array.isArray(t))throw Error(`json must be an Array when option columns is defined`);for(var u=0;u<t.length;u++){s[0]=String(u);for(var d=t[u],f=0;f<a.length;f++){var p=a[f];if(p.length===1)s[1]=p[0];else for(var m=0;m<p.length;m++)s[m+1]=p[m];for(;s.length>p.length+1;)s.pop();l(r,lc(d,p))}if(o.length>=i)break}return o}return l(r,t),o}function SY(e,t,n,r,i){var a=e.toLowerCase(),o=0,s=-1,c=-1;do(c=a.indexOf(t,s))!==-1&&(s=c+t.length,i({path:n.slice(0),field:r,fieldIndex:o,start:c,end:s}),o++);while(c!==-1)}function CY(e,t,n,r){return e.substring(0,n)+t+e.substring(r)}function wY(e,t,n){var r=e;return Ag(n,e=>{r=CY(r,t,e.start,e.end)}),r}function TY(e,t,n,r,i){var{field:a,path:o,start:s,end:c}=r;if(a===ZG.key){var l=Ig(o),u=lc(e,l),d=wg(o),f=lY(l,Object.keys(u),d,CY(d,n,s,c));return{newSelection:MJ(e,f),operations:f}}if(a===ZG.value){var p=lc(e,o);if(p===void 0)throw Error(`Cannot replace: path not found ${_c(o)}`);var m=typeof p==`string`?p:String(p),h=oJ(e,t,o),g=CY(m,n,s,c),_=[{op:`replace`,path:_c(o),value:h?g:_G(g,i)}];return{newSelection:MJ(e,_),operations:_}}throw Error(`Cannot replace: unknown type of search result field ${a}`)}function EY(e){return e.path.concat(e.field,String(e.fieldIndex))}function DY(e){var t=Fq(e)?e.searchResults.filter(e=>e.field===ZG.key):void 0;return t&&t.length>0?t:void 0}function OY(e){var t=Fq(e)?e.searchResults.filter(e=>e.field===ZG.value):void 0;return t&&t.length>0?t:void 0}var kY={createObjectDocumentState:()=>({type:`object`,properties:{}}),createArrayDocumentState:()=>({type:`array`,items:[]}),createValueDocumentState:()=>({type:`value`})};function AY(e,t){return t.reduce((t,n)=>function(e,t,n,r){return eJ(e,t,n,r,kY)}(e,t,n.path,(e,t)=>R(R({},t),{},{searchResults:t.searchResults?t.searchResults.concat(n):[n]})),void 0)}function jY(e){var t=e?.searchResults??[],n=jq(e)?Object.values(e.properties).flatMap(jY):Mq(e)?e.items.flatMap(jY):[];return t.concat(n)}OK(`/* over all fonts, sizes, and colors */
|
|
297
|
+
}`);var iY=X(`<div role="textbox" tabindex="0" contenteditable="true" spellcheck="false"></div>`);function aY(e,t){vB(t,!1);var n=$W(`jsoneditor:EditableDiv`),r=$(t,`value`,9),i=$(t,`initialValue`,9),a=$(t,`shortText`,9,!1),o=$(t,`label`,9),s=$(t,`onChange`,9),c=$(t,`onCancel`,9),l=$(t,`onFind`,9),u=$(t,`onPaste`,9,Pu),d=$(t,`onValueClass`,9,()=>``),f=B(void 0,!0),p=B(void 0,!0),m=!1;function h(){return K(f)?function(e){return e.replace(/\n$/,``)}(K(f).innerText):``}function g(e){K(f)&&iH(f,K(f).innerText=fK(e))}KU(()=>{n(`onMount`,{value:r(),initialValue:i()}),g(i()===void 0?r():i()),K(f)&&function(e){if(e.firstChild!=null){var t=document.createRange(),n=window.getSelection();t.setStart(e,1),t.collapse(!0),n?.removeAllRanges(),n?.addRange(t)}else e.focus()}(K(f))}),qU(()=>{var e=h();n(`onDestroy`,{closed:m,value:r(),newValue:e}),m||e===r()||s()(e,$G.no)}),W(()=>(J(d()),J(r())),()=>{V(p,d()(r()))}),DH(),GW(!0);var _=iY();HW(_,e=>V(f,e),()=>K(f)),G(e=>{jW(_,`aria-label`,o()),_W(_,1,e,`svelte-1r0oryi`)},[()=>pW((J(nY),K(p),J(a()),q(()=>nY(`jse-editable-div`,K(p),{"jse-short-text":a()}))))]),Y(`input`,_,function(){var e=h();e===``&&g(``),V(p,d()(e))}),Y(`keydown`,_,function(e){e.stopPropagation();var t=TK(e);if(t===`Escape`&&(e.preventDefault(),m=!0,c()()),t===`Enter`||t===`Tab`){e.preventDefault(),m=!0;var n=h();s()(n,$G.nextInside)}t===`Ctrl+F`&&(e.preventDefault(),l()(!1)),t===`Ctrl+H`&&(e.preventDefault(),l()(!0))}),Y(`paste`,_,function(e){if(e.stopPropagation(),u()&&e.clipboardData){var t=e.clipboardData.getData(`text/plain`);u()(t)}}),Y(`blur`,_,function(){var e=document.hasFocus(),t=h();n(`handleBlur`,{hasFocus:e,closed:m,value:r(),newValue:t}),document.hasFocus()&&!m&&(m=!0,t!==r()&&s()(t,$G.self))}),Z(e,_),yB()}function oY(e,t){vB(t,!1);var n=$(t,`path`,9),r=$(t,`value`,9),i=$(t,`selection`,9),a=$(t,`mode`,9),o=$(t,`parser`,9),s=$(t,`normalization`,9),c=$(t,`enforceString`,9),l=$(t,`onPatch`,9),u=$(t,`onPasteJson`,9),d=$(t,`onSelect`,9),f=$(t,`onFind`,9),p=$(t,`focus`,9),m=$(t,`findNextInside`,9);function h(e){return c()?e:_G(e,o())}function g(){d()(BJ(n())),p()()}GW(!0);var _=GV(()=>(J(s()),J(r()),q(()=>s().escapeValue(r())))),v=GV(()=>(J(KJ),J(i()),q(()=>KJ(i())?i().initialValue:void 0)));aY(e,{get value(){return K(_)},get initialValue(){return K(v)},label:`Edit value`,onChange:function(e,t){l()([{op:`replace`,path:_c(n()),value:h(s().unescapeValue(e))}],(e,r,i)=>{if(!i||Hg(n(),eY(i)))return{state:r,selection:t===$G.nextInside?m()(n()):BJ(n())}}),p()()},onCancel:g,onPaste:function(e){try{var t=o().parse(e);cG(t)&&u()({path:n(),contents:t,onPasteAsJson:()=>{g();var e=[{op:`replace`,path:_c(n()),value:t}];l()(e,(e,t)=>({state:dJ(e,t,n())}))}})}catch{}},get onFind(){return f()},onValueClass:function(e){return rY(h(s().unescapeValue(e)),a(),o())}}),yB()}function sY(e,t,n){var r=Lg(t),i=lc(e,r);if(Js(i)){var a=iG(kg(t));return n.map((e,t)=>({op:`add`,path:_c(r.concat(String(a+t))),value:e.value}))}if(Ys(i)){var o=kg(t),s=Object.keys(i),c=o===void 0?[]:sJ(s,o,!0);return[...n.map(e=>{var t=PK(e.key,s);return{op:`add`,path:_c(r.concat(t)),value:e.value}}),...c.map(e=>mY(r,e))]}throw Error(`Cannot create insert operations: parent must be an Object or Array`)}function cY(e,t,n){var r=lc(e,t);if(Array.isArray(r)){var i=r.length;return n.map((e,n)=>({op:`add`,path:_c(t.concat(String(i+n))),value:e.value}))}return n.map(e=>{var n=PK(e.key,Object.keys(r));return{op:`add`,path:_c(t.concat(n)),value:e.value}})}function lY(e,t,n,r){var i=PK(r,t.filter(e=>e!==n)),a=sJ(t,n,!1);return[{op:`move`,from:_c(e.concat(n)),path:_c(e.concat(i))},...a.map(t=>mY(e,t))]}function uY(e,t){var n=kg(t);if(Vg(n))throw Error(`Cannot duplicate root object`);var r=Lg(n),i=kg(n),a=lc(e,r);if(Js(a)){var o=kg(t),s=o?iG(kg(o))+1:0;return[...t.map((e,t)=>({op:`copy`,from:_c(e),path:_c(r.concat(String(t+s)))}))]}if(Ys(a)){var c=Object.keys(a),l=i===void 0?[]:sJ(c,i,!1);return[...t.map(e=>{var t=PK(kg(e),c);return{op:`copy`,from:_c(e),path:_c(r.concat(t))}}),...l.map(e=>mY(r,e))]}throw Error(`Cannot create duplicate operations: parent must be an Object or Array`)}function dY(e,t){if(bJ(t))return[{op:`move`,from:_c(t.path),path:``}];if(!xJ(t))throw Error(`Cannot create extract operations: parent must be an Object or Array`);var n=lc(e,Lg(t.focusPath));if(Js(n))return[{op:`replace`,path:``,value:TJ(e,t).map(e=>n[iG(kg(e))])}];if(Ys(n)){var r={};return TJ(e,t).forEach(e=>{var t=String(kg(e));r[t]=n[t]}),[{op:`replace`,path:``,value:r}]}throw Error(`Cannot extract: unsupported type of selection `+JSON.stringify(t))}function fY(e,t,n,r){if(yJ(t)){var i=OG(n,r),a=Lg(t.path),o=lc(e,a);return lY(a,Object.keys(o),kg(t.path),typeof i==`string`?i:n)}if(bJ(t)||xJ(t)&&Vg(t.focusPath))try{return[{op:`replace`,path:_c(eY(t)),value:kG(n,e=>DG(e,r))}]}catch{return[{op:`replace`,path:_c(eY(t)),value:n}]}if(xJ(t)){var s=hY(n,r);return function(e,t,n){var r=Lg(Mg(t)),i=lc(e,r);if(Js(i)){var a=Mg(t),o=a?iG(kg(a)):0;return[...pY(t),...n.map((e,t)=>({op:`add`,path:_c(r.concat(String(t+o))),value:e.value}))]}if(Ys(i)){var s=kg(t),c=Lg(s),l=kg(s),u=Object.keys(i),d=l===void 0?[]:sJ(u,l,!1),f=new Set(t.map(e=>kg(e))),p=u.filter(e=>!f.has(e));return[...pY(t),...n.map(e=>{var t=PK(e.key,p);return{op:`add`,path:_c(c.concat(t)),value:e.value}}),...d.map(e=>mY(c,e))]}throw Error(`Cannot create replace operations: parent must be an Object or Array`)}(e,TJ(e,t),s)}if(_J(t)){var c=hY(n,r),l=t.path,u=Lg(l),d=lc(e,u);if(Js(d)){var f=iG(kg(l));return sY(e,u.concat(String(f+1)),c)}if(Ys(d)){var p=String(kg(l)),m=Object.keys(d);if(Vg(m)||kg(m)===p)return cY(e,u,c);var h=m[m.indexOf(p)+1];return sY(e,u.concat(h),c)}throw Error(`Cannot create insert operations: parent must be an Object or Array`)}if(vJ(t)){var g=hY(n,r),_=t.path,v=lc(e,_);if(Js(v))return sY(e,_.concat(`0`),g);if(Ys(v)){var y=Object.keys(v);if(Vg(y))return cY(e,_,g);var b=Mg(y);return sY(e,_.concat(b),g)}throw Error(`Cannot create insert operations: parent must be an Object or Array`)}throw Error(`Cannot insert: unsupported type of selection `+JSON.stringify(t))}function pY(e){return e.map(e=>({op:`remove`,path:_c(e)})).reverse()}function mY(e,t){return{op:`move`,from:_c(e.concat(t)),path:_c(e.concat(t))}}function hY(e,t){var n=/^\s*{/.test(e),r=/^\s*\[/.test(e),i=OG(e,t),a=i===void 0?kG(e,e=>DG(e,t)):i;return n&&sG(a)||r&&Array.isArray(a)?[{key:`New item`,value:a}]:Array.isArray(a)?a.map((e,t)=>({key:`New item `+t,value:e})):sG(a)?Object.keys(a).map(e=>({key:e,value:a[e]})):[{key:`New item`,value:a}]}function gY(e,t){if(yJ(t)){var n=Lg(t.path),r=lc(e,n),i=lY(n,Object.keys(r),kg(t.path),``);return{operations:i,newSelection:MJ(e,i)}}if(bJ(t))return{operations:[{op:`replace`,path:_c(t.path),value:``}],newSelection:t};if(xJ(t)){var a=TJ(e,t),o=pY(a),s=kg(a);if(Vg(s))return{operations:[{op:`replace`,path:``,value:``}],newSelection:BJ([])};var c=Lg(s),l=lc(e,c);if(Js(l)){var u=iG(kg(Mg(a)));return{operations:o,newSelection:u===0?HJ(c):UJ(c.concat(String(u-1)))}}if(Ys(l)){var d=Object.keys(l),f=kg(Mg(a)),p=d.indexOf(f),m=d[p-1];return{operations:o,newSelection:p===0?HJ(c):UJ(c.concat(m))}}throw Error(`Cannot create remove operations: parent must be an Object or Array`)}throw Error(`Cannot remove: unsupported type of selection `+JSON.stringify(t))}function _Y(e,t){return Mc(e,function(e,t){if(Vg(t)||!t.every(ec))return t;var n=[];for(var r of t){var i=vY(gc(r.from)),a=vY(gc(r.path));if(!i||!a)return t;n.push({from:i,path:a,operation:r})}var o=n[0].path.parent;if(!Ys(lc(e,o))||!n.every(e=>function(e,t){return Hg(e.from.parent,t)&&Hg(e.path.parent,t)}(e,o)))return t;var s=function(e,t){var n=Object.keys(t),r=n.slice();for(var i of e){var a=r.indexOf(i.from.key);a!==-1&&(r.splice(a,1),r.push(i.path.key))}for(var o=0;o<n.length&&n[o]===r[o];)o++;return r[o]}(n,e),c=e=>e.operation,l=n.filter(e=>e.operation.from!==e.operation.path);return l.some(e=>e.path.key===s)?l.map(c):[mY(o,s),...l.map(c)]}(e,t),{before:(e,t,n)=>{if(Zs(t)){var r=gc(t.path);return{revertOperations:[...n,...yY(e,r)]}}if(ec(t)){var i=gc(t.from);return{revertOperations:t.from===t.path?[t,...yY(e,i)]:[...n,...yY(e,i)]}}return{document:e}}})}function vY(e){return e.length>0?{parent:Lg(e),key:kg(e)}:void 0}function yY(e,t){var n=Lg(t),r=kg(t),i=lc(e,n);return Ys(i)?sJ(Object.keys(i),r,!1).map(e=>mY(n,e)):[]}function bY(e){var t=e.activeIndex<e.items.length-1?e.activeIndex+1:e.items.length>0?0:-1,n=e.items[t],r=e.items.map((e,n)=>R(R({},e),{},{active:n===t}));return R(R({},e),{},{items:r,activeItem:n,activeIndex:t})}function xY(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=e.toLowerCase(),i=n?.maxResults??1/0,a=n?.columns,o=[],s=[];function c(e){o.length>=i||o.push(e)}function l(e,t){if(Js(t)){var n=s.length;s.push(`0`);for(var r=0;r<t.length;r++)if(s[n]=String(r),l(e,t[r]),o.length>=i)return;s.pop()}else if(Ys(t)){var a=Object.keys(t),u=s.length;for(var d of(s.push(``),a))if(s[u]=d,SY(d,e,s,ZG.key,c),l(e,t[d]),o.length>=i)return;s.pop()}else SY(String(t),e,s,ZG.value,c)}if(e===``)return[];if(a){if(!Array.isArray(t))throw Error(`json must be an Array when option columns is defined`);for(var u=0;u<t.length;u++){s[0]=String(u);for(var d=t[u],f=0;f<a.length;f++){var p=a[f];if(p.length===1)s[1]=p[0];else for(var m=0;m<p.length;m++)s[m+1]=p[m];for(;s.length>p.length+1;)s.pop();l(r,lc(d,p))}if(o.length>=i)break}return o}return l(r,t),o}function SY(e,t,n,r,i){var a=e.toLowerCase(),o=0,s=-1,c=-1;do(c=a.indexOf(t,s))!==-1&&(s=c+t.length,i({path:n.slice(0),field:r,fieldIndex:o,start:c,end:s}),o++);while(c!==-1)}function CY(e,t,n,r){return e.substring(0,n)+t+e.substring(r)}function wY(e,t,n){var r=e;return see(n,e=>{r=CY(r,t,e.start,e.end)}),r}function TY(e,t,n,r,i){var{field:a,path:o,start:s,end:c}=r;if(a===ZG.key){var l=Lg(o),u=lc(e,l),d=kg(o),f=lY(l,Object.keys(u),d,CY(d,n,s,c));return{newSelection:MJ(e,f),operations:f}}if(a===ZG.value){var p=lc(e,o);if(p===void 0)throw Error(`Cannot replace: path not found ${_c(o)}`);var m=typeof p==`string`?p:String(p),h=oJ(e,t,o),g=CY(m,n,s,c),_=[{op:`replace`,path:_c(o),value:h?g:_G(g,i)}];return{newSelection:MJ(e,_),operations:_}}throw Error(`Cannot replace: unknown type of search result field ${a}`)}function EY(e){return e.path.concat(e.field,String(e.fieldIndex))}function DY(e){var t=Fq(e)?e.searchResults.filter(e=>e.field===ZG.key):void 0;return t&&t.length>0?t:void 0}function OY(e){var t=Fq(e)?e.searchResults.filter(e=>e.field===ZG.value):void 0;return t&&t.length>0?t:void 0}var kY={createObjectDocumentState:()=>({type:`object`,properties:{}}),createArrayDocumentState:()=>({type:`array`,items:[]}),createValueDocumentState:()=>({type:`value`})};function AY(e,t){return t.reduce((t,n)=>function(e,t,n,r){return eJ(e,t,n,r,kY)}(e,t,n.path,(e,t)=>R(R({},t),{},{searchResults:t.searchResults?t.searchResults.concat(n):[n]})),void 0)}function jY(e){var t=e?.searchResults??[],n=jq(e)?Object.values(e.properties).flatMap(jY):Mq(e)?e.items.flatMap(jY):[];return t.concat(n)}OK(`/* over all fonts, sizes, and colors */
|
|
298
298
|
/* "consolas" for Windows, "menlo" for Mac with fallback to "monaco", 'Ubuntu Mono' for Ubuntu */
|
|
299
299
|
/* (at Mac this font looks too large at 14px, but 13px is too small for the font on Windows) */
|
|
300
300
|
/* main, menu, modal */
|
|
@@ -320,7 +320,7 @@ div.jse-editable-div.jse-empty.svelte-1r0oryi::after {
|
|
|
320
320
|
.jse-highlight.jse-active.svelte-19qyvy6 {
|
|
321
321
|
background-color: var(--jse-search-match-active-color, var(--jse-search-match-color, #ffe665));
|
|
322
322
|
outline: var(--jse-search-match-outline, 2px solid #e0be00);
|
|
323
|
-
}`);var MY=X(`<span> </span>`);function NY(e,t){vB(t,!1);var n=B(),r=$(t,`text`,8),i=$(t,`searchResultItems`,8);W(()=>(J(r()),J(i())),()=>{V(n,function(e,t){var n=[],r=0;for(var i of t){var a=e.slice(r,i.start);a!==``&&n.push({resultIndex:void 0,type:`normal`,text:a,active:!1});var o=e.slice(i.start,i.end);n.push({resultIndex:i.resultIndex,type:`highlight`,text:o,active:i.active}),r=i.end}var s=
|
|
323
|
+
}`);var MY=X(`<span> </span>`);function NY(e,t){vB(t,!1);var n=B(),r=$(t,`text`,8),i=$(t,`searchResultItems`,8);W(()=>(J(r()),J(i())),()=>{V(n,function(e,t){var n=[],r=0;for(var i of t){var a=e.slice(r,i.start);a!==``&&n.push({resultIndex:void 0,type:`normal`,text:a,active:!1});var o=e.slice(i.start,i.end);n.push({resultIndex:i.resultIndex,type:`highlight`,text:o,active:i.active}),r=i.end}var s=kg(t);return s&&s.end<e.length&&n.push({type:`normal`,text:e.slice(s.end),resultIndex:void 0,active:!1}),n}(String(r()),i()))}),DH(),GW();var a=kU();nW(hH(a),1,()=>K(n),eW,(e,t)=>{var n=kU(),r=hH(n),i=e=>{var n=OU();G(()=>PU(n,(K(t),q(()=>K(t).text)))),Z(e,n)},a=e=>{var n,r=MY(),i=H(r);G((e,a)=>{n=_W(r,1,`jse-highlight svelte-19qyvy6`,null,n,{"jse-active":K(t).active}),jW(r,`data-search-result-index`,e),PU(i,a)},[()=>(K(t),q(()=>String(K(t).resultIndex))),()=>(J(fK),K(t),q(()=>fK(K(t).text)))]),Z(e,r)};Q(r,e=>{K(t),q(()=>K(t).type===`normal`)?e(i):e(a,-1)}),Z(e,n)}),Z(e,a),yB()}function PY(e){var t=1e3;if(e<900)return e.toFixed()+` B`;var n=e/t;if(n<900)return n.toFixed(1)+` KB`;var r=n/t;if(r<900)return r.toFixed(1)+` MB`;var i=r/t;return i<900?i.toFixed(1)+` GB`:(i/t).toFixed(1)+` TB`}OK(`/* over all fonts, sizes, and colors */
|
|
324
324
|
/* "consolas" for Windows, "menlo" for Mac with fallback to "monaco", 'Ubuntu Mono' for Ubuntu */
|
|
325
325
|
/* (at Mac this font looks too large at 14px, but 13px is too small for the font on Windows) */
|
|
326
326
|
/* main, menu, modal */
|
|
@@ -480,7 +480,7 @@ div.jse-editable-div.jse-empty.svelte-1r0oryi::after {
|
|
|
480
480
|
vertical-align: middle;
|
|
481
481
|
display: inline-flex;
|
|
482
482
|
color: var(--jse-value-color-number, #ee422e);
|
|
483
|
-
}`);var HY=X(`<div class="jse-timestamp svelte-1jcpman"><!></div>`);function UY(e,t){vB(t,!1);var n=B(void 0,!0),r=_B(`absolute-popup`),i=$(t,`value`,9);W(()=>J(i()),()=>{V(n,`Time: ${new Date(i()).toString()}`)}),DH(),GW(!0);var a=HY();GK(H(a),{get data(){return I_}}),uW(a,(e,t)=>VY?.(e,t),()=>R({text:K(n)},r)),Z(e,a),yB()}function WY(e){var t=[];return!e.isEditing&&lG(e.value)&&t.push({component:qK,props:e}),!e.isEditing&&pG(e.value)&&t.push({component:ZK,props:e}),e.isEditing&&t.push({component:oY,props:e}),e.isEditing||t.push({component:RY,props:e}),!e.isEditing&&uG(e.value)&&t.push({component:UY,props:e}),t}function GY(e){return e.map((e,t)=>JY.test(e)?`[`+e+`]`:/[.[\]]/.test(e)||e===``?`["`+function(e){return e.replace(/"/g,`\\"`)}(e)+`"]`:(t>0?`.`:``)+e).join(``)}function KY(e){for(var t=[],n=0;n<e.length;)e[n]===`.`&&n++,e[n]===`[`?(n++,e[n]===`"`?(n++,t.push(r(e=>e===`"`,!0)),i(`"`)):t.push(r(e=>e===`]`)),i(`]`)):t.push(r(e=>e===`.`||e===`[`));function r(t){for(var r=arguments.length>1&&arguments[1]!==void 0&&arguments[1],i=``;n<e.length&&!t(e[n]);)r&&e[n]===`\\`&&e[n+1]===`"`?(i+=`"`,n+=2):(i+=e[n],n++);return i}function i(t){if(e[n]!==t)throw SyntaxError(`Invalid JSON path: ${t} expected at position ${n}`);n++}return t}function qY(e){return{value:e,label:Bg(e)?`(item root)`:GY(e)}}var JY=/^\d+$/,YY={},XY={showWizard:!0,showOriginal:!0},ZY=Math.min,QY=Math.max,$Y=Math.round,eX=Math.floor,tX=e=>({x:e,y:e}),nX={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function rX(e,t,n){return QY(e,ZY(t,n))}function iX(e,t){return typeof e==`function`?e(t):e}function aX(e){return e.split(`-`)[0]}function oX(e){return e.split(`-`)[1]}function sX(e){return e===`x`?`y`:`x`}function cX(e){return e===`y`?`height`:`width`}function lX(e){var t=e[0];return t===`t`||t===`b`?`y`:`x`}function uX(e){return sX(lX(e))}function dX(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var fX=[`left`,`right`],pX=[`right`,`left`],mX=[`top`,`bottom`],hX=[`bottom`,`top`];function gX(e,t,n,r){var i=oX(e),a=function(e,t,n){switch(e){case`top`:case`bottom`:return n?t?pX:fX:t?fX:pX;case`left`:case`right`:return t?mX:hX;default:return[]}}(aX(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(dX)))),a}function _X(e){var t=aX(e);return nX[t]+e.slice(t.length)}function vX(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:function(e){return R({top:0,right:0,bottom:0,left:0},e)}(e)}function yX(e){var{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function bX(e,t,n){var r,{reference:i,floating:a}=e,o=lX(t),s=uX(t),c=cX(s),l=aX(t),u=o===`y`,d=i.x+i.width/2-a.width/2,f=i.y+i.height/2-a.height/2,p=i[c]/2-a[c]/2;switch(l){case`top`:r={x:d,y:i.y-a.height};break;case`bottom`:r={x:d,y:i.y+i.height};break;case`right`:r={x:i.x+i.width,y:f};break;case`left`:r={x:i.x-a.width,y:f};break;default:r={x:i.x,y:i.y}}switch(oX(t)){case`start`:r[s]-=p*(n&&u?-1:1);break;case`end`:r[s]+=p*(n&&u?-1:1)}return r}function xX(e,t){return SX.apply(this,arguments)}function SX(){return SX=pz(function*(e,t){var n;t===void 0&&(t={});var{x:r,y:i,platform:a,rects:o,elements:s,strategy:c}=e,{boundary:l=`clippingAncestors`,rootBoundary:u=`viewport`,elementContext:d=`floating`,altBoundary:f=!1,padding:p=0}=iX(t,e),m=vX(p),h=s[f?d===`floating`?`reference`:`floating`:d],g=yX(yield a.getClippingRect({element:(n=yield a.isElement==null?void 0:a.isElement(h))==null||n?h:h.contextElement||(yield a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:l,rootBoundary:u,strategy:c})),_=d===`floating`?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,v=yield a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating),y=(yield a.isElement==null?void 0:a.isElement(v))&&(yield a.getScale==null?void 0:a.getScale(v))||{x:1,y:1},b=yX(a.convertOffsetParentRelativeRectToViewportRelativeRect?yield a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:_,offsetParent:v,strategy:c}):_);return{top:(g.top-b.top+m.top)/y.y,bottom:(b.bottom-g.bottom+m.bottom)/y.y,left:(g.left-b.left+m.left)/y.x,right:(b.right-g.right+m.right)/y.x}}),SX.apply(this,arguments)}var CX=function(){var e=pz(function*(e,t,n){for(var{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:R(R({},o),{},{detectOverflow:xX}),c=yield o.isRTL==null?void 0:o.isRTL(t),l=yield o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=bX(l,r,c),f=r,p=0,m={},h=0;h<a.length;h++){var g=a[h];if(g){var{name:_,fn:v}=g,{x:y,y:b,data:x,reset:S}=yield v({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=y??u,d=b??d,m[_]=R(R({},m[_]),x),S&&p<50&&(p++,typeof S==`object`&&(S.placement&&(f=S.placement),S.rects&&(l=!0===S.rects?yield o.getElementRects({reference:e,floating:t,strategy:i}):S.rects),{x:u,y:d}=bX(l,f,c)),h=-1)}}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}});return function(t,n,r){return e.apply(this,arguments)}}(),wX=new Set([`left`,`top`]);function TX(){return TX=pz(function*(e,t){var{placement:n,platform:r,elements:i}=e,a=yield r.isRTL==null?void 0:r.isRTL(i.floating),o=aX(n),s=oX(n),c=lX(n)===`y`,l=wX.has(o)?-1:1,u=a&&c?-1:1,d=iX(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?-1*m:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}),TX.apply(this,arguments)}function EX(){return typeof window<`u`}function DX(e){return AX(e)?(e.nodeName||``).toLowerCase():`#document`}function OX(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function kX(e){return((AX(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function AX(e){return!!EX()&&(e instanceof Node||e instanceof OX(e).Node)}function jX(e){return!!EX()&&(e instanceof Element||e instanceof OX(e).Element)}function MX(e){return!!EX()&&(e instanceof HTMLElement||e instanceof OX(e).HTMLElement)}function NX(e){return!(!EX()||typeof ShadowRoot>`u`)&&(e instanceof ShadowRoot||e instanceof OX(e).ShadowRoot)}function PX(e){var{overflow:t,overflowX:n,overflowY:r,display:i}=WX(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function FX(e){return/^(table|td|th)$/.test(DX(e))}function IX(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var LX,RX=/transform|translate|scale|rotate|perspective|filter/,zX=/paint|layout|strict|content/,BX=e=>!!e&&e!==`none`;function VX(e){var t=jX(e)?WX(e):e;return BX(t.transform)||BX(t.translate)||BX(t.scale)||BX(t.rotate)||BX(t.perspective)||!HX()&&(BX(t.backdropFilter)||BX(t.filter))||RX.test(t.willChange||``)||zX.test(t.contain||``)}function HX(){return LX??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),LX}function UX(e){return/^(html|body|#document)$/.test(DX(e))}function WX(e){return OX(e).getComputedStyle(e)}function GX(e){return jX(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function KX(e){if(DX(e)===`html`)return e;var t=e.assignedSlot||e.parentNode||NX(e)&&e.host||kX(e);return NX(t)?t.host:t}function qX(e){var t=KX(e);return UX(t)?e.ownerDocument?e.ownerDocument.body:e.body:MX(t)&&PX(t)?t:qX(t)}function JX(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);var r=qX(e),i=r===e.ownerDocument?.body,a=OX(r);if(i){var o=YX(a);return t.concat(a,a.visualViewport||[],PX(r)?r:[],o&&n?JX(o):[])}return t.concat(r,JX(r,[],n))}function YX(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function XX(e){var t=WX(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=MX(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=$Y(n)!==a||$Y(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function ZX(e){return jX(e)?e:e.contextElement}function QX(e){var t=ZX(e);if(!MX(t))return tX(1);var n=t.getBoundingClientRect(),{width:r,height:i,$:a}=XX(t),o=(a?$Y(n.width):n.width)/r,s=(a?$Y(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}var $X=tX(0);function eZ(e){var t=OX(e);return HX()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:$X}function tZ(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);var i=e.getBoundingClientRect(),a=ZX(e),o=tX(1);t&&(r?jX(r)&&(o=QX(r)):o=QX(e));var s=function(e,t,n){return t===void 0&&(t=!1),!(!n||t&&n!==OX(e))&&t}(a,n,r)?eZ(a):tX(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a)for(var f=OX(a),p=r&&jX(r)?OX(r):r,m=f,h=YX(m);h&&r&&p!==m;){var g=QX(h),_=h.getBoundingClientRect(),v=WX(h),y=_.left+(h.clientLeft+parseFloat(v.paddingLeft))*g.x,b=_.top+(h.clientTop+parseFloat(v.paddingTop))*g.y;c*=g.x,l*=g.y,u*=g.x,d*=g.y,c+=y,l+=b,h=YX(m=OX(h))}return yX({width:u,height:d,x:c,y:l})}function nZ(e,t){var n=GX(e).scrollLeft;return t?t.left+n:tZ(kX(e)).left+n}function rZ(e,t){var n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-nZ(e,n),y:n.top+t.scrollTop}}function iZ(e,t,n){var r;if(t===`viewport`)r=function(e,t){var n=OX(e),r=kX(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;var l=HX();(!l||l&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}var u=nZ(r);if(u<=0){var d=r.ownerDocument,f=d.body,p=getComputedStyle(f),m=d.compatMode===`CSS1Compat`&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,h=Math.abs(r.clientWidth-f.clientWidth-m);h<=25&&(a-=h)}else u<=25&&(a+=u);return{width:a,height:o,x:s,y:c}}(e,n);else if(t===`document`)r=function(e){var t=kX(e),n=GX(e),r=e.ownerDocument.body,i=QY(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=QY(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+nZ(e),s=-n.scrollTop;return WX(r).direction===`rtl`&&(o+=QY(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}(kX(e));else if(jX(t))r=function(e,t){var n=tZ(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=MX(e)?QX(e):tX(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}(t,n);else{var i=eZ(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return yX(r)}function aZ(e,t){var n=KX(e);return!(n===t||!jX(n)||UX(n))&&(WX(n).position===`fixed`||aZ(n,t))}function oZ(e,t,n){var r=MX(t),i=kX(t),a=n===`fixed`,o=tZ(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=tX(0);function l(){c.x=nZ(i)}if(r||!r&&!a)if((DX(t)!==`body`||PX(i))&&(s=GX(t)),r){var u=tZ(t,!0,a,t);c.x=u.x+t.clientLeft,c.y=u.y+t.clientTop}else i&&l();a&&!r&&i&&l();var d=!i||r||a?tX(0):rZ(i,s);return{x:o.left+s.scrollLeft-c.x-d.x,y:o.top+s.scrollTop-c.y-d.y,width:o.width,height:o.height}}function sZ(e){return WX(e).position===`static`}function cZ(e,t){if(!MX(e)||WX(e).position===`fixed`)return null;if(t)return t(e);var n=e.offsetParent;return kX(e)===n&&(n=n.ownerDocument.body),n}function lZ(e,t){var n=OX(e);if(IX(e))return n;if(!MX(e)){for(var r=KX(e);r&&!UX(r);){if(jX(r)&&!sZ(r))return r;r=KX(r)}return n}for(var i=cZ(e,t);i&&FX(i)&&sZ(i);)i=cZ(i,t);return i&&UX(i)&&sZ(i)&&!VX(i)?n:i||function(e){for(var t=KX(e);MX(t)&&!UX(t);){if(VX(t))return t;if(IX(t))return null;t=KX(t)}return null}(e)||n}var uZ={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){var{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=kX(r),s=!!t&&IX(t.floating);if(r===o||s&&a)return n;var c={scrollLeft:0,scrollTop:0},l=tX(1),u=tX(0),d=MX(r);if((d||!d&&!a)&&((DX(r)!==`body`||PX(o))&&(c=GX(r)),d)){var f=tZ(r);l=QX(r),u.x=f.x+r.clientLeft,u.y=f.y+r.clientTop}var p=!o||d||a?tX(0):rZ(o,c);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+p.x,y:n.y*l.y-c.scrollTop*l.y+u.y+p.y}},getDocumentElement:kX,getClippingRect:function(e){for(var{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?IX(t)?[]:function(e,t){var n=t.get(e);if(n)return n;for(var r=JX(e,[],!1).filter(e=>jX(e)&&DX(e)!==`body`),i=null,a=WX(e).position===`fixed`,o=a?KX(e):e;jX(o)&&!UX(o);){var s=WX(o),c=VX(o);c||s.position!==`fixed`||(i=null),(a?!c&&!i:!c&&s.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||PX(o)&&!c&&aZ(e,o))?r=r.filter(e=>e!==o):i=s,o=KX(o)}return t.set(e,r),r}(t,this._c):[].concat(n),r],o=iZ(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left,d=1;d<a.length;d++){var f=iZ(t,a[d],i);s=QY(f.top,s),c=ZY(f.right,c),l=ZY(f.bottom,l),u=QY(f.left,u)}return{width:c-u,height:l-s,x:u,y:s}},getOffsetParent:lZ,getElementRects:function(){var e=pz(function*(e){var t=this.getOffsetParent||lZ,n=this.getDimensions,r=yield n(e.floating);return{reference:oZ(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}});return function(t){return e.apply(this,arguments)}}(),getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){var{width:t,height:n}=XX(e);return{width:t,height:n}},getScale:QX,isElement:jX,isRTL:function(e){return WX(e).direction===`rtl`}};function dZ(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function fZ(e,t,n,r){r===void 0&&(r={});var{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=ZX(e),u=i||a?[...l?JX(l):[],...t?JX(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});var d,f=l&&s?function(e,t){var n,r=null,i=kX(e);function a(){var e;clearTimeout(n),(e=r)==null||e.disconnect(),r=null}return function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();var l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),f&&p){var m={rootMargin:-eX(d)+`px `+-eX(i.clientWidth-(u+f))+`px `+-eX(i.clientHeight-(d+p))+`px `+-eX(u)+`px`,threshold:QY(0,ZY(1,c))||1},h=!0;try{r=new IntersectionObserver(g,R(R({},m),{},{root:i.ownerDocument}))}catch{r=new IntersectionObserver(g,m)}r.observe(e)}function g(t){var r=t[0].intersectionRatio;if(r!==c){if(!h)return o();r?o(!1,r):n=setTimeout(()=>{o(!1,1e-7)},1e3)}r!==1||dZ(l,e.getBoundingClientRect())||o(),h=!1}}(!0),a}(l,n):null,p=-1,m=null;o&&(m=new ResizeObserver(e=>{var[r]=e;r&&r.target===l&&m&&t&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;(e=m)==null||e.observe(t)})),n()}),l&&!c&&m.observe(l),t&&m.observe(t));var h=c?tZ(e):null;return c&&function t(){var r=tZ(e);h&&!dZ(h,r)&&n(),h=r,d=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),f?.(),(e=m)==null||e.disconnect(),m=null,c&&cancelAnimationFrame(d)}}var pZ=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,fn:t=>pz(function*(){var n,{x:r,y:i,placement:a,middlewareData:o}=t,s=yield function(e,t){return TX.apply(this,arguments)}(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:R(R({},s),{},{placement:a})}})()}},mZ=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,fn:t=>pz(function*(){var{x:n,y:r,placement:i,platform:a}=t,o=iX(e,t),{mainAxis:s=!0,crossAxis:c=!1,limiter:l={fn:e=>{var{x:t,y:n}=e;return{x:t,y:n}}}}=o,u=uz(o,lz),d={x:n,y:r},f=yield a.detectOverflow(t,u),p=lX(aX(i)),m=sX(p),h=d[m],g=d[p];if(s){var _=m===`y`?`bottom`:`right`;h=rX(h+f[m===`y`?`top`:`left`],h,h-f[_])}if(c){var v=p===`y`?`bottom`:`right`;g=rX(g+f[p===`y`?`top`:`left`],g,g-f[v])}var y=l.fn(R(R({},t),{},{[m]:h,[p]:g}));return R(R({},y),{},{data:{x:y.x-n,y:y.y-r,enabled:{[m]:s,[p]:c}}})})()}},hZ=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,fn:t=>pz(function*(){var n,{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,l=iX(e,t),{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p=`bestFit`,fallbackAxisSideDirection:m=`none`,flipAlignment:h=!0}=l,g=uz(l,cz);if((n=i.arrow)!=null&&n.alignmentOffset)return{};var _=aX(r),v=lX(o),y=aX(o)===o,b=yield s.isRTL==null?void 0:s.isRTL(c.floating),x=f||(y||!h?[_X(o)]:function(e){var t=_X(e);return[dX(e),t,dX(t)]}(o)),S=m!==`none`;!f&&S&&x.push(...gX(o,h,m,b));var C=[o,...x],w=yield s.detectOverflow(t,g),T=[],E=i.flip?.overflows||[];if(u&&T.push(w[_]),d){var ee=function(e,t,n){n===void 0&&(n=!1);var r=oX(e),i=uX(e),a=cX(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=_X(o)),[o,_X(o)]}(r,a,b);T.push(w[ee[0]],w[ee[1]])}if(E=[...E,{placement:r,overflows:T}],!T.every(e=>e<=0)){var te=(i.flip?.index||0)+1,D=C[te];if(D&&(!(d===`alignment`&&v!==lX(D))||E.every(e=>lX(e.placement)!==v||e.overflows[0]>0)))return{data:{index:te,overflows:E},reset:{placement:D}};var ne=E.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!ne)switch(p){case`bestFit`:var re=E.filter(e=>{if(S){var t=lX(e.placement);return t===v||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];re&&(ne=re);break;case`initialPlacement`:ne=o}if(r!==ne)return{reset:{placement:ne}}}return{}})()}};function gZ(e){var t,n,r={autoUpdate:!0},i=e,a=t=>R(R(R({},r),e||{}),t||{}),o=e=>{t&&n&&(i=a(e),((e,t,n)=>{var r=new Map,i=R({platform:uZ},n),a=R(R({},i.platform),{},{_c:r});return CX(e,t,R(R({},i),{},{platform:a}))})(t,n,i).then(e=>{var t;Object.assign(n.style,{position:e.strategy,left:`${e.x}px`,top:`${e.y}px`}),(t=i)!=null&&t.onComputed&&i.onComputed(e)}))},s=e=>{qU(e.subscribe(e=>{t===void 0?(t=e,o()):(Object.assign(t,e),o())}))};return[e=>{if(`subscribe`in e)return s(e),{};t=e,o()},(e,r)=>{var s;n=e,i=a(r),setTimeout(()=>o(r),0),o(r);var c=()=>{s&&=(s(),void 0)},l=function(){var{autoUpdate:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:i||{};c(),!1!==e&&fU().then(()=>fZ(t,n,()=>o(i),!0===e?{}:e))};return s=l(),{update(e){o(e),s=l(e)},destroy(){c()}}},o]}function _Z(e){var{loadOptions:t,filterText:n,items:r,multiple:i,value:a,itemId:o,groupBy:s,filterSelectedItems:c,itemFilter:l,convertStringItemsToObjects:u,filterGroupedItems:d,label:f}=e;if(r&&t)return r;if(!r)return[];r&&r.length>0&&typeof r[0]!=`object`&&(r=u(r));var p=r.filter(e=>{var t=l(e[f],n,e);return t&&i&&a!=null&&a.length&&(t=!a.some(t=>!!c&&t[o]===e[o])),t});return s&&(p=d(p)),p}function vZ(e){return yZ.apply(this,arguments)}function yZ(){return(yZ=pz(function*(e){var{dispatch:t,loadOptions:n,convertStringItemsToObjects:r,filterText:i}=e,a=yield n(i).catch(e=>{console.warn(`svelte-select loadOptions error :>> `,e),t(`error`,{type:`loadOptions`,details:e})});if(a&&!a.cancelled)return a?(a&&a.length>0&&typeof a[0]!=`object`&&(a=r(a)),t(`loaded`,{items:a})):a=[],{filteredItems:a,loading:!1,focused:!0,listOpen:!0}})).apply(this,arguments)}OK(`
|
|
483
|
+
}`);var HY=X(`<div class="jse-timestamp svelte-1jcpman"><!></div>`);function UY(e,t){vB(t,!1);var n=B(void 0,!0),r=_B(`absolute-popup`),i=$(t,`value`,9);W(()=>J(i()),()=>{V(n,`Time: ${new Date(i()).toString()}`)}),DH(),GW(!0);var a=HY();GK(H(a),{get data(){return I_}}),uW(a,(e,t)=>VY?.(e,t),()=>R({text:K(n)},r)),Z(e,a),yB()}function WY(e){var t=[];return!e.isEditing&&lG(e.value)&&t.push({component:qK,props:e}),!e.isEditing&&pG(e.value)&&t.push({component:ZK,props:e}),e.isEditing&&t.push({component:oY,props:e}),e.isEditing||t.push({component:RY,props:e}),!e.isEditing&&uG(e.value)&&t.push({component:UY,props:e}),t}function GY(e){return e.map((e,t)=>JY.test(e)?`[`+e+`]`:/[.[\]]/.test(e)||e===``?`["`+function(e){return e.replace(/"/g,`\\"`)}(e)+`"]`:(t>0?`.`:``)+e).join(``)}function KY(e){for(var t=[],n=0;n<e.length;)e[n]===`.`&&n++,e[n]===`[`?(n++,e[n]===`"`?(n++,t.push(r(e=>e===`"`,!0)),i(`"`)):t.push(r(e=>e===`]`)),i(`]`)):t.push(r(e=>e===`.`||e===`[`));function r(t){for(var r=arguments.length>1&&arguments[1]!==void 0&&arguments[1],i=``;n<e.length&&!t(e[n]);)r&&e[n]===`\\`&&e[n+1]===`"`?(i+=`"`,n+=2):(i+=e[n],n++);return i}function i(t){if(e[n]!==t)throw SyntaxError(`Invalid JSON path: ${t} expected at position ${n}`);n++}return t}function qY(e){return{value:e,label:Vg(e)?`(item root)`:GY(e)}}var JY=/^\d+$/,YY={},XY={showWizard:!0,showOriginal:!0},ZY=Math.min,QY=Math.max,$Y=Math.round,eX=Math.floor,tX=e=>({x:e,y:e}),nX={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function rX(e,t,n){return QY(e,ZY(t,n))}function iX(e,t){return typeof e==`function`?e(t):e}function aX(e){return e.split(`-`)[0]}function oX(e){return e.split(`-`)[1]}function sX(e){return e===`x`?`y`:`x`}function cX(e){return e===`y`?`height`:`width`}function lX(e){var t=e[0];return t===`t`||t===`b`?`y`:`x`}function uX(e){return sX(lX(e))}function dX(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var fX=[`left`,`right`],pX=[`right`,`left`],mX=[`top`,`bottom`],hX=[`bottom`,`top`];function gX(e,t,n,r){var i=oX(e),a=function(e,t,n){switch(e){case`top`:case`bottom`:return n?t?pX:fX:t?fX:pX;case`left`:case`right`:return t?mX:hX;default:return[]}}(aX(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(dX)))),a}function _X(e){var t=aX(e);return nX[t]+e.slice(t.length)}function vX(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:function(e){return R({top:0,right:0,bottom:0,left:0},e)}(e)}function yX(e){var{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function bX(e,t,n){var r,{reference:i,floating:a}=e,o=lX(t),s=uX(t),c=cX(s),l=aX(t),u=o===`y`,d=i.x+i.width/2-a.width/2,f=i.y+i.height/2-a.height/2,p=i[c]/2-a[c]/2;switch(l){case`top`:r={x:d,y:i.y-a.height};break;case`bottom`:r={x:d,y:i.y+i.height};break;case`right`:r={x:i.x+i.width,y:f};break;case`left`:r={x:i.x-a.width,y:f};break;default:r={x:i.x,y:i.y}}switch(oX(t)){case`start`:r[s]-=p*(n&&u?-1:1);break;case`end`:r[s]+=p*(n&&u?-1:1)}return r}function xX(e,t){return SX.apply(this,arguments)}function SX(){return SX=pz(function*(e,t){var n;t===void 0&&(t={});var{x:r,y:i,platform:a,rects:o,elements:s,strategy:c}=e,{boundary:l=`clippingAncestors`,rootBoundary:u=`viewport`,elementContext:d=`floating`,altBoundary:f=!1,padding:p=0}=iX(t,e),m=vX(p),h=s[f?d===`floating`?`reference`:`floating`:d],g=yX(yield a.getClippingRect({element:(n=yield a.isElement==null?void 0:a.isElement(h))==null||n?h:h.contextElement||(yield a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:l,rootBoundary:u,strategy:c})),_=d===`floating`?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,v=yield a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating),y=(yield a.isElement==null?void 0:a.isElement(v))&&(yield a.getScale==null?void 0:a.getScale(v))||{x:1,y:1},b=yX(a.convertOffsetParentRelativeRectToViewportRelativeRect?yield a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:_,offsetParent:v,strategy:c}):_);return{top:(g.top-b.top+m.top)/y.y,bottom:(b.bottom-g.bottom+m.bottom)/y.y,left:(g.left-b.left+m.left)/y.x,right:(b.right-g.right+m.right)/y.x}}),SX.apply(this,arguments)}var CX=function(){var e=pz(function*(e,t,n){for(var{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:R(R({},o),{},{detectOverflow:xX}),c=yield o.isRTL==null?void 0:o.isRTL(t),l=yield o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=bX(l,r,c),f=r,p=0,m={},h=0;h<a.length;h++){var g=a[h];if(g){var{name:_,fn:v}=g,{x:y,y:b,data:x,reset:S}=yield v({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=y??u,d=b??d,m[_]=R(R({},m[_]),x),S&&p<50&&(p++,typeof S==`object`&&(S.placement&&(f=S.placement),S.rects&&(l=!0===S.rects?yield o.getElementRects({reference:e,floating:t,strategy:i}):S.rects),{x:u,y:d}=bX(l,f,c)),h=-1)}}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}});return function(t,n,r){return e.apply(this,arguments)}}(),wX=new Set([`left`,`top`]);function TX(){return TX=pz(function*(e,t){var{placement:n,platform:r,elements:i}=e,a=yield r.isRTL==null?void 0:r.isRTL(i.floating),o=aX(n),s=oX(n),c=lX(n)===`y`,l=wX.has(o)?-1:1,u=a&&c?-1:1,d=iX(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?-1*m:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}),TX.apply(this,arguments)}function EX(){return typeof window<`u`}function DX(e){return AX(e)?(e.nodeName||``).toLowerCase():`#document`}function OX(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function kX(e){return((AX(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function AX(e){return!!EX()&&(e instanceof Node||e instanceof OX(e).Node)}function jX(e){return!!EX()&&(e instanceof Element||e instanceof OX(e).Element)}function MX(e){return!!EX()&&(e instanceof HTMLElement||e instanceof OX(e).HTMLElement)}function NX(e){return!(!EX()||typeof ShadowRoot>`u`)&&(e instanceof ShadowRoot||e instanceof OX(e).ShadowRoot)}function PX(e){var{overflow:t,overflowX:n,overflowY:r,display:i}=WX(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function FX(e){return/^(table|td|th)$/.test(DX(e))}function IX(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var LX,RX=/transform|translate|scale|rotate|perspective|filter/,zX=/paint|layout|strict|content/,BX=e=>!!e&&e!==`none`;function VX(e){var t=jX(e)?WX(e):e;return BX(t.transform)||BX(t.translate)||BX(t.scale)||BX(t.rotate)||BX(t.perspective)||!HX()&&(BX(t.backdropFilter)||BX(t.filter))||RX.test(t.willChange||``)||zX.test(t.contain||``)}function HX(){return LX??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),LX}function UX(e){return/^(html|body|#document)$/.test(DX(e))}function WX(e){return OX(e).getComputedStyle(e)}function GX(e){return jX(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function KX(e){if(DX(e)===`html`)return e;var t=e.assignedSlot||e.parentNode||NX(e)&&e.host||kX(e);return NX(t)?t.host:t}function qX(e){var t=KX(e);return UX(t)?e.ownerDocument?e.ownerDocument.body:e.body:MX(t)&&PX(t)?t:qX(t)}function JX(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);var r=qX(e),i=r===e.ownerDocument?.body,a=OX(r);if(i){var o=YX(a);return t.concat(a,a.visualViewport||[],PX(r)?r:[],o&&n?JX(o):[])}return t.concat(r,JX(r,[],n))}function YX(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function XX(e){var t=WX(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=MX(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=$Y(n)!==a||$Y(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function ZX(e){return jX(e)?e:e.contextElement}function QX(e){var t=ZX(e);if(!MX(t))return tX(1);var n=t.getBoundingClientRect(),{width:r,height:i,$:a}=XX(t),o=(a?$Y(n.width):n.width)/r,s=(a?$Y(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}var $X=tX(0);function eZ(e){var t=OX(e);return HX()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:$X}function tZ(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);var i=e.getBoundingClientRect(),a=ZX(e),o=tX(1);t&&(r?jX(r)&&(o=QX(r)):o=QX(e));var s=function(e,t,n){return t===void 0&&(t=!1),!(!n||t&&n!==OX(e))&&t}(a,n,r)?eZ(a):tX(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a)for(var f=OX(a),p=r&&jX(r)?OX(r):r,m=f,h=YX(m);h&&r&&p!==m;){var g=QX(h),_=h.getBoundingClientRect(),v=WX(h),y=_.left+(h.clientLeft+parseFloat(v.paddingLeft))*g.x,b=_.top+(h.clientTop+parseFloat(v.paddingTop))*g.y;c*=g.x,l*=g.y,u*=g.x,d*=g.y,c+=y,l+=b,h=YX(m=OX(h))}return yX({width:u,height:d,x:c,y:l})}function nZ(e,t){var n=GX(e).scrollLeft;return t?t.left+n:tZ(kX(e)).left+n}function rZ(e,t){var n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-nZ(e,n),y:n.top+t.scrollTop}}function iZ(e,t,n){var r;if(t===`viewport`)r=function(e,t){var n=OX(e),r=kX(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;var l=HX();(!l||l&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}var u=nZ(r);if(u<=0){var d=r.ownerDocument,f=d.body,p=getComputedStyle(f),m=d.compatMode===`CSS1Compat`&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,h=Math.abs(r.clientWidth-f.clientWidth-m);h<=25&&(a-=h)}else u<=25&&(a+=u);return{width:a,height:o,x:s,y:c}}(e,n);else if(t===`document`)r=function(e){var t=kX(e),n=GX(e),r=e.ownerDocument.body,i=QY(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=QY(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+nZ(e),s=-n.scrollTop;return WX(r).direction===`rtl`&&(o+=QY(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}(kX(e));else if(jX(t))r=function(e,t){var n=tZ(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=MX(e)?QX(e):tX(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}(t,n);else{var i=eZ(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return yX(r)}function aZ(e,t){var n=KX(e);return!(n===t||!jX(n)||UX(n))&&(WX(n).position===`fixed`||aZ(n,t))}function oZ(e,t,n){var r=MX(t),i=kX(t),a=n===`fixed`,o=tZ(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=tX(0);function l(){c.x=nZ(i)}if(r||!r&&!a)if((DX(t)!==`body`||PX(i))&&(s=GX(t)),r){var u=tZ(t,!0,a,t);c.x=u.x+t.clientLeft,c.y=u.y+t.clientTop}else i&&l();a&&!r&&i&&l();var d=!i||r||a?tX(0):rZ(i,s);return{x:o.left+s.scrollLeft-c.x-d.x,y:o.top+s.scrollTop-c.y-d.y,width:o.width,height:o.height}}function sZ(e){return WX(e).position===`static`}function cZ(e,t){if(!MX(e)||WX(e).position===`fixed`)return null;if(t)return t(e);var n=e.offsetParent;return kX(e)===n&&(n=n.ownerDocument.body),n}function lZ(e,t){var n=OX(e);if(IX(e))return n;if(!MX(e)){for(var r=KX(e);r&&!UX(r);){if(jX(r)&&!sZ(r))return r;r=KX(r)}return n}for(var i=cZ(e,t);i&&FX(i)&&sZ(i);)i=cZ(i,t);return i&&UX(i)&&sZ(i)&&!VX(i)?n:i||function(e){for(var t=KX(e);MX(t)&&!UX(t);){if(VX(t))return t;if(IX(t))return null;t=KX(t)}return null}(e)||n}var uZ={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){var{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=kX(r),s=!!t&&IX(t.floating);if(r===o||s&&a)return n;var c={scrollLeft:0,scrollTop:0},l=tX(1),u=tX(0),d=MX(r);if((d||!d&&!a)&&((DX(r)!==`body`||PX(o))&&(c=GX(r)),d)){var f=tZ(r);l=QX(r),u.x=f.x+r.clientLeft,u.y=f.y+r.clientTop}var p=!o||d||a?tX(0):rZ(o,c);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+p.x,y:n.y*l.y-c.scrollTop*l.y+u.y+p.y}},getDocumentElement:kX,getClippingRect:function(e){for(var{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?IX(t)?[]:function(e,t){var n=t.get(e);if(n)return n;for(var r=JX(e,[],!1).filter(e=>jX(e)&&DX(e)!==`body`),i=null,a=WX(e).position===`fixed`,o=a?KX(e):e;jX(o)&&!UX(o);){var s=WX(o),c=VX(o);c||s.position!==`fixed`||(i=null),(a?!c&&!i:!c&&s.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||PX(o)&&!c&&aZ(e,o))?r=r.filter(e=>e!==o):i=s,o=KX(o)}return t.set(e,r),r}(t,this._c):[].concat(n),r],o=iZ(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left,d=1;d<a.length;d++){var f=iZ(t,a[d],i);s=QY(f.top,s),c=ZY(f.right,c),l=ZY(f.bottom,l),u=QY(f.left,u)}return{width:c-u,height:l-s,x:u,y:s}},getOffsetParent:lZ,getElementRects:function(){var e=pz(function*(e){var t=this.getOffsetParent||lZ,n=this.getDimensions,r=yield n(e.floating);return{reference:oZ(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}});return function(t){return e.apply(this,arguments)}}(),getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){var{width:t,height:n}=XX(e);return{width:t,height:n}},getScale:QX,isElement:jX,isRTL:function(e){return WX(e).direction===`rtl`}};function dZ(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function fZ(e,t,n,r){r===void 0&&(r={});var{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=ZX(e),u=i||a?[...l?JX(l):[],...t?JX(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});var d,f=l&&s?function(e,t){var n,r=null,i=kX(e);function a(){var e;clearTimeout(n),(e=r)==null||e.disconnect(),r=null}return function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();var l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),f&&p){var m={rootMargin:-eX(d)+`px `+-eX(i.clientWidth-(u+f))+`px `+-eX(i.clientHeight-(d+p))+`px `+-eX(u)+`px`,threshold:QY(0,ZY(1,c))||1},h=!0;try{r=new IntersectionObserver(g,R(R({},m),{},{root:i.ownerDocument}))}catch{r=new IntersectionObserver(g,m)}r.observe(e)}function g(t){var r=t[0].intersectionRatio;if(r!==c){if(!h)return o();r?o(!1,r):n=setTimeout(()=>{o(!1,1e-7)},1e3)}r!==1||dZ(l,e.getBoundingClientRect())||o(),h=!1}}(!0),a}(l,n):null,p=-1,m=null;o&&(m=new ResizeObserver(e=>{var[r]=e;r&&r.target===l&&m&&t&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;(e=m)==null||e.observe(t)})),n()}),l&&!c&&m.observe(l),t&&m.observe(t));var h=c?tZ(e):null;return c&&function t(){var r=tZ(e);h&&!dZ(h,r)&&n(),h=r,d=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),f?.(),(e=m)==null||e.disconnect(),m=null,c&&cancelAnimationFrame(d)}}var pZ=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,fn:t=>pz(function*(){var n,{x:r,y:i,placement:a,middlewareData:o}=t,s=yield function(e,t){return TX.apply(this,arguments)}(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:R(R({},s),{},{placement:a})}})()}},mZ=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,fn:t=>pz(function*(){var{x:n,y:r,placement:i,platform:a}=t,o=iX(e,t),{mainAxis:s=!0,crossAxis:c=!1,limiter:l={fn:e=>{var{x:t,y:n}=e;return{x:t,y:n}}}}=o,u=uz(o,lz),d={x:n,y:r},f=yield a.detectOverflow(t,u),p=lX(aX(i)),m=sX(p),h=d[m],g=d[p];if(s){var _=m===`y`?`bottom`:`right`;h=rX(h+f[m===`y`?`top`:`left`],h,h-f[_])}if(c){var v=p===`y`?`bottom`:`right`;g=rX(g+f[p===`y`?`top`:`left`],g,g-f[v])}var y=l.fn(R(R({},t),{},{[m]:h,[p]:g}));return R(R({},y),{},{data:{x:y.x-n,y:y.y-r,enabled:{[m]:s,[p]:c}}})})()}},hZ=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,fn:t=>pz(function*(){var n,{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,l=iX(e,t),{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p=`bestFit`,fallbackAxisSideDirection:m=`none`,flipAlignment:h=!0}=l,g=uz(l,cz);if((n=i.arrow)!=null&&n.alignmentOffset)return{};var _=aX(r),v=lX(o),y=aX(o)===o,b=yield s.isRTL==null?void 0:s.isRTL(c.floating),x=f||(y||!h?[_X(o)]:function(e){var t=_X(e);return[dX(e),t,dX(t)]}(o)),S=m!==`none`;!f&&S&&x.push(...gX(o,h,m,b));var C=[o,...x],w=yield s.detectOverflow(t,g),T=[],E=i.flip?.overflows||[];if(u&&T.push(w[_]),d){var ee=function(e,t,n){n===void 0&&(n=!1);var r=oX(e),i=uX(e),a=cX(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=_X(o)),[o,_X(o)]}(r,a,b);T.push(w[ee[0]],w[ee[1]])}if(E=[...E,{placement:r,overflows:T}],!T.every(e=>e<=0)){var te=(i.flip?.index||0)+1,D=C[te];if(D&&(!(d===`alignment`&&v!==lX(D))||E.every(e=>lX(e.placement)!==v||e.overflows[0]>0)))return{data:{index:te,overflows:E},reset:{placement:D}};var ne=E.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!ne)switch(p){case`bestFit`:var re=E.filter(e=>{if(S){var t=lX(e.placement);return t===v||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];re&&(ne=re);break;case`initialPlacement`:ne=o}if(r!==ne)return{reset:{placement:ne}}}return{}})()}};function gZ(e){var t,n,r={autoUpdate:!0},i=e,a=t=>R(R(R({},r),e||{}),t||{}),o=e=>{t&&n&&(i=a(e),((e,t,n)=>{var r=new Map,i=R({platform:uZ},n),a=R(R({},i.platform),{},{_c:r});return CX(e,t,R(R({},i),{},{platform:a}))})(t,n,i).then(e=>{var t;Object.assign(n.style,{position:e.strategy,left:`${e.x}px`,top:`${e.y}px`}),(t=i)!=null&&t.onComputed&&i.onComputed(e)}))},s=e=>{qU(e.subscribe(e=>{t===void 0?(t=e,o()):(Object.assign(t,e),o())}))};return[e=>{if(`subscribe`in e)return s(e),{};t=e,o()},(e,r)=>{var s;n=e,i=a(r),setTimeout(()=>o(r),0),o(r);var c=()=>{s&&=(s(),void 0)},l=function(){var{autoUpdate:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:i||{};c(),!1!==e&&fU().then(()=>fZ(t,n,()=>o(i),!0===e?{}:e))};return s=l(),{update(e){o(e),s=l(e)},destroy(){c()}}},o]}function _Z(e){var{loadOptions:t,filterText:n,items:r,multiple:i,value:a,itemId:o,groupBy:s,filterSelectedItems:c,itemFilter:l,convertStringItemsToObjects:u,filterGroupedItems:d,label:f}=e;if(r&&t)return r;if(!r)return[];r&&r.length>0&&typeof r[0]!=`object`&&(r=u(r));var p=r.filter(e=>{var t=l(e[f],n,e);return t&&i&&a!=null&&a.length&&(t=!a.some(t=>!!c&&t[o]===e[o])),t});return s&&(p=d(p)),p}function vZ(e){return yZ.apply(this,arguments)}function yZ(){return(yZ=pz(function*(e){var{dispatch:t,loadOptions:n,convertStringItemsToObjects:r,filterText:i}=e,a=yield n(i).catch(e=>{console.warn(`svelte-select loadOptions error :>> `,e),t(`error`,{type:`loadOptions`,details:e})});if(a&&!a.cancelled)return a?(a&&a.length>0&&typeof a[0]!=`object`&&(a=r(a)),t(`loaded`,{items:a})):a=[],{filteredItems:a,loading:!1,focused:!0,listOpen:!0}})).apply(this,arguments)}OK(`
|
|
484
484
|
svg.svelte-1kxu7be {
|
|
485
485
|
width: var(--chevron-icon-width, 20px);
|
|
486
486
|
height: var(--chevron-icon-width, 20px);
|
|
@@ -981,7 +981,7 @@ table.jse-transform-wizard.svelte-9wqi8y tr:where(.svelte-9wqi8y) td:where(.svel
|
|
|
981
981
|
}
|
|
982
982
|
table.jse-transform-wizard.svelte-9wqi8y tr:where(.svelte-9wqi8y) td:where(.svelte-9wqi8y) .jse-horizontal:where(.svelte-9wqi8y) .jse-filter-value:where(.svelte-9wqi8y):focus {
|
|
983
983
|
border: var(--jse-input-border-focus, 1px solid var(--jse-input-border-focus, var(--jse-theme-color, #3883fa)));
|
|
984
|
-
}`);var RZ=X(`<table class="jse-transform-wizard svelte-9wqi8y"><tbody><tr class="svelte-9wqi8y"><th class="svelte-9wqi8y">Filter</th><td class="svelte-9wqi8y"><div class="jse-horizontal svelte-9wqi8y"><!> <!> <input class="jse-filter-value svelte-9wqi8y"/></div></td></tr><tr class="svelte-9wqi8y"><th class="svelte-9wqi8y">Sort</th><td class="svelte-9wqi8y"><div class="jse-horizontal svelte-9wqi8y"><!> <!></div></td></tr><tr class="svelte-9wqi8y"><th class="svelte-9wqi8y">Pick</th><td class="svelte-9wqi8y"><div class="jse-horizontal svelte-9wqi8y"><!></div></td></tr></tbody></table>`);function zZ(e,t){var n,r,i;vB(t,!1);var a=B(void 0,!0),o=B(void 0,!0),s=B(void 0,!0),c=B(void 0,!0),l=B(void 0,!0),u=B(void 0,!0),d=$W(`jsoneditor:TransformWizard`),f=$(t,`json`,9),p=$(t,`queryOptions`,29,()=>({})),m=$(t,`onChange`,9),h=[`==`,`!=`,`<`,`<=`,`>`,`>=`].map(e=>({value:e,label:e})),g=[{value:`asc`,label:`ascending`},{value:`desc`,label:`descending`}],_=B((n=p())!=null&&(n=n.filter)!=null&&n.path?qY(p().filter.path):void 0,!0),v=B(h.find(e=>e.value===p().filter?.relation)??h[0],!0),y=B(((r=p())==null||(r=r.filter)==null?void 0:r.value)||``,!0),b=B((i=p())!=null&&(i=i.sort)!=null&&i.path?qY(p().sort.path):void 0,!0),x=B(g.find(e=>e.value===p().sort?.direction)??g[0],!0);W(()=>J(f()),()=>{V(a,Array.isArray(f()))}),W(()=>(K(a),J(f())),()=>{V(o,K(a)?bG(f()):[])}),W(()=>(K(a),J(f())),()=>{V(s,K(a)?bG(f(),!0):[])}),W(()=>(K(o),qY),()=>{V(c,K(o).map(qY))}),W(()=>(K(s),qY),()=>{V(l,K(s)?K(s).map(qY):[])}),W(()=>(J(p()),K(l),
|
|
984
|
+
}`);var RZ=X(`<table class="jse-transform-wizard svelte-9wqi8y"><tbody><tr class="svelte-9wqi8y"><th class="svelte-9wqi8y">Filter</th><td class="svelte-9wqi8y"><div class="jse-horizontal svelte-9wqi8y"><!> <!> <input class="jse-filter-value svelte-9wqi8y"/></div></td></tr><tr class="svelte-9wqi8y"><th class="svelte-9wqi8y">Sort</th><td class="svelte-9wqi8y"><div class="jse-horizontal svelte-9wqi8y"><!> <!></div></td></tr><tr class="svelte-9wqi8y"><th class="svelte-9wqi8y">Pick</th><td class="svelte-9wqi8y"><div class="jse-horizontal svelte-9wqi8y"><!></div></td></tr></tbody></table>`);function zZ(e,t){var n,r,i;vB(t,!1);var a=B(void 0,!0),o=B(void 0,!0),s=B(void 0,!0),c=B(void 0,!0),l=B(void 0,!0),u=B(void 0,!0),d=$W(`jsoneditor:TransformWizard`),f=$(t,`json`,9),p=$(t,`queryOptions`,29,()=>({})),m=$(t,`onChange`,9),h=[`==`,`!=`,`<`,`<=`,`>`,`>=`].map(e=>({value:e,label:e})),g=[{value:`asc`,label:`ascending`},{value:`desc`,label:`descending`}],_=B((n=p())!=null&&(n=n.filter)!=null&&n.path?qY(p().filter.path):void 0,!0),v=B(h.find(e=>e.value===p().filter?.relation)??h[0],!0),y=B(((r=p())==null||(r=r.filter)==null?void 0:r.value)||``,!0),b=B((i=p())!=null&&(i=i.sort)!=null&&i.path?qY(p().sort.path):void 0,!0),x=B(g.find(e=>e.value===p().sort?.direction)??g[0],!0);W(()=>J(f()),()=>{V(a,Array.isArray(f()))}),W(()=>(K(a),J(f())),()=>{V(o,K(a)?bG(f()):[])}),W(()=>(K(a),J(f())),()=>{V(s,K(a)?bG(f(),!0):[])}),W(()=>(K(o),qY),()=>{V(c,K(o).map(qY))}),W(()=>(K(s),qY),()=>{V(l,K(s)?K(s).map(qY):[])}),W(()=>(J(p()),K(l),Hg),()=>{var e;V(u,(e=p())!=null&&(e=e.projection)!=null&&e.paths&&K(l)?p().projection.paths.map(e=>K(l).find(t=>Hg(t.value,e))).filter(e=>!!e):void 0)}),W(()=>K(_),()=>{var e=K(_)?.value,t;Hg((t=p())==null||(t=t.filter)==null?void 0:t.path,e)||(d(`changeFilterPath`,e),p(uc(p(),[`filter`,`path`],e,!0)),m()(p()))}),W(()=>K(v),()=>{var e=K(v)?.value,t;Hg((t=p())==null||(t=t.filter)==null?void 0:t.relation,e)||(d(`changeFilterRelation`,e),p(uc(p(),[`filter`,`relation`],e,!0)),m()(p()))}),W(()=>K(y),()=>{var e=K(y),t;Hg((t=p())==null||(t=t.filter)==null?void 0:t.value,e)||(d(`changeFilterValue`,e),p(uc(p(),[`filter`,`value`],e,!0)),m()(p()))}),W(()=>K(b),()=>{var e=K(b)?.value,t;Hg((t=p())==null||(t=t.sort)==null?void 0:t.path,e)||(d(`changeSortPath`,e),p(uc(p(),[`sort`,`path`],e,!0)),m()(p()))}),W(()=>K(x),()=>{var e=K(x)?.value,t;Hg((t=p())==null||(t=t.sort)==null?void 0:t.direction,e)||(d(`changeSortDirection`,e),p(uc(p(),[`sort`,`direction`],e,!0)),m()(p()))}),W(()=>K(u),()=>{(function(e){var t;Hg((t=p())==null||(t=t.projection)==null?void 0:t.paths,e)||(d(`changeProjectionPaths`,e),p(uc(p(),[`projection`,`paths`],e,!0)),m()(p()))})(K(u)?K(u).map(e=>e.value):void 0)}),DH(),GW(!0);var S=RZ(),C=H(H(S)),w=H(H(U(H(C))));LZ(w,{class:`jse-filter-path`,showChevron:!0,get items(){return K(c)},get value(){return K(_)},set value(e){V(_,e)},$$legacy:!0});var T=U(w,2);LZ(T,{class:`jse-filter-relation`,showChevron:!0,clearable:!1,get items(){return h},get value(){return K(v)},set value(e){V(v,e)},$$legacy:!0});var E=U(T,2),ee=U(C),te=H(H(U(H(ee))));LZ(te,{class:`jse-sort-path`,showChevron:!0,get items(){return K(c)},get value(){return K(b)},set value(e){V(b,e)},$$legacy:!0}),LZ(U(te,2),{class:`jse-sort-direction`,showChevron:!0,clearable:!1,get items(){return g},get value(){return K(x)},set value(e){V(x,e)},$$legacy:!0}),LZ(H(H(U(H(U(ee))))),{class:`jse-projection-paths`,multiple:!0,showChevron:!0,get items(){return K(l)},get value(){return K(u)},set value(e){V(u,e)},$$legacy:!0}),LW(E,()=>K(y),e=>V(y,e)),Z(e,S),yB()}OK(`/* over all fonts, sizes, and colors */
|
|
985
985
|
/* "consolas" for Windows, "menlo" for Mac with fallback to "monaco", 'Ubuntu Mono' for Ubuntu */
|
|
986
986
|
/* (at Mac this font looks too large at 14px, but 13px is too small for the font on Windows) */
|
|
987
987
|
/* main, menu, modal */
|
|
@@ -1098,7 +1098,7 @@ table.jse-transform-wizard.svelte-9wqi8y tr:where(.svelte-9wqi8y) td:where(.svel
|
|
|
1098
1098
|
}
|
|
1099
1099
|
.jse-config.hide.svelte-5gkegr {
|
|
1100
1100
|
display: none;
|
|
1101
|
-
}`);var KZ=X(`<button slot="actions" type="button" title="Select a query language"><!></button>`),qZ=$W(`jsoneditor:AutoScrollHandler`);function JZ(e){var t,n;function r(e){return e<20?200:e<50?400:1200}function i(){if(e){var n=.05*(t||0);e.scrollTop+=n}}function a(e){n&&e===t||(o(),qZ(`startAutoScroll`,e),t=e,n=setInterval(i,50))}function o(){n&&(qZ(`stopAutoScroll`),clearInterval(n),n=void 0,t=void 0)}return qZ(`createAutoScrollHandler`,e),{onDrag:function(t){if(e){var n=t.clientY,{top:i,bottom:s}=e.getBoundingClientRect();n<i?a(-r(i-n)):n>s?a(r(n-s)):o()}},onDragEnd:function(){o()}}}var
|
|
1101
|
+
}`);var KZ=X(`<button slot="actions" type="button" title="Select a query language"><!></button>`),qZ=$W(`jsoneditor:AutoScrollHandler`);function JZ(e){var t,n;function r(e){return e<20?200:e<50?400:1200}function i(){if(e){var n=.05*(t||0);e.scrollTop+=n}}function a(e){n&&e===t||(o(),qZ(`startAutoScroll`,e),t=e,n=setInterval(i,50))}function o(){n&&(qZ(`stopAutoScroll`),clearInterval(n),n=void 0,t=void 0)}return qZ(`createAutoScrollHandler`,e),{onDrag:function(t){if(e){var n=t.clientY,{top:i,bottom:s}=e.getBoundingClientRect();n<i?a(-r(i-n)):n>s?a(r(n-s)):o()}},onDragEnd:function(){o()}}}var YZ=(e,t,n,r)=>(e/=r/2)<1?n/2*e*e+t:-n/2*(--e*(e-2)-1)+t,XZ=()=>{var e,t,n,r,i,a,o,s,c,l,u,d,f;function p(t){return t.getBoundingClientRect().top-(e.getBoundingClientRect?e.getBoundingClientRect().top:0)+n}function m(t){e.scrollTo?e.scrollTo(e.scrollLeft,t):e.scrollTop=t}function h(e){l||=e,m(a(u=e-l,n,s,c)),f=!0,u<c?requestAnimationFrame(h):function(){m(n+s),t&&o&&(t.setAttribute(`tabindex`,`-1`),t.focus()),typeof d==`function`&&d(),l=0,f=!1}()}return function(u){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};switch(c=1e3,i=m.offset||0,d=m.callback,a=m.easing||YZ,o=m.a11y||!1,typeof m.container){case`object`:e=m.container;break;case`string`:e=document.querySelector(m.container);break;default:e=window.document.documentElement}switch(n=e.scrollTop,typeof u){case`number`:t=void 0,o=!1,r=n+u;break;case`object`:r=p(t=u);break;case`string`:t=document.querySelector(u),r=p(t)}switch(s=r-n+i,typeof m.duration){case`number`:c=m.duration;break;case`function`:c=m.duration(s)}f?l=0:requestAnimationFrame(h)}};function ZZ(e,t){var n=Date.now(),r=e();return t(Date.now()-n),r}var QZ=$W(`validation`),$Z={createObjectDocumentState:()=>({type:`object`,properties:{}}),createArrayDocumentState:()=>({type:`array`,items:[]}),createValueDocumentState:()=>({type:`value`})};function eQ(e,t,n,r){return eJ(e,t,n,r,$Z)}function tQ(e,t,n,r){if(QZ(`validateJSON`),!t)return[];if(n!==r){var i=n.stringify(e);return t(i===void 0?void 0:r.parse(i))}return t(e)}function nQ(e,t,n,r){if(QZ(`validateText`),e.length>104857600)return{validationErrors:[{path:[],message:`Validation turned off: the document is too large`,severity:XG.info}]};if(e.length!==0)try{var i=ZZ(()=>n.parse(e),e=>QZ(`validate: parsed json in ${e} ms`));if(!t)return;var a=n===r?i:ZZ(()=>r.parse(e),e=>QZ(`validate: parsed json with the validationParser in ${e} ms`)),o=ZZ(()=>t(a),e=>QZ(`validate: validated json in ${e} ms`));return Vg(o)?void 0:{validationErrors:o}}catch(t){var s=ZZ(()=>function(e,t){if(e.length>rq)return!1;try{return t.parse(Sl(e)),!0}catch{return!1}}(e,n),e=>QZ(`validate: checked whether repairable in ${e} ms`));return{parseError:MG(e,t.message||t.toString()),isRepairable:s}}}var rQ=$W(`jsoneditor:FocusTracker`);function iQ(e){var t,{onMount:n,onDestroy:r,getWindow:i,hasFocus:a,onFocus:o,onBlur:s}=e,c=!1;function l(){var e=a();e&&(clearTimeout(t),c||=(rQ(`focus`),o(),e))}function u(){c&&(clearTimeout(t),t=setTimeout(()=>{a()||(rQ(`blur`),c=!1,s())}))}n(()=>{rQ(`mount FocusTracker`);var e=i();e&&(e.addEventListener(`focusin`,l,!0),e.addEventListener(`focusout`,u,!0))}),r(()=>{rQ(`destroy FocusTracker`);var e=i();e&&(e.removeEventListener(`focusin`,l,!0),e.removeEventListener(`focusout`,u,!0))})}OK(`/* over all fonts, sizes, and colors */
|
|
1102
1102
|
/* "consolas" for Windows, "menlo" for Mac with fallback to "monaco", 'Ubuntu Mono' for Ubuntu */
|
|
1103
1103
|
/* (at Mac this font looks too large at 14px, but 13px is too small for the font on Windows) */
|
|
1104
1104
|
/* main, menu, modal */
|
|
@@ -1173,7 +1173,7 @@ table.jse-transform-wizard.svelte-9wqi8y tr:where(.svelte-9wqi8y) td:where(.svel
|
|
|
1173
1173
|
}
|
|
1174
1174
|
.jse-message.svelte-cbvd26 .jse-actions:where(.svelte-cbvd26) button.jse-action:where(.svelte-cbvd26):hover {
|
|
1175
1175
|
background: var(--jse-message-action-background-highlight, rgba(255, 255, 255, 0.3));
|
|
1176
|
-
}`);var
|
|
1176
|
+
}`);var aQ=X(`<button type="button" class="jse-button jse-action jse-primary svelte-cbvd26"><!> </button>`),oQ=X(`<div><div role="button" tabindex="-1"><div class="jse-text-centered"><!> </div></div> <div class="jse-actions svelte-cbvd26"></div></div>`);function sQ(e,t){vB(t,!1);var n=$(t,`type`,9,`success`),r=$(t,`icon`,9,void 0),i=$(t,`message`,9,void 0),a=$(t,`actions`,25,()=>[]),o=$(t,`onClick`,9,void 0),s=$(t,`onClose`,9,void 0);s()&&qU(s()),GW(!0);var c,l=oQ(),u=H(l),d=H(H(u)),f=e=>{GK(e,{get data(){return r()}})};Q(d,e=>{r()&&e(f)});var p=U(d);nW(U(u,2),5,a,eW,(e,t)=>{var n=aQ(),r=H(n),i=e=>{GK(e,{get data(){return K(t),q(()=>K(t).icon)}})};Q(r,e=>{K(t),q(()=>K(t).icon)&&e(i)});var a=U(r);G(()=>{var e;jW(n,`title`,(K(t),q(()=>K(t).title))),n.disabled=(K(t),q(()=>K(t).disabled)),PU(a,` ${(K(t),e=q(()=>K(t).text))!==null&&e!==void 0?e:``}`)}),Y(`click`,n,()=>{K(t).onClick&&K(t).onClick()}),Y(`mousedown`,n,()=>{K(t).onMouseDown&&K(t).onMouseDown()}),Z(e,n)}),G(()=>{_W(l,1,`jse-message jse-${n()??``}`,`svelte-cbvd26`),c=_W(u,1,`jse-text svelte-cbvd26`,null,c,{"jse-clickable":!!o()}),PU(p,` ${i()??``}`)}),Y(`click`,u,function(){o()&&o()()}),Z(e,l),yB()}OK(`/* over all fonts, sizes, and colors */
|
|
1177
1177
|
/* "consolas" for Windows, "menlo" for Mac with fallback to "monaco", 'Ubuntu Mono' for Ubuntu */
|
|
1178
1178
|
/* (at Mac this font looks too large at 14px, but 13px is too small for the font on Windows) */
|
|
1179
1179
|
/* main, menu, modal */
|
|
@@ -1256,7 +1256,7 @@ table.jse-transform-wizard.svelte-9wqi8y tr:where(.svelte-9wqi8y) td:where(.svel
|
|
|
1256
1256
|
display: inline-block;
|
|
1257
1257
|
position: relative;
|
|
1258
1258
|
top: 3px;
|
|
1259
|
-
}`);var
|
|
1259
|
+
}`);var cQ=X(`<button type="button" class="jse-validation-errors-collapse svelte-1342rh4" title="Collapse validation errors"><!></button>`),lQ=X(`<tr tabindex="0"><td class="jse-validation-error-icon svelte-1342rh4"><!></td><td class="jse-validation-error-path svelte-1342rh4"> </td><td class="jse-validation-error-message svelte-1342rh4"> </td><td class="jse-validation-error-action svelte-1342rh4"><!></td></tr>`),uQ=X(`<tr class="jse-validation-error svelte-1342rh4"><td class="svelte-1342rh4"></td><td class="svelte-1342rh4"></td><td class="svelte-1342rh4"> </td><td class="svelte-1342rh4"></td></tr>`),dQ=X(`<table class="jse-validation-errors-overview-expanded svelte-1342rh4"><tbody><!><!></tbody></table>`),fQ=X(`<table class="jse-validation-errors-overview-collapsed svelte-1342rh4"><tbody><tr><td class="jse-validation-error-icon svelte-1342rh4"><!></td><td class="jse-validation-error-count svelte-1342rh4"> <div class="jse-validation-errors-expand svelte-1342rh4"><!></div></td></tr></tbody></table>`),pQ=X(`<div class="jse-validation-errors-overview svelte-1342rh4"><!></div>`);function mQ(e,t){vB(t,!1);var n=B(void 0,!0),r=$(t,`validationErrors`,9),i=$(t,`selectError`,9),a=B(!0,!0);function o(){V(a,!1)}function s(){V(a,!0)}W(()=>J(r()),()=>{V(n,r().length)}),DH(),GW(!0);var c=kU(),l=hH(c),u=e=>{var t=pQ(),c=H(t),l=e=>{var t=dQ(),a=H(H(t));nW(a,1,()=>(J(SG),J(r()),J(eq),q(()=>SG(r(),eq))),eW,(e,t,n)=>{var a=lQ(),s=H(a);GK(H(s),{get data(){return wv}});var c=U(s),l=H(c),u=U(c),d=H(u),f=H(U(u)),p=e=>{var t=cQ();GK(H(t),{get data(){return dv}}),Y(`click`,t,UW(o)),Z(e,t)};Q(f,e=>{J(r()),q(()=>n===0&&r().length>1)&&e(p)}),G(e=>{var n;_W(a,1,`jse-validation-${(K(t),n=q(()=>K(t).severity))!==null&&n!==void 0?n:``}`,`svelte-1342rh4`),PU(l,e),PU(d,(K(t),q(()=>K(t).message)))},[()=>(J(GY),K(t),q(()=>GY(K(t).path)))]),Y(`click`,a,()=>{setTimeout(()=>i()(K(t)))}),Z(e,a)});var s=U(a),c=e=>{var t=uQ(),r=H(U(H(t),2));G(()=>PU(r,`(and ${K(n)-eq} more errors)`)),Z(e,t)};Q(s,e=>{K(n)>eq&&e(c)}),Z(e,t)},u=e=>{var t=fQ(),i=H(H(t)),a=H(i);GK(H(a),{get data(){return wv}});var o=H(U(a));GK(H(U(o)),{get data(){return J_}}),G(e=>{_W(i,1,`jse-validation-${e??``}`,`svelte-1342rh4`),PU(o,`${K(n)??``} validation errors `)},[()=>(J(r()),q(()=>{return e=r(),[XG.error,XG.warning,XG.info].find(t=>e.some(e=>e.severity===t));var e}))]),Y(`click`,i,s),Z(e,t)};Q(c,e=>{K(a)||K(n)===1?e(l):e(u,-1)}),Z(e,t)},d=WV(()=>(J(Vg),J(r()),q(()=>!Vg(r()))));Q(l,e=>{K(d)&&e(u)}),Z(e,c),yB()}function hQ(e,t){if(e)return e.addEventListener(`keydown`,n),{destroy(){e.removeEventListener(`keydown`,n)}};function n(e){e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),t())}}OK(`/* over all fonts, sizes, and colors */
|
|
1260
1260
|
/* "consolas" for Windows, "menlo" for Mac with fallback to "monaco", 'Ubuntu Mono' for Ubuntu */
|
|
1261
1261
|
/* (at Mac this font looks too large at 14px, but 13px is too small for the font on Windows) */
|
|
1262
1262
|
/* main, menu, modal */
|
|
@@ -1357,7 +1357,7 @@ dialog.jse-modal.svelte-2aoco4 .svelte-select {
|
|
|
1357
1357
|
--multi-item-padding: 2px 8px;
|
|
1358
1358
|
--multi-item-border-radius: 6px;
|
|
1359
1359
|
--indicator-top: 8px;
|
|
1360
|
-
}`);var
|
|
1360
|
+
}`);var gQ=X(`<dialog><div class="jse-modal-inner svelte-2aoco4"><!></div></dialog>`);function _Q(e,t){vB(t,!1);var n=$(t,`className`,8,void 0),r=$(t,`fullscreen`,8,!1),i=$(t,`onClose`,8),a=B();function o(){i()()}KU(()=>K(a).showModal()),qU(()=>K(a).close()),GW();var s,c=gQ();cW(H(H(c)),t,`default`,{},null),HW(c,e=>V(a,e),()=>K(a)),EH(()=>Y(`close`,c,o)),EH(()=>{return Y(`pointerdown`,c,(e=o,function(){var t=[...arguments];t[0].target===this&&e?.apply(this,t)}));var e}),EH(()=>Y(`cancel`,c,WW(function(e){JW.call(this,t,e)}))),uW(c,(e,t)=>hQ?.(e,t),()=>o),G(e=>s=_W(c,1,e,`svelte-2aoco4`,s,{"jse-fullscreen":r()}),[()=>pW((J(nY),J(n()),q(()=>nY(`jse-modal`,n()))))]),Z(e,c),yB()}OK(`/* over all fonts, sizes, and colors */
|
|
1361
1361
|
/* "consolas" for Windows, "menlo" for Mac with fallback to "monaco", 'Ubuntu Mono' for Ubuntu */
|
|
1362
1362
|
/* (at Mac this font looks too large at 14px, but 13px is too small for the font on Windows) */
|
|
1363
1363
|
/* main, menu, modal */
|
|
@@ -1421,7 +1421,7 @@ dialog.jse-modal.svelte-2aoco4 .svelte-select {
|
|
|
1421
1421
|
.jse-shortcuts.svelte-10a6ob6 .jse-shortcut:where(.svelte-10a6ob6) .jse-key:where(.svelte-10a6ob6) {
|
|
1422
1422
|
font-size: 200%;
|
|
1423
1423
|
color: var(--jse-theme-color, #3883fa);
|
|
1424
|
-
}`);var
|
|
1424
|
+
}`);var vQ=X(`<!> <div class="jse-modal-contents svelte-10a6ob6"><div>Clipboard permission is disabled by your browser. You can use:</div> <div class="jse-shortcuts svelte-10a6ob6"><div class="jse-shortcut svelte-10a6ob6"><div class="jse-key svelte-10a6ob6"> </div> for copy</div> <div class="jse-shortcut svelte-10a6ob6"><div class="jse-key svelte-10a6ob6"> </div> for cut</div> <div class="jse-shortcut svelte-10a6ob6"><div class="jse-key svelte-10a6ob6"> </div> for paste</div></div> <div class="jse-actions svelte-10a6ob6"><button type="button" class="jse-primary svelte-10a6ob6">Close</button></div></div>`,1);function yQ(e,t){vB(t,!1);var n=$(t,`onClose`,9),r=wK()?`⌘`:`Ctrl`;GW(!0),_Q(e,{get onClose(){return n()},className:`jse-copy-paste`,children:(e,t)=>{var i=vQ(),a=hH(i);GZ(a,{title:`Copying and pasting`,get onClose(){return n()}});var o=U(H(U(a,2)),2),s=H(o),c=H(H(s)),l=U(s,2),u=H(H(l)),d=H(H(U(l,2))),f=H(U(o,2));G(()=>{PU(c,`${r}+C`),PU(u,`${r}+X`),PU(d,`${r}+V`)}),Y(`click`,f,function(){for(var e,t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];(e=n())==null||e.apply(this,r)}),Z(e,i)},$$slots:{default:!0}}),yB()}OK(`/* over all fonts, sizes, and colors */
|
|
1425
1425
|
/* "consolas" for Windows, "menlo" for Mac with fallback to "monaco", 'Ubuntu Mono' for Ubuntu */
|
|
1426
1426
|
/* (at Mac this font looks too large at 14px, but 13px is too small for the font on Windows) */
|
|
1427
1427
|
/* main, menu, modal */
|
|
@@ -1507,7 +1507,7 @@ dialog.jse-modal.svelte-2aoco4 .svelte-select {
|
|
|
1507
1507
|
opacity: 0.3;
|
|
1508
1508
|
width: 1px;
|
|
1509
1509
|
margin: 3px;
|
|
1510
|
-
}`);var
|
|
1510
|
+
}`);var bQ=X(`<div class="jse-separator svelte-3erbu0"></div>`),xQ=X(`<div class="jse-space svelte-3erbu0"></div>`),SQ=X(`<button type="button"><!> <!></button>`),CQ=X(`<div class="jse-menu svelte-3erbu0"><!> <!> <!></div>`);function wQ(e,t){vB(t,!1);var n=$(t,`items`,25,()=>[]);GW(!0);var r=CQ(),i=H(r);cW(i,t,`left`,{},null);var a=U(i,2);nW(a,1,n,eW,(e,t)=>{var n=kU(),r=hH(n),i=e=>{Z(e,bQ())},a=WV(()=>(J(bq),K(t),q(()=>bq(K(t))))),o=e=>{Z(e,xQ())},s=WV(()=>(J(yq),K(t),q(()=>yq(K(t))))),c=e=>{var n=SQ(),r=H(n),i=e=>{GK(e,{get data(){return K(t),q(()=>K(t).icon)}})};Q(r,e=>{K(t),q(()=>K(t).icon)&&e(i)});var a=U(r,2),o=e=>{var n=OU();G(()=>PU(n,(K(t),q(()=>K(t).text)))),Z(e,n)};Q(a,e=>{K(t),q(()=>K(t).text)&&e(o)}),G(()=>{var e;_W(n,1,`jse-button ${(K(t),e=q(()=>K(t).className))!==null&&e!==void 0?e:``}`,`svelte-3erbu0`),jW(n,`title`,(K(t),q(()=>K(t).title))),n.disabled=(K(t),q(()=>K(t).disabled||!1))}),Y(`click`,n,function(){for(var e,n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];(e=K(t).onClick)==null||e.apply(this,r)}),Z(e,n)},l=WV(()=>(J(Sq),K(t),q(()=>Sq(K(t))))),u=e=>{var n=OU();G(e=>PU(n,e),[()=>(K(t),q(()=>function(e){return console.error(`Unknown type of menu item`,e),`???`}(K(t))))]),Z(e,n)};Q(r,e=>{K(a)?e(i):K(s)?e(o,1):K(l)?e(c,2):e(u,-1)}),Z(e,n)}),cW(U(a,2),t,`right`,{},null),Z(e,r),yB()}OK(`/* over all fonts, sizes, and colors */
|
|
1511
1511
|
/* "consolas" for Windows, "menlo" for Mac with fallback to "monaco", 'Ubuntu Mono' for Ubuntu */
|
|
1512
1512
|
/* (at Mac this font looks too large at 14px, but 13px is too small for the font on Windows) */
|
|
1513
1513
|
/* main, menu, modal */
|
|
@@ -1549,7 +1549,7 @@ dialog.jse-modal.svelte-2aoco4 .svelte-select {
|
|
|
1549
1549
|
color: var(--jse-text-color, #4d4d4d);
|
|
1550
1550
|
resize: none;
|
|
1551
1551
|
outline: none;
|
|
1552
|
-
}`);var
|
|
1552
|
+
}`);var TQ=X(`<div slot="left" class="jse-info svelte-16jv58j">Repair invalid JSON, then click apply</div>`),EQ=X(`<div class="jse-json-repair-component svelte-16jv58j"><!> <!> <textarea class="jse-json-text svelte-16jv58j" autocomplete="off" autocapitalize="off" spellcheck="false"></textarea></div>`);function DQ(e,t){vB(t,!1);var n=B(void 0,!0),r=B(void 0,!0),i=B(void 0,!0),a=B(void 0,!0),o=B(void 0,!0),s=B(void 0,!0),c=$(t,`text`,13,``),l=$(t,`readOnly`,9,!1),u=$(t,`onParse`,9),d=$(t,`onRepair`,9),f=$(t,`onChange`,9,void 0),p=$(t,`onApply`,9),m=$(t,`onCancel`,9),h=$W(`jsoneditor:JSONRepair`),g=B(void 0,!0);function _(){if(K(g)&&K(n)){var e=K(n).position===void 0?0:K(n).position;K(g).setSelectionRange(e,e),K(g).focus()}}function v(){p()(c())}function y(){try{c(d()(c())),f()&&f()(c())}catch{}}var b=B(void 0,!0);W(()=>J(c()),()=>{V(n,function(e){try{u()(e);return}catch(t){return MG(e,t.message)}}(c()))}),W(()=>J(c()),()=>{V(r,function(e){try{return d()(e),!0}catch{return!1}}(c()))}),W(()=>K(n),()=>{h(`error`,K(n))}),W(()=>J(m()),()=>{V(b,[{type:`space`},{type:`button`,icon:yv,title:`Cancel repair`,className:`jse-cancel`,onClick:m()}])}),W(()=>fv,()=>{V(i,{icon:fv,text:`Show me`,title:`Scroll to the error location`,onClick:_})}),W(()=>ev,()=>{V(a,{icon:ev,text:`Auto repair`,title:`Automatically repair JSON`,onClick:y})}),W(()=>(K(r),K(i),K(a)),()=>{V(o,K(r)?[K(i),K(a)]:[K(i)])}),W(()=>J(l()),()=>{V(s,[{icon:Cv,text:`Apply`,title:`Apply fixed JSON`,disabled:l(),onClick:v}])}),DH(),GW(!0);var x=EQ(),S=H(x);wQ(S,{get items(){return K(b)},$$slots:{left:(e,t)=>{Z(e,TQ())}}});var C=U(S,2),w=e=>{var t=GV(()=>(K(n),q(()=>`Cannot parse JSON: ${K(n).message}`)));sQ(e,{type:`error`,get icon(){return wv},get message(){return K(t)},get actions(){return K(o)}})},T=e=>{sQ(e,{type:`success`,message:`JSON is valid now and can be parsed.`,get actions(){return K(s)}})};Q(C,e=>{K(n)?e(w):e(T,-1)});var E=U(C,2);HW(E,e=>V(g,e),()=>K(g)),G(()=>{E.readOnly=l(),AW(E,c())}),Y(`input`,E,function(e){h(`handleChange`);var t=e.target.value;c()!==t&&(c(t),f()&&f()(c()))}),Z(e,x),yB()}function OQ(e,t){vB(t,!1);var n=$(t,`text`,13),r=$(t,`onParse`,9),i=$(t,`onRepair`,9),a=$(t,`onApply`,9),o=$(t,`onClose`,9);function s(e){a()(e),o()()}function c(){o()()}GW(!0),_Q(e,{get onClose(){return o()},className:`jse-repair-modal`,children:(e,t)=>{DQ(e,{get onParse(){return r()},get onRepair(){return i()},onApply:s,onCancel:c,get text(){return n()},set text(e){n(e)},$$legacy:!0})},$$slots:{default:!0}}),yB()}OK(`/* over all fonts, sizes, and colors */
|
|
1553
1553
|
/* "consolas" for Windows, "menlo" for Mac with fallback to "monaco", 'Ubuntu Mono' for Ubuntu */
|
|
1554
1554
|
/* (at Mac this font looks too large at 14px, but 13px is too small for the font on Windows) */
|
|
1555
1555
|
/* main, menu, modal */
|
|
@@ -1608,7 +1608,7 @@ div.jse-collapsed-items.svelte-1v6dhm4 button.jse-expand-items:where(.svelte-1v6
|
|
|
1608
1608
|
}
|
|
1609
1609
|
div.jse-collapsed-items.svelte-1v6dhm4 button.jse-expand-items:where(.svelte-1v6dhm4):hover, div.jse-collapsed-items.svelte-1v6dhm4 button.jse-expand-items:where(.svelte-1v6dhm4):focus {
|
|
1610
1610
|
color: var(--jse-collapsed-items-link-color-highlight, #ee5341);
|
|
1611
|
-
}`);var
|
|
1611
|
+
}`);var kQ=X(`<button type="button" class="jse-expand-items svelte-1v6dhm4"> </button>`),AQ=X(`<div role="none"><div><div class="jse-text svelte-1v6dhm4"> </div> <!></div></div>`);function jQ(e,t){vB(t,!1);var n=B(void 0,!0),r=B(void 0,!0),i=B(void 0,!0),a=B(void 0,!0),o=B(void 0,!0),s=$(t,`visibleSections`,9),c=$(t,`sectionIndex`,9),l=$(t,`total`,9),u=$(t,`path`,9),d=$(t,`selection`,9),f=$(t,`onExpandSection`,9),p=$(t,`context`,9);W(()=>(J(s()),J(c())),()=>{V(n,s()[c()])}),W(()=>K(n),()=>{V(r,K(n).end)}),W(()=>(J(s()),J(c()),J(l())),()=>{V(i,s()[c()+1]?s()[c()+1].start:l())}),W(()=>(J(p()),J(d()),J(u()),K(r)),()=>{V(a,QJ(p().getJson(),d(),u().concat(String(K(r)))))}),W(()=>(K(r),K(i)),()=>{V(o,function(e,t){var n={start:e,end:Math.min(_q(e),t)},r=Math.max(vq((e+t)/2),e),i={start:r,end:Math.min(_q(r),t)},a=vq(t),o=a===t?a-$K:a,s={start:Math.max(o,e),end:t},c=[n],l=i.start>=n.end&&i.end<=s.start;return l&&c.push(i),s.start>=(l?i.end:n.end)&&c.push(s),c}(K(r),K(i)))}),DH(),GW(!0);var m,h,g=AQ(),_=H(H(g)),v=H(_);nW(U(_,2),1,()=>K(o),eW,(e,t)=>{var n=kQ(),r=H(n);G(()=>{var e,n;return PU(r,`show ${(K(t),e=q(()=>K(t).start))!==null&&e!==void 0?e:``}-${(K(t),n=q(()=>K(t).end))!==null&&n!==void 0?n:``}`)}),Y(`click`,n,()=>f()(u(),K(t))),Z(e,n)}),G(()=>{m=_W(g,1,`jse-collapsed-items svelte-1v6dhm4`,null,m,{"jse-selected":K(a)}),h=yW(g,``,h,{"--level":(J(u()),q(()=>u().length+2))}),PU(v,`Items ${K(r)??``}-${K(i)??``}`)}),Y(`mousemove`,g,function(e){e.stopPropagation()}),Z(e,g),yB()}OK(`/* over all fonts, sizes, and colors */
|
|
1612
1612
|
/* "consolas" for Windows, "menlo" for Mac with fallback to "monaco", 'Ubuntu Mono' for Ubuntu */
|
|
1613
1613
|
/* (at Mac this font looks too large at 14px, but 13px is too small for the font on Windows) */
|
|
1614
1614
|
/* main, menu, modal */
|
|
@@ -1658,7 +1658,7 @@ div.jse-collapsed-items.svelte-1v6dhm4 button.jse-expand-items:where(.svelte-1v6
|
|
|
1658
1658
|
}
|
|
1659
1659
|
.jse-context-menu-pointer.jse-selected.svelte-10ijtzr:hover {
|
|
1660
1660
|
background: var(--jse-context-menu-pointer-background-highlight, var(--jse-context-menu-background-highlight, #7a7a7a));
|
|
1661
|
-
}`);var
|
|
1661
|
+
}`);var MQ=X(`<button type="button"><!></button>`);function NQ(e,t){vB(t,!1);var n=$(t,`root`,9,!1),r=$(t,`insert`,9,!1),i=$(t,`selected`,9),a=$(t,`onContextMenu`,9);GW(!0);var o,s=MQ();GK(H(s),{get data(){return sv}}),G(()=>{o=_W(s,1,`jse-context-menu-pointer svelte-10ijtzr`,null,o,{"jse-root":n(),"jse-insert":r(),"jse-selected":i()}),jW(s,`title`,oq)}),Y(`click`,s,function(e){for(var t=e.target;t&&t.nodeName!==`BUTTON`;)t=t.parentNode;t&&a()({anchor:t,left:0,top:0,width:pq,height:fq,offsetTop:2,offsetLeft:0,showTip:!0})}),Z(e,s),yB()}OK(`/* over all fonts, sizes, and colors */
|
|
1662
1662
|
/* "consolas" for Windows, "menlo" for Mac with fallback to "monaco", 'Ubuntu Mono' for Ubuntu */
|
|
1663
1663
|
/* (at Mac this font looks too large at 14px, but 13px is too small for the font on Windows) */
|
|
1664
1664
|
/* main, menu, modal */
|
|
@@ -1699,7 +1699,7 @@ div.jse-collapsed-items.svelte-1v6dhm4 button.jse-expand-items:where(.svelte-1v6
|
|
|
1699
1699
|
pointer-events: none;
|
|
1700
1700
|
color: var(--jse-tag-background, rgba(0, 0, 0, 0.2));
|
|
1701
1701
|
content: "key";
|
|
1702
|
-
}`);var
|
|
1702
|
+
}`);var PQ=X(`<div role="none" data-type="selectable-key"><!></div>`),FQ=X(`<!> <!>`,1),IQ=X(`<div role="button" tabindex="-1" class="jse-value" data-type="selectable-value"></div>`);function LQ(e,t){vB(t,!0);var n=WV(()=>bJ(t.selection)&&KJ(t.selection)),r=WV(()=>t.context.onRenderValue({path:t.path,value:t.value,mode:t.context.mode,truncateTextSize:t.context.truncateTextSize,readOnly:t.context.readOnly,enforceString:t.enforceString,isEditing:K(n),parser:t.context.parser,normalization:t.context.normalization,selection:t.selection,searchResultItems:t.searchResultItems,onPatch:t.context.onPatch,onPasteJson:t.context.onPasteJson,onSelect:t.context.onSelect,onFind:t.context.onFind,findNextInside:t.context.findNextInside,focus:t.context.focus})),i=kU();nW(hH(i),17,()=>K(r),eW,(e,t)=>{var n=kU(),r=hH(n),i=e=>{var n=WV(()=>K(t).action),r=IQ();uW(r,(e,t)=>K(n)?.(e,t),()=>K(t).props),Z(e,r)},a=WV(()=>Aq(K(t))),o=e=>{var n=WV(()=>K(t).component),r=kU();lW(hH(r),()=>K(n),(e,n)=>{n(e,QW(()=>K(t).props))}),Z(e,r)};Q(r,e=>{K(a)?e(i):e(o,-1)}),Z(e,n)}),Z(e,i),yB()}var RQ={selecting:!1,selectionAnchor:void 0,selectionAnchorType:void 0,selectionFocus:void 0,dragging:!1};function zQ(e){var{json:t,selection:n,deltaY:r,items:i}=e;if(!n)return{operations:void 0,updatedSelection:void 0,offset:0};var a=r<0?function(e){for(var{json:t,items:n,selection:r,deltaY:i}=e,a=DJ(t,r),o=n.findIndex(e=>Hg(e.path,a)),s=()=>n[c-1]?.height,c=o,l=0;s()!==void 0&&Math.abs(i)>l+s()/2;)l+=s(),--c;var u=n[c].path,d=c-o;return c!==o&&n[c]!==void 0?{beforePath:u,offset:d}:void 0}({json:t,selection:n,deltaY:r,items:i}):function(e){for(var{json:t,items:n,selection:r,deltaY:i}=e,a=OJ(t,r),o=n.findIndex(e=>Hg(e.path,a)),s=0,c=o,l=()=>n[c+1]?.height;l()!==void 0&&Math.abs(i)>s+l()/2;)s+=l(),c+=1;var u=lc(t,Lg(a)),d=n[Array.isArray(u)?c:c+1]?.path,f=c-o;return d?{beforePath:d,offset:f}:{append:!0,offset:f}}({json:t,selection:n,deltaY:r,items:i});if(!a||a.offset===0)return{operations:void 0,updatedSelection:void 0,offset:0};var o=function(e,t,n){if(!t)return[];var r=`beforePath`in n?n.beforePath:void 0,i=`append`in n?n.append:void 0,a=Lg(eY(t)),o=lc(e,a);if(!(i||r&&IJ(r,a)&&r.length>a.length))return[];var s=DJ(e,t),c=OJ(e,t),l=kg(s),u=kg(c),d=r?r[a.length]:void 0;if(!Ys(o)){if(Js(o)){var f=iG(l),p=iG(u),m=d===void 0?o.length:iG(d);return o_(p-f+1,m<f?e=>({op:`move`,from:_c(a.concat(String(f+e))),path:_c(a.concat(String(m+e)))}):()=>({op:`move`,from:_c(a.concat(String(f))),path:_c(a.concat(String(m)))}))}throw Error(`Cannot create move operations: parent must be an Object or Array`)}var h=Object.keys(o),g=h.indexOf(l),_=h.indexOf(u),v=i?h.length:d===void 0?-1:h.indexOf(d);return g!==-1&&_!==-1&&v!==-1?v>g?[...h.slice(g,_+1),...h.slice(v,h.length)].map(e=>mY(a,e)):[...h.slice(v,g),...h.slice(_+1,h.length)].map(e=>mY(a,e)):[]}(t,n,a),s=lc(t,Lg(DJ(t,n)));return Array.isArray(s)?{operations:o,updatedSelection:function(e){var{items:t,json:n,selection:r,offset:i}=e,a=DJ(n,r),o=OJ(n,r),s=t.findIndex(e=>Hg(e.path,a)),c=t.findIndex(e=>Hg(e.path,o));return WJ(t[s+i]?.path,t[c+i]?.path)}({items:i,json:t,selection:n,offset:a.offset}),offset:a.offset}:{operations:o,updatedSelection:void 0,offset:a.offset}}OK(`/* over all fonts, sizes, and colors */
|
|
1703
1703
|
/* "consolas" for Windows, "menlo" for Mac with fallback to "monaco", 'Ubuntu Mono' for Ubuntu */
|
|
1704
1704
|
/* (at Mac this font looks too large at 14px, but 13px is too small for the font on Windows) */
|
|
1705
1705
|
/* main, menu, modal */
|
|
@@ -1764,7 +1764,7 @@ button.jse-validation-warning.svelte-q6a061 {
|
|
|
1764
1764
|
vertical-align: top;
|
|
1765
1765
|
display: inline-flex;
|
|
1766
1766
|
color: var(--jse-warning-color, #fdc539);
|
|
1767
|
-
}`);var
|
|
1767
|
+
}`);var BQ=X(`<button type="button"><!></button>`);function VQ(e,t){vB(t,!1);var n=B(),r=_B(`absolute-popup`),i=$(t,`validationError`,8),a=$(t,`onExpand`,8);W(()=>J(i()),()=>{V(n,kq(i())&&i().isChildError?`Contains invalid data`:i().message)}),DH(),GW();var o=BQ();GK(H(o),{get data(){return wv}}),EH(()=>Y(`click`,o,function(){for(var e,t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];(e=a())==null||e.apply(this,n)})),uW(o,(e,t)=>VY?.(e,t),()=>R({text:K(n)},r)),G(()=>{var e;return _W(o,1,`jse-validation-${(J(i()),e=q(()=>i().severity))!==null&&e!==void 0?e:``}`,`svelte-q6a061`)}),Z(e,o),yB()}OK(`/* over all fonts, sizes, and colors */
|
|
1768
1768
|
/* "consolas" for Windows, "menlo" for Mac with fallback to "monaco", 'Ubuntu Mono' for Ubuntu */
|
|
1769
1769
|
/* (at Mac this font looks too large at 14px, but 13px is too small for the font on Windows) */
|
|
1770
1770
|
/* main, menu, modal */
|
|
@@ -1983,10 +1983,10 @@ button.jse-validation-warning.svelte-q6a061 {
|
|
|
1983
1983
|
}
|
|
1984
1984
|
.jse-json-node.svelte-1qi6rc1 .jse-insert-area.jse-selected:where(.svelte-1qi6rc1) {
|
|
1985
1985
|
outline-color: var(--jse-context-menu-pointer-background, var(--jse-context-menu-background, #656565));
|
|
1986
|
-
}`);var
|
|
1987
|
-
${(J(a()),t=q(()=>a().length===1?`item`:`items`))!==null&&t!==void 0?t:``}`)}),Z(e,n)},$$slots:{default:!0}}),Z(e,t)},k=e=>{var t=
|
|
1988
|
-
${(J(a()),t=q(()=>a().length===1?`item`:`items`))!==null&&t!==void 0?t:``}`)}),Z(e,n)},$$slots:{default:!0}}),Z(e,t)};Q(re,e=>{K(_)?e(O):e(k,-1)});var se=U(ne,2),ce=e=>{var t=
|
|
1989
|
-
${t??``}`),[()=>(J(a()),q(()=>Object.keys(a()).length)),()=>(J(a()),q(()=>Object.keys(a()).length===1?`prop`:`props`))]),Z(e,n)},$$slots:{default:!0}}),Z(e,t)};Q(re,e=>{K(_)?e(O):e(k,-1)});var se=U(ne,2),ce=e=>{var t=
|
|
1986
|
+
}`);var HQ=qW(()=>RQ),UQ=X(`<div class="jse-separator svelte-1qi6rc1">:</div>`),WQ=X(`<div class="jse-bracket svelte-1qi6rc1">[</div> <!> `,1),GQ=X(`<div class="jse-bracket svelte-1qi6rc1">[</div> <!> <div class="jse-bracket svelte-1qi6rc1">]</div>`,1),KQ=X(`<div class="jse-context-menu-pointer-anchor svelte-1qi6rc1"><!></div>`),qQ=X(`<div role="none" class="jse-insert-selection-area jse-inside svelte-1qi6rc1" data-type="insert-selection-area-inside"></div>`),JQ=X(`<div role="none" class="jse-insert-selection-area jse-after svelte-1qi6rc1" data-type="insert-selection-area-after"></div>`),YQ=X(`<div data-type="insert-selection-area-inside"><!></div>`),XQ=X(`<div slot="identifier" class="jse-identifier svelte-1qi6rc1"><div class="jse-index svelte-1qi6rc1"> </div></div>`),ZQ=X(`<!> <!>`,1),QQ=X(`<div role="none" class="jse-insert-selection-area jse-after svelte-1qi6rc1" data-type="insert-selection-area-after"></div>`),$Q=X(`<div class="jse-items svelte-1qi6rc1"><!> <!></div> <div class="jse-footer-outer svelte-1qi6rc1"><div data-type="selectable-value" class="jse-footer svelte-1qi6rc1"><span class="jse-bracket svelte-1qi6rc1">]</span></div> <!></div>`,1),e$=X(`<div class="jse-header-outer svelte-1qi6rc1"><div class="jse-header svelte-1qi6rc1"><button type="button" class="jse-expand svelte-1qi6rc1" title="Expand or collapse this array (Ctrl+Click to expand/collapse recursively)"><!></button> <!> <!> <div class="jse-meta svelte-1qi6rc1"><div class="jse-meta-inner svelte-1qi6rc1" data-type="selectable-value"><!></div></div> <!></div> <!> <!></div> <!>`,1),t$=X(`<div class="jse-separator svelte-1qi6rc1">:</div>`),n$=X(`<div class="jse-bracket jse-expanded svelte-1qi6rc1">{</div>`),r$=X(`<div class="jse-bracket svelte-1qi6rc1">{</div> <!> <div class="jse-bracket svelte-1qi6rc1">}</div>`,1),i$=X(`<div class="jse-context-menu-pointer-anchor svelte-1qi6rc1"><!></div>`),a$=X(`<div role="none" class="jse-insert-selection-area jse-inside svelte-1qi6rc1" data-type="insert-selection-area-inside"></div>`),o$=X(`<div role="none" class="jse-insert-selection-area jse-after svelte-1qi6rc1" data-type="insert-selection-area-after"></div>`),s$=X(`<div data-type="insert-selection-area-inside"><!></div>`),c$=X(`<div slot="identifier"><!></div>`),l$=X(`<div role="none" class="jse-insert-selection-area jse-after svelte-1qi6rc1" data-type="insert-selection-area-after"></div>`),u$=X(`<div class="jse-props svelte-1qi6rc1"><!> <!></div> <div class="jse-footer-outer svelte-1qi6rc1"><div data-type="selectable-value" class="jse-footer svelte-1qi6rc1"><div class="jse-bracket svelte-1qi6rc1">}</div></div> <!></div>`,1),d$=X(`<div class="jse-header-outer svelte-1qi6rc1"><div class="jse-header svelte-1qi6rc1"><button type="button" class="jse-expand svelte-1qi6rc1" title="Expand or collapse this object (Ctrl+Click to expand/collapse recursively)"><!></button> <!> <!> <div class="jse-meta svelte-1qi6rc1" data-type="selectable-value"><div class="jse-meta-inner svelte-1qi6rc1"><!></div></div> <!></div> <!> <!></div> <!>`,1),f$=X(`<div class="jse-separator svelte-1qi6rc1">:</div>`),p$=X(`<div class="jse-context-menu-pointer-anchor svelte-1qi6rc1"><!></div>`),m$=X(`<div role="none" class="jse-insert-selection-area jse-after svelte-1qi6rc1" data-type="insert-selection-area-after"></div>`),h$=X(`<div class="jse-contents-outer svelte-1qi6rc1"><div class="jse-contents svelte-1qi6rc1"><!> <!> <div class="jse-value-outer svelte-1qi6rc1"><!></div> <!></div> <!> <!></div>`),g$=X(`<div data-type="insert-selection-area-after"><!></div>`),_$=X(`<div role="treeitem" tabindex="-1"><!> <!></div>`);function v$(e,t){vB(t,!1);var n=B(void 0,!0),r=B(void 0,!0),i=$(t,`pointer`,9),a=$(t,`value`,9),o=$(t,`state`,9),s=$(t,`validationErrors`,9),c=$(t,`searchResults`,9),l=$(t,`selection`,9),u=$(t,`context`,9),d=$(t,`onDragSelectionStart`,9),f=$W(`jsoneditor:JSONNode`),p=B(void 0,!0),m=void 0,h=B(void 0,!0),g=B(void 0,!0),_=B(void 0,!0),v=B(void 0,!0),y=B(void 0,!0),b=B(void 0,!0),x=B(void 0,!0);function S(e){e.stopPropagation();var t=EK(e);u().onExpand(K(g),!K(_),t)}function C(){u().onExpand(K(g),!0)}function w(e,t){var n=lY(K(g),Object.keys(a()),e,t);return u().onPatch(n),kg(gc(n[0].path))}function T(e){u().onDrag(e)}function E(e){HQ().selecting&&(HQ(HQ().selecting=!1),e.stopPropagation()),u().onDragEnd(),document.removeEventListener(`mousemove`,T,!0),document.removeEventListener(`mouseup`,E)}function ee(){var e;return((e=u().findElement([]))==null||(e=e.getBoundingClientRect())==null?void 0:e.top)||0}function te(e,t){var n=ee()-e.initialContentTop;return t.clientY-e.initialClientY-n}function D(e){if(!u().readOnly&&l()){var t=Lg(eY(l()));if(Hg(K(g),t)){var n=function(e,t){var n=[];function r(e){var t=K(g).concat(e),r=u().findElement(t);r!==void 0&&n.push({path:t,height:r.clientHeight})}if(Array.isArray(a())){var i=u().getJson();if(i===void 0)return;var o=DJ(i,e),s=OJ(i,e),c=parseInt(kg(o),10),l=parseInt(kg(s),10),d=t.find(e=>c>=e.start&&l<=e.end);if(!d)return;var{start:f,end:p}=d;xG(f,Math.min(a().length,p),e=>r(String(e)))}else Object.keys(a()).forEach(r);return n}(l(),K(y)||nq);if(f(`dragSelectionStart`,{selection:l(),items:n}),n){var r=u().getJson();if(r!==void 0){var i=DJ(r,l()),o=n.findIndex(e=>Hg(e.path,i)),{offset:s}=zQ({json:r,selection:u().getSelection(),deltaY:0,items:n});V(h,{initialTarget:e.target,initialClientY:e.clientY,initialContentTop:ee(),selectionStartIndex:o,selectionItemsCount:TJ(r,l()).length,items:n,offset:s,didMoveItems:!1}),HQ(HQ().dragging=!0),document.addEventListener(`mousemove`,ne,!0),document.addEventListener(`mouseup`,re)}}else f(`Cannot drag the current selection (probably spread over multiple sections)`)}else d()(e)}}function ne(e){if(K(h)){var t=u().getJson();if(t===void 0)return;var n=te(K(h),e),{offset:r}=zQ({json:t,selection:u().getSelection(),deltaY:n,items:K(h).items});r!==K(h).offset&&(f(`drag selection`,r,n),V(h,R(R({},K(h)),{},{offset:r,didMoveItems:!0})))}}function re(e){if(K(h)){var t=u().getJson();if(t===void 0)return;var n=te(K(h),e),{operations:r,updatedSelection:i}=zQ({json:t,selection:u().getSelection(),deltaY:n,items:K(h).items});if(r)u().onPatch(r,(e,t)=>({state:t,selection:i??l()}));else if(e.target===K(h).initialTarget&&!K(h).didMoveItems){var a=bK(e.target),o=SK(e.target);o&&u().onSelect(XJ(a,o))}V(h,void 0),HQ(HQ().dragging=!1),document.removeEventListener(`mousemove`,ne,!0),document.removeEventListener(`mouseup`,re)}}function ie(e){e.shiftKey||(e.stopPropagation(),e.preventDefault(),u().onSelect(HJ(K(g))))}function ae(e){e.shiftKey||(e.stopPropagation(),e.preventDefault(),u().onSelect(UJ(K(g))))}function oe(e){u().onSelect(HJ(K(g))),uV(),u().onContextMenu(e)}function O(e){u().onSelect(UJ(K(g))),uV(),u().onContextMenu(e)}W(()=>J(i()),()=>{V(g,gc(i()))}),W(()=>J(i()),()=>{V(n,encodeURIComponent(i()))}),W(()=>J(o()),()=>{V(_,!!Pq(o())&&o().expanded)}),W(()=>(J(a()),J(o())),()=>{V(v,oJ(a(),o(),[]))}),W(()=>J(o()),()=>{V(y,Mq(o())?o().visibleSections:void 0)}),W(()=>J(s()),()=>{V(b,s()?.validationError)}),W(()=>(J(u()),J(l()),K(g)),()=>{V(x,QJ(u().getJson(),l(),K(g)))}),W(()=>K(g),()=>{V(r,K(g).length===0)}),DH(),GW(!0);var k,se,ce=_$(),le=H(ce),ue=e=>{var n=e$(),d=hH(n),f=H(d),m=H(f),v=H(m),w=e=>{GK(e,{get data(){return sv}})},T=e=>{GK(e,{get data(){return z_}})};Q(v,e=>{K(_)?e(w):e(T,-1)});var E=U(m,2);cW(E,t,`identifier`,{},null);var ee=U(E,2),te=e=>{Z(e,UQ())};Q(ee,e=>{K(r)||e(te)});var ne=U(ee,2),re=H(H(ne)),O=e=>{var t=WQ();IY(U(hH(t),2),{children:(e,t)=>{var n=OU();G(()=>{var e,t;return PU(n,`${(J(a()),e=q(()=>a().length))!==null&&e!==void 0?e:``}
|
|
1987
|
+
${(J(a()),t=q(()=>a().length===1?`item`:`items`))!==null&&t!==void 0?t:``}`)}),Z(e,n)},$$slots:{default:!0}}),Z(e,t)},k=e=>{var t=GQ();IY(U(hH(t),2),{onclick:C,children:(e,t)=>{var n=OU();G(()=>{var e,t;return PU(n,`${(J(a()),e=q(()=>a().length))!==null&&e!==void 0?e:``}
|
|
1988
|
+
${(J(a()),t=q(()=>a().length===1?`item`:`items`))!==null&&t!==void 0?t:``}`)}),Z(e,n)},$$slots:{default:!0}}),Z(e,t)};Q(re,e=>{K(_)?e(O):e(k,-1)});var se=U(ne,2),ce=e=>{var t=KQ();NQ(H(t),{get root(){return K(r)},selected:!0,get onContextMenu(){return J(u()),q(()=>u().onContextMenu)}}),Z(e,t)},le=WV(()=>(J(u()),K(x),J(l()),J(bJ),J(xJ),J(KJ),J(Hg),J(eY),K(g),q(()=>!u().readOnly&&K(x)&&l()&&(bJ(l())||xJ(l()))&&!KJ(l())&&Hg(eY(l()),K(g)))));Q(se,e=>{K(le)&&e(ce)});var ue=U(f,2),A=e=>{VQ(e,{get validationError(){return K(b)},onExpand:C})};Q(ue,e=>{K(b),K(_),q(()=>K(b)&&(!K(_)||!K(b).isChildError))&&e(A)});var de=U(ue,2),fe=e=>{var t=qQ();Y(`click`,t,ie),Z(e,t)},pe=e=>{var t=JQ();Y(`click`,t,ae),Z(e,t)};Q(de,e=>{K(_)?e(fe):e(pe,-1)});var j=U(d,2),me=e=>{var t=$Q(),n=hH(t),d=H(n),f=e=>{var t,n,r=YQ(),i=H(r),a=GV(()=>(K(x),J(vJ),J(l()),q(()=>K(x)&&vJ(l()))));NQ(i,{insert:!0,get selected(){return K(a)},onContextMenu:oe}),G(e=>{t=_W(r,1,`jse-insert-area jse-inside svelte-1qi6rc1`,null,t,e),jW(r,`title`,aq),n=yW(r,``,n,{"--level":(K(g),q(()=>K(g).length+1))})},[()=>({"jse-hovered":K(p)===sq,"jse-selected":K(x)&&vJ(l())})]),Z(e,r)},m=WV(()=>(J(u()),K(p),J(sq),K(x),J(vJ),J(l()),q(()=>!u().readOnly&&(K(p)===sq||K(x)&&vJ(l())))));Q(d,e=>{K(m)&&e(f)}),nW(U(d,2),1,()=>K(y)||nq,eW,(e,t,n)=>{var r=ZQ(),d=hH(r);nW(d,1,()=>(J(a()),K(t),K(h),q(()=>function(e,t,n){var r=t.start,i=t_(r,Math.min(t.end,e.length));return n&&n.offset!==0?TG(i,n.selectionStartIndex,n.selectionItemsCount,n.offset).map((e,t)=>({index:e,gutterIndex:t})):i.map(e=>({index:e,gutterIndex:e}))}(a(),K(t),K(h)))),e=>e.index,(e,t)=>{var n=GV(()=>(J(Mq),J(s()),K(t),q(()=>Mq(s())?s().items[K(t).index]:void 0))),r=GV(()=>(J(ZJ),J(u()),J(l()),K(g),K(t),q(()=>ZJ(u().getJson(),l(),K(g).concat(String(K(t).index)))))),d=kU(),f=hH(d),p=GV(()=>(J(yc),J(i()),K(t),q(()=>yc(i(),K(t).index)))),m=GV(()=>(J(Mq),J(o()),K(t),q(()=>Mq(o())?o().items[K(t).index]:void 0))),h=GV(()=>(J(Mq),J(c()),K(t),q(()=>Mq(c())?c().items[K(t).index]:void 0)));v$(f,{get value(){return J(a()),K(t),q(()=>a()[K(t).index])},get pointer(){return K(p)},get state(){return K(m)},get validationErrors(){return K(n)},get searchResults(){return K(h)},get selection(){return K(r)},get context(){return u()},onDragSelectionStart:D,$$slots:{identifier:(e,n)=>{var r=XQ(),i=H(H(r));G(()=>PU(i,(K(t),q(()=>K(t).gutterIndex)))),Z(e,r)}}}),Z(e,d)});var f=U(d,2),p=e=>{var t=GV(()=>K(y)||nq);jQ(e,{get visibleSections(){return K(t)},sectionIndex:n,get total(){return J(a()),q(()=>a().length)},get path(){return K(g)},get onExpandSection(){return J(u()),q(()=>u().onExpandSection)},get selection(){return l()},get context(){return u()}})};Q(f,e=>{K(t),J(a()),q(()=>K(t).end<a().length)&&e(p)}),Z(e,r)});var _=U(H(U(n,2)),2),v=e=>{var t=QQ();Y(`click`,t,ae),Z(e,t)};Q(_,e=>{K(r)||e(v)}),Z(e,t)};Q(j,e=>{K(_)&&e(me)}),Y(`click`,m,S),Z(e,n)},A=WV(()=>(J(a()),q(()=>Array.isArray(a())))),de=e=>{var n=d$(),d=hH(n),f=H(d),m=H(f),v=H(m),y=e=>{GK(e,{get data(){return sv}})},T=e=>{GK(e,{get data(){return z_}})};Q(v,e=>{K(_)?e(y):e(T,-1)});var E=U(m,2);cW(E,t,`identifier`,{},null);var ee=U(E,2),te=e=>{Z(e,t$())};Q(ee,e=>{K(r)||e(te)});var ne=U(ee,2),re=H(H(ne)),O=e=>{Z(e,n$())},k=e=>{var t=r$();IY(U(hH(t),2),{onclick:C,children:(e,t)=>{var n=OU();G((e,t)=>PU(n,`${e??``}
|
|
1989
|
+
${t??``}`),[()=>(J(a()),q(()=>Object.keys(a()).length)),()=>(J(a()),q(()=>Object.keys(a()).length===1?`prop`:`props`))]),Z(e,n)},$$slots:{default:!0}}),Z(e,t)};Q(re,e=>{K(_)?e(O):e(k,-1)});var se=U(ne,2),ce=e=>{var t=i$();NQ(H(t),{get root(){return K(r)},selected:!0,get onContextMenu(){return J(u()),q(()=>u().onContextMenu)}}),Z(e,t)},le=WV(()=>(J(u()),K(x),J(l()),J(bJ),J(xJ),J(KJ),J(Hg),J(eY),K(g),q(()=>!u().readOnly&&K(x)&&l()&&(bJ(l())||xJ(l()))&&!KJ(l())&&Hg(eY(l()),K(g)))));Q(se,e=>{K(le)&&e(ce)});var ue=U(f,2),A=e=>{VQ(e,{get validationError(){return K(b)},onExpand:C})};Q(ue,e=>{K(b),K(_),q(()=>K(b)&&(!K(_)||!K(b).isChildError))&&e(A)});var de=U(ue,2),fe=e=>{var t=a$();Y(`click`,t,ie),Z(e,t)},pe=e=>{var t=o$();Y(`click`,t,ae),Z(e,t)};Q(de,e=>{K(_)?e(fe):K(r)||e(pe,1)});var j=U(d,2),me=e=>{var t=u$(),n=hH(t),d=H(n),f=e=>{var t,n,r=s$(),i=H(r),a=GV(()=>(K(x),J(vJ),J(l()),q(()=>K(x)&&vJ(l()))));NQ(i,{insert:!0,get selected(){return K(a)},onContextMenu:oe}),G(e=>{t=_W(r,1,`jse-insert-area jse-inside svelte-1qi6rc1`,null,t,e),jW(r,`title`,aq),n=yW(r,``,n,{"--level":(K(g),q(()=>K(g).length+1))})},[()=>({"jse-hovered":K(p)===sq,"jse-selected":K(x)&&vJ(l())})]),Z(e,r)},m=WV(()=>(J(u()),K(p),J(sq),K(x),J(vJ),J(l()),q(()=>!u().readOnly&&(K(p)===sq||K(x)&&vJ(l())))));Q(d,e=>{K(m)&&e(f)}),nW(U(d,2),1,()=>(J(a()),K(h),q(()=>function(e,t){var n=Object.keys(e);return t&&t.offset!==0?TG(n,t.selectionStartIndex,t.selectionItemsCount,t.offset):n}(a(),K(h)))),eW,(e,t)=>{var n=GV(()=>(J(yc),J(i()),K(t),q(()=>yc(i(),K(t))))),r=GV(()=>(J(jq),J(c()),K(t),q(()=>jq(c())?c().properties[K(t)]:void 0))),d=GV(()=>(J(jq),J(s()),K(t),q(()=>jq(s())?s().properties[K(t)]:void 0))),f=GV(()=>(K(g),K(t),q(()=>K(g).concat(K(t))))),p=GV(()=>(J(ZJ),J(u()),J(l()),J(K(f)),q(()=>ZJ(u().getJson(),l(),K(f))))),m=kU(),h=hH(m),_=GV(()=>(J(jq),J(o()),K(t),q(()=>jq(o())?o().properties[K(t)]:void 0)));v$(h,{get value(){return J(a()),K(t),q(()=>a()[K(t)])},get pointer(){return K(n)},get state(){return K(_)},get validationErrors(){return K(d)},get searchResults(){return K(r)},get selection(){return K(p)},get context(){return u()},onDragSelectionStart:D,$$slots:{identifier:(e,i)=>{var a,o=c$(),s=H(o),c=GV(()=>(J(DY),J(K(r)),q(()=>DY(K(r)))));(function(e,t){vB(t,!1);var n=B(void 0,!0),r=B(void 0,!0),i=$(t,`pointer`,9),a=$(t,`key`,9),o=$(t,`selection`,9),s=$(t,`searchResultItems`,9),c=$(t,`onUpdateKey`,9),l=$(t,`context`,9),u=B(void 0,!0);function d(e){K(r)||l().readOnly||(e.preventDefault(),l().onSelect(zJ(K(u))))}function f(e,t){var n=c()(a(),l().normalization.unescapeValue(e)),r=Lg(K(u)).concat(n);l().onSelect(t===$G.nextInside?BJ(r):RJ(r)),t!==$G.self&&l().focus()}function p(){l().onSelect(RJ(K(u))),l().focus()}W(()=>J(i()),()=>{V(u,gc(i()))}),W(()=>(J(o()),K(u)),()=>{V(n,yJ(o())&&Hg(o().path,K(u)))}),W(()=>(K(n),J(o())),()=>{V(r,K(n)&&KJ(o()))}),DH(),GW(!0);var m=FQ(),h=hH(m),g=e=>{var t=GV(()=>(J(l()),J(a()),q(()=>l().normalization.escapeValue(a())))),n=GV(()=>(J(KJ),J(o()),q(()=>KJ(o())?o().initialValue:void 0)));aY(e,{get value(){return K(t)},get initialValue(){return K(n)},label:`Edit key`,shortText:!0,onChange:f,onCancel:p,get onFind(){return J(l()),q(()=>l().onFind)}})},_=e=>{var t,n=PQ(),r=H(n),i=e=>{var t=GV(()=>(J(l()),J(a()),q(()=>l().normalization.escapeValue(a()))));NY(e,{get text(){return K(t)},get searchResultItems(){return s()}})},o=e=>{var t=OU();G(e=>PU(t,e),[()=>(J(fK),J(l()),J(a()),q(()=>fK(l().normalization.escapeValue(a()))))]),Z(e,t)};Q(r,e=>{s()?e(i):e(o,-1)}),G(()=>t=_W(n,1,`jse-key svelte-1n4cez4`,null,t,{"jse-empty":a()===``})),Y(`dblclick`,n,d),Z(e,n)};Q(h,e=>{J(l()),K(r),q(()=>!l().readOnly&&K(r))?e(g):e(_,-1)});var v=U(h,2),y=e=>{NQ(e,{selected:!0,get onContextMenu(){return J(l()),q(()=>l().onContextMenu)}})};Q(v,e=>{J(l()),K(n),K(r),q(()=>!l().readOnly&&K(n)&&!K(r))&&e(y)}),Z(e,m),yB()})(s,{get pointer(){return K(n)},get key(){return K(t)},get selection(){return K(p)},get searchResultItems(){return K(c)},get context(){return u()},onUpdateKey:w}),G(e=>a=_W(o,1,`jse-key-outer svelte-1qi6rc1`,null,a,e),[()=>({"jse-selected-key":yJ(K(p))&&Hg(K(p).path,K(f))})]),Z(e,o)}}}),Z(e,m)});var _=U(H(U(n,2)),2),v=e=>{var t=l$();Y(`click`,t,ae),Z(e,t)};Q(_,e=>{K(r)||e(v)}),Z(e,t)};Q(j,e=>{K(_)&&e(me)}),Y(`click`,m,S),Z(e,n)},fe=WV(()=>(J(sG),J(a()),q(()=>sG(a())))),pe=e=>{var n=h$(),i=H(n),o=H(i);cW(o,t,`identifier`,{},null);var s=U(o,2),d=e=>{Z(e,f$())};Q(s,e=>{K(r)||e(d)});var f=U(s,2),p=H(f),m=GV(()=>K(x)?l():void 0),h=GV(()=>(J(OY),J(c()),q(()=>OY(c()))));LQ(p,{get path(){return K(g)},get value(){return a()},get enforceString(){return K(v)},get selection(){return K(m)},get searchResultItems(){return K(h)},get context(){return u()}});var _=U(f,2),y=e=>{var t=p$();NQ(H(t),{get root(){return K(r)},selected:!0,get onContextMenu(){return J(u()),q(()=>u().onContextMenu)}}),Z(e,t)},S=WV(()=>(J(u()),K(x),J(l()),J(bJ),J(xJ),J(KJ),J(Hg),J(eY),K(g),q(()=>!u().readOnly&&K(x)&&l()&&(bJ(l())||xJ(l()))&&!KJ(l())&&Hg(eY(l()),K(g)))));Q(_,e=>{K(S)&&e(y)});var w=U(i,2),T=e=>{VQ(e,{get validationError(){return K(b)},onExpand:C})};Q(w,e=>{K(b)&&e(T)});var E=U(w,2),ee=e=>{var t=m$();Y(`click`,t,ae),Z(e,t)};Q(E,e=>{K(r)||e(ee)}),Z(e,n)};Q(le,e=>{K(A)?e(ue):K(fe)?e(de,1):e(pe,-1)});var j=U(le,2),me=e=>{var t,n=g$(),r=H(n),i=GV(()=>(K(x),J(_J),J(l()),q(()=>K(x)&&_J(l()))));NQ(r,{insert:!0,get selected(){return K(i)},onContextMenu:O}),G(e=>{t=_W(n,1,`jse-insert-area jse-after svelte-1qi6rc1`,null,t,e),jW(n,`title`,aq)},[()=>({"jse-hovered":K(p)===cq,"jse-selected":K(x)&&_J(l())})]),Z(e,n)},M=WV(()=>(J(u()),K(p),J(cq),K(x),J(_J),J(l()),q(()=>!u().readOnly&&(K(p)===cq||K(x)&&_J(l())))));Q(j,e=>{K(M)&&e(me)}),G((e,t)=>{k=_W(ce,1,e,`svelte-1qi6rc1`,k,t),jW(ce,`data-path`,K(n)),jW(ce,`aria-selected`,K(x)),se=yW(ce,``,se,{"--level":(K(g),q(()=>K(g).length))})},[()=>pW((J(nY),K(_),J(u()),K(g),J(a()),q(()=>nY(`jse-json-node`,{"jse-expanded":K(_)},u().onClassName(K(g),a()))))),()=>({"jse-root":K(r),"jse-selected":K(x)&&xJ(l()),"jse-selected-value":K(x)&&bJ(l()),"jse-readonly":u().readOnly,"jse-hovered":K(p)===lq})]),Y(`mousedown`,ce,function(e){if((e.buttons===1||e.buttons===2)&&!((t=e.target).nodeName===`DIV`&&t.contentEditable===`true`||e.buttons===1&&pK(e.target,`BUTTON`))){var t;e.stopPropagation(),e.preventDefault(),u().focus(),document.addEventListener(`mousemove`,T,!0),document.addEventListener(`mouseup`,E);var n=bK(e.target),i=u().getJson(),o=u().getDocumentState();if(!l()||n===JG.after||n===JG.inside||l().type!==n&&l().type!==JG.multi||!QJ(i,l(),K(g)))if(HQ(HQ().selecting=!0),HQ(HQ().selectionAnchor=K(g)),HQ(HQ().selectionAnchorType=n),HQ(HQ().selectionFocus=K(g)),e.shiftKey){var s=u().getSelection();s&&u().onSelect(WJ(tY(s),K(g)))}else if(n===JG.multi)if(K(r)&&e.target.hasAttribute(`data-path`)){var c=kg(lJ(a(),o));u().onSelect(YJ(c))}else u().onSelect(WJ(K(g),K(g)));else i!==void 0&&u().onSelect(XJ(n,K(g)));else e.button===0&&d()(e)}}),Y(`mousemove`,ce,function(e){if(HQ().selecting){e.preventDefault(),e.stopPropagation(),HQ().selectionFocus===void 0&&window.getSelection&&window.getSelection().empty();var t=bK(e.target);Hg(K(g),HQ().selectionFocus)&&t===HQ().selectionAnchorType||(HQ(HQ().selectionFocus=K(g)),HQ(HQ().selectionAnchorType=t),u().onSelect(WJ(HQ().selectionAnchor||HQ().selectionFocus,HQ().selectionFocus)))}}),Y(`mouseover`,ce,function(e){HQ().selecting||HQ().dragging||(e.stopPropagation(),mK(e.target,`data-type`,`selectable-value`)?V(p,lq):mK(e.target,`data-type`,`selectable-key`)?V(p,void 0):mK(e.target,`data-type`,`insert-selection-area-inside`)?V(p,sq):mK(e.target,`data-type`,`insert-selection-area-after`)&&V(p,cq),clearTimeout(m))}),Y(`mouseout`,ce,function(e){e.stopPropagation(),m=window.setTimeout(()=>V(p,void 0))}),Z(e,ce),yB()}var y$={prefix:`fas`,iconName:`jsoneditor-expand`,icon:[512,512,[],``,`M 0,448 V 512 h 512 v -64 z M 0,0 V 64 H 512 V 0 Z M 256,96 128,224 h 256 z M 256,416 384,288 H 128 Z`]},b$={prefix:`fas`,iconName:`jsoneditor-collapse`,icon:[512,512,[],``,`m 0,224 v 64 h 512 v -64 z M 256,192 384,64 H 128 Z M 256,320 128,448 h 256 z`]},x$={prefix:`fas`,iconName:`jsoneditor-format`,icon:[512,512,[],``,`M 0,32 v 64 h 416 v -64 z M 160,160 v 64 h 352 v -64 z M 160,288 v 64 h 288 v -64 z M 0,416 v 64 h 320 v -64 z`]},S$={prefix:`fas`,iconName:`jsoneditor-compact`,icon:[512,512,[],``,`M 0,32 v 64 h 512 v -64 z M 0,160 v 64 h 512 v -64 z M 0,288 v 64 h 352 v -64 z`]};OK(`/* over all fonts, sizes, and colors */
|
|
1990
1990
|
/* "consolas" for Windows, "menlo" for Mac with fallback to "monaco", 'Ubuntu Mono' for Ubuntu */
|
|
1991
1991
|
/* (at Mac this font looks too large at 14px, but 13px is too small for the font on Windows) */
|
|
1992
1992
|
/* main, menu, modal */
|
|
@@ -2054,7 +2054,7 @@ button.jse-validation-warning.svelte-q6a061 {
|
|
|
2054
2054
|
}
|
|
2055
2055
|
.jse-welcome.svelte-1lhnan .jse-contents:where(.svelte-1lhnan) button:where(.svelte-1lhnan):disabled {
|
|
2056
2056
|
background: var(--jse-button-primary-background-disabled, #9d9d9d);
|
|
2057
|
-
}`);var
|
|
2057
|
+
}`);var C$=X(`<div class="jse-welcome-info svelte-1lhnan">You can paste clipboard data using <b>Ctrl+V</b>, or use the following options:</div> <button class="svelte-1lhnan">Create object</button> <button class="svelte-1lhnan">Create array</button>`,1),w$=X(`<div class="jse-welcome svelte-1lhnan" role="none"><div class="jse-space jse-before svelte-1lhnan"></div> <div class="jse-contents svelte-1lhnan"><div class="jse-welcome-title">Empty document</div> <!></div> <div class="jse-space jse-after svelte-1lhnan"></div></div>`);function T$(e,t){return(0,Tv.default)(typeof e==`string`?e.toLowerCase():e,typeof t==`string`?t.toLowerCase():t)}function E$(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1,i=lc(e,t);if(Js(i)){if(n===void 0)throw Error(`Cannot sort: no property selected by which to sort the array`);return function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=function(e,t){var n={boolean:0,number:1,string:2,undefined:4},r=3;return function(i,a){var o=lc(i,e),s=lc(a,e);if(typeof o!=typeof s){var c=n[typeof o]??r,l=n[typeof s]??r;return c>l?t:c<l?-t:0}return typeof o==`number`||typeof o==`boolean`?o>s?t:o<s?-t:0:cG(o)?0:t*T$(o,s)}}(arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],arguments.length>3&&arguments[3]!==void 0?arguments[3]:1),r=lc(e,t);return[{op:`replace`,path:_c(t),value:r.slice(0).sort(n)}]}(e,t,n,r)}if(sG(i))return function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,r=lc(e,t),i=Object.keys(r).slice();i.sort((e,t)=>n*T$(e,t));var a={};return i.forEach(e=>a[e]=r[e]),[{op:`replace`,path:_c(t),value:a}]}(e,t,r);throw Error(`Cannot sort: no array or object`)}SU([`click`]),OK(`/* over all fonts, sizes, and colors */
|
|
2058
2058
|
/* "consolas" for Windows, "menlo" for Mac with fallback to "monaco", 'Ubuntu Mono' for Ubuntu */
|
|
2059
2059
|
/* (at Mac this font looks too large at 14px, but 13px is too small for the font on Windows) */
|
|
2060
2060
|
/* main, menu, modal */
|
|
@@ -2106,7 +2106,7 @@ button.jse-validation-warning.svelte-q6a061 {
|
|
|
2106
2106
|
.jse-navigation-bar-dropdown.svelte-1k47orx button.jse-navigation-bar-dropdown-item.jse-selected:where(.svelte-1k47orx) {
|
|
2107
2107
|
background: var(--jse-navigation-bar-dropdown-color, #656565);
|
|
2108
2108
|
color: var(--jse-navigation-bar-background, var(--jse-background-color, #fff));
|
|
2109
|
-
}`);var
|
|
2109
|
+
}`);var D$=X(`<button type="button"> </button>`),O$=X(`<button type="button" class="jse-navigation-bar-dropdown-item svelte-1k47orx">...</button>`),k$=X(`<div class="jse-navigation-bar-dropdown svelte-1k47orx"><!> <!></div>`);function A$(e,t){vB(t,!1);var n=$(t,`items`,9),r=$(t,`selectedItem`,9),i=$(t,`onSelect`,9);GW(!0);var a=k$(),o=H(a);nW(o,1,()=>(J(SG),J(n()),q(()=>SG(n(),100))),e=>e,(e,t)=>{var n,a=D$(),o=H(a);G((e,i)=>{n=_W(a,1,`jse-navigation-bar-dropdown-item svelte-1k47orx`,null,n,{"jse-selected":K(t)===r()}),jW(a,`title`,e),PU(o,i)},[()=>(K(t),q(()=>K(t).toString())),()=>(J(FK),K(t),q(()=>FK(K(t).toString(),30)))]),Y(`click`,a,UW(()=>i()(K(t)))),Z(e,a)});var s=U(o,2),c=e=>{var t=O$();jW(t,`title`,`Limited to 100 items`),Z(e,t)};Q(s,e=>{J(n()),q(()=>n().length>100)&&e(c)}),Z(e,a),yB()}OK(`/* over all fonts, sizes, and colors */
|
|
2110
2110
|
/* "consolas" for Windows, "menlo" for Mac with fallback to "monaco", 'Ubuntu Mono' for Ubuntu */
|
|
2111
2111
|
/* (at Mac this font looks too large at 14px, but 13px is too small for the font on Windows) */
|
|
2112
2112
|
/* main, menu, modal */
|
|
@@ -2154,7 +2154,7 @@ button.jse-validation-warning.svelte-q6a061 {
|
|
|
2154
2154
|
}
|
|
2155
2155
|
.jse-navigation-bar-item.svelte-13sijxb:last-child {
|
|
2156
2156
|
padding-right: var(--jse-padding, 10px);
|
|
2157
|
-
}`);var
|
|
2157
|
+
}`);var j$=X(`<button type="button" class="jse-navigation-bar-button svelte-13sijxb"> </button>`),M$=X(`<div class="jse-navigation-bar-item svelte-13sijxb"><button type="button"><!></button> <!></div>`);function N$(e,t){vB(t,!1);var n,r=B(void 0,!0),i=B(void 0,!0),{openAbsolutePopup:a,closeAbsolutePopup:o}=_B(`absolute-popup`),s=$(t,`path`,9),c=$(t,`index`,9),l=$(t,`onSelect`,9),u=$(t,`getItems`,9),d=B(void 0,!0),f=B(!1,!0);function p(e){o(n),l()(K(r).concat(e))}W(()=>(J(s()),J(c())),()=>{V(r,s().slice(0,c()))}),W(()=>(J(s()),J(c())),()=>{V(i,s()[c()])}),DH(),GW(!0);var m,h=M$(),g=H(h);GK(H(g),{get data(){return J_}});var _=U(g,2),v=e=>{var t=j$(),n=H(t);G(()=>PU(n,K(i))),Y(`click`,t,()=>p(K(i))),Z(e,t)};Q(_,e=>{K(i)!==void 0&&e(v)}),HW(h,e=>V(d,e),()=>K(d)),G(()=>m=_W(g,1,`jse-navigation-bar-button jse-navigation-bar-arrow svelte-13sijxb`,null,m,{"jse-open":K(f)})),Y(`click`,g,function(){K(d)&&(V(f,!0),n=a(A$,{items:u()(K(r)),selectedItem:K(i),onSelect:p},{anchor:K(d),closeOnOuterClick:!0,onClose:()=>{V(f,!1)}}))}),Z(e,h),yB()}function P$(e){var t,n;if(navigator.clipboard)return navigator.clipboard.writeText(e);if((t=(n=document).queryCommandSupported)!=null&&t.call(n,`copy`)){var r=document.createElement(`textarea`);r.value=e,r.style.position=`fixed`,r.style.opacity=`0`,document.body.appendChild(r),r.select();try{document.execCommand(`copy`)}catch(e){console.error(e)}finally{document.body.removeChild(r)}return Promise.resolve()}return console.error(`Copy failed.`),Promise.resolve()}OK(`/* over all fonts, sizes, and colors */
|
|
2158
2158
|
/* "consolas" for Windows, "menlo" for Mac with fallback to "monaco", 'Ubuntu Mono' for Ubuntu */
|
|
2159
2159
|
/* (at Mac this font looks too large at 14px, but 13px is too small for the font on Windows) */
|
|
2160
2160
|
/* main, menu, modal */
|
|
@@ -2216,7 +2216,7 @@ button.jse-validation-warning.svelte-q6a061 {
|
|
|
2216
2216
|
margin: 2px;
|
|
2217
2217
|
padding: 0 5px;
|
|
2218
2218
|
border-radius: 3px;
|
|
2219
|
-
}`);var
|
|
2219
|
+
}`);var F$=X(`<button type="button" class="jse-navigation-bar-validation-error svelte-uyexy4"><!></button>`),I$=X(`<div class="jse-copied-text svelte-uyexy4">Copied!</div>`),L$=X(`<div><input type="text" class="jse-navigation-bar-text svelte-uyexy4"/> <!> <!> <button type="button" title="Copy selected path to the clipboard"><!></button></div>`);function R$(e,t){vB(t,!1);var n=B(),r=_B(`absolute-popup`),i=$(t,`path`,8),a=$(t,`pathParser`,8),o=$(t,`onChange`,8),s=$(t,`onClose`,8),c=$(t,`onError`,8),l=$(t,`pathExists`,8),u=B(),d=B(),f=B(!1),p=void 0,m=B(!1);function h(){K(u).focus()}function g(e){try{var t=a().parse(e);return function(e){if(!l()(e))throw Error(`Path does not exist in current document`)}(t),{path:t,error:void 0}}catch(e){return{path:void 0,error:e}}}KU(()=>{h()}),qU(()=>{clearTimeout(p)}),W(()=>(J(a()),J(i())),()=>{V(d,a().stringify(i()))}),W(()=>(K(f),K(d)),()=>{V(n,K(f)?g(K(d)).error:void 0)}),DH(),GW();var _,v=L$(),y=H(v);HW(y,e=>V(u,e),()=>K(u));var b=U(y,2),x=e=>{var t=F$();GK(H(t),{get data(){return wv}}),uW(t,(e,t)=>VY?.(e,t),()=>R({text:String(K(n)||``)},r)),Z(e,t)};Q(b,e=>{K(n)&&e(x)});var S=U(b,2),C=e=>{Z(e,I$())};Q(S,e=>{K(m)&&e(C)});var w,T=U(S,2);GK(H(T),{get data(){return hv}}),G(()=>{_=_W(v,1,`jse-navigation-bar-path-editor svelte-uyexy4`,null,_,{error:K(n)}),AW(y,K(d)),w=_W(T,1,`jse-navigation-bar-copy svelte-uyexy4`,null,w,{copied:K(m)})}),Y(`keydown`,y,UW(function(e){var t=TK(e);if(t===`Escape`&&(e.preventDefault(),s()()),t===`Enter`){e.preventDefault(),V(f,!0);var n=g(K(d));n.path===void 0?c()(n.error):o()(n.path)}})),Y(`input`,y,function(e){V(d,e.currentTarget.value)}),Y(`click`,T,function(){P$(K(d)),V(m,!0),p=window.setTimeout(()=>V(m,!1),1e3),h()}),Z(e,v),yB()}OK(`/* over all fonts, sizes, and colors */
|
|
2220
2220
|
/* "consolas" for Windows, "menlo" for Mac with fallback to "monaco", 'Ubuntu Mono' for Ubuntu */
|
|
2221
2221
|
/* (at Mac this font looks too large at 14px, but 13px is too small for the font on Windows) */
|
|
2222
2222
|
/* main, menu, modal */
|
|
@@ -2270,7 +2270,7 @@ button.jse-validation-warning.svelte-q6a061 {
|
|
|
2270
2270
|
.jse-navigation-bar.svelte-hjhal6 .jse-navigation-bar-edit:where(.svelte-hjhal6) .jse-navigation-bar-space:where(.svelte-hjhal6) {
|
|
2271
2271
|
flex: 1;
|
|
2272
2272
|
text-align: left;
|
|
2273
|
-
}`);var
|
|
2273
|
+
}`);var z$=X(`<!> <!>`,1),B$=X(`<div class="jse-navigation-bar svelte-hjhal6"><!> <button type="button"><span class="jse-navigation-bar-space svelte-hjhal6"> </span> <!></button></div>`);function V$(e,t){vB(t,!1);var n=B(void 0,!0),r=B(void 0,!0),i=$W(`jsoneditor:NavigationBar`),a=$(t,`json`,9),o=$(t,`selection`,9),s=$(t,`onSelect`,9),c=$(t,`onError`,9),l=$(t,`pathParser`,9),u=B(void 0,!0),d=B(!1,!0);function f(e){i(`get items for path`,e);var t=lc(a(),e);if(Array.isArray(t))return t_(0,t.length).map(String);if(sG(t)){var n=Object.keys(t).slice(0);return n.sort(T$),n}return[]}function p(e){return hc(a(),e)}function m(e){i(`select path`,JSON.stringify(e)),s()(WJ(e,e))}function h(){V(d,!1)}function g(e){h(),m(e)}W(()=>(J(o()),eY),()=>{V(n,o()?eY(o()):[])}),W(()=>(J(a()),K(n)),()=>{V(r,cG(lc(a(),K(n))))}),W(()=>K(n),()=>{K(n),setTimeout(()=>{if(K(u)&&K(u).scrollTo){var e=K(u).scrollWidth-K(u).clientWidth;e>0&&(i(`scrollTo `,e),K(u).scrollTo({left:e,behavior:`smooth`}))}})}),DH(),GW(!0);var _=B$(),v=H(_),y=e=>{var t=z$(),i=hH(t);nW(i,1,()=>K(n),eW,(e,t,r)=>{N$(e,{getItems:f,get path(){return K(n)},index:r,onSelect:m})});var a=U(i,2),o=e=>{N$(e,{getItems:f,get path(){return K(n)},get index(){return K(n),q(()=>K(n).length)},onSelect:m})};Q(a,e=>{K(r)&&e(o)}),Z(e,t)},b=e=>{R$(e,{get path(){return K(n)},onClose:h,onChange:g,get onError(){return c()},pathExists:p,get pathParser(){return l()}})};Q(v,e=>{K(d)?e(b,-1):e(y)});var x,S=U(v,2),C=H(S),w=H(C),T=U(C,2),E=GV(()=>K(d)?vv:K_);GK(T,{get data(){return K(E)}}),HW(_,e=>V(u,e),()=>K(u)),G(e=>{x=_W(S,1,`jse-navigation-bar-edit svelte-hjhal6`,null,x,{flex:!K(d),editing:K(d)}),jW(S,`title`,K(d)?`Cancel editing the selected path`:`Edit the selected path`),PU(w,e)},[()=>(J(cG),J(a()),K(d),q(()=>cG(a())||K(d)?`\xA0`:`Navigation bar`))]),Y(`click`,S,function(){V(d,!K(d))}),Z(e,_),yB()}OK(`/* over all fonts, sizes, and colors */
|
|
2274
2274
|
/* "consolas" for Windows, "menlo" for Mac with fallback to "monaco", 'Ubuntu Mono' for Ubuntu */
|
|
2275
2275
|
/* (at Mac this font looks too large at 14px, but 13px is too small for the font on Windows) */
|
|
2276
2276
|
/* main, menu, modal */
|
|
@@ -2385,7 +2385,7 @@ button.jse-validation-warning.svelte-q6a061 {
|
|
|
2385
2385
|
}
|
|
2386
2386
|
.jse-search-box.svelte-1x1x8q0 .jse-search-form:where(.svelte-1x1x8q0) .jse-search-contents:where(.svelte-1x1x8q0) .jse-replace-section:where(.svelte-1x1x8q0) button:where(.svelte-1x1x8q0) {
|
|
2387
2387
|
width: auto;
|
|
2388
|
-
}`);var V$=X(`<button type="button" class="jse-replace-toggle svelte-1x1x8q0" title="Toggle visibility of replace options (Ctrl+H)"><!></button>`),H$=X(`<div class="jse-replace-section svelte-1x1x8q0"><input class="jse-replace-input svelte-1x1x8q0" title="Enter replacement text" type="text" placeholder="Replace"/> <button type="button" title="Replace current occurrence (Ctrl+Enter)" class="svelte-1x1x8q0">Replace</button> <button type="button" title="Replace all occurrences" class="svelte-1x1x8q0">All</button></div>`),U$=X(`<div class="jse-search-box svelte-1x1x8q0"><form class="jse-search-form svelte-1x1x8q0"><!> <div class="jse-search-contents svelte-1x1x8q0"><div class="jse-search-section svelte-1x1x8q0"><div class="jse-search-icon svelte-1x1x8q0"><!></div> <label class="jse-search-input-label svelte-1x1x8q0" about="jse-search input"><input class="jse-search-input svelte-1x1x8q0" title="Enter text to search" type="text" placeholder="Find"/></label> <div> </div> <button type="button" class="jse-search-next svelte-1x1x8q0" title="Go to next search result (Enter)"><!></button> <button type="button" class="jse-search-previous svelte-1x1x8q0" title="Go to previous search result (Shift+Enter)"><!></button> <button type="button" class="jse-search-clear svelte-1x1x8q0" title="Close search box (Esc)"><!></button></div> <!></div></form></div>`);function W$(e,t){vB(t,!1);var n=B(void 0,!0),r=B(void 0,!0),i=B(void 0,!0),a=$W(`jsoneditor:SearchBox`),o=$(t,`json`,9),s=$(t,`documentState`,9),c=$(t,`parser`,9),l=$(t,`showSearch`,9),u=$(t,`showReplace`,13),d=$(t,`readOnly`,9),f=$(t,`columns`,9),p=$(t,`onSearch`,9),m=$(t,`onFocus`,9),h=$(t,`onPatch`,9),g=$(t,`onClose`,9),_=B(``,!0),v=``,y=B(``,!0),b=B(!1,!0),x=B(void 0,!0),S=Cg(function(e){return A.apply(this,arguments)},300),C=Cg(function(e){return de.apply(this,arguments)},300);function w(){u(!u()&&!d())}function T(e){e.stopPropagation();var t=TK(e);t===`Enter`&&(e.preventDefault(),K(_)===v?oe():S.flush()),t===`Shift+Enter`&&(e.preventDefault(),k()),t===`Ctrl+Enter`&&(e.preventDefault(),u()?D():oe()),t===`Ctrl+H`&&(e.preventDefault(),w()),t===`Escape`&&(e.preventDefault(),j())}function E(e){TK(e)===`Enter`&&(e.preventDefault(),e.stopPropagation(),D())}function ee(){return te.apply(this,arguments)}function te(){return(te=pz(function*(){uV(),yield S.flush()})).apply(this,arguments)}function D(){return ne.apply(this,arguments)}function ne(){return(ne=pz(function*(){if(!d()){var e=K(x)?.activeItem;if(a(`handleReplace`,{replaceText:K(y),activeItem:e}),K(x)&&e&&o()!==void 0){V(x,R(R({},bY(K(x))),{},{activeIndex:K(r)}));var{operations:t,newSelection:n}=TY(o(),s(),K(y),e,c());h()(t,(e,t)=>({state:t,selection:n})),uV(),yield C.flush(),yield ce()}}})).apply(this,arguments)}function re(){return ie.apply(this,arguments)}function ie(){return(ie=pz(function*(){if(!d()){a(`handleReplaceAll`,{text:K(_),replaceText:K(y)});var{operations:e,newSelection:t}=function(e,t,n,r,i){for(var a=xY(n,e,{maxResults:1/0}),o=[],s=0;s<a.length;s++){var c=a[s-1],l=a[s];s!==0&&l.field===c.field&&Vg(l.path,c.path)?wg(o).items.push(l):o.push({path:l.path,field:l.field,items:[l]})}o.sort((e,t)=>e.field===t.field?t.path.length-e.path.length:e.field===ZG.key?1:-1);var u,d=[];return o.forEach(n=>{var{field:a,path:o,items:s}=n;if(a===ZG.key){var c=Ig(o),l=lc(e,c),f=wg(o),p=lY(c,Object.keys(l),f,wY(f,r,s));d=d.concat(p),u=MJ(e,p)}else{if(a!==ZG.value)throw Error(`Cannot replace: unknown type of search result field ${a}`);var m=lc(e,o);if(m===void 0)throw Error(`Cannot replace: path not found ${_c(o)}`);var h=typeof m==`string`?m:String(m),g=oJ(e,t,o),_=wY(h,r,s),v=[{op:`replace`,path:_c(o),value:g?_:_G(_,i)}];d=d.concat(v),u=MJ(e,v)}}),{operations:d,newSelection:u}}(o(),s(),K(_),K(y),c());h()(e,(e,n)=>({state:n,selection:t})),yield ce()}})).apply(this,arguments)}function ae(e){e.select()}function oe(){return O.apply(this,arguments)}function O(){return(O=pz(function*(){V(x,K(x)?bY(K(x)):void 0),yield ce()})).apply(this,arguments)}function k(){return se.apply(this,arguments)}function se(){return se=pz(function*(){V(x,K(x)?function(e){var t=e.activeIndex>0?e.activeIndex-1:e.items.length-1,n=e.items[t],r=e.items.map((e,n)=>R(R({},e),{},{active:n===t}));return R(R({},e),{},{items:r,activeItem:n,activeIndex:t})}(K(x)):void 0),yield ce()}),se.apply(this,arguments)}function ce(){return le.apply(this,arguments)}function le(){return(le=pz(function*(){a(`handleFocus`,K(x));var e=K(x)?.activeItem;e&&o()!==void 0&&(yield m()(e.path,e.resultIndex))})).apply(this,arguments)}function ue(){return ue=pz(function*(e){yield fe(e,K(_),o())}),ue.apply(this,arguments)}function A(){return A=pz(function*(e){yield fe(l(),e,o()),yield ce()}),A.apply(this,arguments)}function de(){return de=pz(function*(e){yield fe(l(),K(_),e)}),de.apply(this,arguments)}function fe(e,t,n){return pe.apply(this,arguments)}function pe(){return pe=pz(function*(e,t,n){return e?(a(`applySearch`,{showSearch:e,text:t}),t===``?(a(`clearing search result`),K(x)!==void 0&&V(x,void 0),Promise.resolve()):(v=t,V(b,!0),new Promise(e=>{setTimeout(()=>{V(x,function(e,t){var n=t!=null&&t.activeItem?EY(t.activeItem):void 0,r=e.findIndex(e=>Vg(n,EY(e))),i=r===-1?t?.activeIndex!==void 0&&t?.activeIndex<e.length?t?.activeIndex:e.length>0?0:-1:r,a=e.map((e,t)=>R(R({resultIndex:t},e),{},{active:t===i}));return{items:a,activeItem:a[i],activeIndex:i}}(xY(t,n,{maxResults:QK,columns:f()}),K(x))),V(b,!1),e()})}))):(K(x)&&V(x,void 0),Promise.resolve())}),pe.apply(this,arguments)}function j(){a(`handleClose`),S.cancel(),C.cancel(),fe(!1,K(_),o()),g()()}W(()=>K(x),()=>{var e;V(n,((e=K(x))==null||(e=e.items)==null?void 0:e.length)||0)}),W(()=>K(x),()=>{V(r,K(x)?.activeIndex||0)}),W(()=>(K(n),QK),()=>{V(i,K(n)>=QK?`999+`:String(K(n)))}),W(()=>(J(p()),K(x)),()=>{p()(K(x))}),W(()=>J(l()),()=>{(function(e){ue.apply(this,arguments)})(l())}),W(()=>K(_),()=>{S(K(_))}),W(()=>J(o()),()=>{C(o())}),DH(),GW(!0);var me=kU(),M=hH(me),he=e=>{var t=U$(),a=H(t),o=H(a),s=e=>{var t=V$(),n=H(t),r=GV(()=>u()?sv:z_);GK(n,{get data(){return K(r)}}),Y(`click`,t,w),Z(e,t)};Q(o,e=>{d()||e(s)});var c=H(U(o,2)),l=H(c),f=H(l),p=e=>{GK(e,{get data(){return V_},spin:!0})},m=e=>{GK(e,{get data(){return pv}})};Q(f,e=>{K(b)?e(p):e(m,-1)});var h=U(l,2),g=H(h);EH(()=>LW(g,()=>K(_),e=>V(_,e))),uW(g,e=>ae?.(e)),EH(()=>Y(`paste`,g,ee));var v,x=U(h,2),S=H(x),C=U(x,2);GK(H(C),{get data(){return mv}});var te=U(C,2);GK(H(te),{get data(){return q_}});var ne=U(te,2);GK(H(ne),{get data(){return yv}});var ie=U(c,2),O=e=>{var t=H$(),n=H(t),r=U(n,2),i=U(r,2);LW(n,()=>K(y),e=>V(y,e)),Y(`keydown`,n,E),Y(`click`,r,D),Y(`click`,i,re),Z(e,t)};Q(ie,e=>{u()&&!d()&&e(O)}),G(()=>{v=_W(x,1,`jse-search-count svelte-1x1x8q0`,null,v,{"jse-visible":K(_)!==``}),PU(S,`${K(r)!==-1&&K(r)<K(n)?`${K(r)+1}/`:``}${K(i)??``}`)}),Y(`click`,C,oe),Y(`click`,te,k),Y(`click`,ne,j),Y(`keydown`,a,T),Z(e,t)};Q(M,e=>{l()&&e(he)}),Z(e,me),yB()}var G$=Symbol(`path`);function K$(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1/0,r={};Array.isArray(e)&&function(e,t,n){if(e.length<t)e.forEach(n);else for(var r=t>1?(e.length-1)/(t-1):e.length,i=0;i<t;i++){var a=Math.floor(i*r);n(e[a],a,e)}}(e,n,e=>{sG(e)?q$(e,r,t):r[G$]=!0});var i=[];return G$ in r&&i.push([]),J$(r,[],i,t),i}function q$(e,t,n){for(var r in e){var i=e[r],a=t[r]||(t[r]={});sG(i)&&n?q$(i,a,n):a[G$]===void 0&&(a[G$]=!0)}}function J$(e,t,n,r){for(var i in e){var a=t.concat(i),o=e[i];o&&!0===o[G$]&&n.push(a),Ys(o)&&r&&J$(o,a,n,r)}}function Y$(e,t,n,r,i,a){for(var o=arguments.length>6&&arguments[6]!==void 0?arguments[6]:80,s=Js(n)?n.length:0,c=function(e,t){var n=Object.values(e);return Bg(n)?t:n.reduce((e,t)=>e+t)/n.length}(r,i),l=e-o,u=t+2*o,d=e=>r[e]||i,f=0,p=a;p<l&&f<s;)p+=d(f),f++;f>0&&(p-=d(--f));for(var m=f,h=0;h<u&&m<s;)h+=d(m),m++;for(var g=0,_=m;_<s;_++)g+=d(_);return{startIndex:f,endIndex:m,startHeight:p,endHeight:g,averageItemHeight:c,visibleHeight:h,visibleItems:Js(n)?n.slice(f,m):[]}}function X$(e,t,n,r){for(var{rowIndex:i}=Z$(e,t),a=0,o=0;o<i;o++)a+=n[o]||r;return a}function Z$(e,t){var[n,...r]=e,i=parseInt(n,10);return{rowIndex:isNaN(i)?-1:i,columnIndex:t.findIndex(e=>IJ(r,e))}}function Q$(e,t){var{rowIndex:n,columnIndex:r}=e;return[String(n),...t[r]]}function $$(e,t){var[n,r]=Xg(e,e=>aG(e.path[0]));return{root:r,rows:Ug(Fg(n,t1),e=>{var n={row:[],columns:{}};return e.forEach(e=>{var r=function(e,t){var n=Z$(e.path,t);return n.columnIndex===-1?-1:n.columnIndex}(e,t);r===-1?n.row.push(e):(n.columns[r]===void 0&&(n.columns[r]=[]),n.columns[r].push(e))}),n})}}function e1(e,t){if(t&&t.length!==0)return t.length===1?t[0]:{path:e,message:`Multiple validation issues: `+t.map(e=>GY(e.path)+` `+e.message).join(`, `),severity:XG.warning}}function t1(e){return parseInt(e.path[0],10)}function n1(e,t,n){return t.some(t=>function(e,t,n){if(!e)return!1;if(t.op===`replace`){var{rowIndex:r,columnIndex:i}=Z$(gc(t.path),n),a=n.findIndex(t=>Vg(t,e.path));if(r!==-1&&i!==-1&&i!==a)return!1}return!0}(e,t,n))?void 0:e}var r1=$W(`jsoneditor:actions`);function i1(e){return a1.apply(this,arguments)}function a1(){return a1=pz(function*(e){var{json:t,selection:n,indentation:r,readOnly:i,parser:a,onPatch:o}=e;if(!i&&t!==void 0&&n&&qJ(n)){var s=GJ(t,n,r,a);if(s!==void 0){r1(`cut`,{selection:n,clipboard:s,indentation:r}),yield N$(s);var{operations:c,newSelection:l}=gY(t,n);o(c,(e,t)=>({state:t,selection:l}))}}}),a1.apply(this,arguments)}function o1(e){return s1.apply(this,arguments)}function s1(){return s1=pz(function*(e){var{json:t,selection:n,indentation:r,parser:i}=e,a=GJ(t,n,r,i);a!==void 0&&(r1(`copy`,{clipboard:a,indentation:r}),yield N$(a))}),s1.apply(this,arguments)}function c1(e){var{clipboardText:t,json:n,selection:r,readOnly:i,parser:a,onPatch:o,onChangeText:s,onPasteMultilineText:c,openRepairModal:l}=e;if(!i)try{u(t)}catch{l(t,e=>{r1(`repaired pasted text: `,e),u(e)})}function u(e){if(n!==void 0){var i=r||BJ([]),l=fY(n,i,e,a),u=function(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:iq;if(e.length>r||!/\n/.test(e))return!1;var i=t.some(e=>e.op===`replace`&&Array.isArray(e.value)),a=t.filter(e=>e.op===`add`).length>1;if(!i&&!a)return!1;try{return kG(e,n.parse),!1}catch{return!0}}(t,l,a);r1(`paste`,{pastedText:e,operations:l,ensureSelection:i,pasteMultilineText:u}),o(l,(e,t)=>{var r=t;return l.filter(e=>(Xs(e)||Qs(e))&&cG(e.value)).forEach(t=>{var i=Ac(n,t.path);r=dJ(e,r,i)}),{state:r}}),u&&c(e)}else r1(`paste text`,{pastedText:e}),s(t,(e,t)=>{if(e)return{state:dJ(e,t,[])}})}}function l1(e){var{json:t,text:n,selection:r,keepSelection:i,readOnly:a,onChange:o,onPatch:s}=e;if(!a&&r){var c=t!==void 0&&(yJ(r)||bJ(r))?WJ(r.path,r.path):r;if(Bg(eY(r)))r1(`remove root`,{selection:r}),o&&o({text:``,json:void 0},t===void 0?{text:n||``,json:t}:{text:void 0,json:t},{contentErrors:void 0,patchResult:void 0});else if(t!==void 0){var{operations:l,newSelection:u}=gY(t,c);r1(`remove`,{operations:l,selection:r,newSelection:u}),s(l,(e,t)=>({state:t,selection:i?r:u}))}}}function u1(e){var{insertType:t,selectInside:n,initialValue:r,json:i,selection:a,readOnly:o,parser:s,onPatch:c,onReplaceJson:l}=e;if(!o){var u=function(e,t,n){if(n===`object`)return{};if(n===`array`)return[];if(n===`structure`&&e!==void 0){var r=lc(e,t?EJ(t):[]);if(Array.isArray(r)&&!Bg(r)){var i=jg(r);return cG(i)?uh(i,e=>Array.isArray(e)?[]:sG(e)?void 0:``):``}}return``}(i,a,t);if(i!==void 0){var d=s.stringify(u),f=fY(i,a,d,s);r1(`onInsert`,{insertType:t,operations:f,newValue:u,data:d});var p=wg(f.filter(e=>e.op===`add`||e.op===`replace`));c(f,(e,t,i)=>{if(p){var a=Ac(e,p.path);if(cG(u))return{state:Jq(e,t,a,hJ),selection:n?HJ(a):i};if(u===``){var o=Bg(a)?void 0:lc(e,Ig(a));return{state:Jq(e,t,a,gJ),selection:sG(o)?zJ(a,r):VJ(a,r)}}}}),r1(`after patch`)}else{r1(`onInsert`,{insertType:t,newValue:u});var m=[];l(u,(e,t)=>({state:dJ(e,t,m),selection:cG(u)?HJ(m):VJ(m)}))}}}function d1(e){return f1.apply(this,arguments)}function f1(){return f1=pz(function*(e){var{char:t,selectInside:n,json:r,selection:i,readOnly:a,parser:o,onPatch:s,onReplaceJson:c,onSelect:l}=e;a||(yJ(i)?l(R(R({},i),{},{edit:!0,initialValue:t})):t===`{`?u1({insertType:`object`,selectInside:n,initialValue:void 0,json:r,selection:i,readOnly:a,parser:o,onPatch:s,onReplaceJson:c}):t===`[`?u1({insertType:`array`,selectInside:n,initialValue:void 0,json:r,selection:i,readOnly:a,parser:o,onPatch:s,onReplaceJson:c}):bJ(i)&&r!==void 0?cG(lc(r,i.path))||l(R(R({},i),{},{edit:!0,initialValue:t})):(r1(`onInsertValueWithCharacter`,{char:t}),yield function(e){return p1.apply(this,arguments)}({char:t,json:r,selection:i,readOnly:a,parser:o,onPatch:s,onReplaceJson:c})))}),f1.apply(this,arguments)}function p1(){return p1=pz(function*(e){var{char:t,json:n,selection:r,readOnly:i,parser:a,onPatch:o,onReplaceJson:s}=e;i||u1({insertType:`value`,selectInside:!1,initialValue:t,json:n,selection:r,readOnly:i,parser:a,onPatch:o,onReplaceJson:s})}),p1.apply(this,arguments)}OK(`/* over all fonts, sizes, and colors */
|
|
2388
|
+
}`);var H$=X(`<button type="button" class="jse-replace-toggle svelte-1x1x8q0" title="Toggle visibility of replace options (Ctrl+H)"><!></button>`),U$=X(`<div class="jse-replace-section svelte-1x1x8q0"><input class="jse-replace-input svelte-1x1x8q0" title="Enter replacement text" type="text" placeholder="Replace"/> <button type="button" title="Replace current occurrence (Ctrl+Enter)" class="svelte-1x1x8q0">Replace</button> <button type="button" title="Replace all occurrences" class="svelte-1x1x8q0">All</button></div>`),W$=X(`<div class="jse-search-box svelte-1x1x8q0"><form class="jse-search-form svelte-1x1x8q0"><!> <div class="jse-search-contents svelte-1x1x8q0"><div class="jse-search-section svelte-1x1x8q0"><div class="jse-search-icon svelte-1x1x8q0"><!></div> <label class="jse-search-input-label svelte-1x1x8q0" about="jse-search input"><input class="jse-search-input svelte-1x1x8q0" title="Enter text to search" type="text" placeholder="Find"/></label> <div> </div> <button type="button" class="jse-search-next svelte-1x1x8q0" title="Go to next search result (Enter)"><!></button> <button type="button" class="jse-search-previous svelte-1x1x8q0" title="Go to previous search result (Shift+Enter)"><!></button> <button type="button" class="jse-search-clear svelte-1x1x8q0" title="Close search box (Esc)"><!></button></div> <!></div></form></div>`);function G$(e,t){vB(t,!1);var n=B(void 0,!0),r=B(void 0,!0),i=B(void 0,!0),a=$W(`jsoneditor:SearchBox`),o=$(t,`json`,9),s=$(t,`documentState`,9),c=$(t,`parser`,9),l=$(t,`showSearch`,9),u=$(t,`showReplace`,13),d=$(t,`readOnly`,9),f=$(t,`columns`,9),p=$(t,`onSearch`,9),m=$(t,`onFocus`,9),h=$(t,`onPatch`,9),g=$(t,`onClose`,9),_=B(``,!0),v=``,y=B(``,!0),b=B(!1,!0),x=B(void 0,!0),S=Og(function(e){return A.apply(this,arguments)},300),C=Og(function(e){return de.apply(this,arguments)},300);function w(){u(!u()&&!d())}function T(e){e.stopPropagation();var t=TK(e);t===`Enter`&&(e.preventDefault(),K(_)===v?oe():S.flush()),t===`Shift+Enter`&&(e.preventDefault(),k()),t===`Ctrl+Enter`&&(e.preventDefault(),u()?D():oe()),t===`Ctrl+H`&&(e.preventDefault(),w()),t===`Escape`&&(e.preventDefault(),j())}function E(e){TK(e)===`Enter`&&(e.preventDefault(),e.stopPropagation(),D())}function ee(){return te.apply(this,arguments)}function te(){return(te=pz(function*(){uV(),yield S.flush()})).apply(this,arguments)}function D(){return ne.apply(this,arguments)}function ne(){return(ne=pz(function*(){if(!d()){var e=K(x)?.activeItem;if(a(`handleReplace`,{replaceText:K(y),activeItem:e}),K(x)&&e&&o()!==void 0){V(x,R(R({},bY(K(x))),{},{activeIndex:K(r)}));var{operations:t,newSelection:n}=TY(o(),s(),K(y),e,c());h()(t,(e,t)=>({state:t,selection:n})),uV(),yield C.flush(),yield ce()}}})).apply(this,arguments)}function re(){return ie.apply(this,arguments)}function ie(){return(ie=pz(function*(){if(!d()){a(`handleReplaceAll`,{text:K(_),replaceText:K(y)});var{operations:e,newSelection:t}=function(e,t,n,r,i){for(var a=xY(n,e,{maxResults:1/0}),o=[],s=0;s<a.length;s++){var c=a[s-1],l=a[s];s!==0&&l.field===c.field&&Hg(l.path,c.path)?kg(o).items.push(l):o.push({path:l.path,field:l.field,items:[l]})}o.sort((e,t)=>e.field===t.field?t.path.length-e.path.length:e.field===ZG.key?1:-1);var u,d=[];return o.forEach(n=>{var{field:a,path:o,items:s}=n;if(a===ZG.key){var c=Lg(o),l=lc(e,c),f=kg(o),p=lY(c,Object.keys(l),f,wY(f,r,s));d=d.concat(p),u=MJ(e,p)}else{if(a!==ZG.value)throw Error(`Cannot replace: unknown type of search result field ${a}`);var m=lc(e,o);if(m===void 0)throw Error(`Cannot replace: path not found ${_c(o)}`);var h=typeof m==`string`?m:String(m),g=oJ(e,t,o),_=wY(h,r,s),v=[{op:`replace`,path:_c(o),value:g?_:_G(_,i)}];d=d.concat(v),u=MJ(e,v)}}),{operations:d,newSelection:u}}(o(),s(),K(_),K(y),c());h()(e,(e,n)=>({state:n,selection:t})),yield ce()}})).apply(this,arguments)}function ae(e){e.select()}function oe(){return O.apply(this,arguments)}function O(){return(O=pz(function*(){V(x,K(x)?bY(K(x)):void 0),yield ce()})).apply(this,arguments)}function k(){return se.apply(this,arguments)}function se(){return se=pz(function*(){V(x,K(x)?function(e){var t=e.activeIndex>0?e.activeIndex-1:e.items.length-1,n=e.items[t],r=e.items.map((e,n)=>R(R({},e),{},{active:n===t}));return R(R({},e),{},{items:r,activeItem:n,activeIndex:t})}(K(x)):void 0),yield ce()}),se.apply(this,arguments)}function ce(){return le.apply(this,arguments)}function le(){return(le=pz(function*(){a(`handleFocus`,K(x));var e=K(x)?.activeItem;e&&o()!==void 0&&(yield m()(e.path,e.resultIndex))})).apply(this,arguments)}function ue(){return ue=pz(function*(e){yield fe(e,K(_),o())}),ue.apply(this,arguments)}function A(){return A=pz(function*(e){yield fe(l(),e,o()),yield ce()}),A.apply(this,arguments)}function de(){return de=pz(function*(e){yield fe(l(),K(_),e)}),de.apply(this,arguments)}function fe(e,t,n){return pe.apply(this,arguments)}function pe(){return pe=pz(function*(e,t,n){return e?(a(`applySearch`,{showSearch:e,text:t}),t===``?(a(`clearing search result`),K(x)!==void 0&&V(x,void 0),Promise.resolve()):(v=t,V(b,!0),new Promise(e=>{setTimeout(()=>{V(x,function(e,t){var n=t!=null&&t.activeItem?EY(t.activeItem):void 0,r=e.findIndex(e=>Hg(n,EY(e))),i=r===-1?t?.activeIndex!==void 0&&t?.activeIndex<e.length?t?.activeIndex:e.length>0?0:-1:r,a=e.map((e,t)=>R(R({resultIndex:t},e),{},{active:t===i}));return{items:a,activeItem:a[i],activeIndex:i}}(xY(t,n,{maxResults:QK,columns:f()}),K(x))),V(b,!1),e()})}))):(K(x)&&V(x,void 0),Promise.resolve())}),pe.apply(this,arguments)}function j(){a(`handleClose`),S.cancel(),C.cancel(),fe(!1,K(_),o()),g()()}W(()=>K(x),()=>{var e;V(n,((e=K(x))==null||(e=e.items)==null?void 0:e.length)||0)}),W(()=>K(x),()=>{V(r,K(x)?.activeIndex||0)}),W(()=>(K(n),QK),()=>{V(i,K(n)>=QK?`999+`:String(K(n)))}),W(()=>(J(p()),K(x)),()=>{p()(K(x))}),W(()=>J(l()),()=>{(function(e){ue.apply(this,arguments)})(l())}),W(()=>K(_),()=>{S(K(_))}),W(()=>J(o()),()=>{C(o())}),DH(),GW(!0);var me=kU(),M=hH(me),he=e=>{var t=W$(),a=H(t),o=H(a),s=e=>{var t=H$(),n=H(t),r=GV(()=>u()?sv:z_);GK(n,{get data(){return K(r)}}),Y(`click`,t,w),Z(e,t)};Q(o,e=>{d()||e(s)});var c=H(U(o,2)),l=H(c),f=H(l),p=e=>{GK(e,{get data(){return V_},spin:!0})},m=e=>{GK(e,{get data(){return pv}})};Q(f,e=>{K(b)?e(p):e(m,-1)});var h=U(l,2),g=H(h);EH(()=>LW(g,()=>K(_),e=>V(_,e))),uW(g,e=>ae?.(e)),EH(()=>Y(`paste`,g,ee));var v,x=U(h,2),S=H(x),C=U(x,2);GK(H(C),{get data(){return mv}});var te=U(C,2);GK(H(te),{get data(){return q_}});var ne=U(te,2);GK(H(ne),{get data(){return yv}});var ie=U(c,2),O=e=>{var t=U$(),n=H(t),r=U(n,2),i=U(r,2);LW(n,()=>K(y),e=>V(y,e)),Y(`keydown`,n,E),Y(`click`,r,D),Y(`click`,i,re),Z(e,t)};Q(ie,e=>{u()&&!d()&&e(O)}),G(()=>{v=_W(x,1,`jse-search-count svelte-1x1x8q0`,null,v,{"jse-visible":K(_)!==``}),PU(S,`${K(r)!==-1&&K(r)<K(n)?`${K(r)+1}/`:``}${K(i)??``}`)}),Y(`click`,C,oe),Y(`click`,te,k),Y(`click`,ne,j),Y(`keydown`,a,T),Z(e,t)};Q(M,e=>{l()&&e(he)}),Z(e,me),yB()}var K$=Symbol(`path`);function q$(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1/0,r={};Array.isArray(e)&&function(e,t,n){if(e.length<t)e.forEach(n);else for(var r=t>1?(e.length-1)/(t-1):e.length,i=0;i<t;i++){var a=Math.floor(i*r);n(e[a],a,e)}}(e,n,e=>{sG(e)?J$(e,r,t):r[K$]=!0});var i=[];return K$ in r&&i.push([]),Y$(r,[],i,t),i}function J$(e,t,n){for(var r in e){var i=e[r],a=t[r]||(t[r]={});sG(i)&&n?J$(i,a,n):a[K$]===void 0&&(a[K$]=!0)}}function Y$(e,t,n,r){for(var i in e){var a=t.concat(i),o=e[i];o&&!0===o[K$]&&n.push(a),Ys(o)&&r&&Y$(o,a,n,r)}}function X$(e,t,n,r,i,a){for(var o=arguments.length>6&&arguments[6]!==void 0?arguments[6]:80,s=Js(n)?n.length:0,c=function(e,t){var n=Object.values(e);return Vg(n)?t:n.reduce((e,t)=>e+t)/n.length}(r,i),l=e-o,u=t+2*o,d=e=>r[e]||i,f=0,p=a;p<l&&f<s;)p+=d(f),f++;f>0&&(p-=d(--f));for(var m=f,h=0;h<u&&m<s;)h+=d(m),m++;for(var g=0,_=m;_<s;_++)g+=d(_);return{startIndex:f,endIndex:m,startHeight:p,endHeight:g,averageItemHeight:c,visibleHeight:h,visibleItems:Js(n)?n.slice(f,m):[]}}function Z$(e,t,n,r){for(var{rowIndex:i}=Q$(e,t),a=0,o=0;o<i;o++)a+=n[o]||r;return a}function Q$(e,t){var[n,...r]=e,i=parseInt(n,10);return{rowIndex:isNaN(i)?-1:i,columnIndex:t.findIndex(e=>IJ(r,e))}}function $$(e,t){var{rowIndex:n,columnIndex:r}=e;return[String(n),...t[r]]}function e1(e,t){var[n,r]=Xg(e,e=>aG(e.path[0]));return{root:r,rows:cee(Ig(n,n1),e=>{var n={row:[],columns:{}};return e.forEach(e=>{var r=function(e,t){var n=Q$(e.path,t);return n.columnIndex===-1?-1:n.columnIndex}(e,t);r===-1?n.row.push(e):(n.columns[r]===void 0&&(n.columns[r]=[]),n.columns[r].push(e))}),n})}}function t1(e,t){if(t&&t.length!==0)return t.length===1?t[0]:{path:e,message:`Multiple validation issues: `+t.map(e=>GY(e.path)+` `+e.message).join(`, `),severity:XG.warning}}function n1(e){return parseInt(e.path[0],10)}function r1(e,t,n){return t.some(t=>function(e,t,n){if(!e)return!1;if(t.op===`replace`){var{rowIndex:r,columnIndex:i}=Q$(gc(t.path),n),a=n.findIndex(t=>Hg(t,e.path));if(r!==-1&&i!==-1&&i!==a)return!1}return!0}(e,t,n))?void 0:e}var i1=$W(`jsoneditor:actions`);function a1(e){return o1.apply(this,arguments)}function o1(){return o1=pz(function*(e){var{json:t,selection:n,indentation:r,readOnly:i,parser:a,onPatch:o}=e;if(!i&&t!==void 0&&n&&qJ(n)){var s=GJ(t,n,r,a);if(s!==void 0){i1(`cut`,{selection:n,clipboard:s,indentation:r}),yield P$(s);var{operations:c,newSelection:l}=gY(t,n);o(c,(e,t)=>({state:t,selection:l}))}}}),o1.apply(this,arguments)}function s1(e){return c1.apply(this,arguments)}function c1(){return c1=pz(function*(e){var{json:t,selection:n,indentation:r,parser:i}=e,a=GJ(t,n,r,i);a!==void 0&&(i1(`copy`,{clipboard:a,indentation:r}),yield P$(a))}),c1.apply(this,arguments)}function l1(e){var{clipboardText:t,json:n,selection:r,readOnly:i,parser:a,onPatch:o,onChangeText:s,onPasteMultilineText:c,openRepairModal:l}=e;if(!i)try{u(t)}catch{l(t,e=>{i1(`repaired pasted text: `,e),u(e)})}function u(e){if(n!==void 0){var i=r||BJ([]),l=fY(n,i,e,a),u=function(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:iq;if(e.length>r||!/\n/.test(e))return!1;var i=t.some(e=>e.op===`replace`&&Array.isArray(e.value)),a=t.filter(e=>e.op===`add`).length>1;if(!i&&!a)return!1;try{return kG(e,n.parse),!1}catch{return!0}}(t,l,a);i1(`paste`,{pastedText:e,operations:l,ensureSelection:i,pasteMultilineText:u}),o(l,(e,t)=>{var r=t;return l.filter(e=>(Xs(e)||Qs(e))&&cG(e.value)).forEach(t=>{var i=Ac(n,t.path);r=dJ(e,r,i)}),{state:r}}),u&&c(e)}else i1(`paste text`,{pastedText:e}),s(t,(e,t)=>{if(e)return{state:dJ(e,t,[])}})}}function u1(e){var{json:t,text:n,selection:r,keepSelection:i,readOnly:a,onChange:o,onPatch:s}=e;if(!a&&r){var c=t!==void 0&&(yJ(r)||bJ(r))?WJ(r.path,r.path):r;if(Vg(eY(r)))i1(`remove root`,{selection:r}),o&&o({text:``,json:void 0},t===void 0?{text:n||``,json:t}:{text:void 0,json:t},{contentErrors:void 0,patchResult:void 0});else if(t!==void 0){var{operations:l,newSelection:u}=gY(t,c);i1(`remove`,{operations:l,selection:r,newSelection:u}),s(l,(e,t)=>({state:t,selection:i?r:u}))}}}function d1(e){var{insertType:t,selectInside:n,initialValue:r,json:i,selection:a,readOnly:o,parser:s,onPatch:c,onReplaceJson:l}=e;if(!o){var u=function(e,t,n){if(n===`object`)return{};if(n===`array`)return[];if(n===`structure`&&e!==void 0){var r=lc(e,t?EJ(t):[]);if(Array.isArray(r)&&!Vg(r)){var i=Mg(r);return cG(i)?hh(i,e=>Array.isArray(e)?[]:sG(e)?void 0:``):``}}return``}(i,a,t);if(i!==void 0){var d=s.stringify(u),f=fY(i,a,d,s);i1(`onInsert`,{insertType:t,operations:f,newValue:u,data:d});var p=kg(f.filter(e=>e.op===`add`||e.op===`replace`));c(f,(e,t,i)=>{if(p){var a=Ac(e,p.path);if(cG(u))return{state:Jq(e,t,a,hJ),selection:n?HJ(a):i};if(u===``){var o=Vg(a)?void 0:lc(e,Lg(a));return{state:Jq(e,t,a,gJ),selection:sG(o)?zJ(a,r):VJ(a,r)}}}}),i1(`after patch`)}else{i1(`onInsert`,{insertType:t,newValue:u});var m=[];l(u,(e,t)=>({state:dJ(e,t,m),selection:cG(u)?HJ(m):VJ(m)}))}}}function f1(e){return p1.apply(this,arguments)}function p1(){return p1=pz(function*(e){var{char:t,selectInside:n,json:r,selection:i,readOnly:a,parser:o,onPatch:s,onReplaceJson:c,onSelect:l}=e;a||(yJ(i)?l(R(R({},i),{},{edit:!0,initialValue:t})):t===`{`?d1({insertType:`object`,selectInside:n,initialValue:void 0,json:r,selection:i,readOnly:a,parser:o,onPatch:s,onReplaceJson:c}):t===`[`?d1({insertType:`array`,selectInside:n,initialValue:void 0,json:r,selection:i,readOnly:a,parser:o,onPatch:s,onReplaceJson:c}):bJ(i)&&r!==void 0?cG(lc(r,i.path))||l(R(R({},i),{},{edit:!0,initialValue:t})):(i1(`onInsertValueWithCharacter`,{char:t}),yield function(e){return m1.apply(this,arguments)}({char:t,json:r,selection:i,readOnly:a,parser:o,onPatch:s,onReplaceJson:c})))}),p1.apply(this,arguments)}function m1(){return m1=pz(function*(e){var{char:t,json:n,selection:r,readOnly:i,parser:a,onPatch:o,onReplaceJson:s}=e;i||d1({insertType:`value`,selectInside:!1,initialValue:t,json:n,selection:r,readOnly:i,parser:a,onPatch:o,onReplaceJson:s})}),m1.apply(this,arguments)}OK(`/* over all fonts, sizes, and colors */
|
|
2389
2389
|
/* "consolas" for Windows, "menlo" for Mac with fallback to "monaco", 'Ubuntu Mono' for Ubuntu */
|
|
2390
2390
|
/* (at Mac this font looks too large at 14px, but 13px is too small for the font on Windows) */
|
|
2391
2391
|
/* main, menu, modal */
|
|
@@ -2415,7 +2415,7 @@ button.jse-validation-warning.svelte-q6a061 {
|
|
|
2415
2415
|
border-left: var(--jse-main-border, 1px solid #d7d7d7);
|
|
2416
2416
|
border-right: var(--jse-main-border, 1px solid #d7d7d7);
|
|
2417
2417
|
border-bottom: var(--jse-main-border, 1px solid #d7d7d7);
|
|
2418
|
-
}`);var
|
|
2418
|
+
}`);var h1=X(`<div class="jse-json-preview svelte-25xmyd"> </div>`);function g1(e,t){vB(t,!1);var n=B(),r=B(),i=$(t,`text`,8),a=$(t,`json`,8),o=$(t,`indentation`,8),s=$(t,`parser`,8);W(()=>(J(a()),J(i())),()=>{V(n,a()===void 0?{text:i()||``}:{json:a()})}),W(()=>(K(n),J(o()),J(s()),tq),()=>{V(r,FK(zG(K(n),o(),s()),tq))}),DH(),GW();var c=h1(),l=H(c);G(()=>PU(l,K(r))),Z(e,c),yB()}OK(`/* over all fonts, sizes, and colors */
|
|
2419
2419
|
/* "consolas" for Windows, "menlo" for Mac with fallback to "monaco", 'Ubuntu Mono' for Ubuntu */
|
|
2420
2420
|
/* (at Mac this font looks too large at 14px, but 13px is too small for the font on Windows) */
|
|
2421
2421
|
/* main, menu, modal */
|
|
@@ -2464,7 +2464,7 @@ button.jse-context-menu-button.left.svelte-16jz6ui {
|
|
|
2464
2464
|
}
|
|
2465
2465
|
button.jse-context-menu-button.svelte-16jz6ui svg {
|
|
2466
2466
|
width: 16px;
|
|
2467
|
-
}`);var
|
|
2467
|
+
}`);var _1=X(`<button type="button"><!> <!></button>`);function v1(e,t){vB(t,!1);var n=$(t,`item`,8),r=$(t,`className`,8,void 0),i=$(t,`onRequestClose`,8);GW();var a=_1(),o=H(a),s=e=>{GK(e,{get data(){return J(n()),q(()=>n().icon)}})};Q(o,e=>{J(n()),q(()=>n().icon)&&e(s)});var c=U(o,2),l=e=>{var t=OU();G(()=>PU(t,(J(n()),q(()=>n().text)))),Z(e,t)};Q(c,e=>{J(n()),q(()=>n().text)&&e(l)}),G(e=>{_W(a,1,e,`svelte-16jz6ui`),jW(a,`title`,(J(n()),q(()=>n().title))),a.disabled=(J(n()),q(()=>n().disabled||!1))},[()=>pW((J(nY),J(r()),J(n()),q(()=>nY(`jse-context-menu-button`,r(),n().className))))]),Y(`click`,a,e=>{i()(),n().onClick(e)}),Z(e,a),yB()}OK(`/* over all fonts, sizes, and colors */
|
|
2468
2468
|
/* "consolas" for Windows, "menlo" for Mac with fallback to "monaco", 'Ubuntu Mono' for Ubuntu */
|
|
2469
2469
|
/* (at Mac this font looks too large at 14px, but 13px is too small for the font on Windows) */
|
|
2470
2470
|
/* main, menu, modal */
|
|
@@ -2567,7 +2567,7 @@ button.jse-context-menu-button.svelte-16jz6ui svg {
|
|
|
2567
2567
|
.jse-dropdown-button.svelte-bov1j6 .jse-dropdown-items:where(.svelte-bov1j6) button:where(.svelte-bov1j6):disabled {
|
|
2568
2568
|
color: var(--jse-context-menu-color-disabled, #9d9d9d);
|
|
2569
2569
|
background: unset;
|
|
2570
|
-
}`);var
|
|
2570
|
+
}`);var y1=X(`<li class="svelte-bov1j6"><button type="button"><!> </button></li>`),b1=X(`<div role="button" tabindex="0" class="jse-dropdown-button svelte-bov1j6"><!> <button type="button" data-type="jse-open-dropdown"><!></button> <div><ul class="svelte-bov1j6"></ul></div></div>`);OK(`/* over all fonts, sizes, and colors */
|
|
2571
2571
|
/* "consolas" for Windows, "menlo" for Mac with fallback to "monaco", 'Ubuntu Mono' for Ubuntu */
|
|
2572
2572
|
/* (at Mac this font looks too large at 14px, but 13px is too small for the font on Windows) */
|
|
2573
2573
|
/* main, menu, modal */
|
|
@@ -2616,7 +2616,7 @@ button.jse-context-menu-button.left.svelte-1y5l9l1 {
|
|
|
2616
2616
|
}
|
|
2617
2617
|
button.jse-context-menu-button.svelte-1y5l9l1 svg {
|
|
2618
2618
|
width: 16px;
|
|
2619
|
-
}`);var
|
|
2619
|
+
}`);var x1=X(`<button type="button" slot="defaultItem"><!> </button>`);function S1(e,t){vB(t,!1);var n=B(),r=$(t,`item`,8),i=$(t,`className`,8,void 0),a=$(t,`onRequestClose`,8);W(()=>(J(r()),J(a())),()=>{V(n,r().items.map(e=>R(R({},e),{},{onClick:t=>{a()(),e.onClick(t)}})))}),DH(),GW(),function(e,t){vB(t,!1);var n=B(void 0,!0),r=$(t,`items`,25,()=>[]),i=$(t,`title`,9,void 0),a=$(t,`width`,9,`120px`),o=B(!1,!0);function s(){V(o,!1)}function c(e){TK(e)===`Escape`&&(e.preventDefault(),V(o,!1))}KU(()=>{document.addEventListener(`click`,s),document.addEventListener(`keydown`,c)}),qU(()=>{document.removeEventListener(`click`,s),document.removeEventListener(`keydown`,c)}),W(()=>J(r()),()=>{V(n,r().every(e=>!0===e.disabled))}),DH(),GW(!0);var l=b1(),u=H(l);cW(u,t,`defaultItem`,{},null);var d,f=U(u,2);GK(H(f),{get data(){return sv}});var p,m=U(f,2);nW(H(m),5,r,eW,(e,t)=>{var n=y1(),r=H(n),i=H(r),a=e=>{GK(e,{get data(){return K(t),q(()=>K(t).icon)}})};Q(i,e=>{K(t),q(()=>K(t).icon)&&e(a)});var o=U(i);G(()=>{var e;jW(r,`title`,(K(t),q(()=>K(t).title))),r.disabled=(K(t),q(()=>K(t).disabled)),_W(r,1,pW((K(t),q(()=>K(t).className))),`svelte-bov1j6`),PU(o,` ${(K(t),e=q(()=>K(t).text))!==null&&e!==void 0?e:``}`)}),Y(`click`,r,e=>K(t).onClick(e)),Z(e,n)}),G(()=>{jW(l,`title`,i()),d=_W(f,1,`jse-open-dropdown svelte-bov1j6`,null,d,{"jse-visible":K(o)}),f.disabled=K(n),p=_W(m,1,`jse-dropdown-items svelte-bov1j6`,null,p,{"jse-visible":K(o)}),yW(m,`width: ${a()??``};`)}),Y(`click`,f,function(){var e=K(o);setTimeout(()=>V(o,!e))}),Y(`click`,l,s),Z(e,l),yB()}(e,{get width(){return J(r()),q(()=>r().width)},get items(){return K(n)},$$slots:{defaultItem:(e,t)=>{var n=x1(),o=H(n),s=e=>{GK(e,{get data(){return J(r()),q(()=>r().main.icon)}})};Q(o,e=>{J(r()),q(()=>r().main.icon)&&e(s)});var c=U(o);G(e=>{var t;_W(n,1,e,`svelte-1y5l9l1`),jW(n,`title`,(J(r()),q(()=>r().main.title))),n.disabled=(J(r()),q(()=>r().main.disabled||!1)),PU(c,` ${(J(r()),t=q(()=>r().main.text))!==null&&t!==void 0?t:``}`)},[()=>pW((J(nY),J(i()),J(r()),q(()=>nY(`jse-context-menu-button`,i(),r().main.className))))]),Y(`click`,n,e=>{a()(),r().main.onClick(e)}),Z(e,n)}}}),yB()}OK(`/* over all fonts, sizes, and colors */
|
|
2620
2620
|
/* "consolas" for Windows, "menlo" for Mac with fallback to "monaco", 'Ubuntu Mono' for Ubuntu */
|
|
2621
2621
|
/* (at Mac this font looks too large at 14px, but 13px is too small for the font on Windows) */
|
|
2622
2622
|
/* main, menu, modal */
|
|
@@ -2685,7 +2685,7 @@ button.jse-context-menu-button.svelte-1y5l9l1 svg {
|
|
|
2685
2685
|
width: 100%;
|
|
2686
2686
|
height: 1px;
|
|
2687
2687
|
background: var(--jse-context-menu-separator-color, #7a7a7a);
|
|
2688
|
-
}`);var
|
|
2688
|
+
}`);var C1=X(`<div class="jse-separator svelte-1shjn02"></div>`),w1=X(`<div class="jse-label svelte-1shjn02"> </div>`),T1=X(`<div class="jse-column svelte-1shjn02"></div>`),E1=X(`<div class="jse-separator svelte-1shjn02"></div>`),D1=X(`<div class="jse-row svelte-1shjn02"></div>`),O1=X(`<div class="jse-separator svelte-1shjn02"></div>`),k1=X(`<div class="jse-row svelte-1shjn02"><div class="jse-tip svelte-1shjn02"><div class="jse-tip-icon svelte-1shjn02"><!></div> <div class="jse-tip-text"> </div></div></div>`),A1=X(`<div role="menu" tabindex="-1" class="jse-contextmenu svelte-1shjn02"><!> <!></div>`);function j1(e,t){vB(t,!1);var n=$(t,`items`,9),r=$(t,`onRequestClose`,9),i=$(t,`tip`,9),a=B(void 0,!0);KU(()=>{var e=Array.from(K(a).querySelectorAll(`button`)).find(e=>!e.disabled);e&&e.focus()});var o={ArrowUp:`Up`,ArrowDown:`Down`,ArrowLeft:`Left`,ArrowRight:`Right`};function s(e){return console.error(`Unknown type of context menu item`,e),`???`}GW(!0);var c=A1(),l=H(c);nW(l,1,n,eW,(e,t)=>{var n=kU(),i=hH(n),a=e=>{v1(e,{get item(){return K(t)},get onRequestClose(){return r()}})},o=WV(()=>(J(Sq),K(t),q(()=>Sq(K(t))))),c=e=>{S1(e,{get item(){return K(t)},get onRequestClose(){return r()}})},l=WV(()=>(J(Cq),K(t),q(()=>Cq(K(t))))),u=e=>{var n=D1();nW(n,5,()=>(K(t),q(()=>K(t).items)),eW,(e,t)=>{var n=kU(),i=hH(n),a=e=>{v1(e,{get item(){return K(t)},get onRequestClose(){return r()}})},o=WV(()=>(J(Sq),K(t),q(()=>Sq(K(t))))),c=e=>{S1(e,{get item(){return K(t)},get onRequestClose(){return r()}})},l=WV(()=>(J(Cq),K(t),q(()=>Cq(K(t))))),u=e=>{var n=T1();nW(n,5,()=>(K(t),q(()=>K(t).items)),eW,(e,t)=>{var n=kU(),i=hH(n),a=e=>{v1(e,{className:`left`,get item(){return K(t)},get onRequestClose(){return r()}})},o=WV(()=>(J(Sq),K(t),q(()=>Sq(K(t))))),c=e=>{S1(e,{className:`left`,get item(){return K(t)},get onRequestClose(){return r()}})},l=WV(()=>(J(Cq),K(t),q(()=>Cq(K(t))))),u=e=>{Z(e,C1())},d=WV(()=>(J(bq),K(t),q(()=>bq(K(t))))),f=e=>{var n=w1(),r=H(n);G(()=>PU(r,(K(t),q(()=>K(t).text)))),Z(e,n)},p=WV(()=>(J(xq),K(t),q(()=>xq(K(t))))),m=e=>{var n=OU();G(e=>PU(n,e),[()=>(K(t),q(()=>s(K(t))))]),Z(e,n)};Q(i,e=>{K(o)?e(a):K(l)?e(c,1):K(d)?e(u,2):K(p)?e(f,3):e(m,-1)}),Z(e,n)}),Z(e,n)},d=WV(()=>(J(Tq),K(t),q(()=>Tq(K(t))))),f=e=>{Z(e,E1())},p=WV(()=>(J(bq),K(t),q(()=>bq(K(t))))),m=e=>{var n=OU();G(e=>PU(n,e),[()=>(K(t),q(()=>s(K(t))))]),Z(e,n)};Q(i,e=>{K(o)?e(a):K(l)?e(c,1):K(d)?e(u,2):K(p)?e(f,3):e(m,-1)}),Z(e,n)}),Z(e,n)},d=WV(()=>(J(wq),K(t),q(()=>wq(K(t))))),f=e=>{Z(e,O1())},p=WV(()=>(J(bq),K(t),q(()=>bq(K(t))))),m=e=>{var n=OU();G(e=>PU(n,e),[()=>(K(t),q(()=>s(K(t))))]),Z(e,n)};Q(i,e=>{K(o)?e(a):K(l)?e(c,1):K(d)?e(u,2):K(p)?e(f,3):e(m,-1)}),Z(e,n)});var u=U(l,2),d=e=>{var t=k1(),n=H(H(t));GK(H(n),{get data(){return N_}});var r=H(U(n,2));G(()=>PU(r,i())),Z(e,t)};Q(u,e=>{i()&&e(d)}),HW(c,e=>V(a,e),()=>K(a)),Y(`keydown`,c,function(e){var t=o[TK(e)];if(t&&e.target){e.preventDefault();var n=CK({allElements:Array.from(K(a).querySelectorAll(`button:not([disabled])`)),currentElement:e.target,direction:t,hasPrio:e=>e.getAttribute(`data-type`)!==`jse-open-dropdown`});n&&n.focus()}}),Z(e,c),yB()}OK(`/* over all fonts, sizes, and colors */
|
|
2689
2689
|
/* "consolas" for Windows, "menlo" for Mac with fallback to "monaco", 'Ubuntu Mono' for Ubuntu */
|
|
2690
2690
|
/* (at Mac this font looks too large at 14px, but 13px is too small for the font on Windows) */
|
|
2691
2691
|
/* main, menu, modal */
|
|
@@ -2743,7 +2743,7 @@ button.jse-context-menu-button.svelte-1y5l9l1 svg {
|
|
|
2743
2743
|
}
|
|
2744
2744
|
.jse-enum-value.jse-value.svelte-1htmvf1:focus {
|
|
2745
2745
|
color: var(--jse-text-color, #4d4d4d);
|
|
2746
|
-
}`),X(`<option> </option>`),X(`<select></select>`);var
|
|
2746
|
+
}`),X(`<option> </option>`),X(`<select></select>`);var M1,N1;function P1(e,t){return M1||=(N1=new WeakMap,new ResizeObserver(e=>{for(var t of e){var n=N1.get(t.target);n&&n(t.target)}})),N1.set(e,t),M1.observe(e),{destroy:()=>{N1.delete(e),M1.unobserve(e)}}}OK(`/* over all fonts, sizes, and colors */
|
|
2747
2747
|
/* "consolas" for Windows, "menlo" for Mac with fallback to "monaco", 'Ubuntu Mono' for Ubuntu */
|
|
2748
2748
|
/* (at Mac this font looks too large at 14px, but 13px is too small for the font on Windows) */
|
|
2749
2749
|
/* main, menu, modal */
|
|
@@ -2826,7 +2826,7 @@ button.jse-context-menu-button.svelte-1y5l9l1 svg {
|
|
|
2826
2826
|
margin: -2px;
|
|
2827
2827
|
margin-bottom: 2px;
|
|
2828
2828
|
display: inline-block;
|
|
2829
|
-
}`);var P1=X(`<!> <!>`,1),F1=X(`<div class="jse-search-box-background svelte-10mlrw4"></div>`),I1=X(`<div class="jse-search-box-container svelte-10mlrw4"><!></div> <div class="jse-contents svelte-10mlrw4"><!> <!></div> <!> <!> <!> <!>`,1),L1=X(`<label class="jse-hidden-input-label svelte-10mlrw4"><input type="text" tabindex="-1" class="jse-hidden-input svelte-10mlrw4"/></label> <!>`,1),R1=X(`<div class="jse-contents svelte-10mlrw4"><div class="jse-loading-space svelte-10mlrw4"></div> <div class="jse-loading svelte-10mlrw4">loading...</div></div>`),z1=X(`<div role="tree" tabindex="-1"><!> <!> <!></div> <!> <!>`,1);function B1(e,t){vB(t,!1);var n=B(void 0,!0),r=$W(`jsoneditor:TreeMode`),i=typeof window>`u`;r(`isSSR:`,i);var a=c_(),o=c_(),{openAbsolutePopup:s,closeAbsolutePopup:c}=_B(`absolute-popup`),l=B(void 0,!0),u=B(void 0,!0),d=B(void 0,!0),f=!1,p=YZ(),m=$(t,`readOnly`,9),h=$(t,`externalContent`,9),g=$(t,`externalSelection`,9),_=$(t,`history`,9),v=$(t,`truncateTextSize`,9),y=$(t,`mainMenuBar`,9),b=$(t,`navigationBar`,9),x=$(t,`escapeControlCharacters`,9),S=$(t,`escapeUnicodeCharacters`,9),C=$(t,`parser`,9),w=$(t,`parseMemoizeOne`,9),T=$(t,`validator`,9),E=$(t,`validationParser`,9),ee=$(t,`pathParser`,9),te=$(t,`indentation`,9),D=$(t,`onError`,9),ne=$(t,`onChange`,9),re=$(t,`onChangeMode`,9),ie=$(t,`onSelect`,9),ae=$(t,`onUndo`,9),oe=$(t,`onRedo`,9),O=$(t,`onRenderValue`,9),k=$(t,`onRenderMenu`,9),se=$(t,`onRenderContextMenu`,9),ce=$(t,`onClassName`,9),le=$(t,`onFocus`,9),ue=$(t,`onBlur`,9),A=$(t,`onSortModal`,9),de=$(t,`onTransformModal`,9),fe=$(t,`onJSONEditorModal`,9),pe=!1,j=B(!1,!0),me=B(void 0,!0);rQ({onMount:KU,onDestroy:qU,getWindow:()=>_K(K(d)),hasFocus:()=>pe&&document.hasFocus()||vK(K(d)),onFocus:()=>{f=!0,le()&&le()()},onBlur:()=>{f=!1,ue()&&ue()()}});var M=B(void 0,!0),he=B(void 0,!0),N=void 0,ge=!1,P=B(zq({json:K(M)}),!0),F=B(CJ(g())?g():void 0,!0);function _e(e){V(F,e)}KU(()=>{if(K(F)){var e=eY(K(F));V(P,Jq(K(M),K(P),e,gJ)),setTimeout(()=>Et(e))}});var ve,ye=B(void 0,!0),be=B(void 0,!0),xe=B(void 0,!0),Se=B(void 0,!0),Ce=B(!1,!0),we=B(!1,!0);function Te(e){V(Se,(ve=e)?AY(K(M),ve.items):void 0)}function Ee(e,t){return De.apply(this,arguments)}function De(){return(De=pz(function*(e,t){V(P,Jq(K(M),K(P),e,gJ)),yield St(e,{element:Tt(t)})})).apply(this,arguments)}function Oe(){V(Ce,!1),V(we,!1),Yt()}function ke(e){r(`select validation error`,e),V(F,BJ(e.path)),St(e.path)}function Ae(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:mJ;r(`expand`),V(P,Jq(K(M),K(P),e,t))}function je(e,t){V(P,Yq(K(M),K(P),e,t)),K(F)&&function(e,t){return IJ(eY(e),t)&&(eY(e).length>t.length||vJ(e))}(K(F),e)&&V(F,void 0)}var Me=B(!1,!0),Ne=B([],!0),I=B(void 0,!0),Pe=kv(eQ);function Fe(e,t,n,i){XZ(()=>{var a;try{a=Pe(e,t,n,i)}catch(e){a=[{path:[],message:`Failed to validate: `+e.message,severity:XG.warning}]}Vg(a,K(Ne))||(r(`validationErrors changed:`,a),V(Ne,a),V(I,function(e,t){var n;return t.forEach(t=>{n=$Z(e,n,t.path,(e,n)=>R(R({},n),{},{validationError:t}))}),t.forEach(t=>{for(var r=t.path;r.length>0;)r=Ig(r),n=$Z(e,n,r,(e,t)=>t.validationError?t:R(R({},t),{},{validationError:{isChildError:!0,path:r,message:`Contains invalid data`,severity:XG.warning}}))}),n}(e,K(Ne))))},e=>r(`validationErrors updated in ${e} ms`))}function Ie(){return r(`validate`),N?{parseError:N,isRepairable:!1}:(Fe(K(M),T(),C(),E()),Bg(K(Ne))?void 0:{validationErrors:K(Ne)})}function Le(){return K(M)}function Re(){return K(P)}function ze(){return K(F)}function Be(e){r(`applyExternalContent`,{updatedContent:e}),IG(e)?function(e){if(e!==void 0){var t=!Vg(K(M),e);if(r(`update external json`,{isChanged:t,currentlyText:K(M)===void 0}),t){var n={documentState:K(P),selection:K(F),json:K(M),text:K(he),textIsRepaired:K(Me)};V(M,e),V(P,Wq(e,K(P))),Ve(K(M)),V(he,void 0),V(Me,!1),N=void 0,He(K(M)),Ue(n)}}}(e.json):FG(e)&&function(e){if(!(e===void 0||IG(h()))){var t=e!==K(he);if(r(`update external text`,{isChanged:t}),t){var n={documentState:K(P),selection:K(F),json:K(M),text:K(he),textIsRepaired:K(Me)};try{V(M,w()(e)),V(P,Wq(K(M),K(P))),Ve(K(M)),V(he,e),V(Me,!1),N=void 0}catch(t){try{V(M,w()(yl(e))),V(P,Wq(K(M),K(P))),Ve(K(M)),V(he,e),V(Me,!0),N=void 0,He(K(M))}catch{V(M,void 0),V(P,void 0),V(he,h().text),V(Me,!1),N=K(he)!==void 0&&K(he)!==``?MG(K(he),t.message||String(t)):void 0}}He(K(M)),Ue(n)}}}(e.text)}function Ve(e){ge||(ge=!0,V(P,dJ(e,K(P),[])))}function He(e){K(F)&&(hc(e,tY(K(F)))&&hc(e,eY(K(F)))||(r(`clearing selection: path does not exist anymore`,K(F)),V(F,jJ(e,K(P)))))}function Ue(e){if(e.json!==void 0||e.text!==void 0){var t=K(M)!==void 0&&e.json!==void 0;_().add({type:`tree`,undo:{patch:t?[{op:`replace`,path:``,value:e.json}]:void 0,json:e.json,text:e.text,documentState:e.documentState,textIsRepaired:e.textIsRepaired,selection:LJ(e.selection),sortedColumn:void 0},redo:{patch:t?[{op:`replace`,path:``,value:K(M)}]:void 0,json:K(M),text:K(he),documentState:K(P),textIsRepaired:K(Me),selection:LJ(K(F)),sortedColumn:void 0}})}}function We(e,t){if(r(`patch`,e,t),K(M)===void 0)throw Error(`Cannot apply patch: no JSON`);var n=K(M),i={json:void 0,text:K(he),documentState:K(P),selection:LJ(K(F)),textIsRepaired:K(Me),sortedColumn:void 0},a=_Y(K(M),e),o=Zq(K(M),K(P),e),s=MJ(K(M),e)??K(F),c=typeof t==`function`?t(o.json,o.documentState,s):void 0;return V(M,c?.json===void 0?o.json:c.json),V(P,c?.state===void 0?o.documentState:c.state),V(F,c?.selection===void 0?s:c.selection),V(he,void 0),V(Me,!1),V(be,void 0),V(xe,void 0),N=void 0,He(K(M)),_().add({type:`tree`,undo:R({patch:a},i),redo:{patch:e,json:void 0,text:K(he),documentState:K(P),selection:LJ(K(F)),sortedColumn:void 0,textIsRepaired:K(Me)}}),{json:K(M),previousJson:n,undo:a,redo:e}}function Ge(){!m()&&K(F)&&V(F,zJ(eY(K(F))))}function Ke(){if(!m()&&K(F)){var e=eY(K(F)),t=lc(K(M),e);cG(t)?function(e,t){r(`openJSONEditorModal`,{path:e,value:t}),pe=!0,fe()({content:{json:t},path:e,onPatch:K($t).onPatch,onClose:()=>{pe=!1,setTimeout(Yt)}})}(e,t):V(F,VJ(e))}}function qe(){if(!m()&&bJ(K(F))){var e=eY(K(F)),t=_c(e),n=lc(K(M),e),i=!oJ(K(M),K(P),e),a=i?String(n):_G(String(n),C());r(`handleToggleEnforceString`,{enforceString:i,value:n,updatedValue:a}),Ot([{op:`replace`,path:t,value:a}],(t,n)=>({state:tJ(K(M),n,e,{type:`value`,enforceString:i})}))}}function Je(){return K(Me)&&K(M)!==void 0&&kt(K(M)),K(M)===void 0?{text:K(he)||``}:{json:K(M)}}function Ye(){return Xe.apply(this,arguments)}function Xe(){return Xe=pz(function*(){var e=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];yield i1({json:K(M),selection:K(F),indentation:e?te():void 0,readOnly:m(),parser:C(),onPatch:Ot})}),Xe.apply(this,arguments)}function Ze(){return Qe.apply(this,arguments)}function Qe(){return Qe=pz(function*(){var e=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];K(M)!==void 0&&(yield o1({json:K(M),selection:K(F),indentation:e?te():void 0,parser:C()}))}),Qe.apply(this,arguments)}function $e(e){e.preventDefault(),nt(e.clipboardData?.getData(`text/plain`))}function et(){return tt.apply(this,arguments)}function tt(){return(tt=pz(function*(){try{nt(yield navigator.clipboard.readText())}catch(e){console.error(e),V(j,!0)}})).apply(this,arguments)}function nt(e){e!==void 0&&c1({clipboardText:e,json:K(M),selection:K(F),readOnly:m(),parser:C(),onPatch:Ot,onChangeText:At,onPasteMultilineText:Lt,openRepairModal:rt})}function rt(e,t){V(me,{text:e,onParse:e=>kG(e,e=>DG(e,C())),onRepair:AG,onApply:t,onClose:Yt})}function it(){l1({json:K(M),text:K(he),selection:K(F),keepSelection:!1,readOnly:m(),onChange:ne(),onPatch:Ot})}function at(){!m()&&K(M)!==void 0&&K(F)&&qJ&&!Bg(eY(K(F)))&&(r(`duplicate`,{selection:K(F)}),Ot(uY(K(M),TJ(K(M),K(F)))))}function ot(){m()||!K(F)||!xJ(K(F))&&!bJ(K(F))||Bg(eY(K(F)))||(r(`extract`,{selection:K(F)}),Ot(dY(K(M),K(F)),(e,t)=>{if(cG(e))return{state:fJ(e,t,[])}}))}function st(e){u1({insertType:e,selectInside:!0,initialValue:void 0,json:K(M),selection:K(F),readOnly:m(),parser:C(),onPatch:Ot,onReplaceJson:kt})}function ct(e){yJ(K(F))&&V(F,BJ(K(F).path)),K(F)||V(F,jJ(K(M),K(P))),st(e)}function lt(e){if(!m()&&K(F))if(JJ(K(F)))try{var t=tY(K(F)),n=lc(K(M),t),i=function(e,t,n){if(t===`array`){if(Array.isArray(e))return e;if(sG(e))return wG(e);if(typeof e==`string`)try{var r=n.parse(e);if(Array.isArray(r))return r;if(sG(r))return wG(r)}catch{return[e]}return[e]}if(t===`object`){if(Array.isArray(e))return CG(e);if(sG(e))return e;if(typeof e==`string`)try{var i=n.parse(e);if(sG(i))return i;if(Array.isArray(i))return CG(i)}catch{return{value:e}}return{value:e}}if(t===`value`)return cG(e)?n.stringify(e):e;throw Error(`Cannot convert ${mG(e,n)} to ${t}`)}(n,e,C());if(i===n)return;var a=[{op:`replace`,path:_c(t),value:i}];r(`handleConvert`,{selection:K(F),path:t,type:e,operations:a}),Ot(a,(e,t)=>({state:K(F)?dJ(e,t,eY(K(F))):K(P)}))}catch(e){D()(e)}else D()(Error(`Cannot convert current selection to ${e}`))}function ut(){if(K(F)){var e=kJ(K(M),K(P),K(F),!1),t=Ig(eY(K(F)));e&&!Bg(eY(e))&&Vg(t,Ig(eY(e)))?V(F,UJ(eY(e))):V(F,HJ(t)),r(`insert before`,{selection:K(F),selectionBefore:e,parentPath:t}),uV(),zt()}}function dt(){if(K(F)){var e=OJ(K(M),K(F));r(`insert after`,e),V(F,UJ(e)),uV(),zt()}}function ft(e){return pt.apply(this,arguments)}function pt(){return(pt=pz(function*(e){yield d1({char:e,selectInside:!0,json:K(M),selection:K(F),readOnly:m(),parser:C(),onPatch:Ot,onReplaceJson:kt,onSelect:_e})})).apply(this,arguments)}function mt(){if(!m()&&_().canUndo){var e=_().undo();if(Iq(e)){var t={json:K(M),text:K(he)};V(M,e.undo.patch?bc(K(M),e.undo.patch):e.undo.json),V(P,e.undo.documentState),V(F,e.undo.selection),V(he,e.undo.text),V(Me,e.undo.textIsRepaired),N=void 0,r(`undo`,{item:e,json:K(M),documentState:K(P),selection:K(F)}),Dt(t,e.undo.patch&&e.redo.patch?{json:K(M),previousJson:t.json,redo:e.undo.patch,undo:e.redo.patch}:void 0),Yt(),K(F)&&St(eY(K(F)),{scrollToWhenVisible:!1})}else ae()(e)}}function ht(){if(!m()&&_().canRedo){var e=_().redo();if(Iq(e)){var t={json:K(M),text:K(he)};V(M,e.redo.patch?bc(K(M),e.redo.patch):e.redo.json),V(P,e.redo.documentState),V(F,e.redo.selection),V(he,e.redo.text),V(Me,e.redo.textIsRepaired),N=void 0,r(`redo`,{item:e,json:K(M),documentState:K(P),selection:K(F)}),Dt(t,e.undo.patch&&e.redo.patch?{json:K(M),previousJson:t.json,redo:e.redo.patch,undo:e.undo.patch}:void 0),Yt(),K(F)&&St(eY(K(F)),{scrollToWhenVisible:!1})}else oe()(e)}}function gt(e){var t;m()||K(M)===void 0||(pe=!0,A()({id:a,json:K(M),rootPath:e,onSort:(t=pz(function*(t){var{operations:n}=t;r(`onSort`,e,n),Ot(n,(t,n)=>({state:fJ(t,n,e),selection:BJ(e)}))}),function(e){return t.apply(this,arguments)}),onClose:()=>{pe=!1,setTimeout(Yt)}}))}function _t(){K(F)&>(FJ(K(M),K(F)))}function vt(){gt([])}function yt(e){if(K(M)!==void 0){var{id:t,onTransform:n,onClose:i}=e,a=e.rootPath||[];pe=!0,de()({id:t||o,json:K(M),rootPath:a,onTransform:e=>{n?n({operations:e,json:K(M),transformedJson:bc(K(M),e)}):(r(`onTransform`,a,e),Ot(e,(e,t)=>({state:fJ(e,t,a),selection:BJ(a)})))},onClose:()=>{pe=!1,setTimeout(Yt),i&&i()}})}}function bt(){K(F)&&yt({rootPath:FJ(K(M),K(F))})}function xt(){yt({rootPath:[]})}function St(e){return Ct.apply(this,arguments)}function Ct(){return Ct=pz(function*(e){var{scrollToWhenVisible:t=!0,element:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};V(P,Jq(K(M),K(P),e,gJ));var i=n??wt(e);if(r(`scrollTo`,{path:e,elem:i,refContents:K(l)}),!i||!K(l))return Promise.resolve();var a=K(l).getBoundingClientRect(),o=i.getBoundingClientRect();if(!t&&o.bottom>a.top&&o.top<a.bottom)return Promise.resolve();var s=-a.height/4;return new Promise(e=>{p(i,{container:K(l),offset:s,duration:300,callback:()=>e()})})}),Ct.apply(this,arguments)}function wt(e){return uV(),K(l)?.querySelector(`div[data-path="${xK(e)}"]`)??void 0}function Tt(e){return uV(),K(l)?.querySelector(`span[data-search-result-index="${e}"]`)??void 0}function Et(e){var t=wt(e);if(t&&K(l)){var n=K(l).getBoundingClientRect(),r=t.getBoundingClientRect(),i=cG(lc(K(M),e))?20:r.height;r.top<n.top+20?p(t,{container:K(l),offset:-20,duration:0}):r.top+i>n.bottom-20&&p(t,{container:K(l),offset:-(n.height-i-20),duration:0})}}function Dt(e,t){if(e.json!==void 0||e?.text!==void 0){if(K(he)!==void 0){var n,r={text:K(he),json:void 0};(n=ne())==null||n(r,e,{contentErrors:Ie(),patchResult:t})}else if(K(M)!==void 0){var i,a={text:void 0,json:K(M)};(i=ne())==null||i(a,e,{contentErrors:Ie(),patchResult:t})}}}function Ot(e,t){r(`handlePatch`,e,t);var n={json:K(M),text:K(he)},i=We(e,t);return Dt(n,i),i}function kt(e,t){var n={json:K(M),text:K(he)},r={documentState:K(P),selection:K(F),json:K(M),text:K(he),textIsRepaired:K(Me)},i=Jq(K(M),Wq(e,K(P)),[],pJ),a=typeof t==`function`?t(e,i,K(F)):void 0;V(M,a?.json===void 0?e:a.json),V(P,a?.state===void 0?i:a.state),V(F,a?.selection===void 0?K(F):a.selection),V(he,void 0),V(Me,!1),N=void 0,He(K(M)),Ue(r),Dt(n,void 0)}function At(e,t){r(`handleChangeText`);var n={json:K(M),text:K(he)},i={documentState:K(P),selection:K(F),json:K(M),text:K(he),textIsRepaired:K(Me)};try{V(M,w()(e)),V(P,Jq(K(M),Wq(K(M),K(P)),[],pJ)),V(he,void 0),V(Me,!1),N=void 0}catch(t){try{V(M,w()(yl(e))),V(P,Jq(K(M),Wq(K(M),K(P)),[],pJ)),V(he,e),V(Me,!0),N=void 0}catch{V(M,void 0),V(P,zq({json:K(M),expand:pJ})),V(he,e),V(Me,!1),N=K(he)===``?void 0:MG(K(he),t.message||String(t))}}if(typeof t==`function`){var a=t(K(M),K(P),K(F));V(M,a?.json===void 0?K(M):a.json),V(P,a?.state===void 0?K(P):a.state),V(F,a?.selection===void 0?K(F):a.selection)}He(K(M)),Ue(i),Dt(n,void 0)}function jt(e,t){var n=arguments.length>2&&arguments[2]!==void 0&&arguments[2];r(`handleExpand`,{path:e,expanded:t,recursive:n}),t?Ae(e,n?hJ:mJ):je(e,n),Yt()}function Mt(){jt([],!0,!0)}function Nt(){jt([],!1,!0)}function Pt(e){r(`openFind`,{findAndReplace:e}),V(Ce,!1),V(we,!1),uV(),V(Ce,!0),V(we,e)}function Ft(e,t){r(`handleExpandSection`,e,t),V(P,function(e,t,n,r){return nJ(e,t,n,(e,t)=>{if(!Mq(t))return t;var n=gq(t.visibleSections.concat(r));return R(R({},t),{},{visibleSections:n})})}(K(M),K(P),e,t))}function It(e){r(`pasted json as text`,e),V(be,e)}function Lt(e){r(`pasted multiline text`,{pastedText:e}),V(xe,e)}function Rt(e){var{anchor:t,left:n,top:r,width:i,height:a,offsetTop:o,offsetLeft:l,showTip:u}=e,d=function(e){var{json:t,documentState:n,selection:r,readOnly:i,onEditKey:a,onEditValue:o,onToggleEnforceString:s,onCut:c,onCopy:l,onPaste:u,onRemove:d,onDuplicate:f,onExtract:p,onInsertBefore:m,onInsert:h,onConvert:g,onInsertAfter:_,onSort:v,onTransform:y}=e,b=t!==void 0,x=!!r,S=!!r&&Bg(eY(r)),C=r?lc(t,eY(r)):void 0,w=Array.isArray(C)?`Edit array`:sG(C)?`Edit object`:`Edit value`,T=b&&(xJ(r)||yJ(r)||bJ(r)),E=r&&!S?lc(t,Ig(eY(r))):void 0,ee=!i&&b&&PJ(r)&&!S&&!Array.isArray(E),te=!i&&b&&r!==void 0&&PJ(r),D=te&&!cG(C),ne=!i&&T,re=T,ie=!i&&x,ae=!i&&b&&T&&!S,oe=!i&&b&&r!==void 0&&(xJ(r)||bJ(r))&&!S,O=T,k=O?`Convert to:`:`Insert:`,se=!i&&(vJ(r)&&Array.isArray(C)||_J(r)&&Array.isArray(E)),ce=!i&&(O?JJ(r)&&!sG(C):x),le=!i&&(O?JJ(r)&&!Array.isArray(C):x),ue=!i&&(O?JJ(r)&&cG(C):x),A=r!==void 0&&oJ(t,n,eY(r));function de(e){T?e!==`structure`&&g(e):h(e)}return[{type:`row`,items:[{type:`button`,onClick:()=>a(),icon:nv,text:`Edit key`,title:`Edit the key (Double-click on the key)`,disabled:!ee},{type:`dropdown-button`,main:{type:`button`,onClick:()=>o(),icon:nv,text:w,title:`Edit the value (Double-click on the value)`,disabled:!te},width:`11em`,items:[{type:`button`,icon:nv,text:w,title:`Edit the value (Double-click on the value)`,onClick:()=>o(),disabled:!te},{type:`button`,icon:A?G_:Z_,text:`Enforce string`,title:`Enforce keeping the value as string when it contains a numeric value`,onClick:()=>s(),disabled:!D}]}]},{type:`separator`},{type:`row`,items:[{type:`dropdown-button`,main:{type:`button`,onClick:()=>c(!0),icon:H_,text:`Cut`,title:`Cut selected contents, formatted with indentation (Ctrl+X)`,disabled:!ne},width:`10em`,items:[{type:`button`,icon:H_,text:`Cut formatted`,title:`Cut selected contents, formatted with indentation (Ctrl+X)`,onClick:()=>c(!0),disabled:!ne},{type:`button`,icon:H_,text:`Cut compacted`,title:`Cut selected contents, without indentation (Ctrl+Shift+X)`,onClick:()=>c(!1),disabled:!ne}]},{type:`dropdown-button`,main:{type:`button`,onClick:()=>l(!0),icon:hv,text:`Copy`,title:`Copy selected contents, formatted with indentation (Ctrl+C)`,disabled:!re},width:`12em`,items:[{type:`button`,icon:hv,text:`Copy formatted`,title:`Copy selected contents, formatted with indentation (Ctrl+C)`,onClick:()=>l(!0),disabled:!re},{type:`button`,icon:hv,text:`Copy compacted`,title:`Copy selected contents, without indentation (Ctrl+Shift+C)`,onClick:()=>l(!1),disabled:!re}]},{type:`button`,onClick:()=>u(),icon:B_,text:`Paste`,title:`Paste clipboard contents (Ctrl+V)`,disabled:!ie}]},{type:`separator`},{type:`row`,items:[{type:`column`,items:[{type:`button`,onClick:()=>f(),icon:Sv,text:`Duplicate`,title:`Duplicate selected contents (Ctrl+D)`,disabled:!ae},{type:`button`,onClick:()=>p(),icon:av,text:`Extract`,title:`Extract selected contents`,disabled:!oe},{type:`button`,onClick:()=>v(),icon:uv,text:`Sort`,title:`Sort array or object contents`,disabled:i||!T},{type:`button`,onClick:()=>y(),icon:Q_,text:`Transform`,title:`Transform array or object contents (filter, sort, project)`,disabled:i||!T},{type:`button`,onClick:()=>d(),icon:L_,text:`Remove`,title:`Remove selected contents (Delete)`,disabled:i||!T}]},{type:`column`,items:[{type:`label`,text:k},{type:`button`,onClick:()=>de(`structure`),icon:O?lv:gv,text:`Structure`,title:k+` structure like the first item in the array`,disabled:!se},{type:`button`,onClick:()=>de(`object`),icon:O?lv:gv,text:`Object`,title:k+` object`,disabled:!ce},{type:`button`,onClick:()=>de(`array`),icon:O?lv:gv,text:`Array`,title:k+` array`,disabled:!le},{type:`button`,onClick:()=>de(`value`),icon:O?lv:gv,text:`Value`,title:k+` value`,disabled:!ue}]}]},{type:`separator`},{type:`row`,items:[{type:`button`,onClick:()=>m(),icon:Y_,text:`Insert before`,title:`Select area before current entry to insert or paste contents`,disabled:i||!T||S},{type:`button`,onClick:()=>_(),icon:U_,text:`Insert after`,title:`Select area after current entry to insert or paste contents`,disabled:i||!T||S}]}]}({json:K(M),documentState:K(P),selection:K(F),readOnly:m(),onEditKey:Ge,onEditValue:Ke,onToggleEnforceString:qe,onCut:Ye,onCopy:Ze,onPaste:et,onRemove:it,onDuplicate:at,onExtract:ot,onInsertBefore:ut,onInsert:ct,onInsertAfter:dt,onConvert:lt,onSort:_t,onTransform:bt}),f=se()(d)??d;if(!1!==f){var p={left:n,top:r,offsetTop:o,offsetLeft:l,width:i,height:a,anchor:t,closeOnOuterClick:!0,onClose:()=>{pe=!1,Yt()}};pe=!0;var h=s(A1,{tip:u?`Tip: you can open this context menu via right-click or with Ctrl+Q`:void 0,items:f,onRequestClose:()=>c(h)},p)}}function zt(e){if(!KJ(K(F)))if(e&&(e.stopPropagation(),e.preventDefault()),e&&e.type===`contextmenu`&&e.target!==K(u))Rt({left:e.clientX,top:e.clientY,width:pq,height:fq,showTip:!1});else{var t=K(l)?.querySelector(`.jse-context-menu-pointer.jse-selected`);if(t)Rt({anchor:t,offsetTop:2,width:pq,height:fq,showTip:!1});else{var n=K(l)?.getBoundingClientRect();n&&Rt({top:n.top+2,left:n.left+2,width:pq,height:fq,showTip:!1})}}}function Bt(e){Rt({anchor:yK(e.target,`BUTTON`),offsetTop:0,width:pq,height:fq,showTip:!0})}function Vt(){return Ht.apply(this,arguments)}function Ht(){return(Ht=pz(function*(){if(r(`apply pasted json`,K(be)),K(be)){var{onPasteAsJson:e}=K(be);V(be,void 0),e(),setTimeout(Yt)}})).apply(this,arguments)}function Ut(){return Wt.apply(this,arguments)}function Wt(){return(Wt=pz(function*(){r(`apply pasted multiline text`,K(xe)),K(xe)&&(nt(JSON.stringify(K(xe))),setTimeout(Yt))})).apply(this,arguments)}function Gt(){r(`clear pasted json`),V(be,void 0),Yt()}function Kt(){r(`clear pasted multiline text`),V(xe,void 0),Yt()}function qt(){re()(qG.text)}function Jt(e){V(F,e),Yt(),St(eY(e))}function Yt(){r(`focus`),K(u)&&(K(u).focus(),K(u).select())}function Xt(e){return function(e,t,n){var r=Ig(n),i=[wg(n)],a=lc(e,r),o=a?uJ(a,t,i):void 0;return o?BJ(r.concat(o)):UJ(n)}(K(M),K(P),e)}function Zt(e){K(n)&&K(n).onDrag(e)}function Qt(){K(n)&&K(n).onDragEnd()}var $t=B(void 0,!0);W(()=>K(F),()=>{var e=K(F);Vg(e,g())||(r(`onSelect`,e),ie()(e))}),W(()=>(J(x()),J(S())),()=>{V(ye,tK({escapeControlCharacters:x(),escapeUnicodeCharacters:S()}))}),W(()=>K(Ce),()=>{(function(e){K(l)&&e&&K(l).scrollTop===0&&(iH(l,K(l).style.overflowAnchor=`none`),iH(l,K(l).scrollTop+=mq),setTimeout(()=>{K(l)&&iH(l,K(l).style.overflowAnchor=``)}))})(K(Ce))}),W(()=>J(h()),()=>{Be(h())}),W(()=>J(g()),()=>{(function(e){Vg(K(F),e)||(r(`applyExternalSelection`,{selection:K(F),externalSelection:e}),CJ(e)&&V(F,e))})(g())}),W(()=>(K(M),J(T()),J(C()),J(E())),()=>{Fe(K(M),T(),C(),E())}),W(()=>(K(l),JZ),()=>{V(n,K(l)?JZ(K(l)):void 0)}),W(()=>(J(m()),J(v()),J(C()),K(ye),J(O()),J(ce())),()=>{V($t,{mode:qG.tree,readOnly:m(),truncateTextSize:v(),parser:C(),normalization:K(ye),getJson:Le,getDocumentState:Re,getSelection:ze,findElement:wt,findNextInside:Xt,focus:Yt,onPatch:Ot,onInsert:st,onExpand:jt,onSelect:_e,onFind:Pt,onExpandSection:Ft,onPasteJson:It,onRenderValue:O(),onContextMenu:Rt,onClassName:ce()||(()=>{}),onDrag:Zt,onDragEnd:Qt})}),W(()=>K($t),()=>{r(`context changed`,K($t))}),DH();var en={expand:Ae,collapse:je,validate:Ie,getJson:Le,patch:We,acceptAutoRepair:Je,openTransformModal:yt,scrollTo:St,findElement:wt,findSearchResult:Tt,focus:Yt};GW(!0);var tn=z1();Y(`mousedown`,YV,function(e){!hK(e.target,e=>e===K(d))&&KJ(K(F))&&(r(`click outside the editor, exit edit mode`),V(F,LJ(K(F))),f&&K(u)&&(K(u).focus(),K(u).blur()),r(`blur (outside editor)`),K(u)&&K(u).blur())});var nn,rn=hH(tn),an=H(rn),on=e=>{(function(e,t){vB(t,!1);var n=B(void 0,!0),r=B(void 0,!0),i=B(void 0,!0),a=$(t,`json`,9),o=$(t,`selection`,9),s=$(t,`readOnly`,9),c=$(t,`showSearch`,13,!1),l=$(t,`history`,9),u=$(t,`onExpandAll`,9),d=$(t,`onCollapseAll`,9),f=$(t,`onUndo`,9),p=$(t,`onRedo`,9),m=$(t,`onSort`,9),h=$(t,`onTransform`,9),g=$(t,`onContextMenu`,9),_=$(t,`onCopy`,9),v=$(t,`onRenderMenu`,9);function y(){c(!c())}var b=B(void 0,!0),x=B(void 0,!0),S=B(void 0,!0),C=B(void 0,!0);W(()=>J(a()),()=>{V(n,a()!==void 0)}),W(()=>(K(n),J(o()),bJ),()=>{V(r,K(n)&&(xJ(o())||yJ(o())||bJ(o())))}),W(()=>(J(u()),J(a())),()=>{V(b,{type:`button`,icon:v$,title:`Expand all`,className:`jse-expand-all`,onClick:u(),disabled:!cG(a())})}),W(()=>(J(d()),J(a())),()=>{V(x,{type:`button`,icon:y$,title:`Collapse all`,className:`jse-collapse-all`,onClick:d(),disabled:!cG(a())})}),W(()=>J(a()),()=>{V(S,{type:`button`,icon:pv,title:`Search (Ctrl+F)`,className:`jse-search`,onClick:y,disabled:a()===void 0})}),W(()=>(J(s()),K(b),K(x),J(m()),J(a()),J(h()),K(S),J(g()),J(f()),J(l()),J(p()),J(_()),K(r)),()=>{V(C,s()?[K(b),K(x),{type:`separator`},{type:`button`,icon:hv,title:`Copy (Ctrl+C)`,className:`jse-copy`,onClick:_(),disabled:!K(r)},{type:`separator`},K(S),{type:`space`}]:[K(b),K(x),{type:`separator`},{type:`button`,icon:uv,title:`Sort`,className:`jse-sort`,onClick:m(),disabled:s()||a()===void 0},{type:`button`,icon:Q_,title:`Transform contents (filter, sort, project)`,className:`jse-transform`,onClick:h(),disabled:s()||a()===void 0},K(S),{type:`button`,icon:cv,title:oq,className:`jse-contextmenu`,onClick:g()},{type:`separator`},{type:`button`,icon:iv,title:`Undo (Ctrl+Z)`,className:`jse-undo`,onClick:f(),disabled:!l().canUndo},{type:`button`,icon:rv,title:`Redo (Ctrl+Shift+Z)`,className:`jse-redo`,onClick:p(),disabled:!l().canRedo},{type:`space`}])}),W(()=>(J(v()),K(C)),()=>{V(i,v()(K(C))||K(C))}),DH(),GW(!0),CQ(e,{get items(){return K(i)}}),yB()})(e,{get json(){return K(M)},get selection(){return K(F)},get readOnly(){return m()},get history(){return _()},onExpandAll:Mt,onCollapseAll:Nt,onUndo:mt,onRedo:ht,onSort:vt,onTransform:xt,onContextMenu:Bt,onCopy:Ze,get onRenderMenu(){return k()},get showSearch(){return K(Ce)},set showSearch(e){V(Ce,e)},$$legacy:!0})};Q(an,e=>{y()&&e(on)});var sn=U(an,2),cn=e=>{B$(e,{get json(){return K(M)},get selection(){return K(F)},onSelect:Jt,get onError(){return D()},get pathParser(){return ee()}})};Q(sn,e=>{b()&&e(cn)});var ln=U(sn,2),un=e=>{var t=L1(),n=hH(t),r=H(n);r.readOnly=!0,HW(r,e=>V(u,e),()=>K(u));var i=U(n,2),a=e=>{var t=kU(),n=hH(t),r=e=>{(function(e,t){function n(e){e.stopPropagation(),t.onCreateObject()}function r(e){e.stopPropagation(),t.onCreateArray()}vB(t,!0);var i=C$(),a=U(H(U(H(i),2)),2),o=e=>{var t=S$(),i=U(hH(t),2);jW(i,`title`,`Create an empty JSON object (press '{')`);var a=U(i,2);jW(a,`title`,`Create an empty JSON array (press '[')`),xU(`click`,i,n),xU(`click`,a,r),Z(e,t)};Q(a,e=>{t.readOnly||e(o)}),xU(`click`,i,()=>t.onClick()),Z(e,i),yB()})(e,{get readOnly(){return m()},onCreateObject:()=>{Yt(),ft(`{`)},onCreateArray:()=>{Yt(),ft(`[`)},onClick:()=>{Yt()}})},i=e=>{var t=P1(),n=hH(t),r=GV(()=>m()?[]:[{icon:$_,text:`Repair manually`,title:`Open the document in "code" mode and repair it manually`,onClick:qt}]);oQ(n,{type:`error`,message:`The loaded JSON document is invalid and could not be repaired automatically.`,get actions(){return K(r)}}),h1(U(n,2),{get text(){return K(he)},get json(){return K(M)},get indentation(){return te()},get parser(){return C()}}),Z(e,t)};Q(n,e=>{K(he)===``||K(he)===void 0?e(r):e(i,-1)}),Z(e,t)},o=e=>{var t=I1(),n=hH(t);W$(H(n),{get json(){return K(M)},get documentState(){return K(P)},get parser(){return C()},get showSearch(){return K(Ce)},get showReplace(){return K(we)},get readOnly(){return m()},columns:void 0,onSearch:Te,onFocus:Ee,onPatch:Ot,onClose:Oe});var r=U(n,2);jW(r,`data-jsoneditor-scrollable-contents`,!0);var i=H(r),a=e=>{Z(e,F1())};Q(i,e=>{K(Ce)&&e(a)}),_$(U(i,2),{get value(){return K(M)},pointer:``,get state(){return K(P)},get validationErrors(){return K(I)},get searchResults(){return K(Se)},get selection(){return K(F)},get context(){return K($t)},get onDragSelectionStart(){return ju}}),HW(r,e=>V(l,e),()=>K(l));var o=U(r,2),s=e=>{var t=GV(()=>(K(be),q(()=>`You pasted a JSON ${Array.isArray(K(be).contents)?`array`:`object`} as text`))),n=GV(()=>[{icon:ev,text:`Paste as JSON instead`,title:`Replace the value with the pasted JSON`,onMouseDown:Vt},{text:`Leave as is`,title:`Keep the JSON embedded in the value`,onClick:Gt}]);oQ(e,{type:`info`,get message(){return K(t)},get actions(){return K(n)}})};Q(o,e=>{K(be)&&e(s)});var c=U(o,2),u=e=>{var t=GV(()=>[{icon:ev,text:`Paste as string instead`,title:`Paste the clipboard data as a single string value instead of an array`,onClick:Ut},{text:`Leave as is`,title:`Keep the pasted array`,onClick:Kt}]);oQ(e,{type:`info`,message:`Multiline text was pasted as array`,get actions(){return K(t)}})};Q(c,e=>{K(xe)&&e(u)});var d=U(c,2),f=e=>{var t=GV(()=>m()?[]:[{icon:Cv,text:`Ok`,title:`Accept the repaired document`,onClick:Je},{icon:$_,text:`Repair manually instead`,title:`Leave the document unchanged and repair it manually instead`,onClick:qt}]);oQ(e,{type:`success`,message:`The loaded JSON document was invalid but is successfully repaired.`,get actions(){return K(t)},onClose:Yt})};Q(d,e=>{K(Me)&&e(f)}),pQ(U(d,2),{get validationErrors(){return K(Ne)},selectError:ke}),Z(e,t)};Q(i,e=>{K(M)===void 0?e(a):e(o,-1)}),Y(`paste`,r,$e),Z(e,t)},dn=e=>{Z(e,R1())};Q(ln,e=>{i?e(dn,-1):e(un)}),HW(rn,e=>V(d,e),()=>K(d));var fn=U(rn,2),pn=e=>{vQ(e,{onClose:()=>V(j,!1)})};Q(fn,e=>{K(j)&&e(pn)});var mn=U(fn,2),hn=e=>{DQ(e,QW(()=>K(me),{onClose:()=>{var e;(e=K(me))==null||e.onClose(),V(me,void 0)}}))};return Q(mn,e=>{K(me)&&e(hn)}),G(()=>nn=_W(rn,1,`jse-tree-mode svelte-10mlrw4`,null,nn,{"no-main-menu":!y()})),Y(`keydown`,rn,function(e){var t=TK(e),n=e.shiftKey;if(r(`keydown`,{combo:t,key:e.key}),t===`Ctrl+X`&&(e.preventDefault(),Ye(!0)),t===`Ctrl+Shift+X`&&(e.preventDefault(),Ye(!1)),t===`Ctrl+C`&&(e.preventDefault(),Ze(!0)),t===`Ctrl+Shift+C`&&(e.preventDefault(),Ze(!1)),t===`Ctrl+D`&&(e.preventDefault(),at()),t!==`Delete`&&t!==`Backspace`||(e.preventDefault(),it()),t===`Insert`&&(e.preventDefault(),st(`structure`)),t===`Ctrl+A`&&(e.preventDefault(),V(F,BJ([]))),t===`Ctrl+Q`&&zt(e),t===`ArrowUp`||t===`Shift+ArrowUp`){e.preventDefault();var i=K(F)?kJ(K(M),K(P),K(F),n)||K(F):jJ(K(M),K(P));V(F,i),Et(eY(i))}if(t===`ArrowDown`||t===`Shift+ArrowDown`){e.preventDefault();var a=K(F)?function(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0&&arguments[3];if(n){var i=r?eY(n):OJ(e,n),a=cG(lc(e,i))?Yq(e,t,i,!0):t,o=uJ(e,t,i),s=uJ(e,a,i);if(r)return vJ(n)?o===void 0?void 0:WJ(o,o):_J(n)?s===void 0?void 0:WJ(s,s):s===void 0?void 0:WJ(tY(n),s);if(_J(n))return s===void 0?void 0:BJ(s);if(vJ(n)||bJ(n))return o===void 0?void 0:BJ(o);if(yJ(n)){if(o===void 0||o.length===0)return;var c=lc(e,Ig(o));return Array.isArray(c)?BJ(o):RJ(o)}return xJ(n)?s===void 0?o===void 0?void 0:BJ(o):BJ(s):void 0}}(K(M),K(P),K(F),n)||K(F):jJ(K(M),K(P));V(F,a),Et(eY(a))}if(t===`ArrowLeft`||t===`Shift+ArrowLeft`){e.preventDefault();var o=K(F)?function(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0&&arguments[3],i=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4];if(n){var{caret:a,previous:o}=AJ(e,t,n,i);if(r)return xJ(n)?void 0:WJ(n.path,n.path);if(a&&o)return YJ(o);var s=lc(e,Ig(eY(n)));return bJ(n)&&Array.isArray(s)?WJ(n.path,n.path):xJ(n)&&!Array.isArray(s)?RJ(n.focusPath):void 0}}(K(M),K(P),K(F),n,!m())||K(F):jJ(K(M),K(P));V(F,o),Et(eY(o))}if(t===`ArrowRight`||t===`Shift+ArrowRight`){e.preventDefault();var s=K(F)&&K(M)!==void 0?function(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0&&arguments[3],i=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4];if(n){var{caret:a,next:o}=AJ(e,t,n,i);return r?xJ(n)?void 0:WJ(n.path,n.path):a&&o?YJ(o):xJ(n)?BJ(n.focusPath):void 0}}(K(M),K(P),K(F),n,!m())||K(F):jJ(K(M),K(P));V(F,s),Et(eY(s))}if(t===`Enter`&&K(F)){if(SJ(K(F))){var c=K(F).focusPath,l=lc(K(M),Ig(c));Array.isArray(l)&&(e.preventDefault(),V(F,BJ(c)))}yJ(K(F))&&(e.preventDefault(),V(F,R(R({},K(F)),{},{edit:!0}))),bJ(K(F))&&(e.preventDefault(),cG(lc(K(M),K(F).path))?jt(K(F).path,!0):V(F,R(R({},K(F)),{},{edit:!0})))}if(t.replace(/^Shift\+/,``).length===1&&K(F))return e.preventDefault(),void ft(e.key);if(t===`Enter`&&(_J(K(F))||vJ(K(F))))return e.preventDefault(),void ft(``);if(t===`Ctrl+Enter`&&bJ(K(F))){var u=lc(K(M),K(F).path);gG(u)&&window.open(String(u),`_blank`)}t===`Escape`&&K(F)&&(e.preventDefault(),V(F,void 0)),t===`Ctrl+F`&&(e.preventDefault(),Pt(!1)),t===`Ctrl+H`&&(e.preventDefault(),Pt(!0)),t===`Ctrl+Z`&&(e.preventDefault(),mt()),t===`Ctrl+Shift+Z`&&(e.preventDefault(),ht())}),Y(`mousedown`,rn,function(e){r(`handleMouseDown`,e);var t=e.target;pK(t,`BUTTON`)||t.isContentEditable||(Yt(),K(F)||K(M)!==void 0||K(he)!==``&&K(he)!==void 0||(r(`createDefaultSelection`),V(F,BJ([]))))}),Y(`contextmenu`,rn,zt),Z(e,tn),BW(t,`expand`,Ae),BW(t,`collapse`,je),BW(t,`validate`,Ie),BW(t,`getJson`,Le),BW(t,`patch`,We),BW(t,`acceptAutoRepair`,Je),BW(t,`openTransformModal`,yt),BW(t,`scrollTo`,St),BW(t,`findElement`,wt),BW(t,`findSearchResult`,Tt),BW(t,`focus`,Yt),yB(en)}function V1(e){return typeof(t=e)!=`object`||t===null?e:new Proxy(e,{get:(e,t,n)=>V1(Reflect.get(e,t,n)),set:()=>!1,deleteProperty:()=>!1});var t}var H1=$W(`jsoneditor:History`);function U1(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.maxItems||1e3,n=[],r=0;function i(){return r<n.length}function a(){return r>0}function o(){return{canUndo:i(),canRedo:a(),items:()=>n.slice().reverse(),add:c,undo:u,redo:d,clear:l}}function s(){e.onChange&&e.onChange(o())}function c(e){H1(`add`,e),n=[e].concat(n.slice(r)).slice(0,t),r=0,s()}function l(){H1(`clear`),n=[],r=0,s()}function u(){if(i()){var e=n[r];return r+=1,H1(`undo`,e),s(),e}}function d(){if(a())return H1(`redo`,n[--r]),s(),n[r]}return{get:o}}OK(`/* over all fonts, sizes, and colors */
|
|
2829
|
+
}`);var F1=X(`<!> <!>`,1),I1=X(`<div class="jse-search-box-background svelte-10mlrw4"></div>`),L1=X(`<div class="jse-search-box-container svelte-10mlrw4"><!></div> <div class="jse-contents svelte-10mlrw4"><!> <!></div> <!> <!> <!> <!>`,1),R1=X(`<label class="jse-hidden-input-label svelte-10mlrw4"><input type="text" tabindex="-1" class="jse-hidden-input svelte-10mlrw4"/></label> <!>`,1),z1=X(`<div class="jse-contents svelte-10mlrw4"><div class="jse-loading-space svelte-10mlrw4"></div> <div class="jse-loading svelte-10mlrw4">loading...</div></div>`),B1=X(`<div role="tree" tabindex="-1"><!> <!> <!></div> <!> <!>`,1);function V1(e,t){vB(t,!1);var n=B(void 0,!0),r=$W(`jsoneditor:TreeMode`),i=typeof window>`u`;r(`isSSR:`,i);var a=c_(),o=c_(),{openAbsolutePopup:s,closeAbsolutePopup:c}=_B(`absolute-popup`),l=B(void 0,!0),u=B(void 0,!0),d=B(void 0,!0),f=!1,p=XZ(),m=$(t,`readOnly`,9),h=$(t,`externalContent`,9),g=$(t,`externalSelection`,9),_=$(t,`history`,9),v=$(t,`truncateTextSize`,9),y=$(t,`mainMenuBar`,9),b=$(t,`navigationBar`,9),x=$(t,`escapeControlCharacters`,9),S=$(t,`escapeUnicodeCharacters`,9),C=$(t,`parser`,9),w=$(t,`parseMemoizeOne`,9),T=$(t,`validator`,9),E=$(t,`validationParser`,9),ee=$(t,`pathParser`,9),te=$(t,`indentation`,9),D=$(t,`onError`,9),ne=$(t,`onChange`,9),re=$(t,`onChangeMode`,9),ie=$(t,`onSelect`,9),ae=$(t,`onUndo`,9),oe=$(t,`onRedo`,9),O=$(t,`onRenderValue`,9),k=$(t,`onRenderMenu`,9),se=$(t,`onRenderContextMenu`,9),ce=$(t,`onClassName`,9),le=$(t,`onFocus`,9),ue=$(t,`onBlur`,9),A=$(t,`onSortModal`,9),de=$(t,`onTransformModal`,9),fe=$(t,`onJSONEditorModal`,9),pe=!1,j=B(!1,!0),me=B(void 0,!0);iQ({onMount:KU,onDestroy:qU,getWindow:()=>_K(K(d)),hasFocus:()=>pe&&document.hasFocus()||vK(K(d)),onFocus:()=>{f=!0,le()&&le()()},onBlur:()=>{f=!1,ue()&&ue()()}});var M=B(void 0,!0),he=B(void 0,!0),N=void 0,ge=!1,P=B(zq({json:K(M)}),!0),F=B(CJ(g())?g():void 0,!0);function _e(e){V(F,e)}KU(()=>{if(K(F)){var e=eY(K(F));V(P,Jq(K(M),K(P),e,gJ)),setTimeout(()=>Et(e))}});var ve,ye=B(void 0,!0),be=B(void 0,!0),xe=B(void 0,!0),Se=B(void 0,!0),Ce=B(!1,!0),we=B(!1,!0);function Te(e){V(Se,(ve=e)?AY(K(M),ve.items):void 0)}function Ee(e,t){return De.apply(this,arguments)}function De(){return(De=pz(function*(e,t){V(P,Jq(K(M),K(P),e,gJ)),yield St(e,{element:Tt(t)})})).apply(this,arguments)}function Oe(){V(Ce,!1),V(we,!1),Yt()}function ke(e){r(`select validation error`,e),V(F,BJ(e.path)),St(e.path)}function Ae(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:mJ;r(`expand`),V(P,Jq(K(M),K(P),e,t))}function je(e,t){V(P,Yq(K(M),K(P),e,t)),K(F)&&function(e,t){return IJ(eY(e),t)&&(eY(e).length>t.length||vJ(e))}(K(F),e)&&V(F,void 0)}var Me=B(!1,!0),Ne=B([],!0),I=B(void 0,!0),Pe=kv(tQ);function Fe(e,t,n,i){ZZ(()=>{var a;try{a=Pe(e,t,n,i)}catch(e){a=[{path:[],message:`Failed to validate: `+e.message,severity:XG.warning}]}Hg(a,K(Ne))||(r(`validationErrors changed:`,a),V(Ne,a),V(I,function(e,t){var n;return t.forEach(t=>{n=eQ(e,n,t.path,(e,n)=>R(R({},n),{},{validationError:t}))}),t.forEach(t=>{for(var r=t.path;r.length>0;)r=Lg(r),n=eQ(e,n,r,(e,t)=>t.validationError?t:R(R({},t),{},{validationError:{isChildError:!0,path:r,message:`Contains invalid data`,severity:XG.warning}}))}),n}(e,K(Ne))))},e=>r(`validationErrors updated in ${e} ms`))}function Ie(){return r(`validate`),N?{parseError:N,isRepairable:!1}:(Fe(K(M),T(),C(),E()),Vg(K(Ne))?void 0:{validationErrors:K(Ne)})}function Le(){return K(M)}function Re(){return K(P)}function ze(){return K(F)}function Be(e){r(`applyExternalContent`,{updatedContent:e}),IG(e)?function(e){if(e!==void 0){var t=!Hg(K(M),e);if(r(`update external json`,{isChanged:t,currentlyText:K(M)===void 0}),t){var n={documentState:K(P),selection:K(F),json:K(M),text:K(he),textIsRepaired:K(Me)};V(M,e),V(P,Wq(e,K(P))),Ve(K(M)),V(he,void 0),V(Me,!1),N=void 0,He(K(M)),Ue(n)}}}(e.json):FG(e)&&function(e){if(!(e===void 0||IG(h()))){var t=e!==K(he);if(r(`update external text`,{isChanged:t}),t){var n={documentState:K(P),selection:K(F),json:K(M),text:K(he),textIsRepaired:K(Me)};try{V(M,w()(e)),V(P,Wq(K(M),K(P))),Ve(K(M)),V(he,e),V(Me,!1),N=void 0}catch(t){try{V(M,w()(Sl(e))),V(P,Wq(K(M),K(P))),Ve(K(M)),V(he,e),V(Me,!0),N=void 0,He(K(M))}catch{V(M,void 0),V(P,void 0),V(he,h().text),V(Me,!1),N=K(he)!==void 0&&K(he)!==``?MG(K(he),t.message||String(t)):void 0}}He(K(M)),Ue(n)}}}(e.text)}function Ve(e){ge||(ge=!0,V(P,dJ(e,K(P),[])))}function He(e){K(F)&&(hc(e,tY(K(F)))&&hc(e,eY(K(F)))||(r(`clearing selection: path does not exist anymore`,K(F)),V(F,jJ(e,K(P)))))}function Ue(e){if(e.json!==void 0||e.text!==void 0){var t=K(M)!==void 0&&e.json!==void 0;_().add({type:`tree`,undo:{patch:t?[{op:`replace`,path:``,value:e.json}]:void 0,json:e.json,text:e.text,documentState:e.documentState,textIsRepaired:e.textIsRepaired,selection:LJ(e.selection),sortedColumn:void 0},redo:{patch:t?[{op:`replace`,path:``,value:K(M)}]:void 0,json:K(M),text:K(he),documentState:K(P),textIsRepaired:K(Me),selection:LJ(K(F)),sortedColumn:void 0}})}}function We(e,t){if(r(`patch`,e,t),K(M)===void 0)throw Error(`Cannot apply patch: no JSON`);var n=K(M),i={json:void 0,text:K(he),documentState:K(P),selection:LJ(K(F)),textIsRepaired:K(Me),sortedColumn:void 0},a=_Y(K(M),e),o=Zq(K(M),K(P),e),s=MJ(K(M),e)??K(F),c=typeof t==`function`?t(o.json,o.documentState,s):void 0;return V(M,c?.json===void 0?o.json:c.json),V(P,c?.state===void 0?o.documentState:c.state),V(F,c?.selection===void 0?s:c.selection),V(he,void 0),V(Me,!1),V(be,void 0),V(xe,void 0),N=void 0,He(K(M)),_().add({type:`tree`,undo:R({patch:a},i),redo:{patch:e,json:void 0,text:K(he),documentState:K(P),selection:LJ(K(F)),sortedColumn:void 0,textIsRepaired:K(Me)}}),{json:K(M),previousJson:n,undo:a,redo:e}}function Ge(){!m()&&K(F)&&V(F,zJ(eY(K(F))))}function Ke(){if(!m()&&K(F)){var e=eY(K(F)),t=lc(K(M),e);cG(t)?function(e,t){r(`openJSONEditorModal`,{path:e,value:t}),pe=!0,fe()({content:{json:t},path:e,onPatch:K($t).onPatch,onClose:()=>{pe=!1,setTimeout(Yt)}})}(e,t):V(F,VJ(e))}}function qe(){if(!m()&&bJ(K(F))){var e=eY(K(F)),t=_c(e),n=lc(K(M),e),i=!oJ(K(M),K(P),e),a=i?String(n):_G(String(n),C());r(`handleToggleEnforceString`,{enforceString:i,value:n,updatedValue:a}),Ot([{op:`replace`,path:t,value:a}],(t,n)=>({state:tJ(K(M),n,e,{type:`value`,enforceString:i})}))}}function Je(){return K(Me)&&K(M)!==void 0&&kt(K(M)),K(M)===void 0?{text:K(he)||``}:{json:K(M)}}function Ye(){return Xe.apply(this,arguments)}function Xe(){return Xe=pz(function*(){var e=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];yield a1({json:K(M),selection:K(F),indentation:e?te():void 0,readOnly:m(),parser:C(),onPatch:Ot})}),Xe.apply(this,arguments)}function Ze(){return Qe.apply(this,arguments)}function Qe(){return Qe=pz(function*(){var e=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];K(M)!==void 0&&(yield s1({json:K(M),selection:K(F),indentation:e?te():void 0,parser:C()}))}),Qe.apply(this,arguments)}function $e(e){e.preventDefault(),nt(e.clipboardData?.getData(`text/plain`))}function et(){return tt.apply(this,arguments)}function tt(){return(tt=pz(function*(){try{nt(yield navigator.clipboard.readText())}catch(e){console.error(e),V(j,!0)}})).apply(this,arguments)}function nt(e){e!==void 0&&l1({clipboardText:e,json:K(M),selection:K(F),readOnly:m(),parser:C(),onPatch:Ot,onChangeText:At,onPasteMultilineText:Lt,openRepairModal:rt})}function rt(e,t){V(me,{text:e,onParse:e=>kG(e,e=>DG(e,C())),onRepair:AG,onApply:t,onClose:Yt})}function it(){u1({json:K(M),text:K(he),selection:K(F),keepSelection:!1,readOnly:m(),onChange:ne(),onPatch:Ot})}function at(){!m()&&K(M)!==void 0&&K(F)&&qJ&&!Vg(eY(K(F)))&&(r(`duplicate`,{selection:K(F)}),Ot(uY(K(M),TJ(K(M),K(F)))))}function ot(){m()||!K(F)||!xJ(K(F))&&!bJ(K(F))||Vg(eY(K(F)))||(r(`extract`,{selection:K(F)}),Ot(dY(K(M),K(F)),(e,t)=>{if(cG(e))return{state:fJ(e,t,[])}}))}function st(e){d1({insertType:e,selectInside:!0,initialValue:void 0,json:K(M),selection:K(F),readOnly:m(),parser:C(),onPatch:Ot,onReplaceJson:kt})}function ct(e){yJ(K(F))&&V(F,BJ(K(F).path)),K(F)||V(F,jJ(K(M),K(P))),st(e)}function lt(e){if(!m()&&K(F))if(JJ(K(F)))try{var t=tY(K(F)),n=lc(K(M),t),i=function(e,t,n){if(t===`array`){if(Array.isArray(e))return e;if(sG(e))return wG(e);if(typeof e==`string`)try{var r=n.parse(e);if(Array.isArray(r))return r;if(sG(r))return wG(r)}catch{return[e]}return[e]}if(t===`object`){if(Array.isArray(e))return CG(e);if(sG(e))return e;if(typeof e==`string`)try{var i=n.parse(e);if(sG(i))return i;if(Array.isArray(i))return CG(i)}catch{return{value:e}}return{value:e}}if(t===`value`)return cG(e)?n.stringify(e):e;throw Error(`Cannot convert ${mG(e,n)} to ${t}`)}(n,e,C());if(i===n)return;var a=[{op:`replace`,path:_c(t),value:i}];r(`handleConvert`,{selection:K(F),path:t,type:e,operations:a}),Ot(a,(e,t)=>({state:K(F)?dJ(e,t,eY(K(F))):K(P)}))}catch(e){D()(e)}else D()(Error(`Cannot convert current selection to ${e}`))}function ut(){if(K(F)){var e=kJ(K(M),K(P),K(F),!1),t=Lg(eY(K(F)));e&&!Vg(eY(e))&&Hg(t,Lg(eY(e)))?V(F,UJ(eY(e))):V(F,HJ(t)),r(`insert before`,{selection:K(F),selectionBefore:e,parentPath:t}),uV(),zt()}}function dt(){if(K(F)){var e=OJ(K(M),K(F));r(`insert after`,e),V(F,UJ(e)),uV(),zt()}}function ft(e){return pt.apply(this,arguments)}function pt(){return(pt=pz(function*(e){yield f1({char:e,selectInside:!0,json:K(M),selection:K(F),readOnly:m(),parser:C(),onPatch:Ot,onReplaceJson:kt,onSelect:_e})})).apply(this,arguments)}function mt(){if(!m()&&_().canUndo){var e=_().undo();if(Iq(e)){var t={json:K(M),text:K(he)};V(M,e.undo.patch?bc(K(M),e.undo.patch):e.undo.json),V(P,e.undo.documentState),V(F,e.undo.selection),V(he,e.undo.text),V(Me,e.undo.textIsRepaired),N=void 0,r(`undo`,{item:e,json:K(M),documentState:K(P),selection:K(F)}),Dt(t,e.undo.patch&&e.redo.patch?{json:K(M),previousJson:t.json,redo:e.undo.patch,undo:e.redo.patch}:void 0),Yt(),K(F)&&St(eY(K(F)),{scrollToWhenVisible:!1})}else ae()(e)}}function ht(){if(!m()&&_().canRedo){var e=_().redo();if(Iq(e)){var t={json:K(M),text:K(he)};V(M,e.redo.patch?bc(K(M),e.redo.patch):e.redo.json),V(P,e.redo.documentState),V(F,e.redo.selection),V(he,e.redo.text),V(Me,e.redo.textIsRepaired),N=void 0,r(`redo`,{item:e,json:K(M),documentState:K(P),selection:K(F)}),Dt(t,e.undo.patch&&e.redo.patch?{json:K(M),previousJson:t.json,redo:e.redo.patch,undo:e.undo.patch}:void 0),Yt(),K(F)&&St(eY(K(F)),{scrollToWhenVisible:!1})}else oe()(e)}}function gt(e){var t;m()||K(M)===void 0||(pe=!0,A()({id:a,json:K(M),rootPath:e,onSort:(t=pz(function*(t){var{operations:n}=t;r(`onSort`,e,n),Ot(n,(t,n)=>({state:fJ(t,n,e),selection:BJ(e)}))}),function(e){return t.apply(this,arguments)}),onClose:()=>{pe=!1,setTimeout(Yt)}}))}function _t(){K(F)&>(FJ(K(M),K(F)))}function vt(){gt([])}function yt(e){if(K(M)!==void 0){var{id:t,onTransform:n,onClose:i}=e,a=e.rootPath||[];pe=!0,de()({id:t||o,json:K(M),rootPath:a,onTransform:e=>{n?n({operations:e,json:K(M),transformedJson:bc(K(M),e)}):(r(`onTransform`,a,e),Ot(e,(e,t)=>({state:fJ(e,t,a),selection:BJ(a)})))},onClose:()=>{pe=!1,setTimeout(Yt),i&&i()}})}}function bt(){K(F)&&yt({rootPath:FJ(K(M),K(F))})}function xt(){yt({rootPath:[]})}function St(e){return Ct.apply(this,arguments)}function Ct(){return Ct=pz(function*(e){var{scrollToWhenVisible:t=!0,element:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};V(P,Jq(K(M),K(P),e,gJ));var i=n??wt(e);if(r(`scrollTo`,{path:e,elem:i,refContents:K(l)}),!i||!K(l))return Promise.resolve();var a=K(l).getBoundingClientRect(),o=i.getBoundingClientRect();if(!t&&o.bottom>a.top&&o.top<a.bottom)return Promise.resolve();var s=-a.height/4;return new Promise(e=>{p(i,{container:K(l),offset:s,duration:300,callback:()=>e()})})}),Ct.apply(this,arguments)}function wt(e){return uV(),K(l)?.querySelector(`div[data-path="${xK(e)}"]`)??void 0}function Tt(e){return uV(),K(l)?.querySelector(`span[data-search-result-index="${e}"]`)??void 0}function Et(e){var t=wt(e);if(t&&K(l)){var n=K(l).getBoundingClientRect(),r=t.getBoundingClientRect(),i=cG(lc(K(M),e))?20:r.height;r.top<n.top+20?p(t,{container:K(l),offset:-20,duration:0}):r.top+i>n.bottom-20&&p(t,{container:K(l),offset:-(n.height-i-20),duration:0})}}function Dt(e,t){if(e.json!==void 0||e?.text!==void 0){if(K(he)!==void 0){var n,r={text:K(he),json:void 0};(n=ne())==null||n(r,e,{contentErrors:Ie(),patchResult:t})}else if(K(M)!==void 0){var i,a={text:void 0,json:K(M)};(i=ne())==null||i(a,e,{contentErrors:Ie(),patchResult:t})}}}function Ot(e,t){r(`handlePatch`,e,t);var n={json:K(M),text:K(he)},i=We(e,t);return Dt(n,i),i}function kt(e,t){var n={json:K(M),text:K(he)},r={documentState:K(P),selection:K(F),json:K(M),text:K(he),textIsRepaired:K(Me)},i=Jq(K(M),Wq(e,K(P)),[],pJ),a=typeof t==`function`?t(e,i,K(F)):void 0;V(M,a?.json===void 0?e:a.json),V(P,a?.state===void 0?i:a.state),V(F,a?.selection===void 0?K(F):a.selection),V(he,void 0),V(Me,!1),N=void 0,He(K(M)),Ue(r),Dt(n,void 0)}function At(e,t){r(`handleChangeText`);var n={json:K(M),text:K(he)},i={documentState:K(P),selection:K(F),json:K(M),text:K(he),textIsRepaired:K(Me)};try{V(M,w()(e)),V(P,Jq(K(M),Wq(K(M),K(P)),[],pJ)),V(he,void 0),V(Me,!1),N=void 0}catch(t){try{V(M,w()(Sl(e))),V(P,Jq(K(M),Wq(K(M),K(P)),[],pJ)),V(he,e),V(Me,!0),N=void 0}catch{V(M,void 0),V(P,zq({json:K(M),expand:pJ})),V(he,e),V(Me,!1),N=K(he)===``?void 0:MG(K(he),t.message||String(t))}}if(typeof t==`function`){var a=t(K(M),K(P),K(F));V(M,a?.json===void 0?K(M):a.json),V(P,a?.state===void 0?K(P):a.state),V(F,a?.selection===void 0?K(F):a.selection)}He(K(M)),Ue(i),Dt(n,void 0)}function jt(e,t){var n=arguments.length>2&&arguments[2]!==void 0&&arguments[2];r(`handleExpand`,{path:e,expanded:t,recursive:n}),t?Ae(e,n?hJ:mJ):je(e,n),Yt()}function Mt(){jt([],!0,!0)}function Nt(){jt([],!1,!0)}function Pt(e){r(`openFind`,{findAndReplace:e}),V(Ce,!1),V(we,!1),uV(),V(Ce,!0),V(we,e)}function Ft(e,t){r(`handleExpandSection`,e,t),V(P,function(e,t,n,r){return nJ(e,t,n,(e,t)=>{if(!Mq(t))return t;var n=gq(t.visibleSections.concat(r));return R(R({},t),{},{visibleSections:n})})}(K(M),K(P),e,t))}function It(e){r(`pasted json as text`,e),V(be,e)}function Lt(e){r(`pasted multiline text`,{pastedText:e}),V(xe,e)}function Rt(e){var{anchor:t,left:n,top:r,width:i,height:a,offsetTop:o,offsetLeft:l,showTip:u}=e,d=function(e){var{json:t,documentState:n,selection:r,readOnly:i,onEditKey:a,onEditValue:o,onToggleEnforceString:s,onCut:c,onCopy:l,onPaste:u,onRemove:d,onDuplicate:f,onExtract:p,onInsertBefore:m,onInsert:h,onConvert:g,onInsertAfter:_,onSort:v,onTransform:y}=e,b=t!==void 0,x=!!r,S=!!r&&Vg(eY(r)),C=r?lc(t,eY(r)):void 0,w=Array.isArray(C)?`Edit array`:sG(C)?`Edit object`:`Edit value`,T=b&&(xJ(r)||yJ(r)||bJ(r)),E=r&&!S?lc(t,Lg(eY(r))):void 0,ee=!i&&b&&PJ(r)&&!S&&!Array.isArray(E),te=!i&&b&&r!==void 0&&PJ(r),D=te&&!cG(C),ne=!i&&T,re=T,ie=!i&&x,ae=!i&&b&&T&&!S,oe=!i&&b&&r!==void 0&&(xJ(r)||bJ(r))&&!S,O=T,k=O?`Convert to:`:`Insert:`,se=!i&&(vJ(r)&&Array.isArray(C)||_J(r)&&Array.isArray(E)),ce=!i&&(O?JJ(r)&&!sG(C):x),le=!i&&(O?JJ(r)&&!Array.isArray(C):x),ue=!i&&(O?JJ(r)&&cG(C):x),A=r!==void 0&&oJ(t,n,eY(r));function de(e){T?e!==`structure`&&g(e):h(e)}return[{type:`row`,items:[{type:`button`,onClick:()=>a(),icon:nv,text:`Edit key`,title:`Edit the key (Double-click on the key)`,disabled:!ee},{type:`dropdown-button`,main:{type:`button`,onClick:()=>o(),icon:nv,text:w,title:`Edit the value (Double-click on the value)`,disabled:!te},width:`11em`,items:[{type:`button`,icon:nv,text:w,title:`Edit the value (Double-click on the value)`,onClick:()=>o(),disabled:!te},{type:`button`,icon:A?G_:Z_,text:`Enforce string`,title:`Enforce keeping the value as string when it contains a numeric value`,onClick:()=>s(),disabled:!D}]}]},{type:`separator`},{type:`row`,items:[{type:`dropdown-button`,main:{type:`button`,onClick:()=>c(!0),icon:H_,text:`Cut`,title:`Cut selected contents, formatted with indentation (Ctrl+X)`,disabled:!ne},width:`10em`,items:[{type:`button`,icon:H_,text:`Cut formatted`,title:`Cut selected contents, formatted with indentation (Ctrl+X)`,onClick:()=>c(!0),disabled:!ne},{type:`button`,icon:H_,text:`Cut compacted`,title:`Cut selected contents, without indentation (Ctrl+Shift+X)`,onClick:()=>c(!1),disabled:!ne}]},{type:`dropdown-button`,main:{type:`button`,onClick:()=>l(!0),icon:hv,text:`Copy`,title:`Copy selected contents, formatted with indentation (Ctrl+C)`,disabled:!re},width:`12em`,items:[{type:`button`,icon:hv,text:`Copy formatted`,title:`Copy selected contents, formatted with indentation (Ctrl+C)`,onClick:()=>l(!0),disabled:!re},{type:`button`,icon:hv,text:`Copy compacted`,title:`Copy selected contents, without indentation (Ctrl+Shift+C)`,onClick:()=>l(!1),disabled:!re}]},{type:`button`,onClick:()=>u(),icon:B_,text:`Paste`,title:`Paste clipboard contents (Ctrl+V)`,disabled:!ie}]},{type:`separator`},{type:`row`,items:[{type:`column`,items:[{type:`button`,onClick:()=>f(),icon:Sv,text:`Duplicate`,title:`Duplicate selected contents (Ctrl+D)`,disabled:!ae},{type:`button`,onClick:()=>p(),icon:av,text:`Extract`,title:`Extract selected contents`,disabled:!oe},{type:`button`,onClick:()=>v(),icon:uv,text:`Sort`,title:`Sort array or object contents`,disabled:i||!T},{type:`button`,onClick:()=>y(),icon:Q_,text:`Transform`,title:`Transform array or object contents (filter, sort, project)`,disabled:i||!T},{type:`button`,onClick:()=>d(),icon:L_,text:`Remove`,title:`Remove selected contents (Delete)`,disabled:i||!T}]},{type:`column`,items:[{type:`label`,text:k},{type:`button`,onClick:()=>de(`structure`),icon:O?lv:gv,text:`Structure`,title:k+` structure like the first item in the array`,disabled:!se},{type:`button`,onClick:()=>de(`object`),icon:O?lv:gv,text:`Object`,title:k+` object`,disabled:!ce},{type:`button`,onClick:()=>de(`array`),icon:O?lv:gv,text:`Array`,title:k+` array`,disabled:!le},{type:`button`,onClick:()=>de(`value`),icon:O?lv:gv,text:`Value`,title:k+` value`,disabled:!ue}]}]},{type:`separator`},{type:`row`,items:[{type:`button`,onClick:()=>m(),icon:Y_,text:`Insert before`,title:`Select area before current entry to insert or paste contents`,disabled:i||!T||S},{type:`button`,onClick:()=>_(),icon:U_,text:`Insert after`,title:`Select area after current entry to insert or paste contents`,disabled:i||!T||S}]}]}({json:K(M),documentState:K(P),selection:K(F),readOnly:m(),onEditKey:Ge,onEditValue:Ke,onToggleEnforceString:qe,onCut:Ye,onCopy:Ze,onPaste:et,onRemove:it,onDuplicate:at,onExtract:ot,onInsertBefore:ut,onInsert:ct,onInsertAfter:dt,onConvert:lt,onSort:_t,onTransform:bt}),f=se()(d)??d;if(!1!==f){var p={left:n,top:r,offsetTop:o,offsetLeft:l,width:i,height:a,anchor:t,closeOnOuterClick:!0,onClose:()=>{pe=!1,Yt()}};pe=!0;var h=s(j1,{tip:u?`Tip: you can open this context menu via right-click or with Ctrl+Q`:void 0,items:f,onRequestClose:()=>c(h)},p)}}function zt(e){if(!KJ(K(F)))if(e&&(e.stopPropagation(),e.preventDefault()),e&&e.type===`contextmenu`&&e.target!==K(u))Rt({left:e.clientX,top:e.clientY,width:pq,height:fq,showTip:!1});else{var t=K(l)?.querySelector(`.jse-context-menu-pointer.jse-selected`);if(t)Rt({anchor:t,offsetTop:2,width:pq,height:fq,showTip:!1});else{var n=K(l)?.getBoundingClientRect();n&&Rt({top:n.top+2,left:n.left+2,width:pq,height:fq,showTip:!1})}}}function Bt(e){Rt({anchor:yK(e.target,`BUTTON`),offsetTop:0,width:pq,height:fq,showTip:!0})}function Vt(){return Ht.apply(this,arguments)}function Ht(){return(Ht=pz(function*(){if(r(`apply pasted json`,K(be)),K(be)){var{onPasteAsJson:e}=K(be);V(be,void 0),e(),setTimeout(Yt)}})).apply(this,arguments)}function Ut(){return Wt.apply(this,arguments)}function Wt(){return(Wt=pz(function*(){r(`apply pasted multiline text`,K(xe)),K(xe)&&(nt(JSON.stringify(K(xe))),setTimeout(Yt))})).apply(this,arguments)}function Gt(){r(`clear pasted json`),V(be,void 0),Yt()}function Kt(){r(`clear pasted multiline text`),V(xe,void 0),Yt()}function qt(){re()(qG.text)}function Jt(e){V(F,e),Yt(),St(eY(e))}function Yt(){r(`focus`),K(u)&&(K(u).focus(),K(u).select())}function Xt(e){return function(e,t,n){var r=Lg(n),i=[kg(n)],a=lc(e,r),o=a?uJ(a,t,i):void 0;return o?BJ(r.concat(o)):UJ(n)}(K(M),K(P),e)}function Zt(e){K(n)&&K(n).onDrag(e)}function Qt(){K(n)&&K(n).onDragEnd()}var $t=B(void 0,!0);W(()=>K(F),()=>{var e=K(F);Hg(e,g())||(r(`onSelect`,e),ie()(e))}),W(()=>(J(x()),J(S())),()=>{V(ye,tK({escapeControlCharacters:x(),escapeUnicodeCharacters:S()}))}),W(()=>K(Ce),()=>{(function(e){K(l)&&e&&K(l).scrollTop===0&&(iH(l,K(l).style.overflowAnchor=`none`),iH(l,K(l).scrollTop+=mq),setTimeout(()=>{K(l)&&iH(l,K(l).style.overflowAnchor=``)}))})(K(Ce))}),W(()=>J(h()),()=>{Be(h())}),W(()=>J(g()),()=>{(function(e){Hg(K(F),e)||(r(`applyExternalSelection`,{selection:K(F),externalSelection:e}),CJ(e)&&V(F,e))})(g())}),W(()=>(K(M),J(T()),J(C()),J(E())),()=>{Fe(K(M),T(),C(),E())}),W(()=>(K(l),JZ),()=>{V(n,K(l)?JZ(K(l)):void 0)}),W(()=>(J(m()),J(v()),J(C()),K(ye),J(O()),J(ce())),()=>{V($t,{mode:qG.tree,readOnly:m(),truncateTextSize:v(),parser:C(),normalization:K(ye),getJson:Le,getDocumentState:Re,getSelection:ze,findElement:wt,findNextInside:Xt,focus:Yt,onPatch:Ot,onInsert:st,onExpand:jt,onSelect:_e,onFind:Pt,onExpandSection:Ft,onPasteJson:It,onRenderValue:O(),onContextMenu:Rt,onClassName:ce()||(()=>{}),onDrag:Zt,onDragEnd:Qt})}),W(()=>K($t),()=>{r(`context changed`,K($t))}),DH();var en={expand:Ae,collapse:je,validate:Ie,getJson:Le,patch:We,acceptAutoRepair:Je,openTransformModal:yt,scrollTo:St,findElement:wt,findSearchResult:Tt,focus:Yt};GW(!0);var tn=B1();Y(`mousedown`,YV,function(e){!hK(e.target,e=>e===K(d))&&KJ(K(F))&&(r(`click outside the editor, exit edit mode`),V(F,LJ(K(F))),f&&K(u)&&(K(u).focus(),K(u).blur()),r(`blur (outside editor)`),K(u)&&K(u).blur())});var nn,rn=hH(tn),an=H(rn),on=e=>{(function(e,t){vB(t,!1);var n=B(void 0,!0),r=B(void 0,!0),i=B(void 0,!0),a=$(t,`json`,9),o=$(t,`selection`,9),s=$(t,`readOnly`,9),c=$(t,`showSearch`,13,!1),l=$(t,`history`,9),u=$(t,`onExpandAll`,9),d=$(t,`onCollapseAll`,9),f=$(t,`onUndo`,9),p=$(t,`onRedo`,9),m=$(t,`onSort`,9),h=$(t,`onTransform`,9),g=$(t,`onContextMenu`,9),_=$(t,`onCopy`,9),v=$(t,`onRenderMenu`,9);function y(){c(!c())}var b=B(void 0,!0),x=B(void 0,!0),S=B(void 0,!0),C=B(void 0,!0);W(()=>J(a()),()=>{V(n,a()!==void 0)}),W(()=>(K(n),J(o()),bJ),()=>{V(r,K(n)&&(xJ(o())||yJ(o())||bJ(o())))}),W(()=>(J(u()),J(a())),()=>{V(b,{type:`button`,icon:y$,title:`Expand all`,className:`jse-expand-all`,onClick:u(),disabled:!cG(a())})}),W(()=>(J(d()),J(a())),()=>{V(x,{type:`button`,icon:b$,title:`Collapse all`,className:`jse-collapse-all`,onClick:d(),disabled:!cG(a())})}),W(()=>J(a()),()=>{V(S,{type:`button`,icon:pv,title:`Search (Ctrl+F)`,className:`jse-search`,onClick:y,disabled:a()===void 0})}),W(()=>(J(s()),K(b),K(x),J(m()),J(a()),J(h()),K(S),J(g()),J(f()),J(l()),J(p()),J(_()),K(r)),()=>{V(C,s()?[K(b),K(x),{type:`separator`},{type:`button`,icon:hv,title:`Copy (Ctrl+C)`,className:`jse-copy`,onClick:_(),disabled:!K(r)},{type:`separator`},K(S),{type:`space`}]:[K(b),K(x),{type:`separator`},{type:`button`,icon:uv,title:`Sort`,className:`jse-sort`,onClick:m(),disabled:s()||a()===void 0},{type:`button`,icon:Q_,title:`Transform contents (filter, sort, project)`,className:`jse-transform`,onClick:h(),disabled:s()||a()===void 0},K(S),{type:`button`,icon:cv,title:oq,className:`jse-contextmenu`,onClick:g()},{type:`separator`},{type:`button`,icon:iv,title:`Undo (Ctrl+Z)`,className:`jse-undo`,onClick:f(),disabled:!l().canUndo},{type:`button`,icon:rv,title:`Redo (Ctrl+Shift+Z)`,className:`jse-redo`,onClick:p(),disabled:!l().canRedo},{type:`space`}])}),W(()=>(J(v()),K(C)),()=>{V(i,v()(K(C))||K(C))}),DH(),GW(!0),wQ(e,{get items(){return K(i)}}),yB()})(e,{get json(){return K(M)},get selection(){return K(F)},get readOnly(){return m()},get history(){return _()},onExpandAll:Mt,onCollapseAll:Nt,onUndo:mt,onRedo:ht,onSort:vt,onTransform:xt,onContextMenu:Bt,onCopy:Ze,get onRenderMenu(){return k()},get showSearch(){return K(Ce)},set showSearch(e){V(Ce,e)},$$legacy:!0})};Q(an,e=>{y()&&e(on)});var sn=U(an,2),cn=e=>{V$(e,{get json(){return K(M)},get selection(){return K(F)},onSelect:Jt,get onError(){return D()},get pathParser(){return ee()}})};Q(sn,e=>{b()&&e(cn)});var ln=U(sn,2),un=e=>{var t=R1(),n=hH(t),r=H(n);r.readOnly=!0,HW(r,e=>V(u,e),()=>K(u));var i=U(n,2),a=e=>{var t=kU(),n=hH(t),r=e=>{(function(e,t){function n(e){e.stopPropagation(),t.onCreateObject()}function r(e){e.stopPropagation(),t.onCreateArray()}vB(t,!0);var i=w$(),a=U(H(U(H(i),2)),2),o=e=>{var t=C$(),i=U(hH(t),2);jW(i,`title`,`Create an empty JSON object (press '{')`);var a=U(i,2);jW(a,`title`,`Create an empty JSON array (press '[')`),xU(`click`,i,n),xU(`click`,a,r),Z(e,t)};Q(a,e=>{t.readOnly||e(o)}),xU(`click`,i,()=>t.onClick()),Z(e,i),yB()})(e,{get readOnly(){return m()},onCreateObject:()=>{Yt(),ft(`{`)},onCreateArray:()=>{Yt(),ft(`[`)},onClick:()=>{Yt()}})},i=e=>{var t=F1(),n=hH(t),r=GV(()=>m()?[]:[{icon:$_,text:`Repair manually`,title:`Open the document in "code" mode and repair it manually`,onClick:qt}]);sQ(n,{type:`error`,message:`The loaded JSON document is invalid and could not be repaired automatically.`,get actions(){return K(r)}}),g1(U(n,2),{get text(){return K(he)},get json(){return K(M)},get indentation(){return te()},get parser(){return C()}}),Z(e,t)};Q(n,e=>{K(he)===``||K(he)===void 0?e(r):e(i,-1)}),Z(e,t)},o=e=>{var t=L1(),n=hH(t);G$(H(n),{get json(){return K(M)},get documentState(){return K(P)},get parser(){return C()},get showSearch(){return K(Ce)},get showReplace(){return K(we)},get readOnly(){return m()},columns:void 0,onSearch:Te,onFocus:Ee,onPatch:Ot,onClose:Oe});var r=U(n,2);jW(r,`data-jsoneditor-scrollable-contents`,!0);var i=H(r),a=e=>{Z(e,I1())};Q(i,e=>{K(Ce)&&e(a)}),v$(U(i,2),{get value(){return K(M)},pointer:``,get state(){return K(P)},get validationErrors(){return K(I)},get searchResults(){return K(Se)},get selection(){return K(F)},get context(){return K($t)},get onDragSelectionStart(){return Pu}}),HW(r,e=>V(l,e),()=>K(l));var o=U(r,2),s=e=>{var t=GV(()=>(K(be),q(()=>`You pasted a JSON ${Array.isArray(K(be).contents)?`array`:`object`} as text`))),n=GV(()=>[{icon:ev,text:`Paste as JSON instead`,title:`Replace the value with the pasted JSON`,onMouseDown:Vt},{text:`Leave as is`,title:`Keep the JSON embedded in the value`,onClick:Gt}]);sQ(e,{type:`info`,get message(){return K(t)},get actions(){return K(n)}})};Q(o,e=>{K(be)&&e(s)});var c=U(o,2),u=e=>{var t=GV(()=>[{icon:ev,text:`Paste as string instead`,title:`Paste the clipboard data as a single string value instead of an array`,onClick:Ut},{text:`Leave as is`,title:`Keep the pasted array`,onClick:Kt}]);sQ(e,{type:`info`,message:`Multiline text was pasted as array`,get actions(){return K(t)}})};Q(c,e=>{K(xe)&&e(u)});var d=U(c,2),f=e=>{var t=GV(()=>m()?[]:[{icon:Cv,text:`Ok`,title:`Accept the repaired document`,onClick:Je},{icon:$_,text:`Repair manually instead`,title:`Leave the document unchanged and repair it manually instead`,onClick:qt}]);sQ(e,{type:`success`,message:`The loaded JSON document was invalid but is successfully repaired.`,get actions(){return K(t)},onClose:Yt})};Q(d,e=>{K(Me)&&e(f)}),mQ(U(d,2),{get validationErrors(){return K(Ne)},selectError:ke}),Z(e,t)};Q(i,e=>{K(M)===void 0?e(a):e(o,-1)}),Y(`paste`,r,$e),Z(e,t)},dn=e=>{Z(e,z1())};Q(ln,e=>{i?e(dn,-1):e(un)}),HW(rn,e=>V(d,e),()=>K(d));var fn=U(rn,2),pn=e=>{yQ(e,{onClose:()=>V(j,!1)})};Q(fn,e=>{K(j)&&e(pn)});var mn=U(fn,2),hn=e=>{OQ(e,QW(()=>K(me),{onClose:()=>{var e;(e=K(me))==null||e.onClose(),V(me,void 0)}}))};return Q(mn,e=>{K(me)&&e(hn)}),G(()=>nn=_W(rn,1,`jse-tree-mode svelte-10mlrw4`,null,nn,{"no-main-menu":!y()})),Y(`keydown`,rn,function(e){var t=TK(e),n=e.shiftKey;if(r(`keydown`,{combo:t,key:e.key}),t===`Ctrl+X`&&(e.preventDefault(),Ye(!0)),t===`Ctrl+Shift+X`&&(e.preventDefault(),Ye(!1)),t===`Ctrl+C`&&(e.preventDefault(),Ze(!0)),t===`Ctrl+Shift+C`&&(e.preventDefault(),Ze(!1)),t===`Ctrl+D`&&(e.preventDefault(),at()),t!==`Delete`&&t!==`Backspace`||(e.preventDefault(),it()),t===`Insert`&&(e.preventDefault(),st(`structure`)),t===`Ctrl+A`&&(e.preventDefault(),V(F,BJ([]))),t===`Ctrl+Q`&&zt(e),t===`ArrowUp`||t===`Shift+ArrowUp`){e.preventDefault();var i=K(F)?kJ(K(M),K(P),K(F),n)||K(F):jJ(K(M),K(P));V(F,i),Et(eY(i))}if(t===`ArrowDown`||t===`Shift+ArrowDown`){e.preventDefault();var a=K(F)?function(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0&&arguments[3];if(n){var i=r?eY(n):OJ(e,n),a=cG(lc(e,i))?Yq(e,t,i,!0):t,o=uJ(e,t,i),s=uJ(e,a,i);if(r)return vJ(n)?o===void 0?void 0:WJ(o,o):_J(n)?s===void 0?void 0:WJ(s,s):s===void 0?void 0:WJ(tY(n),s);if(_J(n))return s===void 0?void 0:BJ(s);if(vJ(n)||bJ(n))return o===void 0?void 0:BJ(o);if(yJ(n)){if(o===void 0||o.length===0)return;var c=lc(e,Lg(o));return Array.isArray(c)?BJ(o):RJ(o)}return xJ(n)?s===void 0?o===void 0?void 0:BJ(o):BJ(s):void 0}}(K(M),K(P),K(F),n)||K(F):jJ(K(M),K(P));V(F,a),Et(eY(a))}if(t===`ArrowLeft`||t===`Shift+ArrowLeft`){e.preventDefault();var o=K(F)?function(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0&&arguments[3],i=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4];if(n){var{caret:a,previous:o}=AJ(e,t,n,i);if(r)return xJ(n)?void 0:WJ(n.path,n.path);if(a&&o)return YJ(o);var s=lc(e,Lg(eY(n)));return bJ(n)&&Array.isArray(s)?WJ(n.path,n.path):xJ(n)&&!Array.isArray(s)?RJ(n.focusPath):void 0}}(K(M),K(P),K(F),n,!m())||K(F):jJ(K(M),K(P));V(F,o),Et(eY(o))}if(t===`ArrowRight`||t===`Shift+ArrowRight`){e.preventDefault();var s=K(F)&&K(M)!==void 0?function(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0&&arguments[3],i=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4];if(n){var{caret:a,next:o}=AJ(e,t,n,i);return r?xJ(n)?void 0:WJ(n.path,n.path):a&&o?YJ(o):xJ(n)?BJ(n.focusPath):void 0}}(K(M),K(P),K(F),n,!m())||K(F):jJ(K(M),K(P));V(F,s),Et(eY(s))}if(t===`Enter`&&K(F)){if(SJ(K(F))){var c=K(F).focusPath,l=lc(K(M),Lg(c));Array.isArray(l)&&(e.preventDefault(),V(F,BJ(c)))}yJ(K(F))&&(e.preventDefault(),V(F,R(R({},K(F)),{},{edit:!0}))),bJ(K(F))&&(e.preventDefault(),cG(lc(K(M),K(F).path))?jt(K(F).path,!0):V(F,R(R({},K(F)),{},{edit:!0})))}if(t.replace(/^Shift\+/,``).length===1&&K(F))return e.preventDefault(),void ft(e.key);if(t===`Enter`&&(_J(K(F))||vJ(K(F))))return e.preventDefault(),void ft(``);if(t===`Ctrl+Enter`&&bJ(K(F))){var u=lc(K(M),K(F).path);gG(u)&&window.open(String(u),`_blank`)}t===`Escape`&&K(F)&&(e.preventDefault(),V(F,void 0)),t===`Ctrl+F`&&(e.preventDefault(),Pt(!1)),t===`Ctrl+H`&&(e.preventDefault(),Pt(!0)),t===`Ctrl+Z`&&(e.preventDefault(),mt()),t===`Ctrl+Shift+Z`&&(e.preventDefault(),ht())}),Y(`mousedown`,rn,function(e){r(`handleMouseDown`,e);var t=e.target;pK(t,`BUTTON`)||t.isContentEditable||(Yt(),K(F)||K(M)!==void 0||K(he)!==``&&K(he)!==void 0||(r(`createDefaultSelection`),V(F,BJ([]))))}),Y(`contextmenu`,rn,zt),Z(e,tn),BW(t,`expand`,Ae),BW(t,`collapse`,je),BW(t,`validate`,Ie),BW(t,`getJson`,Le),BW(t,`patch`,We),BW(t,`acceptAutoRepair`,Je),BW(t,`openTransformModal`,yt),BW(t,`scrollTo`,St),BW(t,`findElement`,wt),BW(t,`findSearchResult`,Tt),BW(t,`focus`,Yt),yB(en)}function H1(e){return typeof(t=e)!=`object`||t===null?e:new Proxy(e,{get:(e,t,n)=>H1(Reflect.get(e,t,n)),set:()=>!1,deleteProperty:()=>!1});var t}var U1=$W(`jsoneditor:History`);function W1(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.maxItems||1e3,n=[],r=0;function i(){return r<n.length}function a(){return r>0}function o(){return{canUndo:i(),canRedo:a(),items:()=>n.slice().reverse(),add:c,undo:u,redo:d,clear:l}}function s(){e.onChange&&e.onChange(o())}function c(e){U1(`add`,e),n=[e].concat(n.slice(r)).slice(0,t),r=0,s()}function l(){U1(`clear`),n=[],r=0,s()}function u(){if(i()){var e=n[r];return r+=1,U1(`undo`,e),s(),e}}function d(){if(a())return U1(`redo`,n[--r]),s(),n[r]}return{get:o}}OK(`/* over all fonts, sizes, and colors */
|
|
2830
2830
|
/* "consolas" for Windows, "menlo" for Mac with fallback to "monaco", 'Ubuntu Mono' for Ubuntu */
|
|
2831
2831
|
/* (at Mac this font looks too large at 14px, but 13px is too small for the font on Windows) */
|
|
2832
2832
|
/* main, menu, modal */
|
|
@@ -3032,7 +3032,7 @@ button.jse-context-menu-button.svelte-1y5l9l1 svg {
|
|
|
3032
3032
|
}
|
|
3033
3033
|
.jse-transform-modal-inner.svelte-lta8xm a:hover {
|
|
3034
3034
|
color: var(--jse-a-color-highlight, #0f508d);
|
|
3035
|
-
}`);var W1=qW(()=>YY),G1=qW(()=>XY),K1=X(`<div class="query-error svelte-lta8xm"> </div>`),q1=X(`<!> <!>`,1),J1=X(`<div class="jse-preview jse-error svelte-lta8xm"> </div>`),Y1=X(`<!> <div class="jse-modal-contents svelte-lta8xm"><div class="jse-main-contents svelte-lta8xm"><div class="jse-query-contents svelte-lta8xm"><div class="jse-label svelte-lta8xm"><div class="jse-label-inner svelte-lta8xm">Language</div></div> <div class="jse-description svelte-lta8xm"></div> <div class="jse-label svelte-lta8xm"><div class="jse-label-inner svelte-lta8xm">Path</div></div> <input class="jse-path svelte-lta8xm" type="text" readonly="" title="Selected path"/> <div class="jse-label svelte-lta8xm"><div class="jse-label-inner svelte-lta8xm"><button type="button" class="svelte-lta8xm"><!> Wizard</button></div></div> <!> <div class="jse-label svelte-lta8xm"><div class="jse-label-inner svelte-lta8xm">Query</div></div> <textarea class="jse-query svelte-lta8xm" spellcheck="false"></textarea></div> <div><div><div class="jse-label svelte-lta8xm"><div class="jse-label-inner svelte-lta8xm"><button type="button" class="svelte-lta8xm"><!> Original</button></div></div> <!></div> <div class="jse-preview-data svelte-lta8xm"><div class="jse-label svelte-lta8xm"><div class="jse-label-inner svelte-lta8xm">Preview</div></div> <!></div></div></div> <div class="jse-actions svelte-lta8xm"><button type="button" class="jse-primary svelte-lta8xm">Transform</button></div></div>`,1),X1=X(`<div class="jse-transform-modal-inner svelte-lta8xm"><!></div>`);function Z1(e,t){var n;vB(t,!1);var r=$W(`jsoneditor:TransformModal`),i=$(t,`id`,25,()=>`transform-modal-`+rG()),a=$(t,`json`,9),o=$(t,`rootPath`,25,()=>[]),s=$(t,`indentation`,9),c=$(t,`truncateTextSize`,9),l=$(t,`escapeControlCharacters`,9),u=$(t,`escapeUnicodeCharacters`,9),d=$(t,`parser`,9),f=$(t,`parseMemoizeOne`,9),p=$(t,`validationParser`,9),m=$(t,`pathParser`,9),h=$(t,`queryLanguages`,9),g=$(t,`queryLanguageId`,13),_=$(t,`onChangeQueryLanguage`,9),v=$(t,`onRenderValue`,9),y=$(t,`onRenderMenu`,9),b=$(t,`onRenderContextMenu`,9),x=$(t,`onClassName`,9),S=$(t,`onTransform`,9),C=$(t,`onClose`,9),w=B(void 0,!0),T=B(U1({onChange:e=>V(T,e)}).get(),!0),E=B(void 0,!0),ee=B(void 0,!0),te=B(!1,!0),D=`${i()}:${_c(o())}`,ne=W1()[D]??{},re=B(!1!==G1().showWizard,!0),ie=B(!1!==G1().showOriginal,!0),ae=B(ne.queryOptions??{},!0),oe=B(g()===ne.queryLanguageId&&ne.query?ne.query:``,!0),O=B((n=ne.isManual)!=null&&n,!0),k=B(void 0,!0),se=B(void 0,!0),ce=B({text:``},!0);function le(e){return h().find(t=>t.id===e)??h()[0]}function ue(e){try{V(ae,e),V(oe,le(g()).createQuery(K(E),e)),V(k,void 0),V(O,!1),r(`updateQueryByWizard`,{queryOptions:K(ae),query:K(oe),isManual:K(O)})}catch(e){V(k,String(e))}}function A(e){V(oe,e.target.value),V(O,!0),r(`handleChangeQuery`,{query:K(oe),isManual:K(O)})}K(O)||ue(K(ae)),KU(()=>{var e;(e=K(w))==null||e.focus()});var de=Cg(function(e,t){if(e===void 0)return V(ce,{text:``}),void V(se,`Error: No JSON`);if(t.trim()!==``)try{r(`previewTransform`,{query:t}),V(ce,{json:le(g()).executeQuery(e,t,d())}),V(se,void 0)}catch(e){V(ce,{text:``}),V(se,String(e))}else V(ce,{json:e})},300);function fe(){if(K(E)===void 0)return V(ce,{text:``}),void V(se,`Error: No JSON`);try{r(`handleTransform`,{query:K(oe)});var e=le(g()).executeQuery(K(E),K(oe),d());S()([{op:`replace`,path:_c(o()),value:e}]),C()()}catch(e){console.error(e),V(ce,{text:``}),V(se,String(e))}}function pe(){V(re,!K(re)),G1(G1().showWizard=K(re))}function j(){V(ie,!K(ie)),G1(G1().showOriginal=K(ie))}function me(e){e.focus()}function M(e){r(`handleChangeQueryLanguage`,e),g(e),_()(e),ue(K(ae))}function he(){K(te)?V(te,!K(te)):C()()}W(()=>(J(a()),J(o())),()=>{V(E,V1(lc(a(),o())))}),W(()=>K(E),()=>{V(ee,K(E)?{json:K(E)}:{text:``})}),W(()=>(K(E),K(oe)),()=>{de(K(E),K(oe))}),W(()=>(W1(),K(ae),K(oe),J(g()),K(O)),()=>{W1(W1()[D]={queryOptions:K(ae),query:K(oe),queryLanguageId:g(),isManual:K(O)}),r(`store state in memory`,D,W1()[D])}),DH(),GW(!0),gQ(e,{get onClose(){return C()},className:`jse-transform-modal`,get fullscreen(){return K(te)},children:(e,t)=>{var n=X1();NK(H(n),{children:(e,t)=>{var n=Y1(),r=hH(n);(function(e,t){vB(t,!1);var n,r=$(t,`queryLanguages`,9),i=$(t,`queryLanguageId`,9),a=$(t,`fullscreen`,13),o=$(t,`onChangeQueryLanguage`,9),s=$(t,`onClose`,9),c=B(void 0,!0),{openAbsolutePopup:l,closeAbsolutePopup:u}=_B(`absolute-popup`);function d(){n=l(HZ,{queryLanguages:r(),queryLanguageId:i(),onChangeQueryLanguage:e=>{u(n),o()(e)}},{offsetTop:-2,offsetLeft:0,anchor:K(c),closeOnOuterClick:!0})}GW(!0),GZ(e,{title:`Transform`,fullScreenButton:!0,get onClose(){return s()},get fullscreen(){return a()},set fullscreen(e){a(e)},$$slots:{actions:(e,t)=>{var n,i=KZ();GK(H(i),{get data(){return ov}}),HW(i,e=>V(c,e),()=>K(c)),G(()=>n=_W(i,1,`jse-config svelte-5gkegr`,null,n,{hide:r().length<=1})),Y(`click`,i,d),Z(e,i)}},$$legacy:!0}),yB()})(r,{get queryLanguages(){return h()},get queryLanguageId(){return g()},onChangeQueryLanguage:M,get onClose(){return C()},get fullscreen(){return K(te)},set fullscreen(e){V(te,e)},$$legacy:!0});var i=H(U(r,2)),a=H(i),_=U(H(a),2);sW(_,()=>(J(g()),q(()=>le(g()).description)),!0);var S=U(_,4),D=U(S,2),ne=H(H(D)),O=H(ne),de=GV(()=>K(re)?sv:z_);GK(O,{get data(){return K(de)}});var he=U(D,2),N=e=>{var t=kU(),n=hH(t),r=e=>{var t=q1(),n=hH(t);zZ(n,{get queryOptions(){return K(ae)},get json(){return K(E)},onChange:ue});var r=U(n,2),i=e=>{var t=K1(),n=H(t);G(()=>PU(n,K(k))),Z(e,t)};Q(r,e=>{K(k)&&e(i)}),Z(e,t)},i=WV(()=>(K(E),q(()=>Array.isArray(K(E))))),a=e=>{Z(e,OU(`(Only available for arrays, not for objects)`))};Q(n,e=>{K(i)?e(r):e(a,-1)}),Z(e,t)};Q(he,e=>{K(re)&&e(N)});var ge=U(he,4);HW(ge,e=>V(w,e),()=>K(w));var P,F,_e=U(a,2),ve=H(_e),ye=H(ve),be=H(H(ye)),xe=H(be),Se=GV(()=>K(ie)?sv:z_);GK(xe,{get data(){return K(Se)}});var Ce=U(ye,2),we=e=>{B1(e,{get externalContent(){return K(ee)},externalSelection:void 0,get history(){return K(T)},readOnly:!0,get truncateTextSize(){return c()},mainMenuBar:!1,navigationBar:!1,get indentation(){return s()},get escapeControlCharacters(){return l()},get escapeUnicodeCharacters(){return u()},get parser(){return d()},get parseMemoizeOne(){return f()},get onRenderValue(){return v()},get onRenderMenu(){return y()},get onRenderContextMenu(){return b()},onError:q(()=>console.error),get onChange(){return ju},get onChangeMode(){return ju},get onSelect(){return ju},get onUndo(){return ju},get onRedo(){return ju},get onFocus(){return ju},get onBlur(){return ju},get onSortModal(){return ju},get onTransformModal(){return ju},get onJSONEditorModal(){return ju},get onClassName(){return x()},validator:void 0,get validationParser(){return p()},get pathParser(){return m()}})};Q(Ce,e=>{K(ie)&&e(we)});var Te=U(H(U(ve,2)),2),Ee=e=>{B1(e,{get externalContent(){return K(ce)},externalSelection:void 0,get history(){return K(T)},readOnly:!0,get truncateTextSize(){return c()},mainMenuBar:!1,navigationBar:!1,get indentation(){return s()},get escapeControlCharacters(){return l()},get escapeUnicodeCharacters(){return u()},get parser(){return d()},get parseMemoizeOne(){return f()},get onRenderValue(){return v()},get onRenderMenu(){return y()},get onRenderContextMenu(){return b()},onError:q(()=>console.error),get onChange(){return ju},get onChangeMode(){return ju},get onSelect(){return ju},get onUndo(){return ju},get onRedo(){return ju},get onFocus(){return ju},get onBlur(){return ju},get onSortModal(){return ju},get onTransformModal(){return ju},get onJSONEditorModal(){return ju},get onClassName(){return x()},validator:void 0,get validationParser(){return p()},get pathParser(){return m()}})},De=e=>{var t=J1(),n=H(t);G(()=>PU(n,K(se))),Z(e,t)};Q(Te,e=>{K(se)?e(De,-1):e(Ee)});var Oe=H(U(i,2));EH(()=>Y(`click`,Oe,fe)),uW(Oe,e=>me?.(e)),G(e=>{AW(S,e),AW(ge,K(oe)),P=_W(_e,1,`jse-data-contents svelte-lta8xm`,null,P,{"jse-hide-original-data":!K(ie)}),F=_W(ve,1,`jse-original-data svelte-lta8xm`,null,F,{"jse-hide":!K(ie)}),Oe.disabled=!!K(se)},[()=>(J(Bg),J(o()),J(GY),q(()=>Bg(o())?`(document root)`:GY(o())))]),Y(`click`,ne,pe),Y(`input`,ge,A),Y(`click`,be,j),Z(e,n)},$$slots:{default:!0}}),uW(n,(e,t)=>mQ?.(e,t),()=>he),Z(e,n)},$$slots:{default:!0}}),yB()}function Q1(){}var $1=0,e0=class{constructor(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.id=$1++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw Error(`This node type doesn't define a deserialize function`)}),this.combine=e.combine||null}add(e){if(this.perNode)throw RangeError(`Can't add per-node props to node types`);return typeof e!=`function`&&(e=r0.match(e)),t=>{var n=e(t);return n===void 0?null:[this,n]}}};e0.closedBy=new e0({deserialize:e=>e.split(` `)}),e0.openedBy=new e0({deserialize:e=>e.split(` `)}),e0.group=new e0({deserialize:e=>e.split(` `)}),e0.isolate=new e0({deserialize:e=>{if(e&&e!=`rtl`&&e!=`ltr`&&e!=`auto`)throw RangeError(`Invalid value for isolate: `+e);return e||`auto`}}),e0.contextHash=new e0({perNode:!0}),e0.lookAhead=new e0({perNode:!0}),e0.mounted=new e0({perNode:!0});var t0,n0=Object.create(null),r0=class e{constructor(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;this.name=e,this.props=t,this.id=n,this.flags=r}static define(t){var n=t.props&&t.props.length?Object.create(null):n0,r=!!t.top|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),i=new e(t.name||``,n,t.id,r);if(t.props){for(var a of t.props)if(Array.isArray(a)||(a=a(i)),a){if(a[0].perNode)throw RangeError(`Can't store a per-node prop on a node type`);n[a[0].id]=a[1]}}return i}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(typeof e==`string`){if(this.name==e)return!0;var t=this.prop(e0.group);return!!t&&t.indexOf(e)>-1}return this.id==e}static match(e){var t=Object.create(null);for(var n in e)for(var r of n.split(` `))t[r]=e[n];return e=>{for(var n=e.prop(e0.group),r=-1;r<(n?n.length:0);r++){var i=t[r<0?e.name:n[r]];if(i)return i}}}};r0.none=new r0(``,Object.create(null),0,8),function(e){e[e.ExcludeBuffers=1]=`ExcludeBuffers`,e[e.IncludeAnonymous=2]=`IncludeAnonymous`,e[e.IgnoreMounts=4]=`IgnoreMounts`,e[e.IgnoreOverlays=8]=`IgnoreOverlays`,e[e.EnterBracketed=16]=`EnterBracketed`}(t0||={}),new e0({perNode:!0}),OK(`/* over all fonts, sizes, and colors */
|
|
3035
|
+
}`);var G1=qW(()=>YY),K1=qW(()=>XY),q1=X(`<div class="query-error svelte-lta8xm"> </div>`),J1=X(`<!> <!>`,1),Y1=X(`<div class="jse-preview jse-error svelte-lta8xm"> </div>`),X1=X(`<!> <div class="jse-modal-contents svelte-lta8xm"><div class="jse-main-contents svelte-lta8xm"><div class="jse-query-contents svelte-lta8xm"><div class="jse-label svelte-lta8xm"><div class="jse-label-inner svelte-lta8xm">Language</div></div> <div class="jse-description svelte-lta8xm"></div> <div class="jse-label svelte-lta8xm"><div class="jse-label-inner svelte-lta8xm">Path</div></div> <input class="jse-path svelte-lta8xm" type="text" readonly="" title="Selected path"/> <div class="jse-label svelte-lta8xm"><div class="jse-label-inner svelte-lta8xm"><button type="button" class="svelte-lta8xm"><!> Wizard</button></div></div> <!> <div class="jse-label svelte-lta8xm"><div class="jse-label-inner svelte-lta8xm">Query</div></div> <textarea class="jse-query svelte-lta8xm" spellcheck="false"></textarea></div> <div><div><div class="jse-label svelte-lta8xm"><div class="jse-label-inner svelte-lta8xm"><button type="button" class="svelte-lta8xm"><!> Original</button></div></div> <!></div> <div class="jse-preview-data svelte-lta8xm"><div class="jse-label svelte-lta8xm"><div class="jse-label-inner svelte-lta8xm">Preview</div></div> <!></div></div></div> <div class="jse-actions svelte-lta8xm"><button type="button" class="jse-primary svelte-lta8xm">Transform</button></div></div>`,1),Z1=X(`<div class="jse-transform-modal-inner svelte-lta8xm"><!></div>`);function Q1(e,t){var n;vB(t,!1);var r=$W(`jsoneditor:TransformModal`),i=$(t,`id`,25,()=>`transform-modal-`+rG()),a=$(t,`json`,9),o=$(t,`rootPath`,25,()=>[]),s=$(t,`indentation`,9),c=$(t,`truncateTextSize`,9),l=$(t,`escapeControlCharacters`,9),u=$(t,`escapeUnicodeCharacters`,9),d=$(t,`parser`,9),f=$(t,`parseMemoizeOne`,9),p=$(t,`validationParser`,9),m=$(t,`pathParser`,9),h=$(t,`queryLanguages`,9),g=$(t,`queryLanguageId`,13),_=$(t,`onChangeQueryLanguage`,9),v=$(t,`onRenderValue`,9),y=$(t,`onRenderMenu`,9),b=$(t,`onRenderContextMenu`,9),x=$(t,`onClassName`,9),S=$(t,`onTransform`,9),C=$(t,`onClose`,9),w=B(void 0,!0),T=B(W1({onChange:e=>V(T,e)}).get(),!0),E=B(void 0,!0),ee=B(void 0,!0),te=B(!1,!0),D=`${i()}:${_c(o())}`,ne=G1()[D]??{},re=B(!1!==K1().showWizard,!0),ie=B(!1!==K1().showOriginal,!0),ae=B(ne.queryOptions??{},!0),oe=B(g()===ne.queryLanguageId&&ne.query?ne.query:``,!0),O=B((n=ne.isManual)!=null&&n,!0),k=B(void 0,!0),se=B(void 0,!0),ce=B({text:``},!0);function le(e){return h().find(t=>t.id===e)??h()[0]}function ue(e){try{V(ae,e),V(oe,le(g()).createQuery(K(E),e)),V(k,void 0),V(O,!1),r(`updateQueryByWizard`,{queryOptions:K(ae),query:K(oe),isManual:K(O)})}catch(e){V(k,String(e))}}function A(e){V(oe,e.target.value),V(O,!0),r(`handleChangeQuery`,{query:K(oe),isManual:K(O)})}K(O)||ue(K(ae)),KU(()=>{var e;(e=K(w))==null||e.focus()});var de=Og(function(e,t){if(e===void 0)return V(ce,{text:``}),void V(se,`Error: No JSON`);if(t.trim()!==``)try{r(`previewTransform`,{query:t}),V(ce,{json:le(g()).executeQuery(e,t,d())}),V(se,void 0)}catch(e){V(ce,{text:``}),V(se,String(e))}else V(ce,{json:e})},300);function fe(){if(K(E)===void 0)return V(ce,{text:``}),void V(se,`Error: No JSON`);try{r(`handleTransform`,{query:K(oe)});var e=le(g()).executeQuery(K(E),K(oe),d());S()([{op:`replace`,path:_c(o()),value:e}]),C()()}catch(e){console.error(e),V(ce,{text:``}),V(se,String(e))}}function pe(){V(re,!K(re)),K1(K1().showWizard=K(re))}function j(){V(ie,!K(ie)),K1(K1().showOriginal=K(ie))}function me(e){e.focus()}function M(e){r(`handleChangeQueryLanguage`,e),g(e),_()(e),ue(K(ae))}function he(){K(te)?V(te,!K(te)):C()()}W(()=>(J(a()),J(o())),()=>{V(E,H1(lc(a(),o())))}),W(()=>K(E),()=>{V(ee,K(E)?{json:K(E)}:{text:``})}),W(()=>(K(E),K(oe)),()=>{de(K(E),K(oe))}),W(()=>(G1(),K(ae),K(oe),J(g()),K(O)),()=>{G1(G1()[D]={queryOptions:K(ae),query:K(oe),queryLanguageId:g(),isManual:K(O)}),r(`store state in memory`,D,G1()[D])}),DH(),GW(!0),_Q(e,{get onClose(){return C()},className:`jse-transform-modal`,get fullscreen(){return K(te)},children:(e,t)=>{var n=Z1();NK(H(n),{children:(e,t)=>{var n=X1(),r=hH(n);(function(e,t){vB(t,!1);var n,r=$(t,`queryLanguages`,9),i=$(t,`queryLanguageId`,9),a=$(t,`fullscreen`,13),o=$(t,`onChangeQueryLanguage`,9),s=$(t,`onClose`,9),c=B(void 0,!0),{openAbsolutePopup:l,closeAbsolutePopup:u}=_B(`absolute-popup`);function d(){n=l(HZ,{queryLanguages:r(),queryLanguageId:i(),onChangeQueryLanguage:e=>{u(n),o()(e)}},{offsetTop:-2,offsetLeft:0,anchor:K(c),closeOnOuterClick:!0})}GW(!0),GZ(e,{title:`Transform`,fullScreenButton:!0,get onClose(){return s()},get fullscreen(){return a()},set fullscreen(e){a(e)},$$slots:{actions:(e,t)=>{var n,i=KZ();GK(H(i),{get data(){return ov}}),HW(i,e=>V(c,e),()=>K(c)),G(()=>n=_W(i,1,`jse-config svelte-5gkegr`,null,n,{hide:r().length<=1})),Y(`click`,i,d),Z(e,i)}},$$legacy:!0}),yB()})(r,{get queryLanguages(){return h()},get queryLanguageId(){return g()},onChangeQueryLanguage:M,get onClose(){return C()},get fullscreen(){return K(te)},set fullscreen(e){V(te,e)},$$legacy:!0});var i=H(U(r,2)),a=H(i),_=U(H(a),2);sW(_,()=>(J(g()),q(()=>le(g()).description)),!0);var S=U(_,4),D=U(S,2),ne=H(H(D)),O=H(ne),de=GV(()=>K(re)?sv:z_);GK(O,{get data(){return K(de)}});var he=U(D,2),N=e=>{var t=kU(),n=hH(t),r=e=>{var t=J1(),n=hH(t);zZ(n,{get queryOptions(){return K(ae)},get json(){return K(E)},onChange:ue});var r=U(n,2),i=e=>{var t=q1(),n=H(t);G(()=>PU(n,K(k))),Z(e,t)};Q(r,e=>{K(k)&&e(i)}),Z(e,t)},i=WV(()=>(K(E),q(()=>Array.isArray(K(E))))),a=e=>{Z(e,OU(`(Only available for arrays, not for objects)`))};Q(n,e=>{K(i)?e(r):e(a,-1)}),Z(e,t)};Q(he,e=>{K(re)&&e(N)});var ge=U(he,4);HW(ge,e=>V(w,e),()=>K(w));var P,F,_e=U(a,2),ve=H(_e),ye=H(ve),be=H(H(ye)),xe=H(be),Se=GV(()=>K(ie)?sv:z_);GK(xe,{get data(){return K(Se)}});var Ce=U(ye,2),we=e=>{V1(e,{get externalContent(){return K(ee)},externalSelection:void 0,get history(){return K(T)},readOnly:!0,get truncateTextSize(){return c()},mainMenuBar:!1,navigationBar:!1,get indentation(){return s()},get escapeControlCharacters(){return l()},get escapeUnicodeCharacters(){return u()},get parser(){return d()},get parseMemoizeOne(){return f()},get onRenderValue(){return v()},get onRenderMenu(){return y()},get onRenderContextMenu(){return b()},onError:q(()=>console.error),get onChange(){return Pu},get onChangeMode(){return Pu},get onSelect(){return Pu},get onUndo(){return Pu},get onRedo(){return Pu},get onFocus(){return Pu},get onBlur(){return Pu},get onSortModal(){return Pu},get onTransformModal(){return Pu},get onJSONEditorModal(){return Pu},get onClassName(){return x()},validator:void 0,get validationParser(){return p()},get pathParser(){return m()}})};Q(Ce,e=>{K(ie)&&e(we)});var Te=U(H(U(ve,2)),2),Ee=e=>{V1(e,{get externalContent(){return K(ce)},externalSelection:void 0,get history(){return K(T)},readOnly:!0,get truncateTextSize(){return c()},mainMenuBar:!1,navigationBar:!1,get indentation(){return s()},get escapeControlCharacters(){return l()},get escapeUnicodeCharacters(){return u()},get parser(){return d()},get parseMemoizeOne(){return f()},get onRenderValue(){return v()},get onRenderMenu(){return y()},get onRenderContextMenu(){return b()},onError:q(()=>console.error),get onChange(){return Pu},get onChangeMode(){return Pu},get onSelect(){return Pu},get onUndo(){return Pu},get onRedo(){return Pu},get onFocus(){return Pu},get onBlur(){return Pu},get onSortModal(){return Pu},get onTransformModal(){return Pu},get onJSONEditorModal(){return Pu},get onClassName(){return x()},validator:void 0,get validationParser(){return p()},get pathParser(){return m()}})},De=e=>{var t=Y1(),n=H(t);G(()=>PU(n,K(se))),Z(e,t)};Q(Te,e=>{K(se)?e(De,-1):e(Ee)});var Oe=H(U(i,2));EH(()=>Y(`click`,Oe,fe)),uW(Oe,e=>me?.(e)),G(e=>{AW(S,e),AW(ge,K(oe)),P=_W(_e,1,`jse-data-contents svelte-lta8xm`,null,P,{"jse-hide-original-data":!K(ie)}),F=_W(ve,1,`jse-original-data svelte-lta8xm`,null,F,{"jse-hide":!K(ie)}),Oe.disabled=!!K(se)},[()=>(J(Vg),J(o()),J(GY),q(()=>Vg(o())?`(document root)`:GY(o())))]),Y(`click`,ne,pe),Y(`input`,ge,A),Y(`click`,be,j),Z(e,n)},$$slots:{default:!0}}),uW(n,(e,t)=>hQ?.(e,t),()=>he),Z(e,n)},$$slots:{default:!0}}),yB()}function $1(){}var e0=0,t0=class{constructor(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.id=e0++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw Error(`This node type doesn't define a deserialize function`)}),this.combine=e.combine||null}add(e){if(this.perNode)throw RangeError(`Can't add per-node props to node types`);return typeof e!=`function`&&(e=i0.match(e)),t=>{var n=e(t);return n===void 0?null:[this,n]}}};t0.closedBy=new t0({deserialize:e=>e.split(` `)}),t0.openedBy=new t0({deserialize:e=>e.split(` `)}),t0.group=new t0({deserialize:e=>e.split(` `)}),t0.isolate=new t0({deserialize:e=>{if(e&&e!=`rtl`&&e!=`ltr`&&e!=`auto`)throw RangeError(`Invalid value for isolate: `+e);return e||`auto`}}),t0.contextHash=new t0({perNode:!0}),t0.lookAhead=new t0({perNode:!0}),t0.mounted=new t0({perNode:!0});var n0,r0=Object.create(null),i0=class e{constructor(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;this.name=e,this.props=t,this.id=n,this.flags=r}static define(t){var n=t.props&&t.props.length?Object.create(null):r0,r=!!t.top|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),i=new e(t.name||``,n,t.id,r);if(t.props){for(var a of t.props)if(Array.isArray(a)||(a=a(i)),a){if(a[0].perNode)throw RangeError(`Can't store a per-node prop on a node type`);n[a[0].id]=a[1]}}return i}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(typeof e==`string`){if(this.name==e)return!0;var t=this.prop(t0.group);return!!t&&t.indexOf(e)>-1}return this.id==e}static match(e){var t=Object.create(null);for(var n in e)for(var r of n.split(` `))t[r]=e[n];return e=>{for(var n=e.prop(t0.group),r=-1;r<(n?n.length:0);r++){var i=t[r<0?e.name:n[r]];if(i)return i}}}};i0.none=new i0(``,Object.create(null),0,8),function(e){e[e.ExcludeBuffers=1]=`ExcludeBuffers`,e[e.IncludeAnonymous=2]=`IncludeAnonymous`,e[e.IgnoreMounts=4]=`IgnoreMounts`,e[e.IgnoreOverlays=8]=`IgnoreOverlays`,e[e.EnterBracketed=16]=`EnterBracketed`}(n0||={}),new t0({perNode:!0}),OK(`/* over all fonts, sizes, and colors */
|
|
3036
3036
|
/* "consolas" for Windows, "menlo" for Mac with fallback to "monaco", 'Ubuntu Mono' for Ubuntu */
|
|
3037
3037
|
/* (at Mac this font looks too large at 14px, but 13px is too small for the font on Windows) */
|
|
3038
3038
|
/* main, menu, modal */
|
|
@@ -3068,7 +3068,7 @@ button.jse-context-menu-button.svelte-1y5l9l1 svg {
|
|
|
3068
3068
|
}
|
|
3069
3069
|
.jse-status-bar.svelte-1pmgv9j .jse-status-bar-info:where(.svelte-1pmgv9j) {
|
|
3070
3070
|
padding: 2px;
|
|
3071
|
-
}`);var
|
|
3071
|
+
}`);var a0=X(`<div class="jse-status-bar-info svelte-1pmgv9j"> </div>`),o0=X(`<div class="jse-status-bar-info svelte-1pmgv9j"> </div>`),s0=X(`<div class="jse-status-bar-info svelte-1pmgv9j"> </div>`),c0=X(`<div class="jse-status-bar svelte-1pmgv9j"><!> <!> <!></div>`),l0=sM.define([{tag:qA.propertyName,color:`var(--internal-key-color)`},{tag:qA.number,color:`var(--internal-value-color-number)`},{tag:qA.bool,color:`var(--internal-value-color-boolean)`},{tag:qA.string,color:`var(--internal-value-color-string)`},{tag:qA.keyword,color:`var(--internal-value-color-null)`}]),u0=dM(l0),d0=l0.style;l0.style=e=>d0(e||[]);var f0=[Yw.fromClass(class{constructor(e){this.view=e,this.indentUnit=mj(e.state),this.initialPaddingLeft=null,this.isChrome=window==null?void 0:window.navigator.userAgent.includes(`Chrome`),this.generate(e.state)}update(e){var t=mj(e.state);(t!==this.indentUnit||e.docChanged||e.viewportChanged)&&(this.indentUnit=t,this.generate(e.state))}generate(e){var t=new pS;this.initialPaddingLeft?this.addStyleToBuilder(t,e,this.initialPaddingLeft):this.view.requestMeasure({read:e=>{var n=e.contentDOM.querySelector(`.cm-line`);n&&(this.initialPaddingLeft=window.getComputedStyle(n).getPropertyValue(`padding-left`),this.addStyleToBuilder(t,e.state,this.initialPaddingLeft)),this.decorations=t.finish()}}),this.decorations=t.finish()}addStyleToBuilder(e,t,n){for(var r of this.getVisibleLines(t)){var{numColumns:i,containsTab:a}=this.numColumns(r.text,t.tabSize),o=`calc(${i+this.indentUnit}ch + ${n})`,s=this.isChrome?`calc(-${i+this.indentUnit}ch - ${+!!a}px)`:`-${i+this.indentUnit}ch`;e.add(r.from,r.from,JC.line({attributes:{style:`padding-left: ${o}; text-indent: ${s};`}}))}}getVisibleLines(e){var t=new Set,n=null;for(var{from:r,to:i}of this.view.visibleRanges)for(var a=r;a<=i;){var o=e.doc.lineAt(a);n!==o&&(t.add(o),n=o),a=o.to+1}return t}numColumns(e,t){var n=0,r=!1;e:for(var i=0;i<e.length;i++)switch(e[i]){case` `:n+=1;continue e;case` `:n+=t-n%t,r=!0;continue e;case`\r`:continue e;default:break e}return{numColumns:n,containsTab:r}}},{decorations:e=>e.decorations})];OK(`/* over all fonts, sizes, and colors */
|
|
3072
3072
|
/* "consolas" for Windows, "menlo" for Mac with fallback to "monaco", 'Ubuntu Mono' for Ubuntu */
|
|
3073
3073
|
/* (at Mac this font looks too large at 14px, but 13px is too small for the font on Windows) */
|
|
3074
3074
|
/* main, menu, modal */
|
|
@@ -3289,7 +3289,7 @@ button.jse-context-menu-button.svelte-1y5l9l1 svg {
|
|
|
3289
3289
|
.jse-text-mode.svelte-k2b9e6 .jse-fold-progress:where(.svelte-k2b9e6) .jse-fold-cancel-button:where(.svelte-k2b9e6):hover {
|
|
3290
3290
|
background: var(--jse-theme-color-highlight, #5f9dff);
|
|
3291
3291
|
color: #fff;
|
|
3292
|
-
}`);var f0=X(`<div class="jse-fold-progress svelte-k2b9e6"><span class="jse-fold-tip svelte-k2b9e6">Collapsing</span> <div class="jse-fold-progress-track svelte-k2b9e6"><div class="jse-fold-progress-fill svelte-k2b9e6"></div></div> <button class="jse-fold-cancel-button svelte-k2b9e6" type="button" title="Cancel folding">Cancel</button></div>`),p0=X(`<!> <div class="jse-contents jse-preview svelte-k2b9e6"> </div>`,1),m0=X(`<!> <!> <!> <!>`,1),h0=X(`<div></div> <!> <!>`,1),g0=X(`<div class="jse-contents svelte-k2b9e6"><div class="jse-loading-space svelte-k2b9e6"></div> <div class="jse-loading svelte-k2b9e6">loading...</div></div>`),_0=X(`<div><!> <!> <!></div>`);function v0(e,t){vB(t,!1);var n=B(void 0,!0),r=B(void 0,!0),i=$(t,`readOnly`,9),a=$(t,`mainMenuBar`,9),o=$(t,`statusBar`,9),s=$(t,`askToFormat`,9),c=$(t,`externalContent`,9),l=$(t,`externalSelection`,9),u=$(t,`history`,9),d=$(t,`indentation`,9),f=$(t,`tabSize`,9),p=$(t,`escapeUnicodeCharacters`,9),m=$(t,`maxDocumentSize`,9),h=$(t,`parser`,9),g=$(t,`validator`,9),_=$(t,`validationParser`,9),v=$(t,`onChange`,9),y=$(t,`onChangeMode`,9),b=$(t,`onSelect`,9),x=$(t,`onUndo`,9),S=$(t,`onRedo`,9),C=$(t,`onError`,9),w=$(t,`onFocus`,9),T=$(t,`onBlur`,9),E=$(t,`onRenderMenu`,9),ee=$(t,`onSortModal`,9),te=$(t,`onTransformModal`,9),D=$W(`jsoneditor:TextMode`),ne={key:`Mod-i`,run:Ne,shift:I,preventDefault:!0},re=typeof window>`u`;D(`isSSR:`,re);var ie,ae=B(void 0,!0),oe=B(void 0,!0),O=B(void 0,!0),k=B(!1,!0),se=B(s(),!0),ce=B([],!0),le=B(!1,!0),ue=B(0,!0),A=B(0,!0),de=null,fe=new Ox,pe=new Ox,j=new Ox,me=new Ox,M=new Ox,he=c(),N=B(zG(he,d(),h()),!0),ge=Vx.define(),P=null;function F(){if(!P||P.length===0)return!1;var e=P[0].startState,t=P[P.length-1].state,n=P.map(e=>e.changes).reduce((e,t)=>e.compose(t)),r={type:`text`,undo:{changes:n.invert(e.doc).toJSON(),selection:lt(e.selection)},redo:{changes:n.toJSON(),selection:lt(t.selection)}};return D(`add history item`,r),u().add(r),P=null,!0}var _e=B(p(),!0);KU(pz(function*(){if(!re)try{ie=function(e){var{target:t,initialText:n,readOnly:r,indentation:i}=e;D(`Create CodeMirror editor`,{readOnly:r,indentation:i});var a=function(e,t){return wJ(e)?e.ranges.every(e=>e.anchor<t.length&&e.head<t.length):!1}(l(),n)?$e(l()):void 0;return ie=new OD({state:aS.create({doc:n,selection:a,extensions:[LD.of([YP,ne]),fe.of(qe()),zF(),Pk(),Rk(),SO(),oM(),Se(),nO(),fO(),aS.allowMultipleSelections.of(!0),jj(),fM(hM,{fallback:!0}),wM(),kR(),KR(),LO(),BO(),kO(),jI(),LD.of([...FR,...JP,...yL,{key:`Mod-z`,run:ze,preventDefault:!0},{key:`Mod-y`,mac:`Mod-Shift-z`,run:Be,preventDefault:!0},{key:`Ctrl-Shift-z`,run:Be,preventDefault:!0},...Zj,...qR,...pF]),l0,iz({hideFirstIndent:!0}),OD.domEventHandlers({dblclick:Ke}),OD.updateListener.of(e=>{(V(O,e.state),e.docChanged)&&(e.transactions.some(e=>!!e.annotation(ge))||(P=[...P??[],e]),at()),e.selectionSet&&ct()}),mI(),HI({top:!0}),OD.lineWrapping,pe.of(aS.readOnly.of(r)),me.of(aS.tabSize.of(f())),j.of(it(i)),M.of(OD.theme({},{dark:Je()}))]}),parent:t}),a&&ie.dispatch(ie.state.update({selection:a.main,scrollIntoView:!0})),ie}({target:K(ae),initialText:ut(K(N),m(),K(k))?``:K(n).escapeValue(K(N)),readOnly:i(),indentation:d()})}catch(e){console.error(e)}})),qU(()=>{ot(),ie&&(D(`Destroy CodeMirror editor`),ie.destroy()),Ee()});var ve=c_(),ye=c_();function be(){ie&&(D(`focus`),ie.focus())}function xe(e,t){if(ie)try{(function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],r=ie.state,i=r.doc.length,a=nj(r,i,1/0);if(a){var o=[];if(e.length===0)o=we(a,r,void 0,t);else{var{from:s}=NG(K(n).escapeValue(K(N)),e);s!==void 0&&s!==0&&(o=we(a,r,s,t))}o.length>0&&function(e){Te.apply(this,arguments)}(o)}})(e,t)}catch(e){C()(e)}}function Se(){return Mj.of((e,t,n)=>{var r=nj(e,e.doc.length,1/0);if(!r||r.length<n)return null;for(var i=null,a=r.resolveStack(n,1);a;a=a.next){var o=a.node;if(!(o.to<=n||o.from>n)){if(i&&o.from<t)break;var s=o.type.prop(Nj);if(s&&(o.to<r.length-50||r.length==e.doc.length||!Ce(o))){var c=s(o,e);c&&c.from<=n&&c.from>=t&&c.to>n&&(i=c)}}}return i})}function Ce(e){var t=e.lastChild;return t&&t.to==e.to&&t.type.isError}function we(e,t,n){var r=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3],i=[],a=new Set;return e.iterate({enter(e){if(n===void 0||e.from>=n){var o=Lj(t,e.from,e.to);if(o){var s=`${o.from}-${o.to}`;a.has(s)||(r?(i.push({from:o.from,to:o.to}),a.add(s)):i.some(e=>e.from<=o.from&&e.to>=o.to)||(i.push({from:o.from,to:o.to}),a.add(s)))}}}}),i}function Te(){return Te=pz(function*(e){if(e.length!==0){var t=e.length>5e3;t&&(V(le,!0),V(ue,0),V(A,e.length),de=new AbortController);var n=r=>new Promise(i=>{var a;t&&(a=de)!=null&&a.signal.aborted?i():requestAnimationFrame(()=>{var a=Math.min(r+100,e.length),o=e.slice(r,a);ie.dispatch({effects:o.map(e=>zj.of({from:e.from,to:e.to}))}),t&&V(ue,a),a<e.length?n(a).then(i):i()})});yield n(0),t&&(V(le,!1),V(ue,0),V(A,0),de=null)}}),Te.apply(this,arguments)}function Ee(){de&&de.abort()}function De(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:mJ;if(ie)try{if(e&&e.length>0){var{from:r}=NG(K(n).escapeValue(K(N)),e);r!==void 0&&(ie.dispatch({selection:{anchor:r,head:r}}),qj(ie))}else Xj(ie);t?.(e)}catch(e){C()(e)}}function Oe(){De([],()=>!0)}function ke(){xe([],!0)}var Ae=!1;function je(e){return Me(e,!1)}function Me(e,t){D(`handlePatch`,e,t);var n=h().parse(K(N)),r=bc(n,e),i=Mc(n,e);return Qe({text:h().stringify(r,null,d())},t,!1),{json:r,previousJson:n,undo:i,redo:e}}function Ne(){if(D(`format`),i())return!1;try{var e=h().parse(K(N));return Qe({text:h().stringify(e,null,d())},!0,!1),V(se,s()),!0}catch(e){C()(e)}return!1}function I(){if(D(`compact`),i())return!1;try{var e=h().parse(K(N));return Qe({text:h().stringify(e)},!0,!1),V(se,!1),!0}catch(e){C()(e)}return!1}function Pe(){if(D(`repair`),!i())try{Qe({text:yl(K(N))},!0,!1),V(dt,uq),V(ft,void 0)}catch(e){C()(e)}}function Fe(){var e;if(!i())try{var t=h().parse(K(N));Ae=!0,ee()({id:ve,json:t,rootPath:[],onSort:(e=pz(function*(e){var{operations:t}=e;D(`onSort`,t),Me(t,!0)}),function(t){return e.apply(this,arguments)}),onClose:()=>{Ae=!1,be()}})}catch(e){C()(e)}}function Ie(e){var{id:t,rootPath:n,onTransform:r,onClose:i}=e;try{var a=h().parse(K(N));Ae=!0,te()({id:t||ye,json:a,rootPath:n||[],onTransform:e=>{r?r({operations:e,json:a,transformedJson:bc(a,e)}):(D(`onTransform`,e),Me(e,!0))},onClose:()=>{Ae=!1,be(),i&&i()}})}catch(e){C()(e)}}function Le(){i()||Ie({rootPath:[]})}function Re(){ie&&(K(ae)&&K(ae).querySelector(`.cm-search`)?vL(ie):_L(ie))}function ze(){if(i())return!1;ot();var e=u().undo();return D(`undo`,e),Lq(e)?(ie.dispatch({annotations:ge.of(`undo`),changes:ox.fromJSON(e.undo.changes),selection:L.fromJSON(e.undo.selection),scrollIntoView:!0}),!0):(x()(e),!1)}function Be(){if(i())return!1;ot();var e=u().redo();return D(`redo`,e),Lq(e)?(ie.dispatch({annotations:ge.of(`redo`),changes:ox.fromJSON(e.redo.changes),selection:L.fromJSON(e.redo.selection),scrollIntoView:!0}),!0):(S()(e),!1)}function Ve(){V(k,!0),Qe(c(),!0,!0)}function He(){y()(qG.tree)}function Ue(){nt()}function We(e){D(`select validation error`,e);var{from:t,to:n}=Ye(e);t!==void 0&&n!==void 0&&(Ge(t,n),be())}function Ge(e,t){D(`setSelection`,{anchor:e,head:t}),ie&&ie.dispatch(ie.state.update({selection:{anchor:e,head:t},scrollIntoView:!0}))}function Ke(e,t){if(t.state.selection.ranges.length===1){var n=t.state.selection.ranges[0],r=K(N).slice(n.from,n.to);if(r===`{`||r===`[`){var i=l_.parse(K(N)),a=Object.keys(i.pointers).find(e=>i.pointers[e].value?.pos===n.from),o=i.pointers[a];a&&o&&o.value&&o.valueEnd&&(D(`pointer found, selecting inner contents of path:`,a,o),Ge(o.value.pos+1,o.valueEnd.pos-1))}}}function qe(){return _F(pt,{delay:300})}function Je(){return!!K(ae)&&getComputedStyle(K(ae)).getPropertyValue(`--jse-theme`).includes(`dark`)}function Ye(e){var{path:t,message:r,severity:i}=e,{line:a,column:o,from:s,to:c}=NG(K(n).escapeValue(K(N)),t);return{path:t,line:a,column:o,from:s,to:c,message:r,severity:i,actions:[]}}function Xe(e,t){var{line:n,column:r,position:a,message:o}=e;return{path:[],line:n,column:r,from:a,to:a,severity:XG.error,message:o,actions:t&&!i()?[{name:`Auto repair`,apply:()=>Pe()}]:void 0}}function Ze(e){return{from:e.from||0,to:e.to||0,message:e.message||``,actions:e.actions,severity:e.severity}}function Qe(e,t,r){var i=zG(e,d(),h()),a=!Vg(e,he),o=he;D(`setCodeMirrorContent`,{isChanged:a,emitChange:t,forceUpdate:r}),ie&&(a||r)&&(he=e,V(N,i),ut(K(N),m(),K(k))||ie.dispatch({changes:{from:0,to:ie.state.doc.length,insert:K(n).escapeValue(K(N))}}),F(),a&&t&&st(he,o))}function $e(e){return wJ(e)?L.fromJSON(e):void 0}function et(){return tt.apply(this,arguments)}function tt(){return tt=pz(function*(){D(`refresh`),yield function(){return rt.apply(this,arguments)}()}),tt.apply(this,arguments)}function nt(){if(ie){var e=ie?K(n).unescapeValue(ie.state.doc.toString()):``,t=e!==K(N);if(D(`onChangeCodeMirrorValue`,{isChanged:t}),t){var r=he;V(N,e),he={text:K(N)},F(),st(he,r),uV(),ct()}}}function rt(){return(rt=pz(function*(){if(uV(),ie){var e=Je();return D(`updateTheme`,{dark:e}),ie.dispatch({effects:[M.reconfigure(OD.theme({},{dark:e}))]}),new Promise(e=>setTimeout(e))}return Promise.resolve()})).apply(this,arguments)}function it(e){var t=mj.of(typeof e==`number`?` `.repeat(e):e);return e===` `?[t]:[t,d0]}rQ({onMount:KU,onDestroy:qU,getWindow:()=>_K(K(oe)),hasFocus:()=>Ae&&document.hasFocus()||vK(K(oe)),onFocus:w(),onBlur:()=>{ot(),T()()}});var at=Cg(nt,300);function ot(){at.flush()}function st(e,t){v()&&v()(e,t,{contentErrors:mt(),patchResult:void 0})}function ct(){b()(lt(K(O).selection))}function lt(e){return R({type:JG.text},e.toJSON())}function ut(e,t,n){return!!e&&e.length>t&&!n}var dt=B(uq,!0),ft=B(void 0,!0);function pt(){if(ut(K(N),m(),K(k)))return[];var e=mt();if(Eq(e)){var{parseError:t,isRepairable:n}=e;return[Ze(Xe(t,n))]}return Dq(e)?e.validationErrors.map(Ye).map(Ze):[]}function mt(){D(`validate:start`),ot();var e=ht(K(n).escapeValue(K(N)),g(),h(),_());return Eq(e)?(V(dt,e.isRepairable?dq:`invalid`),V(ft,e.parseError),V(ce,[])):(V(dt,uq),V(ft,void 0),V(ce,e?.validationErrors||[])),D(`validate:end`),e}var ht=kv(tQ);function gt(){K(ft)&&function(e){D(`select parse error`,e);var t=Xe(e,!1);Ge(t.from==null?0:t.from,t.to==null?0:t.to),be()}(K(ft))}var _t={icon:tv,text:`Show me`,title:`Move to the parse error location`,onClick:gt};W(()=>J(p()),()=>{V(n,tK({escapeControlCharacters:!1,escapeUnicodeCharacters:p()}))}),W(()=>J(c()),()=>{Qe(c(),!1,!1)}),W(()=>J(l()),()=>{(function(e){if(wJ(e)){var t=$e(e);!ie||!t||K(O)&&K(O).selection.eq(t)||(D(`applyExternalSelection`,t),ie.dispatch({selection:t}))}})(l())}),W(()=>J(g()),()=>{(function(e){D(`updateLinter`,e),ie&&ie.dispatch({effects:fe.reconfigure(qe())})})(g())}),W(()=>J(d()),()=>{(function(e){ie&&(D(`updateIndentation`,e),ie.dispatch({effects:j.reconfigure(it(e))}))})(d())}),W(()=>J(f()),()=>{(function(e){ie&&(D(`updateTabSize`,e),ie.dispatch({effects:me.reconfigure(aS.tabSize.of(e))}))})(f())}),W(()=>J(i()),()=>{(function(e){ie&&(D(`updateReadOnly`,e),ie.dispatch({effects:[pe.reconfigure(aS.readOnly.of(e))]}))})(i())}),W(()=>(K(_e),J(p())),()=>{K(_e)!==p()&&(V(_e,p()),D(`forceUpdateText`,{escapeUnicodeCharacters:p()}),ie&&ie.dispatch({changes:{from:0,to:ie.state.doc.length,insert:K(n).escapeValue(K(N))}}))}),W(()=>(K(dt),J(i()),ev),()=>{V(r,K(dt)!==dq||i()?[_t]:[{icon:ev,text:`Auto repair`,title:`Automatically repair JSON`,onClick:Pe},_t])}),DH();var vt={focus:be,collapse:xe,expand:De,patch:je,handlePatch:Me,openTransformModal:Ie,refresh:et,flush:ot,validate:mt};GW(!0);var yt,bt=_0(),xt=H(bt),St=e=>{var t=GV(()=>(K(N),q(()=>K(N).length===0))),n=GV(()=>!K(t)),r=GV(()=>!K(t)),a=GV(()=>!K(t)),o=GV(()=>!K(t)),s=GV(()=>!K(t)),c=GV(()=>!K(t));(function(e,t){vB(t,!1);var n=B(void 0,!0),r=$(t,`readOnly`,9,!1),i=$(t,`onExpandAll`,9),a=$(t,`onCollapseAll`,9),o=$(t,`onFormat`,9),s=$(t,`onCompact`,9),c=$(t,`onSort`,9),l=$(t,`onTransform`,9),u=$(t,`onToggleSearch`,9),d=$(t,`onUndo`,9),f=$(t,`onRedo`,9),p=$(t,`canExpandAll`,9),m=$(t,`canCollapseAll`,9),h=$(t,`canUndo`,9),g=$(t,`canRedo`,9),_=$(t,`canFormat`,9),v=$(t,`canCompact`,9),y=$(t,`canSort`,9),b=$(t,`canTransform`,9),x=$(t,`onRenderMenu`,9),S=B(void 0,!0),C=B(void 0,!0),w={type:`button`,icon:pv,title:`Search (Ctrl+F)`,className:`jse-search`,onClick:u()},T=B(void 0,!0);W(()=>(J(i()),J(p())),()=>{V(S,{type:`button`,icon:v$,title:`Expand all`,className:`jse-expand-all`,onClick:i(),disabled:!p()})}),W(()=>(J(a()),J(m())),()=>{V(C,{type:`button`,icon:y$,title:`Collapse all`,className:`jse-collapse-all`,onClick:a(),disabled:!m()})}),W(()=>(J(r()),K(S),K(C),J(o()),J(_()),J(s()),J(v()),J(c()),J(y()),J(l()),J(b()),J(d()),J(h()),J(f()),J(g())),()=>{V(T,r()?[K(S),K(C),{type:`separator`},w,{type:`space`}]:[K(S),K(C),{type:`separator`},{type:`button`,icon:b$,title:`Format JSON: add proper indentation and new lines (Ctrl+I)`,className:`jse-format`,onClick:o(),disabled:r()||!_()},{type:`button`,icon:x$,title:`Compact JSON: remove all white spacing and new lines (Ctrl+Shift+I)`,className:`jse-compact`,onClick:s(),disabled:r()||!v()},{type:`separator`},{type:`button`,icon:uv,title:`Sort`,className:`jse-sort`,onClick:c(),disabled:r()||!y()},{type:`button`,icon:Q_,title:`Transform contents (filter, sort, project)`,className:`jse-transform`,onClick:l(),disabled:r()||!b()},w,{type:`separator`},{type:`button`,icon:iv,title:`Undo (Ctrl+Z)`,className:`jse-undo`,onClick:d(),disabled:!h()},{type:`button`,icon:rv,title:`Redo (Ctrl+Shift+Z)`,className:`jse-redo`,onClick:f(),disabled:!g()},{type:`space`}])}),W(()=>(J(x()),K(T)),()=>{V(n,x()(K(T))||K(T))}),DH(),GW(!0),CQ(e,{get items(){return K(n)}}),yB()})(e,{get readOnly(){return i()},onExpandAll:Oe,onCollapseAll:ke,onFormat:Ne,onCompact:I,onSort:Fe,onTransform:Le,onToggleSearch:Re,onUndo:ze,onRedo:Be,get canExpandAll(){return K(n)},get canCollapseAll(){return K(r)},get canFormat(){return K(a)},get canCompact(){return K(o)},get canSort(){return K(s)},get canTransform(){return K(c)},get canUndo(){return J(u()),q(()=>u().canUndo)},get canRedo(){return J(u()),q(()=>u().canRedo)},get onRenderMenu(){return E()}})};Q(xt,e=>{a()&&e(St)});var Ct=U(xt,2),wt=e=>{var t=f0(),n=U(H(t),2),r=H(n),i=U(n,2);G(()=>yW(r,`width: ${K(A)>0?K(ue)/K(A)*100:0}%`)),Y(`click`,i,Ee),Z(e,t)};Q(Ct,e=>{K(le)&&e(wt)});var Tt=U(Ct,2),Et=e=>{var t,n=GV(()=>(K(N),J(m()),K(k),q(()=>ut(K(N),m(),K(k))))),i=h0(),a=hH(i);HW(a,e=>V(ae,e),()=>K(ae));var s=U(a,2),c=e=>{var t=p0(),n=hH(t),r=GV(()=>(J(PY),J(m()),K(N),q(()=>`The JSON document is larger than ${PY(m())}, and may crash your browser when loading it in text mode. Actual size: ${PY(K(N).length)}.`)));oQ(n,{get icon(){return wv},type:`error`,get message(){return K(r)},actions:[{text:`Open anyway`,title:`Open the document in text mode. This may freeze or crash your browser.`,onClick:Ve},{text:`Open in tree mode`,title:`Open the document in tree mode. Tree mode can handle large documents.`,onClick:He},{text:`Cancel`,title:`Cancel opening this large document.`,onClick:Ue}],onClose:be});var i=H(U(n,2));G(e=>PU(i,e),[()=>(J(FK),K(N),J(tq),q(()=>FK(K(N)||``,tq)))]),Z(e,t)};Q(s,e=>{K(n)&&e(c)});var l=U(s,2),u=e=>{var t=m0(),n=hH(t),i=e=>{(function(e,t){vB(t,!1);var n=$(t,`editorState`,8),r=B(),i=B(),a=B(),o=B(),s=B();W(()=>J(n()),()=>{var e;V(r,(e=n())==null||(e=e.selection)==null||(e=e.main)==null?void 0:e.head)}),W(()=>(K(r),J(n())),()=>{var e;V(i,K(r)===void 0||(e=n())==null||(e=e.doc)==null?void 0:e.lineAt(K(r)))}),W(()=>K(i),()=>{V(a,K(i)===void 0?void 0:K(i).number)}),W(()=>(K(i),K(r)),()=>{V(o,K(i)!==void 0&&K(r)!==void 0?K(r)-K(i).from+1:void 0)}),W(()=>J(n()),()=>{var e;V(s,(e=n())==null||(e=e.selection)==null||(e=e.ranges)==null?void 0:e.reduce((e,t)=>e+t.to-t.from,0))}),DH(),GW();var c=s0(),l=H(c),u=e=>{var t=i0(),n=H(t);G(()=>PU(n,`Line: ${K(a)??``}`)),Z(e,t)};Q(l,e=>{K(a)!==void 0&&e(u)});var d=U(l,2),f=e=>{var t=a0(),n=H(t);G(()=>PU(n,`Column: ${K(o)??``}`)),Z(e,t)};Q(d,e=>{K(o)!==void 0&&e(f)});var p=U(d,2),m=e=>{var t=o0(),n=H(t);G(()=>PU(n,`Selection: ${K(s)??``} characters`)),Z(e,t)};Q(p,e=>{K(s)!==void 0&&K(s)>0&&e(m)}),Z(e,c),yB()})(e,{get editorState(){return K(O)}})};Q(n,e=>{o()&&e(i)});var a=U(n,2),s=e=>{oQ(e,{type:`error`,get icon(){return wv},get message(){return K(ft),q(()=>K(ft).message)},get actions(){return K(r)},onClick:gt,onClose:be})};Q(a,e=>{K(ft)&&e(s)});var c=U(a,2),l=e=>{var t=GV(()=>[{icon:b$,text:`Format`,title:`Format JSON: add proper indentation and new lines (Ctrl+I)`,onClick:Ne},{icon:yv,text:`No thanks`,title:`Close this message`,onClick:()=>V(se,!1)}]);oQ(e,{type:`success`,message:`Do you want to format the JSON?`,get actions(){return K(t)},onClose:be})},u=WV(()=>(K(ft),K(se),J(KG),K(N),q(()=>!K(ft)&&K(se)&&KG(K(N)))));Q(c,e=>{K(u)&&e(l)}),pQ(U(c,2),{get validationErrors(){return K(ce)},selectError:We}),Z(e,t)};Q(l,e=>{K(n)||e(u)}),G(()=>t=_W(a,1,`jse-contents svelte-k2b9e6`,null,t,{"jse-hidden":K(n)})),Z(e,i)},Dt=e=>{Z(e,g0())};return Q(Tt,e=>{re?e(Dt,-1):e(Et)}),HW(bt,e=>V(oe,e),()=>K(oe)),G(()=>yt=_W(bt,1,`jse-text-mode svelte-k2b9e6`,null,yt,{"no-main-menu":!a()})),Z(e,bt),BW(t,`focus`,be),BW(t,`collapse`,xe),BW(t,`expand`,De),BW(t,`patch`,je),BW(t,`handlePatch`,Me),BW(t,`openTransformModal`,Ie),BW(t,`refresh`,et),BW(t,`flush`,ot),BW(t,`validate`,mt),yB(vt)}OK(`/* over all fonts, sizes, and colors */
|
|
3292
|
+
}`);var p0=X(`<div class="jse-fold-progress svelte-k2b9e6"><span class="jse-fold-tip svelte-k2b9e6">Collapsing</span> <div class="jse-fold-progress-track svelte-k2b9e6"><div class="jse-fold-progress-fill svelte-k2b9e6"></div></div> <button class="jse-fold-cancel-button svelte-k2b9e6" type="button" title="Cancel folding">Cancel</button></div>`),m0=X(`<!> <div class="jse-contents jse-preview svelte-k2b9e6"> </div>`,1),h0=X(`<!> <!> <!> <!>`,1),g0=X(`<div></div> <!> <!>`,1),_0=X(`<div class="jse-contents svelte-k2b9e6"><div class="jse-loading-space svelte-k2b9e6"></div> <div class="jse-loading svelte-k2b9e6">loading...</div></div>`),v0=X(`<div><!> <!> <!></div>`);function y0(e,t){vB(t,!1);var n=B(void 0,!0),r=B(void 0,!0),i=$(t,`readOnly`,9),a=$(t,`mainMenuBar`,9),o=$(t,`statusBar`,9),s=$(t,`askToFormat`,9),c=$(t,`externalContent`,9),l=$(t,`externalSelection`,9),u=$(t,`history`,9),d=$(t,`indentation`,9),f=$(t,`tabSize`,9),p=$(t,`escapeUnicodeCharacters`,9),m=$(t,`maxDocumentSize`,9),h=$(t,`parser`,9),g=$(t,`validator`,9),_=$(t,`validationParser`,9),v=$(t,`onChange`,9),y=$(t,`onChangeMode`,9),b=$(t,`onSelect`,9),x=$(t,`onUndo`,9),S=$(t,`onRedo`,9),C=$(t,`onError`,9),w=$(t,`onFocus`,9),T=$(t,`onBlur`,9),E=$(t,`onRenderMenu`,9),ee=$(t,`onSortModal`,9),te=$(t,`onTransformModal`,9),D=$W(`jsoneditor:TextMode`),ne={key:`Mod-i`,run:Ne,shift:I,preventDefault:!0},re=typeof window>`u`;D(`isSSR:`,re);var ie,ae=B(void 0,!0),oe=B(void 0,!0),O=B(void 0,!0),k=B(!1,!0),se=B(s(),!0),ce=B([],!0),le=B(!1,!0),ue=B(0,!0),A=B(0,!0),de=null,fe=new Ox,pe=new Ox,j=new Ox,me=new Ox,M=new Ox,he=c(),N=B(zG(he,d(),h()),!0),ge=Vx.define(),P=null;function F(){if(!P||P.length===0)return!1;var e=P[0].startState,t=P[P.length-1].state,n=P.map(e=>e.changes).reduce((e,t)=>e.compose(t)),r={type:`text`,undo:{changes:n.invert(e.doc).toJSON(),selection:lt(e.selection)},redo:{changes:n.toJSON(),selection:lt(t.selection)}};return D(`add history item`,r),u().add(r),P=null,!0}var _e=B(p(),!0);KU(pz(function*(){if(!re)try{ie=function(e){var{target:t,initialText:n,readOnly:r,indentation:i}=e;D(`Create CodeMirror editor`,{readOnly:r,indentation:i});var a=function(e,t){return wJ(e)?e.ranges.every(e=>e.anchor<t.length&&e.head<t.length):!1}(l(),n)?$e(l()):void 0;return ie=new DD({state:aS.create({doc:n,selection:a,extensions:[ID.of([JP,ne]),fe.of(qe()),RF(),Nk(),Lk(),xO(),aM(),Se(),tO(),dO(),aS.allowMultipleSelections.of(!0),Aj(),dM(mM,{fallback:!0}),CM(),kR(),KR(),IO(),zO(),OO(),jI(),ID.of([...FR,...qP,...yL,{key:`Mod-z`,run:ze,preventDefault:!0},{key:`Mod-y`,mac:`Mod-Shift-z`,run:Be,preventDefault:!0},{key:`Ctrl-Shift-z`,run:Be,preventDefault:!0},...Xj,...qR,...fF]),u0,iz({hideFirstIndent:!0}),DD.domEventHandlers({dblclick:Ke}),DD.updateListener.of(e=>{(V(O,e.state),e.docChanged)&&(e.transactions.some(e=>!!e.annotation(ge))||(P=[...P??[],e]),at()),e.selectionSet&&ct()}),pI(),HI({top:!0}),DD.lineWrapping,pe.of(aS.readOnly.of(r)),me.of(aS.tabSize.of(f())),j.of(it(i)),M.of(DD.theme({},{dark:Je()}))]}),parent:t}),a&&ie.dispatch(ie.state.update({selection:a.main,scrollIntoView:!0})),ie}({target:K(ae),initialText:ut(K(N),m(),K(k))?``:K(n).escapeValue(K(N)),readOnly:i(),indentation:d()})}catch(e){console.error(e)}})),qU(()=>{ot(),ie&&(D(`Destroy CodeMirror editor`),ie.destroy()),Ee()});var ve=c_(),ye=c_();function be(){ie&&(D(`focus`),ie.focus())}function xe(e,t){if(ie)try{(function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],r=ie.state,i=r.doc.length,a=tj(r,i,1/0);if(a){var o=[];if(e.length===0)o=we(a,r,void 0,t);else{var{from:s}=NG(K(n).escapeValue(K(N)),e);s!==void 0&&s!==0&&(o=we(a,r,s,t))}o.length>0&&function(e){Te.apply(this,arguments)}(o)}})(e,t)}catch(e){C()(e)}}function Se(){return jj.of((e,t,n)=>{var r=tj(e,e.doc.length,1/0);if(!r||r.length<n)return null;for(var i=null,a=r.resolveStack(n,1);a;a=a.next){var o=a.node;if(!(o.to<=n||o.from>n)){if(i&&o.from<t)break;var s=o.type.prop(Mj);if(s&&(o.to<r.length-50||r.length==e.doc.length||!Ce(o))){var c=s(o,e);c&&c.from<=n&&c.from>=t&&c.to>n&&(i=c)}}}return i})}function Ce(e){var t=e.lastChild;return t&&t.to==e.to&&t.type.isError}function we(e,t,n){var r=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3],i=[],a=new Set;return e.iterate({enter(e){if(n===void 0||e.from>=n){var o=Ij(t,e.from,e.to);if(o){var s=`${o.from}-${o.to}`;a.has(s)||(r?(i.push({from:o.from,to:o.to}),a.add(s)):i.some(e=>e.from<=o.from&&e.to>=o.to)||(i.push({from:o.from,to:o.to}),a.add(s)))}}}}),i}function Te(){return Te=pz(function*(e){if(e.length!==0){var t=e.length>5e3;t&&(V(le,!0),V(ue,0),V(A,e.length),de=new AbortController);var n=r=>new Promise(i=>{var a;t&&(a=de)!=null&&a.signal.aborted?i():requestAnimationFrame(()=>{var a=Math.min(r+100,e.length),o=e.slice(r,a);ie.dispatch({effects:o.map(e=>Rj.of({from:e.from,to:e.to}))}),t&&V(ue,a),a<e.length?n(a).then(i):i()})});yield n(0),t&&(V(le,!1),V(ue,0),V(A,0),de=null)}}),Te.apply(this,arguments)}function Ee(){de&&de.abort()}function De(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:mJ;if(ie)try{if(e&&e.length>0){var{from:r}=NG(K(n).escapeValue(K(N)),e);r!==void 0&&(ie.dispatch({selection:{anchor:r,head:r}}),Kj(ie))}else Yj(ie);t?.(e)}catch(e){C()(e)}}function Oe(){De([],()=>!0)}function ke(){xe([],!0)}var Ae=!1;function je(e){return Me(e,!1)}function Me(e,t){D(`handlePatch`,e,t);var n=h().parse(K(N)),r=bc(n,e),i=Mc(n,e);return Qe({text:h().stringify(r,null,d())},t,!1),{json:r,previousJson:n,undo:i,redo:e}}function Ne(){if(D(`format`),i())return!1;try{var e=h().parse(K(N));return Qe({text:h().stringify(e,null,d())},!0,!1),V(se,s()),!0}catch(e){C()(e)}return!1}function I(){if(D(`compact`),i())return!1;try{var e=h().parse(K(N));return Qe({text:h().stringify(e)},!0,!1),V(se,!1),!0}catch(e){C()(e)}return!1}function Pe(){if(D(`repair`),!i())try{Qe({text:Sl(K(N))},!0,!1),V(dt,uq),V(ft,void 0)}catch(e){C()(e)}}function Fe(){var e;if(!i())try{var t=h().parse(K(N));Ae=!0,ee()({id:ve,json:t,rootPath:[],onSort:(e=pz(function*(e){var{operations:t}=e;D(`onSort`,t),Me(t,!0)}),function(t){return e.apply(this,arguments)}),onClose:()=>{Ae=!1,be()}})}catch(e){C()(e)}}function Ie(e){var{id:t,rootPath:n,onTransform:r,onClose:i}=e;try{var a=h().parse(K(N));Ae=!0,te()({id:t||ye,json:a,rootPath:n||[],onTransform:e=>{r?r({operations:e,json:a,transformedJson:bc(a,e)}):(D(`onTransform`,e),Me(e,!0))},onClose:()=>{Ae=!1,be(),i&&i()}})}catch(e){C()(e)}}function Le(){i()||Ie({rootPath:[]})}function Re(){ie&&(K(ae)&&K(ae).querySelector(`.cm-search`)?vL(ie):_L(ie))}function ze(){if(i())return!1;ot();var e=u().undo();return D(`undo`,e),Lq(e)?(ie.dispatch({annotations:ge.of(`undo`),changes:ox.fromJSON(e.undo.changes),selection:L.fromJSON(e.undo.selection),scrollIntoView:!0}),!0):(x()(e),!1)}function Be(){if(i())return!1;ot();var e=u().redo();return D(`redo`,e),Lq(e)?(ie.dispatch({annotations:ge.of(`redo`),changes:ox.fromJSON(e.redo.changes),selection:L.fromJSON(e.redo.selection),scrollIntoView:!0}),!0):(S()(e),!1)}function Ve(){V(k,!0),Qe(c(),!0,!0)}function He(){y()(qG.tree)}function Ue(){nt()}function We(e){D(`select validation error`,e);var{from:t,to:n}=Ye(e);t!==void 0&&n!==void 0&&(Ge(t,n),be())}function Ge(e,t){D(`setSelection`,{anchor:e,head:t}),ie&&ie.dispatch(ie.state.update({selection:{anchor:e,head:t},scrollIntoView:!0}))}function Ke(e,t){if(t.state.selection.ranges.length===1){var n=t.state.selection.ranges[0],r=K(N).slice(n.from,n.to);if(r===`{`||r===`[`){var i=l_.parse(K(N)),a=Object.keys(i.pointers).find(e=>i.pointers[e].value?.pos===n.from),o=i.pointers[a];a&&o&&o.value&&o.valueEnd&&(D(`pointer found, selecting inner contents of path:`,a,o),Ge(o.value.pos+1,o.valueEnd.pos-1))}}}function qe(){return gF(pt,{delay:300})}function Je(){return!!K(ae)&&getComputedStyle(K(ae)).getPropertyValue(`--jse-theme`).includes(`dark`)}function Ye(e){var{path:t,message:r,severity:i}=e,{line:a,column:o,from:s,to:c}=NG(K(n).escapeValue(K(N)),t);return{path:t,line:a,column:o,from:s,to:c,message:r,severity:i,actions:[]}}function Xe(e,t){var{line:n,column:r,position:a,message:o}=e;return{path:[],line:n,column:r,from:a,to:a,severity:XG.error,message:o,actions:t&&!i()?[{name:`Auto repair`,apply:()=>Pe()}]:void 0}}function Ze(e){return{from:e.from||0,to:e.to||0,message:e.message||``,actions:e.actions,severity:e.severity}}function Qe(e,t,r){var i=zG(e,d(),h()),a=!Hg(e,he),o=he;D(`setCodeMirrorContent`,{isChanged:a,emitChange:t,forceUpdate:r}),ie&&(a||r)&&(he=e,V(N,i),ut(K(N),m(),K(k))||ie.dispatch({changes:{from:0,to:ie.state.doc.length,insert:K(n).escapeValue(K(N))}}),F(),a&&t&&st(he,o))}function $e(e){return wJ(e)?L.fromJSON(e):void 0}function et(){return tt.apply(this,arguments)}function tt(){return tt=pz(function*(){D(`refresh`),yield function(){return rt.apply(this,arguments)}()}),tt.apply(this,arguments)}function nt(){if(ie){var e=ie?K(n).unescapeValue(ie.state.doc.toString()):``,t=e!==K(N);if(D(`onChangeCodeMirrorValue`,{isChanged:t}),t){var r=he;V(N,e),he={text:K(N)},F(),st(he,r),uV(),ct()}}}function rt(){return(rt=pz(function*(){if(uV(),ie){var e=Je();return D(`updateTheme`,{dark:e}),ie.dispatch({effects:[M.reconfigure(DD.theme({},{dark:e}))]}),new Promise(e=>setTimeout(e))}return Promise.resolve()})).apply(this,arguments)}function it(e){var t=pj.of(typeof e==`number`?` `.repeat(e):e);return e===` `?[t]:[t,f0]}iQ({onMount:KU,onDestroy:qU,getWindow:()=>_K(K(oe)),hasFocus:()=>Ae&&document.hasFocus()||vK(K(oe)),onFocus:w(),onBlur:()=>{ot(),T()()}});var at=Og(nt,300);function ot(){at.flush()}function st(e,t){v()&&v()(e,t,{contentErrors:mt(),patchResult:void 0})}function ct(){b()(lt(K(O).selection))}function lt(e){return R({type:JG.text},e.toJSON())}function ut(e,t,n){return!!e&&e.length>t&&!n}var dt=B(uq,!0),ft=B(void 0,!0);function pt(){if(ut(K(N),m(),K(k)))return[];var e=mt();if(Eq(e)){var{parseError:t,isRepairable:n}=e;return[Ze(Xe(t,n))]}return Dq(e)?e.validationErrors.map(Ye).map(Ze):[]}function mt(){D(`validate:start`),ot();var e=ht(K(n).escapeValue(K(N)),g(),h(),_());return Eq(e)?(V(dt,e.isRepairable?dq:`invalid`),V(ft,e.parseError),V(ce,[])):(V(dt,uq),V(ft,void 0),V(ce,e?.validationErrors||[])),D(`validate:end`),e}var ht=kv(nQ);function gt(){K(ft)&&function(e){D(`select parse error`,e);var t=Xe(e,!1);Ge(t.from==null?0:t.from,t.to==null?0:t.to),be()}(K(ft))}var _t={icon:tv,text:`Show me`,title:`Move to the parse error location`,onClick:gt};W(()=>J(p()),()=>{V(n,tK({escapeControlCharacters:!1,escapeUnicodeCharacters:p()}))}),W(()=>J(c()),()=>{Qe(c(),!1,!1)}),W(()=>J(l()),()=>{(function(e){if(wJ(e)){var t=$e(e);!ie||!t||K(O)&&K(O).selection.eq(t)||(D(`applyExternalSelection`,t),ie.dispatch({selection:t}))}})(l())}),W(()=>J(g()),()=>{(function(e){D(`updateLinter`,e),ie&&ie.dispatch({effects:fe.reconfigure(qe())})})(g())}),W(()=>J(d()),()=>{(function(e){ie&&(D(`updateIndentation`,e),ie.dispatch({effects:j.reconfigure(it(e))}))})(d())}),W(()=>J(f()),()=>{(function(e){ie&&(D(`updateTabSize`,e),ie.dispatch({effects:me.reconfigure(aS.tabSize.of(e))}))})(f())}),W(()=>J(i()),()=>{(function(e){ie&&(D(`updateReadOnly`,e),ie.dispatch({effects:[pe.reconfigure(aS.readOnly.of(e))]}))})(i())}),W(()=>(K(_e),J(p())),()=>{K(_e)!==p()&&(V(_e,p()),D(`forceUpdateText`,{escapeUnicodeCharacters:p()}),ie&&ie.dispatch({changes:{from:0,to:ie.state.doc.length,insert:K(n).escapeValue(K(N))}}))}),W(()=>(K(dt),J(i()),ev),()=>{V(r,K(dt)!==dq||i()?[_t]:[{icon:ev,text:`Auto repair`,title:`Automatically repair JSON`,onClick:Pe},_t])}),DH();var vt={focus:be,collapse:xe,expand:De,patch:je,handlePatch:Me,openTransformModal:Ie,refresh:et,flush:ot,validate:mt};GW(!0);var yt,bt=v0(),xt=H(bt),St=e=>{var t=GV(()=>(K(N),q(()=>K(N).length===0))),n=GV(()=>!K(t)),r=GV(()=>!K(t)),a=GV(()=>!K(t)),o=GV(()=>!K(t)),s=GV(()=>!K(t)),c=GV(()=>!K(t));(function(e,t){vB(t,!1);var n=B(void 0,!0),r=$(t,`readOnly`,9,!1),i=$(t,`onExpandAll`,9),a=$(t,`onCollapseAll`,9),o=$(t,`onFormat`,9),s=$(t,`onCompact`,9),c=$(t,`onSort`,9),l=$(t,`onTransform`,9),u=$(t,`onToggleSearch`,9),d=$(t,`onUndo`,9),f=$(t,`onRedo`,9),p=$(t,`canExpandAll`,9),m=$(t,`canCollapseAll`,9),h=$(t,`canUndo`,9),g=$(t,`canRedo`,9),_=$(t,`canFormat`,9),v=$(t,`canCompact`,9),y=$(t,`canSort`,9),b=$(t,`canTransform`,9),x=$(t,`onRenderMenu`,9),S=B(void 0,!0),C=B(void 0,!0),w={type:`button`,icon:pv,title:`Search (Ctrl+F)`,className:`jse-search`,onClick:u()},T=B(void 0,!0);W(()=>(J(i()),J(p())),()=>{V(S,{type:`button`,icon:y$,title:`Expand all`,className:`jse-expand-all`,onClick:i(),disabled:!p()})}),W(()=>(J(a()),J(m())),()=>{V(C,{type:`button`,icon:b$,title:`Collapse all`,className:`jse-collapse-all`,onClick:a(),disabled:!m()})}),W(()=>(J(r()),K(S),K(C),J(o()),J(_()),J(s()),J(v()),J(c()),J(y()),J(l()),J(b()),J(d()),J(h()),J(f()),J(g())),()=>{V(T,r()?[K(S),K(C),{type:`separator`},w,{type:`space`}]:[K(S),K(C),{type:`separator`},{type:`button`,icon:x$,title:`Format JSON: add proper indentation and new lines (Ctrl+I)`,className:`jse-format`,onClick:o(),disabled:r()||!_()},{type:`button`,icon:S$,title:`Compact JSON: remove all white spacing and new lines (Ctrl+Shift+I)`,className:`jse-compact`,onClick:s(),disabled:r()||!v()},{type:`separator`},{type:`button`,icon:uv,title:`Sort`,className:`jse-sort`,onClick:c(),disabled:r()||!y()},{type:`button`,icon:Q_,title:`Transform contents (filter, sort, project)`,className:`jse-transform`,onClick:l(),disabled:r()||!b()},w,{type:`separator`},{type:`button`,icon:iv,title:`Undo (Ctrl+Z)`,className:`jse-undo`,onClick:d(),disabled:!h()},{type:`button`,icon:rv,title:`Redo (Ctrl+Shift+Z)`,className:`jse-redo`,onClick:f(),disabled:!g()},{type:`space`}])}),W(()=>(J(x()),K(T)),()=>{V(n,x()(K(T))||K(T))}),DH(),GW(!0),wQ(e,{get items(){return K(n)}}),yB()})(e,{get readOnly(){return i()},onExpandAll:Oe,onCollapseAll:ke,onFormat:Ne,onCompact:I,onSort:Fe,onTransform:Le,onToggleSearch:Re,onUndo:ze,onRedo:Be,get canExpandAll(){return K(n)},get canCollapseAll(){return K(r)},get canFormat(){return K(a)},get canCompact(){return K(o)},get canSort(){return K(s)},get canTransform(){return K(c)},get canUndo(){return J(u()),q(()=>u().canUndo)},get canRedo(){return J(u()),q(()=>u().canRedo)},get onRenderMenu(){return E()}})};Q(xt,e=>{a()&&e(St)});var Ct=U(xt,2),wt=e=>{var t=p0(),n=U(H(t),2),r=H(n),i=U(n,2);G(()=>yW(r,`width: ${K(A)>0?K(ue)/K(A)*100:0}%`)),Y(`click`,i,Ee),Z(e,t)};Q(Ct,e=>{K(le)&&e(wt)});var Tt=U(Ct,2),Et=e=>{var t,n=GV(()=>(K(N),J(m()),K(k),q(()=>ut(K(N),m(),K(k))))),i=g0(),a=hH(i);HW(a,e=>V(ae,e),()=>K(ae));var s=U(a,2),c=e=>{var t=m0(),n=hH(t),r=GV(()=>(J(PY),J(m()),K(N),q(()=>`The JSON document is larger than ${PY(m())}, and may crash your browser when loading it in text mode. Actual size: ${PY(K(N).length)}.`)));sQ(n,{get icon(){return wv},type:`error`,get message(){return K(r)},actions:[{text:`Open anyway`,title:`Open the document in text mode. This may freeze or crash your browser.`,onClick:Ve},{text:`Open in tree mode`,title:`Open the document in tree mode. Tree mode can handle large documents.`,onClick:He},{text:`Cancel`,title:`Cancel opening this large document.`,onClick:Ue}],onClose:be});var i=H(U(n,2));G(e=>PU(i,e),[()=>(J(FK),K(N),J(tq),q(()=>FK(K(N)||``,tq)))]),Z(e,t)};Q(s,e=>{K(n)&&e(c)});var l=U(s,2),u=e=>{var t=h0(),n=hH(t),i=e=>{(function(e,t){vB(t,!1);var n=$(t,`editorState`,8),r=B(),i=B(),a=B(),o=B(),s=B();W(()=>J(n()),()=>{var e;V(r,(e=n())==null||(e=e.selection)==null||(e=e.main)==null?void 0:e.head)}),W(()=>(K(r),J(n())),()=>{var e;V(i,K(r)===void 0||(e=n())==null||(e=e.doc)==null?void 0:e.lineAt(K(r)))}),W(()=>K(i),()=>{V(a,K(i)===void 0?void 0:K(i).number)}),W(()=>(K(i),K(r)),()=>{V(o,K(i)!==void 0&&K(r)!==void 0?K(r)-K(i).from+1:void 0)}),W(()=>J(n()),()=>{var e;V(s,(e=n())==null||(e=e.selection)==null||(e=e.ranges)==null?void 0:e.reduce((e,t)=>e+t.to-t.from,0))}),DH(),GW();var c=c0(),l=H(c),u=e=>{var t=a0(),n=H(t);G(()=>PU(n,`Line: ${K(a)??``}`)),Z(e,t)};Q(l,e=>{K(a)!==void 0&&e(u)});var d=U(l,2),f=e=>{var t=o0(),n=H(t);G(()=>PU(n,`Column: ${K(o)??``}`)),Z(e,t)};Q(d,e=>{K(o)!==void 0&&e(f)});var p=U(d,2),m=e=>{var t=s0(),n=H(t);G(()=>PU(n,`Selection: ${K(s)??``} characters`)),Z(e,t)};Q(p,e=>{K(s)!==void 0&&K(s)>0&&e(m)}),Z(e,c),yB()})(e,{get editorState(){return K(O)}})};Q(n,e=>{o()&&e(i)});var a=U(n,2),s=e=>{sQ(e,{type:`error`,get icon(){return wv},get message(){return K(ft),q(()=>K(ft).message)},get actions(){return K(r)},onClick:gt,onClose:be})};Q(a,e=>{K(ft)&&e(s)});var c=U(a,2),l=e=>{var t=GV(()=>[{icon:x$,text:`Format`,title:`Format JSON: add proper indentation and new lines (Ctrl+I)`,onClick:Ne},{icon:yv,text:`No thanks`,title:`Close this message`,onClick:()=>V(se,!1)}]);sQ(e,{type:`success`,message:`Do you want to format the JSON?`,get actions(){return K(t)},onClose:be})},u=WV(()=>(K(ft),K(se),J(KG),K(N),q(()=>!K(ft)&&K(se)&&KG(K(N)))));Q(c,e=>{K(u)&&e(l)}),mQ(U(c,2),{get validationErrors(){return K(ce)},selectError:We}),Z(e,t)};Q(l,e=>{K(n)||e(u)}),G(()=>t=_W(a,1,`jse-contents svelte-k2b9e6`,null,t,{"jse-hidden":K(n)})),Z(e,i)},Dt=e=>{Z(e,_0())};return Q(Tt,e=>{re?e(Dt,-1):e(Et)}),HW(bt,e=>V(oe,e),()=>K(oe)),G(()=>yt=_W(bt,1,`jse-text-mode svelte-k2b9e6`,null,yt,{"no-main-menu":!a()})),Z(e,bt),BW(t,`focus`,be),BW(t,`collapse`,xe),BW(t,`expand`,De),BW(t,`patch`,je),BW(t,`handlePatch`,Me),BW(t,`openTransformModal`,Ie),BW(t,`refresh`,et),BW(t,`flush`,ot),BW(t,`validate`,mt),yB(vt)}OK(`/* over all fonts, sizes, and colors */
|
|
3293
3293
|
/* "consolas" for Windows, "menlo" for Mac with fallback to "monaco", 'Ubuntu Mono' for Ubuntu */
|
|
3294
3294
|
/* (at Mac this font looks too large at 14px, but 13px is too small for the font on Windows) */
|
|
3295
3295
|
/* main, menu, modal */
|
|
@@ -3325,7 +3325,7 @@ button.jse-context-menu-button.svelte-1y5l9l1 svg {
|
|
|
3325
3325
|
.jse-inline-value.jse-highlight.jse-active.svelte-1jv89ui {
|
|
3326
3326
|
background-color: var(--jse-search-match-active-color, var(--jse-search-match-color, #ffe665));
|
|
3327
3327
|
outline: var(--jse-search-match-outline, 2px solid #e0be00);
|
|
3328
|
-
}`);var
|
|
3328
|
+
}`);var b0=X(`<button type="button"> </button>`);OK(`/* over all fonts, sizes, and colors */
|
|
3329
3329
|
/* "consolas" for Windows, "menlo" for Mac with fallback to "monaco", 'Ubuntu Mono' for Ubuntu */
|
|
3330
3330
|
/* (at Mac this font looks too large at 14px, but 13px is too small for the font on Windows) */
|
|
3331
3331
|
/* main, menu, modal */
|
|
@@ -3363,7 +3363,7 @@ button.jse-context-menu-button.svelte-1y5l9l1 svg {
|
|
|
3363
3363
|
}
|
|
3364
3364
|
.jse-column-header.svelte-5pxwfq span.jse-column-sort-icon:where(.svelte-5pxwfq) {
|
|
3365
3365
|
height: 1em;
|
|
3366
|
-
}`);var
|
|
3366
|
+
}`);var x0=X(`<span class="jse-column-sort-icon svelte-5pxwfq"><!></span>`),S0=X(`<button type="button"><span class="jse-column-name"> </span> <!></button>`);OK(`/* over all fonts, sizes, and colors */
|
|
3367
3367
|
/* "consolas" for Windows, "menlo" for Mac with fallback to "monaco", 'Ubuntu Mono' for Ubuntu */
|
|
3368
3368
|
/* (at Mac this font looks too large at 14px, but 13px is too small for the font on Windows) */
|
|
3369
3369
|
/* main, menu, modal */
|
|
@@ -3444,9 +3444,9 @@ button.jse-context-menu-button.svelte-1y5l9l1 svg {
|
|
|
3444
3444
|
}
|
|
3445
3445
|
.jse-table-mode-welcome.svelte-1b9gnk8 .jse-space.jse-after:where(.svelte-1b9gnk8) {
|
|
3446
3446
|
flex: 2;
|
|
3447
|
-
}`);var
|
|
3448
|
-
a JSON Array using <b>Ctrl+V</b>.`,1),
|
|
3449
|
-
document in tree mode.`))},f=e=>{Z(e,
|
|
3447
|
+
}`);var C0=X(`An empty document cannot be opened in table mode. You can go to tree mode instead, or paste
|
|
3448
|
+
a JSON Array using <b>Ctrl+V</b>.`,1),w0=X(`<button type="button" class="jse-nested-array-action svelte-1b9gnk8">Extract</button>`),T0=X(`<div class="jse-nested-property svelte-1b9gnk8"><div class="jse-nested-property-path svelte-1b9gnk8"> <span class="jse-nested-property-count svelte-1b9gnk8"> </span></div> <button type="button" class="jse-nested-array-action svelte-1b9gnk8"> </button> <!></div>`),E0=X(`<div class="jse-table-mode-welcome svelte-1b9gnk8" role="none"><div class="jse-space jse-before svelte-1b9gnk8"></div> <div class="jse-nested-arrays svelte-1b9gnk8"><div class="jse-nested-arrays-title"> </div> <div class="jse-nested-arrays-info svelte-1b9gnk8"><!></div> <!> <button type="button" class="jse-nested-array-action svelte-1b9gnk8">Switch to tree mode</button></div> <div class="jse-space jse-after svelte-1b9gnk8"></div></div>`);function D0(e,t){vB(t,!0);var n=WV(()=>t.json?function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2,n=[];return function e(r,i){Ys(r)&&i.length<t&&Object.keys(r).forEach(t=>{e(r[t],i.concat(t))}),Js(r)&&n.push(i)}(e,[]),n}(t.json).slice(0,99).filter(e=>e.length>0):[]),r=WV(()=>!Vg(K(n))),i=WV(()=>t.json===void 0&&(t.text===``||t.text===void 0)),a=WV(()=>K(r)?`Object with nested arrays`:K(i)?`An empty document`:Ys(t.json)?`An object`:Js(t.json)?`An empty array`:`A ${mG(t.json,t.parser)}`),o=E0(),s=H(U(H(o),2)),c=H(s),l=U(s,2),u=H(l),d=e=>{Z(e,OU(`An object cannot be opened in table mode. You can open a nested array instead, or open the
|
|
3449
|
+
document in tree mode.`))},f=e=>{Z(e,C0())},p=e=>{var t=OU();G(()=>PU(t,`${K(a)??``} cannot be opened in table mode. You can open the document in tree mode instead.`)),Z(e,t)};Q(u,e=>{K(r)?e(d):K(i)&&!t.readOnly?e(f,1):e(p,-1)});var m=U(l,2);nW(m,17,()=>K(n),eW,(e,n)=>{var r=WV(()=>function(e){return lc(t.json,e).length}(K(n))),i=T0(),a=H(i),o=H(a),s=H(U(o)),c=U(a,2),l=H(c),u=U(c,2),d=e=>{var r=w0();xU(`click`,r,()=>t.extractPath(K(n))),Z(e,r)};Q(u,e=>{t.readOnly||e(d)}),G(e=>{PU(o,`"${e??``}" `),PU(s,`(${K(r)??``} ${K(r)===1?`item`:`items`})`),PU(l,t.readOnly?`View`:`Edit`)},[()=>GY(K(n))]),xU(`click`,c,()=>t.openJSONEditorModal(K(n))),Z(e,i)});var h=U(m,2);G(()=>PU(c,K(a))),xU(`click`,o,()=>t.onClick()),xU(`click`,h,()=>t.onChangeMode(qG.tree)),Z(e,o),yB()}SU([`click`]),OK(`/* over all fonts, sizes, and colors */
|
|
3450
3450
|
/* "consolas" for Windows, "menlo" for Mac with fallback to "monaco", 'Ubuntu Mono' for Ubuntu */
|
|
3451
3451
|
/* (at Mac this font looks too large at 14px, but 13px is too small for the font on Windows) */
|
|
3452
3452
|
/* main, menu, modal */
|
|
@@ -3481,7 +3481,7 @@ button.jse-context-menu-button.svelte-1y5l9l1 svg {
|
|
|
3481
3481
|
}
|
|
3482
3482
|
.jse-column-header.svelte-1wgrwv3:not(.jse-column-header.jse-readonly) {
|
|
3483
3483
|
cursor: pointer;
|
|
3484
|
-
}`);var
|
|
3484
|
+
}`);var O0=X(`<button type="button"><!></button>`);OK(`/* over all fonts, sizes, and colors */
|
|
3485
3485
|
/* "consolas" for Windows, "menlo" for Mac with fallback to "monaco", 'Ubuntu Mono' for Ubuntu */
|
|
3486
3486
|
/* (at Mac this font looks too large at 14px, but 13px is too small for the font on Windows) */
|
|
3487
3487
|
/* main, menu, modal */
|
|
@@ -3622,7 +3622,7 @@ button.jse-context-menu-button.svelte-1y5l9l1 svg {
|
|
|
3622
3622
|
box-sizing: border-box;
|
|
3623
3623
|
font-family: var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);
|
|
3624
3624
|
font-size: var(--jse-font-size, 16px);
|
|
3625
|
-
}`);var O0=X(`<div class="jse-table-root-error svelte-1p86y3c"><!></div>`),k0=X(`<th class="jse-table-cell jse-table-cell-header svelte-1p86y3c"><!></th>`),A0=X(`<th class="jse-table-cell jse-table-cell-header svelte-1p86y3c"><!></th>`),j0=X(`<th class="jse-table-cell jse-table-cell-gutter svelte-1p86y3c"> <!></th>`),M0=X(`<div class="jse-context-menu-anchor svelte-1p86y3c"><!></div>`),N0=X(`<td class="jse-table-cell svelte-1p86y3c"><div><!><!></div> <!></td>`),P0=X(`<td class="jse-table-cell svelte-1p86y3c"></td>`),F0=X(`<tr class="jse-table-row svelte-1p86y3c"><!><!><!></tr>`),I0=X(`<div class="jse-search-box-container svelte-1p86y3c"><!></div> <div class="jse-contents svelte-1p86y3c"><table class="jse-table-main svelte-1p86y3c"><tbody><tr class="jse-table-row jse-table-row-header svelte-1p86y3c"><th class="jse-table-cell jse-table-cell-header svelte-1p86y3c"><!></th><!><!></tr><tr><td class="svelte-1p86y3c"></td></tr><!><tr class="jse-table-invisible-end-section svelte-1p86y3c"><td class="svelte-1p86y3c"></td></tr></tbody></table></div> <!> <!> <!> <!>`,1),L0=X(`<!> <!>`,1),R0=X(`<label class="jse-hidden-input-label svelte-1p86y3c"><input type="text" tabindex="-1" class="jse-hidden-input svelte-1p86y3c"/></label> <!>`,1),z0=X(`<div class="jse-contents jse-contents-loading svelte-1p86y3c"><div class="jse-loading-space svelte-1p86y3c"></div> <div class="jse-loading svelte-1p86y3c">loading...</div></div>`),B0=X(`<div role="table"><!> <!></div> <!> <!>`,1);function V0(e,t){vB(t,!1);var n=B(void 0,!0),r=B(void 0,!0),i=B(void 0,!0),a=$W(`jsoneditor:TableMode`),{openAbsolutePopup:o,closeAbsolutePopup:s}=_B(`absolute-popup`),c=YZ(),l=c_(),u=c_(),d=typeof window>`u`;a(`isSSR:`,d);var f=$(t,`readOnly`,9),p=$(t,`externalContent`,9),m=$(t,`externalSelection`,9),h=$(t,`history`,9),g=$(t,`truncateTextSize`,9),_=$(t,`mainMenuBar`,9),v=$(t,`escapeControlCharacters`,9),y=$(t,`escapeUnicodeCharacters`,9),b=$(t,`flattenColumns`,9),x=$(t,`parser`,9),S=$(t,`parseMemoizeOne`,9),C=$(t,`validator`,9),w=$(t,`validationParser`,9),T=$(t,`indentation`,9),E=$(t,`onChange`,9),ee=$(t,`onChangeMode`,9),te=$(t,`onSelect`,9),D=$(t,`onUndo`,9),ne=$(t,`onRedo`,9),re=$(t,`onRenderValue`,9),ie=$(t,`onRenderMenu`,9),ae=$(t,`onRenderContextMenu`,9),oe=$(t,`onFocus`,9),O=$(t,`onBlur`,9),k=$(t,`onSortModal`,9),se=$(t,`onTransformModal`,9),ce=$(t,`onJSONEditorModal`,9),le=B(void 0,!0),ue=B(void 0,!0),A=B(void 0,!0),de=B(void 0,!0),fe=B(void 0,!0);rQ({onMount:KU,onDestroy:qU,getWindow:()=>_K(K(ue)),hasFocus:()=>we&&document.hasFocus()||vK(K(ue)),onFocus:()=>{Te=!0,oe()&&oe()()},onBlur:()=>{Te=!1,O()&&O()()}});var pe,j=B(void 0,!0),me=B(void 0,!0),M=B(void 0,!0),he=B(void 0,!0),N=B(void 0,!0),ge=B(void 0,!0),P=B(!1,!0),F=B(!1,!0);function _e(e){V(ge,(pe=e)?AY(K(j),pe.items):void 0)}function ve(e){return ye.apply(this,arguments)}function ye(){return(ye=pz(function*(e){V(I,void 0),yield $e(e)})).apply(this,arguments)}function be(){V(P,!1),V(F,!1),Ye()}var xe=B(1e4,!0),Se=B([],!0),Ce=B(void 0,!0),we=!1,Te=!1,Ee=B(!1,!0),De=B({},!0),Oe=B(600,!0),ke=B(0,!0),Ae=18;function je(e){V(I,e)}function Me(e){K(I)&&e!==void 0&&(hc(e,tY(K(I)))&&hc(e,eY(K(I)))||(a(`clearing selection: path does not exist anymore`,K(I)),V(I,void 0)))}var Ne=B(K(j)===void 0?void 0:zq({json:K(j)}),!0),I=B(CJ(m())?m():void 0,!0),Pe=B(void 0,!0),Fe=B(!1,!0);function Ie(e){if(!f()){a(`onSortByHeader`,e);var t=e.sortDirection===QG.desc?-1:1;We(T$(K(j),[],e.path,t),(t,n)=>({state:n,sortedColumn:e}))}}KU(()=>{K(I)&&tt(eY(K(I)))});var Le=B(void 0,!0);function Re(e){if(e.json!==void 0||e.text!==void 0){var t=K(j)!==void 0&&e.json!==void 0;h().add({type:`tree`,undo:{patch:t?[{op:`replace`,path:``,value:e.json}]:void 0,json:e.json,text:e.text,documentState:e.documentState,textIsRepaired:e.textIsRepaired,selection:LJ(e.selection),sortedColumn:e.sortedColumn},redo:{patch:t?[{op:`replace`,path:``,value:K(j)}]:void 0,json:K(j),text:K(me),documentState:K(Ne),textIsRepaired:K(Fe),selection:LJ(K(I)),sortedColumn:K(Pe)}})}}var ze=B([],!0),Be=kv(eQ);function Ve(e,t,n,r){XZ(()=>{var i;try{i=Be(e,t,n,r)}catch(e){i=[{path:[],message:`Failed to validate: `+e.message,severity:XG.warning}]}Vg(i,K(ze))||(a(`validationErrors changed:`,i),V(ze,i))},e=>a(`validationErrors updated in ${e} ms`))}function He(){return a(`validate`),K(M)?{parseError:K(M),isRepairable:!1}:(Ve(K(j),C(),x(),w()),Bg(K(ze))?void 0:{validationErrors:K(ze)})}function Ue(e,t){if(a(`patch`,e,t),K(j)===void 0)throw Error(`Cannot apply patch: no JSON`);var n=K(j),r={json:void 0,text:K(me),documentState:K(Ne),selection:LJ(K(I)),sortedColumn:K(Pe),textIsRepaired:K(Fe)},i=_Y(K(j),e),o=Zq(K(j),K(Ne),e),s=n1(K(Pe),e,K(Se)),c=typeof t==`function`?t(o.json,o.documentState,K(I)):void 0;return V(j,c?.json===void 0?o.json:c.json),V(Ne,c?.state===void 0?o.documentState:c.state),V(I,c?.selection===void 0?K(I):c.selection),V(Pe,c?.sortedColumn===void 0?s:c.sortedColumn),V(me,void 0),V(Fe,!1),V(he,void 0),V(N,void 0),V(M,void 0),h().add({type:`tree`,undo:R({patch:i},r),redo:{patch:e,json:void 0,text:void 0,documentState:K(Ne),selection:LJ(K(I)),sortedColumn:K(Pe),textIsRepaired:K(Fe)}}),{json:K(j),previousJson:n,undo:i,redo:e}}function We(e,t){a(`handlePatch`,e,t);var n={json:K(j),text:K(me)},r=Ue(e,t);return Ge(n,r),r}function Ge(e,t){if((e.json!==void 0||e?.text!==void 0)&&E()){if(K(me)!==void 0){var n={text:K(me),json:void 0};E()(n,e,{contentErrors:He(),patchResult:t})}else if(K(j)!==void 0){var r={text:void 0,json:K(j)};E()(r,e,{contentErrors:He(),patchResult:t})}}}function Ke(e){a(`pasted json as text`,e),V(he,e)}function qe(e){a(`pasted multiline text`,{pastedText:e}),V(N,e)}function Je(e){var t=parseInt(e[0],10),n=[String(t+1),...e.slice(1)];return hc(K(j),n)?BJ(n):BJ(e)}function Ye(){a(`focus`),K(de)&&(K(de).focus(),K(de).select())}function Xe(e){V(ke,e.target.scrollTop)}function Ze(){K(I)||V(I,function(){if(Js(K(j))&&!Bg(K(j))&&!Bg(K(Se)))return BJ([`0`,...K(Se)[0]])}())}function Qe(){if(K(Fe)&&K(j)!==void 0){var e={json:K(j),text:K(me)},t={json:K(j),documentState:K(Ne),selection:K(I),sortedColumn:K(Pe),text:K(me),textIsRepaired:K(Fe)};V(me,void 0),V(Fe,!1),Me(K(j)),Re(t),Ge(e,void 0)}return{json:K(j),text:K(me)}}function $e(e){var{scrollToWhenVisible:t=!0}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=K(P)?mq:0,r=X$(e,K(Se),De,Ae),i=r-K(ke)+n+Ae,o=nt(e);if(a(`scrollTo`,{path:e,top:r,scrollTop:K(ke),elem:o}),!K(A))return Promise.resolve();var s=K(A).getBoundingClientRect();if(o&&!t){var l=o.getBoundingClientRect();if(l.bottom>s.top&&l.top<s.bottom)return Promise.resolve()}var u=-Math.max(n+2*Ae,s.height/4);return new Promise(o?t=>{c(o,{container:K(A),offset:u,duration:300,callback:()=>{et(e),t()}})}:t=>{c(i,{container:K(A),offset:u,duration:300,callback:()=>{uV(),et(e),t()}})})}function et(e){var t=nt(e);if(t&&K(A)){var n=K(A).getBoundingClientRect(),r=t.getBoundingClientRect();if(r.right>n.right){var i=r.right-n.right;iH(A,K(A).scrollLeft+=i)}if(r.left<n.left){var a=n.left-r.left;iH(A,K(A).scrollLeft-=a)}}}function tt(e){(function(e){if(K(A)){var{rowIndex:t}=Z$(e,K(Se)),n=X$(e,K(Se),De,Ae),r=n+(De[t]||Ae),i=Ae,a=K(A).getBoundingClientRect(),o=K(ke),s=K(ke)+a.height-i;if(r>s){var c=r-s;iH(A,K(A).scrollTop+=c)}if(n<o){var l=o-n;iH(A,K(A).scrollTop-=l)}}})(e),et(e)}function nt(e){var t=K(Se).find(t=>IJ(e.slice(1),t)),n=t?e.slice(0,1).concat(t):e;return K(A)?.querySelector(`td[data-path="${xK(n)}"]`)??void 0}function rt(e){var{anchor:t,left:n,top:r,width:i,height:a,offsetTop:c,offsetLeft:l,showTip:u}=e,d=function(e){var{json:t,documentState:n,selection:r,readOnly:i,onEditValue:a,onEditRow:o,onToggleEnforceString:s,onCut:c,onCopy:l,onPaste:u,onRemove:d,onDuplicateRow:f,onInsertBeforeRow:p,onInsertAfterRow:m,onRemoveRow:h}=e,g=t!==void 0,_=!!r,v=t!==void 0&&r?lc(t,eY(r)):void 0,y=g&&(xJ(r)||yJ(r)||bJ(r)),b=!i&&g&&r!==void 0&&PJ(r),x=b&&!cG(v),S=!i&&y,C=r!==void 0&&oJ(t,n,eY(r));return[{type:`separator`},{type:`row`,items:[{type:`column`,items:[{type:`label`,text:`Table cell:`},{type:`dropdown-button`,main:{type:`button`,onClick:()=>a(),icon:nv,text:`Edit`,title:`Edit the value (Double-click on the value)`,disabled:!b},width:`11em`,items:[{type:`button`,icon:nv,text:`Edit`,title:`Edit the value (Double-click on the value)`,onClick:()=>a(),disabled:!b},{type:`button`,icon:C?G_:Z_,text:`Enforce string`,title:`Enforce keeping the value as string when it contains a numeric value`,onClick:()=>s(),disabled:!x}]},{type:`dropdown-button`,main:{type:`button`,onClick:()=>c(!0),icon:H_,text:`Cut`,title:`Cut selected contents, formatted with indentation (Ctrl+X)`,disabled:!S},width:`10em`,items:[{type:`button`,icon:H_,text:`Cut formatted`,title:`Cut selected contents, formatted with indentation (Ctrl+X)`,onClick:()=>c(!0),disabled:i||!y},{type:`button`,icon:H_,text:`Cut compacted`,title:`Cut selected contents, without indentation (Ctrl+Shift+X)`,onClick:()=>c(!1),disabled:i||!y}]},{type:`dropdown-button`,main:{type:`button`,onClick:()=>l(!0),icon:hv,text:`Copy`,title:`Copy selected contents, formatted with indentation (Ctrl+C)`,disabled:!y},width:`12em`,items:[{type:`button`,icon:hv,text:`Copy formatted`,title:`Copy selected contents, formatted with indentation (Ctrl+C)`,onClick:()=>l(!1),disabled:!y},{type:`button`,icon:hv,text:`Copy compacted`,title:`Copy selected contents, without indentation (Ctrl+Shift+C)`,onClick:()=>l(!1),disabled:!y}]},{type:`button`,onClick:()=>u(),icon:B_,text:`Paste`,title:`Paste clipboard contents (Ctrl+V)`,disabled:i||!_},{type:`button`,onClick:()=>d(),icon:L_,text:`Remove`,title:`Remove selected contents (Delete)`,disabled:i||!y}]},{type:`column`,items:[{type:`label`,text:`Table row:`},{type:`button`,onClick:()=>o(),icon:nv,text:`Edit row`,title:`Edit the current row`,disabled:i||!_||!g},{type:`button`,onClick:()=>f(),icon:Sv,text:`Duplicate row`,title:`Duplicate the current row (Ctrl+D)`,disabled:i||!_||!g},{type:`button`,onClick:()=>p(),icon:gv,text:`Insert before`,title:`Insert a row before the current row`,disabled:i||!_||!g},{type:`button`,onClick:()=>m(),icon:gv,text:`Insert after`,title:`Insert a row after the current row`,disabled:i||!_||!g},{type:`button`,onClick:()=>h(),icon:L_,text:`Remove row`,title:`Remove current row`,disabled:i||!_||!g}]}]}]}({json:K(j),documentState:K(Ne),selection:K(I),readOnly:f(),onEditValue:ot,onEditRow:st,onToggleEnforceString:ct,onCut:vt,onCopy:bt,onPaste:dt,onRemove:St,onDuplicateRow:wt,onInsertBeforeRow:Tt,onInsertAfterRow:Et,onRemoveRow:Dt}),p=ae()(d)??d;if(!1!==p){var m={left:n,top:r,offsetTop:c,offsetLeft:l,width:i,height:a,anchor:t,closeOnOuterClick:!0,onClose:()=>{we=!1,Ye()}};we=!0;var h=o(A1,{tip:u?`Tip: you can open this context menu via right-click or with Ctrl+Q`:void 0,items:p,onRequestClose(){s(h),Ye()}},m)}}function it(e){if(!KJ(K(I)))if(e&&(e.stopPropagation(),e.preventDefault()),e&&e.type===`contextmenu`&&e.target!==K(de))rt({left:e.clientX,top:e.clientY,width:pq,height:fq,showTip:!1});else{var t=K(A)?.querySelector(`.jse-table-cell.jse-selected-value`);if(t)rt({anchor:t,offsetTop:2,width:pq,height:fq,showTip:!1});else{var n=K(A)?.getBoundingClientRect();n&&rt({top:n.top+2,left:n.left+2,width:pq,height:fq,showTip:!1})}}}function at(e){rt({anchor:yK(e.target,`BUTTON`),offsetTop:0,width:pq,height:fq,showTip:!0})}function ot(){if(!f()&&K(I)){var e=eY(K(I));cG(lc(K(j),e))?Ft(e):V(I,BJ(e))}}function st(){!f()&&K(I)&&Ft(eY(K(I)).slice(0,1))}function ct(){if(!f()&&bJ(K(I))){var e=K(I).path,t=_c(e),n=lc(K(j),e),r=!oJ(K(j),K(Ne),e),i=r?String(n):_G(String(n),x());a(`handleToggleEnforceString`,{enforceString:r,value:n,updatedValue:i}),We([{op:`replace`,path:t,value:i}],(t,n)=>({state:tJ(K(j),n,e,{type:`value`,enforceString:r})}))}}function lt(){return ut.apply(this,arguments)}function ut(){return(ut=pz(function*(){if(a(`apply pasted json`,K(he)),K(he)){var{onPasteAsJson:e}=K(he);e(),setTimeout(Ye)}})).apply(this,arguments)}function dt(){return ft.apply(this,arguments)}function ft(){return(ft=pz(function*(){try{At(yield navigator.clipboard.readText())}catch(e){console.error(e),V(Ee,!0)}})).apply(this,arguments)}function pt(){return mt.apply(this,arguments)}function mt(){return(mt=pz(function*(){a(`apply pasted multiline text`,K(N)),K(N)&&(At(JSON.stringify(K(N))),setTimeout(Ye))})).apply(this,arguments)}function ht(){a(`clear pasted json`),V(he,void 0),Ye()}function gt(){a(`clear pasted multiline text`),V(N,void 0),Ye()}function _t(){ee()(qG.text)}function vt(e){return yt.apply(this,arguments)}function yt(){return(yt=pz(function*(e){yield i1({json:K(j),selection:K(I),indentation:e?T():void 0,readOnly:f(),parser:x(),onPatch:We})})).apply(this,arguments)}function bt(){return xt.apply(this,arguments)}function xt(){return xt=pz(function*(){var e=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];K(j)!==void 0&&(yield o1({json:K(j),selection:K(I),indentation:e?T():void 0,parser:x()}))}),xt.apply(this,arguments)}function St(){l1({json:K(j),text:K(me),selection:K(I),keepSelection:!0,readOnly:f(),onChange:E(),onPatch:We})}function Ct(e){f()||(a(`extract`,{path:e}),We(dY(K(j),BJ(e))))}function wt(){(function(e){var{json:t,selection:n,columns:r,readOnly:i,onPatch:a}=e;if(!i&&t!==void 0&&n&&qJ(n)){var{rowIndex:o,columnIndex:s}=Z$(eY(n),r);r1(`duplicate row`,{rowIndex:o}),a(uY(t,[[String(o)]]),(e,n)=>({state:n,selection:BJ(Q$({rowIndex:o<t.length?o+1:o,columnIndex:s},r))}))}})({json:K(j),selection:K(I),columns:K(Se),readOnly:f(),onPatch:We})}function Tt(){(function(e){var{json:t,selection:n,columns:r,readOnly:i,onPatch:a}=e;if(!i&&t!==void 0&&n&&qJ(n)){var{rowIndex:o}=Z$(eY(n),r);r1(`insert before row`,{rowIndex:o}),a(sY(t,[String(o)],[{key:``,value:Ys(t[0])?{}:``}]))}})({json:K(j),selection:K(I),columns:K(Se),readOnly:f(),onPatch:We})}function Et(){(function(e){var{json:t,selection:n,columns:r,readOnly:i,onPatch:a}=e;if(!i&&t!==void 0&&n&&qJ(n)){var{rowIndex:o,columnIndex:s}=Z$(eY(n),r);r1(`insert after row`,{rowIndex:o});var c=o+1,l=[String(c)],u=[{key:``,value:Ys(t[0])?{}:``}];a(c<t.length?sY(t,l,u):cY(t,[],u),(e,t)=>({state:t,selection:BJ(Q$({rowIndex:c,columnIndex:s},r))}))}})({json:K(j),selection:K(I),columns:K(Se),readOnly:f(),onPatch:We})}function Dt(){(function(e){var{json:t,selection:n,columns:r,readOnly:i,onPatch:a}=e;if(!i&&t!==void 0&&n&&qJ(n)){var{rowIndex:o,columnIndex:s}=Z$(eY(n),r);r1(`remove row`,{rowIndex:o}),a(pY([[String(o)]]),(e,t)=>{var n=o<e.length?o:o>0?o-1:void 0,i=n===void 0?void 0:BJ(Q$({rowIndex:n,columnIndex:s},r));return r1(`remove row new selection`,{rowIndex:o,newRowIndex:n,newSelection:i}),{state:t,selection:i}})}})({json:K(j),selection:K(I),columns:K(Se),readOnly:f(),onPatch:We})}function Ot(){return(Ot=pz(function*(e){yield d1({char:e,selectInside:!1,json:K(j),selection:K(I),readOnly:f(),parser:x(),onPatch:We,onReplaceJson:jt,onSelect:je})})).apply(this,arguments)}function kt(e){e.preventDefault(),At(e.clipboardData?.getData(`text/plain`))}function At(e){e!==void 0&&c1({clipboardText:e,json:K(j),selection:K(I),readOnly:f(),parser:x(),onPatch:We,onChangeText:Mt,onPasteMultilineText:qe,openRepairModal:It})}function jt(e,t){var n={json:K(j),text:K(me)},r={json:K(j),documentState:K(Ne),selection:K(I),sortedColumn:K(Pe),text:K(me),textIsRepaired:K(Fe)},i=Wq(e,K(Ne)),a=typeof t==`function`?t(e,i,K(I)):void 0;V(j,a?.json===void 0?e:a.json),V(Ne,a?.state===void 0?i:a.state),V(I,a?.selection===void 0?K(I):a.selection),V(Pe,void 0),V(me,void 0),V(Fe,!1),V(M,void 0),Me(K(j)),Re(r),Ge(n,void 0)}function Mt(e,t){a(`handleChangeText`);var n={json:K(j),text:K(me)},r={json:K(j),documentState:K(Ne),selection:K(I),sortedColumn:K(Pe),text:K(me),textIsRepaired:K(Fe)};try{V(j,S()(e)),V(Ne,Wq(K(j),K(Ne))),V(me,void 0),V(Fe,!1),V(M,void 0)}catch(t){try{V(j,S()(yl(e))),V(Ne,Wq(K(j),K(Ne))),V(me,e),V(Fe,!0),V(M,void 0)}catch{V(j,void 0),V(Ne,void 0),V(me,e),V(Fe,!1),V(M,K(me)===``?void 0:MG(K(me),t.message||String(t)))}}if(typeof t==`function`){var i=t(K(j),K(Ne),K(I));V(j,i?.json===void 0?K(j):i.json),V(Ne,i?.state===void 0?K(Ne):i.state),V(I,i?.selection===void 0?K(I):i.selection)}Me(K(j)),Re(r),Ge(n,void 0)}function Nt(e){a(`select validation error`,e),V(I,BJ(e.path)),$e(e.path)}function Pt(e){if(K(j)!==void 0){var{id:t,onTransform:n,onClose:r}=e,i=e.rootPath||[];we=!0,se()({id:t||u,json:K(j),rootPath:i||[],onTransform:e=>{n?n({operations:e,json:K(j),transformedJson:bc(K(j),e)}):(a(`onTransform`,i,e),We(e))},onClose:()=>{we=!1,setTimeout(Ye),r&&r()}})}}function Ft(e){a(`openJSONEditorModal`,{path:e}),we=!0,ce()({content:{json:lc(K(j),e)},path:e,onPatch:We,onClose:()=>{we=!1,setTimeout(Ye)}})}function It(e,t){V(fe,{text:e,onParse:e=>kG(e,e=>DG(e,x())),onRepair:AG,onApply:t,onClose:Ye})}function Lt(){(function(e){f()||K(j)===void 0||(we=!0,k()({id:l,json:K(j),rootPath:e,onSort:t=>{var{operations:n,itemPath:r,direction:i}=t;a(`onSort`,n,e,r,i),We(n,(e,t)=>({state:t,sortedColumn:{path:r,sortDirection:i===-1?QG.desc:QG.asc}}))},onClose:()=>{we=!1,setTimeout(Ye)}}))})([])}function Rt(){Pt({rootPath:[]})}function zt(e){a(`openFind`,{findAndReplace:e}),V(P,!1),V(F,!1),uV(),V(P,!0),V(F,e)}function Bt(){if(!f()&&h().canUndo){var e=h().undo();if(Iq(e)){var t={json:K(j),text:K(me)};V(j,e.undo.patch?bc(K(j),e.undo.patch):e.undo.json),V(Ne,e.undo.documentState),V(I,e.undo.selection),V(Pe,e.undo.sortedColumn),V(me,e.undo.text),V(Fe,e.undo.textIsRepaired),V(M,void 0),a(`undo`,{item:e,json:K(j)}),Ge(t,e.undo.patch&&e.redo.patch?{json:K(j),previousJson:t.json,redo:e.undo.patch,undo:e.redo.patch}:void 0),Ye(),K(I)&&$e(eY(K(I)),{scrollToWhenVisible:!1})}else D()(e)}}function Vt(){if(!f()&&h().canRedo){var e=h().redo();if(Iq(e)){var t={json:K(j),text:K(me)};V(j,e.redo.patch?bc(K(j),e.redo.patch):e.redo.json),V(Ne,e.redo.documentState),V(I,e.redo.selection),V(Pe,e.redo.sortedColumn),V(me,e.redo.text),V(Fe,e.redo.textIsRepaired),V(M,void 0),a(`redo`,{item:e,json:K(j)}),Ge(t,e.undo.patch&&e.redo.patch?{json:K(j),previousJson:t.json,redo:e.redo.patch,undo:e.undo.patch}:void 0),Ye(),K(I)&&$e(eY(K(I)),{scrollToWhenVisible:!1})}else ne()(e)}}function Ht(e){V(Oe,e.getBoundingClientRect().height)}W(()=>(J(v()),J(y())),()=>{V(le,tK({escapeControlCharacters:v(),escapeUnicodeCharacters:y()}))}),W(()=>K(P),()=>{(function(e){if(K(A)){var t=e?mq:-100;K(A).scrollTo({top:iH(A,K(A).scrollTop+=t),left:K(A).scrollLeft})}})(K(P))}),W(()=>J(p()),()=>{(function(e){var t={json:K(j)},n=FG(e)?e.text!==K(me):!Vg(t.json,e.json);if(a(`update external content`,{isChanged:n}),n){var r={json:K(j),documentState:K(Ne),selection:K(I),sortedColumn:K(Pe),text:K(me),textIsRepaired:K(Fe)};if(FG(e))try{V(j,S()(e.text)),V(Ne,Wq(K(j),K(Ne))),V(me,e.text),V(Fe,!1),V(M,void 0)}catch(t){try{V(j,S()(yl(e.text))),V(Ne,Wq(K(j),K(Ne))),V(me,e.text),V(Fe,!0),V(M,void 0)}catch{V(j,void 0),V(Ne,void 0),V(me,e.text),V(Fe,!1),V(M,K(me)===``?void 0:MG(K(me),t.message||String(t)))}}else V(j,e.json),V(Ne,Wq(K(j),K(Ne))),V(me,void 0),V(Fe,!1),V(M,void 0);Me(K(j)),V(Pe,void 0),Re(r)}})(p())}),W(()=>J(m()),()=>{(function(e){Vg(K(I),e)||(a(`applyExternalSelection`,{selection:K(I),externalSelection:e}),CJ(e)&&V(I,e))})(m())}),W(()=>(K(Se),K(j),J(b()),K(xe)),()=>{V(Se,Js(K(j))?function(e,t){var n=new Set(t.map(_c)),r=new Set(e.map(_c));for(var i of n)r.has(i)||n.delete(i);for(var a of r)n.has(a)||n.add(a);return[...n].map(gc)}(K$(K(j),b(),K(xe)),K(Se)):[])}),W(()=>(K(j),K(Se)),()=>{V(Ce,!(!K(j)||Bg(K(Se))))}),W(()=>(K(j),K(xe)),()=>{V(n,Array.isArray(K(j))&&K(j).length>K(xe))}),W(()=>(K(ke),K(Oe),K(j),K(P),mq),()=>{V(r,Y$(K(ke),K(Oe),K(j),De,Ae,K(P)?mq:0))}),W(()=>K(j),()=>{K(j),K(A)&&K(A).scrollTo({top:K(A).scrollTop,left:K(A).scrollLeft})}),W(()=>K(I),()=>{var e=K(I);Vg(e,m())||(a(`onSelect`,e),te()(e))}),W(()=>(J(f()),J(g()),J(x()),K(le),K(j),K(Ne),J(re())),()=>{V(Le,{mode:qG.table,readOnly:f(),truncateTextSize:g(),parser:x(),normalization:K(le),getJson:()=>K(j),getDocumentState:()=>K(Ne),findElement:nt,findNextInside:Je,focus:Ye,onPatch:(e,t)=>We(function(e,t){return e.flatMap(e=>{if(Qs(e)){var n=gc(e.path);if(n.length>0){for(var r=[e],i=Ig(n);i.length>0&&!hc(t,i);)r.unshift({op:`add`,path:_c(i),value:{}}),i=Ig(i);return r}}return e})}(e,K(j)),t),onSelect:je,onFind:zt,onPasteJson:Ke,onRenderValue:re()})}),W(()=>(K(j),J(C()),J(x()),J(w())),()=>{Ve(K(j),C(),x(),w())}),W(()=>(K(ze),K(Se)),()=>{V(i,$$(K(ze),K(Se)))}),DH();var Ut={validate:He,patch:Ue,focus:Ye,acceptAutoRepair:Qe,scrollTo:$e,findElement:nt,openTransformModal:Pt};GW(!0);var Wt=B0();Y(`mousedown`,YV,function(e){!hK(e.target,e=>e===K(ue))&&KJ(K(I))&&(a(`click outside the editor, exit edit mode`),V(I,LJ(K(I))),Te&&K(de)&&(K(de).focus(),K(de).blur()),a(`blur (outside editor)`),K(de)&&K(de).blur())});var Gt,Kt=hH(Wt),qt=H(Kt),Jt=e=>{(function(e,t){vB(t,!1);var n=$(t,`containsValidArray`,9),r=$(t,`readOnly`,9),i=$(t,`showSearch`,13,!1),a=$(t,`history`,9),o=$(t,`onSort`,9),s=$(t,`onTransform`,9),c=$(t,`onContextMenu`,9),l=$(t,`onUndo`,9),u=$(t,`onRedo`,9),d=$(t,`onRenderMenu`,9);function f(){i(!i())}var p=B(void 0,!0),m=B(void 0,!0);W(()=>(J(r()),J(o()),J(n()),J(s()),J(c()),J(l()),J(a()),J(u())),()=>{V(p,r()?[{type:`space`}]:[{type:`button`,icon:uv,title:`Sort`,className:`jse-sort`,onClick:o(),disabled:r()||!n()},{type:`button`,icon:Q_,title:`Transform contents (filter, sort, project)`,className:`jse-transform`,onClick:s(),disabled:r()||!n()},{type:`button`,icon:pv,title:`Search (Ctrl+F)`,className:`jse-search`,onClick:f,disabled:!n()},{type:`button`,icon:cv,title:oq,className:`jse-contextmenu`,onClick:c()},{type:`separator`},{type:`button`,icon:iv,title:`Undo (Ctrl+Z)`,className:`jse-undo`,onClick:l(),disabled:!a().canUndo},{type:`button`,icon:rv,title:`Redo (Ctrl+Shift+Z)`,className:`jse-redo`,onClick:u(),disabled:!a().canRedo},{type:`space`}])}),W(()=>(J(d()),K(p)),()=>{V(m,d()(K(p))||K(p))}),DH(),GW(!0),CQ(e,{get items(){return K(m)}}),yB()})(e,{get containsValidArray(){return K(Ce)},get readOnly(){return f()},get history(){return h()},onSort:Lt,onTransform:Rt,onUndo:Bt,onRedo:Vt,onContextMenu:at,get onRenderMenu(){return ie()},get showSearch(){return K(P)},set showSearch(e){V(P,e)},$$legacy:!0})};Q(qt,e=>{_()&&e(Jt)});var Yt=U(qt,2),Xt=e=>{var t=R0(),a=hH(t),o=H(a);o.readOnly=!0,HW(o,e=>V(de,e),()=>K(de));var s=U(a,2),c=e=>{var t=I0(),a=hH(t);W$(H(a),{get json(){return K(j)},get documentState(){return K(Ne)},get parser(){return x()},get showSearch(){return K(P)},get showReplace(){return K(F)},get readOnly(){return f()},get columns(){return K(Se)},onSearch:_e,onFocus:ve,onPatch:We,onClose:be});var o=U(a,2),s=H(H(H(o))),c=H(s),l=H(c),u=e=>{var t=GV(()=>(J(e1),K(i),q(()=>e1([],K(i)?.root)))),n=kU(),r=hH(n),a=e=>{var n=O0();BQ(H(n),{get validationError(){return K(t)},get onExpand(){return Q1}}),Z(e,n)};Q(r,e=>{K(t)&&e(a)}),Z(e,n)},d=WV(()=>(J(Bg),K(i),q(()=>!Bg(K(i)?.root))));Q(l,e=>{K(d)&&e(u)});var p=U(c);nW(p,1,()=>K(Se),eW,(e,t)=>{var n=k0();(function(e,t){vB(t,!1);var n=B(void 0,!0),r=B(void 0,!0),i=B(void 0,!0),a=$(t,`path`,9),o=$(t,`sortedColumn`,9),s=$(t,`readOnly`,9),c=$(t,`onSort`,9);W(()=>(J(a()),GY),()=>{V(n,Bg(a())?`values`:GY(a()))}),W(()=>(J(o()),J(a())),()=>{V(r,o()&&Vg(a(),o()?.path)?o().sortDirection:void 0)}),W(()=>(K(r),hq),()=>{V(i,K(r)?hq[K(r)]:void 0)}),DH(),GW(!0);var l,u=x0(),d=H(u),f=H(d),p=U(d,2),m=e=>{var t=b0(),n=H(t),a=GV(()=>(K(r),J(QG),J(sv),J(X_),q(()=>K(r)===QG.asc?sv:X_)));GK(n,{get data(){return K(a)}}),G(()=>jW(t,`title`,`Currently sorted in ${K(i)} order`)),Z(e,t)};Q(p,e=>{K(r)!==void 0&&e(m)}),G(e=>{l=_W(u,1,`jse-column-header svelte-5pxwfq`,null,l,{"jse-readonly":s()}),jW(u,`title`,s()?K(n):K(n)+` (Click to sort the data by this column)`),PU(f,e)},[()=>(J(FK),K(n),J(50),q(()=>FK(K(n),50)))]),Y(`click`,u,function(){s()||c()({path:a(),sortDirection:K(r)===QG.asc?QG.desc:QG.asc})}),Z(e,u),yB()})(H(n),{get path(){return K(t)},get sortedColumn(){return K(Pe)},get readOnly(){return f()},onSort:Ie}),Z(e,n)});var m=U(p),h=e=>{var t=A0(),n=H(t),r=GV(()=>(K(j),q(()=>Array.isArray(K(j))?K(j).length:0)));(function(e,t){vB(t,!1);var n=$(t,`count`,9),r=$(t,`maxSampleCount`,9),i=$(t,`readOnly`,9),a=$(t,`onRefresh`,9);GW(!0);var o,s=D0();GK(H(s),{get data(){return bv}}),G(()=>{o=_W(s,1,`jse-column-header svelte-1wgrwv3`,null,o,{"jse-readonly":i()}),jW(s,`title`,`The Columns are created by sampling ${r()} items out of ${n()}. If you're missing a column, click here to sample all of the items instead of a subset. This is slower.`)}),Y(`click`,s,()=>a()()),Z(e,s),yB()})(n,{get count(){return K(r)},get maxSampleCount(){return K(xe)},get readOnly(){return f()},onRefresh:()=>V(xe,1/0)}),Z(e,t)};Q(m,e=>{K(n)&&e(h)});var g,_,v=U(s),y=H(v),b=U(v);nW(b,1,()=>(K(r),q(()=>K(r).visibleItems)),eW,(e,t,a)=>{var o=GV(()=>(K(r),q(()=>K(r).startIndex+a))),s=GV(()=>(K(i),J(K(o)),q(()=>K(i).rows[K(o)]))),c=GV(()=>(J(e1),J(K(o)),J(K(s)),q(()=>e1([String(K(o))],K(s)?.row)))),l=GV(()=>(J($q),K(j),K(ge),J(K(o)),q(()=>$q(K(j),K(ge),[String(K(o))])))),u=F0(),d=H(u);$U(d,()=>K(o),e=>{var t=j0(),n=H(t),r=U(n),i=e=>{BQ(e,{get validationError(){return K(c)},get onExpand(){return Q1}})};Q(r,e=>{K(c)&&e(i)}),uW(t,(e,t)=>N1?.(e,t),()=>e=>function(e,t){De[t]=e.getBoundingClientRect().height}(e,K(o))),G(()=>PU(n,`${K(o)??``} `)),Z(e,t)});var p=U(d);nW(p,1,()=>K(Se),eW,(e,n,r,i)=>{var a,c=GV(()=>(J(K(o)),K(n),q(()=>[String(K(o))].concat(K(n))))),u=GV(()=>(J(lc),K(t),K(n),q(()=>lc(K(t),K(n))))),d=GV(()=>(J(bJ),K(I),J(IJ),J(K(c)),q(()=>bJ(K(I))&&IJ(K(I).path,K(c))))),p=GV(()=>(J(K(s)),q(()=>K(s)?.columns[r]))),m=GV(()=>(J(e1),J(K(c)),J(K(p)),q(()=>e1(K(c),K(p))))),h=N0(),g=H(h),_=H(g),v=e=>{var r=GV(()=>(J(jY),J($q),K(t),J(K(l)),K(n),q(()=>jY($q(K(t),K(l),K(n)))))),i=GV(()=>(J(K(r)),q(()=>!!K(r)&&K(r).some(e=>e.active)))),a=GV(()=>(J(Bg),J(K(r)),q(()=>!Bg(K(r)))));(function(e,t){vB(t,!1);var n=$(t,`path`,9),r=$(t,`value`,9),i=$(t,`parser`,9),a=$(t,`isSelected`,9),o=$(t,`containsSearchResult`,9),s=$(t,`containsActiveSearchResult`,9),c=$(t,`onEdit`,9);GW(!0);var l,u=y0(),d=H(u);G(e=>{l=_W(u,1,`jse-inline-value svelte-1jv89ui`,null,l,{"jse-selected":a(),"jse-highlight":o(),"jse-active":s()}),PU(d,e)},[()=>(J(FK),J(i()),J(r()),J(50),q(()=>FK(i().stringify(r())??``,50)))]),Y(`dblclick`,u,()=>c()(n())),Z(e,u),yB()})(e,{get path(){return K(c)},get value(){return K(u)},get parser(){return x()},get isSelected(){return K(d)},get containsSearchResult(){return K(a)},get containsActiveSearchResult(){return K(i)},onEdit:Ft})},y=WV(()=>(J(cG),J(K(u)),q(()=>cG(K(u))))),b=e=>{var t=GV(()=>(J($q),K(j),K(ge),J(K(c)),q(()=>$q(K(j),K(ge),K(c))?.searchResults))),n=GV(()=>K(u)===void 0?``:K(u)),r=GV(()=>(J(oJ),K(j),K(Ne),J(K(c)),q(()=>oJ(K(j),K(Ne),K(c))))),i=GV(()=>K(d)?K(I):void 0);IQ(e,{get path(){return K(c)},get value(){return K(n)},get enforceString(){return K(r)},get selection(){return K(i)},get searchResultItems(){return K(t)},get context(){return K(Le)}})};Q(_,e=>{K(y)?e(v):e(b,-1)});var S=U(_),C=e=>{var t=M0();MQ(H(t),{selected:!0,onContextMenu:rt}),Z(e,t)},w=WV(()=>(J(f()),J(K(d)),J(KJ),K(I),q(()=>!f()&&K(d)&&!KJ(K(I)))));Q(S,e=>{K(w)&&e(C)});var T=U(g,2),E=e=>{BQ(e,{get validationError(){return K(m)},get onExpand(){return Q1}})};Q(T,e=>{K(m)&&e(E)}),G(e=>{jW(h,`data-path`,e),a=_W(g,1,`jse-value-outer svelte-1p86y3c`,null,a,{"jse-selected-value":K(d)})},[()=>(J(xK),J(K(c)),q(()=>xK(K(c))))]),Z(e,h)});var m=U(p),h=e=>{Z(e,P0())};Q(m,e=>{K(n)&&e(h)}),Z(e,u)});var S,C=H(U(b));HW(o,e=>V(A,e),()=>K(A)),uW(o,(e,t)=>N1?.(e,t),()=>Ht),EH(()=>Y(`scroll`,o,Xe));var w=U(o,2),T=e=>{var t=GV(()=>(K(he),q(()=>`You pasted a JSON ${Array.isArray(K(he).contents)?`array`:`object`} as text`))),n=GV(()=>[{icon:ev,text:`Paste as JSON instead`,title:`Paste the text as JSON instead of a single value`,onMouseDown:lt},{text:`Leave as is`,title:`Keep the pasted content as a single value`,onClick:ht}]);oQ(e,{type:`info`,get message(){return K(t)},get actions(){return K(n)}})};Q(w,e=>{K(he)&&e(T)});var E=U(w,2),ee=e=>{var t=GV(()=>[{icon:ev,text:`Paste as string instead`,title:`Paste the clipboard data as a single string value instead of an array`,onClick:pt},{text:`Leave as is`,title:`Keep the pasted array`,onClick:gt}]);oQ(e,{type:`info`,message:`Multiline text was pasted as array`,get actions(){return K(t)}})};Q(E,e=>{K(N)&&e(ee)});var te=U(E,2),D=e=>{var t=GV(()=>f()?[]:[{icon:Cv,text:`Ok`,title:`Accept the repaired document`,onClick:Qe},{icon:$_,text:`Repair manually instead`,title:`Leave the document unchanged and repair it manually instead`,onClick:_t}]);oQ(e,{type:`success`,message:`The loaded JSON document was invalid but is successfully repaired.`,get actions(){return K(t)},onClose:Ye})};Q(te,e=>{K(Fe)&&e(D)}),pQ(U(te,2),{get validationErrors(){return K(ze)},selectError:Nt}),G(()=>{g=_W(v,1,`jse-table-invisible-start-section svelte-1p86y3c`,null,g,{"jse-search-box-background":K(P)}),jW(y,`colspan`,(K(Se),q(()=>K(Se).length))),_=yW(y,``,_,{height:(K(r),q(()=>K(r).startHeight+`px`))}),jW(C,`colspan`,(K(Se),q(()=>K(Se).length))),S=yW(C,``,S,{height:(K(r),q(()=>K(r).endHeight+`px`))})}),Z(e,t)},l=e=>{var t=L0(),n=hH(t),r=GV(()=>f()?[]:[{icon:$_,text:`Repair manually`,title:`Open the document in "code" mode and repair it manually`,onClick:_t}]);oQ(n,{type:`error`,message:`The loaded JSON document is invalid and could not be repaired automatically.`,get actions(){return K(r)}}),h1(U(n,2),{get text(){return K(me)},get json(){return K(j)},get indentation(){return T()},get parser(){return x()}}),Z(e,t)},u=e=>{E0(e,{get text(){return K(me)},get json(){return K(j)},get readOnly(){return f()},get parser(){return x()},openJSONEditorModal:Ft,extractPath:Ct,get onChangeMode(){return ee()},onClick:()=>{Ye()}})};Q(s,e=>{K(Ce)?e(c):K(M)&&K(me)!==void 0&&K(me)!==``?e(l,1):e(u,-1)}),Y(`paste`,o,kt),Z(e,t)},Zt=e=>{Z(e,z0())};Q(Yt,e=>{d?e(Zt,-1):e(Xt)}),HW(Kt,e=>V(ue,e),()=>K(ue));var Qt=U(Kt,2),$t=e=>{vQ(e,{onClose:()=>V(Ee,!1)})};Q(Qt,e=>{K(Ee)&&e($t)});var en=U(Qt,2),tn=e=>{DQ(e,QW(()=>K(fe),{onClose:()=>{var e;(e=K(fe))==null||e.onClose(),V(fe,void 0)}}))};return Q(en,e=>{K(fe)&&e(tn)}),G(()=>Gt=_W(Kt,1,`jse-table-mode svelte-1p86y3c`,null,Gt,{"no-main-menu":!_()})),Y(`mousedown`,Kt,function(e){if(e.buttons===1||e.buttons===2){var t=e.target;t.isContentEditable||Ye();var n=SK(t);if(n){if(KJ(K(I))&&QJ(K(j),K(I),n))return;V(I,BJ(n)),e.preventDefault()}}}),Y(`keydown`,Kt,function(e){var t=TK(e);if(a(`keydown`,{combo:t,key:e.key}),t===`Ctrl+X`&&(e.preventDefault(),vt(!0)),t===`Ctrl+Shift+X`&&(e.preventDefault(),vt(!1)),t===`Ctrl+C`&&(e.preventDefault(),bt(!0)),t===`Ctrl+Shift+C`&&(e.preventDefault(),bt(!1)),t===`Ctrl+D`&&(e.preventDefault(),wt()),t!==`Delete`&&t!==`Backspace`||(e.preventDefault(),St()),t===`Insert`&&e.preventDefault(),t===`Ctrl+A`&&e.preventDefault(),t===`Ctrl+Q`&&it(e),t===`ArrowLeft`&&(e.preventDefault(),Ze(),K(I))){var n=function(e,t){var{rowIndex:n,columnIndex:r}=Z$(eY(t),e);return r>0?BJ(Q$({rowIndex:n,columnIndex:r-1},e)):t}(K(Se),K(I));V(I,n),tt(eY(n))}if(t===`ArrowRight`&&(e.preventDefault(),Ze(),K(I))){var r=function(e,t){var{rowIndex:n,columnIndex:r}=Z$(eY(t),e);return r<e.length-1?BJ(Q$({rowIndex:n,columnIndex:r+1},e)):t}(K(Se),K(I));V(I,r),tt(eY(r))}if(t===`ArrowUp`&&(e.preventDefault(),Ze(),K(I))){var i=function(e,t){var{rowIndex:n,columnIndex:r}=Z$(eY(t),e);return n>0?BJ(Q$({rowIndex:n-1,columnIndex:r},e)):t}(K(Se),K(I));V(I,i),tt(eY(i))}if(t===`ArrowDown`&&(e.preventDefault(),Ze(),K(I))){var o=function(e,t,n){var{rowIndex:r,columnIndex:i}=Z$(eY(n),t);return r<e.length-1?BJ(Q$({rowIndex:r+1,columnIndex:i},t)):n}(K(j),K(Se),K(I));V(I,o),tt(eY(o))}if(t===`Enter`&&K(I)&&bJ(K(I))){e.preventDefault();var s=K(I).path;cG(lc(K(j),s))?Ft(s):f()||V(I,R(R({},K(I)),{},{edit:!0}))}if(t.replace(/^Shift\+/,``).length===1&&K(I))return e.preventDefault(),void function(e){Ot.apply(this,arguments)}(e.key);if(t===`Ctrl+Enter`&&bJ(K(I))){e.preventDefault();var c=lc(K(j),K(I).path);gG(c)&&window.open(String(c),`_blank`)}t===`Escape`&&K(I)&&(e.preventDefault(),V(I,void 0)),t===`Ctrl+F`&&(e.preventDefault(),zt(!1)),t===`Ctrl+H`&&(e.preventDefault(),zt(!0)),t===`Ctrl+Z`&&(e.preventDefault(),Bt()),t===`Ctrl+Shift+Z`&&(e.preventDefault(),Vt())}),Y(`contextmenu`,Kt,it),Z(e,Wt),BW(t,`validate`,He),BW(t,`patch`,Ue),BW(t,`focus`,Ye),BW(t,`acceptAutoRepair`,Qe),BW(t,`scrollTo`,$e),BW(t,`findElement`,nt),BW(t,`openTransformModal`,Pt),yB(Ut)}function H0(e,t){vB(t,!1);var n=$(t,`content`,8),r=$(t,`selection`,12),i=$(t,`readOnly`,8),a=$(t,`indentation`,8),o=$(t,`tabSize`,8),s=$(t,`truncateTextSize`,8),c=$(t,`externalMode`,8),l=$(t,`mainMenuBar`,8),u=$(t,`navigationBar`,8),d=$(t,`statusBar`,8),f=$(t,`askToFormat`,8),p=$(t,`escapeControlCharacters`,8),m=$(t,`escapeUnicodeCharacters`,8),h=$(t,`maxDocumentSizeTextMode`,8),g=$(t,`flattenColumns`,8),_=$(t,`parser`,8),v=$(t,`parseMemoizeOne`,8),y=$(t,`validator`,8),b=$(t,`validationParser`,8),x=$(t,`pathParser`,8),S=$(t,`insideModal`,8),C=$(t,`onChange`,8),w=$(t,`onChangeMode`,8),T=$(t,`onSelect`,8),E=$(t,`onRenderValue`,8),ee=$(t,`onClassName`,8),te=$(t,`onRenderMenu`,8),D=$(t,`onRenderContextMenu`,8),ne=$(t,`onError`,8),re=$(t,`onFocus`,8),ie=$(t,`onBlur`,8),ae=$(t,`onSortModal`,8),oe=$(t,`onTransformModal`,8),O=$(t,`onJSONEditorModal`,8),k=B(),se=B(),ce=B(),le=$W(`jsoneditor:JSONEditorRoot`),ue=B(U1({onChange:e=>V(ue,e)}).get()),A=B(c());function de(e){if(Rq(e)){V(A,e.undo.mode);var t=K(ue).items(),n=t.findIndex(t=>t===e),i=n===-1?void 0:t[n-1];le(`handleUndo`,{index:n,item:e,items:t,prevItem:i}),i&&r(i.redo.selection),w()(K(A))}}function fe(e){if(Rq(e)){V(A,e.redo.mode);var t=K(ue).items(),n=t.findIndex(t=>t===e),i=n===-1?void 0:t[n+1];le(`handleRedo`,{index:n,item:e,items:t,nextItem:i}),i&&r(i.undo.selection),w()(K(A))}}var pe=B(),j={type:`separator`},me=B(),M=B();function he(e){if(K(k))return K(k).patch(e);if(K(se))return K(se).patch(e);if(K(ce))return K(ce).patch(e);throw Error(`Method patch is not available in mode "${K(A)}"`)}function N(e,t){if(K(k))return K(k).expand(e,t);if(K(ce))return K(ce).expand(e,t);throw Error(`Method expand is not available in mode "${K(A)}"`)}function ge(e,t){if(K(k))return K(k).collapse(e,t);if(K(ce))return K(ce).collapse(e,t);throw Error(`Method collapse is not available in mode "${K(A)}"`)}function P(e){if(K(ce))K(ce).openTransformModal(e);else if(K(k))K(k).openTransformModal(e);else{if(!K(se))throw Error(`Method transform is not available in mode "${K(A)}"`);K(se).openTransformModal(e)}}function F(){if(K(ce))return K(ce).validate();if(K(k))return K(k).validate();if(K(se))return K(se).validate();throw Error(`Method validate is not available in mode "${K(A)}"`)}function _e(){return K(k)?K(k).acceptAutoRepair():n()}function ve(e){if(K(k))return K(k).scrollTo(e);if(K(se))return K(se).scrollTo(e);throw Error(`Method scrollTo is not available in mode "${K(A)}"`)}function ye(e){if(K(k))return K(k).findElement(e);if(K(se))return K(se).findElement(e);throw Error(`Method findElement is not available in mode "${K(A)}"`)}function be(){K(ce)?K(ce).focus():K(k)?K(k).focus():K(se)&&K(se).focus()}function xe(){return Se.apply(this,arguments)}function Se(){return(Se=pz(function*(){K(ce)&&(yield K(ce).refresh())})).apply(this,arguments)}W(()=>J(c()),()=>{(function(e){if(e!==K(A)){var t={type:`mode`,undo:{mode:K(A),selection:void 0},redo:{mode:e,selection:void 0}};K(A)===`text`&&K(ce)&&K(ce).flush(),le(`add history item`,t),K(ue).add(t),V(A,e)}})(c())}),W(()=>(K(A),J(w())),()=>{V(pe,[{type:`button`,text:`text`,title:`Switch to text mode (current mode: ${K(A)})`,className:`jse-group-button jse-first`+(K(A)===qG.text?` jse-selected`:``),onClick:()=>w()(qG.text)},{type:`button`,text:`tree`,title:`Switch to tree mode (current mode: ${K(A)})`,className:`jse-group-button `+(K(A)===qG.tree?` jse-selected`:``),onClick:()=>w()(qG.tree)},{type:`button`,text:`table`,title:`Switch to table mode (current mode: ${K(A)})`,className:`jse-group-button jse-last`+(K(A)===qG.table?` jse-selected`:``),onClick:()=>w()(qG.table)}])}),W(()=>(K(pe),J(te()),K(A),J(S()),J(i())),()=>{V(me,e=>{var t=yq(e[0])?K(pe).concat(e):K(pe).concat(j,e),n=sh(t);return te()(t,{mode:K(A),modal:S(),readOnly:i()})||n})}),W(()=>(J(D()),K(A),J(S()),J(i()),J(r())),()=>{V(M,e=>{var t=sh(e);return D()(e,{mode:K(A),modal:S(),readOnly:i(),selection:r()})??(!i()&&t)})}),DH();var Ce={patch:he,expand:N,collapse:ge,transform:P,validate:F,acceptAutoRepair:_e,scrollTo:ve,findElement:ye,focus:be,refresh:xe};GW();var we=kU(),Te=hH(we),Ee=e=>{HW(v0(e,{get externalContent(){return n()},get externalSelection(){return r()},get history(){return K(ue)},get readOnly(){return i()},get indentation(){return a()},get tabSize(){return o()},get mainMenuBar(){return l()},get statusBar(){return d()},get askToFormat(){return f()},get escapeUnicodeCharacters(){return m()},get maxDocumentSize(){return h()},get parser(){return _()},get validator(){return y()},get validationParser(){return b()},get onChange(){return C()},get onChangeMode(){return w()},get onSelect(){return T()},onUndo:de,onRedo:fe,get onError(){return ne()},get onFocus(){return re()},get onBlur(){return ie()},get onRenderMenu(){return K(me)},get onSortModal(){return ae()},get onTransformModal(){return oe()},$$legacy:!0}),e=>V(ce,e),()=>K(ce))},De=WV(()=>(K(A),J(qG),q(()=>K(A)===qG.text||String(K(A))===`code`))),Oe=e=>{HW(V0(e,{get externalContent(){return n()},get externalSelection(){return r()},get history(){return K(ue)},get readOnly(){return i()},get truncateTextSize(){return s()},get mainMenuBar(){return l()},get escapeControlCharacters(){return p()},get escapeUnicodeCharacters(){return m()},get flattenColumns(){return g()},get parser(){return _()},get parseMemoizeOne(){return v()},get validator(){return y()},get validationParser(){return b()},get indentation(){return a()},get onChange(){return C()},get onChangeMode(){return w()},get onSelect(){return T()},onUndo:de,onRedo:fe,get onRenderValue(){return E()},get onFocus(){return re()},get onBlur(){return ie()},get onRenderMenu(){return K(me)},get onRenderContextMenu(){return K(M)},get onSortModal(){return ae()},get onTransformModal(){return oe()},get onJSONEditorModal(){return O()},$$legacy:!0}),e=>V(se,e),()=>K(se))},ke=e=>{HW(B1(e,{get externalContent(){return n()},get externalSelection(){return r()},get history(){return K(ue)},get readOnly(){return i()},get indentation(){return a()},get truncateTextSize(){return s()},get mainMenuBar(){return l()},get navigationBar(){return u()},get escapeControlCharacters(){return p()},get escapeUnicodeCharacters(){return m()},get parser(){return _()},get parseMemoizeOne(){return v()},get validator(){return y()},get validationParser(){return b()},get pathParser(){return x()},get onError(){return ne()},get onChange(){return C()},get onChangeMode(){return w()},get onSelect(){return T()},onUndo:de,onRedo:fe,get onRenderValue(){return E()},get onClassName(){return ee()},get onFocus(){return re()},get onBlur(){return ie()},get onRenderMenu(){return K(me)},get onRenderContextMenu(){return K(M)},get onSortModal(){return ae()},get onTransformModal(){return oe()},get onJSONEditorModal(){return O()},$$legacy:!0}),e=>V(k,e),()=>K(k))};return Q(Te,e=>{K(De)?e(Ee):(K(A),J(qG),q(()=>K(A)===qG.table)?e(Oe,1):e(ke,-1))}),Z(e,we),BW(t,`patch`,he),BW(t,`expand`,N),BW(t,`collapse`,ge),BW(t,`transform`,P),BW(t,`validate`,F),BW(t,`acceptAutoRepair`,_e),BW(t,`scrollTo`,ve),BW(t,`findElement`,ye),BW(t,`focus`,be),BW(t,`refresh`,xe),yB(Ce)}OK(`/* over all fonts, sizes, and colors */
|
|
3625
|
+
}`);var k0=X(`<div class="jse-table-root-error svelte-1p86y3c"><!></div>`),A0=X(`<th class="jse-table-cell jse-table-cell-header svelte-1p86y3c"><!></th>`),j0=X(`<th class="jse-table-cell jse-table-cell-header svelte-1p86y3c"><!></th>`),M0=X(`<th class="jse-table-cell jse-table-cell-gutter svelte-1p86y3c"> <!></th>`),N0=X(`<div class="jse-context-menu-anchor svelte-1p86y3c"><!></div>`),P0=X(`<td class="jse-table-cell svelte-1p86y3c"><div><!><!></div> <!></td>`),F0=X(`<td class="jse-table-cell svelte-1p86y3c"></td>`),I0=X(`<tr class="jse-table-row svelte-1p86y3c"><!><!><!></tr>`),L0=X(`<div class="jse-search-box-container svelte-1p86y3c"><!></div> <div class="jse-contents svelte-1p86y3c"><table class="jse-table-main svelte-1p86y3c"><tbody><tr class="jse-table-row jse-table-row-header svelte-1p86y3c"><th class="jse-table-cell jse-table-cell-header svelte-1p86y3c"><!></th><!><!></tr><tr><td class="svelte-1p86y3c"></td></tr><!><tr class="jse-table-invisible-end-section svelte-1p86y3c"><td class="svelte-1p86y3c"></td></tr></tbody></table></div> <!> <!> <!> <!>`,1),R0=X(`<!> <!>`,1),z0=X(`<label class="jse-hidden-input-label svelte-1p86y3c"><input type="text" tabindex="-1" class="jse-hidden-input svelte-1p86y3c"/></label> <!>`,1),B0=X(`<div class="jse-contents jse-contents-loading svelte-1p86y3c"><div class="jse-loading-space svelte-1p86y3c"></div> <div class="jse-loading svelte-1p86y3c">loading...</div></div>`),V0=X(`<div role="table"><!> <!></div> <!> <!>`,1);function H0(e,t){vB(t,!1);var n=B(void 0,!0),r=B(void 0,!0),i=B(void 0,!0),a=$W(`jsoneditor:TableMode`),{openAbsolutePopup:o,closeAbsolutePopup:s}=_B(`absolute-popup`),c=XZ(),l=c_(),u=c_(),d=typeof window>`u`;a(`isSSR:`,d);var f=$(t,`readOnly`,9),p=$(t,`externalContent`,9),m=$(t,`externalSelection`,9),h=$(t,`history`,9),g=$(t,`truncateTextSize`,9),_=$(t,`mainMenuBar`,9),v=$(t,`escapeControlCharacters`,9),y=$(t,`escapeUnicodeCharacters`,9),b=$(t,`flattenColumns`,9),x=$(t,`parser`,9),S=$(t,`parseMemoizeOne`,9),C=$(t,`validator`,9),w=$(t,`validationParser`,9),T=$(t,`indentation`,9),E=$(t,`onChange`,9),ee=$(t,`onChangeMode`,9),te=$(t,`onSelect`,9),D=$(t,`onUndo`,9),ne=$(t,`onRedo`,9),re=$(t,`onRenderValue`,9),ie=$(t,`onRenderMenu`,9),ae=$(t,`onRenderContextMenu`,9),oe=$(t,`onFocus`,9),O=$(t,`onBlur`,9),k=$(t,`onSortModal`,9),se=$(t,`onTransformModal`,9),ce=$(t,`onJSONEditorModal`,9),le=B(void 0,!0),ue=B(void 0,!0),A=B(void 0,!0),de=B(void 0,!0),fe=B(void 0,!0);iQ({onMount:KU,onDestroy:qU,getWindow:()=>_K(K(ue)),hasFocus:()=>we&&document.hasFocus()||vK(K(ue)),onFocus:()=>{Te=!0,oe()&&oe()()},onBlur:()=>{Te=!1,O()&&O()()}});var pe,j=B(void 0,!0),me=B(void 0,!0),M=B(void 0,!0),he=B(void 0,!0),N=B(void 0,!0),ge=B(void 0,!0),P=B(!1,!0),F=B(!1,!0);function _e(e){V(ge,(pe=e)?AY(K(j),pe.items):void 0)}function ve(e){return ye.apply(this,arguments)}function ye(){return(ye=pz(function*(e){V(I,void 0),yield $e(e)})).apply(this,arguments)}function be(){V(P,!1),V(F,!1),Ye()}var xe=B(1e4,!0),Se=B([],!0),Ce=B(void 0,!0),we=!1,Te=!1,Ee=B(!1,!0),De=B({},!0),Oe=B(600,!0),ke=B(0,!0),Ae=18;function je(e){V(I,e)}function Me(e){K(I)&&e!==void 0&&(hc(e,tY(K(I)))&&hc(e,eY(K(I)))||(a(`clearing selection: path does not exist anymore`,K(I)),V(I,void 0)))}var Ne=B(K(j)===void 0?void 0:zq({json:K(j)}),!0),I=B(CJ(m())?m():void 0,!0),Pe=B(void 0,!0),Fe=B(!1,!0);function Ie(e){if(!f()){a(`onSortByHeader`,e);var t=e.sortDirection===QG.desc?-1:1;We(E$(K(j),[],e.path,t),(t,n)=>({state:n,sortedColumn:e}))}}KU(()=>{K(I)&&tt(eY(K(I)))});var Le=B(void 0,!0);function Re(e){if(e.json!==void 0||e.text!==void 0){var t=K(j)!==void 0&&e.json!==void 0;h().add({type:`tree`,undo:{patch:t?[{op:`replace`,path:``,value:e.json}]:void 0,json:e.json,text:e.text,documentState:e.documentState,textIsRepaired:e.textIsRepaired,selection:LJ(e.selection),sortedColumn:e.sortedColumn},redo:{patch:t?[{op:`replace`,path:``,value:K(j)}]:void 0,json:K(j),text:K(me),documentState:K(Ne),textIsRepaired:K(Fe),selection:LJ(K(I)),sortedColumn:K(Pe)}})}}var ze=B([],!0),Be=kv(tQ);function Ve(e,t,n,r){ZZ(()=>{var i;try{i=Be(e,t,n,r)}catch(e){i=[{path:[],message:`Failed to validate: `+e.message,severity:XG.warning}]}Hg(i,K(ze))||(a(`validationErrors changed:`,i),V(ze,i))},e=>a(`validationErrors updated in ${e} ms`))}function He(){return a(`validate`),K(M)?{parseError:K(M),isRepairable:!1}:(Ve(K(j),C(),x(),w()),Vg(K(ze))?void 0:{validationErrors:K(ze)})}function Ue(e,t){if(a(`patch`,e,t),K(j)===void 0)throw Error(`Cannot apply patch: no JSON`);var n=K(j),r={json:void 0,text:K(me),documentState:K(Ne),selection:LJ(K(I)),sortedColumn:K(Pe),textIsRepaired:K(Fe)},i=_Y(K(j),e),o=Zq(K(j),K(Ne),e),s=r1(K(Pe),e,K(Se)),c=typeof t==`function`?t(o.json,o.documentState,K(I)):void 0;return V(j,c?.json===void 0?o.json:c.json),V(Ne,c?.state===void 0?o.documentState:c.state),V(I,c?.selection===void 0?K(I):c.selection),V(Pe,c?.sortedColumn===void 0?s:c.sortedColumn),V(me,void 0),V(Fe,!1),V(he,void 0),V(N,void 0),V(M,void 0),h().add({type:`tree`,undo:R({patch:i},r),redo:{patch:e,json:void 0,text:void 0,documentState:K(Ne),selection:LJ(K(I)),sortedColumn:K(Pe),textIsRepaired:K(Fe)}}),{json:K(j),previousJson:n,undo:i,redo:e}}function We(e,t){a(`handlePatch`,e,t);var n={json:K(j),text:K(me)},r=Ue(e,t);return Ge(n,r),r}function Ge(e,t){if((e.json!==void 0||e?.text!==void 0)&&E()){if(K(me)!==void 0){var n={text:K(me),json:void 0};E()(n,e,{contentErrors:He(),patchResult:t})}else if(K(j)!==void 0){var r={text:void 0,json:K(j)};E()(r,e,{contentErrors:He(),patchResult:t})}}}function Ke(e){a(`pasted json as text`,e),V(he,e)}function qe(e){a(`pasted multiline text`,{pastedText:e}),V(N,e)}function Je(e){var t=parseInt(e[0],10),n=[String(t+1),...e.slice(1)];return hc(K(j),n)?BJ(n):BJ(e)}function Ye(){a(`focus`),K(de)&&(K(de).focus(),K(de).select())}function Xe(e){V(ke,e.target.scrollTop)}function Ze(){K(I)||V(I,function(){if(Js(K(j))&&!Vg(K(j))&&!Vg(K(Se)))return BJ([`0`,...K(Se)[0]])}())}function Qe(){if(K(Fe)&&K(j)!==void 0){var e={json:K(j),text:K(me)},t={json:K(j),documentState:K(Ne),selection:K(I),sortedColumn:K(Pe),text:K(me),textIsRepaired:K(Fe)};V(me,void 0),V(Fe,!1),Me(K(j)),Re(t),Ge(e,void 0)}return{json:K(j),text:K(me)}}function $e(e){var{scrollToWhenVisible:t=!0}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=K(P)?mq:0,r=Z$(e,K(Se),De,Ae),i=r-K(ke)+n+Ae,o=nt(e);if(a(`scrollTo`,{path:e,top:r,scrollTop:K(ke),elem:o}),!K(A))return Promise.resolve();var s=K(A).getBoundingClientRect();if(o&&!t){var l=o.getBoundingClientRect();if(l.bottom>s.top&&l.top<s.bottom)return Promise.resolve()}var u=-Math.max(n+2*Ae,s.height/4);return new Promise(o?t=>{c(o,{container:K(A),offset:u,duration:300,callback:()=>{et(e),t()}})}:t=>{c(i,{container:K(A),offset:u,duration:300,callback:()=>{uV(),et(e),t()}})})}function et(e){var t=nt(e);if(t&&K(A)){var n=K(A).getBoundingClientRect(),r=t.getBoundingClientRect();if(r.right>n.right){var i=r.right-n.right;iH(A,K(A).scrollLeft+=i)}if(r.left<n.left){var a=n.left-r.left;iH(A,K(A).scrollLeft-=a)}}}function tt(e){(function(e){if(K(A)){var{rowIndex:t}=Q$(e,K(Se)),n=Z$(e,K(Se),De,Ae),r=n+(De[t]||Ae),i=Ae,a=K(A).getBoundingClientRect(),o=K(ke),s=K(ke)+a.height-i;if(r>s){var c=r-s;iH(A,K(A).scrollTop+=c)}if(n<o){var l=o-n;iH(A,K(A).scrollTop-=l)}}})(e),et(e)}function nt(e){var t=K(Se).find(t=>IJ(e.slice(1),t)),n=t?e.slice(0,1).concat(t):e;return K(A)?.querySelector(`td[data-path="${xK(n)}"]`)??void 0}function rt(e){var{anchor:t,left:n,top:r,width:i,height:a,offsetTop:c,offsetLeft:l,showTip:u}=e,d=function(e){var{json:t,documentState:n,selection:r,readOnly:i,onEditValue:a,onEditRow:o,onToggleEnforceString:s,onCut:c,onCopy:l,onPaste:u,onRemove:d,onDuplicateRow:f,onInsertBeforeRow:p,onInsertAfterRow:m,onRemoveRow:h}=e,g=t!==void 0,_=!!r,v=t!==void 0&&r?lc(t,eY(r)):void 0,y=g&&(xJ(r)||yJ(r)||bJ(r)),b=!i&&g&&r!==void 0&&PJ(r),x=b&&!cG(v),S=!i&&y,C=r!==void 0&&oJ(t,n,eY(r));return[{type:`separator`},{type:`row`,items:[{type:`column`,items:[{type:`label`,text:`Table cell:`},{type:`dropdown-button`,main:{type:`button`,onClick:()=>a(),icon:nv,text:`Edit`,title:`Edit the value (Double-click on the value)`,disabled:!b},width:`11em`,items:[{type:`button`,icon:nv,text:`Edit`,title:`Edit the value (Double-click on the value)`,onClick:()=>a(),disabled:!b},{type:`button`,icon:C?G_:Z_,text:`Enforce string`,title:`Enforce keeping the value as string when it contains a numeric value`,onClick:()=>s(),disabled:!x}]},{type:`dropdown-button`,main:{type:`button`,onClick:()=>c(!0),icon:H_,text:`Cut`,title:`Cut selected contents, formatted with indentation (Ctrl+X)`,disabled:!S},width:`10em`,items:[{type:`button`,icon:H_,text:`Cut formatted`,title:`Cut selected contents, formatted with indentation (Ctrl+X)`,onClick:()=>c(!0),disabled:i||!y},{type:`button`,icon:H_,text:`Cut compacted`,title:`Cut selected contents, without indentation (Ctrl+Shift+X)`,onClick:()=>c(!1),disabled:i||!y}]},{type:`dropdown-button`,main:{type:`button`,onClick:()=>l(!0),icon:hv,text:`Copy`,title:`Copy selected contents, formatted with indentation (Ctrl+C)`,disabled:!y},width:`12em`,items:[{type:`button`,icon:hv,text:`Copy formatted`,title:`Copy selected contents, formatted with indentation (Ctrl+C)`,onClick:()=>l(!1),disabled:!y},{type:`button`,icon:hv,text:`Copy compacted`,title:`Copy selected contents, without indentation (Ctrl+Shift+C)`,onClick:()=>l(!1),disabled:!y}]},{type:`button`,onClick:()=>u(),icon:B_,text:`Paste`,title:`Paste clipboard contents (Ctrl+V)`,disabled:i||!_},{type:`button`,onClick:()=>d(),icon:L_,text:`Remove`,title:`Remove selected contents (Delete)`,disabled:i||!y}]},{type:`column`,items:[{type:`label`,text:`Table row:`},{type:`button`,onClick:()=>o(),icon:nv,text:`Edit row`,title:`Edit the current row`,disabled:i||!_||!g},{type:`button`,onClick:()=>f(),icon:Sv,text:`Duplicate row`,title:`Duplicate the current row (Ctrl+D)`,disabled:i||!_||!g},{type:`button`,onClick:()=>p(),icon:gv,text:`Insert before`,title:`Insert a row before the current row`,disabled:i||!_||!g},{type:`button`,onClick:()=>m(),icon:gv,text:`Insert after`,title:`Insert a row after the current row`,disabled:i||!_||!g},{type:`button`,onClick:()=>h(),icon:L_,text:`Remove row`,title:`Remove current row`,disabled:i||!_||!g}]}]}]}({json:K(j),documentState:K(Ne),selection:K(I),readOnly:f(),onEditValue:ot,onEditRow:st,onToggleEnforceString:ct,onCut:vt,onCopy:bt,onPaste:dt,onRemove:St,onDuplicateRow:wt,onInsertBeforeRow:Tt,onInsertAfterRow:Et,onRemoveRow:Dt}),p=ae()(d)??d;if(!1!==p){var m={left:n,top:r,offsetTop:c,offsetLeft:l,width:i,height:a,anchor:t,closeOnOuterClick:!0,onClose:()=>{we=!1,Ye()}};we=!0;var h=o(j1,{tip:u?`Tip: you can open this context menu via right-click or with Ctrl+Q`:void 0,items:p,onRequestClose(){s(h),Ye()}},m)}}function it(e){if(!KJ(K(I)))if(e&&(e.stopPropagation(),e.preventDefault()),e&&e.type===`contextmenu`&&e.target!==K(de))rt({left:e.clientX,top:e.clientY,width:pq,height:fq,showTip:!1});else{var t=K(A)?.querySelector(`.jse-table-cell.jse-selected-value`);if(t)rt({anchor:t,offsetTop:2,width:pq,height:fq,showTip:!1});else{var n=K(A)?.getBoundingClientRect();n&&rt({top:n.top+2,left:n.left+2,width:pq,height:fq,showTip:!1})}}}function at(e){rt({anchor:yK(e.target,`BUTTON`),offsetTop:0,width:pq,height:fq,showTip:!0})}function ot(){if(!f()&&K(I)){var e=eY(K(I));cG(lc(K(j),e))?Ft(e):V(I,BJ(e))}}function st(){!f()&&K(I)&&Ft(eY(K(I)).slice(0,1))}function ct(){if(!f()&&bJ(K(I))){var e=K(I).path,t=_c(e),n=lc(K(j),e),r=!oJ(K(j),K(Ne),e),i=r?String(n):_G(String(n),x());a(`handleToggleEnforceString`,{enforceString:r,value:n,updatedValue:i}),We([{op:`replace`,path:t,value:i}],(t,n)=>({state:tJ(K(j),n,e,{type:`value`,enforceString:r})}))}}function lt(){return ut.apply(this,arguments)}function ut(){return(ut=pz(function*(){if(a(`apply pasted json`,K(he)),K(he)){var{onPasteAsJson:e}=K(he);e(),setTimeout(Ye)}})).apply(this,arguments)}function dt(){return ft.apply(this,arguments)}function ft(){return(ft=pz(function*(){try{At(yield navigator.clipboard.readText())}catch(e){console.error(e),V(Ee,!0)}})).apply(this,arguments)}function pt(){return mt.apply(this,arguments)}function mt(){return(mt=pz(function*(){a(`apply pasted multiline text`,K(N)),K(N)&&(At(JSON.stringify(K(N))),setTimeout(Ye))})).apply(this,arguments)}function ht(){a(`clear pasted json`),V(he,void 0),Ye()}function gt(){a(`clear pasted multiline text`),V(N,void 0),Ye()}function _t(){ee()(qG.text)}function vt(e){return yt.apply(this,arguments)}function yt(){return(yt=pz(function*(e){yield a1({json:K(j),selection:K(I),indentation:e?T():void 0,readOnly:f(),parser:x(),onPatch:We})})).apply(this,arguments)}function bt(){return xt.apply(this,arguments)}function xt(){return xt=pz(function*(){var e=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];K(j)!==void 0&&(yield s1({json:K(j),selection:K(I),indentation:e?T():void 0,parser:x()}))}),xt.apply(this,arguments)}function St(){u1({json:K(j),text:K(me),selection:K(I),keepSelection:!0,readOnly:f(),onChange:E(),onPatch:We})}function Ct(e){f()||(a(`extract`,{path:e}),We(dY(K(j),BJ(e))))}function wt(){(function(e){var{json:t,selection:n,columns:r,readOnly:i,onPatch:a}=e;if(!i&&t!==void 0&&n&&qJ(n)){var{rowIndex:o,columnIndex:s}=Q$(eY(n),r);i1(`duplicate row`,{rowIndex:o}),a(uY(t,[[String(o)]]),(e,n)=>({state:n,selection:BJ($$({rowIndex:o<t.length?o+1:o,columnIndex:s},r))}))}})({json:K(j),selection:K(I),columns:K(Se),readOnly:f(),onPatch:We})}function Tt(){(function(e){var{json:t,selection:n,columns:r,readOnly:i,onPatch:a}=e;if(!i&&t!==void 0&&n&&qJ(n)){var{rowIndex:o}=Q$(eY(n),r);i1(`insert before row`,{rowIndex:o}),a(sY(t,[String(o)],[{key:``,value:Ys(t[0])?{}:``}]))}})({json:K(j),selection:K(I),columns:K(Se),readOnly:f(),onPatch:We})}function Et(){(function(e){var{json:t,selection:n,columns:r,readOnly:i,onPatch:a}=e;if(!i&&t!==void 0&&n&&qJ(n)){var{rowIndex:o,columnIndex:s}=Q$(eY(n),r);i1(`insert after row`,{rowIndex:o});var c=o+1,l=[String(c)],u=[{key:``,value:Ys(t[0])?{}:``}];a(c<t.length?sY(t,l,u):cY(t,[],u),(e,t)=>({state:t,selection:BJ($$({rowIndex:c,columnIndex:s},r))}))}})({json:K(j),selection:K(I),columns:K(Se),readOnly:f(),onPatch:We})}function Dt(){(function(e){var{json:t,selection:n,columns:r,readOnly:i,onPatch:a}=e;if(!i&&t!==void 0&&n&&qJ(n)){var{rowIndex:o,columnIndex:s}=Q$(eY(n),r);i1(`remove row`,{rowIndex:o}),a(pY([[String(o)]]),(e,t)=>{var n=o<e.length?o:o>0?o-1:void 0,i=n===void 0?void 0:BJ($$({rowIndex:n,columnIndex:s},r));return i1(`remove row new selection`,{rowIndex:o,newRowIndex:n,newSelection:i}),{state:t,selection:i}})}})({json:K(j),selection:K(I),columns:K(Se),readOnly:f(),onPatch:We})}function Ot(){return(Ot=pz(function*(e){yield f1({char:e,selectInside:!1,json:K(j),selection:K(I),readOnly:f(),parser:x(),onPatch:We,onReplaceJson:jt,onSelect:je})})).apply(this,arguments)}function kt(e){e.preventDefault(),At(e.clipboardData?.getData(`text/plain`))}function At(e){e!==void 0&&l1({clipboardText:e,json:K(j),selection:K(I),readOnly:f(),parser:x(),onPatch:We,onChangeText:Mt,onPasteMultilineText:qe,openRepairModal:It})}function jt(e,t){var n={json:K(j),text:K(me)},r={json:K(j),documentState:K(Ne),selection:K(I),sortedColumn:K(Pe),text:K(me),textIsRepaired:K(Fe)},i=Wq(e,K(Ne)),a=typeof t==`function`?t(e,i,K(I)):void 0;V(j,a?.json===void 0?e:a.json),V(Ne,a?.state===void 0?i:a.state),V(I,a?.selection===void 0?K(I):a.selection),V(Pe,void 0),V(me,void 0),V(Fe,!1),V(M,void 0),Me(K(j)),Re(r),Ge(n,void 0)}function Mt(e,t){a(`handleChangeText`);var n={json:K(j),text:K(me)},r={json:K(j),documentState:K(Ne),selection:K(I),sortedColumn:K(Pe),text:K(me),textIsRepaired:K(Fe)};try{V(j,S()(e)),V(Ne,Wq(K(j),K(Ne))),V(me,void 0),V(Fe,!1),V(M,void 0)}catch(t){try{V(j,S()(Sl(e))),V(Ne,Wq(K(j),K(Ne))),V(me,e),V(Fe,!0),V(M,void 0)}catch{V(j,void 0),V(Ne,void 0),V(me,e),V(Fe,!1),V(M,K(me)===``?void 0:MG(K(me),t.message||String(t)))}}if(typeof t==`function`){var i=t(K(j),K(Ne),K(I));V(j,i?.json===void 0?K(j):i.json),V(Ne,i?.state===void 0?K(Ne):i.state),V(I,i?.selection===void 0?K(I):i.selection)}Me(K(j)),Re(r),Ge(n,void 0)}function Nt(e){a(`select validation error`,e),V(I,BJ(e.path)),$e(e.path)}function Pt(e){if(K(j)!==void 0){var{id:t,onTransform:n,onClose:r}=e,i=e.rootPath||[];we=!0,se()({id:t||u,json:K(j),rootPath:i||[],onTransform:e=>{n?n({operations:e,json:K(j),transformedJson:bc(K(j),e)}):(a(`onTransform`,i,e),We(e))},onClose:()=>{we=!1,setTimeout(Ye),r&&r()}})}}function Ft(e){a(`openJSONEditorModal`,{path:e}),we=!0,ce()({content:{json:lc(K(j),e)},path:e,onPatch:We,onClose:()=>{we=!1,setTimeout(Ye)}})}function It(e,t){V(fe,{text:e,onParse:e=>kG(e,e=>DG(e,x())),onRepair:AG,onApply:t,onClose:Ye})}function Lt(){(function(e){f()||K(j)===void 0||(we=!0,k()({id:l,json:K(j),rootPath:e,onSort:t=>{var{operations:n,itemPath:r,direction:i}=t;a(`onSort`,n,e,r,i),We(n,(e,t)=>({state:t,sortedColumn:{path:r,sortDirection:i===-1?QG.desc:QG.asc}}))},onClose:()=>{we=!1,setTimeout(Ye)}}))})([])}function Rt(){Pt({rootPath:[]})}function zt(e){a(`openFind`,{findAndReplace:e}),V(P,!1),V(F,!1),uV(),V(P,!0),V(F,e)}function Bt(){if(!f()&&h().canUndo){var e=h().undo();if(Iq(e)){var t={json:K(j),text:K(me)};V(j,e.undo.patch?bc(K(j),e.undo.patch):e.undo.json),V(Ne,e.undo.documentState),V(I,e.undo.selection),V(Pe,e.undo.sortedColumn),V(me,e.undo.text),V(Fe,e.undo.textIsRepaired),V(M,void 0),a(`undo`,{item:e,json:K(j)}),Ge(t,e.undo.patch&&e.redo.patch?{json:K(j),previousJson:t.json,redo:e.undo.patch,undo:e.redo.patch}:void 0),Ye(),K(I)&&$e(eY(K(I)),{scrollToWhenVisible:!1})}else D()(e)}}function Vt(){if(!f()&&h().canRedo){var e=h().redo();if(Iq(e)){var t={json:K(j),text:K(me)};V(j,e.redo.patch?bc(K(j),e.redo.patch):e.redo.json),V(Ne,e.redo.documentState),V(I,e.redo.selection),V(Pe,e.redo.sortedColumn),V(me,e.redo.text),V(Fe,e.redo.textIsRepaired),V(M,void 0),a(`redo`,{item:e,json:K(j)}),Ge(t,e.undo.patch&&e.redo.patch?{json:K(j),previousJson:t.json,redo:e.redo.patch,undo:e.undo.patch}:void 0),Ye(),K(I)&&$e(eY(K(I)),{scrollToWhenVisible:!1})}else ne()(e)}}function Ht(e){V(Oe,e.getBoundingClientRect().height)}W(()=>(J(v()),J(y())),()=>{V(le,tK({escapeControlCharacters:v(),escapeUnicodeCharacters:y()}))}),W(()=>K(P),()=>{(function(e){if(K(A)){var t=e?mq:-100;K(A).scrollTo({top:iH(A,K(A).scrollTop+=t),left:K(A).scrollLeft})}})(K(P))}),W(()=>J(p()),()=>{(function(e){var t={json:K(j)},n=FG(e)?e.text!==K(me):!Hg(t.json,e.json);if(a(`update external content`,{isChanged:n}),n){var r={json:K(j),documentState:K(Ne),selection:K(I),sortedColumn:K(Pe),text:K(me),textIsRepaired:K(Fe)};if(FG(e))try{V(j,S()(e.text)),V(Ne,Wq(K(j),K(Ne))),V(me,e.text),V(Fe,!1),V(M,void 0)}catch(t){try{V(j,S()(Sl(e.text))),V(Ne,Wq(K(j),K(Ne))),V(me,e.text),V(Fe,!0),V(M,void 0)}catch{V(j,void 0),V(Ne,void 0),V(me,e.text),V(Fe,!1),V(M,K(me)===``?void 0:MG(K(me),t.message||String(t)))}}else V(j,e.json),V(Ne,Wq(K(j),K(Ne))),V(me,void 0),V(Fe,!1),V(M,void 0);Me(K(j)),V(Pe,void 0),Re(r)}})(p())}),W(()=>J(m()),()=>{(function(e){Hg(K(I),e)||(a(`applyExternalSelection`,{selection:K(I),externalSelection:e}),CJ(e)&&V(I,e))})(m())}),W(()=>(K(Se),K(j),J(b()),K(xe)),()=>{V(Se,Js(K(j))?function(e,t){var n=new Set(t.map(_c)),r=new Set(e.map(_c));for(var i of n)r.has(i)||n.delete(i);for(var a of r)n.has(a)||n.add(a);return[...n].map(gc)}(q$(K(j),b(),K(xe)),K(Se)):[])}),W(()=>(K(j),K(Se)),()=>{V(Ce,!(!K(j)||Vg(K(Se))))}),W(()=>(K(j),K(xe)),()=>{V(n,Array.isArray(K(j))&&K(j).length>K(xe))}),W(()=>(K(ke),K(Oe),K(j),K(P),mq),()=>{V(r,X$(K(ke),K(Oe),K(j),De,Ae,K(P)?mq:0))}),W(()=>K(j),()=>{K(j),K(A)&&K(A).scrollTo({top:K(A).scrollTop,left:K(A).scrollLeft})}),W(()=>K(I),()=>{var e=K(I);Hg(e,m())||(a(`onSelect`,e),te()(e))}),W(()=>(J(f()),J(g()),J(x()),K(le),K(j),K(Ne),J(re())),()=>{V(Le,{mode:qG.table,readOnly:f(),truncateTextSize:g(),parser:x(),normalization:K(le),getJson:()=>K(j),getDocumentState:()=>K(Ne),findElement:nt,findNextInside:Je,focus:Ye,onPatch:(e,t)=>We(function(e,t){return e.flatMap(e=>{if(Qs(e)){var n=gc(e.path);if(n.length>0){for(var r=[e],i=Lg(n);i.length>0&&!hc(t,i);)r.unshift({op:`add`,path:_c(i),value:{}}),i=Lg(i);return r}}return e})}(e,K(j)),t),onSelect:je,onFind:zt,onPasteJson:Ke,onRenderValue:re()})}),W(()=>(K(j),J(C()),J(x()),J(w())),()=>{Ve(K(j),C(),x(),w())}),W(()=>(K(ze),K(Se)),()=>{V(i,e1(K(ze),K(Se)))}),DH();var Ut={validate:He,patch:Ue,focus:Ye,acceptAutoRepair:Qe,scrollTo:$e,findElement:nt,openTransformModal:Pt};GW(!0);var Wt=V0();Y(`mousedown`,YV,function(e){!hK(e.target,e=>e===K(ue))&&KJ(K(I))&&(a(`click outside the editor, exit edit mode`),V(I,LJ(K(I))),Te&&K(de)&&(K(de).focus(),K(de).blur()),a(`blur (outside editor)`),K(de)&&K(de).blur())});var Gt,Kt=hH(Wt),qt=H(Kt),Jt=e=>{(function(e,t){vB(t,!1);var n=$(t,`containsValidArray`,9),r=$(t,`readOnly`,9),i=$(t,`showSearch`,13,!1),a=$(t,`history`,9),o=$(t,`onSort`,9),s=$(t,`onTransform`,9),c=$(t,`onContextMenu`,9),l=$(t,`onUndo`,9),u=$(t,`onRedo`,9),d=$(t,`onRenderMenu`,9);function f(){i(!i())}var p=B(void 0,!0),m=B(void 0,!0);W(()=>(J(r()),J(o()),J(n()),J(s()),J(c()),J(l()),J(a()),J(u())),()=>{V(p,r()?[{type:`space`}]:[{type:`button`,icon:uv,title:`Sort`,className:`jse-sort`,onClick:o(),disabled:r()||!n()},{type:`button`,icon:Q_,title:`Transform contents (filter, sort, project)`,className:`jse-transform`,onClick:s(),disabled:r()||!n()},{type:`button`,icon:pv,title:`Search (Ctrl+F)`,className:`jse-search`,onClick:f,disabled:!n()},{type:`button`,icon:cv,title:oq,className:`jse-contextmenu`,onClick:c()},{type:`separator`},{type:`button`,icon:iv,title:`Undo (Ctrl+Z)`,className:`jse-undo`,onClick:l(),disabled:!a().canUndo},{type:`button`,icon:rv,title:`Redo (Ctrl+Shift+Z)`,className:`jse-redo`,onClick:u(),disabled:!a().canRedo},{type:`space`}])}),W(()=>(J(d()),K(p)),()=>{V(m,d()(K(p))||K(p))}),DH(),GW(!0),wQ(e,{get items(){return K(m)}}),yB()})(e,{get containsValidArray(){return K(Ce)},get readOnly(){return f()},get history(){return h()},onSort:Lt,onTransform:Rt,onUndo:Bt,onRedo:Vt,onContextMenu:at,get onRenderMenu(){return ie()},get showSearch(){return K(P)},set showSearch(e){V(P,e)},$$legacy:!0})};Q(qt,e=>{_()&&e(Jt)});var Yt=U(qt,2),Xt=e=>{var t=z0(),a=hH(t),o=H(a);o.readOnly=!0,HW(o,e=>V(de,e),()=>K(de));var s=U(a,2),c=e=>{var t=L0(),a=hH(t);G$(H(a),{get json(){return K(j)},get documentState(){return K(Ne)},get parser(){return x()},get showSearch(){return K(P)},get showReplace(){return K(F)},get readOnly(){return f()},get columns(){return K(Se)},onSearch:_e,onFocus:ve,onPatch:We,onClose:be});var o=U(a,2),s=H(H(H(o))),c=H(s),l=H(c),u=e=>{var t=GV(()=>(J(t1),K(i),q(()=>t1([],K(i)?.root)))),n=kU(),r=hH(n),a=e=>{var n=k0();VQ(H(n),{get validationError(){return K(t)},get onExpand(){return $1}}),Z(e,n)};Q(r,e=>{K(t)&&e(a)}),Z(e,n)},d=WV(()=>(J(Vg),K(i),q(()=>!Vg(K(i)?.root))));Q(l,e=>{K(d)&&e(u)});var p=U(c);nW(p,1,()=>K(Se),eW,(e,t)=>{var n=A0();(function(e,t){vB(t,!1);var n=B(void 0,!0),r=B(void 0,!0),i=B(void 0,!0),a=$(t,`path`,9),o=$(t,`sortedColumn`,9),s=$(t,`readOnly`,9),c=$(t,`onSort`,9);W(()=>(J(a()),GY),()=>{V(n,Vg(a())?`values`:GY(a()))}),W(()=>(J(o()),J(a())),()=>{V(r,o()&&Hg(a(),o()?.path)?o().sortDirection:void 0)}),W(()=>(K(r),hq),()=>{V(i,K(r)?hq[K(r)]:void 0)}),DH(),GW(!0);var l,u=S0(),d=H(u),f=H(d),p=U(d,2),m=e=>{var t=x0(),n=H(t),a=GV(()=>(K(r),J(QG),J(sv),J(X_),q(()=>K(r)===QG.asc?sv:X_)));GK(n,{get data(){return K(a)}}),G(()=>jW(t,`title`,`Currently sorted in ${K(i)} order`)),Z(e,t)};Q(p,e=>{K(r)!==void 0&&e(m)}),G(e=>{l=_W(u,1,`jse-column-header svelte-5pxwfq`,null,l,{"jse-readonly":s()}),jW(u,`title`,s()?K(n):K(n)+` (Click to sort the data by this column)`),PU(f,e)},[()=>(J(FK),K(n),J(50),q(()=>FK(K(n),50)))]),Y(`click`,u,function(){s()||c()({path:a(),sortDirection:K(r)===QG.asc?QG.desc:QG.asc})}),Z(e,u),yB()})(H(n),{get path(){return K(t)},get sortedColumn(){return K(Pe)},get readOnly(){return f()},onSort:Ie}),Z(e,n)});var m=U(p),h=e=>{var t=j0(),n=H(t),r=GV(()=>(K(j),q(()=>Array.isArray(K(j))?K(j).length:0)));(function(e,t){vB(t,!1);var n=$(t,`count`,9),r=$(t,`maxSampleCount`,9),i=$(t,`readOnly`,9),a=$(t,`onRefresh`,9);GW(!0);var o,s=O0();GK(H(s),{get data(){return bv}}),G(()=>{o=_W(s,1,`jse-column-header svelte-1wgrwv3`,null,o,{"jse-readonly":i()}),jW(s,`title`,`The Columns are created by sampling ${r()} items out of ${n()}. If you're missing a column, click here to sample all of the items instead of a subset. This is slower.`)}),Y(`click`,s,()=>a()()),Z(e,s),yB()})(n,{get count(){return K(r)},get maxSampleCount(){return K(xe)},get readOnly(){return f()},onRefresh:()=>V(xe,1/0)}),Z(e,t)};Q(m,e=>{K(n)&&e(h)});var g,_,v=U(s),y=H(v),b=U(v);nW(b,1,()=>(K(r),q(()=>K(r).visibleItems)),eW,(e,t,a)=>{var o=GV(()=>(K(r),q(()=>K(r).startIndex+a))),s=GV(()=>(K(i),J(K(o)),q(()=>K(i).rows[K(o)]))),c=GV(()=>(J(t1),J(K(o)),J(K(s)),q(()=>t1([String(K(o))],K(s)?.row)))),l=GV(()=>(J($q),K(j),K(ge),J(K(o)),q(()=>$q(K(j),K(ge),[String(K(o))])))),u=I0(),d=H(u);$U(d,()=>K(o),e=>{var t=M0(),n=H(t),r=U(n),i=e=>{VQ(e,{get validationError(){return K(c)},get onExpand(){return $1}})};Q(r,e=>{K(c)&&e(i)}),uW(t,(e,t)=>P1?.(e,t),()=>e=>function(e,t){De[t]=e.getBoundingClientRect().height}(e,K(o))),G(()=>PU(n,`${K(o)??``} `)),Z(e,t)});var p=U(d);nW(p,1,()=>K(Se),eW,(e,n,r,i)=>{var a,c=GV(()=>(J(K(o)),K(n),q(()=>[String(K(o))].concat(K(n))))),u=GV(()=>(J(lc),K(t),K(n),q(()=>lc(K(t),K(n))))),d=GV(()=>(J(bJ),K(I),J(IJ),J(K(c)),q(()=>bJ(K(I))&&IJ(K(I).path,K(c))))),p=GV(()=>(J(K(s)),q(()=>K(s)?.columns[r]))),m=GV(()=>(J(t1),J(K(c)),J(K(p)),q(()=>t1(K(c),K(p))))),h=P0(),g=H(h),_=H(g),v=e=>{var r=GV(()=>(J(jY),J($q),K(t),J(K(l)),K(n),q(()=>jY($q(K(t),K(l),K(n)))))),i=GV(()=>(J(K(r)),q(()=>!!K(r)&&K(r).some(e=>e.active)))),a=GV(()=>(J(Vg),J(K(r)),q(()=>!Vg(K(r)))));(function(e,t){vB(t,!1);var n=$(t,`path`,9),r=$(t,`value`,9),i=$(t,`parser`,9),a=$(t,`isSelected`,9),o=$(t,`containsSearchResult`,9),s=$(t,`containsActiveSearchResult`,9),c=$(t,`onEdit`,9);GW(!0);var l,u=b0(),d=H(u);G(e=>{l=_W(u,1,`jse-inline-value svelte-1jv89ui`,null,l,{"jse-selected":a(),"jse-highlight":o(),"jse-active":s()}),PU(d,e)},[()=>(J(FK),J(i()),J(r()),J(50),q(()=>FK(i().stringify(r())??``,50)))]),Y(`dblclick`,u,()=>c()(n())),Z(e,u),yB()})(e,{get path(){return K(c)},get value(){return K(u)},get parser(){return x()},get isSelected(){return K(d)},get containsSearchResult(){return K(a)},get containsActiveSearchResult(){return K(i)},onEdit:Ft})},y=WV(()=>(J(cG),J(K(u)),q(()=>cG(K(u))))),b=e=>{var t=GV(()=>(J($q),K(j),K(ge),J(K(c)),q(()=>$q(K(j),K(ge),K(c))?.searchResults))),n=GV(()=>K(u)===void 0?``:K(u)),r=GV(()=>(J(oJ),K(j),K(Ne),J(K(c)),q(()=>oJ(K(j),K(Ne),K(c))))),i=GV(()=>K(d)?K(I):void 0);LQ(e,{get path(){return K(c)},get value(){return K(n)},get enforceString(){return K(r)},get selection(){return K(i)},get searchResultItems(){return K(t)},get context(){return K(Le)}})};Q(_,e=>{K(y)?e(v):e(b,-1)});var S=U(_),C=e=>{var t=N0();NQ(H(t),{selected:!0,onContextMenu:rt}),Z(e,t)},w=WV(()=>(J(f()),J(K(d)),J(KJ),K(I),q(()=>!f()&&K(d)&&!KJ(K(I)))));Q(S,e=>{K(w)&&e(C)});var T=U(g,2),E=e=>{VQ(e,{get validationError(){return K(m)},get onExpand(){return $1}})};Q(T,e=>{K(m)&&e(E)}),G(e=>{jW(h,`data-path`,e),a=_W(g,1,`jse-value-outer svelte-1p86y3c`,null,a,{"jse-selected-value":K(d)})},[()=>(J(xK),J(K(c)),q(()=>xK(K(c))))]),Z(e,h)});var m=U(p),h=e=>{Z(e,F0())};Q(m,e=>{K(n)&&e(h)}),Z(e,u)});var S,C=H(U(b));HW(o,e=>V(A,e),()=>K(A)),uW(o,(e,t)=>P1?.(e,t),()=>Ht),EH(()=>Y(`scroll`,o,Xe));var w=U(o,2),T=e=>{var t=GV(()=>(K(he),q(()=>`You pasted a JSON ${Array.isArray(K(he).contents)?`array`:`object`} as text`))),n=GV(()=>[{icon:ev,text:`Paste as JSON instead`,title:`Paste the text as JSON instead of a single value`,onMouseDown:lt},{text:`Leave as is`,title:`Keep the pasted content as a single value`,onClick:ht}]);sQ(e,{type:`info`,get message(){return K(t)},get actions(){return K(n)}})};Q(w,e=>{K(he)&&e(T)});var E=U(w,2),ee=e=>{var t=GV(()=>[{icon:ev,text:`Paste as string instead`,title:`Paste the clipboard data as a single string value instead of an array`,onClick:pt},{text:`Leave as is`,title:`Keep the pasted array`,onClick:gt}]);sQ(e,{type:`info`,message:`Multiline text was pasted as array`,get actions(){return K(t)}})};Q(E,e=>{K(N)&&e(ee)});var te=U(E,2),D=e=>{var t=GV(()=>f()?[]:[{icon:Cv,text:`Ok`,title:`Accept the repaired document`,onClick:Qe},{icon:$_,text:`Repair manually instead`,title:`Leave the document unchanged and repair it manually instead`,onClick:_t}]);sQ(e,{type:`success`,message:`The loaded JSON document was invalid but is successfully repaired.`,get actions(){return K(t)},onClose:Ye})};Q(te,e=>{K(Fe)&&e(D)}),mQ(U(te,2),{get validationErrors(){return K(ze)},selectError:Nt}),G(()=>{g=_W(v,1,`jse-table-invisible-start-section svelte-1p86y3c`,null,g,{"jse-search-box-background":K(P)}),jW(y,`colspan`,(K(Se),q(()=>K(Se).length))),_=yW(y,``,_,{height:(K(r),q(()=>K(r).startHeight+`px`))}),jW(C,`colspan`,(K(Se),q(()=>K(Se).length))),S=yW(C,``,S,{height:(K(r),q(()=>K(r).endHeight+`px`))})}),Z(e,t)},l=e=>{var t=R0(),n=hH(t),r=GV(()=>f()?[]:[{icon:$_,text:`Repair manually`,title:`Open the document in "code" mode and repair it manually`,onClick:_t}]);sQ(n,{type:`error`,message:`The loaded JSON document is invalid and could not be repaired automatically.`,get actions(){return K(r)}}),g1(U(n,2),{get text(){return K(me)},get json(){return K(j)},get indentation(){return T()},get parser(){return x()}}),Z(e,t)},u=e=>{D0(e,{get text(){return K(me)},get json(){return K(j)},get readOnly(){return f()},get parser(){return x()},openJSONEditorModal:Ft,extractPath:Ct,get onChangeMode(){return ee()},onClick:()=>{Ye()}})};Q(s,e=>{K(Ce)?e(c):K(M)&&K(me)!==void 0&&K(me)!==``?e(l,1):e(u,-1)}),Y(`paste`,o,kt),Z(e,t)},Zt=e=>{Z(e,B0())};Q(Yt,e=>{d?e(Zt,-1):e(Xt)}),HW(Kt,e=>V(ue,e),()=>K(ue));var Qt=U(Kt,2),$t=e=>{yQ(e,{onClose:()=>V(Ee,!1)})};Q(Qt,e=>{K(Ee)&&e($t)});var en=U(Qt,2),tn=e=>{OQ(e,QW(()=>K(fe),{onClose:()=>{var e;(e=K(fe))==null||e.onClose(),V(fe,void 0)}}))};return Q(en,e=>{K(fe)&&e(tn)}),G(()=>Gt=_W(Kt,1,`jse-table-mode svelte-1p86y3c`,null,Gt,{"no-main-menu":!_()})),Y(`mousedown`,Kt,function(e){if(e.buttons===1||e.buttons===2){var t=e.target;t.isContentEditable||Ye();var n=SK(t);if(n){if(KJ(K(I))&&QJ(K(j),K(I),n))return;V(I,BJ(n)),e.preventDefault()}}}),Y(`keydown`,Kt,function(e){var t=TK(e);if(a(`keydown`,{combo:t,key:e.key}),t===`Ctrl+X`&&(e.preventDefault(),vt(!0)),t===`Ctrl+Shift+X`&&(e.preventDefault(),vt(!1)),t===`Ctrl+C`&&(e.preventDefault(),bt(!0)),t===`Ctrl+Shift+C`&&(e.preventDefault(),bt(!1)),t===`Ctrl+D`&&(e.preventDefault(),wt()),t!==`Delete`&&t!==`Backspace`||(e.preventDefault(),St()),t===`Insert`&&e.preventDefault(),t===`Ctrl+A`&&e.preventDefault(),t===`Ctrl+Q`&&it(e),t===`ArrowLeft`&&(e.preventDefault(),Ze(),K(I))){var n=function(e,t){var{rowIndex:n,columnIndex:r}=Q$(eY(t),e);return r>0?BJ($$({rowIndex:n,columnIndex:r-1},e)):t}(K(Se),K(I));V(I,n),tt(eY(n))}if(t===`ArrowRight`&&(e.preventDefault(),Ze(),K(I))){var r=function(e,t){var{rowIndex:n,columnIndex:r}=Q$(eY(t),e);return r<e.length-1?BJ($$({rowIndex:n,columnIndex:r+1},e)):t}(K(Se),K(I));V(I,r),tt(eY(r))}if(t===`ArrowUp`&&(e.preventDefault(),Ze(),K(I))){var i=function(e,t){var{rowIndex:n,columnIndex:r}=Q$(eY(t),e);return n>0?BJ($$({rowIndex:n-1,columnIndex:r},e)):t}(K(Se),K(I));V(I,i),tt(eY(i))}if(t===`ArrowDown`&&(e.preventDefault(),Ze(),K(I))){var o=function(e,t,n){var{rowIndex:r,columnIndex:i}=Q$(eY(n),t);return r<e.length-1?BJ($$({rowIndex:r+1,columnIndex:i},t)):n}(K(j),K(Se),K(I));V(I,o),tt(eY(o))}if(t===`Enter`&&K(I)&&bJ(K(I))){e.preventDefault();var s=K(I).path;cG(lc(K(j),s))?Ft(s):f()||V(I,R(R({},K(I)),{},{edit:!0}))}if(t.replace(/^Shift\+/,``).length===1&&K(I))return e.preventDefault(),void function(e){Ot.apply(this,arguments)}(e.key);if(t===`Ctrl+Enter`&&bJ(K(I))){e.preventDefault();var c=lc(K(j),K(I).path);gG(c)&&window.open(String(c),`_blank`)}t===`Escape`&&K(I)&&(e.preventDefault(),V(I,void 0)),t===`Ctrl+F`&&(e.preventDefault(),zt(!1)),t===`Ctrl+H`&&(e.preventDefault(),zt(!0)),t===`Ctrl+Z`&&(e.preventDefault(),Bt()),t===`Ctrl+Shift+Z`&&(e.preventDefault(),Vt())}),Y(`contextmenu`,Kt,it),Z(e,Wt),BW(t,`validate`,He),BW(t,`patch`,Ue),BW(t,`focus`,Ye),BW(t,`acceptAutoRepair`,Qe),BW(t,`scrollTo`,$e),BW(t,`findElement`,nt),BW(t,`openTransformModal`,Pt),yB(Ut)}function U0(e,t){vB(t,!1);var n=$(t,`content`,8),r=$(t,`selection`,12),i=$(t,`readOnly`,8),a=$(t,`indentation`,8),o=$(t,`tabSize`,8),s=$(t,`truncateTextSize`,8),c=$(t,`externalMode`,8),l=$(t,`mainMenuBar`,8),u=$(t,`navigationBar`,8),d=$(t,`statusBar`,8),f=$(t,`askToFormat`,8),p=$(t,`escapeControlCharacters`,8),m=$(t,`escapeUnicodeCharacters`,8),h=$(t,`maxDocumentSizeTextMode`,8),g=$(t,`flattenColumns`,8),_=$(t,`parser`,8),v=$(t,`parseMemoizeOne`,8),y=$(t,`validator`,8),b=$(t,`validationParser`,8),x=$(t,`pathParser`,8),S=$(t,`insideModal`,8),C=$(t,`onChange`,8),w=$(t,`onChangeMode`,8),T=$(t,`onSelect`,8),E=$(t,`onRenderValue`,8),ee=$(t,`onClassName`,8),te=$(t,`onRenderMenu`,8),D=$(t,`onRenderContextMenu`,8),ne=$(t,`onError`,8),re=$(t,`onFocus`,8),ie=$(t,`onBlur`,8),ae=$(t,`onSortModal`,8),oe=$(t,`onTransformModal`,8),O=$(t,`onJSONEditorModal`,8),k=B(),se=B(),ce=B(),le=$W(`jsoneditor:JSONEditorRoot`),ue=B(W1({onChange:e=>V(ue,e)}).get()),A=B(c());function de(e){if(Rq(e)){V(A,e.undo.mode);var t=K(ue).items(),n=t.findIndex(t=>t===e),i=n===-1?void 0:t[n-1];le(`handleUndo`,{index:n,item:e,items:t,prevItem:i}),i&&r(i.redo.selection),w()(K(A))}}function fe(e){if(Rq(e)){V(A,e.redo.mode);var t=K(ue).items(),n=t.findIndex(t=>t===e),i=n===-1?void 0:t[n+1];le(`handleRedo`,{index:n,item:e,items:t,nextItem:i}),i&&r(i.undo.selection),w()(K(A))}}var pe=B(),j={type:`separator`},me=B(),M=B();function he(e){if(K(k))return K(k).patch(e);if(K(se))return K(se).patch(e);if(K(ce))return K(ce).patch(e);throw Error(`Method patch is not available in mode "${K(A)}"`)}function N(e,t){if(K(k))return K(k).expand(e,t);if(K(ce))return K(ce).expand(e,t);throw Error(`Method expand is not available in mode "${K(A)}"`)}function ge(e,t){if(K(k))return K(k).collapse(e,t);if(K(ce))return K(ce).collapse(e,t);throw Error(`Method collapse is not available in mode "${K(A)}"`)}function P(e){if(K(ce))K(ce).openTransformModal(e);else if(K(k))K(k).openTransformModal(e);else{if(!K(se))throw Error(`Method transform is not available in mode "${K(A)}"`);K(se).openTransformModal(e)}}function F(){if(K(ce))return K(ce).validate();if(K(k))return K(k).validate();if(K(se))return K(se).validate();throw Error(`Method validate is not available in mode "${K(A)}"`)}function _e(){return K(k)?K(k).acceptAutoRepair():n()}function ve(e){if(K(k))return K(k).scrollTo(e);if(K(se))return K(se).scrollTo(e);throw Error(`Method scrollTo is not available in mode "${K(A)}"`)}function ye(e){if(K(k))return K(k).findElement(e);if(K(se))return K(se).findElement(e);throw Error(`Method findElement is not available in mode "${K(A)}"`)}function be(){K(ce)?K(ce).focus():K(k)?K(k).focus():K(se)&&K(se).focus()}function xe(){return Se.apply(this,arguments)}function Se(){return(Se=pz(function*(){K(ce)&&(yield K(ce).refresh())})).apply(this,arguments)}W(()=>J(c()),()=>{(function(e){if(e!==K(A)){var t={type:`mode`,undo:{mode:K(A),selection:void 0},redo:{mode:e,selection:void 0}};K(A)===`text`&&K(ce)&&K(ce).flush(),le(`add history item`,t),K(ue).add(t),V(A,e)}})(c())}),W(()=>(K(A),J(w())),()=>{V(pe,[{type:`button`,text:`text`,title:`Switch to text mode (current mode: ${K(A)})`,className:`jse-group-button jse-first`+(K(A)===qG.text?` jse-selected`:``),onClick:()=>w()(qG.text)},{type:`button`,text:`tree`,title:`Switch to tree mode (current mode: ${K(A)})`,className:`jse-group-button `+(K(A)===qG.tree?` jse-selected`:``),onClick:()=>w()(qG.tree)},{type:`button`,text:`table`,title:`Switch to table mode (current mode: ${K(A)})`,className:`jse-group-button jse-last`+(K(A)===qG.table?` jse-selected`:``),onClick:()=>w()(qG.table)}])}),W(()=>(K(pe),J(te()),K(A),J(S()),J(i())),()=>{V(me,e=>{var t=yq(e[0])?K(pe).concat(e):K(pe).concat(j,e),n=fh(t);return te()(t,{mode:K(A),modal:S(),readOnly:i()})||n})}),W(()=>(J(D()),K(A),J(S()),J(i()),J(r())),()=>{V(M,e=>{var t=fh(e);return D()(e,{mode:K(A),modal:S(),readOnly:i(),selection:r()})??(!i()&&t)})}),DH();var Ce={patch:he,expand:N,collapse:ge,transform:P,validate:F,acceptAutoRepair:_e,scrollTo:ve,findElement:ye,focus:be,refresh:xe};GW();var we=kU(),Te=hH(we),Ee=e=>{HW(y0(e,{get externalContent(){return n()},get externalSelection(){return r()},get history(){return K(ue)},get readOnly(){return i()},get indentation(){return a()},get tabSize(){return o()},get mainMenuBar(){return l()},get statusBar(){return d()},get askToFormat(){return f()},get escapeUnicodeCharacters(){return m()},get maxDocumentSize(){return h()},get parser(){return _()},get validator(){return y()},get validationParser(){return b()},get onChange(){return C()},get onChangeMode(){return w()},get onSelect(){return T()},onUndo:de,onRedo:fe,get onError(){return ne()},get onFocus(){return re()},get onBlur(){return ie()},get onRenderMenu(){return K(me)},get onSortModal(){return ae()},get onTransformModal(){return oe()},$$legacy:!0}),e=>V(ce,e),()=>K(ce))},De=WV(()=>(K(A),J(qG),q(()=>K(A)===qG.text||String(K(A))===`code`))),Oe=e=>{HW(H0(e,{get externalContent(){return n()},get externalSelection(){return r()},get history(){return K(ue)},get readOnly(){return i()},get truncateTextSize(){return s()},get mainMenuBar(){return l()},get escapeControlCharacters(){return p()},get escapeUnicodeCharacters(){return m()},get flattenColumns(){return g()},get parser(){return _()},get parseMemoizeOne(){return v()},get validator(){return y()},get validationParser(){return b()},get indentation(){return a()},get onChange(){return C()},get onChangeMode(){return w()},get onSelect(){return T()},onUndo:de,onRedo:fe,get onRenderValue(){return E()},get onFocus(){return re()},get onBlur(){return ie()},get onRenderMenu(){return K(me)},get onRenderContextMenu(){return K(M)},get onSortModal(){return ae()},get onTransformModal(){return oe()},get onJSONEditorModal(){return O()},$$legacy:!0}),e=>V(se,e),()=>K(se))},ke=e=>{HW(V1(e,{get externalContent(){return n()},get externalSelection(){return r()},get history(){return K(ue)},get readOnly(){return i()},get indentation(){return a()},get truncateTextSize(){return s()},get mainMenuBar(){return l()},get navigationBar(){return u()},get escapeControlCharacters(){return p()},get escapeUnicodeCharacters(){return m()},get parser(){return _()},get parseMemoizeOne(){return v()},get validator(){return y()},get validationParser(){return b()},get pathParser(){return x()},get onError(){return ne()},get onChange(){return C()},get onChangeMode(){return w()},get onSelect(){return T()},onUndo:de,onRedo:fe,get onRenderValue(){return E()},get onClassName(){return ee()},get onFocus(){return re()},get onBlur(){return ie()},get onRenderMenu(){return K(me)},get onRenderContextMenu(){return K(M)},get onSortModal(){return ae()},get onTransformModal(){return oe()},get onJSONEditorModal(){return O()},$$legacy:!0}),e=>V(k,e),()=>K(k))};return Q(Te,e=>{K(De)?e(Ee):(K(A),J(qG),q(()=>K(A)===qG.table)?e(Oe,1):e(ke,-1))}),Z(e,we),BW(t,`patch`,he),BW(t,`expand`,N),BW(t,`collapse`,ge),BW(t,`transform`,P),BW(t,`validate`,F),BW(t,`acceptAutoRepair`,_e),BW(t,`scrollTo`,ve),BW(t,`findElement`,ye),BW(t,`focus`,be),BW(t,`refresh`,xe),yB(Ce)}OK(`/* over all fonts, sizes, and colors */
|
|
3626
3626
|
/* "consolas" for Windows, "menlo" for Mac with fallback to "monaco", 'Ubuntu Mono' for Ubuntu */
|
|
3627
3627
|
/* (at Mac this font looks too large at 14px, but 13px is too small for the font on Windows) */
|
|
3628
3628
|
/* main, menu, modal */
|
|
@@ -3745,7 +3745,7 @@ button.jse-context-menu-button.svelte-1y5l9l1 svg {
|
|
|
3745
3745
|
}
|
|
3746
3746
|
.jse-modal-wrapper.svelte-t4zsk3 input:where(.svelte-t4zsk3):read-only {
|
|
3747
3747
|
background: var(--jse-input-background-readonly, transparent);
|
|
3748
|
-
}`);var
|
|
3748
|
+
}`);var W0=X(`<div class="jse-error svelte-t4zsk3"> </div>`),G0=X(`<button type="button" class="jse-secondary svelte-t4zsk3"><!> Back</button>`),K0=X(`<button type="button" class="jse-primary svelte-t4zsk3">Apply</button>`),q0=X(`<button type="button" class="jse-primary svelte-t4zsk3">Close</button>`),J0=X(`<!> <div class="jse-modal-contents svelte-t4zsk3"><div class="jse-label svelte-t4zsk3"><div class="jse-label-inner svelte-t4zsk3">Path</div></div> <input class="jse-path svelte-t4zsk3" type="text" readonly="" title="Selected path"/> <div class="jse-label svelte-t4zsk3"><div class="jse-label-inner svelte-t4zsk3">Contents</div></div> <div class="jse-modal-inline-editor svelte-t4zsk3"><!></div> <div class="jse-actions svelte-t4zsk3"><!> <!> <!></div></div>`,1),Y0=X(`<div class="jse-modal-wrapper svelte-t4zsk3"><!></div>`),X0={};OK(`/* over all fonts, sizes, and colors */
|
|
3749
3749
|
/* "consolas" for Windows, "menlo" for Mac with fallback to "monaco", 'Ubuntu Mono' for Ubuntu */
|
|
3750
3750
|
/* (at Mac this font looks too large at 14px, but 13px is too small for the font on Windows) */
|
|
3751
3751
|
/* main, menu, modal */
|
|
@@ -3832,7 +3832,7 @@ button.jse-context-menu-button.svelte-1y5l9l1 svg {
|
|
|
3832
3832
|
}
|
|
3833
3833
|
.jse-modal-contents.svelte-lwzlls .jse-space:where(.svelte-lwzlls) .jse-error:where(.svelte-lwzlls) {
|
|
3834
3834
|
color: var(--jse-error-color, #ee5341);
|
|
3835
|
-
}`);var
|
|
3835
|
+
}`);var Z0=qW(()=>X0),Q0=X(`<tr><th class="svelte-lwzlls">Property</th><td class="svelte-lwzlls"><!></td></tr>`),$0=X(`<div class="jse-error svelte-lwzlls"> </div>`),e2=X(`<!> <div class="jse-modal-contents svelte-lwzlls"><table class="svelte-lwzlls"><colgroup><col width="25%"/><col width="75%"/></colgroup><tbody><tr><th class="svelte-lwzlls">Path</th><td class="svelte-lwzlls"><input class="jse-path svelte-lwzlls" type="text" readonly="" title="Selected path"/></td></tr><!><tr><th class="svelte-lwzlls">Direction</th><td class="svelte-lwzlls"><!></td></tr></tbody></table> <div class="jse-space svelte-lwzlls"><!></div> <div class="jse-actions svelte-lwzlls"><button type="button" class="jse-primary svelte-lwzlls">Sort</button></div></div>`,1);OK(`/* over all fonts, sizes, and colors */
|
|
3836
3836
|
/* "consolas" for Windows, "menlo" for Mac with fallback to "monaco", 'Ubuntu Mono' for Ubuntu */
|
|
3837
3837
|
/* (at Mac this font looks too large at 14px, but 13px is too small for the font on Windows) */
|
|
3838
3838
|
/* main, menu, modal */
|
|
@@ -3866,4 +3866,4 @@ button.jse-context-menu-button.svelte-1y5l9l1 svg {
|
|
|
3866
3866
|
.jse-main.svelte-1l55585:not(.jse-focus) {
|
|
3867
3867
|
--jse-selection-background-color: var(--jse-selection-background-inactive-color, #e8e8e8);
|
|
3868
3868
|
--jse-context-menu-pointer-background: var(--jse-context-menu-pointer-hover-background, #b2b2b2);
|
|
3869
|
-
}`);var e2=X(`<div role="none"><!></div> <!> <!> <!>`,1);function t2(e,t){vB(t,!1);var n=B(void 0,!0),r=$W(`jsoneditor:JSONEditor`),i={text:``},a=void 0,o=!1,s=qG.tree,c=!0,l=!0,u=!0,d=!0,f=!1,p=!1,m=10485760,h=!0,g=JSON,_=void 0,v=JSON,y={parse:KY,stringify:GY},b=[LK],x=b[0].id,S=Q1,C=void 0,w=void 0,T=WY,E=Q1,ee=Q1,te=Q1,D=Q1,ne=e=>{console.error(e),alert(e.toString())},re=Q1,ie=Q1,ae=$(t,`content`,13,i),oe=$(t,`selection`,13,a),O=$(t,`readOnly`,13,o),k=$(t,`indentation`,13,2),se=$(t,`tabSize`,13,4),ce=$(t,`truncateTextSize`,13,1e3),le=$(t,`mode`,13,s),ue=$(t,`mainMenuBar`,13,c),A=$(t,`navigationBar`,13,l),de=$(t,`statusBar`,13,u),fe=$(t,`askToFormat`,13,d),pe=$(t,`escapeControlCharacters`,13,f),j=$(t,`escapeUnicodeCharacters`,13,p),me=$(t,`maxDocumentSizeTextMode`,13,m),M=$(t,`flattenColumns`,13,h),he=$(t,`parser`,13,g),N=$(t,`validator`,13,_),ge=$(t,`validationParser`,13,v),P=$(t,`pathParser`,13,y),F=$(t,`queryLanguages`,13,b),_e=$(t,`queryLanguageId`,13,x),ve=$(t,`onChangeQueryLanguage`,13,S),ye=$(t,`onChange`,13,C),be=$(t,`onSelect`,13,w),xe=$(t,`onRenderValue`,13,T),Se=$(t,`onClassName`,13,E),Ce=$(t,`onRenderMenu`,13,ee),we=$(t,`onRenderContextMenu`,13,te),Te=$(t,`onChangeMode`,13,D),Ee=$(t,`onError`,13,ne),De=$(t,`onFocus`,13,re),Oe=$(t,`onBlur`,13,ie),ke=B(rG(),!0),Ae=B(!1,!0),je=B(void 0,!0),Me=B(void 0,!0),Ne=B(void 0,!0),I=B(void 0,!0),Pe=B(he(),!0);function Fe(){return ae()}function Ie(e){r(`set`);var t=PG(e);if(t)throw Error(t);V(ke,rG()),ae(e),uV()}function Le(e){r(`update`);var t=PG(e);if(t)throw Error(t);ae(e),uV()}function Re(e){var t=K(je).patch(e);return uV(),t}function ze(e){oe(e),uV()}function Be(e,t){K(je).expand(e,t),uV()}function Ve(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];K(je).collapse(e,t),uV()}function He(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};K(je).transform(e),uV()}function Ue(){return K(je).validate()}function We(){var e=K(je).acceptAutoRepair();return uV(),e}function Ge(e){return Ke.apply(this,arguments)}function Ke(){return(Ke=pz(function*(e){yield K(je).scrollTo(e)})).apply(this,arguments)}function qe(e){return K(je).findElement(e)}function Je(){K(je).focus(),uV()}function Ye(){return Xe.apply(this,arguments)}function Xe(){return(Xe=pz(function*(){yield K(je).refresh()})).apply(this,arguments)}function Ze(e){for(var t of Object.keys(e))switch(t){case`content`:ae(e[t]??i);break;case`selection`:oe(e[t]??a);break;case`readOnly`:O(e[t]??o);break;case`indentation`:k(e[t]??2);break;case`tabSize`:se(e[t]??4);break;case`truncateTextSize`:ce(e[t]??1e3);break;case`mode`:le(e[t]??s);break;case`mainMenuBar`:ue(e[t]??c);break;case`navigationBar`:A(e[t]??l);break;case`statusBar`:de(e[t]??u);break;case`askToFormat`:fe(e[t]??d);break;case`escapeControlCharacters`:pe(e[t]??f);break;case`escapeUnicodeCharacters`:j(e[t]??p);break;case`maxDocumentSizeTextMode`:me(e[t]??m);break;case`flattenColumns`:M(e[t]??h);break;case`parser`:he(e[t]??g);break;case`validator`:N(e[t]??_);break;case`validationParser`:ge(e[t]??v);break;case`pathParser`:P(e[t]??y);break;case`queryLanguages`:F(e[t]??b);break;case`queryLanguageId`:_e(e[t]??x);break;case`onChangeQueryLanguage`:ve(e[t]??S);break;case`onChange`:ye(e[t]??C);break;case`onRenderValue`:xe(e[t]??T);break;case`onClassName`:Se(e[t]??E);break;case`onRenderMenu`:Ce(e[t]??ee);break;case`onRenderContextMenu`:we(e[t]??te);break;case`onChangeMode`:Te(e[t]??D);break;case`onSelect`:be(e[t]??w);break;case`onError`:Ee(e[t]??ne);break;case`onFocus`:De(e[t]??re);break;case`onBlur`:Oe(e[t]??ie);break;default:n(t)}function n(e){r(`Unknown property "${e}"`)}F().some(e=>e.id===_e())||_e(F()[0].id),uV()}function Qe(){return $e.apply(this,arguments)}function $e(){return($e=pz(function*(){throw Error(`class method destroy() is deprecated. It is replaced with a method destroy() in the vanilla library.`)})).apply(this,arguments)}function et(e,t,n){ae(e),ye()&&ye()(e,t,n)}function tt(e){oe(e),be()&&be()(sh(e))}function nt(){V(Ae,!0),De()&&De()()}function rt(){V(Ae,!1),Oe()&&Oe()()}function it(e){return at.apply(this,arguments)}function at(){return(at=pz(function*(e){le()!==e&&(le(e),uV(),Je(),Te()(e))})).apply(this,arguments)}function ot(e){r(`handleChangeQueryLanguage`,e),_e(e),ve()(e)}function st(e){var{id:t,json:r,rootPath:i,onTransform:a,onClose:o}=e;O()||V(I,{id:t,json:r,rootPath:i,indentation:k(),truncateTextSize:ce(),escapeControlCharacters:pe(),escapeUnicodeCharacters:j(),parser:he(),parseMemoizeOne:K(n),validationParser:ge(),pathParser:P(),queryLanguages:F(),queryLanguageId:_e(),onChangeQueryLanguage:ot,onRenderValue:xe(),onRenderMenu:e=>Ce()(e,{mode:le(),modal:!0,readOnly:O()}),onRenderContextMenu:e=>we()(e,{mode:le(),modal:!0,readOnly:O(),selection:oe()}),onClassName:Se(),onTransform:a,onClose:o})}function ct(e){O()||V(Ne,e)}function lt(e){var{content:t,path:n,onPatch:i,onClose:a}=e;r(`onJSONEditorModal`,{content:t,path:n}),V(Me,{content:t,path:n,onPatch:i,readOnly:O(),indentation:k(),tabSize:se(),truncateTextSize:ce(),mainMenuBar:ue(),navigationBar:A(),statusBar:de(),askToFormat:fe(),escapeControlCharacters:pe(),escapeUnicodeCharacters:j(),maxDocumentSizeTextMode:me(),flattenColumns:M(),parser:he(),validator:void 0,validationParser:ge(),pathParser:P(),onRenderValue:xe(),onClassName:Se(),onRenderMenu:Ce(),onRenderContextMenu:we(),onSortModal:ct,onTransformModal:st,onClose:a})}function ut(e){e.stopPropagation()}W(()=>(J(he()),K(Pe),J(ae()),rG),()=>{if(!GG(he(),K(Pe))){if(r(`parser changed, recreate editor`),IG(ae())){var e=K(Pe).stringify(ae().json);ae({json:e===void 0?void 0:he().parse(e)})}V(Pe,he()),V(ke,rG())}}),W(()=>J(ae()),()=>{var e=PG(ae());e&&console.error(`Error: `+e)}),W(()=>J(oe()),()=>{oe()===null&&console.warn(`selection is invalid: it is null but should be undefined`)}),W(()=>J(he()),()=>{V(n,kv(he().parse))}),W(()=>J(le()),()=>{r(`mode changed to`,le())}),DH();var dt={get:Fe,set:Ie,update:Le,patch:Re,select:ze,expand:Be,collapse:Ve,transform:He,validate:Ue,acceptAutoRepair:We,scrollTo:Ge,findElement:qe,focus:Je,refresh:Ye,updateProps:Ze,destroy:Qe};return GW(!0),NK(e,{children:(e,t)=>{var r,i=e2(),a=hH(i);$U(H(a),()=>K(ke),e=>{HW(H0(e,{get externalMode(){return le()},get content(){return ae()},get selection(){return oe()},get readOnly(){return O()},get indentation(){return k()},get tabSize(){return se()},get truncateTextSize(){return ce()},get statusBar(){return de()},get askToFormat(){return fe()},get mainMenuBar(){return ue()},get navigationBar(){return A()},get maxDocumentSizeTextMode(){return me()},get escapeControlCharacters(){return pe()},get escapeUnicodeCharacters(){return j()},get flattenColumns(){return M()},get parser(){return he()},get parseMemoizeOne(){return K(n)},get validator(){return N()},get validationParser(){return ge()},get pathParser(){return P()},insideModal:!1,get onError(){return Ee()},onChange:et,onChangeMode:it,onSelect:tt,get onRenderValue(){return xe()},get onClassName(){return Se()},onFocus:nt,onBlur:rt,get onRenderMenu(){return Ce()},get onRenderContextMenu(){return we()},onSortModal:ct,onTransformModal:st,onJSONEditorModal:lt,$$legacy:!0}),e=>V(je,e),()=>K(je))});var o=U(a,2),s=e=>{(function(e,t){vB(t,!1);var n=B(void 0,!0),r=B(void 0,!0),i=B(void 0,!0),a=B(void 0,!0),o=$W(`jsoneditor:SortModal`),s=$(t,`id`,9),c=$(t,`json`,9),l=$(t,`rootPath`,9),u=$(t,`onSort`,9),d=$(t,`onClose`,9),f={value:1,label:`ascending`},p=[f,{value:-1,label:`descending`}],m=`${s()}:${_c(l())}`,h=B(X0()[m]?.selectedProperty,!0),g=B(X0()[m]?.selectedDirection||f,!0),_=B(void 0,!0);function v(){try{var e;V(_,void 0);var t=K(h)?.value||((e=K(a))==null||(e=e[0])==null?void 0:e.value)||[],n=K(g)?.value,r=T$(c(),l(),t,n);u()!==void 0&&l()!==void 0&&u()({operations:r,rootPath:l(),itemPath:t,direction:n}),d()()}catch(e){V(_,String(e))}}function y(e){e.focus()}W(()=>(J(c()),J(l())),()=>{V(n,lc(c(),l()))}),W(()=>K(n),()=>{V(r,Array.isArray(K(n)))}),W(()=>(K(r),K(n)),()=>{V(i,K(r)?bG(K(n)):void 0)}),W(()=>(K(i),qY),()=>{V(a,K(i)?K(i).map(qY):void 0)}),W(()=>(X0(),K(h),K(g)),()=>{X0(X0()[m]={selectedProperty:K(h),selectedDirection:K(g)}),o(`store state in memory`,m,X0()[m])}),DH(),GW(!0),gQ(e,{get onClose(){return d()},className:`jse-sort-modal`,children:(e,t)=>{var n=$0(),i=hH(n),o=GV(()=>K(r)?`Sort array items`:`Sort object keys`);GZ(i,{get title(){return K(o)},get onClose(){return d()}});var s=H(U(i,2)),c=H(U(H(s))),u=H(U(H(c))),f=U(c),m=e=>{var t=Z0();LZ(H(U(H(t))),{showChevron:!0,get items(){return K(a)},get value(){return K(h)},set value(e){V(h,e)},$$legacy:!0}),Z(e,t)};Q(f,e=>{K(r),K(a),q(()=>K(r)&&K(a)&&K(a)?.length>1)&&e(m)}),LZ(H(U(H(U(f)))),{showChevron:!0,clearable:!1,get items(){return p},get value(){return K(g)},set value(e){V(g,e)},$$legacy:!0});var b=U(s,2),x=H(b),S=e=>{var t=Q0(),n=H(t);G(()=>PU(n,K(_))),Z(e,t)};Q(x,e=>{K(_)&&e(S)});var C=H(U(b,2));EH(()=>Y(`click`,C,v)),uW(C,e=>y?.(e)),G(e=>{AW(u,e),C.disabled=(K(r),K(a),K(h),q(()=>!!(K(r)&&K(a)&&K(a)?.length>1)&&!K(h)))},[()=>(J(l()),J(Bg),J(GY),q(()=>l()&&!Bg(l())?GY(l()):`(document root)`))]),Z(e,n)},$$slots:{default:!0}}),yB()})(e,QW(()=>K(Ne),{onClose:()=>{var e;(e=K(Ne))==null||e.onClose(),V(Ne,void 0)}}))};Q(o,e=>{K(Ne)&&e(s)});var c=U(o,2),l=e=>{Z1(e,QW(()=>K(I),{onClose:()=>{var e;(e=K(I))==null||e.onClose(),V(I,void 0)}}))};Q(c,e=>{K(I)&&e(l)});var u=U(c,2),d=e=>{(function(e,t){vB(t,!1);var n=B(void 0,!0),r=B(void 0,!0),i=B(void 0,!0),a=B(void 0,!0),o=$W(`jsoneditor:JSONEditorModal`),s=$(t,`content`,9),c=$(t,`path`,9),l=$(t,`onPatch`,9),u=$(t,`readOnly`,9),d=$(t,`indentation`,9),f=$(t,`tabSize`,9),p=$(t,`truncateTextSize`,9),m=$(t,`mainMenuBar`,9),h=$(t,`navigationBar`,9),g=$(t,`statusBar`,9),_=$(t,`askToFormat`,9),v=$(t,`escapeControlCharacters`,9),y=$(t,`escapeUnicodeCharacters`,9),b=$(t,`maxDocumentSizeTextMode`,9),x=$(t,`flattenColumns`,9),S=$(t,`parser`,9),C=$(t,`validator`,9),w=$(t,`validationParser`,9),T=$(t,`pathParser`,9),E=$(t,`onRenderValue`,9),ee=$(t,`onClassName`,9),te=$(t,`onRenderMenu`,9),D=$(t,`onRenderContextMenu`,9),ne=$(t,`onSortModal`,9),re=$(t,`onTransformModal`,9),ie=$(t,`onClose`,9),ae=B(void 0,!0),oe=B(void 0,!0),O={mode:ce(s()),content:s(),selection:void 0,relativePath:c()},k=B([O],!0),se=B(void 0,!0);function ce(e){return IG(e)&&Js(e.json)?qG.table:qG.tree}function le(){var e=wg(K(k))?.selection;CJ(e)&&K(ae).scrollTo(eY(e))}function ue(){if(o(`handleApply`),!u())try{V(se,void 0);var e=K(n).relativePath,t=K(n).content,r=[{op:`replace`,path:_c(e),value:RG(t,S()).json}];if(K(k).length>1){var i=RG(K(k)[K(k).length-2].content,S()).json,a={json:bc(i,r)},s=R(R({},K(k)[K(k).length-2]||O),{},{content:a});V(k,[...K(k).slice(0,K(k).length-2),s]),uV(),le()}else l()(r),ie()()}catch(e){V(se,String(e))}}function A(){var e;o(`handleClose`),K(k).length>1?(V(k,Ig(K(k))),uV(),(e=K(ae))==null||e.focus(),le(),V(se,void 0)):ie()()}function de(e){o(`handleChange`,e),j(t=>R(R({},t),{},{content:e}))}function fe(e){o(`handleChangeSelection`,e),j(t=>R(R({},t),{},{selection:e}))}function pe(e){o(`handleChangeMode`,e),j(t=>R(R({},t),{},{mode:e}))}function j(e){var t=e(wg(K(k)));V(k,[...Ig(K(k)),t])}function me(e){V(se,e.toString()),console.error(e)}function M(e){var t,{content:n,path:r}=e;o(`handleJSONEditorModal`,{content:n,path:r});var i={mode:ce(n),content:n,selection:void 0,relativePath:r};V(k,[...K(k),i]),uV(),(t=K(ae))==null||t.focus()}function he(e){e.focus()}KU(()=>{var e;(e=K(ae))==null||e.focus()}),W(()=>K(k),()=>{V(n,wg(K(k))||O)}),W(()=>K(k),()=>{V(r,K(k).flatMap(e=>e.relativePath))}),W(()=>(K(r),GY),()=>{V(i,Bg(K(r))?`(document root)`:GY(K(r)))}),W(()=>J(S()),()=>{V(a,kv(S().parse))}),DH(),GW(!0),gQ(e,{onClose:A,className:`jse-jsoneditor-modal`,get fullscreen(){return K(oe)},children:(e,t)=>{var r=J0();NK(H(r),{children:(e,t)=>{var r=q0(),o=hH(r),s=GV(()=>(K(k),q(()=>K(k).length>1?` (${K(k).length})`:``)));GZ(o,{get title(){return`Edit nested content ${K(s)??``}`},fullScreenButton:!0,onClose:A,get fullscreen(){return K(oe)},set fullscreen(e){V(oe,e)},$$legacy:!0});var c=U(H(U(o,2)),2),l=U(c,4);HW(H0(H(l),{get externalMode(){return K(n),q(()=>K(n).mode)},get content(){return K(n),q(()=>K(n).content)},get selection(){return K(n),q(()=>K(n).selection)},get readOnly(){return u()},get indentation(){return d()},get tabSize(){return f()},get truncateTextSize(){return p()},get statusBar(){return g()},get askToFormat(){return _()},get mainMenuBar(){return m()},get navigationBar(){return h()},get escapeControlCharacters(){return v()},get escapeUnicodeCharacters(){return y()},get maxDocumentSizeTextMode(){return b()},get flattenColumns(){return x()},get parser(){return S()},get parseMemoizeOne(){return K(a)},get validator(){return C()},get validationParser(){return w()},get pathParser(){return T()},insideModal:!0,onError:me,onChange:de,onChangeMode:pe,onSelect:fe,get onRenderValue(){return E()},get onClassName(){return ee()},get onFocus(){return Q1},get onBlur(){return Q1},get onRenderMenu(){return te()},get onRenderContextMenu(){return D()},get onSortModal(){return ne()},get onTransformModal(){return re()},onJSONEditorModal:M,$$legacy:!0}),e=>V(ae,e),()=>K(ae));var ie=H(U(l,2)),O=e=>{var t=U0(),n=H(t);G(()=>PU(n,K(se))),Z(e,t)};Q(ie,e=>{K(se)&&e(O)});var ce=U(ie,2),le=e=>{var t=W0();GK(H(t),{get data(){return W_}}),Y(`click`,t,A),Z(e,t)};Q(ce,e=>{K(k),q(()=>K(k).length>1)&&e(le)});var j=U(ce,2),N=e=>{var t=G0();EH(()=>Y(`click`,t,ue)),uW(t,e=>he?.(e)),Z(e,t)},ge=e=>{var t=K0();Y(`click`,t,A),Z(e,t)};Q(j,e=>{u()?e(ge,-1):e(N)}),G(()=>AW(c,K(i))),Z(e,r)},$$slots:{default:!0}}),Z(e,r)},$$slots:{default:!0}}),yB()})(e,QW(()=>K(Me),{onClose:()=>{var e;(e=K(Me))==null||e.onClose(),V(Me,void 0)}}))};Q(u,e=>{K(Me)&&e(d)}),G(()=>r=_W(a,1,`jse-main svelte-1l55585`,null,r,{"jse-focus":K(Ae)})),Y(`keydown`,a,ut),Z(e,i)},$$slots:{default:!0}}),BW(t,`get`,Fe),BW(t,`set`,Ie),BW(t,`update`,Le),BW(t,`patch`,Re),BW(t,`select`,ze),BW(t,`expand`,Be),BW(t,`collapse`,Ve),BW(t,`transform`,He),BW(t,`validate`,Ue),BW(t,`acceptAutoRepair`,We),BW(t,`scrollTo`,Ge),BW(t,`findElement`,qe),BW(t,`focus`,Je),BW(t,`refresh`,Ye),BW(t,`updateProps`,Ze),BW(t,`destroy`,Qe),yB(dt)}function n2(e){var{target:t,props:n}=e,r=FU(t2,{target:t,props:n});return r.destroy=pz(function*(){return function(e,t){var n=LU.get(e);return n?(LU.delete(e),n(t)):Promise.resolve()}(r)}),uV(),r}var r2=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,i2=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,a2=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function o2(e,t){if(e===`__proto__`||e===`constructor`&&t&&typeof t==`object`&&`prototype`in t){s2(e);return}return t}function s2(e){console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`)}function c2(e,t={}){if(typeof e!=`string`)return e;let n=e.trim();if(e[0]===`"`&&e.endsWith(`"`)&&!e.includes(`\\`))return n.slice(1,-1);if(n.length<=9){let e=n.toLowerCase();if(e===`true`)return!0;if(e===`false`)return!1;if(e===`undefined`)return;if(e===`null`)return null;if(e===`nan`)return NaN;if(e===`infinity`)return 1/0;if(e===`-infinity`)return-1/0}if(!a2.test(e)){if(t.strict)throw SyntaxError(`[destr] Invalid JSON`);return e}try{if(r2.test(e)||i2.test(e)){if(t.strict)throw Error(`[destr] Possible prototype pollution`);return JSON.parse(e,o2)}return JSON.parse(e)}catch(n){if(t.strict)throw n;return e}}function l2(e,t={}){return c2(e,{...t,strict:!0})}var u2=typeof global==`object`&&global&&global.Object===Object&&global,d2=typeof self==`object`&&self&&self.Object===Object&&self,f2=u2||d2||Function(`return this`)(),p2=f2.Symbol,m2=Object.prototype,h2=m2.hasOwnProperty,g2=m2.toString,_2=p2?p2.toStringTag:void 0;function v2(e){var t=h2.call(e,_2),n=e[_2];try{e[_2]=void 0;var r=!0}catch{}var i=g2.call(e);return r&&(t?e[_2]=n:delete e[_2]),i}var y2=Object.prototype.toString;function b2(e){return y2.call(e)}var x2=`[object Null]`,S2=`[object Undefined]`,C2=p2?p2.toStringTag:void 0;function w2(e){return e==null?e===void 0?S2:x2:C2&&C2 in Object(e)?v2(e):b2(e)}function T2(e){return typeof e==`object`&&!!e}var E2=`[object Symbol]`;function D2(e){return typeof e==`symbol`||T2(e)&&w2(e)==E2}var O2=/\s/;function k2(e){for(var t=e.length;t--&&O2.test(e.charAt(t)););return t}var A2=/^\s+/;function j2(e){return e&&e.slice(0,k2(e)+1).replace(A2,``)}function M2(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}var N2=NaN,P2=/^[-+]0x[0-9a-f]+$/i,F2=/^0b[01]+$/i,I2=/^0o[0-7]+$/i,L2=parseInt;function R2(e){if(typeof e==`number`)return e;if(D2(e))return N2;if(M2(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=M2(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=j2(e);var n=F2.test(e);return n||I2.test(e)?L2(e.slice(2),n?2:8):P2.test(e)?N2:+e}var z2=function(){return f2.Date.now()},B2=`Expected a function`,V2=Math.max,H2=Math.min;function U2(e,t,n){var r,i,a,o,s,c,l=0,u=!1,d=!1,f=!0;if(typeof e!=`function`)throw TypeError(B2);t=R2(t)||0,M2(n)&&(u=!!n.leading,d=`maxWait`in n,a=d?V2(R2(n.maxWait)||0,t):a,f=`trailing`in n?!!n.trailing:f);function p(t){var n=r,a=i;return r=i=void 0,l=t,o=e.apply(a,n),o}function m(e){return l=e,s=setTimeout(_,t),u?p(e):o}function h(e){var n=e-c,r=e-l,i=t-n;return d?H2(i,a-r):i}function g(e){var n=e-c,r=e-l;return c===void 0||n>=t||n<0||d&&r>=a}function _(){var e=z2();if(g(e))return v(e);s=setTimeout(_,h(e))}function v(e){return s=void 0,f&&r?p(e):(r=i=void 0,o)}function y(){s!==void 0&&clearTimeout(s),l=0,r=c=i=s=void 0}function b(){return s===void 0?o:v(z2())}function x(){var e=z2(),n=g(e);if(r=arguments,i=this,c=e,n){if(s===void 0)return m(c);if(d)return clearTimeout(s),s=setTimeout(_,t),p(c)}return s===void 0&&(s=setTimeout(_,t)),o}return x.cancel=y,x.flush=b,x}var W2=typeof global==`object`&&global&&global.Object===Object&&global,G2=typeof self==`object`&&self&&self.Object===Object&&self,K2=W2||G2||Function(`return this`)(),q2=K2.Symbol,J2=Object.prototype,Y2=J2.hasOwnProperty,X2=J2.toString,Z2=q2?q2.toStringTag:void 0;function Q2(e){var t=Y2.call(e,Z2),n=e[Z2];try{e[Z2]=void 0;var r=!0}catch{}var i=X2.call(e);return r&&(t?e[Z2]=n:delete e[Z2]),i}var $2=Object.prototype.toString;function e4(e){return $2.call(e)}var t4=`[object Null]`,n4=`[object Undefined]`,r4=q2?q2.toStringTag:void 0;function i4(e){return e==null?e===void 0?n4:t4:r4&&r4 in Object(e)?Q2(e):e4(e)}function a4(e){return typeof e==`object`&&!!e}var o4=`[object Symbol]`;function s4(e){return typeof e==`symbol`||a4(e)&&i4(e)==o4}function c4(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var l4=Array.isArray,u4=q2?q2.prototype:void 0,d4=u4?u4.toString:void 0;function f4(e){if(typeof e==`string`)return e;if(l4(e))return c4(e,f4)+``;if(s4(e))return d4?d4.call(e):``;var t=e+``;return t==`0`&&1/e==-1/0?`-0`:t}function p4(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}function m4(e){return e}var h4=`[object AsyncFunction]`,g4=`[object Function]`,_4=`[object GeneratorFunction]`,v4=`[object Proxy]`;function y4(e){if(!p4(e))return!1;var t=i4(e);return t==g4||t==_4||t==h4||t==v4}var b4=K2[`__core-js_shared__`],x4=function(){var e=/[^.]+$/.exec(b4&&b4.keys&&b4.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function S4(e){return!!x4&&x4 in e}var C4=Function.prototype.toString;function w4(e){if(e!=null){try{return C4.call(e)}catch{}try{return e+``}catch{}}return``}var T4=/[\\^$.*+?()[\]{}|]/g,E4=/^\[object .+?Constructor\]$/,D4=Function.prototype,O4=Object.prototype,k4=D4.toString,A4=O4.hasOwnProperty,j4=RegExp(`^`+k4.call(A4).replace(T4,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function M4(e){return!p4(e)||S4(e)?!1:(y4(e)?j4:E4).test(w4(e))}function N4(e,t){return e?.[t]}function P4(e,t){var n=N4(e,t);return M4(n)?n:void 0}var F4=P4(K2,`WeakMap`),I4=Object.create,L4=function(){function e(){}return function(t){if(!p4(t))return{};if(I4)return I4(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function R4(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function z4(e,t){var n=-1,r=e.length;for(t||=Array(r);++n<r;)t[n]=e[n];return t}var B4=800,V4=16,H4=Date.now;function U4(e){var t=0,n=0;return function(){var r=H4(),i=V4-(r-n);if(n=r,i>0){if(++t>=B4)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function W4(e){return function(){return e}}var G4=function(){try{var e=P4(Object,`defineProperty`);return e({},``,{}),e}catch{}}(),K4=U4(G4?function(e,t){return G4(e,`toString`,{configurable:!0,enumerable:!1,value:W4(t),writable:!0})}:m4);function q4(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var J4=9007199254740991,Y4=/^(?:0|[1-9]\d*)$/;function X4(e,t){var n=typeof e;return t??=J4,!!t&&(n==`number`||n!=`symbol`&&Y4.test(e))&&e>-1&&e%1==0&&e<t}function Z4(e,t,n){t==`__proto__`&&G4?G4(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Q4(e,t){return e===t||e!==e&&t!==t}var $4=Object.prototype.hasOwnProperty;function e3(e,t,n){var r=e[t];(!($4.call(e,t)&&Q4(r,n))||n===void 0&&!(t in e))&&Z4(e,t,n)}function t3(e,t,n,r){var i=!n;n||={};for(var a=-1,o=t.length;++a<o;){var s=t[a],c=r?r(n[s],e[s],s,n,e):void 0;c===void 0&&(c=e[s]),i?Z4(n,s,c):e3(n,s,c)}return n}var n3=Math.max;function r3(e,t,n){return t=n3(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,a=n3(r.length-t,0),o=Array(a);++i<a;)o[i]=r[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=r[i];return s[t]=n(o),R4(e,this,s)}}function i3(e,t){return K4(r3(e,t,m4),e+``)}var a3=9007199254740991;function o3(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=a3}function s3(e){return e!=null&&o3(e.length)&&!y4(e)}function c3(e,t,n){if(!p4(n))return!1;var r=typeof t;return(r==`number`?s3(n)&&X4(t,n.length):r==`string`&&t in n)?Q4(n[t],e):!1}function l3(e){return i3(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(a=e.length>3&&typeof a==`function`?(i--,a):void 0,o&&c3(n[0],n[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,a)}return t})}var u3=Object.prototype;function d3(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||u3)}function f3(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var p3=`[object Arguments]`;function m3(e){return a4(e)&&i4(e)==p3}var h3=Object.prototype,g3=h3.hasOwnProperty,_3=h3.propertyIsEnumerable,v3=m3(function(){return arguments}())?m3:function(e){return a4(e)&&g3.call(e,`callee`)&&!_3.call(e,`callee`)};function y3(){return!1}var b3=typeof exports==`object`&&exports&&!exports.nodeType&&exports,x3=b3&&typeof module==`object`&&module&&!module.nodeType&&module,S3=x3&&x3.exports===b3?K2.Buffer:void 0,C3=(S3?S3.isBuffer:void 0)||y3,w3=`[object Arguments]`,T3=`[object Array]`,E3=`[object Boolean]`,D3=`[object Date]`,O3=`[object Error]`,k3=`[object Function]`,A3=`[object Map]`,j3=`[object Number]`,M3=`[object Object]`,N3=`[object RegExp]`,P3=`[object Set]`,F3=`[object String]`,I3=`[object WeakMap]`,L3=`[object ArrayBuffer]`,R3=`[object DataView]`,z3=`[object Float32Array]`,B3=`[object Float64Array]`,V3=`[object Int8Array]`,H3=`[object Int16Array]`,U3=`[object Int32Array]`,W3=`[object Uint8Array]`,G3=`[object Uint8ClampedArray]`,K3=`[object Uint16Array]`,q3=`[object Uint32Array]`,J3={};J3[z3]=J3[B3]=J3[V3]=J3[H3]=J3[U3]=J3[W3]=J3[G3]=J3[K3]=J3[q3]=!0,J3[w3]=J3[T3]=J3[L3]=J3[E3]=J3[R3]=J3[D3]=J3[O3]=J3[k3]=J3[A3]=J3[j3]=J3[M3]=J3[N3]=J3[P3]=J3[F3]=J3[I3]=!1;function Y3(e){return a4(e)&&o3(e.length)&&!!J3[i4(e)]}function X3(e){return function(t){return e(t)}}var Z3=typeof exports==`object`&&exports&&!exports.nodeType&&exports,Q3=Z3&&typeof module==`object`&&module&&!module.nodeType&&module,$3=Q3&&Q3.exports===Z3&&W2.process,e6=function(){try{return Q3&&Q3.require&&Q3.require(`util`).types||$3&&$3.binding&&$3.binding(`util`)}catch{}}(),t6=e6&&e6.isTypedArray,n6=t6?X3(t6):Y3,r6=Object.prototype.hasOwnProperty;function i6(e,t){var n=l4(e),r=!n&&v3(e),i=!n&&!r&&C3(e),a=!n&&!r&&!i&&n6(e),o=n||r||i||a,s=o?f3(e.length,String):[],c=s.length;for(var l in e)(t||r6.call(e,l))&&!(o&&(l==`length`||i&&(l==`offset`||l==`parent`)||a&&(l==`buffer`||l==`byteLength`||l==`byteOffset`)||X4(l,c)))&&s.push(l);return s}function a6(e,t){return function(n){return e(t(n))}}var o6=a6(Object.keys,Object),s6=Object.prototype.hasOwnProperty;function c6(e){if(!d3(e))return o6(e);var t=[];for(var n in Object(e))s6.call(e,n)&&n!=`constructor`&&t.push(n);return t}function l6(e){return s3(e)?i6(e):c6(e)}function u6(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var d6=Object.prototype.hasOwnProperty;function f6(e){if(!p4(e))return u6(e);var t=d3(e),n=[];for(var r in e)r==`constructor`&&(t||!d6.call(e,r))||n.push(r);return n}function p6(e){return s3(e)?i6(e,!0):f6(e)}var m6=l3(function(e,t,n,r){t3(t,p6(t),e,r)}),h6=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,g6=/^\w*$/;function _6(e,t){if(l4(e))return!1;var n=typeof e;return n==`number`||n==`symbol`||n==`boolean`||e==null||s4(e)?!0:g6.test(e)||!h6.test(e)||t!=null&&e in Object(t)}var v6=P4(Object,`create`);function y6(){this.__data__=v6?v6(null):{},this.size=0}function b6(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}var x6=`__lodash_hash_undefined__`,S6=Object.prototype.hasOwnProperty;function C6(e){var t=this.__data__;if(v6){var n=t[e];return n===x6?void 0:n}return S6.call(t,e)?t[e]:void 0}var w6=Object.prototype.hasOwnProperty;function T6(e){var t=this.__data__;return v6?t[e]!==void 0:w6.call(t,e)}var E6=`__lodash_hash_undefined__`;function D6(e,t){var n=this.__data__;return this.size+=+!this.has(e),n[e]=v6&&t===void 0?E6:t,this}function O6(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}O6.prototype.clear=y6,O6.prototype.delete=b6,O6.prototype.get=C6,O6.prototype.has=T6,O6.prototype.set=D6;function k6(){this.__data__=[],this.size=0}function A6(e,t){for(var n=e.length;n--;)if(Q4(e[n][0],t))return n;return-1}var j6=Array.prototype.splice;function M6(e){var t=this.__data__,n=A6(t,e);return n<0?!1:(n==t.length-1?t.pop():j6.call(t,n,1),--this.size,!0)}function N6(e){var t=this.__data__,n=A6(t,e);return n<0?void 0:t[n][1]}function P6(e){return A6(this.__data__,e)>-1}function F6(e,t){var n=this.__data__,r=A6(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function I6(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}I6.prototype.clear=k6,I6.prototype.delete=M6,I6.prototype.get=N6,I6.prototype.has=P6,I6.prototype.set=F6;var L6=P4(K2,`Map`);function R6(){this.size=0,this.__data__={hash:new O6,map:new(L6||I6),string:new O6}}function z6(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}function B6(e,t){var n=e.__data__;return z6(t)?n[typeof t==`string`?`string`:`hash`]:n.map}function V6(e){var t=B6(this,e).delete(e);return this.size-=+!!t,t}function H6(e){return B6(this,e).get(e)}function U6(e){return B6(this,e).has(e)}function W6(e,t){var n=B6(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function G6(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}G6.prototype.clear=R6,G6.prototype.delete=V6,G6.prototype.get=H6,G6.prototype.has=U6,G6.prototype.set=W6;var K6=`Expected a function`;function q6(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(K6);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(q6.Cache||G6),n}q6.Cache=G6;var J6=500;function Y6(e){var t=q6(e,function(e){return n.size===J6&&n.clear(),e}),n=t.cache;return t}var X6=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Z6=/\\(\\)?/g,Q6=Y6(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(X6,function(e,n,r,i){t.push(r?i.replace(Z6,`$1`):n||e)}),t});function $6(e){return e==null?``:f4(e)}function e8(e,t){return l4(e)?e:_6(e,t)?[e]:Q6($6(e))}function t8(e){if(typeof e==`string`||s4(e))return e;var t=e+``;return t==`0`&&1/e==-1/0?`-0`:t}function n8(e,t){t=e8(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[t8(t[n++])];return n&&n==r?e:void 0}function r8(e,t,n){var r=e==null?void 0:n8(e,t);return r===void 0?n:r}function i8(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var a8=a6(Object.getPrototypeOf,Object),o8=`[object Object]`,s8=Function.prototype,c8=Object.prototype,l8=s8.toString,u8=c8.hasOwnProperty,d8=l8.call(Object);function f8(e){if(!a4(e)||i4(e)!=o8)return!1;var t=a8(e);if(t===null)return!0;var n=u8.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&l8.call(n)==d8}function p8(){this.__data__=new I6,this.size=0}function m8(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function h8(e){return this.__data__.get(e)}function g8(e){return this.__data__.has(e)}var _8=200;function v8(e,t){var n=this.__data__;if(n instanceof I6){var r=n.__data__;if(!L6||r.length<_8-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new G6(r)}return n.set(e,t),this.size=n.size,this}function y8(e){var t=this.__data__=new I6(e);this.size=t.size}y8.prototype.clear=p8,y8.prototype.delete=m8,y8.prototype.get=h8,y8.prototype.has=g8,y8.prototype.set=v8;var b8=typeof exports==`object`&&exports&&!exports.nodeType&&exports,x8=b8&&typeof module==`object`&&module&&!module.nodeType&&module,S8=x8&&x8.exports===b8?K2.Buffer:void 0,C8=S8?S8.allocUnsafe:void 0;function w8(e,t){if(t)return e.slice();var n=e.length,r=C8?C8(n):new e.constructor(n);return e.copy(r),r}function T8(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}function E8(){return[]}var D8=Object.prototype.propertyIsEnumerable,O8=Object.getOwnPropertySymbols,k8=O8?function(e){return e==null?[]:(e=Object(e),T8(O8(e),function(t){return D8.call(e,t)}))}:E8;function A8(e,t,n){var r=t(e);return l4(e)?r:i8(r,n(e))}function j8(e){return A8(e,l6,k8)}var M8=P4(K2,`DataView`),N8=P4(K2,`Promise`),P8=P4(K2,`Set`),F8=`[object Map]`,I8=`[object Object]`,L8=`[object Promise]`,R8=`[object Set]`,z8=`[object WeakMap]`,B8=`[object DataView]`,V8=w4(M8),H8=w4(L6),U8=w4(N8),W8=w4(P8),G8=w4(F4),K8=i4;(M8&&K8(new M8(new ArrayBuffer(1)))!=B8||L6&&K8(new L6)!=F8||N8&&K8(N8.resolve())!=L8||P8&&K8(new P8)!=R8||F4&&K8(new F4)!=z8)&&(K8=function(e){var t=i4(e),n=t==I8?e.constructor:void 0,r=n?w4(n):``;if(r)switch(r){case V8:return B8;case H8:return F8;case U8:return L8;case W8:return R8;case G8:return z8}return t});var q8=Object.prototype.hasOwnProperty;function J8(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]==`string`&&q8.call(e,`index`)&&(n.index=e.index,n.input=e.input),n}var Y8=K2.Uint8Array;function X8(e){var t=new e.constructor(e.byteLength);return new Y8(t).set(new Y8(e)),t}function Z8(e,t){var n=X8(e.buffer);return new e.constructor(n,e.byteOffset,e.byteLength)}var Q8=/\w*$/;function $8(e){var t=new e.constructor(e.source,Q8.exec(e));return t.lastIndex=e.lastIndex,t}var e5=q2?q2.prototype:void 0,t5=e5?e5.valueOf:void 0;function n5(e){return t5?Object(t5.call(e)):{}}function r5(e,t){var n=t?X8(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var i5=`[object Boolean]`,a5=`[object Date]`,o5=`[object Map]`,s5=`[object Number]`,c5=`[object RegExp]`,l5=`[object Set]`,u5=`[object String]`,d5=`[object Symbol]`,f5=`[object ArrayBuffer]`,p5=`[object DataView]`,m5=`[object Float32Array]`,h5=`[object Float64Array]`,g5=`[object Int8Array]`,_5=`[object Int16Array]`,v5=`[object Int32Array]`,y5=`[object Uint8Array]`,b5=`[object Uint8ClampedArray]`,x5=`[object Uint16Array]`,S5=`[object Uint32Array]`;function C5(e,t,n){var r=e.constructor;switch(t){case f5:return X8(e);case i5:case a5:return new r(+e);case p5:return Z8(e);case m5:case h5:case g5:case _5:case v5:case y5:case b5:case x5:case S5:return r5(e,n);case o5:return new r;case s5:case u5:return new r(e);case c5:return $8(e);case l5:return new r;case d5:return n5(e)}}function w5(e){return typeof e.constructor==`function`&&!d3(e)?L4(a8(e)):{}}var T5=`[object Map]`;function E5(e){return a4(e)&&K8(e)==T5}var D5=e6&&e6.isMap,O5=D5?X3(D5):E5,k5=`[object Set]`;function A5(e){return a4(e)&&K8(e)==k5}var j5=e6&&e6.isSet,M5=j5?X3(j5):A5,N5=1,P5=`[object Arguments]`,F5=`[object Array]`,I5=`[object Boolean]`,L5=`[object Date]`,R5=`[object Error]`,z5=`[object Function]`,B5=`[object GeneratorFunction]`,V5=`[object Map]`,H5=`[object Number]`,U5=`[object Object]`,W5=`[object RegExp]`,G5=`[object Set]`,K5=`[object String]`,q5=`[object Symbol]`,J5=`[object WeakMap]`,Y5=`[object ArrayBuffer]`,X5=`[object DataView]`,Z5=`[object Float32Array]`,Q5=`[object Float64Array]`,$5=`[object Int8Array]`,e7=`[object Int16Array]`,t7=`[object Int32Array]`,n7=`[object Uint8Array]`,r7=`[object Uint8ClampedArray]`,i7=`[object Uint16Array]`,a7=`[object Uint32Array]`,o7={};o7[P5]=o7[F5]=o7[Y5]=o7[X5]=o7[I5]=o7[L5]=o7[Z5]=o7[Q5]=o7[$5]=o7[e7]=o7[t7]=o7[V5]=o7[H5]=o7[U5]=o7[W5]=o7[G5]=o7[K5]=o7[q5]=o7[n7]=o7[r7]=o7[i7]=o7[a7]=!0,o7[R5]=o7[z5]=o7[J5]=!1;function s7(e,t,n,r,i,a){var o,s=t&N5;if(o!==void 0)return o;if(!p4(e))return e;var c=l4(e);if(c)o=J8(e);else{var l=K8(e),u=l==z5||l==B5;if(C3(e))return w8(e,s);if(l==U5||l==P5||u&&!i)o=u?{}:w5(e);else{if(!o7[l])return i?e:{};o=C5(e,l,s)}}a||=new y8;var d=a.get(e);if(d)return d;a.set(e,o),M5(e)?e.forEach(function(r){o.add(s7(r,t,n,r,e,a))}):O5(e)&&e.forEach(function(r,i){o.set(i,s7(r,t,n,i,e,a))});var f=c?void 0:j8(e);return q4(f||e,function(r,i){f&&(i=r,r=e[i]),e3(o,i,s7(r,t,n,i,e,a))}),o}var c7=1,l7=4;function u7(e){return s7(e,c7|l7)}var d7=`__lodash_hash_undefined__`;function f7(e){return this.__data__.set(e,d7),this}function p7(e){return this.__data__.has(e)}function m7(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new G6;++t<n;)this.add(e[t])}m7.prototype.add=m7.prototype.push=f7,m7.prototype.has=p7;function h7(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function g7(e,t){return e.has(t)}var _7=1,v7=2;function y7(e,t,n,r,i,a){var o=n&_7,s=e.length,c=t.length;if(s!=c&&!(o&&c>s))return!1;var l=a.get(e),u=a.get(t);if(l&&u)return l==t&&u==e;var d=-1,f=!0,p=n&v7?new m7:void 0;for(a.set(e,t),a.set(t,e);++d<s;){var m=e[d],h=t[d];if(r)var g=o?r(h,m,d,t,e,a):r(m,h,d,e,t,a);if(g!==void 0){if(g)continue;f=!1;break}if(p){if(!h7(t,function(e,t){if(!g7(p,t)&&(m===e||i(m,e,n,r,a)))return p.push(t)})){f=!1;break}}else if(!(m===h||i(m,h,n,r,a))){f=!1;break}}return a.delete(e),a.delete(t),f}function b7(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function x7(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var S7=1,C7=2,w7=`[object Boolean]`,T7=`[object Date]`,E7=`[object Error]`,D7=`[object Map]`,O7=`[object Number]`,k7=`[object RegExp]`,A7=`[object Set]`,j7=`[object String]`,M7=`[object Symbol]`,N7=`[object ArrayBuffer]`,P7=`[object DataView]`,F7=q2?q2.prototype:void 0,I7=F7?F7.valueOf:void 0;function L7(e,t,n,r,i,a,o){switch(n){case P7:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case N7:return!(e.byteLength!=t.byteLength||!a(new Y8(e),new Y8(t)));case w7:case T7:case O7:return Q4(+e,+t);case E7:return e.name==t.name&&e.message==t.message;case k7:case j7:return e==t+``;case D7:var s=b7;case A7:var c=r&S7;if(s||=x7,e.size!=t.size&&!c)return!1;var l=o.get(e);if(l)return l==t;r|=C7,o.set(e,t);var u=y7(s(e),s(t),r,i,a,o);return o.delete(e),u;case M7:if(I7)return I7.call(e)==I7.call(t)}return!1}var R7=1,z7=Object.prototype.hasOwnProperty;function B7(e,t,n,r,i,a){var o=n&R7,s=j8(e),c=s.length;if(c!=j8(t).length&&!o)return!1;for(var l=c;l--;){var u=s[l];if(!(o?u in t:z7.call(t,u)))return!1}var d=a.get(e),f=a.get(t);if(d&&f)return d==t&&f==e;var p=!0;a.set(e,t),a.set(t,e);for(var m=o;++l<c;){u=s[l];var h=e[u],g=t[u];if(r)var _=o?r(g,h,u,t,e,a):r(h,g,u,e,t,a);if(!(_===void 0?h===g||i(h,g,n,r,a):_)){p=!1;break}m||=u==`constructor`}if(p&&!m){var v=e.constructor,y=t.constructor;v!=y&&`constructor`in e&&`constructor`in t&&!(typeof v==`function`&&v instanceof v&&typeof y==`function`&&y instanceof y)&&(p=!1)}return a.delete(e),a.delete(t),p}var V7=1,H7=`[object Arguments]`,U7=`[object Array]`,W7=`[object Object]`,G7=Object.prototype.hasOwnProperty;function K7(e,t,n,r,i,a){var o=l4(e),s=l4(t),c=o?U7:K8(e),l=s?U7:K8(t);c=c==H7?W7:c,l=l==H7?W7:l;var u=c==W7,d=l==W7,f=c==l;if(f&&C3(e)){if(!C3(t))return!1;o=!0,u=!1}if(f&&!u)return a||=new y8,o||n6(e)?y7(e,t,n,r,i,a):L7(e,t,c,n,r,i,a);if(!(n&V7)){var p=u&&G7.call(e,`__wrapped__`),m=d&&G7.call(t,`__wrapped__`);if(p||m){var h=p?e.value():e,g=m?t.value():t;return a||=new y8,i(h,g,n,r,a)}}return f?(a||=new y8,B7(e,t,n,r,i,a)):!1}function q7(e,t,n,r,i){return e===t?!0:e==null||t==null||!a4(e)&&!a4(t)?e!==e&&t!==t:K7(e,t,n,r,q7,i)}var J7=1,Y7=2;function X7(e,t,n,r){var i=n.length,a=i;if(e==null)return!a;for(e=Object(e);i--;){var o=n[i];if(o[2]?o[1]!==e[o[0]]:!(o[0]in e))return!1}for(;++i<a;){o=n[i];var s=o[0],c=e[s],l=o[1];if(o[2]){if(c===void 0&&!(s in e))return!1}else{var u=new y8,d;if(!(d===void 0?q7(l,c,J7|Y7,r,u):d))return!1}}return!0}function Z7(e){return e===e&&!p4(e)}function Q7(e){for(var t=l6(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Z7(i)]}return t}function $7(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function e9(e){var t=Q7(e);return t.length==1&&t[0][2]?$7(t[0][0],t[0][1]):function(n){return n===e||X7(n,e,t)}}function t9(e,t){return e!=null&&t in Object(e)}function n9(e,t,n){t=e8(t,e);for(var r=-1,i=t.length,a=!1;++r<i;){var o=t8(t[r]);if(!(a=e!=null&&n(e,o)))break;e=e[o]}return a||++r!=i?a:(i=e==null?0:e.length,!!i&&o3(i)&&X4(o,i)&&(l4(e)||v3(e)))}function r9(e,t){return e!=null&&n9(e,t,t9)}var i9=1,a9=2;function o9(e,t){return _6(e)&&Z7(t)?$7(t8(e),t):function(n){var r=r8(n,e);return r===void 0&&r===t?r9(n,e):q7(t,r,i9|a9)}}function s9(e){return function(t){return t?.[e]}}function c9(e){return function(t){return n8(t,e)}}function l9(e){return _6(e)?s9(t8(e)):c9(e)}function u9(e){return typeof e==`function`?e:e==null?m4:typeof e==`object`?l4(e)?o9(e[0],e[1]):e9(e):l9(e)}function d9(e){return function(e,t,n){for(var r=-1,i=Object(e),a=n(e),o=a.length;o--;){var s=a[++r];if(t(i[s],s,i)===!1)break}return e}}var f9=d9();function p9(e,t){return e&&f9(e,t,l6)}function m9(e,t,n){(n!==void 0&&!Q4(e[t],n)||n===void 0&&!(t in e))&&Z4(e,t,n)}function h9(e){return a4(e)&&s3(e)}function g9(e,t){if(!(t===`constructor`&&typeof e[t]==`function`)&&t!=`__proto__`)return e[t]}function _9(e){return t3(e,p6(e))}function v9(e,t,n,r,i,a,o){var s=g9(e,n),c=g9(t,n),l=o.get(c);if(l){m9(e,n,l);return}var u=a?a(s,c,n+``,e,t,o):void 0,d=u===void 0;if(d){var f=l4(c),p=!f&&C3(c),m=!f&&!p&&n6(c);u=c,f||p||m?l4(s)?u=s:h9(s)?u=z4(s):p?(d=!1,u=w8(c,!0)):m?(d=!1,u=r5(c,!0)):u=[]:f8(c)||v3(c)?(u=s,v3(s)?u=_9(s):(!p4(s)||y4(s))&&(u=w5(c))):d=!1}d&&(o.set(c,u),i(u,c,r,a,o),o.delete(c)),m9(e,n,u)}function y9(e,t,n,r,i){e!==t&&f9(t,function(a,o){if(i||=new y8,p4(a))v9(e,t,o,n,y9,r,i);else{var s=r?r(g9(e,o),a,o+``,e,t,i):void 0;s===void 0&&(s=a),m9(e,o,s)}},p6)}var b9=l3(function(e,t,n,r){y9(e,t,n,r)});function x9(e,t){var n={};return t=u9(t),p9(e,function(e,r,i){Z4(n,t(e,r,i),e)}),n}var S9=RegExp(`([\\p{Ll}\\d])(\\p{Lu})`,`gu`),C9=RegExp(`(\\p{Lu})([\\p{Lu}][\\p{Ll}])`,`gu`),w9=RegExp(`(\\d)\\p{Ll}|(\\p{L})\\d`,`u`),T9=/[^\p{L}\d]+/giu,E9=`$1\0$2`,D9=``;function O9(e){let t=e.trim();t=t.replace(S9,E9).replace(C9,E9),t=t.replace(T9,`\0`);let n=0,r=t.length;for(;t.charAt(n)===`\0`;)n++;if(n===r)return[];for(;t.charAt(r-1)===`\0`;)r--;return t.slice(n,r).split(/\0/g)}function k9(e){let t=O9(e);for(let e=0;e<t.length;e++){let n=t[e],r=w9.exec(n);if(r){let i=r.index+(r[1]??r[2]).length;t.splice(e,1,n.slice(0,i),n.slice(i))}}return t}function A9(e,t){let[n,r,i]=P9(e,t),a=j9(void 0),o=N9(a,M9(void 0));return n+r.map((e,t)=>t===0?a(e):o(e,t)).join(``)+i}function j9(e){return t=>t.toLocaleLowerCase(e)}function M9(e){return t=>t.toLocaleUpperCase(e)}function N9(e,t){return(n,r)=>{let i=n[0];return(r>0&&i>=`0`&&i<=`9`?`_`+i:t(i))+e(n.slice(1))}}function P9(e,t={}){let n=t.split??(t.separateNumbers?k9:O9),r=t.prefixCharacters??D9,i=t.suffixCharacters??D9,a=0,o=e.length;for(;a<e.length;){let t=e.charAt(a);if(!r.includes(t))break;a++}for(;o>a;){let t=o-1,n=e.charAt(t);if(!i.includes(n))break;o=t}return[e.slice(0,a),n(e.slice(a,o)),e.slice(o)]}var F9=e=>/.+-.+/.test(e)?A9(e):e,I9=e=>Object.prototype.toString.call(e).slice(8,-1)===`Object`;function L9(e,t){let n=Object.create(null),r=e.split(`,`);for(let e=0;e<r.length;e++)n[r[e]]=!0;return e=>!!n[e]}var R9=L9(`String,Number,Boolean,Function,Symbol,BigInt`);function z9(e){let t=e?.toString().match(/^\s*function (\w+)/);return t?t[1]:e===null?`null`:``}function B9(e,t){let n,r=z9(t);if(R9(r)){let i=typeof e;n=i===r.toLowerCase(),!n&&i===`object`&&(n=e instanceof t)}else n=r===`Object`?p4(e):r===`Array`?Array.isArray(e):r===`null`?e===null:e instanceof t;return{valid:n,expectedType:r}}function V9({prop:e,type:t,validator:n}){if(![void 0,null].includes(e)&&t){let n=!1,r=Array.isArray(t)?t:[t],i=[];for(let t=0;t<r.length&&!n;t++){let{valid:a,expectedType:o}=B9(e,r[t]);i.push(o||``),n=a}if(!n)throw TypeError(`Invalid prop: type check failed, expecting [${i.join(`, `)}], receiving: ${e}`)}if(n&&!n(e))throw Error(`Invalid prop: validator check failed, receiving: ${e}`)}function H9(e,{mergeObject:t,mergeObjectCustomizer:n,mergeFunction:r}){let i=[];for(let t=e.length-1;t>=0;t--)i.push(e[t]);let a=n||(r?(e,t)=>typeof e==`function`&&typeof t==`function`?r?.(t,e):void 0:void 0);return t===`deep`?b9(...i,a):m6(...i,a)}function U9(e,{mergeFunction:t}){return e.reduce(t,()=>{})}function W9(e,t={}){let{type:n,default:r,defaultIsDynamic:i=!1,required:a=!1,validator:o,camelizeObjectKeys:s=!1,mergeObjectApplyOnlyToDefault:c=!1,mergeFunctionApplyOnlyToDefault:l=!0}=t,{mergeObject:u=`deep`,mergeObjectCustomizer:d,mergeFunction:f=!1}=t,p=[],m,h=!1,g=!1,_=e=>{if(e!==void 0){V9({type:n,prop:e,validator:o});let t=I9(e),r=typeof e==`function`;return h=t,g=r,t?(e=u7(e),s?x9(e,(e,t)=>F9(t)):e):e}};for(let t of e)p.push(_(t));if(!i)p.push(_(r));else if(typeof r!=`function`)throw TypeError(`Invalid option: options.default should be Function when options.defaultIsDynamic enabled, receiving: ${r}`);h||(u=!1,g||(f=!1));for(let e=0;e<p.length;e++){let t=p[e];if(t!==void 0){m=e===p.length-1?t:u?H9(c?[t,r]:p,{mergeObject:u,mergeObjectCustomizer:d,mergeFunction:f}):f?U9(l?[t,r]:p,{mergeFunction:f}):t;break}}if(a&&[void 0,null].includes(m))throw Error(`Missing required prop`);return i?W9(e,{...t,default:r(m),defaultIsDynamic:!1}):m}function G9(e){let t=Array.from(F9(e));return t[0]=t[0].toUpperCase(),t.unshift(`o`,`n`),t.join(``)}function K9(e,{props:t=[],camelizePropNames:n=!1}={}){let r={props:{},attrs:{},listeners:{},hooks:{},slots:{}},i;if(Array.isArray(t))i=n?t.map(e=>F9(e)):t;else if(n){i=[];for(let e in t)i.push(F9(e))}else i=Object.keys(t);for(let t in e)if(t.startsWith(`@`)){let n=t.substring(1);if(n.startsWith(`vue:`))r.hooks[G9(n.replace(`vue:`,`vnode-`))]=e[t];else{if(n.startsWith(`vnode`))throw Error(`@vnode-* hooks are no longer supported. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support has been removed in Vue 3.4.`);r.listeners[G9(n)]=e[t]}}else if(t.startsWith(`#`)){let n=t.substring(1);n&&(r.slots[n]=e[t])}else{let a=n?F9(t):t;i.includes(a)?r.props[a]=e[t]:r.attrs[t]=e[t]}return r}var q9=`JsonEditorVue`,J9=[`mainMenuBar`,`navigationBar`,`statusBar`,`askToFormat`,`readOnly`,`escapeControlCharacters`,`escapeUnicodeCharacters`,`flattenColumns`],Y9={},X9={},Z9=`modelValue`,Q9=`update:modelValue`,$9={[Z9]:{},mode:{type:String},debounce:{type:Number},stringified:{type:Boolean,default:void 0},...Object.fromEntries(J9.map(e=>[e,{type:Boolean,default:void 0}]))},cee=Ur({name:q9,install(e,t){let n=K9(t||{},{props:$9});Object.assign(Y9,n.props),Object.assign(X9,n.attrs),e.component(q9,this)},props:$9,emits:{[Q9](e){return!0},"update:mode":function(e){return!0}},setup(e,{attrs:t,emit:n,expose:r}){let i=rs()?.proxy,a=an(),o=an(!1),s=an();lr(()=>{var t;s.value=W9([e.mode,Y9.mode],{type:String}),(t=a.value)==null||t.updateProps({mode:s.value||qG.tree})});let c=e=>{n(`update:mode`,e)};Y9.mode!==void 0&&e.mode===void 0&&c(Y9.mode);let l=xs(()=>W9([e.debounce,Y9.debounce,300],{type:Number})),u=xs(()=>W9([e.stringified,Y9.stringified,!0],{type:Boolean})),d=c2,f=e=>{o.value=!0,!u.value&&e.text&&(a.value&&!a.value.validate()&&(e.json=d(e.text)),e.text=void 0),n(Q9,e.text===void 0?e.json:e.text)},p=U2(f,l.value),m=e=>{s.value===`text`?p(e):f(e)},h=(e,t)=>(...n)=>{e(...n),t(...n)};return r?.({jsonEditor:a}),Ei(()=>{var e;(e=a.value)==null||e.destroy()}),Si(()=>{let n=W9([e[Z9],Y9[Z9]]),l=W9([Object.fromEntries(Array.from(J9,t=>[t,W9([e[t],Y9[t]])]).filter(([,e])=>e!==void 0)),t,X9],{camelizeObjectKeys:!0,defaultIsDynamic:!0,default:e=>(d=e.parser?.parse||c2,{onChange:m,onChangeMode:c,mode:s.value,parser:{parse:l2,stringify:JSON.stringify},...n!==void 0&&{content:{[typeof n==`string`&&s.value===`text`&&u.value?`text`:`json`]:n}}}),mergeFunction:h,mergeObject:`shallow`,type:Object});a.value=n2({target:i?.$refs.jsonEditorRef,props:l}),dr(()=>e[Z9],e=>{if(o.value){o.value=!1;return}a.value&&a.value.set([void 0,``].includes(e)?{text:``}:{[typeof e==`string`&&s.value===`text`&&u.value?`text`:`json`]:e})},{deep:!0}),dr(()=>Array.from(J9,t=>e[t]),e=>{var t;(t=a.value)==null||t.updateProps(Object.fromEntries(Array.from(e,(e,t)=>[J9[t],e]).filter(([,e])=>e!==void 0)))}),dr(()=>t,e=>{var t;let n={};(e.onChange||e[`on-change`])&&(n.onChange=m),(e.onChangeMode||e[`on-change-mode`])&&(n.onChangeMode=c),d=e.parser?.parse||c2,(t=a.value)==null||t.updateProps(Object.getOwnPropertyNames(n).length>0?W9([e,n],{camelizeObjectKeys:!0,mergeFunction:h,mergeObject:`shallow`,type:Object}):e)},{deep:!0}),r||(r=e=>{for(let t in e)i[t]=un(e[t])},r({jsonEditor:a}))}),()=>Ss(`div`,{ref:`jsonEditorRef`})}});export{Fi as $,F as $t,Ss as A,dn as At,Ai as B,x as Bt,Go as C,an as Ct,rs as D,$t as Dt,Ur as E,on as Et,Bn as F,f as Ft,$n as G,v as Gt,Ei as H,w as Ht,pi as I,k as It,Wn as J,C as Jt,ir as K,ve as Kt,xi as L,ye as Lt,ar as M,un as Mt,Qi as N,oe as Nt,Hr as O,yn as Ot,Zo as P,se as Pt,Ii as Q,P as Qt,Ti as R,ue as Rt,Ko as S,Kt as St,ci as T,qt as Tt,wi as U,u as Ut,Si as V,d as Vt,ko as W,D as Wt,Vi as X,Se as Xt,zi as Y,xe as Yt,Ni as Z,de as Zt,qo as _,Xt as _t,Ds as a,Ji as at,Qa as b,je as bt,Co as c,dr as ct,Tr as d,tr as dt,me as en,Rr as et,An as f,nr as ft,Fo as g,Ae as gt,Bo as h,ke as ht,Os as i,ya as it,or as j,ln as jt,Uo as k,gn as kt,di as l,lr as lt,xs as m,hn as mt,Fg as n,fe as nn,Ui as nt,Ir as o,Gr as ot,Wo as p,er as pt,Qn as q,S as qt,$f as r,Yi as rt,Mr as s,Ar as st,cee as t,we as tn,Vr as tt,fo as u,$i as ut,Po as v,rn as vt,Vo as w,Gt as wt,Bi as x,Wt as xt,$a as y,en as yt,mi as z,g as zt};
|
|
3869
|
+
}`);var t2=X(`<div role="none"><!></div> <!> <!> <!>`,1);function n2(e,t){vB(t,!1);var n=B(void 0,!0),r=$W(`jsoneditor:JSONEditor`),i={text:``},a=void 0,o=!1,s=qG.tree,c=!0,l=!0,u=!0,d=!0,f=!1,p=!1,m=10485760,h=!0,g=JSON,_=void 0,v=JSON,y={parse:KY,stringify:GY},b=[LK],x=b[0].id,S=$1,C=void 0,w=void 0,T=WY,E=$1,ee=$1,te=$1,D=$1,ne=e=>{console.error(e),alert(e.toString())},re=$1,ie=$1,ae=$(t,`content`,13,i),oe=$(t,`selection`,13,a),O=$(t,`readOnly`,13,o),k=$(t,`indentation`,13,2),se=$(t,`tabSize`,13,4),ce=$(t,`truncateTextSize`,13,1e3),le=$(t,`mode`,13,s),ue=$(t,`mainMenuBar`,13,c),A=$(t,`navigationBar`,13,l),de=$(t,`statusBar`,13,u),fe=$(t,`askToFormat`,13,d),pe=$(t,`escapeControlCharacters`,13,f),j=$(t,`escapeUnicodeCharacters`,13,p),me=$(t,`maxDocumentSizeTextMode`,13,m),M=$(t,`flattenColumns`,13,h),he=$(t,`parser`,13,g),N=$(t,`validator`,13,_),ge=$(t,`validationParser`,13,v),P=$(t,`pathParser`,13,y),F=$(t,`queryLanguages`,13,b),_e=$(t,`queryLanguageId`,13,x),ve=$(t,`onChangeQueryLanguage`,13,S),ye=$(t,`onChange`,13,C),be=$(t,`onSelect`,13,w),xe=$(t,`onRenderValue`,13,T),Se=$(t,`onClassName`,13,E),Ce=$(t,`onRenderMenu`,13,ee),we=$(t,`onRenderContextMenu`,13,te),Te=$(t,`onChangeMode`,13,D),Ee=$(t,`onError`,13,ne),De=$(t,`onFocus`,13,re),Oe=$(t,`onBlur`,13,ie),ke=B(rG(),!0),Ae=B(!1,!0),je=B(void 0,!0),Me=B(void 0,!0),Ne=B(void 0,!0),I=B(void 0,!0),Pe=B(he(),!0);function Fe(){return ae()}function Ie(e){r(`set`);var t=PG(e);if(t)throw Error(t);V(ke,rG()),ae(e),uV()}function Le(e){r(`update`);var t=PG(e);if(t)throw Error(t);ae(e),uV()}function Re(e){var t=K(je).patch(e);return uV(),t}function ze(e){oe(e),uV()}function Be(e,t){K(je).expand(e,t),uV()}function Ve(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];K(je).collapse(e,t),uV()}function He(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};K(je).transform(e),uV()}function Ue(){return K(je).validate()}function We(){var e=K(je).acceptAutoRepair();return uV(),e}function Ge(e){return Ke.apply(this,arguments)}function Ke(){return(Ke=pz(function*(e){yield K(je).scrollTo(e)})).apply(this,arguments)}function qe(e){return K(je).findElement(e)}function Je(){K(je).focus(),uV()}function Ye(){return Xe.apply(this,arguments)}function Xe(){return(Xe=pz(function*(){yield K(je).refresh()})).apply(this,arguments)}function Ze(e){for(var t of Object.keys(e))switch(t){case`content`:ae(e[t]??i);break;case`selection`:oe(e[t]??a);break;case`readOnly`:O(e[t]??o);break;case`indentation`:k(e[t]??2);break;case`tabSize`:se(e[t]??4);break;case`truncateTextSize`:ce(e[t]??1e3);break;case`mode`:le(e[t]??s);break;case`mainMenuBar`:ue(e[t]??c);break;case`navigationBar`:A(e[t]??l);break;case`statusBar`:de(e[t]??u);break;case`askToFormat`:fe(e[t]??d);break;case`escapeControlCharacters`:pe(e[t]??f);break;case`escapeUnicodeCharacters`:j(e[t]??p);break;case`maxDocumentSizeTextMode`:me(e[t]??m);break;case`flattenColumns`:M(e[t]??h);break;case`parser`:he(e[t]??g);break;case`validator`:N(e[t]??_);break;case`validationParser`:ge(e[t]??v);break;case`pathParser`:P(e[t]??y);break;case`queryLanguages`:F(e[t]??b);break;case`queryLanguageId`:_e(e[t]??x);break;case`onChangeQueryLanguage`:ve(e[t]??S);break;case`onChange`:ye(e[t]??C);break;case`onRenderValue`:xe(e[t]??T);break;case`onClassName`:Se(e[t]??E);break;case`onRenderMenu`:Ce(e[t]??ee);break;case`onRenderContextMenu`:we(e[t]??te);break;case`onChangeMode`:Te(e[t]??D);break;case`onSelect`:be(e[t]??w);break;case`onError`:Ee(e[t]??ne);break;case`onFocus`:De(e[t]??re);break;case`onBlur`:Oe(e[t]??ie);break;default:n(t)}function n(e){r(`Unknown property "${e}"`)}F().some(e=>e.id===_e())||_e(F()[0].id),uV()}function Qe(){return $e.apply(this,arguments)}function $e(){return($e=pz(function*(){throw Error(`class method destroy() is deprecated. It is replaced with a method destroy() in the vanilla library.`)})).apply(this,arguments)}function et(e,t,n){ae(e),ye()&&ye()(e,t,n)}function tt(e){oe(e),be()&&be()(fh(e))}function nt(){V(Ae,!0),De()&&De()()}function rt(){V(Ae,!1),Oe()&&Oe()()}function it(e){return at.apply(this,arguments)}function at(){return(at=pz(function*(e){le()!==e&&(le(e),uV(),Je(),Te()(e))})).apply(this,arguments)}function ot(e){r(`handleChangeQueryLanguage`,e),_e(e),ve()(e)}function st(e){var{id:t,json:r,rootPath:i,onTransform:a,onClose:o}=e;O()||V(I,{id:t,json:r,rootPath:i,indentation:k(),truncateTextSize:ce(),escapeControlCharacters:pe(),escapeUnicodeCharacters:j(),parser:he(),parseMemoizeOne:K(n),validationParser:ge(),pathParser:P(),queryLanguages:F(),queryLanguageId:_e(),onChangeQueryLanguage:ot,onRenderValue:xe(),onRenderMenu:e=>Ce()(e,{mode:le(),modal:!0,readOnly:O()}),onRenderContextMenu:e=>we()(e,{mode:le(),modal:!0,readOnly:O(),selection:oe()}),onClassName:Se(),onTransform:a,onClose:o})}function ct(e){O()||V(Ne,e)}function lt(e){var{content:t,path:n,onPatch:i,onClose:a}=e;r(`onJSONEditorModal`,{content:t,path:n}),V(Me,{content:t,path:n,onPatch:i,readOnly:O(),indentation:k(),tabSize:se(),truncateTextSize:ce(),mainMenuBar:ue(),navigationBar:A(),statusBar:de(),askToFormat:fe(),escapeControlCharacters:pe(),escapeUnicodeCharacters:j(),maxDocumentSizeTextMode:me(),flattenColumns:M(),parser:he(),validator:void 0,validationParser:ge(),pathParser:P(),onRenderValue:xe(),onClassName:Se(),onRenderMenu:Ce(),onRenderContextMenu:we(),onSortModal:ct,onTransformModal:st,onClose:a})}function ut(e){e.stopPropagation()}W(()=>(J(he()),K(Pe),J(ae()),rG),()=>{if(!GG(he(),K(Pe))){if(r(`parser changed, recreate editor`),IG(ae())){var e=K(Pe).stringify(ae().json);ae({json:e===void 0?void 0:he().parse(e)})}V(Pe,he()),V(ke,rG())}}),W(()=>J(ae()),()=>{var e=PG(ae());e&&console.error(`Error: `+e)}),W(()=>J(oe()),()=>{oe()===null&&console.warn(`selection is invalid: it is null but should be undefined`)}),W(()=>J(he()),()=>{V(n,kv(he().parse))}),W(()=>J(le()),()=>{r(`mode changed to`,le())}),DH();var dt={get:Fe,set:Ie,update:Le,patch:Re,select:ze,expand:Be,collapse:Ve,transform:He,validate:Ue,acceptAutoRepair:We,scrollTo:Ge,findElement:qe,focus:Je,refresh:Ye,updateProps:Ze,destroy:Qe};return GW(!0),NK(e,{children:(e,t)=>{var r,i=t2(),a=hH(i);$U(H(a),()=>K(ke),e=>{HW(U0(e,{get externalMode(){return le()},get content(){return ae()},get selection(){return oe()},get readOnly(){return O()},get indentation(){return k()},get tabSize(){return se()},get truncateTextSize(){return ce()},get statusBar(){return de()},get askToFormat(){return fe()},get mainMenuBar(){return ue()},get navigationBar(){return A()},get maxDocumentSizeTextMode(){return me()},get escapeControlCharacters(){return pe()},get escapeUnicodeCharacters(){return j()},get flattenColumns(){return M()},get parser(){return he()},get parseMemoizeOne(){return K(n)},get validator(){return N()},get validationParser(){return ge()},get pathParser(){return P()},insideModal:!1,get onError(){return Ee()},onChange:et,onChangeMode:it,onSelect:tt,get onRenderValue(){return xe()},get onClassName(){return Se()},onFocus:nt,onBlur:rt,get onRenderMenu(){return Ce()},get onRenderContextMenu(){return we()},onSortModal:ct,onTransformModal:st,onJSONEditorModal:lt,$$legacy:!0}),e=>V(je,e),()=>K(je))});var o=U(a,2),s=e=>{(function(e,t){vB(t,!1);var n=B(void 0,!0),r=B(void 0,!0),i=B(void 0,!0),a=B(void 0,!0),o=$W(`jsoneditor:SortModal`),s=$(t,`id`,9),c=$(t,`json`,9),l=$(t,`rootPath`,9),u=$(t,`onSort`,9),d=$(t,`onClose`,9),f={value:1,label:`ascending`},p=[f,{value:-1,label:`descending`}],m=`${s()}:${_c(l())}`,h=B(Z0()[m]?.selectedProperty,!0),g=B(Z0()[m]?.selectedDirection||f,!0),_=B(void 0,!0);function v(){try{var e;V(_,void 0);var t=K(h)?.value||((e=K(a))==null||(e=e[0])==null?void 0:e.value)||[],n=K(g)?.value,r=E$(c(),l(),t,n);u()!==void 0&&l()!==void 0&&u()({operations:r,rootPath:l(),itemPath:t,direction:n}),d()()}catch(e){V(_,String(e))}}function y(e){e.focus()}W(()=>(J(c()),J(l())),()=>{V(n,lc(c(),l()))}),W(()=>K(n),()=>{V(r,Array.isArray(K(n)))}),W(()=>(K(r),K(n)),()=>{V(i,K(r)?bG(K(n)):void 0)}),W(()=>(K(i),qY),()=>{V(a,K(i)?K(i).map(qY):void 0)}),W(()=>(Z0(),K(h),K(g)),()=>{Z0(Z0()[m]={selectedProperty:K(h),selectedDirection:K(g)}),o(`store state in memory`,m,Z0()[m])}),DH(),GW(!0),_Q(e,{get onClose(){return d()},className:`jse-sort-modal`,children:(e,t)=>{var n=e2(),i=hH(n),o=GV(()=>K(r)?`Sort array items`:`Sort object keys`);GZ(i,{get title(){return K(o)},get onClose(){return d()}});var s=H(U(i,2)),c=H(U(H(s))),u=H(U(H(c))),f=U(c),m=e=>{var t=Q0();LZ(H(U(H(t))),{showChevron:!0,get items(){return K(a)},get value(){return K(h)},set value(e){V(h,e)},$$legacy:!0}),Z(e,t)};Q(f,e=>{K(r),K(a),q(()=>K(r)&&K(a)&&K(a)?.length>1)&&e(m)}),LZ(H(U(H(U(f)))),{showChevron:!0,clearable:!1,get items(){return p},get value(){return K(g)},set value(e){V(g,e)},$$legacy:!0});var b=U(s,2),x=H(b),S=e=>{var t=$0(),n=H(t);G(()=>PU(n,K(_))),Z(e,t)};Q(x,e=>{K(_)&&e(S)});var C=H(U(b,2));EH(()=>Y(`click`,C,v)),uW(C,e=>y?.(e)),G(e=>{AW(u,e),C.disabled=(K(r),K(a),K(h),q(()=>!!(K(r)&&K(a)&&K(a)?.length>1)&&!K(h)))},[()=>(J(l()),J(Vg),J(GY),q(()=>l()&&!Vg(l())?GY(l()):`(document root)`))]),Z(e,n)},$$slots:{default:!0}}),yB()})(e,QW(()=>K(Ne),{onClose:()=>{var e;(e=K(Ne))==null||e.onClose(),V(Ne,void 0)}}))};Q(o,e=>{K(Ne)&&e(s)});var c=U(o,2),l=e=>{Q1(e,QW(()=>K(I),{onClose:()=>{var e;(e=K(I))==null||e.onClose(),V(I,void 0)}}))};Q(c,e=>{K(I)&&e(l)});var u=U(c,2),d=e=>{(function(e,t){vB(t,!1);var n=B(void 0,!0),r=B(void 0,!0),i=B(void 0,!0),a=B(void 0,!0),o=$W(`jsoneditor:JSONEditorModal`),s=$(t,`content`,9),c=$(t,`path`,9),l=$(t,`onPatch`,9),u=$(t,`readOnly`,9),d=$(t,`indentation`,9),f=$(t,`tabSize`,9),p=$(t,`truncateTextSize`,9),m=$(t,`mainMenuBar`,9),h=$(t,`navigationBar`,9),g=$(t,`statusBar`,9),_=$(t,`askToFormat`,9),v=$(t,`escapeControlCharacters`,9),y=$(t,`escapeUnicodeCharacters`,9),b=$(t,`maxDocumentSizeTextMode`,9),x=$(t,`flattenColumns`,9),S=$(t,`parser`,9),C=$(t,`validator`,9),w=$(t,`validationParser`,9),T=$(t,`pathParser`,9),E=$(t,`onRenderValue`,9),ee=$(t,`onClassName`,9),te=$(t,`onRenderMenu`,9),D=$(t,`onRenderContextMenu`,9),ne=$(t,`onSortModal`,9),re=$(t,`onTransformModal`,9),ie=$(t,`onClose`,9),ae=B(void 0,!0),oe=B(void 0,!0),O={mode:ce(s()),content:s(),selection:void 0,relativePath:c()},k=B([O],!0),se=B(void 0,!0);function ce(e){return IG(e)&&Js(e.json)?qG.table:qG.tree}function le(){var e=kg(K(k))?.selection;CJ(e)&&K(ae).scrollTo(eY(e))}function ue(){if(o(`handleApply`),!u())try{V(se,void 0);var e=K(n).relativePath,t=K(n).content,r=[{op:`replace`,path:_c(e),value:RG(t,S()).json}];if(K(k).length>1){var i=RG(K(k)[K(k).length-2].content,S()).json,a={json:bc(i,r)},s=R(R({},K(k)[K(k).length-2]||O),{},{content:a});V(k,[...K(k).slice(0,K(k).length-2),s]),uV(),le()}else l()(r),ie()()}catch(e){V(se,String(e))}}function A(){var e;o(`handleClose`),K(k).length>1?(V(k,Lg(K(k))),uV(),(e=K(ae))==null||e.focus(),le(),V(se,void 0)):ie()()}function de(e){o(`handleChange`,e),j(t=>R(R({},t),{},{content:e}))}function fe(e){o(`handleChangeSelection`,e),j(t=>R(R({},t),{},{selection:e}))}function pe(e){o(`handleChangeMode`,e),j(t=>R(R({},t),{},{mode:e}))}function j(e){var t=e(kg(K(k)));V(k,[...Lg(K(k)),t])}function me(e){V(se,e.toString()),console.error(e)}function M(e){var t,{content:n,path:r}=e;o(`handleJSONEditorModal`,{content:n,path:r});var i={mode:ce(n),content:n,selection:void 0,relativePath:r};V(k,[...K(k),i]),uV(),(t=K(ae))==null||t.focus()}function he(e){e.focus()}KU(()=>{var e;(e=K(ae))==null||e.focus()}),W(()=>K(k),()=>{V(n,kg(K(k))||O)}),W(()=>K(k),()=>{V(r,K(k).flatMap(e=>e.relativePath))}),W(()=>(K(r),GY),()=>{V(i,Vg(K(r))?`(document root)`:GY(K(r)))}),W(()=>J(S()),()=>{V(a,kv(S().parse))}),DH(),GW(!0),_Q(e,{onClose:A,className:`jse-jsoneditor-modal`,get fullscreen(){return K(oe)},children:(e,t)=>{var r=Y0();NK(H(r),{children:(e,t)=>{var r=J0(),o=hH(r),s=GV(()=>(K(k),q(()=>K(k).length>1?` (${K(k).length})`:``)));GZ(o,{get title(){return`Edit nested content ${K(s)??``}`},fullScreenButton:!0,onClose:A,get fullscreen(){return K(oe)},set fullscreen(e){V(oe,e)},$$legacy:!0});var c=U(H(U(o,2)),2),l=U(c,4);HW(U0(H(l),{get externalMode(){return K(n),q(()=>K(n).mode)},get content(){return K(n),q(()=>K(n).content)},get selection(){return K(n),q(()=>K(n).selection)},get readOnly(){return u()},get indentation(){return d()},get tabSize(){return f()},get truncateTextSize(){return p()},get statusBar(){return g()},get askToFormat(){return _()},get mainMenuBar(){return m()},get navigationBar(){return h()},get escapeControlCharacters(){return v()},get escapeUnicodeCharacters(){return y()},get maxDocumentSizeTextMode(){return b()},get flattenColumns(){return x()},get parser(){return S()},get parseMemoizeOne(){return K(a)},get validator(){return C()},get validationParser(){return w()},get pathParser(){return T()},insideModal:!0,onError:me,onChange:de,onChangeMode:pe,onSelect:fe,get onRenderValue(){return E()},get onClassName(){return ee()},get onFocus(){return $1},get onBlur(){return $1},get onRenderMenu(){return te()},get onRenderContextMenu(){return D()},get onSortModal(){return ne()},get onTransformModal(){return re()},onJSONEditorModal:M,$$legacy:!0}),e=>V(ae,e),()=>K(ae));var ie=H(U(l,2)),O=e=>{var t=W0(),n=H(t);G(()=>PU(n,K(se))),Z(e,t)};Q(ie,e=>{K(se)&&e(O)});var ce=U(ie,2),le=e=>{var t=G0();GK(H(t),{get data(){return W_}}),Y(`click`,t,A),Z(e,t)};Q(ce,e=>{K(k),q(()=>K(k).length>1)&&e(le)});var j=U(ce,2),N=e=>{var t=K0();EH(()=>Y(`click`,t,ue)),uW(t,e=>he?.(e)),Z(e,t)},ge=e=>{var t=q0();Y(`click`,t,A),Z(e,t)};Q(j,e=>{u()?e(ge,-1):e(N)}),G(()=>AW(c,K(i))),Z(e,r)},$$slots:{default:!0}}),Z(e,r)},$$slots:{default:!0}}),yB()})(e,QW(()=>K(Me),{onClose:()=>{var e;(e=K(Me))==null||e.onClose(),V(Me,void 0)}}))};Q(u,e=>{K(Me)&&e(d)}),G(()=>r=_W(a,1,`jse-main svelte-1l55585`,null,r,{"jse-focus":K(Ae)})),Y(`keydown`,a,ut),Z(e,i)},$$slots:{default:!0}}),BW(t,`get`,Fe),BW(t,`set`,Ie),BW(t,`update`,Le),BW(t,`patch`,Re),BW(t,`select`,ze),BW(t,`expand`,Be),BW(t,`collapse`,Ve),BW(t,`transform`,He),BW(t,`validate`,Ue),BW(t,`acceptAutoRepair`,We),BW(t,`scrollTo`,Ge),BW(t,`findElement`,qe),BW(t,`focus`,Je),BW(t,`refresh`,Ye),BW(t,`updateProps`,Ze),BW(t,`destroy`,Qe),yB(dt)}function r2(e){var{target:t,props:n}=e,r=FU(n2,{target:t,props:n});return r.destroy=pz(function*(){return function(e,t){var n=LU.get(e);return n?(LU.delete(e),n(t)):Promise.resolve()}(r)}),uV(),r}var i2=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,a2=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,o2=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function s2(e,t){if(e===`__proto__`||e===`constructor`&&t&&typeof t==`object`&&`prototype`in t){c2(e);return}return t}function c2(e){console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`)}function l2(e,t={}){if(typeof e!=`string`)return e;let n=e.trim();if(e[0]===`"`&&e.endsWith(`"`)&&!e.includes(`\\`))return n.slice(1,-1);if(n.length<=9){let e=n.toLowerCase();if(e===`true`)return!0;if(e===`false`)return!1;if(e===`undefined`)return;if(e===`null`)return null;if(e===`nan`)return NaN;if(e===`infinity`)return 1/0;if(e===`-infinity`)return-1/0}if(!o2.test(e)){if(t.strict)throw SyntaxError(`[destr] Invalid JSON`);return e}try{if(i2.test(e)||a2.test(e)){if(t.strict)throw Error(`[destr] Possible prototype pollution`);return JSON.parse(e,s2)}return JSON.parse(e)}catch(n){if(t.strict)throw n;return e}}function u2(e,t={}){return l2(e,{...t,strict:!0})}var d2=typeof global==`object`&&global&&global.Object===Object&&global,f2=typeof self==`object`&&self&&self.Object===Object&&self,p2=d2||f2||Function(`return this`)(),m2=p2.Symbol,h2=Object.prototype,g2=h2.hasOwnProperty,_2=h2.toString,v2=m2?m2.toStringTag:void 0;function y2(e){var t=g2.call(e,v2),n=e[v2];try{e[v2]=void 0;var r=!0}catch{}var i=_2.call(e);return r&&(t?e[v2]=n:delete e[v2]),i}var b2=Object.prototype.toString;function x2(e){return b2.call(e)}var S2=`[object Null]`,C2=`[object Undefined]`,w2=m2?m2.toStringTag:void 0;function T2(e){return e==null?e===void 0?C2:S2:w2&&w2 in Object(e)?y2(e):x2(e)}function E2(e){return typeof e==`object`&&!!e}var D2=`[object Symbol]`;function O2(e){return typeof e==`symbol`||E2(e)&&T2(e)==D2}var k2=/\s/;function A2(e){for(var t=e.length;t--&&k2.test(e.charAt(t)););return t}var j2=/^\s+/;function M2(e){return e&&e.slice(0,A2(e)+1).replace(j2,``)}function N2(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}var P2=NaN,F2=/^[-+]0x[0-9a-f]+$/i,I2=/^0b[01]+$/i,L2=/^0o[0-7]+$/i,R2=parseInt;function z2(e){if(typeof e==`number`)return e;if(O2(e))return P2;if(N2(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=N2(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=M2(e);var n=I2.test(e);return n||L2.test(e)?R2(e.slice(2),n?2:8):F2.test(e)?P2:+e}var B2=function(){return p2.Date.now()},V2=`Expected a function`,H2=Math.max,U2=Math.min;function W2(e,t,n){var r,i,a,o,s,c,l=0,u=!1,d=!1,f=!0;if(typeof e!=`function`)throw TypeError(V2);t=z2(t)||0,N2(n)&&(u=!!n.leading,d=`maxWait`in n,a=d?H2(z2(n.maxWait)||0,t):a,f=`trailing`in n?!!n.trailing:f);function p(t){var n=r,a=i;return r=i=void 0,l=t,o=e.apply(a,n),o}function m(e){return l=e,s=setTimeout(_,t),u?p(e):o}function h(e){var n=e-c,r=e-l,i=t-n;return d?U2(i,a-r):i}function g(e){var n=e-c,r=e-l;return c===void 0||n>=t||n<0||d&&r>=a}function _(){var e=B2();if(g(e))return v(e);s=setTimeout(_,h(e))}function v(e){return s=void 0,f&&r?p(e):(r=i=void 0,o)}function y(){s!==void 0&&clearTimeout(s),l=0,r=c=i=s=void 0}function b(){return s===void 0?o:v(B2())}function x(){var e=B2(),n=g(e);if(r=arguments,i=this,c=e,n){if(s===void 0)return m(c);if(d)return clearTimeout(s),s=setTimeout(_,t),p(c)}return s===void 0&&(s=setTimeout(_,t)),o}return x.cancel=y,x.flush=b,x}var G2=typeof global==`object`&&global&&global.Object===Object&&global,K2=typeof self==`object`&&self&&self.Object===Object&&self,q2=G2||K2||Function(`return this`)(),J2=q2.Symbol,Y2=Object.prototype,X2=Y2.hasOwnProperty,Z2=Y2.toString,Q2=J2?J2.toStringTag:void 0;function $2(e){var t=X2.call(e,Q2),n=e[Q2];try{e[Q2]=void 0;var r=!0}catch{}var i=Z2.call(e);return r&&(t?e[Q2]=n:delete e[Q2]),i}var e4=Object.prototype.toString;function t4(e){return e4.call(e)}var n4=`[object Null]`,r4=`[object Undefined]`,i4=J2?J2.toStringTag:void 0;function a4(e){return e==null?e===void 0?r4:n4:i4&&i4 in Object(e)?$2(e):t4(e)}function o4(e){return typeof e==`object`&&!!e}var s4=`[object Symbol]`;function c4(e){return typeof e==`symbol`||o4(e)&&a4(e)==s4}function l4(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var u4=Array.isArray,d4=J2?J2.prototype:void 0,f4=d4?d4.toString:void 0;function p4(e){if(typeof e==`string`)return e;if(u4(e))return l4(e,p4)+``;if(c4(e))return f4?f4.call(e):``;var t=e+``;return t==`0`&&1/e==-1/0?`-0`:t}function m4(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}function h4(e){return e}var g4=`[object AsyncFunction]`,_4=`[object Function]`,v4=`[object GeneratorFunction]`,y4=`[object Proxy]`;function b4(e){if(!m4(e))return!1;var t=a4(e);return t==_4||t==v4||t==g4||t==y4}var x4=q2[`__core-js_shared__`],S4=function(){var e=/[^.]+$/.exec(x4&&x4.keys&&x4.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function C4(e){return!!S4&&S4 in e}var w4=Function.prototype.toString;function T4(e){if(e!=null){try{return w4.call(e)}catch{}try{return e+``}catch{}}return``}var E4=/[\\^$.*+?()[\]{}|]/g,D4=/^\[object .+?Constructor\]$/,O4=Function.prototype,k4=Object.prototype,A4=O4.toString,j4=k4.hasOwnProperty,M4=RegExp(`^`+A4.call(j4).replace(E4,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function N4(e){return!m4(e)||C4(e)?!1:(b4(e)?M4:D4).test(T4(e))}function P4(e,t){return e?.[t]}function F4(e,t){var n=P4(e,t);return N4(n)?n:void 0}var I4=F4(q2,`WeakMap`),L4=Object.create,R4=function(){function e(){}return function(t){if(!m4(t))return{};if(L4)return L4(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function z4(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function B4(e,t){var n=-1,r=e.length;for(t||=Array(r);++n<r;)t[n]=e[n];return t}var V4=800,H4=16,U4=Date.now;function W4(e){var t=0,n=0;return function(){var r=U4(),i=H4-(r-n);if(n=r,i>0){if(++t>=V4)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function G4(e){return function(){return e}}var K4=function(){try{var e=F4(Object,`defineProperty`);return e({},``,{}),e}catch{}}(),q4=W4(K4?function(e,t){return K4(e,`toString`,{configurable:!0,enumerable:!1,value:G4(t),writable:!0})}:h4);function J4(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var Y4=9007199254740991,X4=/^(?:0|[1-9]\d*)$/;function Z4(e,t){var n=typeof e;return t??=Y4,!!t&&(n==`number`||n!=`symbol`&&X4.test(e))&&e>-1&&e%1==0&&e<t}function Q4(e,t,n){t==`__proto__`&&K4?K4(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function $4(e,t){return e===t||e!==e&&t!==t}var e3=Object.prototype.hasOwnProperty;function t3(e,t,n){var r=e[t];(!(e3.call(e,t)&&$4(r,n))||n===void 0&&!(t in e))&&Q4(e,t,n)}function n3(e,t,n,r){var i=!n;n||={};for(var a=-1,o=t.length;++a<o;){var s=t[a],c=r?r(n[s],e[s],s,n,e):void 0;c===void 0&&(c=e[s]),i?Q4(n,s,c):t3(n,s,c)}return n}var r3=Math.max;function i3(e,t,n){return t=r3(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,a=r3(r.length-t,0),o=Array(a);++i<a;)o[i]=r[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=r[i];return s[t]=n(o),z4(e,this,s)}}function a3(e,t){return q4(i3(e,t,h4),e+``)}var o3=9007199254740991;function s3(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=o3}function c3(e){return e!=null&&s3(e.length)&&!b4(e)}function l3(e,t,n){if(!m4(n))return!1;var r=typeof t;return(r==`number`?c3(n)&&Z4(t,n.length):r==`string`&&t in n)?$4(n[t],e):!1}function u3(e){return a3(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(a=e.length>3&&typeof a==`function`?(i--,a):void 0,o&&l3(n[0],n[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,a)}return t})}var d3=Object.prototype;function f3(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||d3)}function p3(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var m3=`[object Arguments]`;function h3(e){return o4(e)&&a4(e)==m3}var g3=Object.prototype,_3=g3.hasOwnProperty,v3=g3.propertyIsEnumerable,y3=h3(function(){return arguments}())?h3:function(e){return o4(e)&&_3.call(e,`callee`)&&!v3.call(e,`callee`)};function b3(){return!1}var x3=typeof exports==`object`&&exports&&!exports.nodeType&&exports,S3=x3&&typeof module==`object`&&module&&!module.nodeType&&module,C3=S3&&S3.exports===x3?q2.Buffer:void 0,w3=(C3?C3.isBuffer:void 0)||b3,T3=`[object Arguments]`,E3=`[object Array]`,D3=`[object Boolean]`,O3=`[object Date]`,k3=`[object Error]`,A3=`[object Function]`,j3=`[object Map]`,M3=`[object Number]`,N3=`[object Object]`,P3=`[object RegExp]`,F3=`[object Set]`,I3=`[object String]`,L3=`[object WeakMap]`,R3=`[object ArrayBuffer]`,z3=`[object DataView]`,B3=`[object Float32Array]`,V3=`[object Float64Array]`,H3=`[object Int8Array]`,U3=`[object Int16Array]`,W3=`[object Int32Array]`,G3=`[object Uint8Array]`,K3=`[object Uint8ClampedArray]`,q3=`[object Uint16Array]`,J3=`[object Uint32Array]`,Y3={};Y3[B3]=Y3[V3]=Y3[H3]=Y3[U3]=Y3[W3]=Y3[G3]=Y3[K3]=Y3[q3]=Y3[J3]=!0,Y3[T3]=Y3[E3]=Y3[R3]=Y3[D3]=Y3[z3]=Y3[O3]=Y3[k3]=Y3[A3]=Y3[j3]=Y3[M3]=Y3[N3]=Y3[P3]=Y3[F3]=Y3[I3]=Y3[L3]=!1;function X3(e){return o4(e)&&s3(e.length)&&!!Y3[a4(e)]}function Z3(e){return function(t){return e(t)}}var Q3=typeof exports==`object`&&exports&&!exports.nodeType&&exports,$3=Q3&&typeof module==`object`&&module&&!module.nodeType&&module,e6=$3&&$3.exports===Q3&&G2.process,t6=function(){try{return $3&&$3.require&&$3.require(`util`).types||e6&&e6.binding&&e6.binding(`util`)}catch{}}(),n6=t6&&t6.isTypedArray,r6=n6?Z3(n6):X3,i6=Object.prototype.hasOwnProperty;function a6(e,t){var n=u4(e),r=!n&&y3(e),i=!n&&!r&&w3(e),a=!n&&!r&&!i&&r6(e),o=n||r||i||a,s=o?p3(e.length,String):[],c=s.length;for(var l in e)(t||i6.call(e,l))&&!(o&&(l==`length`||i&&(l==`offset`||l==`parent`)||a&&(l==`buffer`||l==`byteLength`||l==`byteOffset`)||Z4(l,c)))&&s.push(l);return s}function o6(e,t){return function(n){return e(t(n))}}var s6=o6(Object.keys,Object),c6=Object.prototype.hasOwnProperty;function l6(e){if(!f3(e))return s6(e);var t=[];for(var n in Object(e))c6.call(e,n)&&n!=`constructor`&&t.push(n);return t}function u6(e){return c3(e)?a6(e):l6(e)}function d6(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var f6=Object.prototype.hasOwnProperty;function p6(e){if(!m4(e))return d6(e);var t=f3(e),n=[];for(var r in e)r==`constructor`&&(t||!f6.call(e,r))||n.push(r);return n}function m6(e){return c3(e)?a6(e,!0):p6(e)}var h6=u3(function(e,t,n,r){n3(t,m6(t),e,r)}),g6=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,_6=/^\w*$/;function v6(e,t){if(u4(e))return!1;var n=typeof e;return n==`number`||n==`symbol`||n==`boolean`||e==null||c4(e)?!0:_6.test(e)||!g6.test(e)||t!=null&&e in Object(t)}var y6=F4(Object,`create`);function b6(){this.__data__=y6?y6(null):{},this.size=0}function x6(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}var S6=`__lodash_hash_undefined__`,C6=Object.prototype.hasOwnProperty;function w6(e){var t=this.__data__;if(y6){var n=t[e];return n===S6?void 0:n}return C6.call(t,e)?t[e]:void 0}var T6=Object.prototype.hasOwnProperty;function E6(e){var t=this.__data__;return y6?t[e]!==void 0:T6.call(t,e)}var D6=`__lodash_hash_undefined__`;function O6(e,t){var n=this.__data__;return this.size+=+!this.has(e),n[e]=y6&&t===void 0?D6:t,this}function k6(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}k6.prototype.clear=b6,k6.prototype.delete=x6,k6.prototype.get=w6,k6.prototype.has=E6,k6.prototype.set=O6;function A6(){this.__data__=[],this.size=0}function j6(e,t){for(var n=e.length;n--;)if($4(e[n][0],t))return n;return-1}var M6=Array.prototype.splice;function N6(e){var t=this.__data__,n=j6(t,e);return n<0?!1:(n==t.length-1?t.pop():M6.call(t,n,1),--this.size,!0)}function P6(e){var t=this.__data__,n=j6(t,e);return n<0?void 0:t[n][1]}function F6(e){return j6(this.__data__,e)>-1}function I6(e,t){var n=this.__data__,r=j6(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function L6(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}L6.prototype.clear=A6,L6.prototype.delete=N6,L6.prototype.get=P6,L6.prototype.has=F6,L6.prototype.set=I6;var R6=F4(q2,`Map`);function z6(){this.size=0,this.__data__={hash:new k6,map:new(R6||L6),string:new k6}}function B6(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}function V6(e,t){var n=e.__data__;return B6(t)?n[typeof t==`string`?`string`:`hash`]:n.map}function H6(e){var t=V6(this,e).delete(e);return this.size-=+!!t,t}function U6(e){return V6(this,e).get(e)}function W6(e){return V6(this,e).has(e)}function G6(e,t){var n=V6(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function K6(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}K6.prototype.clear=z6,K6.prototype.delete=H6,K6.prototype.get=U6,K6.prototype.has=W6,K6.prototype.set=G6;var q6=`Expected a function`;function J6(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(q6);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(J6.Cache||K6),n}J6.Cache=K6;var Y6=500;function X6(e){var t=J6(e,function(e){return n.size===Y6&&n.clear(),e}),n=t.cache;return t}var Z6=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Q6=/\\(\\)?/g,$6=X6(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(Z6,function(e,n,r,i){t.push(r?i.replace(Q6,`$1`):n||e)}),t});function e8(e){return e==null?``:p4(e)}function t8(e,t){return u4(e)?e:v6(e,t)?[e]:$6(e8(e))}function n8(e){if(typeof e==`string`||c4(e))return e;var t=e+``;return t==`0`&&1/e==-1/0?`-0`:t}function r8(e,t){t=t8(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[n8(t[n++])];return n&&n==r?e:void 0}function i8(e,t,n){var r=e==null?void 0:r8(e,t);return r===void 0?n:r}function a8(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var o8=o6(Object.getPrototypeOf,Object),s8=`[object Object]`,c8=Function.prototype,l8=Object.prototype,u8=c8.toString,d8=l8.hasOwnProperty,f8=u8.call(Object);function p8(e){if(!o4(e)||a4(e)!=s8)return!1;var t=o8(e);if(t===null)return!0;var n=d8.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&u8.call(n)==f8}function m8(){this.__data__=new L6,this.size=0}function h8(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function g8(e){return this.__data__.get(e)}function _8(e){return this.__data__.has(e)}var v8=200;function y8(e,t){var n=this.__data__;if(n instanceof L6){var r=n.__data__;if(!R6||r.length<v8-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new K6(r)}return n.set(e,t),this.size=n.size,this}function b8(e){var t=this.__data__=new L6(e);this.size=t.size}b8.prototype.clear=m8,b8.prototype.delete=h8,b8.prototype.get=g8,b8.prototype.has=_8,b8.prototype.set=y8;var x8=typeof exports==`object`&&exports&&!exports.nodeType&&exports,S8=x8&&typeof module==`object`&&module&&!module.nodeType&&module,C8=S8&&S8.exports===x8?q2.Buffer:void 0,w8=C8?C8.allocUnsafe:void 0;function T8(e,t){if(t)return e.slice();var n=e.length,r=w8?w8(n):new e.constructor(n);return e.copy(r),r}function E8(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}function D8(){return[]}var O8=Object.prototype.propertyIsEnumerable,k8=Object.getOwnPropertySymbols,A8=k8?function(e){return e==null?[]:(e=Object(e),E8(k8(e),function(t){return O8.call(e,t)}))}:D8;function j8(e,t,n){var r=t(e);return u4(e)?r:a8(r,n(e))}function M8(e){return j8(e,u6,A8)}var N8=F4(q2,`DataView`),P8=F4(q2,`Promise`),F8=F4(q2,`Set`),I8=`[object Map]`,L8=`[object Object]`,R8=`[object Promise]`,z8=`[object Set]`,B8=`[object WeakMap]`,V8=`[object DataView]`,H8=T4(N8),U8=T4(R6),W8=T4(P8),G8=T4(F8),K8=T4(I4),q8=a4;(N8&&q8(new N8(new ArrayBuffer(1)))!=V8||R6&&q8(new R6)!=I8||P8&&q8(P8.resolve())!=R8||F8&&q8(new F8)!=z8||I4&&q8(new I4)!=B8)&&(q8=function(e){var t=a4(e),n=t==L8?e.constructor:void 0,r=n?T4(n):``;if(r)switch(r){case H8:return V8;case U8:return I8;case W8:return R8;case G8:return z8;case K8:return B8}return t});var J8=Object.prototype.hasOwnProperty;function Y8(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]==`string`&&J8.call(e,`index`)&&(n.index=e.index,n.input=e.input),n}var X8=q2.Uint8Array;function Z8(e){var t=new e.constructor(e.byteLength);return new X8(t).set(new X8(e)),t}function Q8(e,t){var n=Z8(e.buffer);return new e.constructor(n,e.byteOffset,e.byteLength)}var $8=/\w*$/;function e5(e){var t=new e.constructor(e.source,$8.exec(e));return t.lastIndex=e.lastIndex,t}var t5=J2?J2.prototype:void 0,n5=t5?t5.valueOf:void 0;function r5(e){return n5?Object(n5.call(e)):{}}function i5(e,t){var n=t?Z8(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var a5=`[object Boolean]`,o5=`[object Date]`,s5=`[object Map]`,c5=`[object Number]`,l5=`[object RegExp]`,u5=`[object Set]`,d5=`[object String]`,f5=`[object Symbol]`,p5=`[object ArrayBuffer]`,m5=`[object DataView]`,h5=`[object Float32Array]`,g5=`[object Float64Array]`,_5=`[object Int8Array]`,v5=`[object Int16Array]`,y5=`[object Int32Array]`,b5=`[object Uint8Array]`,x5=`[object Uint8ClampedArray]`,S5=`[object Uint16Array]`,C5=`[object Uint32Array]`;function w5(e,t,n){var r=e.constructor;switch(t){case p5:return Z8(e);case a5:case o5:return new r(+e);case m5:return Q8(e);case h5:case g5:case _5:case v5:case y5:case b5:case x5:case S5:case C5:return i5(e,n);case s5:return new r;case c5:case d5:return new r(e);case l5:return e5(e);case u5:return new r;case f5:return r5(e)}}function T5(e){return typeof e.constructor==`function`&&!f3(e)?R4(o8(e)):{}}var E5=`[object Map]`;function D5(e){return o4(e)&&q8(e)==E5}var O5=t6&&t6.isMap,k5=O5?Z3(O5):D5,A5=`[object Set]`;function j5(e){return o4(e)&&q8(e)==A5}var M5=t6&&t6.isSet,N5=M5?Z3(M5):j5,P5=1,F5=`[object Arguments]`,I5=`[object Array]`,L5=`[object Boolean]`,R5=`[object Date]`,z5=`[object Error]`,B5=`[object Function]`,V5=`[object GeneratorFunction]`,H5=`[object Map]`,U5=`[object Number]`,W5=`[object Object]`,G5=`[object RegExp]`,K5=`[object Set]`,q5=`[object String]`,J5=`[object Symbol]`,Y5=`[object WeakMap]`,X5=`[object ArrayBuffer]`,Z5=`[object DataView]`,Q5=`[object Float32Array]`,$5=`[object Float64Array]`,e7=`[object Int8Array]`,t7=`[object Int16Array]`,n7=`[object Int32Array]`,r7=`[object Uint8Array]`,i7=`[object Uint8ClampedArray]`,a7=`[object Uint16Array]`,o7=`[object Uint32Array]`,s7={};s7[F5]=s7[I5]=s7[X5]=s7[Z5]=s7[L5]=s7[R5]=s7[Q5]=s7[$5]=s7[e7]=s7[t7]=s7[n7]=s7[H5]=s7[U5]=s7[W5]=s7[G5]=s7[K5]=s7[q5]=s7[J5]=s7[r7]=s7[i7]=s7[a7]=s7[o7]=!0,s7[z5]=s7[B5]=s7[Y5]=!1;function c7(e,t,n,r,i,a){var o,s=t&P5;if(o!==void 0)return o;if(!m4(e))return e;var c=u4(e);if(c)o=Y8(e);else{var l=q8(e),u=l==B5||l==V5;if(w3(e))return T8(e,s);if(l==W5||l==F5||u&&!i)o=u?{}:T5(e);else{if(!s7[l])return i?e:{};o=w5(e,l,s)}}a||=new b8;var d=a.get(e);if(d)return d;a.set(e,o),N5(e)?e.forEach(function(r){o.add(c7(r,t,n,r,e,a))}):k5(e)&&e.forEach(function(r,i){o.set(i,c7(r,t,n,i,e,a))});var f=c?void 0:M8(e);return J4(f||e,function(r,i){f&&(i=r,r=e[i]),t3(o,i,c7(r,t,n,i,e,a))}),o}var l7=1,u7=4;function d7(e){return c7(e,l7|u7)}var f7=`__lodash_hash_undefined__`;function p7(e){return this.__data__.set(e,f7),this}function m7(e){return this.__data__.has(e)}function h7(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new K6;++t<n;)this.add(e[t])}h7.prototype.add=h7.prototype.push=p7,h7.prototype.has=m7;function g7(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function _7(e,t){return e.has(t)}var v7=1,y7=2;function b7(e,t,n,r,i,a){var o=n&v7,s=e.length,c=t.length;if(s!=c&&!(o&&c>s))return!1;var l=a.get(e),u=a.get(t);if(l&&u)return l==t&&u==e;var d=-1,f=!0,p=n&y7?new h7:void 0;for(a.set(e,t),a.set(t,e);++d<s;){var m=e[d],h=t[d];if(r)var g=o?r(h,m,d,t,e,a):r(m,h,d,e,t,a);if(g!==void 0){if(g)continue;f=!1;break}if(p){if(!g7(t,function(e,t){if(!_7(p,t)&&(m===e||i(m,e,n,r,a)))return p.push(t)})){f=!1;break}}else if(!(m===h||i(m,h,n,r,a))){f=!1;break}}return a.delete(e),a.delete(t),f}function x7(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function S7(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var C7=1,w7=2,T7=`[object Boolean]`,E7=`[object Date]`,D7=`[object Error]`,O7=`[object Map]`,k7=`[object Number]`,A7=`[object RegExp]`,j7=`[object Set]`,M7=`[object String]`,N7=`[object Symbol]`,P7=`[object ArrayBuffer]`,F7=`[object DataView]`,I7=J2?J2.prototype:void 0,L7=I7?I7.valueOf:void 0;function R7(e,t,n,r,i,a,o){switch(n){case F7:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case P7:return!(e.byteLength!=t.byteLength||!a(new X8(e),new X8(t)));case T7:case E7:case k7:return $4(+e,+t);case D7:return e.name==t.name&&e.message==t.message;case A7:case M7:return e==t+``;case O7:var s=x7;case j7:var c=r&C7;if(s||=S7,e.size!=t.size&&!c)return!1;var l=o.get(e);if(l)return l==t;r|=w7,o.set(e,t);var u=b7(s(e),s(t),r,i,a,o);return o.delete(e),u;case N7:if(L7)return L7.call(e)==L7.call(t)}return!1}var z7=1,B7=Object.prototype.hasOwnProperty;function V7(e,t,n,r,i,a){var o=n&z7,s=M8(e),c=s.length;if(c!=M8(t).length&&!o)return!1;for(var l=c;l--;){var u=s[l];if(!(o?u in t:B7.call(t,u)))return!1}var d=a.get(e),f=a.get(t);if(d&&f)return d==t&&f==e;var p=!0;a.set(e,t),a.set(t,e);for(var m=o;++l<c;){u=s[l];var h=e[u],g=t[u];if(r)var _=o?r(g,h,u,t,e,a):r(h,g,u,e,t,a);if(!(_===void 0?h===g||i(h,g,n,r,a):_)){p=!1;break}m||=u==`constructor`}if(p&&!m){var v=e.constructor,y=t.constructor;v!=y&&`constructor`in e&&`constructor`in t&&!(typeof v==`function`&&v instanceof v&&typeof y==`function`&&y instanceof y)&&(p=!1)}return a.delete(e),a.delete(t),p}var H7=1,U7=`[object Arguments]`,W7=`[object Array]`,G7=`[object Object]`,K7=Object.prototype.hasOwnProperty;function q7(e,t,n,r,i,a){var o=u4(e),s=u4(t),c=o?W7:q8(e),l=s?W7:q8(t);c=c==U7?G7:c,l=l==U7?G7:l;var u=c==G7,d=l==G7,f=c==l;if(f&&w3(e)){if(!w3(t))return!1;o=!0,u=!1}if(f&&!u)return a||=new b8,o||r6(e)?b7(e,t,n,r,i,a):R7(e,t,c,n,r,i,a);if(!(n&H7)){var p=u&&K7.call(e,`__wrapped__`),m=d&&K7.call(t,`__wrapped__`);if(p||m){var h=p?e.value():e,g=m?t.value():t;return a||=new b8,i(h,g,n,r,a)}}return f?(a||=new b8,V7(e,t,n,r,i,a)):!1}function J7(e,t,n,r,i){return e===t?!0:e==null||t==null||!o4(e)&&!o4(t)?e!==e&&t!==t:q7(e,t,n,r,J7,i)}var Y7=1,X7=2;function Z7(e,t,n,r){var i=n.length,a=i;if(e==null)return!a;for(e=Object(e);i--;){var o=n[i];if(o[2]?o[1]!==e[o[0]]:!(o[0]in e))return!1}for(;++i<a;){o=n[i];var s=o[0],c=e[s],l=o[1];if(o[2]){if(c===void 0&&!(s in e))return!1}else{var u=new b8,d;if(!(d===void 0?J7(l,c,Y7|X7,r,u):d))return!1}}return!0}function Q7(e){return e===e&&!m4(e)}function $7(e){for(var t=u6(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Q7(i)]}return t}function e9(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function t9(e){var t=$7(e);return t.length==1&&t[0][2]?e9(t[0][0],t[0][1]):function(n){return n===e||Z7(n,e,t)}}function n9(e,t){return e!=null&&t in Object(e)}function r9(e,t,n){t=t8(t,e);for(var r=-1,i=t.length,a=!1;++r<i;){var o=n8(t[r]);if(!(a=e!=null&&n(e,o)))break;e=e[o]}return a||++r!=i?a:(i=e==null?0:e.length,!!i&&s3(i)&&Z4(o,i)&&(u4(e)||y3(e)))}function i9(e,t){return e!=null&&r9(e,t,n9)}var a9=1,o9=2;function s9(e,t){return v6(e)&&Q7(t)?e9(n8(e),t):function(n){var r=i8(n,e);return r===void 0&&r===t?i9(n,e):J7(t,r,a9|o9)}}function c9(e){return function(t){return t?.[e]}}function l9(e){return function(t){return r8(t,e)}}function u9(e){return v6(e)?c9(n8(e)):l9(e)}function d9(e){return typeof e==`function`?e:e==null?h4:typeof e==`object`?u4(e)?s9(e[0],e[1]):t9(e):u9(e)}function f9(e){return function(e,t,n){for(var r=-1,i=Object(e),a=n(e),o=a.length;o--;){var s=a[++r];if(t(i[s],s,i)===!1)break}return e}}var p9=f9();function m9(e,t){return e&&p9(e,t,u6)}function h9(e,t,n){(n!==void 0&&!$4(e[t],n)||n===void 0&&!(t in e))&&Q4(e,t,n)}function g9(e){return o4(e)&&c3(e)}function _9(e,t){if(!(t===`constructor`&&typeof e[t]==`function`)&&t!=`__proto__`)return e[t]}function v9(e){return n3(e,m6(e))}function y9(e,t,n,r,i,a,o){var s=_9(e,n),c=_9(t,n),l=o.get(c);if(l){h9(e,n,l);return}var u=a?a(s,c,n+``,e,t,o):void 0,d=u===void 0;if(d){var f=u4(c),p=!f&&w3(c),m=!f&&!p&&r6(c);u=c,f||p||m?u4(s)?u=s:g9(s)?u=B4(s):p?(d=!1,u=T8(c,!0)):m?(d=!1,u=i5(c,!0)):u=[]:p8(c)||y3(c)?(u=s,y3(s)?u=v9(s):(!m4(s)||b4(s))&&(u=T5(c))):d=!1}d&&(o.set(c,u),i(u,c,r,a,o),o.delete(c)),h9(e,n,u)}function b9(e,t,n,r,i){e!==t&&p9(t,function(a,o){if(i||=new b8,m4(a))y9(e,t,o,n,b9,r,i);else{var s=r?r(_9(e,o),a,o+``,e,t,i):void 0;s===void 0&&(s=a),h9(e,o,s)}},m6)}var x9=u3(function(e,t,n,r){b9(e,t,n,r)});function S9(e,t){var n={};return t=d9(t),m9(e,function(e,r,i){Q4(n,t(e,r,i),e)}),n}var C9=RegExp(`([\\p{Ll}\\d])(\\p{Lu})`,`gu`),w9=RegExp(`(\\p{Lu})([\\p{Lu}][\\p{Ll}])`,`gu`),T9=RegExp(`(\\d)\\p{Ll}|(\\p{L})\\d`,`u`),E9=/[^\p{L}\d]+/giu,D9=`$1\0$2`,O9=``;function k9(e){let t=e.trim();t=t.replace(C9,D9).replace(w9,D9),t=t.replace(E9,`\0`);let n=0,r=t.length;for(;t.charAt(n)===`\0`;)n++;if(n===r)return[];for(;t.charAt(r-1)===`\0`;)r--;return t.slice(n,r).split(/\0/g)}function A9(e){let t=k9(e);for(let e=0;e<t.length;e++){let n=t[e],r=T9.exec(n);if(r){let i=r.index+(r[1]??r[2]).length;t.splice(e,1,n.slice(0,i),n.slice(i))}}return t}function j9(e,t){let[n,r,i]=F9(e,t),a=M9(void 0),o=P9(a,N9(void 0));return n+r.map((e,t)=>t===0?a(e):o(e,t)).join(``)+i}function M9(e){return t=>t.toLocaleLowerCase(e)}function N9(e){return t=>t.toLocaleUpperCase(e)}function P9(e,t){return(n,r)=>{let i=n[0];return(r>0&&i>=`0`&&i<=`9`?`_`+i:t(i))+e(n.slice(1))}}function F9(e,t={}){let n=t.split??(t.separateNumbers?A9:k9),r=t.prefixCharacters??O9,i=t.suffixCharacters??O9,a=0,o=e.length;for(;a<e.length;){let t=e.charAt(a);if(!r.includes(t))break;a++}for(;o>a;){let t=o-1,n=e.charAt(t);if(!i.includes(n))break;o=t}return[e.slice(0,a),n(e.slice(a,o)),e.slice(o)]}var I9=e=>/.+-.+/.test(e)?j9(e):e,L9=e=>Object.prototype.toString.call(e).slice(8,-1)===`Object`;function R9(e,t){let n=Object.create(null),r=e.split(`,`);for(let e=0;e<r.length;e++)n[r[e]]=!0;return e=>!!n[e]}var z9=R9(`String,Number,Boolean,Function,Symbol,BigInt`);function B9(e){let t=e?.toString().match(/^\s*function (\w+)/);return t?t[1]:e===null?`null`:``}function V9(e,t){let n,r=B9(t);if(z9(r)){let i=typeof e;n=i===r.toLowerCase(),!n&&i===`object`&&(n=e instanceof t)}else n=r===`Object`?m4(e):r===`Array`?Array.isArray(e):r===`null`?e===null:e instanceof t;return{valid:n,expectedType:r}}function H9({prop:e,type:t,validator:n}){if(![void 0,null].includes(e)&&t){let n=!1,r=Array.isArray(t)?t:[t],i=[];for(let t=0;t<r.length&&!n;t++){let{valid:a,expectedType:o}=V9(e,r[t]);i.push(o||``),n=a}if(!n)throw TypeError(`Invalid prop: type check failed, expecting [${i.join(`, `)}], receiving: ${e}`)}if(n&&!n(e))throw Error(`Invalid prop: validator check failed, receiving: ${e}`)}function U9(e,{mergeObject:t,mergeObjectCustomizer:n,mergeFunction:r}){let i=[];for(let t=e.length-1;t>=0;t--)i.push(e[t]);let a=n||(r?(e,t)=>typeof e==`function`&&typeof t==`function`?r?.(t,e):void 0:void 0);return t===`deep`?x9(...i,a):h6(...i,a)}function W9(e,{mergeFunction:t}){return e.reduce(t,()=>{})}function G9(e,t={}){let{type:n,default:r,defaultIsDynamic:i=!1,required:a=!1,validator:o,camelizeObjectKeys:s=!1,mergeObjectApplyOnlyToDefault:c=!1,mergeFunctionApplyOnlyToDefault:l=!0}=t,{mergeObject:u=`deep`,mergeObjectCustomizer:d,mergeFunction:f=!1}=t,p=[],m,h=!1,g=!1,_=e=>{if(e!==void 0){H9({type:n,prop:e,validator:o});let t=L9(e),r=typeof e==`function`;return h=t,g=r,t?(e=d7(e),s?S9(e,(e,t)=>I9(t)):e):e}};for(let t of e)p.push(_(t));if(!i)p.push(_(r));else if(typeof r!=`function`)throw TypeError(`Invalid option: options.default should be Function when options.defaultIsDynamic enabled, receiving: ${r}`);h||(u=!1,g||(f=!1));for(let e=0;e<p.length;e++){let t=p[e];if(t!==void 0){m=e===p.length-1?t:u?U9(c?[t,r]:p,{mergeObject:u,mergeObjectCustomizer:d,mergeFunction:f}):f?W9(l?[t,r]:p,{mergeFunction:f}):t;break}}if(a&&[void 0,null].includes(m))throw Error(`Missing required prop`);return i?G9(e,{...t,default:r(m),defaultIsDynamic:!1}):m}function K9(e){let t=Array.from(I9(e));return t[0]=t[0].toUpperCase(),t.unshift(`o`,`n`),t.join(``)}function uee(e,{props:t=[],camelizePropNames:n=!1}={}){let r={props:{},attrs:{},listeners:{},hooks:{},slots:{}},i;if(Array.isArray(t))i=n?t.map(e=>I9(e)):t;else if(n){i=[];for(let e in t)i.push(I9(e))}else i=Object.keys(t);for(let t in e)if(t.startsWith(`@`)){let n=t.substring(1);if(n.startsWith(`vue:`))r.hooks[K9(n.replace(`vue:`,`vnode-`))]=e[t];else{if(n.startsWith(`vnode`))throw Error(`@vnode-* hooks are no longer supported. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support has been removed in Vue 3.4.`);r.listeners[K9(n)]=e[t]}}else if(t.startsWith(`#`)){let n=t.substring(1);n&&(r.slots[n]=e[t])}else{let a=n?I9(t):t;i.includes(a)?r.props[a]=e[t]:r.attrs[t]=e[t]}return r}var q9=`JsonEditorVue`,J9=[`mainMenuBar`,`navigationBar`,`statusBar`,`askToFormat`,`readOnly`,`escapeControlCharacters`,`escapeUnicodeCharacters`,`flattenColumns`],Y9={},X9={},Z9=`modelValue`,Q9=`update:modelValue`,$9={[Z9]:{},mode:{type:String},debounce:{type:Number},stringified:{type:Boolean,default:void 0},...Object.fromEntries(J9.map(e=>[e,{type:Boolean,default:void 0}]))},dee=Ur({name:q9,install(e,t){let n=uee(t||{},{props:$9});Object.assign(Y9,n.props),Object.assign(X9,n.attrs),e.component(q9,this)},props:$9,emits:{[Q9](e){return!0},"update:mode":function(e){return!0}},setup(e,{attrs:t,emit:n,expose:r}){let i=rs()?.proxy,a=rn(),o=rn(!1),s=rn();cr(()=>{var t;s.value=G9([e.mode,Y9.mode],{type:String}),(t=a.value)==null||t.updateProps({mode:s.value||qG.tree})});let c=e=>{n(`update:mode`,e)};Y9.mode!==void 0&&e.mode===void 0&&c(Y9.mode);let l=xs(()=>G9([e.debounce,Y9.debounce,300],{type:Number})),u=xs(()=>G9([e.stringified,Y9.stringified,!0],{type:Boolean})),d=l2,f=e=>{o.value=!0,!u.value&&e.text&&(a.value&&!a.value.validate()&&(e.json=d(e.text)),e.text=void 0),n(Q9,e.text===void 0?e.json:e.text)},p=W2(f,l.value),m=e=>{s.value===`text`?p(e):f(e)},h=(e,t)=>(...n)=>{e(...n),t(...n)};return r?.({jsonEditor:a}),Ai(()=>{var e;(e=a.value)==null||e.destroy()}),Ei(()=>{let n=G9([e[Z9],Y9[Z9]]),l=G9([Object.fromEntries(Array.from(J9,t=>[t,G9([e[t],Y9[t]])]).filter(([,e])=>e!==void 0)),t,X9],{camelizeObjectKeys:!0,defaultIsDynamic:!0,default:e=>(d=e.parser?.parse||l2,{onChange:m,onChangeMode:c,mode:s.value,parser:{parse:u2,stringify:JSON.stringify},...n!==void 0&&{content:{[typeof n==`string`&&s.value===`text`&&u.value?`text`:`json`]:n}}}),mergeFunction:h,mergeObject:`shallow`,type:Object});a.value=r2({target:i?.$refs.jsonEditorRef,props:l}),ur(()=>e[Z9],e=>{if(o.value){o.value=!1;return}a.value&&a.value.set([void 0,``].includes(e)?{text:``}:{[typeof e==`string`&&s.value===`text`&&u.value?`text`:`json`]:e})},{deep:!0}),ur(()=>Array.from(J9,t=>e[t]),e=>{var t;(t=a.value)==null||t.updateProps(Object.fromEntries(Array.from(e,(e,t)=>[J9[t],e]).filter(([,e])=>e!==void 0)))}),ur(()=>t,e=>{var t;let n={};(e.onChange||e[`on-change`])&&(n.onChange=m),(e.onChangeMode||e[`on-change-mode`])&&(n.onChangeMode=c),d=e.parser?.parse||l2,(t=a.value)==null||t.updateProps(Object.getOwnPropertyNames(n).length>0?G9([e,n],{camelizeObjectKeys:!0,mergeFunction:h,mergeObject:`shallow`,type:Object}):e)},{deep:!0}),r||(r=e=>{for(let t in e)i[t]=ln(e[t])},r({jsonEditor:a}))}),()=>Ss(`div`,{ref:`jsonEditorRef`})}});export{zi as $,F as $t,Ss as A,un as At,Pi as B,x as Bt,Go as C,rn as Ct,rs as D,Qt as Dt,Ur as E,an as Et,zn as F,f as Ft,Qn as G,v as Gt,Ai as H,w as Ht,_i as I,k as It,Un as J,C as Jt,rr as K,ve as Kt,Ti as L,ye as Lt,ir as M,ln as Mt,na as N,oe as Nt,Hr as O,vn as Ot,Zo as P,se as Pt,Bi as Q,P as Qt,ki as R,ue as Rt,Ko as S,Gt as St,fi as T,Kt as Tt,Oi as U,u as Ut,Ei as V,d as Vt,ko as W,D as Wt,Gi as X,Se as Xt,Ui as Y,xe as Yt,Li as Z,de as Zt,qo as _,Yt as _t,Ds as a,Qi as at,$a as b,je as bt,Co as c,ur as ct,Tr as d,er as dt,me as en,Rr as et,kn as f,tr as ft,Fo as g,Ae as gt,Bo as h,ke as ht,Os as i,Ca as it,ar as j,cn as jt,Uo as k,hn as kt,hi as l,cr as lt,xs as m,mn as mt,Ig as n,fe as nn,qi as nt,Ir as o,Gr as ot,Wo as p,$n as pt,Zn as q,S as qt,rp as r,$i as rt,Mr as s,Ar as st,dee as t,we as tn,Vr as tt,po as u,ra as ut,Po as v,nn as vt,Vo as w,Wt as wt,Wi as x,Ut as xt,eo as y,$t as yt,vi as z,g as zt};
|