@oferitz/graphiq 0.1.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/LICENSE +21 -0
- package/README.md +210 -0
- package/dist/components/GraphiQ.d.ts +3 -0
- package/dist/components/GraphiQ.d.ts.map +1 -0
- package/dist/components/GraphiQProvider.d.ts +3 -0
- package/dist/components/GraphiQProvider.d.ts.map +1 -0
- package/dist/components/editor/HeadersEditor.d.ts +6 -0
- package/dist/components/editor/HeadersEditor.d.ts.map +1 -0
- package/dist/components/editor/QueryEditor.d.ts +6 -0
- package/dist/components/editor/QueryEditor.d.ts.map +1 -0
- package/dist/components/editor/ResponseViewer.d.ts +6 -0
- package/dist/components/editor/ResponseViewer.d.ts.map +1 -0
- package/dist/components/editor/VariablesEditor.d.ts +6 -0
- package/dist/components/editor/VariablesEditor.d.ts.map +1 -0
- package/dist/components/editor/use-codemirror.d.ts +15 -0
- package/dist/components/editor/use-codemirror.d.ts.map +1 -0
- package/dist/components/explorer/QueryExplorer.d.ts +6 -0
- package/dist/components/explorer/QueryExplorer.d.ts.map +1 -0
- package/dist/components/history/QueryHistory.d.ts +6 -0
- package/dist/components/history/QueryHistory.d.ts.map +1 -0
- package/dist/components/schema/SchemaExplorer.d.ts +6 -0
- package/dist/components/schema/SchemaExplorer.d.ts.map +1 -0
- package/dist/components/sidebar/Sidebar.d.ts +10 -0
- package/dist/components/sidebar/Sidebar.d.ts.map +1 -0
- package/dist/components/tabs/Tab.d.ts +10 -0
- package/dist/components/tabs/Tab.d.ts.map +1 -0
- package/dist/components/tabs/TabBar.d.ts +6 -0
- package/dist/components/tabs/TabBar.d.ts.map +1 -0
- package/dist/components/toolbar/ExecuteButton.d.ts +9 -0
- package/dist/components/toolbar/ExecuteButton.d.ts.map +1 -0
- package/dist/components/toolbar/PrettifyButton.d.ts +7 -0
- package/dist/components/toolbar/PrettifyButton.d.ts.map +1 -0
- package/dist/components/toolbar/Toolbar.d.ts +7 -0
- package/dist/components/toolbar/Toolbar.d.ts.map +1 -0
- package/dist/components/ui/Resizable.d.ts +13 -0
- package/dist/components/ui/Resizable.d.ts.map +1 -0
- package/dist/graphiq.cjs +28 -0
- package/dist/graphiq.cjs.map +1 -0
- package/dist/graphiq.js +20903 -0
- package/dist/graphiq.js.map +1 -0
- package/dist/hooks/use-graphiq.d.ts +18 -0
- package/dist/hooks/use-graphiq.d.ts.map +1 -0
- package/dist/hooks/use-query.d.ts +8 -0
- package/dist/hooks/use-query.d.ts.map +1 -0
- package/dist/hooks/use-schema.d.ts +6 -0
- package/dist/hooks/use-schema.d.ts.map +1 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/lib/cn.d.ts +3 -0
- package/dist/lib/cn.d.ts.map +1 -0
- package/dist/lib/fetcher.d.ts +3 -0
- package/dist/lib/fetcher.d.ts.map +1 -0
- package/dist/lib/formatter.d.ts +2 -0
- package/dist/lib/formatter.d.ts.map +1 -0
- package/dist/lib/introspection.d.ts +4 -0
- package/dist/lib/introspection.d.ts.map +1 -0
- package/dist/lib/storage.d.ts +3 -0
- package/dist/lib/storage.d.ts.map +1 -0
- package/dist/stores/create-store.d.ts +19 -0
- package/dist/stores/create-store.d.ts.map +1 -0
- package/dist/stores/editor-store.d.ts +11 -0
- package/dist/stores/editor-store.d.ts.map +1 -0
- package/dist/stores/execution-store.d.ts +12 -0
- package/dist/stores/execution-store.d.ts.map +1 -0
- package/dist/stores/history-store.d.ts +10 -0
- package/dist/stores/history-store.d.ts.map +1 -0
- package/dist/stores/schema-store.d.ts +11 -0
- package/dist/stores/schema-store.d.ts.map +1 -0
- package/dist/stores/tabs-store.d.ts +11 -0
- package/dist/stores/tabs-store.d.ts.map +1 -0
- package/dist/stores/ui-store.d.ts +8 -0
- package/dist/stores/ui-store.d.ts.map +1 -0
- package/dist/style.css +3 -0
- package/dist/styles/codemirror-theme.d.ts +8 -0
- package/dist/styles/codemirror-theme.d.ts.map +1 -0
- package/dist/styles/variants.d.ts +81 -0
- package/dist/styles/variants.d.ts.map +1 -0
- package/dist/types/fetcher.d.ts +22 -0
- package/dist/types/fetcher.d.ts.map +1 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/plugin.d.ts +15 -0
- package/dist/types/plugin.d.ts.map +1 -0
- package/dist/types/props.d.ts +50 -0
- package/dist/types/props.d.ts.map +1 -0
- package/dist/types/store.d.ts +23 -0
- package/dist/types/store.d.ts.map +1 -0
- package/package.json +100 -0
- package/src/styles/animations.css +35 -0
- package/src/styles/base.css +193 -0
- package/src/styles/codemirror-theme.ts +46 -0
- package/src/styles/variants.ts +25 -0
package/dist/graphiq.cjs
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let l=require(`react`);l=c(l);let u=require(`react/jsx-runtime`),d=require(`graphql`);var f=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},p=(e=>e?f(e):f),m=e=>e;function h(e,t=m){let n=l.default.useSyncExternalStore(e.subscribe,l.default.useCallback(()=>t(e.getState()),[e,t]),l.default.useCallback(()=>t(e.getInitialState()),[e,t]));return l.default.useDebugValue(n),n}function g(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=g(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function _(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=g(e))&&(r&&(r+=` `),r+=t);return r}var v=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},y=(e,t)=>({classGroupId:e,validator:t}),ee=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),b=`-`,te=[],ne=`arbitrary..`,x=e=>{let t=ae(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return ie(e);let n=e.split(b);return re(n,n[0]===``&&n.length>1?1:0,t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?v(i,t):t:i||te}return n[e]||te}}},re=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=re(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(b):e.slice(t).join(b),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},ie=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?ne+r:void 0})(),ae=e=>{let{theme:t,classGroups:n}=e;return oe(n,t)},oe=(e,t)=>{let n=ee();for(let r in e){let i=e[r];se(i,n,r,t)}return n},se=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];ce(i,t,n,r)}},ce=(e,t,n,r)=>{if(typeof e==`string`){le(e,t,n);return}if(typeof e==`function`){ue(e,t,n,r);return}de(e,t,n,r)},le=(e,t,n)=>{let r=e===``?t:fe(t,e);r.classGroupId=n},ue=(e,t,n,r)=>{if(pe(e)){se(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(y(n,e))},de=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];se(o,fe(t,a),n,r)}},fe=(e,t)=>{let n=e,r=t.split(b),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=ee(),n.nextPart.set(t,i)),n=i}return n},pe=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,S=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},me=`!`,he=`:`,ge=[],_e=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),ve=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===he){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(me)?(c=s.slice(0,-1),l=!0):s.startsWith(me)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return _e(t,l,c,u)};if(t){let e=t+he,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):_e(ge,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},ye=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},be=e=>({cache:S(e.cacheSize),parseClassName:ve(e),sortModifiers:ye(e),...x(e)}),xe=/\s+/,Se=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],s=e.trim().split(xe),c=``;for(let e=s.length-1;e>=0;--e){let t=s[e],{isExternal:l,modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=n(t);if(l){c=t+(c.length>0?` `+c:c);continue}let m=!!p,h=r(m?f.substring(0,p):f);if(!h){if(!m){c=t+(c.length>0?` `+c:c);continue}if(h=r(f),!h){c=t+(c.length>0?` `+c:c);continue}m=!1}let g=u.length===0?``:u.length===1?u[0]:a(u).join(`:`),_=d?g+me:g,v=_+h;if(o.indexOf(v)>-1)continue;o.push(v);let y=i(h,m);for(let e=0;e<y.length;++e){let t=y[e];o.push(_+t)}c=t+(c.length>0?` `+c:c)}return c},Ce=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=we(n))&&(i&&(i+=` `),i+=r);return i},we=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=we(e[r]))&&(n&&(n+=` `),n+=t);return n},Te=(e,...t)=>{let n,r,i,a,o=o=>(n=be(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=Se(e,n);return i(e,a),a};return a=o,(...e)=>a(Ce(...e))},Ee=[],De=e=>{let t=t=>t[e]||Ee;return t.isThemeGetter=!0,t},Oe=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ke=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Ae=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,je=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Me=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Ne=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Pe=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Fe=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ie=e=>Ae.test(e),C=e=>!!e&&!Number.isNaN(Number(e)),Le=e=>!!e&&Number.isInteger(Number(e)),Re=e=>e.endsWith(`%`)&&C(e.slice(0,-1)),ze=e=>je.test(e),Be=()=>!0,Ve=e=>Me.test(e)&&!Ne.test(e),He=()=>!1,Ue=e=>Pe.test(e),We=e=>Fe.test(e),Ge=e=>!w(e)&&!T(e),Ke=e=>st(e,dt,He),w=e=>Oe.test(e),qe=e=>st(e,ft,Ve),Je=e=>st(e,pt,C),Ye=e=>st(e,ht,Be),Xe=e=>st(e,mt,He),Ze=e=>st(e,lt,He),Qe=e=>st(e,ut,We),$e=e=>st(e,gt,Ue),T=e=>ke.test(e),et=e=>ct(e,ft),tt=e=>ct(e,mt),nt=e=>ct(e,lt),rt=e=>ct(e,dt),it=e=>ct(e,ut),at=e=>ct(e,gt,!0),ot=e=>ct(e,ht,!0),st=(e,t,n)=>{let r=Oe.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},ct=(e,t,n=!1)=>{let r=ke.exec(e);return r?r[1]?t(r[1]):n:!1},lt=e=>e===`position`||e===`percentage`,ut=e=>e===`image`||e===`url`,dt=e=>e===`length`||e===`size`||e===`bg-size`,ft=e=>e===`length`,pt=e=>e===`number`,mt=e=>e===`family-name`,ht=e=>e===`number`||e===`weight`,gt=e=>e===`shadow`,_t=()=>{let e=De(`color`),t=De(`font`),n=De(`text`),r=De(`font-weight`),i=De(`tracking`),a=De(`leading`),o=De(`breakpoint`),s=De(`container`),c=De(`spacing`),l=De(`radius`),u=De(`shadow`),d=De(`inset-shadow`),f=De(`text-shadow`),p=De(`drop-shadow`),m=De(`blur`),h=De(`perspective`),g=De(`aspect`),_=De(`ease`),v=De(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],ee=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],b=()=>[...ee(),T,w],te=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],ne=()=>[`auto`,`contain`,`none`],x=()=>[T,w,c],re=()=>[Ie,`full`,`auto`,...x()],ie=()=>[Le,`none`,`subgrid`,T,w],ae=()=>[`auto`,{span:[`full`,Le,T,w]},Le,T,w],oe=()=>[Le,`auto`,T,w],se=()=>[`auto`,`min`,`max`,`fr`,T,w],ce=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],le=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],ue=()=>[`auto`,...x()],de=()=>[Ie,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...x()],fe=()=>[Ie,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...x()],pe=()=>[Ie,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...x()],S=()=>[e,T,w],me=()=>[...ee(),nt,Ze,{position:[T,w]}],he=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ge=()=>[`auto`,`cover`,`contain`,rt,Ke,{size:[T,w]}],_e=()=>[Re,et,qe],ve=()=>[``,`none`,`full`,l,T,w],ye=()=>[``,C,et,qe],be=()=>[`solid`,`dashed`,`dotted`,`double`],xe=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],Se=()=>[C,Re,nt,Ze],Ce=()=>[``,`none`,m,T,w],we=()=>[`none`,C,T,w],Te=()=>[`none`,C,T,w],Ee=()=>[C,T,w],Oe=()=>[Ie,`full`,...x()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[ze],breakpoint:[ze],color:[Be],container:[ze],"drop-shadow":[ze],ease:[`in`,`out`,`in-out`],font:[Ge],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[ze],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[ze],shadow:[ze],spacing:[`px`,C],text:[ze],"text-shadow":[ze],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Ie,w,T,g]}],container:[`container`],columns:[{columns:[C,w,T,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:b()}],overflow:[{overflow:te()}],"overflow-x":[{"overflow-x":te()}],"overflow-y":[{"overflow-y":te()}],overscroll:[{overscroll:ne()}],"overscroll-x":[{"overscroll-x":ne()}],"overscroll-y":[{"overscroll-y":ne()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:re()}],"inset-x":[{"inset-x":re()}],"inset-y":[{"inset-y":re()}],start:[{"inset-s":re(),start:re()}],end:[{"inset-e":re(),end:re()}],"inset-bs":[{"inset-bs":re()}],"inset-be":[{"inset-be":re()}],top:[{top:re()}],right:[{right:re()}],bottom:[{bottom:re()}],left:[{left:re()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[Le,`auto`,T,w]}],basis:[{basis:[Ie,`full`,`auto`,s,...x()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[C,Ie,`auto`,`initial`,`none`,w]}],grow:[{grow:[``,C,T,w]}],shrink:[{shrink:[``,C,T,w]}],order:[{order:[Le,`first`,`last`,`none`,T,w]}],"grid-cols":[{"grid-cols":ie()}],"col-start-end":[{col:ae()}],"col-start":[{"col-start":oe()}],"col-end":[{"col-end":oe()}],"grid-rows":[{"grid-rows":ie()}],"row-start-end":[{row:ae()}],"row-start":[{"row-start":oe()}],"row-end":[{"row-end":oe()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":se()}],"auto-rows":[{"auto-rows":se()}],gap:[{gap:x()}],"gap-x":[{"gap-x":x()}],"gap-y":[{"gap-y":x()}],"justify-content":[{justify:[...ce(),`normal`]}],"justify-items":[{"justify-items":[...le(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...le()]}],"align-content":[{content:[`normal`,...ce()]}],"align-items":[{items:[...le(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...le(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":ce()}],"place-items":[{"place-items":[...le(),`baseline`]}],"place-self":[{"place-self":[`auto`,...le()]}],p:[{p:x()}],px:[{px:x()}],py:[{py:x()}],ps:[{ps:x()}],pe:[{pe:x()}],pbs:[{pbs:x()}],pbe:[{pbe:x()}],pt:[{pt:x()}],pr:[{pr:x()}],pb:[{pb:x()}],pl:[{pl:x()}],m:[{m:ue()}],mx:[{mx:ue()}],my:[{my:ue()}],ms:[{ms:ue()}],me:[{me:ue()}],mbs:[{mbs:ue()}],mbe:[{mbe:ue()}],mt:[{mt:ue()}],mr:[{mr:ue()}],mb:[{mb:ue()}],ml:[{ml:ue()}],"space-x":[{"space-x":x()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":x()}],"space-y-reverse":[`space-y-reverse`],size:[{size:de()}],"inline-size":[{inline:[`auto`,...fe()]}],"min-inline-size":[{"min-inline":[`auto`,...fe()]}],"max-inline-size":[{"max-inline":[`none`,...fe()]}],"block-size":[{block:[`auto`,...pe()]}],"min-block-size":[{"min-block":[`auto`,...pe()]}],"max-block-size":[{"max-block":[`none`,...pe()]}],w:[{w:[s,`screen`,...de()]}],"min-w":[{"min-w":[s,`screen`,`none`,...de()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...de()]}],h:[{h:[`screen`,`lh`,...de()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...de()]}],"max-h":[{"max-h":[`screen`,`lh`,...de()]}],"font-size":[{text:[`base`,n,et,qe]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,ot,Ye]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Re,w]}],"font-family":[{font:[tt,Xe,t]}],"font-features":[{"font-features":[w]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,T,w]}],"line-clamp":[{"line-clamp":[C,`none`,T,Je]}],leading:[{leading:[a,...x()]}],"list-image":[{"list-image":[`none`,T,w]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,T,w]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:S()}],"text-color":[{text:S()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...be(),`wavy`]}],"text-decoration-thickness":[{decoration:[C,`from-font`,`auto`,T,qe]}],"text-decoration-color":[{decoration:S()}],"underline-offset":[{"underline-offset":[C,`auto`,T,w]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:x()}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,T,w]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,T,w]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:me()}],"bg-repeat":[{bg:he()}],"bg-size":[{bg:ge()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Le,T,w],radial:[``,T,w],conic:[Le,T,w]},it,Qe]}],"bg-color":[{bg:S()}],"gradient-from-pos":[{from:_e()}],"gradient-via-pos":[{via:_e()}],"gradient-to-pos":[{to:_e()}],"gradient-from":[{from:S()}],"gradient-via":[{via:S()}],"gradient-to":[{to:S()}],rounded:[{rounded:ve()}],"rounded-s":[{"rounded-s":ve()}],"rounded-e":[{"rounded-e":ve()}],"rounded-t":[{"rounded-t":ve()}],"rounded-r":[{"rounded-r":ve()}],"rounded-b":[{"rounded-b":ve()}],"rounded-l":[{"rounded-l":ve()}],"rounded-ss":[{"rounded-ss":ve()}],"rounded-se":[{"rounded-se":ve()}],"rounded-ee":[{"rounded-ee":ve()}],"rounded-es":[{"rounded-es":ve()}],"rounded-tl":[{"rounded-tl":ve()}],"rounded-tr":[{"rounded-tr":ve()}],"rounded-br":[{"rounded-br":ve()}],"rounded-bl":[{"rounded-bl":ve()}],"border-w":[{border:ye()}],"border-w-x":[{"border-x":ye()}],"border-w-y":[{"border-y":ye()}],"border-w-s":[{"border-s":ye()}],"border-w-e":[{"border-e":ye()}],"border-w-bs":[{"border-bs":ye()}],"border-w-be":[{"border-be":ye()}],"border-w-t":[{"border-t":ye()}],"border-w-r":[{"border-r":ye()}],"border-w-b":[{"border-b":ye()}],"border-w-l":[{"border-l":ye()}],"divide-x":[{"divide-x":ye()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":ye()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...be(),`hidden`,`none`]}],"divide-style":[{divide:[...be(),`hidden`,`none`]}],"border-color":[{border:S()}],"border-color-x":[{"border-x":S()}],"border-color-y":[{"border-y":S()}],"border-color-s":[{"border-s":S()}],"border-color-e":[{"border-e":S()}],"border-color-bs":[{"border-bs":S()}],"border-color-be":[{"border-be":S()}],"border-color-t":[{"border-t":S()}],"border-color-r":[{"border-r":S()}],"border-color-b":[{"border-b":S()}],"border-color-l":[{"border-l":S()}],"divide-color":[{divide:S()}],"outline-style":[{outline:[...be(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[C,T,w]}],"outline-w":[{outline:[``,C,et,qe]}],"outline-color":[{outline:S()}],shadow:[{shadow:[``,`none`,u,at,$e]}],"shadow-color":[{shadow:S()}],"inset-shadow":[{"inset-shadow":[`none`,d,at,$e]}],"inset-shadow-color":[{"inset-shadow":S()}],"ring-w":[{ring:ye()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:S()}],"ring-offset-w":[{"ring-offset":[C,qe]}],"ring-offset-color":[{"ring-offset":S()}],"inset-ring-w":[{"inset-ring":ye()}],"inset-ring-color":[{"inset-ring":S()}],"text-shadow":[{"text-shadow":[`none`,f,at,$e]}],"text-shadow-color":[{"text-shadow":S()}],opacity:[{opacity:[C,T,w]}],"mix-blend":[{"mix-blend":[...xe(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":xe()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[C]}],"mask-image-linear-from-pos":[{"mask-linear-from":Se()}],"mask-image-linear-to-pos":[{"mask-linear-to":Se()}],"mask-image-linear-from-color":[{"mask-linear-from":S()}],"mask-image-linear-to-color":[{"mask-linear-to":S()}],"mask-image-t-from-pos":[{"mask-t-from":Se()}],"mask-image-t-to-pos":[{"mask-t-to":Se()}],"mask-image-t-from-color":[{"mask-t-from":S()}],"mask-image-t-to-color":[{"mask-t-to":S()}],"mask-image-r-from-pos":[{"mask-r-from":Se()}],"mask-image-r-to-pos":[{"mask-r-to":Se()}],"mask-image-r-from-color":[{"mask-r-from":S()}],"mask-image-r-to-color":[{"mask-r-to":S()}],"mask-image-b-from-pos":[{"mask-b-from":Se()}],"mask-image-b-to-pos":[{"mask-b-to":Se()}],"mask-image-b-from-color":[{"mask-b-from":S()}],"mask-image-b-to-color":[{"mask-b-to":S()}],"mask-image-l-from-pos":[{"mask-l-from":Se()}],"mask-image-l-to-pos":[{"mask-l-to":Se()}],"mask-image-l-from-color":[{"mask-l-from":S()}],"mask-image-l-to-color":[{"mask-l-to":S()}],"mask-image-x-from-pos":[{"mask-x-from":Se()}],"mask-image-x-to-pos":[{"mask-x-to":Se()}],"mask-image-x-from-color":[{"mask-x-from":S()}],"mask-image-x-to-color":[{"mask-x-to":S()}],"mask-image-y-from-pos":[{"mask-y-from":Se()}],"mask-image-y-to-pos":[{"mask-y-to":Se()}],"mask-image-y-from-color":[{"mask-y-from":S()}],"mask-image-y-to-color":[{"mask-y-to":S()}],"mask-image-radial":[{"mask-radial":[T,w]}],"mask-image-radial-from-pos":[{"mask-radial-from":Se()}],"mask-image-radial-to-pos":[{"mask-radial-to":Se()}],"mask-image-radial-from-color":[{"mask-radial-from":S()}],"mask-image-radial-to-color":[{"mask-radial-to":S()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":ee()}],"mask-image-conic-pos":[{"mask-conic":[C]}],"mask-image-conic-from-pos":[{"mask-conic-from":Se()}],"mask-image-conic-to-pos":[{"mask-conic-to":Se()}],"mask-image-conic-from-color":[{"mask-conic-from":S()}],"mask-image-conic-to-color":[{"mask-conic-to":S()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:me()}],"mask-repeat":[{mask:he()}],"mask-size":[{mask:ge()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,T,w]}],filter:[{filter:[``,`none`,T,w]}],blur:[{blur:Ce()}],brightness:[{brightness:[C,T,w]}],contrast:[{contrast:[C,T,w]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,at,$e]}],"drop-shadow-color":[{"drop-shadow":S()}],grayscale:[{grayscale:[``,C,T,w]}],"hue-rotate":[{"hue-rotate":[C,T,w]}],invert:[{invert:[``,C,T,w]}],saturate:[{saturate:[C,T,w]}],sepia:[{sepia:[``,C,T,w]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,T,w]}],"backdrop-blur":[{"backdrop-blur":Ce()}],"backdrop-brightness":[{"backdrop-brightness":[C,T,w]}],"backdrop-contrast":[{"backdrop-contrast":[C,T,w]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,C,T,w]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[C,T,w]}],"backdrop-invert":[{"backdrop-invert":[``,C,T,w]}],"backdrop-opacity":[{"backdrop-opacity":[C,T,w]}],"backdrop-saturate":[{"backdrop-saturate":[C,T,w]}],"backdrop-sepia":[{"backdrop-sepia":[``,C,T,w]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":x()}],"border-spacing-x":[{"border-spacing-x":x()}],"border-spacing-y":[{"border-spacing-y":x()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,T,w]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[C,`initial`,T,w]}],ease:[{ease:[`linear`,`initial`,_,T,w]}],delay:[{delay:[C,T,w]}],animate:[{animate:[`none`,v,T,w]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,T,w]}],"perspective-origin":[{"perspective-origin":b()}],rotate:[{rotate:we()}],"rotate-x":[{"rotate-x":we()}],"rotate-y":[{"rotate-y":we()}],"rotate-z":[{"rotate-z":we()}],scale:[{scale:Te()}],"scale-x":[{"scale-x":Te()}],"scale-y":[{"scale-y":Te()}],"scale-z":[{"scale-z":Te()}],"scale-3d":[`scale-3d`],skew:[{skew:Ee()}],"skew-x":[{"skew-x":Ee()}],"skew-y":[{"skew-y":Ee()}],transform:[{transform:[T,w,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:b()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:Oe()}],"translate-x":[{"translate-x":Oe()}],"translate-y":[{"translate-y":Oe()}],"translate-z":[{"translate-z":Oe()}],"translate-none":[`translate-none`],accent:[{accent:S()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:S()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,T,w]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scroll-m":[{"scroll-m":x()}],"scroll-mx":[{"scroll-mx":x()}],"scroll-my":[{"scroll-my":x()}],"scroll-ms":[{"scroll-ms":x()}],"scroll-me":[{"scroll-me":x()}],"scroll-mbs":[{"scroll-mbs":x()}],"scroll-mbe":[{"scroll-mbe":x()}],"scroll-mt":[{"scroll-mt":x()}],"scroll-mr":[{"scroll-mr":x()}],"scroll-mb":[{"scroll-mb":x()}],"scroll-ml":[{"scroll-ml":x()}],"scroll-p":[{"scroll-p":x()}],"scroll-px":[{"scroll-px":x()}],"scroll-py":[{"scroll-py":x()}],"scroll-ps":[{"scroll-ps":x()}],"scroll-pe":[{"scroll-pe":x()}],"scroll-pbs":[{"scroll-pbs":x()}],"scroll-pbe":[{"scroll-pbe":x()}],"scroll-pt":[{"scroll-pt":x()}],"scroll-pr":[{"scroll-pr":x()}],"scroll-pb":[{"scroll-pb":x()}],"scroll-pl":[{"scroll-pl":x()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,T,w]}],fill:[{fill:[`none`,...S()]}],"stroke-w":[{stroke:[C,et,qe,Je]}],stroke:[{stroke:[`none`,...S()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}},vt=(e,{cacheSize:t,prefix:n,experimentalParseClassName:r,extend:i={},override:a={}})=>(yt(e,`cacheSize`,t),yt(e,`prefix`,n),yt(e,`experimentalParseClassName`,r),bt(e.theme,a.theme),bt(e.classGroups,a.classGroups),bt(e.conflictingClassGroups,a.conflictingClassGroups),bt(e.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),yt(e,`orderSensitiveModifiers`,a.orderSensitiveModifiers),xt(e.theme,i.theme),xt(e.classGroups,i.classGroups),xt(e.conflictingClassGroups,i.conflictingClassGroups),xt(e.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers),St(e,i,`orderSensitiveModifiers`),e),yt=(e,t,n)=>{n!==void 0&&(e[t]=n)},bt=(e,t)=>{if(t)for(let n in t)yt(e,n,t[n])},xt=(e,t)=>{if(t)for(let n in t)St(e,t,n)},St=(e,t,n)=>{let r=t[n];r!==void 0&&(e[n]=e[n]?e[n].concat(r):r)},Ct=(e,...t)=>typeof e==`function`?Te(_t,e,...t):Te(()=>vt(_t(),e),...t),wt=Te(_t);function E(...e){return wt(_(e))}function Tt(e,t){return async(n,r)=>{let i={"Content-Type":`application/json`,...t,...n.headers},a={query:n.query};n.variables&&(a.variables=n.variables),n.operationName&&(a.operationName=n.operationName);let o=await fetch(e,{method:`POST`,headers:i,body:JSON.stringify(a),signal:r});if(!o.ok)throw Error(`HTTP ${o.status}: ${o.statusText}`);return await o.json()}}var Et=(0,l.createContext)(null);function Dt(){let e=(0,l.useContext)(Et);if(!e)throw Error(`GraphiQ hooks must be used within a <GraphiQProvider>`);return e}var Ot=/\s+/g,kt=e=>typeof e!=`string`||!e?e:e.replace(Ot,` `).trim(),At=(...e)=>{let t=[],n=e=>{if(!e&&e!==0&&e!==0n)return;if(Array.isArray(e)){for(let t=0,r=e.length;t<r;t++)n(e[t]);return}let r=typeof e;if(r===`string`||r===`number`||r===`bigint`){if(r===`number`&&e!==e)return;t.push(String(e))}else if(r===`object`){let n=Object.keys(e);for(let r=0,i=n.length;r<i;r++){let i=n[r];e[i]&&t.push(i)}}};for(let t=0,r=e.length;t<r;t++){let r=e[t];r!=null&&n(r)}return t.length>0?kt(t.join(` `)):void 0},jt=e=>e===!1?`false`:e===!0?`true`:e===0?`0`:e,Mt=e=>{if(!e||typeof e!=`object`)return!0;for(let t in e)return!1;return!0},Nt=(e,t)=>{if(e===t)return!0;if(!e||!t)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i=0;i<n.length;i++){let a=n[i];if(!r.includes(a)||e[a]!==t[a])return!1}return!0},Pt=(e,t)=>{for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let r=t[n];n in e?e[n]=At(e[n],r):e[n]=r}return e},Ft=(e,t)=>{for(let n=0;n<e.length;n++){let r=e[n];Array.isArray(r)?Ft(r,t):r&&t.push(r)}},It=(...e)=>{let t=[];Ft(e,t);let n=[];for(let e=0;e<t.length;e++)t[e]&&n.push(t[e]);return n},Lt=(e,t)=>{let n={};for(let r in e){let i=e[r];if(r in t){let e=t[r];Array.isArray(i)||Array.isArray(e)?n[r]=It(e,i):typeof i==`object`&&typeof e==`object`&&i&&e?n[r]=Lt(i,e):n[r]=e+` `+i}else n[r]=i}for(let r in t)r in e||(n[r]=t[r]);return n},Rt={twMerge:!0,twMergeConfig:{}};function zt(){let e=null,t={},n=!1;return{get cachedTwMerge(){return e},set cachedTwMerge(t){e=t},get cachedTwMergeConfig(){return t},set cachedTwMergeConfig(e){t=e},get didTwMergeConfigChange(){return n},set didTwMergeConfigChange(e){n=e},reset(){e=null,t={},n=!1}}}var Bt=zt(),Vt=e=>{let t=(t,n)=>{let{extend:r=null,slots:i={},variants:a={},compoundVariants:o=[],compoundSlots:s=[],defaultVariants:c={}}=t,l={...Rt,...n},u=r?.base?At(r.base,t?.base):t?.base,d=r?.variants&&!Mt(r.variants)?Lt(a,r.variants):a,f=r?.defaultVariants&&!Mt(r.defaultVariants)?{...r.defaultVariants,...c}:c;!Mt(l.twMergeConfig)&&!Nt(l.twMergeConfig,Bt.cachedTwMergeConfig)&&(Bt.didTwMergeConfigChange=!0,Bt.cachedTwMergeConfig=l.twMergeConfig);let p=Mt(r?.slots),m=Mt(i)?{}:{base:At(t?.base,p&&r?.base),...i},h=p?m:Pt({...r?.slots},Mt(m)?{base:t?.base}:m),g=Mt(r?.compoundVariants)?o:It(r?.compoundVariants,o),_=t=>{if(Mt(d)&&Mt(i)&&p)return e(u,t?.class,t?.className)(l);if(g&&!Array.isArray(g))throw TypeError(`The "compoundVariants" prop must be an array. Received: ${typeof g}`);if(s&&!Array.isArray(s))throw TypeError(`The "compoundSlots" prop must be an array. Received: ${typeof s}`);let n=(e,n=d,r=null,i=null)=>{let a=n[e];if(!a||Mt(a))return null;let o=i?.[e]??t?.[e];if(o===null)return null;let s=jt(o);if(typeof s==`object`)return null;let c=f?.[e];return a[(s??jt(c))||`false`]},r=()=>{if(!d)return null;let e=Object.keys(d),t=[];for(let r=0;r<e.length;r++){let i=n(e[r],d);i&&t.push(i)}return t},a=(e,t)=>{if(!d||typeof d!=`object`)return null;let r=[];for(let i in d){let a=n(i,d,e,t),o=e===`base`&&typeof a==`string`?a:a&&a[e];o&&r.push(o)}return r},o={};for(let e in t){let n=t[e];n!==void 0&&(o[e]=n)}let c=(e,n)=>{let r=typeof t?.[e]==`object`?{[e]:t[e]?.initial}:{};return{...f,...o,...r,...n}},m=(e=[],t)=>{let n=[],r=e.length;for(let i=0;i<r;i++){let{class:r,className:a,...o}=e[i],s=!0,l=c(null,t);for(let e in o){let t=o[e],n=l[e];if(Array.isArray(t)){if(!t.includes(n)){s=!1;break}}else{if((t==null||t===!1)&&(n==null||n===!1))continue;if(n!==t){s=!1;break}}}s&&(r&&n.push(r),a&&n.push(a))}return n},_=t=>{let n=m(g,t);if(!Array.isArray(n))return n;let r={},i=e;for(let e=0;e<n.length;e++){let t=n[e];if(typeof t==`string`)r.base=i(r.base,t)(l);else if(typeof t==`object`)for(let e in t)r[e]=i(r[e],t[e])(l)}return r},v=e=>{if(s.length<1)return null;let t={},n=c(null,e);for(let e=0;e<s.length;e++){let{slots:r=[],class:i,className:a,...o}=s[e];if(!Mt(o)){let e=!0;for(let t in o){let r=n[t],i=o[t];if(r===void 0||(Array.isArray(i)?!i.includes(r):i!==r)){e=!1;break}}if(!e)continue}for(let e=0;e<r.length;e++){let n=r[e];t[n]||(t[n]=[]),t[n].push([i,a])}}return t};if(!Mt(i)||!p){let t={};if(typeof h==`object`&&!Mt(h)){let n=e;for(let e in h)t[e]=t=>{let r=_(t),i=v(t);return n(h[e],a(e,t),r?r[e]:void 0,i?i[e]:void 0,t?.class,t?.className)(l)}}return t}return e(u,r(),m(g),t?.class,t?.className)(l)};return _.variantKeys=(()=>{if(!(!d||typeof d!=`object`))return Object.keys(d)})(),_.extend=r,_.base=u,_.slots=h,_.variants=d,_.defaultVariants=f,_.compoundSlots=s,_.compoundVariants=g,_};return{tv:t,createTV:e=>(n,r)=>t(n,r?Lt(e,r):e)}},Ht=e=>Mt(e)?wt:Ct({...e,extend:{theme:e.theme,classGroups:e.classGroups,conflictingClassGroupModifiers:e.conflictingClassGroupModifiers,conflictingClassGroups:e.conflictingClassGroups,...e.extend}}),Ut=(e,t)=>{let n=At(e);return!n||!(t?.twMerge??!0)?n:((!Bt.cachedTwMerge||Bt.didTwMergeConfigChange)&&(Bt.didTwMergeConfigChange=!1,Bt.cachedTwMerge=Ht(Bt.cachedTwMergeConfig)),Bt.cachedTwMerge(n)||void 0)},{createTV:Wt,tv:Gt}=Vt((...e)=>t=>Ut(e,t)),Kt=Gt({slots:{root:`gq-root flex h-full w-full bg-gq-bg text-gq-text font-gq-sans text-[13px] overflow-hidden`,sidebar:`gq-sidebar flex flex-col items-center gap-0.5 py-1.5 bg-gq-bg border-r border-gq-border`,sidebarPanel:`gq-sidebar-panel bg-gq-bg border-r border-gq-border overflow-y-auto`,editor:`gq-editor flex flex-col flex-1 min-w-0 bg-gq-bg-secondary`,toolbar:`gq-toolbar flex items-center gap-1.5 px-2 bg-gq-bg border-b border-gq-border`,response:`gq-response flex flex-col flex-1 min-w-0 bg-gq-bg-secondary`,executeButton:`gq-execute inline-flex items-center justify-center gap-1 px-2.5 py-1 rounded-gq bg-gq-accent text-gq-bg font-gq-sans text-xs font-medium transition-all hover:bg-gq-accent-hover active:scale-[0.97]`,tabs:`gq-tabs flex items-center gap-0 border-b border-gq-border bg-gq-bg`,variablesEditor:`gq-variables flex flex-col bg-gq-bg-secondary`,headersEditor:`gq-headers flex flex-col bg-gq-bg-secondary`}}),qt=1024,Jt=0,Yt=class{constructor(e,t){this.from=e,this.to=t}},D=class{constructor(e={}){this.id=Jt++,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=Qt.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}};D.closedBy=new D({deserialize:e=>e.split(` `)}),D.openedBy=new D({deserialize:e=>e.split(` `)}),D.group=new D({deserialize:e=>e.split(` `)}),D.isolate=new D({deserialize:e=>{if(e&&e!=`rtl`&&e!=`ltr`&&e!=`auto`)throw RangeError(`Invalid value for isolate: `+e);return e||`auto`}}),D.contextHash=new D({perNode:!0}),D.lookAhead=new D({perNode:!0}),D.mounted=new D({perNode:!0});var Xt=class{constructor(e,t,n,r=!1){this.tree=e,this.overlay=t,this.parser=n,this.bracketed=r}static get(e){return e&&e.props&&e.props[D.mounted.id]}},Zt=Object.create(null),Qt=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):Zt,r=(t.top?1:0)|(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(D.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(D.group),r=-1;r<(n?n.length:0);r++){let i=t[r<0?e.name:n[r]];if(i)return i}}}};Qt.none=new Qt(``,Object.create(null),0,8);var $t=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);if(t){r||=Object.assign({},e.props);let n=t[1],i=t[0];i.combine&&i.id in r&&(n=i.combine(r[i.id],n)),r[i.id]=n}}n.push(r?new Qt(e.name,r,e.id,e.flags):e)}return new e(n)}},en=new WeakMap,tn=new WeakMap,O;(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`})(O||={});var nn=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=Xt.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 _n(this.topNode,e)}cursorAt(e,t=0,n=0){let r=new _n(en.get(this)||this.topNode);return r.moveTo(e,t),en.set(this,r._tree),r}get topNode(){return new ln(this,0,0,null)}resolve(e,t=0){let n=sn(en.get(this)||this.topNode,e,t,!1);return en.set(this,n),n}resolveInner(e,t=0){let n=sn(tn.get(this)||this.topNode,e,t,!0);return tn.set(this,n),n}resolveStack(e,t=0){return gn(this,e,t)}iterate(e){let{enter:t,leave:n,from:r=0,to:i=this.length}=e,a=e.mode||0,o=(a&O.IncludeAnonymous)>0;for(let e=this.cursor(a|O.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:Sn(Qt.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(Qt.none,t,n,r)))}static build(e){return yn(e)}};nn.empty=new nn(Qt.none,[],[],0);var rn=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)}},an=class e{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return Qt.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&&!(on(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 on(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 sn(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 ln&&e.index<0?null:e.parent;if(!t)return e;e=t}let i=r?0:O.IgnoreOverlays;if(r)for(let r=e,a=r.parent;a;r=a,a=r.parent)r instanceof ln&&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 cn=class{cursor(e=0){return new _n(this,e)}getChild(e,t=null,n=null){let r=un(this,e,t,n);return r.length?r[0]:null}getChildren(e,t=null,n=null){return un(this,e,t,n)}resolve(e,t=0){return sn(this,e,t,!1)}resolveInner(e,t=0){return sn(this,e,t,!0)}matchContext(e){return dn(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}},ln=class e extends cn{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,d;if(!(!(a&O.EnterBracketed&&l instanceof nn&&(d=Xt.get(l))&&!d.overlay&&d.bracketed&&r>=u&&r<=u+l.length)&&!on(i,r,u,u+l.length))){if(l instanceof an){if(a&O.ExcludeBuffers)continue;let e=l.findChild(0,l.buffer.length,n,r-u,i);if(e>-1)return new pn(new fn(o,l,t,u),null,e)}else if(a&O.IncludeAnonymous||!l.type.isAnonymous||vn(l)){let s;if(!(a&O.IgnoreMounts)&&(s=Xt.get(l))&&!s.overlay)return new e(s.tree,u,t,o);let c=new e(l,u,t,o);return a&O.IncludeAnonymous||!c.type.isAnonymous?c:c.nextChild(n<0?l.children.length-1:0,n,r,i,a)}}}if(a&O.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)}prop(e){return this._tree.prop(e)}enter(t,n,r=0){let i;if(!(r&O.IgnoreOverlays)&&(i=Xt.get(this._tree))&&i.overlay){let a=t-this.from,o=r&O.EnterBracketed&&i.bracketed;for(let{from:t,to:r}of i.overlay)if((n>0||o?t<=a:t<a)&&(n<0||o?r>=a:r>a))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 un(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 dn(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 fn=class{constructor(e,t,n,r){this.parent=e,this.buffer=t,this.index=n,this.start=r}},pn=class e extends cn{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)}prop(e){return this.type.prop(e)}enter(t,n,r=0){if(r&O.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 nn(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}};function mn(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 ln&&n.index<0?null:n.parent,i=e.slice();return r?i[t]=r:i.splice(t,1),new hn(i,n)}var hn=class{constructor(e,t){this.heads=e,this.node=t}get next(){return mn(this.heads)}};function gn(e,t,n){let r=e.resolveInner(t,n),i=null;for(let e=r instanceof ln?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=Xt.get(e.tree);if(a&&a.overlay&&a.overlay[0].from<=t&&a.overlay[a.overlay.length-1].to>=t){let o=new ln(a.tree,a.overlay[0].from+e.from,-1,e);(i||=[r]).push(sn(o,t,n,!1))}}return i?mn(i):r}var _n=class{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~O.EnterBracketed,e instanceof ln)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 ln?(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&O.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&O.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&O.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&O.IncludeAnonymous||e instanceof an||!e.type.isAnonymous||vn(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 pn(this.buffer,t,this.stack[e]);return this.bufferNode=new pn(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 dn(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 dn(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 vn(e){return e.children.some(e=>e instanceof an||!e.type.isAnonymous||vn(e))}function yn(e){let{buffer:t,nodeSet:n,maxBufferLength:r=qt,reused:i=[],minRepeatType:a=n.types.length}=e,o=Array.isArray(t)?new rn(t,t.length):t,s=n.types,c=0,l=0;function u(e,t,_,v,y,ee){let{id:b,start:te,end:ne,size:x}=o,re=l,ie=c;if(x<0)if(o.next(),x==-1){let t=i[b];_.push(t),v.push(te-e);return}else if(x==-3){c=b;return}else if(x==-4){l=b;return}else throw RangeError(`Unrecognized record size: ${x}`);let ae=s[b],oe,se,ce=te-e;if(ne-te<=r&&(se=h(o.pos-t,y))){let t=new Uint16Array(se.size-se.skip),r=o.pos-se.size,i=t.length;for(;o.pos>r;)i=g(se.start,t,i);oe=new an(t,ne-se.start,n),ce=se.start-e}else{let e=o.pos-x;o.next();let t=[],n=[],i=b>=a?b:-1,s=0,c=ne;for(;o.pos>e;)i>=0&&o.id==i&&o.size>=0?(o.end<=c-r&&(p(t,n,te,s,o.end,c,i,re,ie),s=t.length,c=o.end),o.next()):ee>2500?d(te,e,t,n):u(te,e,t,n,i,ee+1);if(i>=0&&s>0&&s<t.length&&p(t,n,te,s,te,c,i,re,ie),t.reverse(),n.reverse(),i>-1&&s>0){let e=f(ae,ie);oe=Sn(ae,t,n,0,t.length,0,ne-te,e,e)}else oe=m(ae,t,n,ne-te,re-ne,ie)}_.push(oe),v.push(ce)}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 an(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 nn){if(!o&&s.type==e&&s.length==i)return s;(c=s.prop(D.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=[D.contextHash,a];o=o?[e].concat(o):[e]}if(i>25){let e=[D.lookAhead,i];o=o?[e].concat(o):[e]}return new nn(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||n.size==-4)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 nn(s[e.topID],_.reverse(),v.reverse(),y)}var bn=new WeakMap;function xn(e,t){if(!e.isAnonymous||t instanceof an||t.type!=e)return 1;let n=bn.get(t);if(n==null){n=1;for(let r of t.children){if(r.type!=e||!(r instanceof nn)){n=1;break}n+=xn(e,r)}bn.set(t,n)}return n}function Sn(e,t,n,r,i,a,o,s,c){let l=0;for(let n=r;n<i;n++)l+=xn(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=xn(e,t[s]);for(s++;s<i;s++){let n=xn(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(Sn(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 Cn=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?1:0)|(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}},wn=class{startParse(e,t,n){return typeof e==`string`&&(e=new Tn(e)),n=n?n.length?n.map(e=>new Yt(e.from,e.to)):[new Yt(0,0)]:[new Yt(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}}},Tn=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 D({perNode:!0});var En=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 Dn(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&&this.setLookAhead(this.pos),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||this.buffer[i-1]<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;this.pos=r;let o=a.stateFlag(i,1);!o&&(r>n||t<=a.maxNode)&&(this.reducePos=r),this.pushState(i,o?n:Math.min(n,this.reducePos)),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 On(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 Dn(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}},Dn=class{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}},On=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,this.state=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0)}},kn=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 An(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 jn=class{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}},Mn=new jn,Nn=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=Mn,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);this.chunk=this.pos+e.length>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=Mn,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}},Pn=class{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;In(this.data,e,t,this.id,n.data,n.tokenPrecTable)}};Pn.prototype.contextual=Pn.prototype.fallback=Pn.prototype.extend=!1;var Fn=class{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data=typeof e==`string`?An(e):e}token(e,t){let n=e.pos,r=0;for(;;){let n=e.next<0,i=e.resolveOffset(1,1);if(In(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))}};Fn.prototype.contextual=Pn.prototype.fallback=Pn.prototype.extend=!1;function In(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||Rn(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 Ln(e,t,n){for(let r=t,i;(i=e[r])!=65535;r++)if(i==n)return r-t;return-1}function Rn(e,t,n,r){let i=Ln(n,r,t);return i<0||Ln(n,r,e)<i}var zn=typeof process<`u`&&process.env&&/\bparse\b/.test(process.env.LOG),Bn=null;function Vn(e,t,n){let r=e.cursor(O.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 Hn=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?Vn(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?Vn(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 nn){if(a==e){if(a<this.safeFrom)return null;let e=a+i.length;if(e<=this.safeTo){let t=i.prop(D.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}}},Un=class{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(e=>new jn)}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 jn,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 jn,{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=Jn(o,s+2);else{r==0&&o[s+1]==2&&(r=this.putAction(Jn(o,s+2),t,n,r));break}o[s]==t&&(r=this.putAction(Jn(o,s+1),t,n,r))}return r}},Wn=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 Nn(t,r),this.tokens=new Un(e,this.stream),this.topTerm=e.top[1];let{from:i}=r[0];this.stacks=[En.start(this,e.top[0],i)],this.fragments=n.length&&this.stream.end-i>e.bufferLength*4?new Hn(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&&Yn(r);if(e)return zn&&console.log(`Finish with `+this.stackID(e)),this.stackToTree(e);if(this.parser.strict)throw zn&&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 zn&&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.sort((e,t)=>t.score-e.score),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=zn?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(D.contextHash)||0)==n))return e.useNode(o,r),zn&&console.log(a+this.stackID(e)+` (via reuse of ${i.getName(o.type.id)})`),!0;if(!(o instanceof nn)||o.children.length==0||o.positions[0]>0)break;let s=o.children[0];if(s instanceof nn&&o.positions[0]==0)o=s;else break}}let o=i.stateSlot(e.state,4);if(o>0)return e.reduce(o),zn&&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),zn&&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 Gn(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=zn?this.stackID(o)+` -> `:``;if(o.deadEnd&&(i||(i=!0,o.restart(),zn&&console.log(l+this.stackID(o)+` (restarted)`),this.advanceFully(o,n))))continue;let u=o.split(),d=l;for(let e=0;e<10&&u.forceReduce()&&(zn&&console.log(d+this.stackID(u)+` (via force-reduce)`),!this.advanceFully(u,n));e++)zn&&(d=this.stackID(u)+` -> `);for(let e of o.recoverByInsert(s))zn&&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),zn&&console.log(l+this.stackID(o)+` (via recover-delete ${this.parser.getName(s)})`),Gn(o,n)):(!r||r.score<u.score)&&(r=u)}return r}stackToTree(e){return e.close(),nn.build({buffer:kn.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=(Bn||=new WeakMap).get(e);return t||Bn.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}};function Gn(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 Kn=class{constructor(e,t,n){this.source=e,this.flags=t,this.disabled=n}allows(e){return!this.disabled||this.disabled[e]==0}},qn=class e extends wn{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=D[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 $t(t.map((t,i)=>Qt.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=qt;let a=An(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(Xn),this.states=An(e.states,Uint32Array),this.data=An(e.stateData),this.goto=An(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(e=>typeof e==`number`?new Pn(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 Wn(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=Jn(n,i+2)];else if(n[i+1]==2)return Jn(n,i+2);else break;if(a==t||a==0)return Jn(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=Jn(this.data,n+2);else break;r=t(Jn(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=Jn(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]=Xn(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 Kn(e,n,r)}static deserialize(t){return new e(t)}};function Jn(e,t){return e[t]|e[t+1]<<16}function Yn(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 Xn(e){if(e.external){let t=e.extend?1:0;return(n,r)=>e.external(n,r)<<1|t}return e.get}var Zn=0,Qn=class e{constructor(e,t,n,r){this.name=e,this.set=t,this.base=n,this.modified=r,this.id=Zn++}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 er(e);return e=>e.modified.indexOf(t)>-1?e:er.get(e.base||e,e.modified.concat(t).sort((e,t)=>e.id-t.id))}},$n=0,er=class e{constructor(e){this.name=e,this.instances=[],this.id=$n++}static get(t,n){if(!n.length)return t;let r=n[0].instances.find(e=>e.base==t&&tr(n,e.modified));if(r)return r;let i=[],a=new Qn(t.name,i,t,n);for(let e of n)e.instances.push(a);let o=nr(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 tr(e,t){return e.length==t.length&&e.every((e,n)=>e==t[n])}function nr(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 rr(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 ar(r,i,o>0?n.slice(0,o):null).sort(t[s])}}return ir.add(t)}var ir=new D({combine(e,t){let n,r,i;for(;e||t;){if(!e||t&&e.depth>=t.depth?(i=t,t=t.next):(i=e,e=e.next),n&&n.mode==i.mode&&!i.context&&!n.context)continue;let a=new ar(i.tags,i.mode,i.context);n?n.next=a:r=a,n=a}return r}}),ar=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}};ar.empty=new ar([],2,null);function or(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 sr(e,t){let n=null;for(let r of e){let e=r.style(t);e&&(n=n?n+` `+e:e)}return n}function cr(e,t,n,r=0,i=e.length){let a=new lr(r,Array.isArray(t)?t:[t],n);a.highlightRange(e.cursor(),r,i,``,a.highlighters),a.flush(i)}var lr=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=ur(e)||ar.empty,u=sr(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(D.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 ur(e){let t=e.type.prop(ir);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}var k=Qn.define,dr=k(),fr=k(),pr=k(fr),mr=k(fr),hr=k(),gr=k(hr),_r=k(hr),vr=k(),yr=k(vr),br=k(),xr=k(),Sr=k(),Cr=k(Sr),wr=k(),A={comment:dr,lineComment:k(dr),blockComment:k(dr),docComment:k(dr),name:fr,variableName:k(fr),typeName:pr,tagName:k(pr),propertyName:mr,attributeName:k(mr),className:k(fr),labelName:k(fr),namespace:k(fr),macroName:k(fr),literal:hr,string:gr,docString:k(gr),character:k(gr),attributeValue:k(gr),number:_r,integer:k(_r),float:k(_r),bool:k(hr),regexp:k(hr),escape:k(hr),color:k(hr),url:k(hr),keyword:br,self:k(br),null:k(br),atom:k(br),unit:k(br),modifier:k(br),operatorKeyword:k(br),controlKeyword:k(br),definitionKeyword:k(br),moduleKeyword:k(br),operator:xr,derefOperator:k(xr),arithmeticOperator:k(xr),logicOperator:k(xr),bitwiseOperator:k(xr),compareOperator:k(xr),updateOperator:k(xr),definitionOperator:k(xr),typeOperator:k(xr),controlOperator:k(xr),punctuation:Sr,separator:k(Sr),bracket:Cr,angleBracket:k(Cr),squareBracket:k(Cr),paren:k(Cr),brace:k(Cr),content:vr,heading:yr,heading1:k(yr),heading2:k(yr),heading3:k(yr),heading4:k(yr),heading5:k(yr),heading6:k(yr),contentSeparator:k(vr),list:k(vr),quote:k(vr),emphasis:k(vr),strong:k(vr),link:k(vr),monospace:k(vr),strikethrough:k(vr),inserted:k(),deleted:k(),changed:k(),invalid:k(),meta:wr,documentMeta:k(wr),annotation:k(wr),processingInstruction:k(wr),definition:Qn.defineModifier(`definition`),constant:Qn.defineModifier(`constant`),function:Qn.defineModifier(`function`),standard:Qn.defineModifier(`standard`),local:Qn.defineModifier(`local`),special:Qn.defineModifier(`special`)};for(let e in A){let t=A[e];t instanceof Qn&&(t.name=e)}or([{tag:A.link,class:`tok-link`},{tag:A.heading,class:`tok-heading`},{tag:A.emphasis,class:`tok-emphasis`},{tag:A.strong,class:`tok-strong`},{tag:A.keyword,class:`tok-keyword`},{tag:A.atom,class:`tok-atom`},{tag:A.bool,class:`tok-bool`},{tag:A.url,class:`tok-url`},{tag:A.labelName,class:`tok-labelName`},{tag:A.inserted,class:`tok-inserted`},{tag:A.deleted,class:`tok-deleted`},{tag:A.literal,class:`tok-literal`},{tag:A.string,class:`tok-string`},{tag:A.number,class:`tok-number`},{tag:[A.regexp,A.escape,A.special(A.string)],class:`tok-string2`},{tag:A.variableName,class:`tok-variableName`},{tag:A.local(A.variableName),class:`tok-variableName tok-local`},{tag:A.definition(A.variableName),class:`tok-variableName tok-definition`},{tag:A.special(A.variableName),class:`tok-variableName2`},{tag:A.definition(A.propertyName),class:`tok-propertyName tok-definition`},{tag:A.typeName,class:`tok-typeName`},{tag:A.namespace,class:`tok-namespace`},{tag:A.className,class:`tok-className`},{tag:A.macroName,class:`tok-macroName`},{tag:A.propertyName,class:`tok-propertyName`},{tag:A.operator,class:`tok-operator`},{tag:A.comment,class:`tok-comment`},{tag:A.meta,class:`tok-meta`},{tag:A.invalid,class:`tok-invalid`},{tag:A.punctuation,class:`tok-punctuation`}]);var Tr=rr({String:A.string,Number:A.number,"True False":A.bool,PropertyName:A.propertyName,Null:A.null,", :":A.separator,"[ ]":A.squareBracket,"{ }":A.brace}),Er=qn.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:[Tr],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}),Dr=[],Or=[];(()=>{let e=`lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o`.split(`,`).map(e=>e?parseInt(e,36):1);for(let t=0,n=0;t<e.length;t++)(t%2?Or:Dr).push(n+=e[t])})();function kr(e){if(e<768)return!1;for(let t=0,n=Dr.length;;){let r=t+n>>1;if(e<Dr[r])n=r;else if(e>=Or[r])t=r+1;else return!0;if(t==n)return!1}}function Ar(e){return e>=127462&&e<=127487}var jr=8205;function Mr(e,t,n=!0,r=!0){return(n?Nr:Pr)(e,t,r)}function Nr(e,t,n){if(t==e.length)return t;t&&Ir(e.charCodeAt(t))&&Lr(e.charCodeAt(t-1))&&t--;let r=Fr(e,t);for(t+=Rr(r);t<e.length;){let i=Fr(e,t);if(r==jr||i==jr||n&&kr(i))t+=Rr(i),r=i;else if(Ar(i)){let n=0,r=t-2;for(;r>=0&&Ar(Fr(e,r));)n++,r-=2;if(n%2==0)break;t+=2}else break}return t}function Pr(e,t,n){for(;t>0;){let r=Nr(e,t-2,n);if(r<t)return r;t--}return 0}function Fr(e,t){let n=e.charCodeAt(t);if(!Lr(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return Ir(r)?(n-55296<<10)+(r-56320)+65536:n}function Ir(e){return e>=56320&&e<57344}function Lr(e){return e>=55296&&e<56320}function Rr(e){return e<65536?1:2}var j=class e{lineAt(e){if(e<0||e>this.length)throw RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=Jr(this,e,t);let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),Br.from(r,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=Jr(this,e,t);let n=[];return this.decompose(e,t,n,0),Br.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new Wr(this),i=new Wr(e);for(let e=t,a=t;;){if(r.next(e),i.next(e),e=0,r.lineBreak!=i.lineBreak||r.done!=i.done||r.value!=i.value)return!1;if(a+=r.value.length,r.done||a>=n)return!0}}iter(e=1){return new Wr(this,e)}iterRange(e,t=this.length){return new Gr(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t??=this.lines+1;let r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Kr(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(t){if(t.length==0)throw RangeError(`A document must have at least one line`);return t.length==1&&!t[0]?e.empty:t.length<=32?new zr(t):Br.from(zr.split(t,[]))}},zr=class e extends j{constructor(e,t=Vr(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,r){for(let i=0;;i++){let a=this.text[i],o=r+a.length;if((t?n:o)>=e)return new qr(r,o,n,a);r=o+1,n++}}decompose(t,n,r,i){let a=t<=0&&n>=this.length?this:new e(Ur(this.text,t,n),Math.min(n,this.length)-Math.max(0,t));if(i&1){let t=r.pop(),n=Hr(a.text,t.text.slice(),0,a.length);if(n.length<=32)r.push(new e(n,t.length+a.length));else{let t=n.length>>1;r.push(new e(n.slice(0,t)),new e(n.slice(t)))}}else r.push(a)}replace(t,n,r){if(!(r instanceof e))return super.replace(t,n,r);[t,n]=Jr(this,t,n);let i=Hr(this.text,Hr(r.text,Ur(this.text,0,t)),n),a=this.length+r.length-(n-t);return i.length<=32?new e(i,a):Br.from(e.split(i,[]),a)}sliceString(e,t=this.length,n=`
|
|
2
|
+
`){[e,t]=Jr(this,e,t);let r=``;for(let i=0,a=0;i<=t&&a<this.text.length;a++){let o=this.text[a],s=i+o.length;i>e&&a&&(r+=n),e<s&&t>i&&(r+=o.slice(Math.max(0,e-i),t-i)),i=s+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(t,n){let r=[],i=-1;for(let a of t)r.push(a),i+=a.length+1,r.length==32&&(n.push(new e(r,i)),r=[],i=-1);return i>-1&&n.push(new e(r,i)),n}},Br=class e extends j{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let t of e)this.lines+=t.lines}lineInner(e,t,n,r){for(let i=0;;i++){let a=this.children[i],o=r+a.length,s=n+a.lines-1;if((t?s:o)>=e)return a.lineInner(e,t,n,r);r=o+1,n=s+1}}decompose(e,t,n,r){for(let i=0,a=0;a<=t&&i<this.children.length;i++){let o=this.children[i],s=a+o.length;if(e<=s&&t>=a){let i=r&((a<=e?1:0)|(s>=t?2:0));a>=e&&s<=t&&!i?n.push(o):o.decompose(e-a,t-a,n,i)}a=s+1}}replace(t,n,r){if([t,n]=Jr(this,t,n),r.lines<this.lines)for(let i=0,a=0;i<this.children.length;i++){let o=this.children[i],s=a+o.length;if(t>=a&&n<=s){let c=o.replace(t-a,n-a,r),l=this.lines-o.lines+c.lines;if(c.lines<l>>4&&c.lines>l>>6){let a=this.children.slice();return a[i]=c,new e(a,this.length-(n-t)+r.length)}return super.replace(a,s,c)}a=s+1}return super.replace(t,n,r)}sliceString(e,t=this.length,n=`
|
|
3
|
+
`){[e,t]=Jr(this,e,t);let r=``;for(let i=0,a=0;i<this.children.length&&a<=t;i++){let o=this.children[i],s=a+o.length;a>e&&i&&(r+=n),e<s&&t>a&&(r+=o.sliceString(e-a,t-a,n)),a=s+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(t,n){if(!(t instanceof e))return 0;let r=0,[i,a,o,s]=n>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;i+=n,a+=n){if(i==o||a==s)return r;let e=this.children[i],c=t.children[a];if(e!=c)return r+e.scanIdentical(c,n);r+=e.length+1}}static from(t,n=t.reduce((e,t)=>e+t.length+1,-1)){let r=0;for(let e of t)r+=e.lines;if(r<32){let e=[];for(let n of t)n.flatten(e);return new zr(e,n)}let i=Math.max(32,r>>5),a=i<<1,o=i>>1,s=[],c=0,l=-1,u=[];function d(t){let n;if(t.lines>a&&t instanceof e)for(let e of t.children)d(e);else t.lines>o&&(c>o||!c)?(f(),s.push(t)):t instanceof zr&&c&&(n=u[u.length-1])instanceof zr&&t.lines+n.lines<=32?(c+=t.lines,l+=t.length+1,u[u.length-1]=new zr(n.text.concat(t.text),n.length+1+t.length)):(c+t.lines>i&&f(),c+=t.lines,l+=t.length+1,u.push(t))}function f(){c!=0&&(s.push(u.length==1?u[0]:e.from(u,l)),l=-1,c=u.length=0)}for(let e of t)d(e);return f(),s.length==1?s[0]:new e(s,n)}};j.empty=new zr([``],0);function Vr(e){let t=-1;for(let n of e)t+=n.length+1;return t}function Hr(e,t,n=0,r=1e9){for(let i=0,a=0,o=!0;a<e.length&&i<=r;a++){let s=e[a],c=i+s.length;c>=n&&(c>r&&(s=s.slice(0,r-i)),i<n&&(s=s.slice(n-i)),o?(t[t.length-1]+=s,o=!1):t.push(s)),i=c+1}return t}function Ur(e,t,n){return Hr(e,[``],t,n)}var Wr=class{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value=``,this.nodes=[e],this.offsets=[t>0?1:(e instanceof zr?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,r=this.nodes[n],i=this.offsets[n],a=i>>1,o=r instanceof zr?r.text.length:r.children.length;if(a==(t>0?o:0)){if(n==0)return this.done=!0,this.value=``,this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((i&1)==(t>0?0:1)){if(this.offsets[n]+=t,e==0)return this.lineBreak=!0,this.value=`
|
|
4
|
+
`,this;e--}else if(r instanceof zr){let i=r.text[a+(t<0?-1:0)];if(this.offsets[n]+=t,i.length>Math.max(0,e))return this.value=e==0?i:t>0?i.slice(e):i.slice(0,i.length-e),this;e-=i.length}else{let i=r.children[a+(t<0?-1:0)];e>i.length?(e-=i.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(i),this.offsets.push(t>0?1:(i instanceof zr?i.text.length:i.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}},Gr=class{constructor(e,t,n){this.value=``,this.done=!1,this.cursor=new Wr(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value=``,this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=n?r:t<0?r.slice(r.length-n):r.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=``}},Kr=class{constructor(e){this.inner=e,this.afterBreak=!0,this.value=``,this.done=!1}next(e=0){let{done:t,lineBreak:n,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value=``,this.afterBreak=!1):t?(this.done=!0,this.value=``):n?this.afterBreak?this.value=``:(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}};typeof Symbol<`u`&&(j.prototype[Symbol.iterator]=function(){return this.iter()},Wr.prototype[Symbol.iterator]=Gr.prototype[Symbol.iterator]=Kr.prototype[Symbol.iterator]=function(){return this});var qr=class{constructor(e,t,n,r){this.from=e,this.to=t,this.number=n,this.text=r}get length(){return this.to-this.from}};function Jr(e,t,n){return t=Math.max(0,Math.min(e.length,t)),[t,Math.max(t,Math.min(e.length,n))]}function Yr(e,t,n=!0,r=!0){return Mr(e,t,n,r)}function Xr(e){return e>=56320&&e<57344}function Zr(e){return e>=55296&&e<56320}function Qr(e,t){let n=e.charCodeAt(t);if(!Zr(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return Xr(r)?(n-55296<<10)+(r-56320)+65536:n}function $r(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}function ei(e){return e<65536?1:2}var ti=/\r\n?|\n/,ni=(function(e){return e[e.Simple=0]=`Simple`,e[e.TrackDel=1]=`TrackDel`,e[e.TrackBefore=2]=`TrackBefore`,e[e.TrackAfter=3]=`TrackAfter`,e})(ni||={}),ri=class e{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t+1];e+=n<0?this.sections[t]:n}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,n=0,r=0;t<this.sections.length;){let i=this.sections[t++],a=this.sections[t++];a<0?(e(n,r,i),r+=i):r+=a,n+=i}}iterChangedRanges(e,t=!1){si(this,e,t)}get invertedDesc(){let t=[];for(let e=0;e<this.sections.length;){let n=this.sections[e++],r=this.sections[e++];r<0?t.push(n,r):t.push(r,n)}return new e(t)}composeDesc(e){return this.empty?e:e.empty?this:li(this,e)}mapDesc(e,t=!1){return e.empty?this:ci(this,e,t)}mapPos(e,t=-1,n=ni.Simple){let r=0,i=0;for(let a=0;a<this.sections.length;){let o=this.sections[a++],s=this.sections[a++],c=r+o;if(s<0){if(c>e)return i+(e-r);i+=o}else{if(n!=ni.Simple&&c>=e&&(n==ni.TrackDel&&r<e&&c>e||n==ni.TrackBefore&&r<e||n==ni.TrackAfter&&c>e))return null;if(c>e||c==e&&t<0&&!o)return e==r||t<0?i:i+s;i+=s}r=c}if(e>r)throw RangeError(`Position ${e} is out of range for changeset of length ${r}`);return i}touchesRange(e,t=e){for(let n=0,r=0;n<this.sections.length&&r<=t;){let i=this.sections[n++],a=this.sections[n++],o=r+i;if(a>=0&&r<=t&&o>=e)return r<e&&o>t?`cover`:!0;r=o}return!1}toString(){let e=``;for(let t=0;t<this.sections.length;){let n=this.sections[t++],r=this.sections[t++];e+=(e?` `:``)+n+(r>=0?`:`+r:``)}return e}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(e=>typeof e!=`number`))throw RangeError(`Invalid JSON representation of ChangeDesc`);return new e(t)}static create(t){return new e(t)}},ii=class e extends ri{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw RangeError(`Applying change set to a document with the wrong length`);return si(this,(t,n,r,i,a)=>e=e.replace(r,r+(n-t),a),!1),e}mapDesc(e,t=!1){return ci(this,e,t,!0)}invert(t){let n=this.sections.slice(),r=[];for(let e=0,i=0;e<n.length;e+=2){let a=n[e],o=n[e+1];if(o>=0){n[e]=o,n[e+1]=a;let s=e>>1;for(;r.length<s;)r.push(j.empty);r.push(a?t.slice(i,i+a):j.empty)}i+=a}return new e(n,r)}compose(e){return this.empty?e:e.empty?this:li(this,e,!0)}map(e,t=!1){return e.empty?this:ci(this,e,t,!0)}iterChanges(e,t=!1){si(this,e,t)}get desc(){return ri.create(this.sections)}filter(t){let n=[],r=[],i=[],a=new ui(this);done:for(let e=0,o=0;;){let s=e==t.length?1e9:t[e++];for(;o<s||o==s&&a.len==0;){if(a.done)break done;let e=Math.min(a.len,s-o);ai(i,e,-1);let t=a.ins==-1?-1:a.off==0?a.ins:0;ai(n,e,t),t>0&&oi(r,n,a.text),a.forward(e),o+=e}let c=t[e++];for(;o<c;){if(a.done)break done;let e=Math.min(a.len,c-o);ai(n,e,-1),ai(i,e,a.ins==-1?-1:a.off==0?a.ins:0),a.forward(e),o+=e}}return{changes:new e(n,r),filtered:ri.create(i)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t],r=this.sections[t+1];r<0?e.push(n):r==0?e.push([n]):e.push([n].concat(this.inserted[t>>1].toJSON()))}return e}static of(t,n,r){let i=[],a=[],o=0,s=null;function c(t=!1){if(!t&&!i.length)return;o<n&&ai(i,n-o,-1);let r=new e(i,a);s=s?s.compose(r.map(s)):r,i=[],a=[],o=0}function l(t){if(Array.isArray(t))for(let e of t)l(e);else if(t instanceof e){if(t.length!=n)throw RangeError(`Mismatched change set length (got ${t.length}, expected ${n})`);c(),s=s?s.compose(t.map(s)):t}else{let{from:e,to:s=e,insert:l}=t;if(e>s||e<0||s>n)throw RangeError(`Invalid change range ${e} to ${s} (in doc of length ${n})`);let u=l?typeof l==`string`?j.of(l.split(r||ti)):l:j.empty,d=u.length;if(e==s&&d==0)return;e<o&&c(),e>o&&ai(i,e-o,-1),ai(i,s-e,d),oi(a,i,u),o=s}}return l(t),c(!s),s}static empty(t){return new e(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw RangeError(`Invalid JSON representation of ChangeSet`);let n=[],r=[];for(let e=0;e<t.length;e++){let i=t[e];if(typeof i==`number`)n.push(i,-1);else if(!Array.isArray(i)||typeof i[0]!=`number`||i.some((e,t)=>t&&typeof e!=`string`))throw RangeError(`Invalid JSON representation of ChangeSet`);else if(i.length==1)n.push(i[0],0);else{for(;r.length<e;)r.push(j.empty);r[e]=j.of(i.slice(1)),n.push(i[0],r[e].length)}}return new e(n,r)}static createSet(t,n){return new e(t,n)}};function ai(e,t,n,r=!1){if(t==0&&n<=0)return;let i=e.length-2;i>=0&&n<=0&&n==e[i+1]?e[i]+=t:i>=0&&t==0&&e[i]==0?e[i+1]+=n:r?(e[i]+=t,e[i+1]+=n):e.push(t,n)}function oi(e,t,n){if(n.length==0)return;let r=t.length-2>>1;if(r<e.length)e[e.length-1]=e[e.length-1].append(n);else{for(;e.length<r;)e.push(j.empty);e.push(n)}}function si(e,t,n){let r=e.inserted;for(let i=0,a=0,o=0;o<e.sections.length;){let s=e.sections[o++],c=e.sections[o++];if(c<0)i+=s,a+=s;else{let l=i,u=a,d=j.empty;for(;l+=s,u+=c,c&&r&&(d=d.append(r[o-2>>1])),!(n||o==e.sections.length||e.sections[o+1]<0);)s=e.sections[o++],c=e.sections[o++];t(i,l,a,u,d),i=l,a=u}}}function ci(e,t,n,r=!1){let i=[],a=r?[]:null,o=new ui(e),s=new ui(t);for(let e=-1;;)if(o.done&&s.len||s.done&&o.len)throw Error(`Mismatched change set lengths`);else if(o.ins==-1&&s.ins==-1){let e=Math.min(o.len,s.len);ai(i,e,-1),o.forward(e),s.forward(e)}else if(s.ins>=0&&(o.ins<0||e==o.i||o.off==0&&(s.len<o.len||s.len==o.len&&!n))){let t=s.len;for(ai(i,s.ins,-1);t;){let n=Math.min(o.len,t);o.ins>=0&&e<o.i&&o.len<=n&&(ai(i,0,o.ins),a&&oi(a,i,o.text),e=o.i),o.forward(n),t-=n}s.next()}else if(o.ins>=0){let t=0,n=o.len;for(;n;)if(s.ins==-1){let e=Math.min(n,s.len);t+=e,n-=e,s.forward(e)}else if(s.ins==0&&s.len<n)n-=s.len,s.next();else break;ai(i,t,e<o.i?o.ins:0),a&&e<o.i&&oi(a,i,o.text),e=o.i,o.forward(o.len-n)}else if(o.done&&s.done)return a?ii.createSet(i,a):ri.create(i);else throw Error(`Mismatched change set lengths`)}function li(e,t,n=!1){let r=[],i=n?[]:null,a=new ui(e),o=new ui(t);for(let e=!1;;)if(a.done&&o.done)return i?ii.createSet(r,i):ri.create(r);else if(a.ins==0)ai(r,a.len,0,e),a.next();else if(o.len==0&&!o.done)ai(r,0,o.ins,e),i&&oi(i,r,o.text),o.next();else if(a.done||o.done)throw Error(`Mismatched change set lengths`);else{let t=Math.min(a.len2,o.len),n=r.length;if(a.ins==-1){let n=o.ins==-1?-1:o.off?0:o.ins;ai(r,t,n,e),i&&n&&oi(i,r,o.text)}else o.ins==-1?(ai(r,a.off?0:a.len,t,e),i&&oi(i,r,a.textBit(t))):(ai(r,a.off?0:a.len,o.off?0:o.ins,e),i&&!o.off&&oi(i,r,o.text));e=(a.ins>t||o.ins>=0&&o.len>t)&&(e||r.length>n),a.forward2(t),o.forward(t)}}var ui=class{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?j.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?j.empty:t[n].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}},di=class e{constructor(e,t,n){this.from=e,this.to=t,this.flags=n}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(t,n=-1){let r,i;return this.empty?r=i=t.mapPos(this.from,n):(r=t.mapPos(this.from,1),i=t.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new e(r,i,this.flags)}extend(e,t=e,n=0){if(e<=this.anchor&&t>=this.anchor)return M.range(e,t,void 0,void 0,n);let r=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return M.range(this.anchor,r,void 0,void 0,n)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!=`number`||typeof e.head!=`number`)throw RangeError(`Invalid JSON representation for SelectionRange`);return M.range(e.anchor,e.head)}static create(t,n,r){return new e(t,n,r)}},M=class e{constructor(e,t){this.ranges=e,this.mainIndex=t}map(t,n=-1){return t.empty?this:e.create(this.ranges.map(e=>e.map(t,n)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;n<this.ranges.length;n++)if(!this.ranges[n].eq(e.ranges[n],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new e([this.main],0)}addRange(t,n=!0){return e.create([t].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(t,n=this.mainIndex){let r=this.ranges.slice();return r[n]=t,e.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||typeof t.main!=`number`||t.main>=t.ranges.length)throw RangeError(`Invalid JSON representation for EditorSelection`);return new e(t.ranges.map(e=>di.fromJSON(e)),t.main)}static single(t,n=t){return new e([e.range(t,n)],0)}static create(t,n=0){if(t.length==0)throw RangeError(`A selection needs at least one range`);for(let r=0,i=0;i<t.length;i++){let a=t[i];if(a.empty?a.from<=r:a.from<r)return e.normalized(t.slice(),n);r=a.to}return new e(t,n)}static cursor(e,t=0,n,r){return di.create(e,e,(t==0?0:t<0?8:16)|(n==null?7:Math.min(6,n))|(r??16777215)<<6)}static range(e,t,n,r,i){let a=(n??16777215)<<6|(r==null?7:Math.min(6,r));return!i&&e!=t&&(i=t<e?1:-1),t<e?di.create(t,e,48|a):di.create(e,t,(i?i<0?8:16:0)|a)}static normalized(t,n=0){let r=t[n];t.sort((e,t)=>e.from-t.from),n=t.indexOf(r);for(let r=1;r<t.length;r++){let i=t[r],a=t[r-1];if(i.empty?i.from<=a.to:i.from<a.to){let o=a.from,s=Math.max(i.to,a.to);r<=n&&n--,t.splice(--r,2,i.anchor>i.head?e.range(s,o):e.range(o,s))}}return new e(t,n)}};function fi(e,t){for(let n of e.ranges)if(n.to>t)throw RangeError(`Selection points outside of document`)}var pi=0,N=class e{constructor(e,t,n,r,i){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=r,this.id=pi++,this.default=e([]),this.extensions=typeof i==`function`?i(this):i}get reader(){return this}static define(t={}){return new e(t.combine||(e=>e),t.compareInput||((e,t)=>e===t),t.compare||(t.combine?(e,t)=>e===t:mi),!!t.static,t.enables)}of(e){return new hi([],this,0,e)}compute(e,t){if(this.isStatic)throw Error(`Can't compute a static facet`);return new hi(e,this,1,t)}computeN(e,t){if(this.isStatic)throw Error(`Can't compute a static facet`);return new hi(e,this,2,t)}from(e,t){return t||=e=>e,this.compute([e],n=>t(n.field(e)))}};function mi(e,t){return e==t||e.length==t.length&&e.every((e,n)=>e===t[n])}var hi=class{constructor(e,t,n,r){this.dependencies=e,this.facet=t,this.type=n,this.value=r,this.id=pi++}dynamicSlot(e){let t=this.value,n=this.facet.compareInput,r=this.id,i=e[r]>>1,a=this.type==2,o=!1,s=!1,c=[];for(let t of this.dependencies)t==`doc`?o=!0:t==`selection`?s=!0:(e[t.id]??1)&1||c.push(e[t.id]);return{create(e){return e.values[i]=t(e),1},update(e,r){if(o&&r.docChanged||s&&(r.docChanged||r.selection)||_i(e,c)){let r=t(e);if(a?!gi(r,e.values[i],n):!n(r,e.values[i]))return e.values[i]=r,1}return 0},reconfigure:(e,o)=>{let s,c=o.config.address[r];if(c!=null){let r=Ai(o,c);if(this.dependencies.every(t=>t instanceof N?o.facet(t)===e.facet(t):t instanceof bi?o.field(t,!1)==e.field(t,!1):!0)||(a?gi(s=t(e),r,n):n(s=t(e),r)))return e.values[i]=r,0}else s=t(e);return e.values[i]=s,1}}}};function gi(e,t,n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!n(e[r],t[r]))return!1;return!0}function _i(e,t){let n=!1;for(let r of t)ki(e,r)&1&&(n=!0);return n}function vi(e,t,n){let r=n.map(t=>e[t.id]),i=n.map(e=>e.type),a=r.filter(e=>!(e&1)),o=e[t.id]>>1;function s(e){let n=[];for(let t=0;t<r.length;t++){let a=Ai(e,r[t]);if(i[t]==2)for(let e of a)n.push(e);else n.push(a)}return t.combine(n)}return{create(e){for(let t of r)ki(e,t);return e.values[o]=s(e),1},update(e,n){if(!_i(e,a))return 0;let r=s(e);return t.compare(r,e.values[o])?0:(e.values[o]=r,1)},reconfigure(e,i){let a=_i(e,r),c=i.config.facets[t.id],l=i.facet(t);if(c&&!a&&mi(n,c))return e.values[o]=l,0;let u=s(e);return t.compare(u,l)?(e.values[o]=l,0):(e.values[o]=u,1)}}}var yi=N.define({static:!0}),bi=class e{constructor(e,t,n,r,i){this.id=e,this.createF=t,this.updateF=n,this.compareF=r,this.spec=i,this.provides=void 0}static define(t){let n=new e(pi++,t.create,t.update,t.compare||((e,t)=>e===t),t);return t.provide&&(n.provides=t.provide(n)),n}create(e){return(e.facet(yi).find(e=>e.field==this)?.create||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:e=>(e.values[t]=this.create(e),1),update:(e,n)=>{let r=e.values[t],i=this.updateF(r,n);return this.compareF(r,i)?0:(e.values[t]=i,1)},reconfigure:(e,n)=>{let r=e.facet(yi),i=n.facet(yi),a;return(a=r.find(e=>e.field==this))&&a!=i.find(e=>e.field==this)?(e.values[t]=a.create(e),1):n.config.address[this.id]==null?(e.values[t]=this.create(e),1):(e.values[t]=n.field(this),0)}}}init(e){return[this,yi.of({field:this,create:e})]}get extension(){return this}},xi={lowest:4,low:3,default:2,high:1,highest:0};function Si(e){return t=>new wi(t,e)}var Ci={highest:Si(xi.highest),high:Si(xi.high),default:Si(xi.default),low:Si(xi.low),lowest:Si(xi.lowest)},wi=class{constructor(e,t){this.inner=e,this.prec=t}},Ti=class e{of(e){return new Ei(this,e)}reconfigure(t){return e.reconfigure.of({compartment:this,extension:t})}get(e){return e.config.compartments.get(this)}},Ei=class{constructor(e,t){this.compartment=e,this.inner=t}},Di=class e{constructor(e,t,n,r,i,a){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=r,this.staticValues=i,this.facets=a,this.statusTemplate=[];this.statusTemplate.length<n.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(t,n,r){let i=[],a=Object.create(null),o=new Map;for(let e of Oi(t,n,o))e instanceof bi?i.push(e):(a[e.facet.id]||(a[e.facet.id]=[])).push(e);let s=Object.create(null),c=[],l=[];for(let e of i)s[e.id]=l.length<<1,l.push(t=>e.slot(t));let u=r?.config.facets;for(let e in a){let t=a[e],n=t[0].facet,i=u&&u[e]||[];if(t.every(e=>e.type==0))if(s[n.id]=c.length<<1|1,mi(i,t))c.push(r.facet(n));else{let e=n.combine(t.map(e=>e.value));c.push(r&&n.compare(e,r.facet(n))?r.facet(n):e)}else{for(let e of t)e.type==0?(s[e.id]=c.length<<1|1,c.push(e.value)):(s[e.id]=l.length<<1,l.push(t=>e.dynamicSlot(t)));s[n.id]=l.length<<1,l.push(e=>vi(e,n,t))}}return new e(t,o,l.map(e=>e(s)),s,c,a)}};function Oi(e,t,n){let r=[[],[],[],[],[]],i=new Map;function a(e,o){let s=i.get(e);if(s!=null){if(s<=o)return;let t=r[s].indexOf(e);t>-1&&r[s].splice(t,1),e instanceof Ei&&n.delete(e.compartment)}if(i.set(e,o),Array.isArray(e))for(let t of e)a(t,o);else if(e instanceof Ei){if(n.has(e.compartment))throw RangeError(`Duplicate use of compartment in extensions`);let r=t.get(e.compartment)||e.inner;n.set(e.compartment,r),a(r,o)}else if(e instanceof wi)a(e.inner,e.prec);else if(e instanceof bi)r[o].push(e),e.provides&&a(e.provides,o);else if(e instanceof hi)r[o].push(e),e.facet.extensions&&a(e.facet.extensions,xi.default);else{let t=e.extension;if(!t)throw Error(`Unrecognized extension value in extension set (${e}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);a(t,o)}}return a(e,xi.default),r.reduce((e,t)=>e.concat(t))}function ki(e,t){if(t&1)return 2;let n=t>>1,r=e.status[n];if(r==4)throw Error(`Cyclic dependency between fields and/or facets`);if(r&2)return r;e.status[n]=4;let i=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|i}function Ai(e,t){return t&1?e.config.staticValues[t>>1]:e.values[t>>1]}var ji=N.define(),Mi=N.define({combine:e=>e.some(e=>e),static:!0}),Ni=N.define({combine:e=>e.length?e[0]:void 0,static:!0}),Pi=N.define(),Fi=N.define(),Ii=N.define(),Li=N.define({combine:e=>e.length?e[0]:!1}),Ri=class{constructor(e,t){this.type=e,this.value=t}static define(){return new zi}},zi=class{of(e){return new Ri(this,e)}},Bi=class{constructor(e){this.map=e}of(e){return new P(this,e)}},P=class e{constructor(e,t){this.type=e,this.value=t}map(t){let n=this.type.map(this.value,t);return n===void 0?void 0:n==this.value?this:new e(this.type,n)}is(e){return this.type==e}static define(e={}){return new Bi(e.map||(e=>e))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let r of e){let e=r.map(t);e&&n.push(e)}return n}};P.reconfigure=P.define(),P.appendConfig=P.define();var Vi=class e{constructor(t,n,r,i,a,o){this.startState=t,this.changes=n,this.selection=r,this.effects=i,this.annotations=a,this.scrollIntoView=o,this._doc=null,this._state=null,r&&fi(r,n.newLength),a.some(t=>t.type==e.time)||(this.annotations=a.concat(e.time.of(Date.now())))}static create(t,n,r,i,a,o){return new e(t,n,r,i,a,o)}get newDoc(){return this._doc||=this.changes.apply(this.startState.doc)}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let n=this.annotation(e.userEvent);return!!(n&&(n==t||n.length>t.length&&n.slice(0,t.length)==t&&n[t.length]==`.`))}};Vi.time=Ri.define(),Vi.userEvent=Ri.define(),Vi.addToHistory=Ri.define(),Vi.remote=Ri.define();function Hi(e,t){let n=[];for(let r=0,i=0;;){let a,o;if(r<e.length&&(i==t.length||t[i]>=e[r]))a=e[r++],o=e[r++];else if(i<t.length)a=t[i++],o=t[i++];else return n;!n.length||n[n.length-1]<a?n.push(a,o):n[n.length-1]<o&&(n[n.length-1]=o)}}function Ui(e,t,n){let r,i,a;return n?(r=t.changes,i=ii.empty(t.changes.length),a=e.changes.compose(t.changes)):(r=t.changes.map(e.changes),i=e.changes.mapDesc(t.changes,!0),a=e.changes.compose(r)),{changes:a,selection:t.selection?t.selection.map(i):e.selection?.map(r),effects:P.mapEffects(e.effects,r).concat(P.mapEffects(t.effects,i)),annotations:e.annotations.length?e.annotations.concat(t.annotations):t.annotations,scrollIntoView:e.scrollIntoView||t.scrollIntoView}}function Wi(e,t,n){let r=t.selection,i=Yi(t.annotations);return t.userEvent&&(i=i.concat(Vi.userEvent.of(t.userEvent))),{changes:t.changes instanceof ii?t.changes:ii.of(t.changes||[],n,e.facet(Ni)),selection:r&&(r instanceof M?r:M.single(r.anchor,r.head)),effects:Yi(t.effects),annotations:i,scrollIntoView:!!t.scrollIntoView}}function Gi(e,t,n){let r=Wi(e,t.length?t[0]:{},e.doc.length);t.length&&t[0].filter===!1&&(n=!1);for(let i=1;i<t.length;i++){t[i].filter===!1&&(n=!1);let a=!!t[i].sequential;r=Ui(r,Wi(e,t[i],a?r.changes.newLength:e.doc.length),a)}let i=Vi.create(e,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return qi(n?Ki(i):i)}function Ki(e){let t=e.startState,n=!0;for(let r of t.facet(Pi)){let t=r(e);if(t===!1){n=!1;break}Array.isArray(t)&&(n=n===!0?t:Hi(n,t))}if(n!==!0){let r,i;if(n===!1)i=e.changes.invertedDesc,r=ii.empty(t.doc.length);else{let t=e.changes.filter(n);r=t.changes,i=t.filtered.mapDesc(t.changes).invertedDesc}e=Vi.create(t,r,e.selection&&e.selection.map(i),P.mapEffects(e.effects,i),e.annotations,e.scrollIntoView)}let r=t.facet(Fi);for(let n=r.length-1;n>=0;n--){let i=r[n](e);e=i instanceof Vi?i:Array.isArray(i)&&i.length==1&&i[0]instanceof Vi?i[0]:Gi(t,Yi(i),!1)}return e}function qi(e){let t=e.startState,n=t.facet(Ii),r=e;for(let i=n.length-1;i>=0;i--){let a=n[i](e);a&&Object.keys(a).length&&(r=Ui(r,Wi(t,a,e.changes.newLength),!0))}return r==e?e:Vi.create(t,e.changes,e.selection,r.effects,r.annotations,r.scrollIntoView)}var Ji=[];function Yi(e){return e==null?Ji:Array.isArray(e)?e:[e]}var F=(function(e){return e[e.Word=0]=`Word`,e[e.Space=1]=`Space`,e[e.Other=2]=`Other`,e})(F||={}),Xi=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Zi;try{Zi=RegExp(`[\\p{Alphabetic}\\p{Number}_]`,`u`)}catch{}function Qi(e){if(Zi)return Zi.test(e);for(let t=0;t<e.length;t++){let n=e[t];if(/\w/.test(n)||n>``&&(n.toUpperCase()!=n.toLowerCase()||Xi.test(n)))return!0}return!1}function $i(e){return t=>{if(!/\S/.test(t))return F.Space;if(Qi(t))return F.Word;for(let n=0;n<e.length;n++)if(t.indexOf(e[n])>-1)return F.Word;return F.Other}}var I=class e{constructor(e,t,n,r,i,a){this.config=e,this.doc=t,this.selection=n,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=i,a&&(a._state=this);for(let e=0;e<this.config.dynamicSlots.length;e++)ki(this,e<<1);this.computeSlot=null}field(e,t=!0){let n=this.config.address[e.id];if(n==null){if(t)throw RangeError(`Field is not present in this state`);return}return ki(this,n),Ai(this,n)}update(...e){return Gi(this,e,!0)}applyTransaction(t){let n=this.config,{base:r,compartments:i}=n;for(let e of t.effects)e.is(Ti.reconfigure)?(n&&=(i=new Map,n.compartments.forEach((e,t)=>i.set(t,e)),null),i.set(e.value.compartment,e.value.extension)):e.is(P.reconfigure)?(n=null,r=e.value):e.is(P.appendConfig)&&(n=null,r=Yi(r).concat(e.value));let a;n?a=t.startState.values.slice():(n=Di.resolve(r,i,this),a=new e(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(e,t)=>t.reconfigure(e,this),null).values);let o=t.startState.facet(Mi)?t.newSelection:t.newSelection.asSingle();new e(n,t.newDoc,o,a,(e,n)=>n.update(e,t),t)}replaceSelection(e){return typeof e==`string`&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:M.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),r=this.changes(n.changes),i=[n.range],a=Yi(n.effects);for(let n=1;n<t.ranges.length;n++){let o=e(t.ranges[n]),s=this.changes(o.changes),c=s.map(r);for(let e=0;e<n;e++)i[e]=i[e].map(c);let l=r.mapDesc(s,!0);i.push(o.range.map(l)),r=r.compose(c),a=P.mapEffects(a,c).concat(P.mapEffects(Yi(o.effects),l))}return{changes:r,selection:M.create(i,t.mainIndex),effects:a}}changes(t=[]){return t instanceof ii?t:ii.of(t,this.doc.length,this.facet(e.lineSeparator))}toText(t){return j.of(t.split(this.facet(e.lineSeparator)||ti))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(ki(this,t),Ai(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let n in e){let r=e[n];r instanceof bi&&this.config.address[r.id]!=null&&(t[n]=r.spec.toJSON(this.field(e[n]),this))}return t}static fromJSON(t,n={},r){if(!t||typeof t.doc!=`string`)throw RangeError(`Invalid JSON representation for EditorState`);let i=[];if(r){for(let e in r)if(Object.prototype.hasOwnProperty.call(t,e)){let n=r[e],a=t[e];i.push(n.init(e=>n.spec.fromJSON(a,e)))}}return e.create({doc:t.doc,selection:M.fromJSON(t.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(t={}){let n=Di.resolve(t.extensions||[],new Map),r=t.doc instanceof j?t.doc:j.of((t.doc||``).split(n.staticFacet(e.lineSeparator)||ti)),i=t.selection?t.selection instanceof M?t.selection:M.single(t.selection.anchor,t.selection.head):M.single(0);return fi(i,r.length),n.staticFacet(Mi)||(i=i.asSingle()),new e(n,r,i,n.dynamicSlots.map(()=>null),(e,t)=>t.create(e),null)}get tabSize(){return this.facet(e.tabSize)}get lineBreak(){return this.facet(e.lineSeparator)||`
|
|
5
|
+
`}get readOnly(){return this.facet(Li)}phrase(t,...n){for(let n of this.facet(e.phrases))if(Object.prototype.hasOwnProperty.call(n,t)){t=n[t];break}return n.length&&(t=t.replace(/\$(\$|\d*)/g,(e,t)=>{if(t==`$`)return`$`;let r=+(t||1);return!r||r>n.length?e:n[r-1]})),t}languageDataAt(e,t,n=-1){let r=[];for(let i of this.facet(ji))for(let a of i(this,t,n))Object.prototype.hasOwnProperty.call(a,e)&&r.push(a[e]);return r}charCategorizer(e){let t=this.languageDataAt(`wordChars`,e);return $i(t.length?t[0]:``)}wordAt(e){let{text:t,from:n,length:r}=this.doc.lineAt(e),i=this.charCategorizer(e),a=e-n,o=e-n;for(;a>0;){let e=Yr(t,a,!1);if(i(t.slice(e,a))!=F.Word)break;a=e}for(;o<r;){let e=Yr(t,o);if(i(t.slice(o,e))!=F.Word)break;o=e}return a==o?null:M.range(a+n,o+n)}};I.allowMultipleSelections=Mi,I.tabSize=N.define({combine:e=>e.length?e[0]:4}),I.lineSeparator=Ni,I.readOnly=Li,I.phrases=N.define({compare(e,t){let n=Object.keys(e),r=Object.keys(t);return n.length==r.length&&n.every(n=>e[n]==t[n])}}),I.languageData=ji,I.changeFilter=Pi,I.transactionFilter=Fi,I.transactionExtender=Ii,Ti.reconfigure=P.define();function ea(e,t,n={}){let r={};for(let t of e)for(let e of Object.keys(t)){let i=t[e],a=r[e];if(a===void 0)r[e]=i;else if(!(a===i||i===void 0))if(Object.hasOwnProperty.call(n,e))r[e]=n[e](a,i);else throw Error(`Config merge conflict for field `+e)}for(let e in t)r[e]===void 0&&(r[e]=t[e]);return r}var ta=class{eq(e){return this==e}range(e,t=e){return ra.create(e,t,this)}};ta.prototype.startSide=ta.prototype.endSide=0,ta.prototype.point=!1,ta.prototype.mapMode=ni.TrackDel;function na(e,t){return e==t||e.constructor==t.constructor&&e.eq(t)}var ra=class e{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(t,n,r){return new e(t,n,r)}};function ia(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}var aa=class e{constructor(e,t,n,r){this.from=e,this.to=t,this.value=n,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,r=0){let i=n?this.to:this.from;for(let a=r,o=i.length;;){if(a==o)return a;let r=a+o>>1,s=i[r]-e||(n?this.value[r].endSide:this.value[r].startSide)-t;if(r==a)return s>=0?a:o;s>=0?o=r:a=r+1}}between(e,t,n,r){for(let i=this.findIndex(t,-1e9,!0),a=this.findIndex(n,1e9,!1,i);i<a;i++)if(r(this.from[i]+e,this.to[i]+e,this.value[i])===!1)return!1}map(t,n){let r=[],i=[],a=[],o=-1,s=-1;for(let e=0;e<this.value.length;e++){let c=this.value[e],l=this.from[e]+t,u=this.to[e]+t,d,f;if(l==u){let e=n.mapPos(l,c.startSide,c.mapMode);if(e==null||(d=f=e,c.startSide!=c.endSide&&(f=n.mapPos(l,c.endSide),f<d)))continue}else if(d=n.mapPos(l,c.startSide),f=n.mapPos(u,c.endSide),d>f||d==f&&c.startSide>0&&c.endSide<=0)continue;(f-d||c.endSide-c.startSide)<0||(o<0&&(o=d),c.point&&(s=Math.max(s,f-d)),r.push(c),i.push(d-o),a.push(f-o))}return{mapped:r.length?new e(i,a,r,s):null,pos:o}}},L=class e{constructor(e,t,n,r){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=r}static create(t,n,r,i){return new e(t,n,r,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(t){let{add:n=[],sort:r=!1,filterFrom:i=0,filterTo:a=this.length}=t,o=t.filter;if(n.length==0&&!o)return this;if(r&&(n=n.slice().sort(ia)),this.isEmpty)return n.length?e.of(n):this;let s=new la(this,null,-1).goto(0),c=0,l=[],u=new sa;for(;s.value||c<n.length;)if(c<n.length&&(s.from-n[c].from||s.startSide-n[c].value.startSide)>=0){let e=n[c++];u.addInner(e.from,e.to,e.value)||l.push(e)}else s.rangeIndex==1&&s.chunkIndex<this.chunk.length&&(c==n.length||this.chunkEnd(s.chunkIndex)<n[c].from)&&(!o||i>this.chunkEnd(s.chunkIndex)||a<this.chunkPos[s.chunkIndex])&&u.addChunk(this.chunkPos[s.chunkIndex],this.chunk[s.chunkIndex])?s.nextChunk():((!o||i>s.to||a<s.from||o(s.from,s.to,s.value))&&(u.addInner(s.from,s.to,s.value)||l.push(ra.create(s.from,s.to,s.value))),s.next());return u.finishInner(this.nextLayer.isEmpty&&!l.length?e.empty:this.nextLayer.update({add:l,filter:o,filterFrom:i,filterTo:a}))}map(t){if(t.empty||this.isEmpty)return this;let n=[],r=[],i=-1;for(let e=0;e<this.chunk.length;e++){let a=this.chunkPos[e],o=this.chunk[e],s=t.touchesRange(a,a+o.length);if(s===!1)i=Math.max(i,o.maxPoint),n.push(o),r.push(t.mapPos(a));else if(s===!0){let{mapped:e,pos:s}=o.map(a,t);e&&(i=Math.max(i,e.maxPoint),n.push(e),r.push(s))}}let a=this.nextLayer.map(t);return n.length==0?a:new e(r,n,a||e.empty,i)}between(e,t,n){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let i=this.chunkPos[r],a=this.chunk[r];if(t>=i&&e<=i+a.length&&a.between(i,e-i,t-i,n)===!1)return}this.nextLayer.between(e,t,n)}}iter(e=0){return ua.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return ua.from(e).goto(t)}static compare(e,t,n,r,i=-1){let a=e.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i),o=t.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i),s=ca(a,o,n),c=new fa(a,s,i),l=new fa(o,s,i);n.iterGaps((e,t,n)=>pa(c,e,l,t,n,r)),n.empty&&n.length==0&&pa(c,0,l,0,0,r)}static eq(e,t,n=0,r){r??=999999999;let i=e.filter(e=>!e.isEmpty&&t.indexOf(e)<0),a=t.filter(t=>!t.isEmpty&&e.indexOf(t)<0);if(i.length!=a.length)return!1;if(!i.length)return!0;let o=ca(i,a),s=new fa(i,o,0).goto(n),c=new fa(a,o,0).goto(n);for(;;){if(s.to!=c.to||!ma(s.active,c.active)||s.point&&(!c.point||!na(s.point,c.point)))return!1;if(s.to>r)return!0;s.next(),c.next()}}static spans(e,t,n,r,i=-1){let a=new fa(e,null,i).goto(t),o=t,s=a.openStart;for(;;){let e=Math.min(a.to,n);if(a.point){let n=a.activeForPoint(a.to),i=a.pointFrom<t?n.length+1:a.point.startSide<0?n.length:Math.min(n.length,s);r.point(o,e,a.point,n,i,a.pointRank),s=Math.min(a.openEnd(e),n.length)}else e>o&&(r.span(o,e,a.active,s),s=a.openEnd(e));if(a.to>n)return s+(a.point&&a.to>n?1:0);o=a.to,a.next()}}static of(e,t=!1){let n=new sa;for(let r of e instanceof ra?[e]:t?oa(e):e)n.add(r.from,r.to,r.value);return n.finish()}static join(t){if(!t.length)return e.empty;let n=t[t.length-1];for(let r=t.length-2;r>=0;r--)for(let i=t[r];i!=e.empty;i=i.nextLayer)n=new e(i.chunkPos,i.chunk,n,Math.max(i.maxPoint,n.maxPoint));return n}};L.empty=new L([],[],null,-1);function oa(e){if(e.length>1)for(let t=e[0],n=1;n<e.length;n++){let r=e[n];if(ia(t,r)>0)return e.slice().sort(ia);t=r}return e}L.empty.nextLayer=L.empty;var sa=class e{finishChunk(e){this.chunks.push(new aa(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(t,n,r){this.addInner(t,n,r)||(this.nextLayer||=new e).add(t,n,r)}addInner(e,t,n){let r=e-this.lastTo||n.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw Error("Ranges must be added sorted by `from` position and `startSide`");return r<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(L.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=L.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}};function ca(e,t,n){let r=new Map;for(let t of e)for(let e=0;e<t.chunk.length;e++)t.chunk[e].maxPoint<=0&&r.set(t.chunk[e],t.chunkPos[e]);let i=new Set;for(let e of t)for(let t=0;t<e.chunk.length;t++){let a=r.get(e.chunk[t]);a!=null&&(n?n.mapPos(a):a)==e.chunkPos[t]&&!n?.touchesRange(a,a+e.chunk[t].length)&&i.add(e.chunk[t])}return i}var la=class{constructor(e,t,n,r=0){this.layer=e,this.skip=t,this.minPoint=n,this.rank=r}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,n){for(;this.chunkIndex<this.layer.chunk.length;){let t=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(t)||this.layer.chunkEnd(this.chunkIndex)<e||t.maxPoint<this.minPoint))break;this.chunkIndex++,n=!1}if(this.chunkIndex<this.layer.chunk.length){let r=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!n||this.rangeIndex<r)&&this.setRangeIndex(r)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex];if(this.from=e+t.from[this.rangeIndex],this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}},ua=class e{constructor(e){this.heap=e}static from(t,n=null,r=-1){let i=[];for(let e=0;e<t.length;e++)for(let a=t[e];!a.isEmpty;a=a.nextLayer)a.maxPoint>=r&&i.push(new la(a,n,r,e));return i.length==1?i[0]:new e(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let e=this.heap.length>>1;e>=0;e--)da(this.heap,e);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let e=this.heap.length>>1;e>=0;e--)da(this.heap,e);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),da(this.heap,0)}}};function da(e,t){for(let n=e[t];;){let r=(t<<1)+1;if(r>=e.length)break;let i=e[r];if(r+1<e.length&&i.compare(e[r+1])>=0&&(i=e[r+1],r++),n.compare(i)<0)break;e[r]=n,e[t]=i,t=r}}var fa=class{constructor(e,t,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=ua.from(e,t,n)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){ha(this.active,e),ha(this.activeTo,e),ha(this.activeRank,e),this.minActive=_a(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:r,rank:i}=this.cursor;for(;t<this.activeRank.length&&(i-this.activeRank[t]||r-this.activeTo[t])>0;)t++;ga(this.active,t,n),ga(this.activeTo,t,r),ga(this.activeRank,t,i),e&&ga(e,t,this.cursor.from),this.minActive=_a(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),n&&ha(n,r)}else if(!this.cursor.value){this.to=this.endSide=1e9;break}else if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let e=this.cursor.value;if(!e.point)this.addActive(n),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=e,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=e.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}}if(n){this.openStart=0;for(let t=n.length-1;t>=0&&n[t]<e;t--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let n=this.active.length-1;n>=0&&!(this.activeRank[n]<this.pointRank);n--)(this.activeTo[n]>e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}};function pa(e,t,n,r,i,a){e.goto(t),n.goto(r);let o=r+i,s=r,c=r-t,l=!!a.boundChange;for(let t=!1;;){let r=e.to+c-n.to,i=r||e.endSide-n.endSide,u=i<0?e.to+c:n.to,d=Math.min(u,o);if(e.point||n.point?(e.point&&n.point&&na(e.point,n.point)&&ma(e.activeForPoint(e.to),n.activeForPoint(n.to))||a.comparePoint(s,d,e.point,n.point),t=!1):(t&&a.boundChange(s),d>s&&!ma(e.active,n.active)&&a.compareRange(s,d,e.active,n.active),l&&d<o&&(r||e.openEnd(u)!=n.openEnd(u))&&(t=!0)),u>o)break;s=u,i<=0&&e.next(),i>=0&&n.next()}}function ma(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n]&&!na(e[n],t[n]))return!1;return!0}function ha(e,t){for(let n=t,r=e.length-1;n<r;n++)e[n]=e[n+1];e.pop()}function ga(e,t,n){for(let n=e.length-1;n>=t;n--)e[n+1]=e[n];e[t]=n}function _a(e,t){let n=-1,r=1e9;for(let i=0;i<t.length;i++)(t[i]-r||e[i].endSide-e[n].endSide)<0&&(n=i,r=t[i]);return n}function va(e,t,n=e.length){let r=0;for(let i=0;i<n&&i<e.length;)e.charCodeAt(i)==9?(r+=t-r%t,i++):(r++,i=Yr(e,i));return r}function ya(e,t,n,r){for(let r=0,i=0;;){if(i>=t)return r;if(r==e.length)break;i+=e.charCodeAt(r)==9?n-i%n:1,r=Yr(e,r)}return r===!0?-1:e.length}for(var ba=`ͼ`,xa=typeof Symbol>`u`?`__`+ba:Symbol.for(ba),Sa=typeof Symbol>`u`?`__styleSet`+Math.floor(Math.random()*1e8):Symbol(`styleSet`),Ca=typeof globalThis<`u`?globalThis:typeof window<`u`?window:{},wa=class{constructor(e,t){this.rules=[];let{finish:n}=t||{};function r(e){return/^@/.test(e)?[e]:e.split(/,\s*/)}function i(e,t,a,o){let s=[],c=/^@(\w+)\b/.exec(e[0]),l=c&&c[1]==`keyframes`;if(c&&t==null)return a.push(e[0]+`;`);for(let n in t){let o=t[n];if(/&/.test(n))i(n.split(/,\s*/).map(t=>e.map(e=>t.replace(/&/,e))).reduce((e,t)=>e.concat(t)),o,a);else if(o&&typeof o==`object`){if(!c)throw RangeError(`The value of a property (`+n+`) should be a primitive value.`);i(r(n),o,s,l)}else o!=null&&s.push(n.replace(/_.*/,``).replace(/[A-Z]/g,e=>`-`+e.toLowerCase())+`: `+o+`;`)}(s.length||l)&&a.push((n&&!c&&!o?e.map(n):e).join(`, `)+` {`+s.join(` `)+`}`)}for(let t in e)i(r(t),e[t],this.rules)}getRules(){return this.rules.join(`
|
|
6
|
+
`)}static newName(){let e=Ca[xa]||1;return Ca[xa]=e+1,ba+e.toString(36)}static mount(e,t,n){let r=e[Sa],i=n&&n.nonce;r?i&&r.setNonce(i):r=new Ea(e,i),r.mount(Array.isArray(t)?t:[t],e)}},Ta=new Map,Ea=class{constructor(e,t){let n=e.ownerDocument||e,r=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let t=Ta.get(n);if(t)return e[Sa]=t;this.sheet=new r.CSSStyleSheet,Ta.set(n,this)}else this.styleTag=n.createElement(`style`),t&&this.styleTag.setAttribute(`nonce`,t);this.modules=[],e[Sa]=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()+`
|
|
7
|
+
`;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)}},Da={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:`'`},Oa={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`"`},ka=typeof navigator<`u`&&/Mac/.test(navigator.platform),Aa=typeof navigator<`u`&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),ja=0;ja<10;ja++)Da[48+ja]=Da[96+ja]=String(ja);for(var ja=1;ja<=24;ja++)Da[ja+111]=`F`+ja;for(var ja=65;ja<=90;ja++)Da[ja]=String.fromCharCode(ja+32),Oa[ja]=String.fromCharCode(ja);for(var Ma in Da)Oa.hasOwnProperty(Ma)||(Oa[Ma]=Da[Ma]);function Na(e){var t=!(ka&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||Aa&&e.shiftKey&&e.key&&e.key.length==1||e.key==`Unidentified`)&&e.key||(e.shiftKey?Oa:Da)[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 R(){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++)Pa(e,arguments[t]);return e}function Pa(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++)Pa(e,t[n]);else throw RangeError(`Unsupported child node: `+t)}var Fa=typeof navigator<`u`?navigator:{userAgent:``,vendor:``,platform:``},Ia=typeof document<`u`?document:{documentElement:{style:{}}},La=/Edge\/(\d+)/.exec(Fa.userAgent),Ra=/MSIE \d/.test(Fa.userAgent),za=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Fa.userAgent),Ba=!!(Ra||za||La),Va=!Ba&&/gecko\/(\d+)/i.test(Fa.userAgent),Ha=!Ba&&/Chrome\/(\d+)/.exec(Fa.userAgent),Ua=`webkitFontSmoothing`in Ia.documentElement.style,Wa=!Ba&&/Apple Computer/.test(Fa.vendor),Ga=Wa&&(/Mobile\/\w+/.test(Fa.userAgent)||Fa.maxTouchPoints>2),z={mac:Ga||/Mac/.test(Fa.platform),windows:/Win/.test(Fa.platform),linux:/Linux|X11/.test(Fa.platform),ie:Ba,ie_version:Ra?Ia.documentMode||6:za?+za[1]:La?+La[1]:0,gecko:Va,gecko_version:Va?+(/Firefox\/(\d+)/.exec(Fa.userAgent)||[0,0])[1]:0,chrome:!!Ha,chrome_version:Ha?+Ha[1]:0,ios:Ga,android:/Android\b/.test(Fa.userAgent),webkit:Ua,webkit_version:Ua?+(/\bAppleWebKit\/(\d+)/.exec(Fa.userAgent)||[0,0])[1]:0,safari:Wa,safari_version:Wa?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Fa.userAgent)||[0,0])[1]:0,tabSize:Ia.documentElement.style.tabSize==null?`-moz-tab-size`:`tab-size`};function Ka(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 qa=Object.create(null);function Ja(e,t,n){if(e==t)return!0;e||=qa,t||=qa;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 Ya(e,t){for(let n=e.attributes.length-1;n>=0;n--){let r=e.attributes[n].name;t[r]??e.removeAttribute(r)}for(let n in t){let r=t[n];n==`style`?e.style.cssText=r:e.getAttribute(n)!=r&&e.setAttribute(n,r)}}function Xa(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 Za(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 Qa=class{eq(e){return!1}updateDOM(e,t,n){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){}},$a=(function(e){return e[e.Text=0]=`Text`,e[e.WidgetBefore=1]=`WidgetBefore`,e[e.WidgetAfter=2]=`WidgetAfter`,e[e.WidgetRange=3]=`WidgetRange`,e})($a||={}),B=class extends ta{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 eo(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 no(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}=ro(e,t);n=(i?t?-3e8:-1:5e8)-1,r=(a?t?2e8:1:-6e8)+1}return new no(e,n,r,t,e.widget||null,!0)}static line(e){return new to(e)}static set(e,t=!1){return L.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}};B.none=L.empty;var eo=class e extends B{constructor(e){let{start:t,end:n}=ro(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||`span`,this.attrs=e.class&&e.attributes?Ka(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||qa}eq(t){return this==t||t instanceof e&&this.tagName==t.tagName&&Ja(this.attrs,t.attrs)}range(e,t=e){if(e>=t)throw RangeError(`Mark decorations may not be empty`);return super.range(e,t)}};eo.prototype.point=!1;var to=class e extends B{constructor(e){super(-2e8,-2e8,null,e)}eq(t){return t instanceof e&&this.spec.class==t.spec.class&&Ja(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)}};to.prototype.mapMode=ni.TrackBefore,to.prototype.point=!0;var no=class e extends B{constructor(e,t,n,r,i,a){super(t,n,i,e),this.block=r,this.isReplace=a,this.mapMode=r?t<=0?ni.TrackBefore:ni.TrackAfter:ni.TrackDel}get type(){return this.startSide==this.endSide?this.startSide<=0?$a.WidgetBefore:$a.WidgetAfter:$a.WidgetRange}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof e&&io(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)}};no.prototype.point=!0;function ro(e,t=!1){let{inclusiveStart:n,inclusiveEnd:r}=e;return n??=e.inclusive,r??=e.inclusive,{start:n??t,end:r??t}}function io(e,t){return e==t||!!(e&&t&&e.compare(t))}function ao(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 oo=class e extends ta{constructor(e,t){super(),this.tagName=e,this.attributes=t}eq(t){return t==this||t instanceof e&&this.tagName==t.tagName&&Ja(this.attributes,t.attributes)}static create(t){return new e(t.tagName,t.attributes||qa)}static set(e,t=!1){return L.of(e,t)}};oo.prototype.startSide=oo.prototype.endSide=-1;function so(e){let t;return t=e.nodeType==11?e.getSelection?e:e.ownerDocument:e,t.getSelection()}function co(e,t){return t?e==t||e.contains(t.nodeType==1?t:t.parentNode):!1}function lo(e,t){if(!t.anchorNode)return!1;try{return co(e,t.anchorNode)}catch{return!1}}function uo(e){return e.nodeType==3?Eo(e,0,e.nodeValue.length).getClientRects():e.nodeType==1?e.getClientRects():[]}function fo(e,t,n,r){return n?ho(e,t,n,r,-1)||ho(e,t,n,r,1):!1}function po(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t}function mo(e){return e.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function ho(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:go(e))){if(e.nodeName==`DIV`)return!1;let n=e.parentNode;if(!n||n.nodeType!=1)return!1;t=po(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?go(e):0}else return!1}}function go(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function _o(e,t){let n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function vo(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 yo(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 bo(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=vo(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}=yo(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=t.top-(e.top+o),n>0&&t.bottom>e.bottom+g&&(g=t.bottom-e.bottom+o)):t.bottom>e.bottom&&(g=t.bottom-e.bottom+o,n<0&&t.top-g<e.top&&(g=t.top-(e.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=t.left-(e.left+a),n>0&&t.right>e.right+h&&(h=t.right-e.right+a)):t.right>e.right&&(h=t.right-e.right+a,n<0&&t.left<e.left+h&&(h=t.left-(e.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;(t.top<e.top||t.bottom>e.bottom||t.left<e.left||t.right>e.right)&&(t={left:Math.max(t.left,e.left),right:Math.min(t.right,e.right),top:Math.max(t.top,e.top),bottom:Math.min(t.bottom,e.bottom)}),u=u.assignedSlot||u.parentNode}else if(u.nodeType==11)u=u.host;else break}function xo(e,t=!0){let n=e.ownerDocument,r=null,i=null;for(let a=e.parentNode;a&&!(a==n.body||(!t||r)&&i);)if(a.nodeType==1)!i&&a.scrollHeight>a.clientHeight&&(i=a),t&&!r&&a.scrollWidth>a.clientWidth&&(r=a),a=a.assignedSlot||a.parentNode;else if(a.nodeType==11)a=a.host;else break;return{x:r,y:i}}var So=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?go(t):0),n,Math.min(e.focusOffset,n?go(n):0))}set(e,t,n,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=r}},Co=null;z.safari&&z.safari_version>=26&&(Co=!1);function wo(e){if(e.setActive)return e.setActive();if(Co)return e.focus(Co);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(Co==null?{get preventScroll(){return Co={preventScroll:!0},!0}}:void 0),!Co){Co=!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 To;function Eo(e,t,n=t){let r=To||=document.createRange();return r.setEnd(e,n),r.setStart(e,t),r}function Do(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 Oo(e){for(;e;){if(e&&(e.nodeType==9||e.nodeType==11&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}function ko(e,t){let n=t.focusNode,r=t.focusOffset;if(!n||t.anchorNode!=n||t.anchorOffset!=r)return!1;for(r=Math.min(r,go(n));;)if(r){if(n.nodeType!=1)return!1;let e=n.childNodes[r-1];e.contentEditable==`false`?r--:(n=e,r=go(n))}else if(n==e)return!0;else r=po(n),n=n.parentNode}function Ao(e){return e instanceof Window?e.pageYOffset>Math.max(0,e.document.documentElement.scrollHeight-e.innerHeight-4):e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function jo(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=go(n)}else if(n.parentNode&&!mo(n))r=po(n),n=n.parentNode;else return null}function Mo(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&&!mo(n))r=po(n)+1,n=n.parentNode;else return null}var No=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,po(t),n)}static after(t,n){return new e(t.parentNode,po(t)+1,n)}},V=(function(e){return e[e.LTR=0]=`LTR`,e[e.RTL=1]=`RTL`,e})(V||={}),Po=V.LTR,Fo=V.RTL;function Io(e){let t=[];for(let n=0;n<e.length;n++)t.push(1<<e[n]);return t}var Lo=Io(`88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008`),Ro=Io(`4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333`),zo=Object.create(null),Bo=[];for(let e of[`()`,`[]`,`{}`]){let t=e.charCodeAt(0),n=e.charCodeAt(1);zo[t]=n,zo[n]=-t}function Vo(e){return e<=247?Lo[e]:1424<=e&&e<=1524?2:1536<=e&&e<=1785?Ro[e-1536]:1774<=e&&e<=2220?4:8192<=e&&e<=8204?256:64336<=e&&e<=65023?4:1}var Ho=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/,Uo=class{get dir(){return this.level%2?Fo:Po}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 Wo(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||!Wo(r.inner,i.inner))return!1}return!0}var H=[];function Go(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=Vo(e.charCodeAt(t));i==512?i=n:i==8&&r==4&&(i=16),H[t]=i==4?2:i,i&7&&(r=i),n=i}for(let e=o,t=c,r=c;e<s;e++){let i=H[e];if(i==128)e<s-1&&t==H[e+1]&&t&24?i=H[e]=t:H[e]=256;else if(i==64){let i=e+1;for(;i<s&&H[i]==64;)i++;let a=e&&t==8||i<n&&H[i]==8?r==1?1:8:256;for(let t=e;t<i;t++)H[t]=a;e=i-1}else i==8&&r==1&&(H[e]=1);t=i,i&7&&(r=i)}}}function Ko(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=zo[n=e.charCodeAt(t)])if(r<0){for(let e=s-3;e>=0;e-=3)if(Bo[e+1]==-r){let n=Bo[e+2],r=n&2?i:n&4?n&1?a:i:0;r&&(H[t]=H[Bo[e]]=r),s=e;break}}else if(Bo.length==189)break;else Bo[s++]=t,Bo[s++]=n,Bo[s++]=c;else if((o=H[t])==2||o==1){let e=o==i;c=e?0:1;for(let t=s-3;t>=0;t-=3){let n=Bo[t+2];if(n&2)break;if(e)Bo[t+2]|=2;else{if(n&4)break;Bo[t+2]|=4}}}}}function qo(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=H[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(H[o]==256)o++;else break;let l=a==1,u=l==((o<t?H[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),H[--t]=u;c=o}else a=o,c++}}}function Jo(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=H[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(H[e]==s)break run;else break}l++,d?d.push(m):(m.from>c&&o.push(new Uo(c,m.from,f)),Yo(e,m.direction==Po==!(f%2)?r:r+1,i,m.inner,m.from,m.to,o),c=m.to),p=m.to}else if(p==n||(t?H[p]!=s:H[p]==s))break;else p++;d?Jo(e,c,p,r+1,i,d,o):c<p&&o.push(new Uo(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=H[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(H[e-1]==s)break run;else break}d?d.push(m):(m.to<c&&o.push(new Uo(m.to,c,f)),Yo(e,m.direction==Po==!(f%2)?r:r+1,i,m.inner,m.from,m.to,o),c=m.from),p=m.from}else if(p==t||(n?H[p-1]!=s:H[p-1]==s))break;else p--;d?Jo(e,p,c,r+1,i,d,o):p<c&&o.push(new Uo(p,c,f)),c=p}}function Yo(e,t,n,r,i,a,o){let s=t%2?2:1;Go(e,i,a,r,s),Ko(e,i,a,r,s),qo(i,a,r,s),Jo(e,i,a,t,n,r,o)}function Xo(e,t,n){if(!e)return[new Uo(0,0,t==Fo?1:0)];if(t==Po&&!n.length&&!Ho.test(e))return Zo(e.length);if(n.length)for(;e.length>H.length;)H[H.length]=256;let r=[],i=t==Po?0:1;return Yo(e,i,i,n,0,e.length,r),r}function Zo(e){return[new Uo(0,e,0)]}var Qo=``;function $o(e,t,n,r,i){let a=r.head-e.from,o=Uo.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=Yr(e.text,a,s.forward(i,n));(l<s.from||l>s.to)&&(l=c),Qo=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?0:1)<s.level?M.cursor(u.side(!i,n)+e.from,u.forward(i,n)?1:-1,u.level):M.cursor(l+e.from,s.forward(i,n)?-1:1,s.level)}function es(e,t,n){for(let r=t;r<n;r++){let t=Vo(e.charCodeAt(r));if(t==1)return Po;if(t==2||t==4)return Fo}return Po}var ts=N.define(),ns=N.define(),rs=N.define(),is=N.define(),as=N.define(),os=N.define(),ss=N.define(),cs=N.define(),ls=N.define(),us=N.define({combine:e=>e.some(e=>e)}),ds=N.define({combine:e=>e.some(e=>e)}),fs=N.define(),ps=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(M.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}},ms=P.define({map:(e,t)=>e.map(t)}),hs=P.define();function gs(e,t,n){let r=e.facet(is);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 _s=N.define({combine:e=>e.length?e[0]:!0}),vs=0,ys=N.define({combine(e){return e.filter((t,n)=>{for(let r=0;r<n;r++)if(e[r].plugin==t.plugin)return!1;return!0})}}),bs=class e{constructor(e,t,n,r,i){this.id=e,this.create=t,this.domEventHandlers=n,this.domEventObservers=r,this.baseExtensions=i(this),this.extension=this.baseExtensions.concat(ys.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(ys.of({plugin:this,arg:e}))}static define(t,n){let{eventHandlers:r,eventObservers:i,provide:a,decorations:o}=n||{};return new e(vs++,t,r,i,e=>{let t=[];return o&&t.push(ws.of(t=>{let n=t.plugin(e);return n?o(n):B.none})),a&&t.push(a(e)),t})}static fromClass(t,n){return e.define((e,n)=>new t(e,n),n)}},xs=class{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(!this.value){if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(t){gs(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(gs(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){gs(e.state,t,`CodeMirror plugin crashed`)}}deactivate(){this.spec=this.value=null}},Ss=N.define(),Cs=N.define(),ws=N.define(),Ts=N.define(),Es=N.define(),Ds=N.define(),Os=N.define();function ks(e,t){let n=e.state.facet(Os);if(!n.length)return n;let r=n.map(t=>t instanceof Function?t(e):t),i=[];return L.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??=es(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 As=N.define();function js(e){let t=0,n=0,r=0,i=0;for(let a of e.state.facet(As)){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 Ms=N.define(),Ns=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;;){let s=i<t.length?t[i].fromB:1e9,c=a<n.length?n[a]:1e9,l=Math.min(s,c);if(l==1e9)break;let u=l+o,d=l,f=u;for(;;)if(a<n.length&&n[a]<=d){let e=n[a+1];a+=2,d=Math.max(d,e);for(let e=i;e<t.length&&t[e].fromB<=d;e++)o=t[e].toA-t[e].toB;f=Math.max(f,e+o)}else if(i<t.length&&t[i].fromB<=d){let e=t[i++];d=Math.max(d,e.toB),f=Math.max(f,e.toA),o=e.toA-e.toB}else break;r.push(new e(u,f,l,d))}return r}},Ps=class e{constructor(e,t,n){this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=ii.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 Ns(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}},Fs=[],U=class{constructor(e,t,n=0){this.dom=e,this.length=t,this.flags=n,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return Fs}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let e=this.domAttrs;e&&Ya(this.dom,e)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:``)+(this.breakAfter?`#`:``)}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,t=this.posAtStart){let n=t;for(let t of this.children){if(t==e)return n;n+=t.length+t.breakAfter}throw RangeError(`Invalid child in posBefore`)}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,t){return null}domPosFor(e,t){let n=po(this.dom),r=this.length?e>0:t>0;return new No(this.parent.dom,n+(r?1:0),e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof Rs)return e;return null}static get(e){return e.cmTile}},Is=class extends U{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let t=this.dom,n=null,r,i=e?.node==t?e:null,a=0;for(let o of this.children){if(o.sync(e),a+=o.length+o.breakAfter,r=n?n.nextSibling:t.firstChild,i&&r!=o.dom&&(i.written=!0),o.dom.parentNode==t)for(;r&&r!=o.dom;)r=Ls(r);else t.insertBefore(o.dom,r);n=o.dom}for(r=n?n.nextSibling:t.firstChild,i&&r&&(i.written=!0);r;)r=Ls(r);this.length=a}};function Ls(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}var Rs=class extends Is{constructor(e,t){super(t),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let t=U.get(e);if(t&&this.owns(t))return t;e=e.parentNode}}blockTiles(e){for(let t=[],n=this,r=0,i=0;;)if(r==n.children.length){if(!t.length)return;n=n.parent,n.breakAfter&&i++,r=t.pop()}else{let a=n.children[r++];if(a instanceof zs)t.push(r),n=a,r=0;else{let t=i+a.length,n=e(a,i);if(n!==void 0)return n;i=t+a.breakAfter}}}resolveBlock(e,t){let n,r=-1,i,a=-1;if(this.blockTiles((o,s)=>{let c=s+o.length;if(e>=s&&e<=c){if(o.isWidget()&&t>=-1&&t<=1){if(o.flags&32)return!0;o.flags&16&&(n=void 0)}(s<e||e==c&&(t<-1?o.length:o.covers(1)))&&(!n||!o.isWidget()&&n.isWidget())&&(n=o,r=e-s),(c>e||e==s&&(t>1?o.length:o.covers(-1)))&&(!i||!o.isWidget()&&i.isWidget())&&(i=o,a=e-s)}}),!n&&!i)throw Error(`No tile at position `+e);return n&&t<0||!i?{tile:n,offset:r}:{tile:i,offset:a}}},zs=class e extends Is{constructor(e,t){super(e),this.wrapper=t}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(t,n){let r=new e(n||document.createElement(t.tagName),t);return n||(r.flags|=4),r}},Bs=class e extends Is{constructor(e,t){super(e),this.attrs=t}isLine(){return!0}static start(t,n,r){let i=new e(n||document.createElement(`div`),t);return(!n||!r)&&(i.flags|=4),i}get domAttrs(){return this.attrs}resolveInline(e,t,n){let r=null,i=-1,a=null,o=-1;function s(e,c){for(let l=0,u=0;l<e.children.length&&u<=c;l++){let d=e.children[l],f=u+d.length;f>=c&&(d.isComposite()?s(d,c-u):(!a||a.isHidden&&(t>0||n&&Hs(a,d)))&&(f>c||d.flags&32)?(a=d,o=c-u):(u<c||d.flags&16&&!d.isHidden)&&(r=d,i=c-u)),u=f}}s(this,e);let c=(t<0?r:a)||r||a;return c?{tile:c,offset:c==r?i:o}:null}coordsIn(e,t){let n=this.resolveInline(e,t,!0);return n?n.tile.coordsIn(Math.max(0,n.offset),t):Vs(this)}domIn(e,t){let n=this.resolveInline(e,t);if(n){let{tile:e,offset:r}=n;if(this.dom.contains(e.dom))return e.isText()?new No(e.dom,Math.min(e.dom.nodeValue.length,r)):e.domPosFor(r,e.flags&16?1:e.flags&32?-1:t);let i=n.tile.parent,a=!1;for(let e of i.children){if(a)return new No(e.dom,0);e==n.tile&&(a=!0)}}return new No(this.dom,0)}};function Vs(e){let t=e.dom.lastChild;if(!t)return e.dom.getBoundingClientRect();let n=uo(t);return n[n.length-1]||null}function Hs(e,t){let n=e.coordsIn(0,1),r=t.coordsIn(0,1);return n&&r&&r.top<n.bottom}var Us=class e extends Is{constructor(e,t){super(e),this.mark=t}get domAttrs(){return this.mark.attrs}static of(t,n){let r=new e(n||document.createElement(t.tagName),t);return n||(r.flags|=4),r}},Ws=class e extends U{constructor(e,t){super(e,t.length),this.text=t}sync(e){this.flags&2||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,t){let n=this.dom.nodeValue.length;e>n&&(e=n);let r=e,i=e,a=0;e==0&&t<0||e==n&&t>=0?z.chrome||z.gecko||(e?(r--,a=1):i<n&&(i++,a=-1)):t<0?r--:i<n&&i++;let o=Eo(this.dom,r,i).getClientRects();if(!o.length)return null;let s=o[(a?a<0:t>=0)?0:o.length-1];return z.safari&&!a&&s.width==0&&(s=Array.prototype.find.call(o,e=>e.width)||s),a?_o(s,a<0):s||null}static of(t,n){let r=new e(n||document.createTextNode(t),t);return n||(r.flags|=2),r}},Gs=class e extends U{constructor(e,t,n,r){super(e,t,r),this.widget=n}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,t){return this.coordsInWidget(e,t,!1)}coordsInWidget(e,t,n){let r=this.widget.coordsAt(this.dom,e,t);if(r)return r;if(n)return _o(this.dom.getBoundingClientRect(),this.length?e==0:t<=0);{let t=this.dom.getClientRects(),n=null;if(!t.length)return null;let r=this.flags&16?!0:this.flags&32?!1:e>0;for(let i=r?t.length-1:0;n=t[i],!(e>0?i==0:i==t.length-1||n.top<n.bottom);i+=r?-1:1);return _o(n,!r)}}get overrideDOMText(){if(!this.length)return j.empty;let{root:e}=this;if(!e)return j.empty;let t=this.posAtStart;return e.view.state.doc.slice(t,t+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(t,n,r,i,a){return a||(a=t.toDOM(n),t.editable||(a.contentEditable=`false`)),new e(a,r,t,i)}},Ks=class extends U{constructor(e){let t=document.createElement(`img`);t.className=`cm-widgetBuffer`,t.setAttribute(`aria-hidden`,`true`),super(t,0,e)}get isHidden(){return!0}get overrideDOMText(){return j.empty}coordsIn(e){return this.dom.getBoundingClientRect()}},qs=class{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,t,n){let{tile:r,index:i,beforeBreak:a,parents:o}=this;for(;e||t>0;)if(!r.isComposite())if(i==r.length)a=!!r.breakAfter,{tile:r,index:i}=o.pop(),i++;else if(e){let t=Math.min(e,r.length-i);n&&n.skip(r,i,i+t),e-=t,i+=t}else break;else if(a){if(!e)break;n&&n.break(),e--,a=!1}else if(i==r.children.length){if(!e&&!o.length)break;n&&n.leave(r),a=!!r.breakAfter,{tile:r,index:i}=o.pop(),i++}else{let s=r.children[i],c=s.breakAfter;(t>0?s.length<=e:s.length<e)&&(!n||n.skip(s,0,s.length)!==!1||!s.isComposite)?(a=!!c,i++,e-=s.length):(o.push({tile:r,index:i}),r=s,i=0,n&&s.isComposite()&&n.enter(s))}return this.tile=r,this.index=i,this.beforeBreak=a,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}},Js=class{constructor(e,t,n,r){this.from=e,this.to=t,this.wrapper=n,this.rank=r}},Ys=class{constructor(e,t,n){this.cache=e,this.root=t,this.blockWrappers=n,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,t,n,r){this.flushBuffer();let i=this.ensureMarks(t,n),a=i.lastChild;if(a&&a.isText()&&!(a.flags&8)&&a.length+e.length<512){this.cache.reused.set(a,2);let t=i.children[i.children.length-1]=new Ws(a.dom,a.text+e);t.parent=i}else i.append(r||Ws.of(e,this.cache.find(Ws)?.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,t){let n=this.curLine;n.dom!=t.line.dom&&(n.setDOM(this.cache.reused.has(t.line)?ac(t.line.dom):t.line.dom),this.cache.reused.set(t.line,2));let r=n;for(let e=t.marks.length-1;e>=0;e--){let n=t.marks[e],i=r.lastChild;if(i instanceof Us&&i.mark.eq(n.mark))i.dom!=n.dom&&i.setDOM(ac(n.dom)),r=i;else{if(this.cache.reused.get(n)){let e=U.get(n.dom);e&&e.setDOM(ac(n.dom))}let e=Us.of(n.mark,n.dom);r.append(e),r=e}this.cache.reused.set(n,2)}let i=U.get(e.text);i&&this.cache.reused.set(i,2);let a=new Ws(e.text,e.text.nodeValue);a.flags|=8,r.append(a)}addInlineWidget(e,t,n){let r=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);r||this.flushBuffer();let i=this.ensureMarks(t,n);!r&&!(e.flags&16)&&i.append(this.getBuffer(1)),i.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,t,n){this.flushBuffer(),this.ensureMarks(t,n).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let t=this.afterWidget||this.lastBlock;t.length+=e,this.pos+=e}addLineStart(e,t){e||=nc;let n=Bs.start(e,t||this.cache.find(Bs)?.dom,!!t);this.getBlockPos().append(this.lastBlock=this.curLine=n)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,t){let n=this.curLine;for(let r=e.length-1;r>=0;r--){let i=e[r],a;if(t>0&&(a=n.lastChild)&&a instanceof Us&&a.mark.eq(i))n=a,t--;else{let e=Us.of(i,this.cache.find(Us,e=>e.mark.eq(i))?.dom);n.append(e),n=e,t=0}}return n}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!ec(this.curLine,!1)||e.dom.nodeName!=`BR`&&e.isWidget()&&!(z.ios&&ec(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(sc,0,32)||new Gs(sc.toDOM(),0,sc,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let t=new Js(e.from,e.to,e.value,e.rank),n=this.wrappers.length;for(;n>0&&(this.wrappers[n-1].rank-t.rank||this.wrappers[n-1].to-t.to)<0;)n--;this.wrappers.splice(n,0,t)}this.wrapperPos=this.pos}getBlockPos(){this.updateBlockWrappers();let e=this.root;for(let t of this.wrappers){let n=e.lastChild;if(t.from<this.pos&&n instanceof zs&&n.wrapper.eq(t.wrapper))e=n;else{let n=zs.of(t.wrapper,this.cache.find(zs,e=>e.wrapper.eq(t.wrapper))?.dom);e.append(n),e=n}}return e}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let t=2|(e<0?16:32),n=this.cache.find(Ks,void 0,1);return n&&(n.flags=t),n||new Ks(t)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}},Xs=class{constructor(e){this.skipCount=0,this.text=``,this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text=``,this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:t,lineBreak:n,done:r}=this.cursor.next(this.skipCount);if(this.skipCount=0,r)throw Error(`Ran out of text content when drawing inline views`);this.text=t;let i=this.textOff=Math.min(e,t.length);return n?null:t.slice(0,i)}let t=Math.min(this.text.length,this.textOff+e),n=this.text.slice(this.textOff,t);return this.textOff=t,n}},Zs=[Gs,Bs,Ws,Us,Ks,zs,Rs];for(let e=0;e<Zs.length;e++)Zs[e].bucket=e;var Qs=class{constructor(e){this.view=e,this.buckets=Zs.map(()=>[]),this.index=Zs.map(()=>0),this.reused=new Map}add(e){let t=e.constructor.bucket,n=this.buckets[t];n.length<6?n.push(e):n[this.index[t]=(this.index[t]+1)%6]=e}find(e,t,n=2){let r=e.bucket,i=this.buckets[r],a=this.index[r];for(let e=i.length-1;e>=0;e--){let o=(e+a)%i.length,s=i[o];if((!t||t(s))&&!this.reused.has(s))return i.splice(o,1),o<a&&this.index[r]--,this.reused.set(s,n),s}return null}findWidget(e,t,n){let r=this.buckets[0];if(r.length)for(let i=0,a=0;;i++){if(i==r.length){if(a)return null;a=1,i=0}let o=r[i];if(!this.reused.has(o)&&(a==0?o.widget.compare(e):o.widget.constructor==e.constructor&&e.updateDOM(o.dom,this.view,o.widget)))return r.splice(i,1),i<this.index[0]&&this.index[0]--,o.widget==e&&o.length==t&&(o.flags&497)==n?(this.reused.set(o,1),o):(this.reused.set(o,2),new Gs(o.dom,t,e,o.flags&-498|n))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,t=2){if(!this.reused.has(e))return this.reused.set(e,t),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}},$s=class{constructor(e,t,n,r,i){this.view=e,this.decorations=r,this.disallowBlockEffectsFor=i,this.openWidget=!1,this.openMarks=0,this.cache=new Qs(e),this.text=new Xs(e.state.doc),this.builder=new Ys(this.cache,new Rs(e,e.contentDOM),L.iter(n)),this.cache.reused.set(t,2),this.old=new qs(t),this.reuseWalker={skip:(e,t,n)=>{if(this.cache.add(e),e.isComposite())return!1},enter:e=>this.cache.add(e),leave:()=>{},break:()=>{}}}run(e,t){let n=t&&this.getCompositionContext(t.text);for(let r=0,i=0,a=0;;){let o=a<e.length?e[a++]:null,s=o?o.fromA:this.old.root.length;if(s>r){let e=s-r;this.preserve(e,!a,!o),r=s,i+=e}if(!o)break;t&&o.fromA<=t.range.fromA&&o.toA>=t.range.toA?(this.forward(o.fromA,t.range.fromA,t.range.fromA<t.range.toA?1:-1),this.emit(i,t.range.fromB),this.cache.clear(),this.builder.addComposition(t,n),this.text.skip(t.range.toB-t.range.fromB),this.forward(t.range.fromA,o.toA),this.emit(t.range.toB,o.toB)):(this.forward(o.fromA,o.toA),this.emit(i,o.toB)),i=o.toB,r=o.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,t,n){let r=ic(this.old),i=this.openMarks;this.old.advance(e,n?1:-1,{skip:(e,t,n)=>{if(e.isWidget())if(this.openWidget)this.builder.continueWidget(n-t);else{let a=n>0||t<e.length?Gs.of(e.widget,this.view,n-t,e.flags&496,this.cache.maybeReuse(e)):this.cache.reuse(e);a.flags&256?(a.flags&=-2,this.builder.addBlockWidget(a)):(this.builder.ensureLine(null),this.builder.addInlineWidget(a,r,i),i=r.length)}else if(e.isText())this.builder.ensureLine(null),!t&&n==e.length&&!this.cache.reused.has(e)?this.builder.addText(e.text,r,i,this.cache.reuse(e)):(this.cache.add(e),this.builder.addText(e.text.slice(t,n),r,i)),i=r.length;else if(e.isLine())e.flags&=-2,this.cache.reused.set(e,1),this.builder.addLine(e);else if(e instanceof Ks)this.cache.add(e);else if(e instanceof Us)this.builder.ensureLine(null),this.builder.addMark(e,r,i),this.cache.reused.set(e,1),i=r.length;else return!1;this.openWidget=!1},enter:e=>{e.isLine()?this.builder.addLineStart(e.attrs,this.cache.maybeReuse(e)):(this.cache.add(e),e instanceof Us&&r.unshift(e.mark)),this.openWidget=!1},leave:e=>{e.isLine()?r.length&&=i=0:e instanceof Us&&(r.shift(),i=Math.min(i,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,t){let n=null,r=this.builder,i=0,a=L.spans(this.decorations,e,t,{point:(e,t,a,o,s,c)=>{if(a instanceof no){if(this.disallowBlockEffectsFor[c]){if(a.block)throw RangeError(`Block decorations may not be specified via plugins`);if(t>this.view.state.doc.lineAt(e).to)throw RangeError(`Decorations that replace line breaks may not be specified via plugins`)}if(i=o.length,s>o.length)r.continueWidget(t-e);else{let i=a.widget||(a.block?oc.block:oc.inline),c=tc(a),l=this.cache.findWidget(i,t-e,c)||Gs.of(i,this.view,t-e,c);a.block?(a.startSide>0&&r.addLineStartIfNotCovered(n),r.addBlockWidget(l)):(r.ensureLine(n),r.addInlineWidget(l,o,s))}n=null}else n=rc(n,a);t>e&&this.text.skip(t-e)},span:(e,t,i,a)=>{for(let o=e;o<t;){let s=this.text.next(Math.min(512,t-o));s==null?(r.addLineStartIfNotCovered(n),r.addBreak(),o++):(r.ensureLine(n),r.addText(s,i,o==e?a:i.length),o+=s.length),n=null}}});r.addLineStartIfNotCovered(n),this.openWidget=a>i,this.openMarks=a}forward(e,t,n=1){t-e<=10?this.old.advance(t-e,n,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(t-e-10,-1),this.old.advance(5,n,this.reuseWalker))}getCompositionContext(e){let t=[],n=null;for(let r=e.parentNode;;r=r.parentNode){let e=U.get(r);if(r==this.view.contentDOM)break;e instanceof Us?t.push(e):e?.isLine()?n=e:e instanceof zs||(r.nodeName==`DIV`&&!n&&r!=this.view.contentDOM?n=new Bs(r,nc):n||t.push(Us.of(new eo({tagName:r.nodeName.toLowerCase(),attributes:Za(r)}),r)))}return{line:n,marks:t}}};function ec(e,t){let n=e=>{for(let r of e.children)if((t?r.isText():r.length)||n(r))return!0;return!1};return n(e)}function tc(e){let t=e.isReplace?(e.startSide<0?64:0)|(e.endSide>0?128:0):e.startSide>0?32:16;return e.block&&(t|=256),t}var nc={class:`cm-line`};function rc(e,t){let n=t.spec.attributes,r=t.spec.class;return!n&&!r?e:(e||={class:`cm-line`},n&&Ka(n,e),r&&(e.class+=` `+r),e)}function ic(e){let t=[];for(let n=e.parents.length;n>1;n--){let r=n==e.parents.length?e.tile:e.parents[n].tile;r instanceof Us&&t.push(r.mark)}return t}function ac(e){let t=U.get(e);return t&&t.setDOM(e.cloneNode()),e}var oc=class extends Qa{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}};oc.inline=new oc(`span`),oc.block=new oc(`div`);var sc=new class extends Qa{toDOM(){return document.createElement(`br`)}get isHidden(){return!0}get editable(){return!0}},cc=class{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=B.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new Rs(e,e.contentDOM),this.updateInner([new Ns(0,0,0,e.state.doc.length)],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:!yc(e.changes,this.hasComposition)&&!e.selectionSet&&(n=e.state.selection.main.head));let r=n>-1?fc(this.view,e.changes,n):null;if(this.domChanged=null,this.hasComposition){let{from:n,to:r}=this.hasComposition;t=new Ns(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,(z.ie||z.chrome)&&!r&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let i=this.decorations,a=this.blockWrappers;this.updateDeco();let o=hc(i,this.decorations,e.changes);o.length&&(t=Ns.extendWithRanges(t,o));let s=_c(a,this.blockWrappers,e.changes);return s.length&&(t=Ns.extendWithRanges(t,s)),r&&!t.some(e=>e.fromA<=r.range.fromA&&e.toA>=r.range.toA)&&(t=r.range.addToSet(t.slice())),this.tile.flags&2&&t.length==0?!1:(this.updateInner(t,r),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t){this.view.viewState.mustMeasureContent=!0;let{observer:n}=this.view;n.ignore(()=>{if(t||e.length){let n=this.tile,r=new $s(this.view,n,this.blockWrappers,this.decorations,this.dynamicDecorationMap);t&&U.get(t.text)&&r.cache.reused.set(U.get(t.text),2),this.tile=r.run(e,t),lc(n,r.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+`px`,this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+`px`:``;let r=z.chrome||z.ios?{node:n.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(r),r&&(r.written||n.selectionRange.focusNode!=r.node||!this.tile.dom.contains(r.node))&&(this.forceSelection=!0),this.tile.dom.style.height=``});let r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let e of this.tile.children)e.isWidget()&&e.widget instanceof bc&&r.push(e.dom);n.updateGaps(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let e of t.effects)e.is(hs)&&(this.editContextFormatting=e.value)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:n}=this.tile,r=this.view.root.activeElement,i=r==n,a=!i&&!(this.view.state.facet(_s)||n.tabIndex>-1)&&lo(n,this.view.observer.selectionRange)&&!(r&&n.contains(r));if(!(i||t||a))return;let o=this.forceSelection;this.forceSelection=!1;let s=this.view.state.selection.main,c,l;if(s.empty?l=c=this.inlineDOMNearPos(s.anchor,s.assoc||1):(l=this.inlineDOMNearPos(s.head,s.head==s.from?1:-1),c=this.inlineDOMNearPos(s.anchor,s.anchor==s.from?1:-1)),z.gecko&&s.empty&&!this.hasComposition&&uc(c)){let e=document.createTextNode(``);this.view.observer.ignore(()=>c.node.insertBefore(e,c.node.childNodes[c.offset]||null)),c=l=new No(e,0),o=!0}let u=this.view.observer.selectionRange;(o||!u.focusNode||(!fo(c.node,c.offset,u.anchorNode,u.anchorOffset)||!fo(l.node,l.offset,u.focusNode,u.focusOffset))&&!this.suppressWidgetCursorChange(u,s))&&(this.view.observer.ignore(()=>{z.android&&z.chrome&&n.contains(u.focusNode)&&vc(u.focusNode,n)&&(n.blur(),n.focus({preventScroll:!0}));let e=so(this.view.root);if(e)if(s.empty){if(z.gecko){let e=pc(c.node,c.offset);if(e&&e!=3){let t=(e==1?jo:Mo)(c.node,c.offset);t&&(c=new No(t.node,t.offset))}}e.collapse(c.node,c.offset),s.bidiLevel!=null&&e.caretBidiLevel!==void 0&&(e.caretBidiLevel=s.bidiLevel)}else if(e.extend){e.collapse(c.node,c.offset);try{e.extend(l.node,l.offset)}catch{}}else{let t=document.createRange();s.anchor>s.head&&([c,l]=[l,c]),t.setEnd(l.node,l.offset),t.setStart(c.node,c.offset),e.removeAllRanges(),e.addRange(t)}a&&this.view.root.activeElement==n&&(n.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(c,l)),this.impreciseAnchor=c.precise?null:new No(u.anchorNode,u.anchorOffset),this.impreciseHead=l.precise?null:new No(u.focusNode,u.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&fo(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=so(e.root),{anchorNode:r,anchorOffset:i}=e.observer.selectionRange;if(!n||!t.empty||!t.assoc||!n.modify)return;let a=this.lineAt(t.head,t.assoc);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,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)}posFromDOM(e,t){let n=this.tile.nearest(e);if(!n)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let r=n.posAtStart;if(n.isComposite()){let i;if(e==n.dom)i=n.dom.childNodes[t];else{let r=go(e)==0?0:t==0?-1:1;for(;;){let t=e.parentNode;if(t==n.dom)break;r==0&&t.firstChild!=t.lastChild&&(r=e==t.firstChild?-1:1),e=t}i=r<0?e:e.nextSibling}if(i==n.dom.firstChild)return r;for(;i&&!U.get(i);)i=i.nextSibling;if(!i)return r+n.length;for(let e=0,t=r;;e++){let r=n.children[e];if(r.dom==i)return t;t+=r.length+r.breakAfter}}else if(n.isText())return e==n.dom?r+t:r+(t?n.length:0);else return r}domAtPos(e,t){let{tile:n,offset:r}=this.tile.resolveBlock(e,t);return n.isWidget()?n.domPosFor(e,t):n.domIn(r,t)}inlineDOMNearPos(e,t){let n,r=-1,i=!1,a,o=-1,s=!1;return this.tile.blockTiles((t,c)=>{if(t.isWidget()){if(t.flags&32&&c>=e)return!0;t.flags&16&&(i=!0)}else{let l=c+t.length;if(c<=e&&(n=t,r=e-c,i=l<e),l>=e&&!a&&(a=t,o=e-c,s=c>e),c>e&&a)return!0}}),!n&&!a?this.domAtPos(e,t):(i&&a?n=null:s&&n&&(a=null),n&&t<0||!a?n.domIn(r,t):a.domIn(o,t))}coordsAt(e,t){let{tile:n,offset:r}=this.tile.resolveBlock(e,t);return n.isWidget()?n.widget instanceof bc?null:n.coordsInWidget(r,t,!0):n.coordsIn(r,t)}lineAt(e,t){let{tile:n}=this.tile.resolveBlock(e,t);return n.isLine()?n:null}coordsForChar(e){let{tile:t,offset:n}=this.tile.resolveBlock(e,1);if(!t.isLine())return null;function r(e,t){if(e.isComposite())for(let n of e.children){if(n.length>=t){let e=r(n,t);if(e)return e}if(t-=n.length,t<0)break}else if(e.isText()&&t<e.length){let n=Yr(e.text,t);if(n==t)return null;let r=Eo(e.dom,t,n).getClientRects();for(let e=0;e<r.length;e++){let t=r[e];if(e==r.length-1||t.top<t.bottom&&t.left<t.right)return t}}return null}return r(t,n)}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==V.LTR,c=0,l=(e,u,d)=>{for(let f=0;f<e.children.length&&!(u>r);f++){let r=e.children[f],p=u+r.length,m=r.dom.getBoundingClientRect(),{height:h}=m;if(d&&!f&&(c+=m.top-d.top),r instanceof zs)p>n&&l(r,u,m);else if(u>=n&&(c>0&&t.push(-c),t.push(h+c),c=0,a)){let e=r.dom.lastChild,t=e?uo(e):[];if(t.length){let e=t[t.length-1],n=s?e.right-m.left:m.right-e.left;n>o&&(o=n,this.minWidth=i,this.minWidthFrom=u,this.minWidthTo=p)}}d&&f==e.children.length-1&&(c+=d.bottom-m.bottom),u=p+r.breakAfter}};return l(this.tile,0,null),t}textDirectionAt(e){let{tile:t}=this.tile.resolveBlock(e,1);return getComputedStyle(t.dom).direction==`rtl`?V.RTL:V.LTR}measureTextSize(){let e=this.tile.blockTiles(e=>{if(e.isLine()&&e.children.length&&e.length<=20){let t=0,n;for(let r of e.children){if(!r.isText()||/[^ -~]/.test(r.text))return;let e=uo(r.dom);if(e.length!=1)return;t+=e[0].width,n=e[0].height}if(t)return{lineHeight:e.dom.getBoundingClientRect().height,charWidth:t/e.length,textHeight:n}}});if(e)return e;let t=document.createElement(`div`),n,r,i;return t.className=`cm-line`,t.style.width=`99999px`,t.style.position=`absolute`,t.textContent=`abc def ghi jkl mno pqr stu`,this.view.observer.ignore(()=>{this.tile.dom.appendChild(t);let e=uo(t.firstChild)[0];n=t.getBoundingClientRect().height,r=e&&e.width?e.width/27:7,i=e&&e.height?e.height:n,t.remove()}),{lineHeight:n,charWidth:r,textHeight:i}}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.view.state.doc.length;if(a>n){let r=(t.lineBlockAt(a).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(B.replace({widget:new bc(r),block:!0,inclusive:!0,isBlockGap:!0}).range(n,a))}if(!i)break;n=i.to+1}return B.set(e)}updateDeco(){let e=1,t=this.view.state.facet(ws).map(t=>(this.dynamicDecorationMap[e++]=typeof t==`function`)?t(this.view):t),n=!1,r=this.view.state.facet(Es).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(L.join(r))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(Ts).map(e=>typeof e==`function`?e(this.view):e)}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(fs))try{if(t(this.view,e.range,e))return!0}catch(e){gs(this.view.state,e,`scroll handler`)}let{range:t}=e,n=this.coordsAt(t.head,t.assoc??(t.empty?0: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=js(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;if(bo(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==V.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(n.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||n.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let e=this.view.docView.lineAt(t.head,1);e&&e.dom.scrollIntoView({block:`nearest`})}}lineHasWidget(e){let t=e=>e.isWidget()||e.children.some(t);return t(this.tile.resolveBlock(e,1).tile)}destroy(){lc(this.tile)}};function lc(e,t){let n=t?.get(e);if(n!=1){n??e.destroy();for(let n of e.children)lc(n,t)}}function uc(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 dc(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let r=jo(n.focusNode,n.focusOffset),i=Mo(n.focusNode,n.focusOffset),a=r||i;if(i&&r&&i.node!=r.node){let t=U.get(i.node);if(!t||t.isText()&&t.text!=i.node.nodeValue)a=i;else if(e.docView.lastCompositionAfterCursor){let e=U.get(r.node);!e||e.isText()&&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 fc(e,t,n){let r=dc(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;return{range:new Ns(c.mapPos(a),c.mapPos(o),a,o),text:i}}function pc(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 mc=class{constructor(){this.changes=[]}compareRange(e,t){ao(e,t,this.changes)}comparePoint(e,t){ao(e,t,this.changes)}boundChange(e){ao(e,e,this.changes)}};function hc(e,t,n){let r=new mc;return L.compare(e,t,n,r),r.changes}var gc=class{constructor(){this.changes=[]}compareRange(e,t){ao(e,t,this.changes)}comparePoint(){}boundChange(e){ao(e,e,this.changes)}};function _c(e,t,n){let r=new gc;return L.compare(e,t,n,r),r.changes}function vc(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 yc(e,t){let n=!1;return t&&e.iterChangedRanges((e,r)=>{e<t.to&&r>t.from&&(n=!0)}),n}var bc=class extends Qa{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement(`div`);return e.className=`cm-gap`,this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+`px`,!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}};function xc(e,t,n=1){let r=e.charCategorizer(t),i=e.doc.lineAt(t),a=t-i.from;if(i.length==0)return M.cursor(t);a==0?n=1:a==i.length&&(n=-1);let o=a,s=a;n<0?o=Yr(i.text,a,!1):s=Yr(i.text,a);let c=r(i.text.slice(o,s));for(;o>0;){let e=Yr(i.text,o,!1);if(r(i.text.slice(e,o))!=c)break;o=e}for(;s<i.length;){let e=Yr(i.text,s);if(r(i.text.slice(s,e))!=c)break;s=e}return M.range(o+i.from,s+i.from)}function Sc(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+ya(o,a,e.state.tabSize)}function Cc(e,t,n){let r=e.lineBlockAt(t);if(Array.isArray(r.type)){let e;for(let i of r.type){if(i.from>t)break;if(!(i.to<t)){if(i.from<t&&i.to>t)return i;(!e||i.type==$a.Text&&(e.type!=i.type||(n<0?i.from<t:i.to>t)))&&(e=i)}}return e||r}return r}function wc(e,t,n,r){let i=Cc(e,t.head,t.assoc||-1),a=!r||i.type!=$a.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==V.LTR)?t.right-1:t.left+1,y:(a.top+a.bottom)/2});if(o!=null)return M.cursor(o,n?-1:1)}return M.cursor(n?i.to:i.from,n?-1:1)}function Tc(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=$o(i,a,o,s,n),l=Qo;if(!t){if(i.number==(n?e.state.doc.lines:1))return s;l=`
|
|
8
|
+
`,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 Ec(e,t,n){let r=e.state.charCategorizer(t),i=r(n);return e=>{let t=r(e);return i==F.Space&&(i=t),i==t}}function Dc(e,t,n,r){let i=t.head,a=n?1:-1;if(i==(n?e.state.doc.length:0))return M.cursor(i,t.assoc);let o=t.goalColumn,s,c=e.contentDOM.getBoundingClientRect(),l=e.coordsAtPos(i,t.assoc||((t.empty?n:t.head==t.from)?1:-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=e.viewState.heightOracle.textHeight>>1,p=r??f;for(let t=0;;t+=f){let r=s+(p+t)*a,i=Mc(e,{x:d,y:r},!1,a);if(n?r>c.bottom:r<c.top)return M.cursor(i.pos,i.assoc);let l=e.coordsAtPos(i.pos,i.assoc),u=l?(l.top+l.bottom)/2:0;if(!l||(n?u>s:u<s))return M.cursor(i.pos,i.assoc,void 0,o)}}function Oc(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 kc(e,t){let n=null;for(let r=0;r<t.ranges.length;r++){let i=t.ranges[r],a=null;if(i.empty){let t=Oc(e,i.from,0);t!=i.from&&(a=M.cursor(t,-1))}else{let t=Oc(e,i.from,-1),n=Oc(e,i.to,1);(t!=i.from||n!=i.to)&&(a=M.range(i.from==i.anchor?t:n,i.from==i.head?t:n))}a&&(n||=t.ranges.slice(),n[r]=a)}return n?M.create(n,t.mainIndex):t}function Ac(e,t,n){let r=Oc(e.state.facet(Ds).map(t=>t(e)),n.from,t.head>n.from?-1:1);return r==n.from?n:M.cursor(r,r<n.from?1:-1)}var jc=class{constructor(e,t){this.pos=e,this.assoc=t}};function Mc(e,t,n,r){let i=e.contentDOM.getBoundingClientRect(),a=i.top+e.viewState.paddingTop,{x:o,y:s}=t,c=s-a,l;for(;;){if(c<0)return new jc(0,1);if(c>e.viewState.docHeight)return new jc(e.state.doc.length,-1);if(l=e.elementAtHeight(c),r==null)break;if(l.type==$a.Text){if(r<0?l.to<e.viewport.from:l.from>e.viewport.to)break;let t=e.docView.coordsAt(r<0?l.from:l.to,r>0?-1:1);if(t&&(r<0?t.top<=c+a:t.bottom>=c+a))break}let t=e.viewState.heightOracle.textHeight/2;c=r>0?l.bottom+t:l.top-t}if(e.viewport.from>=l.to||e.viewport.to<=l.from){if(n)return null;if(l.type==$a.Text){let t=Sc(e,i,l,o,s);return new jc(t,t==l.from?1:-1)}}if(l.type!=$a.Text)return c<(l.top+l.bottom)/2?new jc(l.from,1):new jc(l.to,-1);let u=e.docView.lineAt(l.from,2);return(!u||u.length!=l.length)&&(u=e.docView.lineAt(l.from,-2)),new Nc(e,o,s,e.textDirectionAt(l.from)).scanTile(u,l.from)}var Nc=class{constructor(e,t,n,r){this.view=e,this.x=t,this.y=n,this.baseDir=r,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,t){let{line:n,spans:r}=this.bidiSpansAt(e);return r[Uo.find(r,e-n.from,-1,t)].level==this.baseDir}dirAt(e,t){let{line:n,spans:r}=this.bidiSpansAt(e);return r[Uo.find(r,e-n.from,-1,t)].dir}bidiIn(e,t){let{spans:n,line:r}=this.bidiSpansAt(e);return n.length>1||n.length&&(n[0].level!=this.baseDir||n[0].to+r.from<t)}scan(e,t){let n=0,r=e.length-1,i=new Set,a=this.bidiIn(e[0],e[r]),o,s,c=-1,l=1e9,u;search:for(;n<r;){let d=r-n,f=n+r>>1;adjust:if(i.has(f)){let e=n+Math.floor(Math.random()*d);for(let t=0;t<d;t++){if(!i.has(e)){f=e;break adjust}e++,e==r&&(e=n)}break search}i.add(f);let p=t(f);if(p)for(let t=0;t<p.length;t++){let i=p[t],d=0;if(!(i.width==0&&p.length>1)){if(i.bottom<this.y)(!o||o.bottom<i.bottom)&&(o=i),d=1;else if(i.top>this.y)(!s||s.top>i.top)&&(s=i),d=-1;else{let e=i.left>this.x?this.x-i.left:i.right<this.x?this.x-i.right:0,t=Math.abs(e);t<l&&(c=f,l=t,u=i),e&&(d=e<0==(this.baseDir==V.LTR)?-1:1)}d==-1&&(!a||this.baseDirAt(e[f],1))?r=f:d==1&&(!a||this.baseDirAt(e[f+1],-1))&&(n=f+1)}}}if(!u){let n=o&&(!s||this.y-o.bottom<s.top-this.y)?o:s;return this.y=(n.top+n.bottom)/2,this.scan(e,t)}let d=(a?this.dirAt(e[c],1):this.baseDir)==V.LTR;return{i:c,after:this.x>(u.left+u.right)/2==d}}scanText(e,t){let n=[];for(let r=0;r<e.length;r=Yr(e.text,r))n.push(t+r);n.push(t+e.length);let r=this.scan(n,r=>{let i=n[r]-t,a=n[r+1]-t;return Eo(e.dom,i,a).getClientRects()});return r.after?new jc(n[r.i+1],-1):new jc(n[r.i],1)}scanTile(e,t){if(!e.length)return new jc(t,1);if(e.children.length==1){let n=e.children[0];if(n.isText())return this.scanText(n,t);if(n.isComposite())return this.scanTile(n,t)}let n=[t];for(let r=0,i=t;r<e.children.length;r++)n.push(i+=e.children[r].length);let r=this.scan(n,t=>{let n=e.children[t];return n.flags&48?null:(n.dom.nodeType==1?n.dom:Eo(n.dom,0,n.length)).getClientRects()}),i=e.children[r.i],a=n[r.i];return i.isText()?this.scanText(i,a):i.isComposite()?this.scanTile(i,a):r.after?new jc(n[r.i+1],-1):new jc(a,1)}},Pc=``,Fc=class{constructor(e,t){this.points=e,this.view=t,this.text=``,this.lineSeparator=t.state.facet(I.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Pc}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=U.get(r),a=r.nextSibling;if(a==t){i?.breakAfter&&!a&&n!=this.view.contentDOM&&this.lineBreak();break}let o=U.get(a);(i&&o?i.breakAfter:(i?i.breakAfter:mo(r))||mo(a)&&(r.nodeName!=`BR`||i?.isWidget())&&this.text.length>e)&&!Lc(a,t)&&this.lineBreak(),r=a}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){let t=U.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+(Ic(e,n.node,n.offset)?t:0))}};function Ic(e,t,n){for(;;){if(!t||n<go(t))return!1;if(t==e)return!0;n=po(t)+1,t=t.parentNode}}function Lc(e,t){let n;for(;!(e==t||!e);e=e.nextSibling){let t=U.get(e);if(!t?.isWidget())return!1;t&&(n||=[]).push(t)}if(n){for(let e of n)if(e.overrideDOMText?.length)return!1}return!0}var Rc=class{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}},zc=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,o=e.state.selection;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=Bc(e.docView.tile,t,n,0))){let t=i||a?[]:Gc(e),n=new Fc(t,e);n.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=n.text,this.newSel=Kc(t,this.bounds.from)}else{let t=e.observer.selectionRange,n=i&&i.node==t.focusNode&&i.offset==t.focusOffset||!co(e.contentDOM,t.focusNode)?o.main.head:e.docView.posFromDOM(t.focusNode,t.focusOffset),r=a&&a.node==t.anchorNode&&a.offset==t.anchorOffset||!co(e.contentDOM,t.anchorNode)?o.main.anchor:e.docView.posFromDOM(t.anchorNode,t.anchorOffset),s=e.viewport;if((z.ios||z.chrome)&&o.main.empty&&n!=r&&(s.from>0||s.to<e.state.doc.length)){let t=Math.min(n,r),i=Math.max(n,r),a=s.from-t,o=s.to-i;(a==0||a==1||t==0)&&(o==0||o==-1||i==e.state.doc.length)&&(n=0,r=e.state.doc.length)}if(e.inputState.composing>-1&&o.ranges.length>1)this.newSel=o.replaceRange(M.range(r,n));else if(e.lineWrapping&&r==n&&!(o.main.empty&&o.main.head==n)&&e.inputState.lastTouchTime>Date.now()-100){let t=e.coordsAtPos(n,-1),r=0;t&&(r=e.inputState.lastTouchY<=t.bottom?-1:1),this.newSel=M.create([M.cursor(n,r)])}else this.newSel=M.single(r,n)}}};function Bc(e,t,n,r){if(e.isComposite()){let i=-1,a=-1,o=-1,s=-1;for(let c=0,l=r,u=r;c<e.children.length;c++){let r=e.children[c],d=l+r.length;if(l<t&&d>n)return Bc(r,t,n,l);if(d>=t&&i==-1&&(i=c,a=l),l>n&&r.dom.parentNode==e.dom){o=c,s=u;break}u=d,l=d+r.breakAfter}return{from:a,to:s<0?r+e.length:s,startDOM:(i?e.children[i-1].dom.nextSibling:null)||e.dom.firstChild,endDOM:o<e.children.length&&o>=0?e.children[o].dom:null}}else if(e.isText())return{from:r,to:r+e.length,startDOM:e.dom,endDOM:e.dom.nextSibling};else return null}function Vc(e,t){let n,{newSel:r}=t,{state:i}=e,a=i.selection.main,o=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:e,to:r}=t.bounds,s=a.from,c=null;(o===8||z.android&&t.text.length<r-e)&&(s=a.to,c=`end`);let l=i.doc.sliceString(e,r,Pc),u,d;!a.empty&&a.from>=e&&a.to<=r&&(t.typeOver||l!=t.text)&&l.slice(0,a.from-e)==t.text.slice(0,a.from-e)&&l.slice(a.to-e)==t.text.slice(u=t.text.length-(l.length-(a.to-e)))?n={from:a.from,to:a.to,insert:j.of(t.text.slice(a.from-e,u).split(Pc))}:(d=Wc(l,t.text,s-e,c))&&(z.chrome&&o==13&&d.toB==d.from+2&&t.text.slice(d.from,d.toB)==Pc+Pc&&d.toB--,n={from:e+d.from,to:e+d.toA,insert:j.of(t.text.slice(d.from,d.toB).split(Pc))})}else r&&(!e.hasFocus&&i.facet(_s)||qc(r,a))&&(r=null);if(!n&&!r)return!1;if((z.mac||z.android)&&n&&n.from==n.to&&n.from==a.head-1&&/^\. ?$/.test(n.insert.toString())&&e.contentDOM.getAttribute(`autocorrect`)==`off`?(r&&n.insert.length==2&&(r=M.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:j.of([n.insert.toString().replace(`.`,` `)])}):i.doc.lineAt(a.from).to<a.to&&e.docView.lineHasWidget(a.to)&&e.inputState.insertingTextAt>Date.now()-50?n={from:a.from,to:a.to,insert:i.toText(e.inputState.insertingText)}:z.chrome&&n&&n.from==n.to&&n.from==a.head&&n.insert.toString()==`
|
|
9
|
+
`&&e.lineWrapping&&(r&&=M.single(r.main.anchor-1,r.main.head-1),n={from:a.from,to:a.to,insert:j.of([` `])}),n)return Hc(e,n,r,o);if(r&&!qc(r,a)){let t=!1,n=`select`;return e.inputState.lastSelectionTime>Date.now()-50&&(e.inputState.lastSelectionOrigin==`select`&&(t=!0),n=e.inputState.lastSelectionOrigin,n==`select.pointer`&&(r=kc(i.facet(Ds).map(t=>t(e)),r))),e.dispatch({selection:r,scrollIntoView:t,userEvent:n}),!0}else return!1}function Hc(e,t,n,r=-1){if(z.ios&&e.inputState.flushIOSKey(t))return!0;let i=e.state.selection.main;if(z.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&&Do(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)&&Do(e.contentDOM,`Backspace`,8)||t.from==i.from&&t.to==i.to+1&&t.insert.length==0&&Do(e.contentDOM,`Delete`,46)))return!0;let a=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let o,s=()=>o||=Uc(e,t,n);return e.state.facet(os).some(n=>n(e,t.from,t.to,a,s))||e.dispatch(s()),!0}function Uc(e,t,n){let r,i=e.state,a=i.selection.main,o=-1;if(t.from==t.to&&t.from<a.from||t.from>a.to){let n=t.from<a.from?-1:1,r=n<0?a.from:a.to,s=Oc(i.facet(Ds).map(t=>t(e)),r,n);t.from==s&&(o=s)}if(o>-1)r={changes:t,selection:M.cursor(t.from+t.insert.length,-1)};else 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||e.inputState.compositionPendingChange)&&t.to<=a.to+10&&t.to>=a.to-10){let c=e.state.sliceDoc(t.from,t.to),l,u=n&&dc(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;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(e.state.sliceDoc(u,r)!=c||r>=l.from&&u<=l.to)return{range:n};let f=i.changes({from:u,to:r,insert:t.insert}),p=n.to-a.to;return{changes:f,range:s?M.range(Math.max(0,s.anchor+p),Math.max(0,s.head+p)):n.map(f)}})}else r={changes:o,selection:s&&i.selection.replaceRange(s)}}let s=`input.type`;return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,s+=`.compose`,e.inputState.compositionFirstChange&&(s+=`.start`,e.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:s,scrollIntoView:!0})}function Wc(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 Gc(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 Rc(n,r)),(i!=n||a!=r)&&t.push(new Rc(i,a))),t}function Kc(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?M.single(n+t,r+t):null}function qc(e,t){return t.head==e.main.head&&t.anchor==e.main.anchor}var Jc=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.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText=``,this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,z.safari&&e.contentDOM.addEventListener(`input`,()=>null),z.gecko&&Al(e.contentDOM.ownerDocument)}handleEvent(e){!sl(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=Xc(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&&$c.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),z.android&&z.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return z.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&!e.shiftKey&&((t=Zc.find(t=>t.keyCode==e.keyCode))&&!e.ctrlKey||Qc.indexOf(e.key)>-1&&e.ctrlKey)?(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,Do(this.view.contentDOM,t.key,t.keyCode,t instanceof KeyboardEvent?t:void 0))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:z.safari&&!z.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}};function Yc(e,t){return(n,r)=>{try{return t.call(e,r,n)}catch(e){gs(n.state,e)}}}function Xc(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,r=e&&e.plugin.domEventHandlers,i=e&&e.plugin.domEventObservers;if(r)for(let e in r){let i=r[e];i&&n(e).handlers.push(Yc(t.value,i))}if(i)for(let e in i){let r=i[e];r&&n(e).observers.push(Yc(t.value,r))}}for(let e in cl)n(e).handlers.push(cl[e]);for(let e in ll)n(e).observers.push(ll[e]);return t}var Zc=[{key:`Backspace`,keyCode:8,inputType:`deleteContentBackward`},{key:`Enter`,keyCode:13,inputType:`insertParagraph`},{key:`Enter`,keyCode:13,inputType:`insertLineBreak`},{key:`Delete`,keyCode:46,inputType:`deleteContentForward`}],Qc=`dthko`,$c=[16,17,18,20,91,92,224,225],el=6;function tl(e){return Math.max(0,e)*.7+8}function nl(e,t){return Math.max(Math.abs(e.clientX-t.clientX),Math.abs(e.clientY-t.clientY))}var rl=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=xo(e.contentDOM),this.atoms=e.state.facet(Ds).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(I.allowMultipleSelections)&&il(e,t),this.dragging=ol(e,t)&&yl(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&&nl(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=js(this.view);e.clientX-s.left<=r+el?t=-tl(r-e.clientX):e.clientX+s.right>=a-el&&(t=tl(e.clientX-a)),e.clientY-s.top<=i+el?n=-tl(i-e.clientY):e.clientY+s.bottom>=o-el&&(n=tl(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)}select(e){let{view:t}=this,n=kc(this.atoms,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 il(e,t){let n=e.state.facet(ts);return n.length?n[0](t):z.mac?t.metaKey:t.ctrlKey}function al(e,t){let n=e.state.facet(ns);return n.length?n[0](t):z.mac?!t.altKey:!t.ctrlKey}function ol(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let r=so(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 sl(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=U.get(n))&&r.isWidget()&&!r.isHidden&&r.widget.ignoreEvent(t))return!1;return!0}var cl=Object.create(null),ll=Object.create(null),ul=z.ie&&z.ie_version<15||z.ios&&z.webkit_version<604;function dl(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(),pl(e,n.value)},50)}function fl(e,t,n){for(let r of e.facet(t))n=r(n,e);return n}function pl(e,t){t=fl(e.state,cs,t);let{state:n}=e,r,i=1,a=n.toText(t),o=a.lines==n.selection.ranges.length;if(Tl!=null&&n.selection.ranges.every(e=>e.empty)&&Tl==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:M.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:M.cursor(e.from+t.length)}}):n.replaceSelection(a);e.dispatch(r,{userEvent:`input.paste`,scrollIntoView:!0})}ll.scroll=e=>{e.inputState.lastScrollTop=e.scrollDOM.scrollTop,e.inputState.lastScrollLeft=e.scrollDOM.scrollLeft},ll.wheel=ll.mousewheel=e=>{e.inputState.lastWheelEvent=Date.now()},cl.keydown=(e,t)=>(e.inputState.setSelectionOrigin(`select`),t.keyCode==27&&e.inputState.tabFocusMode!=0&&(e.inputState.tabFocusMode=Date.now()+2e3),!1),ll.touchstart=(e,t)=>{let n=e.inputState,r=t.targetTouches[0];n.lastTouchTime=Date.now(),r&&(n.lastTouchX=r.clientX,n.lastTouchY=r.clientY),n.setSelectionOrigin(`select.pointer`)},ll.touchmove=e=>{e.inputState.setSelectionOrigin(`select.pointer`)},cl.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(rs))if(n=r(e,t),n)break;if(!n&&t.button==0&&(n=bl(e,t)),n){let r=!e.hasFocus;e.inputState.startMouseSelection(new rl(e,t,n,r)),r&&e.observer.ignore(()=>{wo(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}else e.inputState.setSelectionOrigin(`select.pointer`);return!1};function ml(e,t,n,r){if(r==1)return M.cursor(t,n);if(r==2)return xc(e.state,t,n);{let r=e.docView.lineAt(t,n),i=e.state.doc.lineAt(r?r.posAtEnd:t),a=r?r.posAtStart:i.from,o=r?r.posAtEnd:i.to;return o<e.state.doc.length&&o==i.to&&o++,M.range(a,o)}}var hl=z.ie&&z.ie_version<=11,gl=null,_l=0,vl=0;function yl(e){if(!hl)return e.detail;let t=gl,n=vl;return gl=e,vl=Date.now(),_l=!t||n>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(_l+1)%3:1}function bl(e,t){let n=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),r=yl(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.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),c,l=ml(e,s.pos,s.assoc,r);if(n.pos!=s.pos&&!a){let t=ml(e,n.pos,n.assoc,r),i=Math.min(t.from,l.from),a=Math.max(t.to,l.to);l=i<l.from?M.range(i,a,l.assoc):M.range(a,i,l.assoc)}return a?i.replaceRange(i.main.extend(l.from,l.to,l.assoc)):o&&r==1&&i.ranges.length>1&&(c=xl(i,s.pos))?c:o?i.addRange(l):M.create([l])}}}function xl(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 M.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-(e.mainIndex>n?1:0))}return null}cl.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let r=e.docView.tile.nearest(t.target);if(r&&r.isWidget()){let e=r.posAtStart,t=e+r.length;(e>=n.to||t<=n.from)&&(n=M.range(e,t))}}let{inputState:r}=e;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData(`Text`,fl(e.state,ls,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed=`copyMove`),!1},cl.dragend=e=>(e.inputState.draggedContent=null,!1);function Sl(e,t,n,r){if(n=fl(e.state,cs,n),!n)return;let i=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:a}=e.inputState,o=r&&a&&al(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}cl.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&&Sl(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 Sl(e,t,n,!0),!0}return!1},cl.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=ul?null:t.clipboardData;return n?(pl(e,n.getData(`text/plain`)||n.getData(`text/uri-list`)),!0):(dl(e),!1)};function Cl(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 wl(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:fl(e,ls,t.join(e.lineBreak)),ranges:n,linewise:r}}var Tl=null;cl.copy=cl.cut=(e,t)=>{if(!lo(e.contentDOM,e.observer.selectionRange))return!1;let{text:n,ranges:r,linewise:i}=wl(e.state);if(!n&&!i)return!1;Tl=i?n:null,t.type==`cut`&&!e.state.readOnly&&e.dispatch({changes:r,scrollIntoView:!0,userEvent:`delete.cut`});let a=ul?null:t.clipboardData;return a?(a.clearData(),a.setData(`text/plain`,n),!0):(Cl(e,n),!1)};var El=Ri.define();function Dl(e,t){let n=[];for(let r of e.facet(ss)){let i=r(e,t);i&&n.push(i)}return n.length?e.update({effects:n,annotations:El.of(!0)}):null}function Ol(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=Dl(e.state,t);n?e.dispatch(n):e.update([])}},10)}ll.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),Ol(e)},ll.blur=e=>{e.observer.clearSelectionRange(),Ol(e)},ll.compositionstart=ll.compositionupdate=e=>{e.observer.editContext||(e.inputState.compositionFirstChange??(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))},ll.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,z.chrome&&z.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))},ll.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()},cl.beforeinput=(e,t)=>{if((t.inputType==`insertText`||t.inputType==`insertCompositionText`)&&(e.inputState.insertingText=t.data,e.inputState.insertingTextAt=Date.now()),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 Hc(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(z.chrome&&z.android&&(n=Zc.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 z.ios&&t.inputType==`deleteContentForward`&&e.observer.flushSoon(),z.safari&&t.inputType==`insertText`&&e.inputState.composing>=0&&setTimeout(()=>ll.compositionend(e,t),20),!1};var kl=new Set;function Al(e){kl.has(e)||(kl.add(e),e.addEventListener(`copy`,()=>{}),e.addEventListener(`cut`,()=>{}))}var jl=[`pre-wrap`,`normal`,`pre-line`,`break-spaces`],Ml=!1;function Nl(){Ml=!1}var Pl=class{constructor(e){this.lineWrapping=e,this.doc=j.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)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return jl.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=jl.indexOf(e)>-1,s=Math.abs(t-this.lineHeight)>.3||this.lineWrapping!=o||Math.abs(n-this.charWidth)>.1;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}},Fl=class{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}},Il=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`?$a.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 no?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)}},W=(function(e){return e[e.ByPos=0]=`ByPos`,e[e.ByHeight=1]=`ByHeight`,e[e.ByPosNoHeight=2]=`ByPosNoHeight`,e})(W||={}),Ll=.001,Rl=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)>Ll&&(Ml=!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,W.ByPosNoHeight,n.setDoc(t),0,0),f=d.to>=c?d:i.lineAt(c,W.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,W.ByPosNoHeight,n,0,0));l+=d.from-s,s=d.from;let p=ql.build(n.setDoc(a),e,l,u);i=zl(i,i.replace(s,c,p))}return i.updateHeight(n,0)}static empty(){return new Hl(0,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 Wl(e.of(t.slice(0,n)),o,e.of(t.slice(r)))}};function zl(e,t){return e==t?e:(e.constructor!=t.constructor&&(Ml=!0),t)}Rl.prototype.size=1;var Bl=B.replace({}),Vl=class extends Rl{constructor(e,t,n){super(e,t),this.deco=n,this.spaceAbove=0}mainBlock(e,t){return new Il(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,t,n,r){return this.spaceAbove&&e<n+this.spaceAbove?new Il(r,0,n,this.spaceAbove,Bl):this.mainBlock(n,r)}lineAt(e,t,n,r,i){let a=this.mainBlock(r,i);return this.spaceAbove?this.blockAt(0,n,r,i).join(a):a}forEachLine(e,t,n,r,i,a){e<=i+this.length&&t>=i&&a(this.lineAt(0,W.ByPos,n,r,i))}setMeasuredHeight(e){let t=e.heights[e.index++];t<0?(this.spaceAbove=-t,t=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(t)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}},Hl=class e extends Vl{constructor(e,t,n){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=n}mainBlock(e,t){return new Il(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(t,n,r){let i=r[0];return r.length==1&&(i instanceof e||i instanceof Ul&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof Ul?i=new e(i.length,this.height,this.spaceAbove):i.height=this.height,this.outdated||(i.outdated=!1),i):Rl.of(r)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more?this.setMeasuredHeight(r):(n||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:``}${this.widgetHeight?`:`+this.widgetHeight:``})`}},Ul=class e extends Rl{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 Il(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 Il(s,c,n+o*r,o,0)}}lineAt(e,t,n,r,i){if(t==W.ByHeight)return this.blockAt(e,n,r,i);if(t==W.ByPosNoHeight){let{from:t,to:r}=n.doc.lineAt(e);return new Il(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 Il(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 Il(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 Rl.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++],a=0;n<0&&(a=-n,n=i.heights[i.index++]),s==-1?s=n:Math.abs(n-s)>=Ll&&(s=-2);let c=new Hl(e,n,a);c.outdated=!1,r.push(c),o+=e+1}o<=a&&r.push(null,new e(a-o).updateHeight(t,o));let c=Rl.of(r);return(s<0||Math.abs(c.height-this.height)>=Ll||Math.abs(s-this.heightMetrics(t,n).perLine)>=Ll)&&(Ml=!0),zl(this,c)}else (r||this.outdated)&&(this.setHeight(t.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}},Wl=class extends Rl{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==W.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==W.ByPosNoHeight?W.ByPosNoHeight:W.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,W.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&&Gl(i,a-1),t<this.length){let e=i.length;this.decomposeRight(t,i),Gl(i,e)}return Rl.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?Rl.of(this.break?[e,null,t]:[e,t]):(this.left=zl(this.left,e),this.right=zl(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 Gl(e,t){let n,r;e[t]==null&&(n=e[t-1])instanceof Ul&&(r=e[t+1])instanceof Ul&&e.splice(t-1,3,new Ul(n.length+1+r.length))}var Kl=5,ql=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 Hl?n.length+=e-this.pos:(e>this.pos||!this.isCovered)&&this.nodes.push(new Hl(e-this.pos,-1,0)),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 Vl(a,r,n)):(a||i||r>=Kl)&&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 Hl(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,t){let n=new Ul(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 Hl)return e;let t=new Hl(0,-1,0);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos+=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 Hl)&&!this.isCovered?this.nodes.push(new Hl(0,-1,0)):(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 Hl&&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 L.spans(n,r,i,a,0),a.finish(r)}};function Jl(e,t,n){let r=new Yl;return L.compare(e,t,n,r,0),r.changes}var Yl=class{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,n,r){(e<t||n&&n.heightRelevant||r&&r.heightRelevant)&&ao(e,t,this.changes,5)}};function Xl(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 Zl(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 Ql(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}var $l=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 B.replace({widget:new eu(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}},eu=class extends Qa{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}},tu=class{constructor(e,t){this.view=e,this.state=t,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.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=su,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=V.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1,this.heightOracle=new Pl(t.facet(Cs).some(e=>typeof e!=`function`&&e.class==`cm-lineWrapping`)),this.stateDeco=cu(t),this.heightMap=Rl.empty().applyChanges(this.stateDeco,j.empty,this.heightOracle.setDoc(t.doc),[new Ns(0,0,0,t.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=B.set(this.lineGaps.map(e=>e.draw(this,!1))),this.scrollParent=e.scrollDOM,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 nu(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?su:new lu(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(uu(e,this.scaler))})}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=cu(this.state);let r=e.changedRanges,i=Ns.extendWithRanges(r,Jl(n,this.stateDeco,e?e.changes:ii.empty(this.state.doc.length))),a=this.heightMap.height,o=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);Nl(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),i),(this.heightMap.height!=a||Ml)&&(e.flags|=2),o?(this.scrollAnchorPos=e.changes.mapPos(o.from,-1),this.scrollAnchorHeight=o.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=a);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.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(ds)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,t=e.contentDOM,n=window.getComputedStyle(t),r=this.heightOracle,i=n.whiteSpace;this.defaultTextDirection=n.direction==`rtl`?V.RTL:V.LTR;let a=this.heightOracle.mustRefreshForWrapping(i)||this.mustMeasureContent===`refresh`,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}=yo(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=xo(this.view.contentDOM,!1).y;f!=this.scrollParent&&(this.scrollParent=f,this.scrollAnchorHeight=-1,this.scrollOffset=0);let p=this.getScrollOffset();this.scrollOffset!=p&&(this.scrollAnchorHeight=-1,this.scrollOffset=p),this.scrolledToBottom=Ao(this.scrollParent||e.win);let m=(this.printing?Ql:Xl)(t,this.paddingTop),h=m.top-this.pixelViewport.top,g=m.bottom-this.pixelViewport.bottom;this.pixelViewport=m;let _=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(_!=this.inView&&(this.inView=_,_&&(s=!0)),!this.inView&&!this.scrollTarget&&!Zl(e.dom))return 0;let v=o.width;if((this.contentDOMWidth!=v||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(v-this.contentDOMWidth)>r.charWidth){let{lineHeight:n,charWidth:o,textHeight:s}=e.docView.measureTextSize();a=n>0&&r.refresh(i,n,o,s,Math.max(5,v/o),t),a&&(e.docView.minWidth=0,c|=16)}h>0&&g>0?l=Math.max(h,g):h<0&&g<0&&(l=Math.min(h,g)),Nl();for(let n of this.viewports){let i=n.from==this.viewport.from?t:e.docView.measureVisibleLineHeights(n);this.heightMap=(a?Rl.empty().applyChanges(this.stateDeco,j.empty,this.heightOracle,[new Ns(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,a,new Fl(n.from,i))}Ml&&(c|=2)}let y=!this.viewportIsAppropriate(this.viewport,l)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return y&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(l,this.scrollTarget),c|=this.updateForViewport()),(c&2||y)&&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 nu(r.lineAt(a-n*1e3,W.ByHeight,i,0,0).from,r.lineAt(o+(1-n)*1e3,W.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,W.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 nu(r.lineAt(o-1e3/2,W.ByHeight,i,0,0).from,r.lineAt(o+n+1e3/2,W.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 nu(this.heightMap.lineAt(n,W.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(r,W.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,W.ByPos,this.heightOracle,0,0),{bottom:i}=this.heightMap.lineAt(t,W.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 $l(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!=V.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=ou(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(M.cursor(a),!1,!0).head;e>r&&(a=e)}let e=this.gapSize(c,r,a,l);f=new $l(r,a,e,n||e<2e6?e:2e6)}o.push(f)},c=t=>{if(t.length<a||t.type!=$a.Text)return;let i=ru(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=au(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=iu(i,n),l=iu(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=au(i,o),t=((d-u)/2+a)/n;f=e-t,p=e+t}else f=(u-a)/n,p=(d+a)/n;c=iu(i,f),l=iu(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=au(r,n)-au(r,t);return this.heightOracle.lineWrapping?e.height*i:r.total*this.heightOracle.charWidth*i}updateLineGaps(e){$l.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=B.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=[];L.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)||uu(this.heightMap.lineAt(e,W.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)||uu(this.heightMap.lineAt(this.scaler.fromDOM(e),W.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}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 uu(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}},nu=class{constructor(e,t){this.from=e,this.to=t}};function ru(e,t,n){let r=[],i=e,a=0;return L.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 iu({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 au(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 ou(e,t){for(let n of e)if(t(n))return n}var su={toDOM(e){return e},fromDOM(e){return e},scale:1,eq(e){return e==this}};function cu(e){let t=e.facet(ws).filter(e=>typeof e!=`function`),n=e.facet(Es).filter(e=>typeof e!=`function`);return n.length&&t.push(L.join(n)),t}var lu=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,W.ByPos,e,0,0).top,o=t.lineAt(i,W.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 uu(e,t){if(t.scale==1)return e;let n=t.toDOM(e.top),r=t.toDOM(e.bottom);return new Il(e.from,e.length,n,r-n,Array.isArray(e._content)?e._content.map(e=>uu(e,t)):e._content)}var du=N.define({combine:e=>e.join(` `)}),fu=N.define({combine:e=>e.indexOf(!0)>-1}),pu=wa.newName(),mu=wa.newName(),hu=wa.newName(),gu={"&light":`.`+mu,"&dark":`.`+hu};function _u(e,t,n){return new wa(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 vu=_u(`.`+pu,{"&":{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-selectionHandle":{backgroundColor:`currentColor`,width:`1.5px`},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:`""`,backgroundColor:`inherit`,borderRadius:`50%`,width:`8px`,height:`8px`,position:`absolute`,left:`-3.25px`},".cm-selectionHandle-start::before":{top:`-8px`},".cm-selectionHandle-end::before":{bottom:`-8px`},".cm-dropCursor":{position:`absolute`},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:`block`},".cm-iso":{unicodeBidi:`isolate`},".cm-announced":{position:`fixed`,top:`-10000px`},"@media print":{".cm-announced":{display:`none`}},"&light .cm-activeLine":{backgroundColor:`#cceeff44`},"&dark .cm-activeLine":{backgroundColor:`#99eeff33`},"&light .cm-specialChar":{color:`red`},"&dark .cm-specialChar":{color:`#f78`},".cm-gutters":{flexShrink:0,display:`flex`,height:`100%`,boxSizing:`border-box`,zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:`#f5f5f5`,color:`#6c6c6c`,border:`0px solid #ddd`,"&.cm-gutters-before":{borderRightWidth:`1px`},"&.cm-gutters-after":{borderLeftWidth:`1px`}},"&dark .cm-gutters":{backgroundColor:`#333338`,color:`#ccc`},".cm-gutter":{display:`flex !important`,flexDirection:`column`,flexShrink:0,boxSizing:`border-box`,minHeight:`100%`,overflow:`hidden`},".cm-gutterElement":{boxSizing:`border-box`},".cm-lineNumbers .cm-gutterElement":{padding:`0 3px 0 5px`,minWidth:`20px`,textAlign:`right`,whiteSpace:`nowrap`},"&light .cm-activeLineGutter":{backgroundColor:`#e2f2ff`},"&dark .cm-activeLineGutter":{backgroundColor:`#222227`},".cm-panels":{boxSizing:`border-box`,position:`sticky`,left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:`#f5f5f5`,color:`black`},"&light .cm-panels-top":{borderBottom:`1px solid #ddd`},"&light .cm-panels-bottom":{borderTop:`1px solid #ddd`},"&dark .cm-panels":{backgroundColor:`#333338`,color:`white`},".cm-dialog":{padding:`2px 19px 4px 6px`,position:`relative`,"& label":{fontSize:`80%`}},".cm-dialog-close":{position:`absolute`,top:`3px`,right:`4px`,backgroundColor:`inherit`,border:`none`,font:`inherit`,fontSize:`14px`,padding:`0`},".cm-tab":{display:`inline-block`,overflow:`hidden`,verticalAlign:`bottom`},".cm-widgetBuffer":{verticalAlign:`text-top`,height:`1em`,width:0,display:`inline`},".cm-placeholder":{color:`#888`,display:`inline-block`,verticalAlign:`top`,userSelect:`none`},".cm-highlightSpace":{backgroundImage:`radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)`,backgroundPosition:`center`},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:`auto 100%`,backgroundPosition:`right 90%`,backgroundRepeat:`no-repeat`},".cm-trailingSpace":{backgroundColor:`#ff332255`},".cm-button":{verticalAlign:`middle`,color:`inherit`,fontSize:`70%`,padding:`.2em 1em`,borderRadius:`1px`},"&light .cm-button":{backgroundImage:`linear-gradient(#eff1f5, #d9d9df)`,border:`1px solid #888`,"&:active":{backgroundImage:`linear-gradient(#b4b4b4, #d0d3d6)`}},"&dark .cm-button":{backgroundImage:`linear-gradient(#393939, #111)`,border:`1px solid #888`,"&:active":{backgroundImage:`linear-gradient(#111, #333)`}},".cm-textfield":{verticalAlign:`middle`,color:`inherit`,fontSize:`70%`,border:`1px solid silver`,padding:`.2em .5em`},"&light .cm-textfield":{backgroundColor:`white`},"&dark .cm-textfield":{border:`1px solid #555`,backgroundColor:`inherit`}},gu),yu={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},bu=z.ie&&z.ie_version<=11,xu=class{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new So,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);(z.ie&&z.ie_version<=11||z.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&&z.android&&e.constructor.EDIT_CONTEXT!==!1&&!(z.chrome&&z.chrome_version<126)&&(this.editContext=new Tu(e),e.state.facet(_s)&&(e.contentDOM.editContext=this.editContext.editContext)),bu&&(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(_s)?n.root.activeElement!=this.dom:!lo(this.dom,r))return;let i=r.anchorNode&&n.docView.tile.nearest(r.anchorNode);if(i&&i.isWidget()&&i.widget.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(z.ie&&z.ie_version<=11||z.android&&z.chrome)&&!n.state.selection.main.empty&&r.focusNode&&fo(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=so(e.root);if(!t)return!1;let n=z.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&wu(this.view,t)||t;if(!n||this.selectionRange.eq(n))return!1;let r=lo(this.dom,n);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&ko(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,yu),bu&&this.dom.addEventListener(`DOMCharacterDataModified`,this.onCharData),!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),bu&&this.dom.removeEventListener(`DOMCharacterDataModified`,this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){this.delayedAndroidKey||(this.flushingAndroidKey=this.view.win.requestAnimationFrame(()=>{let e=this.delayedAndroidKey;e&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=e.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&e.force&&Do(this.dom,e.key,e.keyCode))})),(!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&&lo(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 zc(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=Vc(this.view,t);return this.view.state==n&&(t.domChanged||t.newSel&&!qc(this.view.state.selection,t.newSel.main))&&this.view.update([]),r}readMutation(e){let t=this.view.docView.tile.nearest(e.target);if(!t||t.isWidget())return null;if(t.markDirty(e.type==`attributes`),e.type==`childList`){let n=Su(t,e.previousSibling||e.target.previousSibling,-1),r=Su(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(_s)!=e.state.facet(_s)&&(e.view.contentDOM.editContext=e.state.facet(_s)?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 Su(e,t,n){for(;t;){let r=U.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 Cu(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,a=t.endOffset,o=e.docView.domAtPos(e.state.selection.main.anchor,1);return fo(o.node,o.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function wu(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return Cu(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?Cu(e,n):null}var Tu=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=n=>{let r=e.state.selection.main,{anchor:i,head:a}=r,o=this.toEditorPos(n.updateRangeStart),s=this.toEditorPos(n.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:n.updateRangeStart,editorBase:o,drifted:!1});let c=s-o>n.text.length;o==this.from&&i<this.from?o=i:s==this.to&&i>this.to&&(s=i);let l=Wc(e.state.sliceDoc(o,s),n.text,(c?r.from:r.to)-o,c?`end`:null);if(!l){let t=M.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd));qc(t,r)||e.dispatch({selection:t,userEvent:`select`});return}let u={from:l.from+o,to:l.toA+o,insert:j.of(n.text.slice(l.from,l.toB).split(`
|
|
10
|
+
`))};if((z.mac||z.android)&&u.from==a-1&&/^\. ?$/.test(n.text)&&e.contentDOM.getAttribute(`autocorrect`)==`off`&&(u={from:o,to:s,insert:j.of([n.text.replace(`.`,` `)])}),this.pendingContextChange=u,!e.state.readOnly){let t=this.to-this.from+(u.to-u.from+u.insert.length);Hc(e,u,M.single(this.toEditorPos(n.selectionStart,t),this.toEditorPos(n.selectionEnd,t)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),u.from<u.to&&!u.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,n.updateRangeStart-1),Math.min(t.text.length,n.updateRangeStart+1)))&&this.handlers.compositionend(n)},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(!/none/i.test(t)&&!/none/i.test(r)){let i=this.toEditorPos(e.rangeStart),a=this.toEditorPos(e.rangeEnd);if(i<a){let e=`text-decoration: underline ${/^[a-z]/.test(t)?t+` `:t==`Dashed`?`dashed `:t==`Squiggle`?`wavy `:``}${/thin/i.test(r)?1:2}px`;n.push(B.mark({attributes:{style:e}}).range(i,a))}}}e.dispatch({effects:hs.of(B.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=so(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])}},G=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&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){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||Oo(e.parent)||document,this.viewState=new tu(this,e.state||I.create(e)),e.scrollTo&&e.scrollTo.is(ms)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(ys).map(e=>new xs(e));for(let e of this.plugins)e.update(this);this.observer=new xu(this),this.inputState=new Jc(this),this.inputState.ensureHandlers(this.plugins),this.docView=new cc(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),document.fonts?.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent=`refresh`,this.requestMeasure()})}dispatch(...e){let t=e.length==1&&e[0]instanceof Vi?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(El))?(this.inputState.notifiedFocused=a,o=1):a!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=a,s=Dl(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(I.phrases)!=this.state.facet(I.phrases))return this.setState(i);r=Ps.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 ps(e.empty?e:M.cursor(e.head,e.head>e.anchor?-1:1))}for(let e of t.effects)e.is(ms)&&(u=e.value.clip(this.state))}this.viewState.update(r,u),this.bidiCache=Ou.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),t=this.docView.update(r),this.state.facet(Ms)!=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(du)!=r.state.facet(du)&&(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(as))try{e(r)}catch(e){gs(this.state,e,`update listener`)}(s||l)&&Promise.resolve().then(()=>{s&&this.state==s.startState&&this.dispatch(s),l&&!Vc(this,l)&&c.force&&Do(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 tu(this,e),this.plugins=e.facet(ys).map(e=>new xs(e)),this.pluginMap.clear();for(let e of this.plugins)e.update(this);this.docView.destroy(),this.docView=new cc(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(ys),n=e.state.facet(ys);if(t!=n){let r=[];for(let i of n){let n=t.indexOf(i);if(n<0)r.push(new xs(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){gs(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.viewState.scrollParent,r=this.viewState.getScrollOffset(),{scrollAnchorPos:i,scrollAnchorHeight:a}=this.viewState;Math.abs(r-this.viewState.scrollOffset)>1&&(a=-1),this.viewState.scrollAnchorHeight=-1;try{for(let e=0;;e++){if(a<0)if(Ao(n||this.win))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();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 gs(this.state,e),Du}}),l=Ps.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]!=Du)try{let t=s[e];t.write&&t.write(c[e],this)}catch(e){gs(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)/this.scaleY;if((e>1||e<-1)&&(n==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){r+=e,n?n.scrollTop+=e:this.win.scrollBy(0,e),a=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let e of this.state.facet(as))e(t)}get themeClasses(){return pu+` `+(this.state.facet(fu)?hu:mu)+` `+this.state.facet(du)}updateAttrs(){let e=ku(this,Ss,{class:`cm-editor`+(this.hasFocus?` cm-focused `:` `)+this.themeClasses}),t={spellcheck:`false`,autocorrect:`off`,autocapitalize:`off`,writingsuggestions:`false`,translate:`no`,contenteditable:this.state.facet(_s)?`true`:`false`,class:`cm-content`,style:`${z.tabSize}: ${this.state.tabSize}`,role:`textbox`,"aria-multiline":`true`};this.state.readOnly&&(t[`aria-readonly`]=`true`),ku(this,Cs,t);let n=this.observer.ignore(()=>{let n=Xa(this.contentDOM,this.contentAttrs,t),r=Xa(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(Ms);let t=this.state.facet(e.cspNonce);wa.mount(this.root,this.styleModules.concat(vu).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.plugin!=e)&&this.pluginMap.set(e,t=this.plugins.find(t=>t.plugin==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,n){return Ac(this,e,Tc(this,e,t,n))}moveByGroup(e,t){return Ac(this,e,Tc(this,e,t,t=>Ec(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 M.cursor(i.side(t,r)+e.from,i.forward(!t,r)?1:-1)}moveToLineBoundary(e,t,n=!0){return wc(this,e,t,n)}moveVertically(e,t,n){return Ac(this,e,Dc(this,e,t,n))}domAtPos(e,t=1){return this.docView.domAtPos(e,t)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){this.readMeasured();let n=Mc(this,e,t);return n&&n.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),Mc(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[Uo.find(i,e-r.from,-1,t)];return _o(n,a.dir==V.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(us)||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>Eu)return Zo(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||Wo(r.isolates,n=ks(this,e))))return r.order;n||=ks(this,e);let r=Xo(e.text,t,n);return this.bidiCache.push(new Ou(e.from,e.to,t,n,!0,r)),r}get hasFocus(){return(this.dom.ownerDocument.hasFocus()||z.safari&&this.inputState?.lastContextMenu>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{wo(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 ms.of(new ps(typeof e==`number`?M.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 ms.of(new ps(M.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 bs.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return bs.define(()=>({}),{eventObservers:e})}static theme(e,t){let n=wa.newName(),r=[du.of(n),Ms.of(_u(`.${n}`,e))];return t&&t.dark&&r.push(fu.of(!0)),r}static baseTheme(e){return Ci.lowest(Ms.of(_u(`.`+pu,e,gu)))}static findFromDOM(e){let t=e.querySelector(`.cm-content`);return(t&&U.get(t)||U.get(e))?.root?.view||null}};G.styleModule=Ms,G.inputHandler=os,G.clipboardInputFilter=cs,G.clipboardOutputFilter=ls,G.scrollHandler=fs,G.focusChangeEffect=ss,G.perLineTextDirection=us,G.exceptionSink=is,G.updateListener=as,G.editable=_s,G.mouseSelectionStyle=rs,G.dragMovesSelection=ns,G.clickAddsSelectionRange=ts,G.decorations=ws,G.blockWrappers=Ts,G.outerDecorations=Es,G.atomicRanges=Ds,G.bidiIsolatedRanges=Os,G.scrollMargins=As,G.darkTheme=fu,G.cspNonce=N.define({combine:e=>e.length?e[0]:``}),G.contentAttributes=Cs,G.editorAttributes=Ss,G.lineWrapping=G.contentAttributes.of({class:`cm-lineWrapping`}),G.announce=P.define();var Eu=4096,Du={},Ou=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:V.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 ku(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&&Ka(a,n)}return n}var Au=z.mac?`mac`:z.windows?`win`:z.linux?`linux`:`key`;function ju(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 Mu(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 Nu=Ci.default(G.domEventHandlers({keydown(e,t){return Hu(Iu(t.state),e,t,`editor`)}})),Pu=N.define({enables:Nu}),Fu=new WeakMap;function Iu(e){let t=e.facet(Pu),n=Fu.get(t);return n||Fu.set(t,n=Bu(t.reduce((e,t)=>e.concat(t),[]))),n}function Lu(e,t,n){return Hu(Iu(e.state),t,e,n)}var Ru=null,zu=4e3;function Bu(e,t=Au){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=>ju(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=Ru={view:t,prefix:n,scope:e};return setTimeout(()=>{Ru==r&&(Ru=null)},zu),!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,Vu))}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 Vu=null;function Hu(e,t,n,r){Vu=t;let i=Na(t),a=ei(Qr(i,0))==i.length&&i!=` `,o=``,s=!1,c=!1,l=!1;Ru&&Ru.view==n&&Ru.scope==r&&(o=Ru.prefix+` `,$c.indexOf(t.keyCode)<0&&(c=!0,Ru=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+Mu(i,t,!a)])?s=!0:a&&(t.altKey||t.metaKey||t.ctrlKey)&&!(z.windows&&t.ctrlKey&&t.altKey)&&!(z.mac&&t.altKey&&!(t.ctrlKey||t.metaKey))&&(p=Da[t.keyCode])&&p!=i?(d(f[o+Mu(p,t,!0)])||t.shiftKey&&(m=Oa[t.keyCode])!=i&&m!=p&&d(f[o+Mu(m,t,!1)]))&&(s=!0):a&&t.shiftKey&&d(f[o+Mu(i,t,!0)])&&(s=!0),!s&&d(f._any)&&(s=!0)),c&&(s=!0),s&&l&&t.stopPropagation(),Vu=null,s}var Uu=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=Wu(t);return[new e(n,i.left-a.left,i.top-a.top,null,i.bottom-i.top)]}else return Ku(t,n,r)}};function Wu(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==V.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function Gu(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 Ku(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==V.LTR,o=e.contentDOM,s=o.getBoundingClientRect(),c=Wu(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=Cc(e,r,1),m=Cc(e,i,-1),h=p.type==$a.Text?p:null,g=m.type==$a.Text?m:null;if(h&&(e.lineWrapping||p.widgetLineBreaks)&&(h=Gu(e,r,1,h)),g&&(e.lineWrapping||m.widgetLineBreaks)&&(g=Gu(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):ee(p,!1),r=g?y(null,n.to,g):ee(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==$a.Text&&(t.bottom=r.top=(t.bottom+r.top)/2),v(t).concat(i).concat(v(r))}function _(e,n,r,i){return new Uu(t,e-c.left,n-c.top,Math.max(0,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==V.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 ee(e,t){let n=s.top+(t?e.top:e.bottom);return{top:n,bottom:n,horizontal:[]}}}function qu(e,t){return e.constructor==t.constructor&&e.eq(t)}var Ju=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(Yu)!=e.state.facet(Yu)&&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(Yu);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)=>!qu(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,z.safari&&z.safari_version>=26&&(this.dom.style.display=this.dom.firstChild?``:`none`)}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}},Yu=N.define();function Xu(e){return[bs.define(t=>new Ju(t,e)),Yu.of(e)]}var Zu=N.define({combine(e){return ea(e,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function Qu(e={}){return[Zu.of(e),ed,nd,rd,ds.of(!0)]}function $u(e){return e.startState.facet(Zu)!=e.state.facet(Zu)}var ed=Xu({above:!0,markers(e){let{state:t}=e,n=t.facet(Zu),r=[];for(let i of t.selection.ranges){let a=i==t.selection.main;if(i.empty||n.drawRangeCursor&&!(a&&z.ios&&n.iosSelectionHandles)){let t=a?`cm-cursor cm-cursor-primary`:`cm-cursor cm-cursor-secondary`,n=i.empty?i:M.cursor(i.head,i.assoc);for(let i of Uu.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=$u(e);return n&&td(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){td(t.state,e)},class:`cm-cursorLayer`});function td(e,t){t.style.animationDuration=e.facet(Zu).cursorBlinkRate+`ms`}var nd=Xu({above:!1,markers(e){let t=[],{main:n,ranges:r}=e.state.selection;for(let n of r)if(!n.empty)for(let r of Uu.forRange(e,`cm-selectionBackground`,n))t.push(r);if(z.ios&&!n.empty&&e.state.facet(Zu).iosSelectionHandles){for(let r of Uu.forRange(e,`cm-selectionHandle cm-selectionHandle-start`,M.cursor(n.from,1)))t.push(r);for(let r of Uu.forRange(e,`cm-selectionHandle cm-selectionHandle-end`,M.cursor(n.to,1)))t.push(r)}return t},update(e,t){return e.docChanged||e.selectionSet||e.viewportChanged||$u(e)},class:`cm-selectionLayer`}),rd=Ci.highest(G.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:`transparent !important`},caretColor:`transparent !important`},".cm-content":{caretColor:`transparent !important`,"& :focus":{caretColor:`initial !important`,"&::selection, & ::selection":{backgroundColor:`Highlight !important`}}}})),id=P.define({map(e,t){return e==null?null:t.mapPos(e)}}),ad=bi.define({create(){return null},update(e,t){return e!=null&&(e=t.changes.mapPos(e)),t.effects.reduce((e,t)=>t.is(id)?t.value:e,e)}}),od=bs.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(ad);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(ad)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field(ad),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(ad)!=e&&this.view.dispatch({effects:id.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 sd(){return[ad,od]}function cd(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 ld(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 ud=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 sa,n=t.add.bind(t);for(let{from:t,to:r}of ld(e,this.maxLength))cd(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 cd(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}},dd=/x/.unicode==null?`g`:`gu`,fd=RegExp(`[\0-\b
|
|
11
|
+
--\u2028\u2029-]`,dd),pd={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`},md=null;function hd(){if(md==null&&typeof document<`u`&&document.body){let e=document.body.style;md=(e.tabSize??e.MozTabSize)!=null}return md||!1}var gd=N.define({combine(e){let t=ea(e,{render:null,specialChars:fd,addSpecialChars:null});return(t.replaceTabs=!hd())&&(t.specialChars=RegExp(` |`+t.specialChars.source,dd)),t.addSpecialChars&&(t.specialChars=RegExp(t.specialChars.source+`|`+t.addSpecialChars.source,dd)),t}});function _d(e={}){return[gd.of(e),yd()]}var vd=null;function yd(){return vd||=bs.fromClass(class{constructor(e){this.view=e,this.decorations=B.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(gd)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new ud({regexp:e.specialChars,decoration:(t,n,r)=>{let{doc:i}=n.state,a=Qr(t[0],0);if(a==9){let e=i.lineAt(r),t=n.state.tabSize,a=va(e.text,t,r-e.from);return B.replace({widget:new Cd((t-a%t)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[a]||(this.decorationCache[a]=B.replace({widget:new Sd(e,a)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(gd);e.startState.facet(gd)==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 bd=`•`;function xd(e){return e>=32?bd:e==10?``:String.fromCharCode(9216+e)}var Sd=class extends Qa{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=xd(this.code),n=e.state.phrase(`Control character`)+` `+(pd[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}},Cd=class extends Qa{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 wd(){return Ed}var Td=B.line({class:`cm-activeLine`}),Ed=bs.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(Td.range(i.from)),t=i.from)}return B.set(n)}},{decorations:e=>e.decorations}),Dd=class extends Qa{constructor(e){super(),this.content=e}toDOM(e){let t=document.createElement(`span`);return t.className=`cm-placeholder`,t.style.pointerEvents=`none`,t.appendChild(typeof this.content==`string`?document.createTextNode(this.content):typeof this.content==`function`?this.content(e):this.content.cloneNode(!0)),t.setAttribute(`aria-hidden`,`true`),t}coordsAt(e){let t=e.firstChild?uo(e.firstChild):[];if(!t.length)return null;let n=window.getComputedStyle(e.parentNode),r=_o(t[0],n.direction!=`rtl`),i=parseInt(n.lineHeight);return r.bottom-r.top>i*1.5?{left:r.left,right:r.right,top:r.top,bottom:r.top+i}:r}ignoreEvent(){return!1}};function Od(e){let t=bs.fromClass(class{constructor(t){this.view=t,this.placeholder=e?B.set([B.widget({widget:new Dd(e),side:1}).range(0)]):B.none}get decorations(){return this.view.state.doc.length?B.none:this.placeholder}},{decorations:e=>e.decorations});return typeof e==`string`?[t,G.contentAttributes.of({"aria-placeholder":e})]:t}var kd=2e3;function Ad(e,t,n){let r=Math.min(t.line,n.line),i=Math.max(t.line,n.line),a=[];if(t.off>kd||n.off>kd||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(M.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=ya(n.text,o,e.tabSize,!0);if(r<0)a.push(M.cursor(n.to));else{let t=ya(n.text,s,e.tabSize);a.push(M.range(n.from+r,n.from+t))}}}return a}function jd(e,t){let n=e.coordsAtPos(e.viewport.from);return n?Math.round(Math.abs((n.left-t)/e.defaultCharacterWidth)):-1}function Md(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>kd?-1:i==r.length?jd(e,t.clientX):va(r.text,e.state.tabSize,n-r.from);return{line:r.number,col:a,off:i}}function Nd(e,t){let n=Md(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=Md(e,t);if(!o)return r;let s=Ad(e.state,n,o);return s.length?a?M.create(s.concat(r.ranges)):M.create(s):r}}:null}function Pd(e){let t=e?.eventFilter||(e=>e.altKey&&e.button==0);return G.mouseSelectionStyle.of((e,n)=>t(n)?Nd(e,n):null)}var Fd={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},Id={style:`cursor: crosshair`};function Ld(e={}){let[t,n]=Fd[e.key||`Alt`],r=bs.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,G.contentAttributes.of(e=>e.plugin(r)?.isDown?Id:null)]}var Rd=`-10000px`,zd=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 Bd(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}var Vd=N.define({combine:e=>({position:z.ios?`absolute`:e.find(e=>e.position)?.position||`fixed`,parent:e.find(e=>e.parent)?.parent||null,tooltipSpace:e.find(e=>e.tooltipSpace)?.tooltipSpace||Bd})}),Hd=new WeakMap,Ud=bs.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(Vd);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 zd(e,qd,(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(Vd);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=Rd,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(z.safari){let t=e.getBoundingClientRect();n=Math.abs(t.top+1e4)>1||Math.abs(t.left)>1}else n=!!e.offsetParent&&e.offsetParent!=this.container.ownerDocument.body}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=js(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(Vd).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=Rd;continue}let f=s.arrow?c.dom.querySelector(`.cm-tooltip-arrow`):null,p=f?7:0,m=d.right-d.left,h=Hd.get(c)??d.bottom-d.top,g=c.offset||Kd,_=this.view.textDirection==V.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 ee=(y?u.top-n.top:n.bottom-u.bottom)-p;if(ee<h&&c.resize!==!1){if(ee<this.view.defaultLineHeight){l.style.top=Rd;continue}Hd.set(c,h),l.style.height=(h=ee)/i+`px`}else l.style.height&&(l.style.height=``);let b=y?u.top-h-p-g.y:u.bottom+p+g.y,te=v+m;if(c.overlap!==!0)for(let e of a)e.left<te&&e.right>v&&e.top<b+h&&e.bottom>b&&(b=y?e.top-h-2-p:e.bottom+p+2);if(this.position==`absolute`?(l.style.top=(b-e.parent.top)/i+`px`,Wd(l,(v-e.parent.left)/r)):(l.style.top=b/i+`px`,Wd(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:b,right:te,bottom:b+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=Rd}},{eventObservers:{scroll(){this.maybeMeasure()}}});function Wd(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+`px`)}var Gd=G.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`}}}),Kd={x:0,y:0},qd=N.define({enables:[Ud,Gd]}),Jd=N.define({combine:e=>e.reduce((e,t)=>e.concat(t),[])}),Yd=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 zd(e,Jd,(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`)}},Xd=qd.compute([Jd],e=>{let t=e.facet(Jd);return t.length===0?null:{pos:Math.min(...t.map(e=>e.pos)),end:Math.max(...t.map(e=>e.end??e.pos)),create:Yd.create,above:t[0].above,arrow:t.some(e=>e.arrow)}}),Zd=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.tile.nearest(t.target);if(!n)return;let r,i=1;if(n.isWidget())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==V.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=>gs(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(Ud),t=e?e.manager.tooltips.findIndex(e=>e.create==Yd.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&&!$d(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:!ef(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),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener(`mouseleave`,this.mouseleave),this.view.dom.removeEventListener(`mousemove`,this.mousemove)}},Qd=4;function $d(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-Qd&&t.clientX<=r+Qd&&t.clientY>=i-Qd&&t.clientY<=a+Qd}function ef(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 tf(e,t={}){let n=P.define(),r=bi.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,ni.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(rf)&&(e=[]);return e},provide:e=>Jd.from(e)});return{active:r,extension:[r,bs.define(i=>new Zd(i,e,r,n,t.hoverTime||300)),Xd]}}function nf(e,t){let n=e.plugin(Ud);if(!n)return null;let r=n.manager.tooltips.indexOf(t);return r<0?null:n.manager.tooltipViews[r]}var rf=P.define(),af=N.define({combine(e){let t,n;for(let r of e)t||=r.topContainer,n||=r.bottomContainer;return{topContainer:t,bottomContainer:n}}});function of(e,t){let n=e.plugin(sf),r=n?n.specs.indexOf(t):-1;return r>-1?n.panels[r]:null}var sf=bs.fromClass(class{constructor(e){this.input=e.state.facet(uf),this.specs=this.input.filter(e=>e),this.panels=this.specs.map(t=>t(e));let t=e.state.facet(af);this.top=new cf(e,!0,t.topContainer),this.bottom=new cf(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(af);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new cf(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new cf(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(uf);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=>G.scrollMargins.of(t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})}),cf=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=lf(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=lf(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 lf(e){let t=e.nextSibling;return e.remove(),t}var uf=N.define({enables:sf});function df(e,t){let n,r=new Promise(e=>n=e),i=e=>hf(e,t,n);e.state.field(ff,!1)?e.dispatch({effects:pf.of(i)}):e.dispatch({effects:P.appendConfig.of(ff.init(()=>[i]))});let a=mf.of(i);return{close:a,result:r.then(t=>((e.win.queueMicrotask||(t=>e.win.setTimeout(t,10)))(()=>{e.state.field(ff).indexOf(i)>-1&&e.dispatch({effects:a})}),t))}}var ff=bi.define({create(){return[]},update(e,t){for(let n of t.effects)n.is(pf)?e=[n.value].concat(e):n.is(mf)&&(e=e.filter(e=>e!=n.value));return e},provide:e=>uf.computeN([e],t=>t.field(e))}),pf=P.define(),mf=P.define();function hf(e,t,n){let r=t.content?t.content(e,()=>o(null)):null;if(!r){if(r=R(`form`),t.input){let e=R(`input`,t.input);/^(text|password|number|email|tel|url)$/.test(e.type)&&e.classList.add(`cm-textfield`),e.name||=`input`,r.appendChild(R(`label`,(t.label||``)+`: `,e))}else r.appendChild(document.createTextNode(t.label||``));r.appendChild(document.createTextNode(` `)),r.appendChild(R(`button`,{class:`cm-button`,type:`submit`},t.submitLabel||`OK`))}let i=r.nodeName==`FORM`?[r]:r.querySelectorAll(`form`);for(let e=0;e<i.length;e++){let t=i[e];t.addEventListener(`keydown`,e=>{e.keyCode==27?(e.preventDefault(),o(null)):e.keyCode==13&&(e.preventDefault(),o(t))}),t.addEventListener(`submit`,e=>{e.preventDefault(),o(t)})}let a=R(`div`,r,R(`button`,{onclick:()=>o(null),"aria-label":e.state.phrase(`close`),class:`cm-dialog-close`,type:`button`},[`×`]));t.class&&(a.className=t.class),a.classList.add(`cm-dialog`);function o(t){a.contains(a.ownerDocument.activeElement)&&e.focus(),n(t)}return{dom:a,top:t.top,mount:()=>{if(t.focus){let e;e=typeof t.focus==`string`?r.querySelector(t.focus):r.querySelector(`input`)||r.querySelector(`button`),e&&`select`in e?e.select():e&&`focus`in e&&e.focus()}}}}var gf=class extends ta{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}};gf.prototype.elementClass=``,gf.prototype.toDOM=void 0,gf.prototype.mapMode=ni.TrackBefore,gf.prototype.startSide=gf.prototype.endSide=-1,gf.prototype.point=!0;var _f=N.define(),vf=N.define(),yf={class:``,renderEmptyElements:!1,elementStyle:``,markers:()=>L.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:`before`},bf=N.define();function xf(e){return[Cf(),bf.of({...yf,...e})]}var Sf=N.define({combine:e=>e.some(e=>e)});function Cf(e){let t=[wf];return e&&e.fixed===!1&&t.push(Sf.of(!0)),t}var wf=bs.fromClass(class{constructor(e){this.view=e,this.domAfter=null,this.prevViewport=e.viewport,this.dom=document.createElement(`div`),this.dom.className=`cm-gutters cm-gutters-before`,this.dom.setAttribute(`aria-hidden`,`true`),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+`px`,this.gutters=e.state.facet(bf).map(t=>new Of(e,t)),this.fixed=!e.state.facet(Sf);for(let e of this.gutters)e.config.side==`after`?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position=`sticky`),this.syncGutters(!1),e.scrollDOM.insertBefore(this.dom,e.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement(`div`),this.domAfter.className=`cm-gutters cm-gutters-after`,this.domAfter.setAttribute(`aria-hidden`,`true`),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+`px`,this.domAfter.style.position=this.fixed?`sticky`:``,this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(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)}if(e.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+`px`;this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(Sf)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?`sticky`:``,this.domAfter&&(this.domAfter.style.position=this.fixed?`sticky`:``)),this.prevViewport=e.view.viewport}syncGutters(e){let t=this.dom.nextSibling;e&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=L.iter(this.view.state.facet(_f),this.view.viewport.from),r=[],i=this.gutters.map(e=>new Df(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==$a.Text&&t){Ef(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==$a.Text){Ef(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),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(e){let t=e.startState.facet(bf),n=e.state.facet(bf),r=e.docChanged||e.heightChanged||e.viewportChanged||!L.eq(e.startState.facet(_f),e.state.facet(_f),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 Of(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)e.config.side==`after`?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.gutters=i}return r}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:e=>G.scrollMargins.of(t=>{let n=t.plugin(e);if(!n||n.gutters.length==0||!n.fixed)return null;let r=n.dom.offsetWidth*t.scaleX,i=n.domAfter?n.domAfter.offsetWidth*t.scaleX:0;return t.textDirection==V.LTR?{left:r,right:i}:{right:r,left:i}})});function Tf(e){return Array.isArray(e)?e:[e]}function Ef(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}var Df=class{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=L.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 kf(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=[];Ef(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(vf)){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()}}},Of=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=Tf(t.markers(e)),t.initialSpacer&&(this.spacer=new kf(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=Tf(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!L.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()}},kf=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`:``),Af(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 Af(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 jf=N.define(),Mf=N.define(),Nf=N.define({combine(e){return ea(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}})}}),Pf=class extends gf{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}};function Ff(e,t){return e.state.facet(Nf).formatNumber(t,e.state)}var If=bf.compute([Nf],e=>({class:`cm-lineNumbers`,renderEmptyElements:!1,markers(e){return e.state.facet(jf)},lineMarker(e,t,n){return n.some(e=>e.toDOM)?null:new Pf(Ff(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,n)=>{for(let r of e.state.facet(Mf)){let i=r(e,t,n);if(i)return i}return null},lineMarkerChange:e=>e.startState.facet(Nf)!=e.state.facet(Nf),initialSpacer(e){return new Pf(Ff(e,Rf(e.state.doc.lines)))},updateSpacer(e,t){let n=Ff(t.view,Rf(t.view.state.doc.lines));return n==e.number?e:new Pf(n)},domEventHandlers:e.facet(Nf).domEventHandlers,side:`before`}));function Lf(e={}){return[Nf.of(e),Cf(),If]}function Rf(e){let t=9;for(;t<e;)t=t*10+9;return t}var zf=new class extends gf{constructor(){super(...arguments),this.elementClass=`cm-activeLineGutter`}},Bf=_f.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(zf.range(i)))}return L.of(t)});function Vf(){return Bf}var Hf=new D;function Uf(e){return N.define({combine:e?t=>t.concat(e):void 0})}var Wf=new D,Gf=class{constructor(e,t,n=[],r=``){this.data=e,this.name=r,I.prototype.hasOwnProperty(`tree`)||Object.defineProperty(I.prototype,`tree`,{get(){return Jf(this)}}),this.parser=t,this.extension=[rp.of(this),I.languageData.of((e,t,n)=>{let r=Kf(e,t,n),i=r.type.prop(Hf);if(!i)return[];let a=e.facet(i),o=r.type.prop(Wf);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 Kf(e,t,n).type.prop(Hf)==this.data}findRegions(e){let t=e.facet(rp);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(Hf)==this.data){n.push({from:t,to:t+e.length});return}let i=e.prop(D.mounted);if(i){if(i.tree.prop(Hf)==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 nn&&r(i,e.positions[n]+t)}};return r(Jf(e),0),n}get allowsNesting(){return!0}};Gf.setState=P.define();function Kf(e,t,n){let r=e.facet(rp),i=Jf(e).topNode;if(!r||r.allowsNesting)for(let e=i;e;e=e.enter(t,n,O.ExcludeBuffers|O.EnterBracketed))e.type.isTop&&(i=e);return i}var qf=class e extends Gf{constructor(e,t,n){super(e,t,[],n),this.parser=t}static define(t){let n=Uf(t.languageData);return new e(n,t.parser.configure({props:[Hf.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 Jf(e){let t=e.field(Gf.state,!1);return t?t.tree:nn.empty}var Yf=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)}},Xf=null,Zf=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,[],nn.empty,0,r,[],null)}startParse(){return this.parser.startParse(new Yf(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=nn.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(Cn.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(Cn.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=Xf;Xf=this;try{return e()}finally{Xf=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=Qf(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=Cn.applyChanges(r,e),i=nn.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=Qf(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 wn{createParse(t,n,r){let i=r[0].from,a=r[r.length-1].to;return{parsedPos:i,advance(){let t=Xf;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 nn(Qt.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 Xf}};function Qf(e,t,n){return Cn.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}var $f=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=Zf.create(t.facet(rp).parser,t,{from:0,to:n});return r.work(20,n)||r.takeTree(),new e(r)}};Gf.state=bi.define({create:$f.init,update(e,t){for(let e of t.effects)if(e.is(Gf.setState))return e.value;return t.startState.facet(rp)==t.state.facet(rp)?e.apply(t):$f.init(t.state)}});var ep=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<`u`&&(ep=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});var tp=typeof navigator<`u`&&navigator.scheduling?.isInputPending?()=>navigator.scheduling.isInputPending():null,np=bs.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(Gf.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(Gf.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=ep(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(Gf.state);if(i.tree==i.context.tree&&i.context.isDone(r+1e5))return;let a=Date.now()+Math.min(this.chunkBudget,100,e&&!tp?Math.max(25,e.timeRemaining()-5):1e9),o=i.context.treeLen<r&&n.doc.length>r+1e3,s=i.context.work(()=>tp&&tp()||Date.now()>a,r+(o?0:1e5));this.chunkBudget-=Date.now()-t,(s||this.chunkBudget<=0)&&(i.context.takeTree(),this.view.dispatch({effects:Gf.setState.of(new $f(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=>gs(this.view.state,e)).then(()=>this.workScheduled--),null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),rp=N.define({combine(e){return e.length?e[0]:null},enables:e=>[Gf.state,np,G.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]}),ip=class{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}},ap=N.define(),op=N.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 sp(e){let t=e.facet(op);return t.charCodeAt(0)==9?e.tabSize*t.length:t.length}function cp(e,t){let n=``,r=e.tabSize,i=e.facet(op)[0];if(i==` `){for(;t>=r;)n+=` `,t-=r;i=` `}for(let e=0;e<t;e++)n+=i;return n}function lp(e,t){e instanceof I&&(e=new up(e));for(let n of e.state.facet(ap)){let r=n(e,t);if(r!==void 0)return r}let n=Jf(e.state);return n.length>=t?fp(e,n,t):null}var up=class{constructor(e,t={}){this.state=e,this.options=t,this.unit=sp(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 va(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}},dp=new D;function fp(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.to>r.node.to||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 pp(r,e,n)}function pp(e,t,n){for(let r=e;r;r=r.next){let e=hp(r.node);if(e)return e(_p.create(t,n,r))}return 0}function mp(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}function hp(e){let t=e.type.prop(dp);if(t)return t;let n=e.firstChild,r;if(n&&(r=n.type.prop(D.closedBy))){let t=e.lastChild,n=t&&r.indexOf(t.name)>-1;return e=>xp(e,!0,1,void 0,n&&!mp(e)?t.from:void 0)}return e.parent==null?gp:null}function gp(){return 0}var _p=class e extends up{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(vp(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return pp(this.context.next,this.base,this.pos)}};function vp(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function yp(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 bp({closing:e,align:t=!0,units:n=1}){return r=>xp(r,t,n,e)}function xp(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?yp(e):null;return c?s?e.column(c.from):e.column(c.to):e.baseIndent+(s?0:e.unit*n)}function Sp({except:e,units:t=1}={}){return n=>{let r=e&&e.test(n.textAfter);return n.baseIndent+(r?0:t*n.unit)}}var Cp=200;function wp(){return I.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+Cp)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=lp(o,t.from);if(n==null)continue;let r=/^\s*/.exec(t.text)[0],i=cp(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 Tp=N.define(),Ep=new D;function Dp(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 Op(e,t,n){let r=Jf(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(Ep);if(s&&(i.to<r.length-50||r.length==e.doc.length||!kp(i))){let r=s(i,e);r&&r.from<=n&&r.from>=t&&r.to>n&&(a=r)}}return a}function kp(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}function Ap(e,t,n){for(let r of e.facet(Tp)){let i=r(e,t,n);if(i)return i}return Op(e,t,n)}function jp(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 Mp=P.define({map:jp}),Np=P.define({map:jp});function Pp(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 Fp=bi.define({create(){return B.none},update(e,t){t.isUserEvent(`delete`)&&t.changes.iterChangedRanges((t,n)=>e=Ip(e,t,n)),e=e.map(t.changes);for(let n of t.effects)if(n.is(Mp)&&!Rp(e,n.value.from,n.value.to)){let{preparePlaceholder:r}=t.state.facet(Gp),i=r?B.replace({widget:new Yp(r(t.state,n.value))}):Jp;e=e.update({add:[i.range(n.value.from,n.value.to)]})}else n.is(Np)&&(e=e.update({filter:(e,t)=>n.value.from!=e||n.value.to!=t,filterFrom:n.value.from,filterTo:n.value.to}));return t.selection&&(e=Ip(e,t.selection.main.head)),e},provide:e=>G.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(Jp.range(r,i))}return B.set(t,!0)}});function Ip(e,t,n=t){let r=!1;return e.between(t,n,(e,i)=>{e<n&&i>t&&(r=!0)}),r?e.update({filterFrom:t,filterTo:n,filter:(e,r)=>e>=n||r<=t}):e}function Lp(e,t,n){var r;let i=null;return(r=e.field(Fp,!1))==null||r.between(t,n,(e,t)=>{(!i||i.from>e)&&(i={from:e,to:t})}),i}function Rp(e,t,n){let r=!1;return e.between(t,t,(e,i)=>{e==t&&i==n&&(r=!0)}),r}function zp(e,t){return e.field(Fp,!1)?t:t.concat(P.appendConfig.of(Kp()))}var Bp=e=>{for(let t of Pp(e)){let n=Ap(e.state,t.from,t.to);if(n)return e.dispatch({effects:zp(e.state,[Mp.of(n),Hp(e,n)])}),!0}return!1},Vp=e=>{if(!e.state.field(Fp,!1))return!1;let t=[];for(let n of Pp(e)){let r=Lp(e.state,n.from,n.to);r&&t.push(Np.of(r),Hp(e,r,!1))}return t.length&&e.dispatch({effects:t}),t.length>0};function Hp(e,t,n=!0){let r=e.state.doc.lineAt(t.from).number,i=e.state.doc.lineAt(t.to).number;return G.announce.of(`${e.state.phrase(n?`Folded lines`:`Unfolded lines`)} ${r} ${e.state.phrase(`to`)} ${i}.`)}var Up=[{key:`Ctrl-Shift-[`,mac:`Cmd-Alt-[`,run:Bp},{key:`Ctrl-Shift-]`,mac:`Cmd-Alt-]`,run:Vp},{key:`Ctrl-Alt-[`,run:e=>{let{state:t}=e,n=[];for(let r=0;r<t.doc.length;){let i=e.lineBlockAt(r),a=Ap(t,i.from,i.to);a&&n.push(Mp.of(a)),r=(a?e.lineBlockAt(a.to):i).to+1}return n.length&&e.dispatch({effects:zp(e.state,n)}),!!n.length}},{key:`Ctrl-Alt-]`,run:e=>{let t=e.state.field(Fp,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,(e,t)=>{n.push(Np.of({from:e,to:t}))}),e.dispatch({effects:n}),!0}}],Wp={placeholderDOM:null,preparePlaceholder:null,placeholderText:`…`},Gp=N.define({combine(e){return ea(e,Wp)}});function Kp(e){let t=[Fp,$p];return e&&t.push(Gp.of(e)),t}function qp(e,t){let{state:n}=e,r=n.facet(Gp),i=t=>{let n=e.lineBlockAt(e.posAtDOM(t.target)),r=Lp(e.state,n.from,n.to);r&&e.dispatch({effects:Np.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 Jp=B.replace({widget:new class extends Qa{toDOM(e){return qp(e,null)}}}),Yp=class extends Qa{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return qp(e,this.value)}},Xp={openText:`⌄`,closedText:`›`,markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1},Zp=class extends gf{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 Qp(e={}){let t={...Xp,...e},n=new Zp(t,!0),r=new Zp(t,!1),i=bs.fromClass(class{constructor(e){this.from=e.viewport.from,this.markers=this.buildMarkers(e)}update(e){(e.docChanged||e.viewportChanged||e.startState.facet(rp)!=e.state.facet(rp)||e.startState.field(Fp,!1)!=e.state.field(Fp,!1)||Jf(e.startState)!=Jf(e.state)||t.foldingChanged(e))&&(this.markers=this.buildMarkers(e.view))}buildMarkers(e){let t=new sa;for(let i of e.viewportLineBlocks){let a=Lp(e.state,i.from,i.to)?r:Ap(e.state,i.from,i.to)?n:null;a&&t.add(i.from,i.from,a)}return t.finish()}}),{domEventHandlers:a}=t;return[i,xf({class:`cm-foldGutter`,markers(e){return e.plugin(i)?.markers||L.empty},initialSpacer(){return new Zp(t,!1)},domEventHandlers:{...a,click:(e,t,n)=>{if(a.click&&a.click(e,t,n))return!0;let r=Lp(e.state,t.from,t.to);if(r)return e.dispatch({effects:Np.of(r)}),!0;let i=Ap(e.state,t.from,t.to);return i?(e.dispatch({effects:Mp.of(i)}),!0):!1}}}),Kp()]}var $p=G.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`}}),em=class e{constructor(e,t){this.specs=e;let n;function r(e){let t=wa.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 Gf?e=>e.prop(Hf)==a.data:a?e=>e==a:void 0,this.style=or(e.map(e=>({tag:e.tag,class:e.class||r(Object.assign({},e,{tag:null}))})),{all:i}).style,this.module=n?new wa(n):null,this.themeType=t.themeType}static define(t,n){return new e(t,n||{})}},tm=N.define(),nm=N.define({combine(e){return e.length?[e[0]]:null}});function rm(e){let t=e.facet(tm);return t.length?t:e.facet(nm)}function im(e,t){let n=[om],r;return e instanceof em&&(e.module&&n.push(G.styleModule.of(e.module)),r=e.themeType),t?.fallback?n.push(nm.of(e)):r?n.push(tm.computeN([G.darkTheme],t=>t.facet(G.darkTheme)==(r==`dark`)?[e]:[])):n.push(tm.of(e)),n}var am=class{constructor(e){this.markCache=Object.create(null),this.tree=Jf(e.state),this.decorations=this.buildDeco(e,rm(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=Jf(e.state),n=rm(e.state),r=n!=rm(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 B.none;let n=new sa;for(let{from:r,to:i}of e.visibleRanges)cr(this.tree,t,(e,t,r)=>{n.add(e,t,this.markCache[r]||(this.markCache[r]=B.mark({class:r})))},r,i);return n.finish()}},om=Ci.high(bs.fromClass(am,{decorations:e=>e.decorations})),sm=em.define([{tag:A.meta,color:`#404740`},{tag:A.link,textDecoration:`underline`},{tag:A.heading,textDecoration:`underline`,fontWeight:`bold`},{tag:A.emphasis,fontStyle:`italic`},{tag:A.strong,fontWeight:`bold`},{tag:A.strikethrough,textDecoration:`line-through`},{tag:A.keyword,color:`#708`},{tag:[A.atom,A.bool,A.url,A.contentSeparator,A.labelName],color:`#219`},{tag:[A.literal,A.inserted],color:`#164`},{tag:[A.string,A.deleted],color:`#a11`},{tag:[A.regexp,A.escape,A.special(A.string)],color:`#e40`},{tag:A.definition(A.variableName),color:`#00f`},{tag:A.local(A.variableName),color:`#30a`},{tag:[A.typeName,A.namespace],color:`#085`},{tag:A.className,color:`#167`},{tag:[A.special(A.variableName),A.macroName],color:`#256`},{tag:A.definition(A.propertyName),color:`#00c`},{tag:A.comment,color:`#940`},{tag:A.invalid,color:`#f00`}]),cm=G.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:`#328c8252`},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:`#bb555544`}}),lm=1e4,um=`()[]{}`,dm=N.define({combine(e){return ea(e,{afterCursor:!0,brackets:um,maxScanDistance:lm,renderMatch:mm})}}),fm=B.mark({class:`cm-matchingBracket`}),pm=B.mark({class:`cm-nonmatchingBracket`});function mm(e){let t=[],n=e.matched?fm:pm;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}function hm(e){let t=[],n=e.facet(dm);for(let r of e.selection.ranges){if(!r.empty)continue;let i=xm(e,r.head,-1,n)||r.head>0&&xm(e,r.head-1,1,n)||n.afterCursor&&(xm(e,r.head,1,n)||r.head<e.doc.length&&xm(e,r.head+1,-1,n));i&&(t=t.concat(n.renderMatch(i,e)))}return B.set(t,!0)}var gm=[bs.fromClass(class{constructor(e){this.paused=!1,this.decorations=hm(e.state)}update(e){(e.docChanged||e.selectionSet||this.paused)&&(e.view.composing?(this.decorations=this.decorations.map(e.changes),this.paused=!0):(this.decorations=hm(e.state),this.paused=!1))}},{decorations:e=>e.decorations}),cm];function _m(e={}){return[dm.of(e),gm]}var vm=new D;function ym(e,t,n){let r=e.prop(t<0?D.openedBy:D.closedBy);if(r)return r;if(e.name.length==1){let r=n.indexOf(e.name);if(r>-1&&r%2==(t<0?1:0))return[n[r+t]]}return null}function bm(e){let t=e.type.prop(vm);return t?t(e.node):e}function xm(e,t,n,r={}){let i=r.maxScanDistance||lm,a=r.brackets||um,o=Jf(e),s=o.resolveInner(t,n);for(let r=s;r;r=r.parent){let i=ym(r.type,n,a);if(i&&r.from<r.to){let o=bm(r);if(o&&(n>0?t>=o.from&&t<o.to:t>o.from&&t<=o.to))return Sm(e,t,n,r,o,i,a)}}return Cm(e,t,n,o,s.type,i,a)}function Sm(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=bm(u);return{start:c,end:e?{from:e.from,to:e.to}:void 0,matched:!0}}else if(ym(u.type,n,o))l++;else if(ym(u.type,-n,o)){if(l==0){let e=bm(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 Cm(e,t,n,r,i,a,o){if(n<0?!t:t==e.doc.length)return null;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 wm=Object.create(null),Tm=[Qt.none],Em=[],Dm=Object.create(null),Om=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`]])Om[e]=Am(wm,t);function km(e,t){Em.indexOf(e)>-1||(Em.push(e),console.warn(t))}function Am(e,t){let n=[];for(let r of t.split(` `)){let t=[];for(let n of r.split(`.`)){let r=e[n]||A[n];r?typeof r==`function`?t.length?t=t.map(r):km(n,`Modifier ${n} used at start of tag`):t.length?km(n,`Tag ${n} used as modifier`):t=Array.isArray(r)?r:[r]:km(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=Dm[i];if(a)return a.id;let o=Dm[i]=Qt.define({id:Tm.length,name:r,props:[rr({[r]:n})]});return Tm.push(o),o.id}V.RTL,V.LTR;var jm=qf.define({name:`json`,parser:Er.configure({props:[dp.add({Object:Sp({except:/^\s*\}/}),Array:Sp({except:/^\s*\]/})}),Ep.add({"Object Array":Dp})]}),languageData:{closeBrackets:{brackets:[`[`,`{`,`"`]},indentOnInput:/^\s*[\}\]]$/}});function Mm(){return new ip(jm)}var Nm=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=Rm(e.state,n.from);return r.line?Fm(e):r.block?Lm(e):!1};function Pm(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 Fm=Pm(Um,0),Im=Pm(Hm,0),Lm=Pm((e,t)=>Hm(e,t,Vm(t)),0);function Rm(e,t){let n=e.languageDataAt(`commentTokens`,t,1);return n.length?n[0]:{}}var zm=50;function Bm(e,{open:t,close:n},r,i){let a=e.sliceDoc(r-zm,r),o=e.sliceDoc(i,i+zm),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*zm?u=d=e.sliceDoc(r,i):(u=e.sliceDoc(r,r+zm),d=e.sliceDoc(i-zm,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))?1:0},close:{pos:i-p-n.length,margin:/\s/.test(d.charAt(m-1))?1:0}}:null}function Vm(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 Hm(e,t,n=t.selection.ranges){let r=n.map(e=>Rm(t,e.from).block);if(!r.every(e=>e))return null;let i=n.map((e,n)=>Bm(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 Um(e,t,n=t.selection.ranges){let r=[],i=-1;ranges:for(let{from:e,to:a}of n){let n=r.length,o=1e9,s;for(let n=e;n<=a;){let c=t.doc.lineAt(n);if(s==null&&(s=Rm(t,c.from).line,!s))continue ranges;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 Wm=Ri.define(),Gm=Ri.define(),Km=N.define(),qm=N.define({combine(e){return ea(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,r)=>e(n,r)||t(n,r)})}}),Jm=bi.define({create(){return ph.empty},update(e,t){let n=t.state.facet(qm),r=t.annotation(Wm);if(r){let i=th.fromTransaction(t,r.selection),a=r.side,o=a==0?e.undone:e.done;return o=i?nh(o,o.length,n.minDepth,i):ch(o,t.startState.selection),new ph(a==0?r.rest:o,a==0?o:r.rest)}let i=t.annotation(Gm);if((i==`full`||i==`before`)&&(e=e.isolate()),t.annotation(Vi.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let a=th.fromTransaction(t),o=t.annotation(Vi.time),s=t.annotation(Vi.userEvent);return a?e=e.addChanges(a,o,s,n,t):t.selection&&(e=e.addSelection(t.startState.selection,o,s,n.newGroupDelay)),(i==`full`||i==`after`)&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}},fromJSON(e){return new ph(e.done.map(th.fromJSON),e.undone.map(th.fromJSON))}});function Ym(e={}){return[Jm,qm.of(e),G.domEventHandlers({beforeinput(e,t){let n=e.inputType==`historyUndo`?Zm:e.inputType==`historyRedo`?Qm:null;return n?(e.preventDefault(),n(t)):!1}})]}function Xm(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let i=n.field(Jm,!1);if(!i)return!1;let a=i.pop(e,n,t);return a?(r(a),!0):!1}}var Zm=Xm(0,!1),Qm=Xm(1,!1),$m=Xm(0,!0),eh=Xm(1,!0),th=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&&ii.fromJSON(t.changes),[],t.mapped&&ri.fromJSON(t.mapped),t.startSelection&&M.fromJSON(t.startSelection),t.selectionsAfter.map(M.fromJSON))}static fromTransaction(t,n){let r=oh;for(let e of t.startState.facet(Km)){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,oh)}static selection(t){return new e(void 0,oh,void 0,void 0,t)}};function nh(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 rh(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 ih(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((e,n)=>e.empty!=t.ranges[n].empty).length===0}function ah(e,t){return e.length?t.length?e.concat(t):e:t}var oh=[],sh=200;function ch(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-sh));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),nh(e,e.length-1,1e9,n.setSelAfter(r)))}else return[th.selection([t])]}function lh(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 uh(e,t){if(!e.length)return e;let n=e.length,r=oh;for(;n;){let i=dh(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?[th.selection(r)]:oh}function dh(e,t,n){let r=ah(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):oh,n);if(!e.changes)return th.selection(r);let i=e.changes.map(t),a=t.mapDesc(e.changes,!0),o=e.mapped?e.mapped.composeDesc(a):a;return new th(i,P.mapEffects(e.effects,t),o,e.startSelection.map(a),r)}var fh=/^(input\.type|delete)($|\.)/,ph=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||fh.test(r))&&(!s.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(a,rh(s.changes,t.changes))||r==`input.type.compose`)?nh(o,o.length-1,i.minDepth,new th(t.changes.compose(s.changes),ah(P.mapEffects(t.effects,s.changes),s.effects),s.mapped,s.startSelection,oh)):nh(o,o.length,i.minDepth,t),new e(o,oh,n,r)}addSelection(t,n,r,i){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:oh;return a.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&ih(a[a.length-1],t)?this:new e(ch(this.done,t),this.undone,n,r)}addMapping(t){return new e(uh(this.done,t),uh(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]||(i.startSelection?i.startSelection.map(i.changes.invertedDesc,1):t.selection);if(n&&i.selectionsAfter.length)return t.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:Wm.of({side:e,rest:lh(r),selection:a}),userEvent:e==0?`select.undo`:`select.redo`,scrollIntoView:!0});if(i.changes){let n=r.length==1?oh:r.slice(0,r.length-1);return i.mapped&&(n=uh(n,i.mapped)),t.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:Wm.of({side:e,rest:n,selection:a}),filter:!1,userEvent:e==0?`undo`:`redo`,scrollIntoView:!0})}else return null}};ph.empty=new ph(oh,oh);var mh=[{key:`Mod-z`,run:Zm,preventDefault:!0},{key:`Mod-y`,mac:`Mod-Shift-z`,run:Qm,preventDefault:!0},{linux:`Ctrl-Shift-z`,run:Qm,preventDefault:!0},{key:`Mod-u`,run:$m,preventDefault:!0},{key:`Alt-u`,mac:`Mod-Shift-u`,run:eh,preventDefault:!0}];function hh(e,t){return M.create(e.ranges.map(t),e.mainIndex)}function gh(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:`select`})}function _h({state:e,dispatch:t},n){let r=hh(e.selection,n);return r.eq(e.selection,!0)?!1:(t(gh(e,r)),!0)}function vh(e,t){return M.cursor(t?e.to:e.from)}function yh(e,t){return _h(e,n=>n.empty?e.moveByChar(n,t):vh(n,t))}function bh(e){return e.textDirectionAt(e.state.selection.main.head)==V.LTR}var xh=e=>yh(e,!bh(e)),Sh=e=>yh(e,bh(e));function Ch(e,t){return _h(e,n=>n.empty?e.moveByGroup(n,t):vh(n,t))}var wh=e=>Ch(e,!bh(e)),Th=e=>Ch(e,bh(e));typeof Intl<`u`&&Intl.Segmenter;function Eh(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 Dh(e,t,n){let r=Jf(e).resolveInner(t.head),i=n?D.closedBy:D.openedBy;for(let a=t.head;;){let t=n?r.childAfter(a):r.childBefore(a);if(!t)break;Eh(e,t,i)?r=t:a=n?t.to:t.from}let a=r.type.prop(i),o,s;return s=a&&(o=n?xm(e,r.from,1):xm(e,r.to,-1))&&o.matched?n?o.end.to:o.end.from:n?r.to:r.from,M.cursor(s,n?-1:1)}var Oh=e=>_h(e,t=>Dh(e.state,t,!bh(e))),kh=e=>_h(e,t=>Dh(e.state,t,bh(e)));function Ah(e,t){return _h(e,n=>{if(!n.empty)return vh(n,t);let r=e.moveVertically(n,t);return r.head==n.head?e.moveToLineBoundary(n,t):r})}var jh=e=>Ah(e,!1),Mh=e=>Ah(e,!0);function Nh(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,i;if(t){for(let t of e.state.facet(G.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 Ph(e,t){let n=Nh(e),{state:r}=e,i=hh(r.selection,r=>r.empty?e.moveVertically(r,t,n.height):vh(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=G.scrollIntoView(i.main.head,{y:`start`,yMargin:t.top-s}))}return e.dispatch(gh(r,i),{effects:a}),!0}var Fh=e=>Ph(e,!1),Ih=e=>Ph(e,!0);function Lh(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=M.cursor(r.from+n))}return i}var Rh=e=>_h(e,t=>Lh(e,t,!0)),zh=e=>_h(e,t=>Lh(e,t,!1)),Bh=e=>_h(e,t=>Lh(e,t,!bh(e))),Vh=e=>_h(e,t=>Lh(e,t,bh(e))),Hh=e=>_h(e,t=>M.cursor(e.lineBlockAt(t.head).from,1)),Uh=e=>_h(e,t=>M.cursor(e.lineBlockAt(t.head).to,-1));function Wh(e,t,n){let r=!1,i=hh(e.selection,t=>{let i=xm(e,t.head,-1)||xm(e,t.head,1)||t.head>0&&xm(e,t.head-1,1)||t.head<e.doc.length&&xm(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?M.range(t.anchor,a):M.cursor(a)});return r?(t(gh(e,i)),!0):!1}var Gh=({state:e,dispatch:t})=>Wh(e,t,!1);function Kh(e,t){let n=hh(e.state.selection,e=>{let n=t(e);return M.range(e.anchor,n.head,n.goalColumn,n.bidiLevel||void 0,n.assoc)});return n.eq(e.state.selection)?!1:(e.dispatch(gh(e.state,n)),!0)}function qh(e,t){return Kh(e,n=>e.moveByChar(n,t))}var Jh=e=>qh(e,!bh(e)),Yh=e=>qh(e,bh(e));function Xh(e,t){return Kh(e,n=>e.moveByGroup(n,t))}var Zh=e=>Xh(e,!bh(e)),Qh=e=>Xh(e,bh(e)),$h=e=>Kh(e,t=>Dh(e.state,t,!bh(e))),eg=e=>Kh(e,t=>Dh(e.state,t,bh(e)));function tg(e,t){return Kh(e,n=>e.moveVertically(n,t))}var ng=e=>tg(e,!1),rg=e=>tg(e,!0);function ig(e,t){return Kh(e,n=>e.moveVertically(n,t,Nh(e).height))}var ag=e=>ig(e,!1),og=e=>ig(e,!0),sg=e=>Kh(e,t=>Lh(e,t,!0)),cg=e=>Kh(e,t=>Lh(e,t,!1)),lg=e=>Kh(e,t=>Lh(e,t,!bh(e))),ug=e=>Kh(e,t=>Lh(e,t,bh(e))),dg=e=>Kh(e,t=>M.cursor(e.lineBlockAt(t.head).from)),fg=e=>Kh(e,t=>M.cursor(e.lineBlockAt(t.head).to)),pg=({state:e,dispatch:t})=>(t(gh(e,{anchor:0})),!0),mg=({state:e,dispatch:t})=>(t(gh(e,{anchor:e.doc.length})),!0),hg=({state:e,dispatch:t})=>(t(gh(e,{anchor:e.selection.main.anchor,head:0})),!0),gg=({state:e,dispatch:t})=>(t(gh(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),_g=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:`select`})),!0),vg=({state:e,dispatch:t})=>{let n=Lg(e).map(({from:t,to:n})=>M.range(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:M.create(n),userEvent:`select`})),!0},yg=({state:e,dispatch:t})=>{let n=hh(e.selection,t=>{let n=Jf(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 M.range(n.to,n.from)}return t});return n.eq(e.selection)?!1:(t(gh(e,n)),!0)};function bg(e,t){let{state:n}=e,r=n.selection,i=n.selection.ranges.slice();for(let r of n.selection.ranges){let a=n.doc.lineAt(r.head);if(t?a.to<e.state.doc.length:a.from>0)for(let n=r;;){let r=e.moveVertically(n,t);if(r.head<a.from||r.head>a.to){i.some(e=>e.head==r.head)||i.push(r);break}else if(r.head==n.head)break;else n=r}}return i.length==r.ranges.length?!1:(e.dispatch(gh(n,M.create(i,i.length-1))),!0)}var xg=e=>bg(e,!1),Sg=e=>bg(e,!0),Cg=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=M.create([n.main]):n.main.empty||(r=M.create([M.cursor(n.main.head)])),r?(t(gh(e,r)),!0):!1};function wg(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=Tg(e,o,!1)):o>i&&(n=`delete.forward`,o=Tg(e,o,!0)),i=Math.min(i,o),a=Math.max(a,o)}else i=Tg(e,i,!1),a=Tg(e,a,!0);return i==a?{range:r}:{changes:{from:i,to:a},range:M.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`?G.announce.of(r.phrase(`Selection deleted`)):void 0})),!0)}function Tg(e,t,n){if(e instanceof G)for(let r of e.state.facet(G.atomicRanges).map(t=>t(e)))r.between(t,t,(e,r)=>{e<t&&r>t&&(t=n?r:e)});return t}var Eg=(e,t,n)=>wg(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=va(s,a.tabSize)%sp(a)||sp(a);for(let t=0;t<e&&s[s.length-1-t]==` `;t++)i--;c=i}else c=Yr(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=Yr(o.text,c-o.from,!1,!1)+o.from);return c}),Dg=e=>Eg(e,!1,!0),Og=e=>Eg(e,!0,!1),kg=(e,t)=>wg(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=Yr(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}),Ag=e=>kg(e,!1),jg=e=>kg(e,!0),Mg=e=>wg(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),Ng=e=>wg(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),Pg=e=>wg(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),Fg=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:j.of([``,``])},range:M.cursor(e.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:`input`})),!0},Ig=({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:Yr(r.text,n-r.from,!1)+r.from,a=n==r.to?n+1:Yr(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:M.cursor(a)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:`move.character`})),!0)};function Lg(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 Rg(e,t,n){if(e.readOnly)return!1;let r=[],i=[];for(let t of Lg(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(M.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(M.range(e.anchor-o,e.head-o))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:M.create(i,e.selection.mainIndex),userEvent:`move.line`})),!0):!1}var zg=({state:e,dispatch:t})=>Rg(e,t,!1),Bg=({state:e,dispatch:t})=>Rg(e,t,!0);function Vg(e,t,n){if(e.readOnly)return!1;let r=[];for(let t of Lg(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)});let i=e.changes(r);return t(e.update({changes:i,selection:e.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:`input.copyline`})),!0}var Hg=({state:e,dispatch:t})=>Vg(e,t,!1),Ug=({state:e,dispatch:t})=>Vg(e,t,!0),Wg=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(Lg(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),r=hh(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 Gg(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=Jf(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(D.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 Kg=Jg(!1),qg=Jg(!0);function Jg(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&&Gg(t,r);e&&(r=i=(i<=a.to?a:t.doc.lineAt(i)).to);let s=new up(t,{simulateBreak:r,simulateDoubleBreak:!!o}),c=lp(s,r);for(c??=va(/^\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=[``,cp(t,c)];return o&&l.push(cp(t,s.lineIndent(a.from,-1))),{changes:{from:r,to:i,insert:j.of(l)},range:M.cursor(r+1+l[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:`input`})),!0}}function Yg(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:M.range(a.mapPos(r.anchor,1),a.mapPos(r.head,1))}})}var Xg=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new up(e,{overrideIndentation:e=>n[e]??-1}),i=Yg(e,(t,i,a)=>{let o=lp(r,t.from);if(o==null)return;/\S/.test(t.text)||(o=0);let s=/^\s*/.exec(t.text)[0],c=cp(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},Zg=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(Yg(e,(t,n)=>{n.push({from:t.from,insert:e.facet(op)})}),{userEvent:`input.indent`})),!0),Qg=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(Yg(e,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let i=va(r,e.tabSize),a=0,o=cp(e,Math.max(0,i-sp(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),$g=e=>(e.setTabFocusMode(),!0),e_=[{key:`Ctrl-b`,run:xh,shift:Jh,preventDefault:!0},{key:`Ctrl-f`,run:Sh,shift:Yh},{key:`Ctrl-p`,run:jh,shift:ng},{key:`Ctrl-n`,run:Mh,shift:rg},{key:`Ctrl-a`,run:Hh,shift:dg},{key:`Ctrl-e`,run:Uh,shift:fg},{key:`Ctrl-d`,run:Og},{key:`Ctrl-h`,run:Dg},{key:`Ctrl-k`,run:Mg},{key:`Ctrl-Alt-h`,run:Ag},{key:`Ctrl-o`,run:Fg},{key:`Ctrl-t`,run:Ig},{key:`Ctrl-v`,run:Ih}],t_=[{key:`ArrowLeft`,run:xh,shift:Jh,preventDefault:!0},{key:`Mod-ArrowLeft`,mac:`Alt-ArrowLeft`,run:wh,shift:Zh,preventDefault:!0},{mac:`Cmd-ArrowLeft`,run:Bh,shift:lg,preventDefault:!0},{key:`ArrowRight`,run:Sh,shift:Yh,preventDefault:!0},{key:`Mod-ArrowRight`,mac:`Alt-ArrowRight`,run:Th,shift:Qh,preventDefault:!0},{mac:`Cmd-ArrowRight`,run:Vh,shift:ug,preventDefault:!0},{key:`ArrowUp`,run:jh,shift:ng,preventDefault:!0},{mac:`Cmd-ArrowUp`,run:pg,shift:hg},{mac:`Ctrl-ArrowUp`,run:Fh,shift:ag},{key:`ArrowDown`,run:Mh,shift:rg,preventDefault:!0},{mac:`Cmd-ArrowDown`,run:mg,shift:gg},{mac:`Ctrl-ArrowDown`,run:Ih,shift:og},{key:`PageUp`,run:Fh,shift:ag},{key:`PageDown`,run:Ih,shift:og},{key:`Home`,run:zh,shift:cg,preventDefault:!0},{key:`Mod-Home`,run:pg,shift:hg},{key:`End`,run:Rh,shift:sg,preventDefault:!0},{key:`Mod-End`,run:mg,shift:gg},{key:`Enter`,run:Kg,shift:Kg},{key:`Mod-a`,run:_g},{key:`Backspace`,run:Dg,shift:Dg,preventDefault:!0},{key:`Delete`,run:Og,preventDefault:!0},{key:`Mod-Backspace`,mac:`Alt-Backspace`,run:Ag,preventDefault:!0},{key:`Mod-Delete`,mac:`Alt-Delete`,run:jg,preventDefault:!0},{mac:`Mod-Backspace`,run:Ng,preventDefault:!0},{mac:`Mod-Delete`,run:Pg,preventDefault:!0}].concat(e_.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),n_=[{key:`Alt-ArrowLeft`,mac:`Ctrl-ArrowLeft`,run:Oh,shift:$h},{key:`Alt-ArrowRight`,mac:`Ctrl-ArrowRight`,run:kh,shift:eg},{key:`Alt-ArrowUp`,run:zg},{key:`Shift-Alt-ArrowUp`,run:Hg},{key:`Alt-ArrowDown`,run:Bg},{key:`Shift-Alt-ArrowDown`,run:Ug},{key:`Mod-Alt-ArrowUp`,run:xg},{key:`Mod-Alt-ArrowDown`,run:Sg},{key:`Escape`,run:Cg},{key:`Mod-Enter`,run:qg},{key:`Alt-l`,mac:`Ctrl-l`,run:vg},{key:`Mod-i`,run:yg,preventDefault:!0},{key:`Mod-[`,run:Qg},{key:`Mod-]`,run:Zg},{key:`Mod-Alt-\\`,run:Xg},{key:`Shift-Mod-k`,run:Wg},{key:`Shift-Mod-\\`,run:Gh},{key:`Mod-/`,run:Nm},{key:`Alt-A`,run:Im},{key:`Ctrl-m`,mac:`Shift-Alt-m`,run:$g}].concat(t_),r_=typeof String.prototype.normalize==`function`?e=>e.normalize(`NFKD`):e=>e,i_=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(r_(e)):r_,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 Qr(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=$r(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=ei(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`&&(i_.prototype[Symbol.iterator]=function(){return this});var a_={from:-1,to:-1,match:/.*/.exec(``)},o_=`gm`+(/x/.unicode==null?``:`u`),s_=class{constructor(e,t,n,r=0,i=e.length){if(this.text=e,this.to=i,this.curLine=``,this.done=!1,this.value=a_,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new u_(e,t,n,r,i);this.re=new RegExp(t,o_+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.iter=e.iter(),this.curLineStart=e.lineAt(r).from,this.matchPos=f_(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=f_(this.text,r+(n==r?1:0)),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}}},c_=new WeakMap,l_=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=c_.get(t);if(!i||i.from>=r||i.to<=n){let i=new e(n,t.sliceString(n,r));return c_.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)),c_.set(t,new e(o,a)),new e(n,a.slice(n-o,r-o))}},u_=class{constructor(e,t,n,r,i){this.text=e,this.to=i,this.done=!1,this.value=a_,this.matchPos=f_(e,r),this.re=new RegExp(t,o_+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.flat=l_.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=f_(this.text,n+(e==n?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=l_.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}};typeof Symbol<`u`&&(s_.prototype[Symbol.iterator]=u_.prototype[Symbol.iterator]=function(){return this});function d_(e){try{return new RegExp(e,o_),!0}catch{return!1}}function f_(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}var p_=e=>{let{state:t}=e,n=String(t.doc.lineAt(e.state.selection.main.head).number),{close:r,result:i}=df(e,{label:t.phrase(`Go to line`),input:{type:`text`,name:`line`,value:n},focus:!0,submitLabel:t.phrase(`go`)});return i.then(n=>{let i=n&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.elements.line.value);if(!i){e.dispatch({effects:r});return}let a=t.doc.lineAt(t.selection.main.head),[,o,s,c,l]=i,u=c?+c.slice(1):0,d=s?+s:a.number;if(s&&l){let e=d/100;o&&(e=e*(o==`-`?-1:1)+a.number/t.doc.lines),d=Math.round(t.doc.lines*e)}else s&&o&&(d=d*(o==`-`?-1:1)+a.number);let f=t.doc.line(Math.max(1,Math.min(t.doc.lines,d))),p=M.cursor(f.from+Math.max(0,Math.min(u,f.length)));e.dispatch({effects:[r,G.scrollIntoView(p.from,{y:`center`})],selection:p})}),!0},m_={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},h_=N.define({combine(e){return ea(e,m_,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function g_(e){let t=[S_,x_];return e&&t.push(h_.of(e)),t}var __=B.mark({class:`cm-selectionMatch`}),v_=B.mark({class:`cm-selectionMatch cm-selectionMatch-main`});function y_(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=F.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=F.Word)}function b_(e,t,n,r){return e(t.sliceDoc(n,n+1))==F.Word&&e(t.sliceDoc(r-1,r))==F.Word}var x_=bs.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(h_),{state:n}=e,r=n.selection;if(r.ranges.length>1)return B.none;let i=r.main,a,o=null;if(i.empty){if(!t.highlightWordAroundCursor)return B.none;let e=n.wordAt(i.head);if(!e)return B.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 B.none;if(t.wholeWords){if(a=n.sliceDoc(i.from,i.to),o=n.charCategorizer(i.head),!(y_(o,n,i.from,i.to)&&b_(o,n,i.from,i.to)))return B.none}else if(a=n.sliceDoc(i.from,i.to),!a)return B.none}let s=[];for(let r of e.visibleRanges){let e=new i_(n.doc,a,r.from,r.to);for(;!e.next().done;){let{from:r,to:a}=e.value;if((!o||y_(o,n,r,a))&&(i.empty&&r<=i.from&&a>=i.to?s.push(v_.range(r,a)):(r>=i.to||a<=i.from)&&s.push(__.range(r,a)),s.length>t.maxMatches))return B.none}}return B.set(s)}},{decorations:e=>e.decorations}),S_=G.baseTheme({".cm-selectionMatch":{backgroundColor:`#99ff7780`},".cm-searchMatch .cm-selectionMatch":{backgroundColor:`transparent`}}),C_=({state:e,dispatch:t})=>{let{selection:n}=e,r=M.create(n.ranges.map(t=>e.wordAt(t.head)||M.cursor(t.head)),n.mainIndex);return r.eq(n)?!1:(t(e.update({selection:r})),!0)};function w_(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 i_(e.doc,t,r[r.length-1].to);;)if(i.next(),i.done){if(n)return null;i=new i_(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 T_=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return C_({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=w_(e,r);return i?(t(e.update({selection:e.selection.addRange(M.range(i.from,i.to),!1),effects:G.scrollIntoView(i.to)})),!0):!1},E_=N.define({combine(e){return ea(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new ov(e),scrollToMatch:e=>G.scrollIntoView(e)})}}),D_=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||d_(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>t==`n`?`
|
|
12
|
+
`: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&&this.test==e.test}create(){return this.regexp?new R_(this):new M_(this)}getCursor(e,t=0,n){let r=e.doc?e:I.create({doc:e});return n??=r.doc.length,this.regexp?P_(this,r,t,n):A_(this,r,t,n)}},O_=class{constructor(e){this.spec=e}};function k_(e,t,n){return(r,i,a,o)=>n&&!n(r,i,a,o)?!1:e(r>=o&&i<=o+a.length?a.slice(r-o,i-o):t.doc.sliceString(r,i),t,r,i)}function A_(e,t,n,r){let i;return e.wholeWord&&(i=j_(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(i=k_(e.test,t,i)),new i_(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:e=>e.toLowerCase(),i)}function j_(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(F_(i,n-a))!=F.Word||t(I_(i,n-a))!=F.Word)&&(t(I_(i,r-a))!=F.Word||t(F_(i,r-a))!=F.Word))}var M_=class extends O_{constructor(e){super(e)}nextMatch(e,t,n){let r=A_(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);r=A_(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=A_(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=A_(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=A_(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 N_(e,t,n){return(r,i,a)=>(!n||n(r,i,a))&&e(a[0],t,r,i)}function P_(e,t,n,r){let i;return e.wholeWord&&(i=L_(t.charCategorizer(t.selection.main.head))),e.test&&(i=N_(e.test,t,i)),new s_(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:i},n,r)}function F_(e,t){return e.slice(Yr(e,t,!1),t)}function I_(e,t){return e.slice(t,Yr(e,t))}function L_(e){return(t,n,r)=>!r[0].length||(e(F_(r.input,r.index))!=F.Word||e(I_(r.input,r.index))!=F.Word)&&(e(I_(r.input,r.index+r[0].length))!=F.Word||e(F_(r.input,r.index+r[0].length))!=F.Word)}var R_=class extends O_{nextMatch(e,t,n){let r=P_(this.spec,e,n,e.doc.length).next();return r.done&&(r=P_(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=P_(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=P_(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=P_(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)}},z_=P.define(),B_=P.define(),V_=bi.define({create(e){return new H_(ev(e).create(),null)},update(e,t){for(let n of t.effects)n.is(z_)?e=new H_(n.value.create(),e.panel):n.is(B_)&&(e=new H_(e.query,n.value?$_:null));return e},provide:e=>uf.from(e,e=>e.panel)}),H_=class{constructor(e,t){this.query=e,this.panel=t}},U_=B.mark({class:`cm-searchMatch`}),W_=B.mark({class:`cm-searchMatch cm-searchMatch-selected`}),G_=bs.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(V_))}update(e){let t=e.state.field(V_);(t!=e.startState.field(V_)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return B.none;let{view:n}=this,r=new sa;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?W_:U_)})}return r.finish()}},{decorations:e=>e.decorations});function K_(e){return t=>{let n=t.state.field(V_,!1);return n&&n.query.spec.valid?e(t,n):rv(t)}}var q_=K_((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let i=M.single(r.from,r.to),a=e.state.facet(E_);return e.dispatch({selection:i,effects:[uv(e,r),a.scrollToMatch(i.main,e)],userEvent:`select.search`}),nv(e),!0}),J_=K_((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n,r,r);if(!i)return!1;let a=M.single(i.from,i.to),o=e.state.facet(E_);return e.dispatch({selection:a,effects:[uv(e,i),o.scrollToMatch(a.main,e)],userEvent:`select.search`}),nv(e),!0}),Y_=K_((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:M.create(n.map(e=>M.range(e.from,e.to))),userEvent:`select.search.matches`}),!0)}),X_=({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 i_(e.doc,e.sliceDoc(r,i));!t.next().done;){if(a.length>1e3)return!1;t.value.from==r&&(o=a.length),a.push(M.range(t.value.from,t.value.to))}return t(e.update({selection:M.create(a,o),userEvent:`select.search.matches`})),!0},Z_=K_((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=[];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(G.announce.of(n.phrase(`replaced match on line $`,n.doc.lineAt(r).number)+`.`)));let d=e.state.changes(s);return o&&(c=M.single(o.from,o.to).map(d),u.push(uv(e,o)),u.push(n.facet(E_).scrollToMatch(c.main,e))),e.dispatch({changes:d,selection:c,effects:u,userEvent:`input.replace`}),!0}),Q_=K_((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:G.announce.of(r),userEvent:`input.replace.all`}),!0});function $_(e){return e.state.facet(E_).createPanel(e)}function ev(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(E_);return new D_({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 tv(e){let t=of(e,$_);return t&&t.dom.querySelector(`[main-field]`)}function nv(e){let t=tv(e);t&&t==e.root.activeElement&&t.select()}var rv=e=>{let t=e.state.field(V_,!1);if(t&&t.panel){let n=tv(e);if(n&&n!=e.root.activeElement){let r=ev(e.state,t.query.spec);r.valid&&e.dispatch({effects:z_.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[B_.of(!0),t?z_.of(ev(e.state,t.query.spec)):P.appendConfig.of(fv)]});return!0},iv=e=>{let t=e.state.field(V_,!1);if(!t||!t.panel)return!1;let n=of(e,$_);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:B_.of(!1)}),!0},av=[{key:`Mod-f`,run:rv,scope:`editor search-panel`},{key:`F3`,run:q_,shift:J_,scope:`editor search-panel`,preventDefault:!0},{key:`Mod-g`,run:q_,shift:J_,scope:`editor search-panel`,preventDefault:!0},{key:`Escape`,run:iv,scope:`editor search-panel`},{key:`Mod-Shift-l`,run:X_},{key:`Mod-Alt-g`,run:p_},{key:`Mod-d`,run:T_,preventDefault:!0}],ov=class{constructor(e){this.view=e;let t=this.query=e.state.field(V_).query.spec;this.commit=this.commit.bind(this),this.searchField=R(`input`,{value:t.search,placeholder:sv(e,`Find`),"aria-label":sv(e,`Find`),class:`cm-textfield`,name:`search`,form:``,"main-field":`true`,onchange:this.commit,onkeyup:this.commit}),this.replaceField=R(`input`,{value:t.replace,placeholder:sv(e,`Replace`),"aria-label":sv(e,`Replace`),class:`cm-textfield`,name:`replace`,form:``,onchange:this.commit,onkeyup:this.commit}),this.caseField=R(`input`,{type:`checkbox`,name:`case`,form:``,checked:t.caseSensitive,onchange:this.commit}),this.reField=R(`input`,{type:`checkbox`,name:`re`,form:``,checked:t.regexp,onchange:this.commit}),this.wordField=R(`input`,{type:`checkbox`,name:`word`,form:``,checked:t.wholeWord,onchange:this.commit});function n(e,t,n){return R(`button`,{class:`cm-button`,name:e,onclick:t,type:`button`},n)}this.dom=R(`div`,{onkeydown:e=>this.keydown(e),class:`cm-search`},[this.searchField,n(`next`,()=>q_(e),[sv(e,`next`)]),n(`prev`,()=>J_(e),[sv(e,`previous`)]),n(`select`,()=>Y_(e),[sv(e,`all`)]),R(`label`,null,[this.caseField,sv(e,`match case`)]),R(`label`,null,[this.reField,sv(e,`regexp`)]),R(`label`,null,[this.wordField,sv(e,`by word`)]),...e.state.readOnly?[]:[R(`br`),this.replaceField,n(`replace`,()=>Z_(e),[sv(e,`replace`)]),n(`replaceAll`,()=>Q_(e),[sv(e,`replace all`)])],R(`button`,{name:`close`,onclick:()=>iv(e),"aria-label":sv(e,`close`),type:`button`},[`×`])])}commit(){let e=new D_({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:z_.of(e)}))}keydown(e){Lu(this.view,e,`search-panel`)?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?J_:q_)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),Z_(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(z_)&&!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(E_).top}};function sv(e,t){return e.state.phrase(t)}var cv=30,lv=/[\s\.,:;?!]/;function uv(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-cv),o=Math.min(i,n+cv),s=e.state.sliceDoc(a,o);if(a!=r.from){for(let e=0;e<cv;e++)if(!lv.test(s[e+1])&&lv.test(s[e])){s=s.slice(e);break}}if(o!=i){for(let e=s.length-1;e>s.length-cv;e--)if(!lv.test(s[e-1])&&lv.test(s[e])){s=s.slice(0,e);break}}return G.announce.of(`${e.state.phrase(`current match`)}. ${s} ${e.state.phrase(`on line`)} ${r.number}.`)}var dv=G.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`}}),fv=[V_,Ci.low(G_),dv],pv=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=Jf(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(yv(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 mv(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 hv(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=mv(t)+mv(n)+`*$`;return[RegExp(`^`+r),new RegExp(r)]}function gv(e){let t=e.map(e=>typeof e==`string`?{label:e}:e),[n,r]=t.every(e=>/^\w+$/.test(e.label))?[/\w*$/,/\w+$/]:hv(t);return e=>{let i=e.matchBefore(r);return i||e.explicit?{from:i?i.from:e.pos,options:t,validFor:n}:null}}var _v=class{constructor(e,t,n,r){this.completion=e,this.source=t,this.match=n,this.score=r}};function vv(e){return e.selection.main.from}function yv(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 bv=Ri.define();function xv(e,t,n,r){let{main:i}=e.selection,a=n-i.from,o=r-i.from;return{...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:M.cursor(s.from+a+c.length)}}),scrollIntoView:!0,userEvent:`input.complete`}}var Sv=new WeakMap;function Cv(e){if(!Array.isArray(e))return e;let t=Sv.get(e);return t||Sv.set(e,t=gv(e)),t}var wv=P.define(),Tv=P.define(),Ev=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=Qr(e,t),r=ei(n);this.chars.push(n);let i=e.slice(t,t+r),a=i.toUpperCase();this.folded.push(Qr(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=Qr(e,0),i=ei(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=Qr(e,i);(a==t[c]||a==n[c])&&(r[c++]=i),i+=ei(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=Qr(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?1:0:(v=$r(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+=ei(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?ei(Qr(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)}},Dv=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)}},Ov=N.define({combine(e){return ea(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:Av,filterStrict:!1,compareCompletions:(e,t)=>(e.sortText||e.label).localeCompare(t.sortText||t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>n=>kv(e(n),t(n)),optionClass:(e,t)=>n=>kv(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function kv(e,t){return e?t?e+` `+t:e:t}function Av(e,t,n,r,i,a){let o=e.textDirection==V.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`)}}var jv=P.define();function Mv(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 Nv(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 Pv=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(Ov);this.optionContent=Mv(o),this.optionClass=o.optionClass,this.tooltipClass=o.tooltipClass,this.range=Nv(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}if(n.target==this.list){let t=this.list.classList.contains(`cm-completionListIncompleteTop`)&&n.clientY<this.list.firstChild.getBoundingClientRect().top?this.range.from-1:this.list.classList.contains(`cm-completionListIncompleteBottom`)&&n.clientY>this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;t!=null&&(e.dispatch({effects:jv.of(t)}),n.preventDefault())}}),this.dom.addEventListener(`focusout`,t=>{let n=e.state.field(this.stateField,!1);n&&n.tooltip&&e.state.facet(Ov).closeOnBlur&&t.relatedTarget!=e.contentDOM&&e.dispatch({effects:Tv.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=Nv(r.length,i,e.state.facet(Ov).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;(t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=Nv(t.options.length,t.selected,this.view.state.facet(Ov).maxRenderedOptions),this.showOptions(t.options,e.id));let n=this.updateSelectedOption(t.selected);if(n){this.destroyInfo();let{completion:r}=t.options[t.selected],{info:i}=r;if(!i)return;let a=typeof i==`string`?document.createTextNode(i):i(r);if(!a)return;`then`in a?a.then(t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t,r)}).catch(e=>gs(this.view.state,e,`completion info`)):(this.addInfoPane(a,r),n.setAttribute(`aria-describedby`,this.info.id))}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement(`div`);if(n.className=`cm-tooltip cm-completionInfo`,n.id=`cm-completionInfo-`+Math.floor(Math.random()*65535).toString(16),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`),n.removeAttribute(`aria-describedby`));return t&&Iv(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(Ov).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 Fv(e,t){return n=>new Pv(n,e,t)}function Iv(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 Lv(e){return(e.boost||0)*100+(e.apply?10:0)+(e.info?5:0)+(e.type?1:0)}function Rv(e,t){let n=[],r=null,i=null,a=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)}},o=t.facet(Ov);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)a(new _v(t,r.source,e?e(t):[],1e9-n.length));else{let n=t.sliceDoc(r.from,r.to),s,c=o.filterStrict?new Dv(n):new Ev(n);for(let t of r.result.options)if(s=c.match(t.label)){let n=t.displayLabel?e?e(t,s.matched):[]:s.matched,o=s.score+(t.boost||0);if(a(new _v(t,r.source,n,o)),typeof t.section==`object`&&t.section.rank===`dynamic`){let{name:e}=t.section;i||=Object.create(null),i[e]=Math.max(o,i[e]||-1e9)}}}}if(r){let e=Object.create(null),t=0,a=(e,t)=>(e.rank===`dynamic`&&t.rank===`dynamic`?i[t.name]-i[e.name]:0)||(typeof e.rank==`number`?e.rank:1e9)-(typeof t.rank==`number`?t.rank:1e9)||(e.name<t.name?-1:1);for(let n of r.sort(a))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 s=[],c=null,l=o.compareCompletions;for(let e of n.sort((e,t)=>t.score-e.score||l(e.completion,t.completion))){let t=e.completion;!c||c.label!=t.label||c.detail!=t.detail||c.type!=null&&t.type!=null&&c.type!=t.type||c.apply!=t.apply||c.boost!=t.boost?s.push(e):Lv(e.completion)>Lv(c)&&(s[s.length-1]=e),c=e.completion}return s}var zv=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,Wv(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=Rv(t,n);if(!s.length)return i&&t.some(e=>e.isPending)?i.setDisabled():null;let c=n.facet(Ov).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,Wv(r,c),{pos:t.reduce((e,t)=>t.hasResult()?Math.min(e,t.from):e,1e8),create:$v,above:a.aboveCursor},i?i.timestamp:Date.now(),c,!1)}map(t){return new e(this.options,this.attrs,{...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)}},Bv=class e{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new e(Gv,`cm-ac-`+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:n}=t,r=n.facet(Ov),i=(r.override||n.languageDataAt(`autocomplete`,vv(n)).map(Cv)).map(e=>(this.active.find(t=>t.source==e)||new qv(e,this.active.some(e=>e.state!=0)?1: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(Xv));a&&t.docChanged&&(a=a.map(t.changes)),t.selection||i.some(e=>e.hasResult()&&t.changes.touchesRange(e.from,e.to))||!Vv(i,this.active)||o?a=zv.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 qv(e.source,0):e));for(let e of t.effects)e.is(jv)&&(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?Hv:Uv}};function Vv(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 Hv={"aria-autocomplete":`list`},Uv={};function Wv(e,t){let n={"aria-autocomplete":`list`,"aria-haspopup":`listbox`,"aria-controls":e};return t>-1&&(n[`aria-activedescendant`]=e+`-`+t),n}var Gv=[];function Kv(e,t){if(e.isUserEvent(`input.complete`)){let n=e.annotation(bv);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 qv=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=Kv(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(wv))i=new e(i.source,1,n.value);else if(n.is(Tv))i=new e(i.source,0);else if(n.is(Xv))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(vv(e.state))}},Jv=class e extends qv{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=vv(t.state);if(o>a||!r||n&2&&(vv(t.startState)==this.from||o<this.limit))return new qv(this.source,n&4?1:0);let s=t.changes.mapPos(this.limit);return Yv(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 pv(t.state,o,!1)))?new e(this.source,this.explicit,s,r,r.from,r.to??vv(t.state)):new qv(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 qv(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}};function Yv(e,t,n,r){if(!e)return!1;let i=t.sliceDoc(n,r);return typeof e==`function`?e(i,n,r,t):yv(e,!0).test(i)}var Xv=P.define({map(e,t){return e.map(e=>e.map(t))}}),Zv=bi.define({create(){return Bv.start()},update(e,t){return e.update(t)},provide:e=>[qd.from(e,e=>e.tooltip),G.contentAttributes.from(e,e=>e.attrs)]});function Qv(e,t){let n=t.completion.apply||t.completion.label,r=e.state.field(Zv).active.find(e=>e.source==t.source);return r instanceof Jv?(typeof n==`string`?e.dispatch({...xv(e.state,n,r.from,r.to),annotations:bv.of(t.completion)}):n(e,t.completion,r.from,r.to),!0):!1}var $v=Fv(Zv,Qv);function ey(e,t=`option`){return n=>{let r=n.state.field(Zv,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<n.state.facet(Ov).interactionDelay)return!1;let i=1,a;t==`page`&&(a=nf(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:jv.of(s)}),!0}}var ty=e=>{let t=e.state.field(Zv,!1);return e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(Ov).interactionDelay?!1:Qv(e,t.open.options[t.open.selected])},ny=e=>e.state.field(Zv,!1)?(e.dispatch({effects:wv.of(!0)}),!0):!1,ry=e=>{let t=e.state.field(Zv,!1);return!t||!t.active.some(e=>e.state!=0)?!1:(e.dispatch({effects:Tv.of(null)}),!0)},iy=class{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}},ay=50,oy=1e3,sy=bs.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(Zv).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(Zv),n=e.state.facet(Ov);if(!e.selectionSet&&!e.docChanged&&e.startState.field(Zv)==t)return;let r=e.transactions.some(e=>{let t=Kv(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>ay&&Date.now()-n.time>oy){for(let e of n.context.abortListeners)try{e()}catch(e){gs(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(wv)))&&(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(Zv);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(Ov).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=new pv(t,vv(t),e.explicit,this.view),r=new iy(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:Tv.of(null)}),gs(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(Ov).updateSyncTime))}accept(){this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(Ov),n=this.view.state.field(Zv);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=vv(i.updates.length?i.updates[0].startState:this.view.state),r=Math.min(n,i.done.from+(i.active.explicit?0:1)),a=new Jv(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 qv(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:Xv.of(e)})}},{eventHandlers:{blur(e){let t=this.view.state.field(Zv,!1);if(t&&t.tooltip&&this.view.state.facet(Ov).closeOnBlur){let n=t.open&&nf(this.view,t.open.tooltip);(!n||!n.dom.contains(e.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:Tv.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:wv.of(!1)}),20),this.composing=0}}}),cy=typeof navigator==`object`&&/Win/.test(navigator.platform),ly=Ci.highest(G.domEventHandlers({keydown(e,t){let n=t.state.field(Zv,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(cy&&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&&Qv(t,r),!1}})),uy=G.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`}}}),dy={brackets:[`(`,`[`,`{`,`'`,`"`],before:`)]}:;>`,stringPrefixes:[]},fy=P.define({map(e,t){return t.mapPos(e,-1,ni.TrackAfter)??void 0}}),py=new class extends ta{};py.startSide=1,py.endSide=-1;var my=bi.define({create(){return L.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(fy)&&(e=e.update({add:[py.range(n.value,n.value+1)]}));return e}});function hy(){return[by,my]}var gy=`()[]{}<>«»»«[]{}`;function _y(e){for(let t=0;t<16;t+=2)if(gy.charCodeAt(t)==e)return gy.charAt(t+1);return $r(e<128?e:e+1)}function vy(e,t){return e.languageDataAt(`closeBrackets`,t)[0]||dy}var yy=typeof navigator==`object`&&/Android\b/.test(navigator.userAgent),by=G.inputHandler.of((e,t,n,r)=>{if((yy?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let i=e.state.selection.main;if(r.length>2||r.length==2&&ei(Qr(r,0))==1||t!=i.from||n!=i.to)return!1;let a=Sy(e.state,r);return a?(e.dispatch(a),!0):!1}),xy=[{key:`Backspace`,run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=vy(e,e.selection.main.head).brackets||dy.brackets,r=null,i=e.changeByRange(t=>{if(t.empty){let r=Ty(e.doc,t.head);for(let i of n)if(i==r&&wy(e.doc,t.head)==_y(Qr(i,0)))return{changes:{from:t.head-i.length,to:t.head+i.length},range:M.cursor(t.head-i.length)}}return{range:r=t}});return r||t(e.update(i,{scrollIntoView:!0,userEvent:`delete.backward`})),!r}}];function Sy(e,t){let n=vy(e,e.selection.main.head),r=n.brackets||dy.brackets;for(let i of r){let a=_y(Qr(i,0));if(t==i)return a==i?Oy(e,i,r.indexOf(i+i+i)>-1,n):Ey(e,i,a,n.before||dy.before);if(t==a&&Cy(e,e.selection.main.from))return Dy(e,i,a)}return null}function Cy(e,t){let n=!1;return e.field(my).between(0,e.doc.length,e=>{e==t&&(n=!0)}),n}function wy(e,t){let n=e.sliceString(t,t+2);return n.slice(0,ei(Qr(n,0)))}function Ty(e,t){let n=e.sliceString(t-2,t);return ei(Qr(n,0))==n.length?n:n.slice(1)}function Ey(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:fy.of(a.to+t.length),range:M.range(a.anchor+t.length,a.head+t.length)};let o=wy(e.doc,a.head);return!o||/\s/.test(o)||r.indexOf(o)>-1?{changes:{insert:t+n,from:a.head},effects:fy.of(a.head+t.length),range:M.cursor(a.head+t.length)}:{range:i=a}});return i?null:e.update(a,{scrollIntoView:!0,userEvent:`input.type`})}function Dy(e,t,n){let r=null,i=e.changeByRange(t=>t.empty&&wy(e.doc,t.head)==n?{changes:{from:t.head,to:t.head+n.length,insert:n},range:M.cursor(t.head+n.length)}:r={range:t});return r?null:e.update(i,{scrollIntoView:!0,userEvent:`input.type`})}function Oy(e,t,n,r){let i=r.stringPrefixes||dy.stringPrefixes,a=null,o=e.changeByRange(r=>{if(!r.empty)return{changes:[{insert:t,from:r.from},{insert:t,from:r.to}],effects:fy.of(r.to+t.length),range:M.range(r.anchor+t.length,r.head+t.length)};let o=r.head,s=wy(e.doc,o),c;if(s==t){if(ky(e,o))return{changes:{insert:t+t,from:o},effects:fy.of(o+t.length),range:M.cursor(o+t.length)};if(Cy(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:M.cursor(o+r.length)}}}else if(n&&e.sliceDoc(o-2*t.length,o)==t+t&&(c=jy(e,o-2*t.length,i))>-1&&ky(e,c))return{changes:{insert:t+t+t+t,from:o},effects:fy.of(o+t.length),range:M.cursor(o+t.length)};else if(e.charCategorizer(o)(s)!=F.Word&&jy(e,o,i)>-1&&!Ay(e,o,t,i))return{changes:{insert:t+t,from:o},effects:fy.of(o+t.length),range:M.cursor(o+t.length)};return{range:a=r}});return a?null:e.update(o,{scrollIntoView:!0,userEvent:`input.type`})}function ky(e,t){let n=Jf(e).resolveInner(t+1);return n.parent&&n.from==t}function Ay(e,t,n,r){let i=Jf(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 jy(e,t,n){let r=e.charCategorizer(t);if(r(e.sliceDoc(t-1,t))!=F.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))!=F.Word)return n}return-1}function My(e={}){return[ly,Zv,Ov.of(e),sy,Py,uy]}var Ny=[{key:`Ctrl-Space`,run:ny},{mac:"Alt-`",run:ny},{mac:`Alt-i`,run:ny},{key:`Escape`,run:ry},{key:`ArrowDown`,run:ey(!0)},{key:`ArrowUp`,run:ey(!1)},{key:`PageDown`,run:ey(!0,`page`)},{key:`PageUp`,run:ey(!1,`page`)},{key:`Enter`,run:ty}],Py=Ci.highest(Pu.computeN([Ov],e=>e.facet(Ov).defaultKeymap?[Ny]:[])),Fy=class{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}},Iy=class e{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(t,n,r){let i=r.facet($y).markerFilter;i&&(t=i(t,r));let a=t.slice().sort((e,t)=>e.from-t.from||e.to-t.to),o=new sa,s=[],c=0,l=r.doc.iter(),u=0,d=r.doc.length;for(let e=0;;){let t=e==a.length?null:a[e];if(!t&&!s.length)break;let n,r;if(s.length)n=c,r=s.reduce((e,t)=>Math.min(e,t.to),t&&t.from>n?t.from:1e8);else{if(n=t.from,n>d)break;r=t.to,s.push(t),e++}for(;e<a.length;){let t=a[e];if(t.from==n&&(t.to>t.from||t.to==n))s.push(t),e++,r=Math.min(t.to,r);else{r=Math.min(t.from,r);break}}r=Math.min(r,d);let i=!1;if(s.some(e=>e.from==n&&(e.to==r||r==d))&&(i=n==r,!i&&r-n<10)){let e=n-(u+l.value.length);e>0&&(l.next(e),u=n);for(let e=n;;){if(e>=r){i=!0;break}if(!l.lineBreak&&u+l.value.length>e)break;e=u+l.value.length,u+=l.value.length,l.next()}}let f=db(s);if(i)o.add(n,n,B.widget({widget:new ib(f),diagnostics:s.slice()}));else{let e=s.reduce((e,t)=>t.markClass?e+` `+t.markClass:e,``);o.add(n,r,B.mark({class:`cm-lintRange cm-lintRange-`+f+e,diagnostics:s.slice(),inclusiveEnd:s.some(e=>e.to>r)}))}if(c=r,c==d)break;for(let e=0;e<s.length;e++)s[e].to<=c&&s.splice(e--,1)}let f=o.finish();return new e(f,n,Ly(f))}};function Ly(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 Fy(e,n,t||i.diagnostics[0]);else if(i.diagnostics.indexOf(r.diagnostic)<0)return!1;else r=new Fy(r.from,n,r.diagnostic)}),r}function Ry(e,t){let n=t.pos,r=t.end||n,i=e.state.facet($y).hideOn(e,n,r);if(i!=null)return i;let a=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(e=>e.is(Vy))||e.changes.touchesRange(a.from,Math.max(a.to,r)))}function zy(e,t){return e.field(Wy,!1)?t:t.concat(P.appendConfig.of(fb))}function By(e,t){return{effects:zy(e,[Vy.of(t)])}}var Vy=P.define(),Hy=P.define(),Uy=P.define(),Wy=bi.define({create(){return new Iy(B.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=Ly(n,e.selected.diagnostic,i)||Ly(n,null,i)}!n.size&&i&&t.state.facet($y).autoPanel&&(i=null),e=new Iy(n,i,r)}for(let n of t.effects)if(n.is(Vy)){let r=t.state.facet($y).autoPanel?n.value.length?ob.open:null:e.panel;e=Iy.init(n.value,r,t.state)}else n.is(Hy)?e=new Iy(e.diagnostics,n.value?ob.open:null,e.selected):n.is(Uy)&&(e=new Iy(e.diagnostics,e.panel,n.value));return e},provide:e=>[uf.from(e,e=>e.panel),G.decorations.from(e,e=>e.diagnostics)]}),Gy=B.mark({class:`cm-lintRange cm-lintRange-active`});function Ky(e,t,n){let{diagnostics:r}=e.state.field(Wy),i,a=-1,o=-1;r.between(t-(n<0?1:0),t+(n>0?1: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($y).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:qy(e,i)}}}:null}function qy(e,t){return R(`ul`,{class:`cm-tooltip-lint`},t.map(t=>rb(e,t,!1)))}var Jy=e=>{let t=e.state.field(Wy,!1);(!t||!t.panel)&&e.dispatch({effects:zy(e.state,[Hy.of(!0)])});let n=of(e,ob.open);return n&&n.dom.querySelector(`.cm-panel-lint ul`).focus(),!0},Yy=e=>{let t=e.state.field(Wy,!1);return!t||!t.panel?!1:(e.dispatch({effects:Hy.of(!1)}),!0)},Xy=[{key:`Mod-Shift-m`,run:Jy,preventDefault:!0},{key:`F8`,run:e=>{let t=e.state.field(Wy,!1);if(!t)return!1;let n=e.state.selection.main,r=Ly(t.diagnostics,null,n.to+1);return!r&&(r=Ly(t.diagnostics,null,0),!r||r.from==n.from&&r.to==n.to)?!1:(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)}}],Zy=bs.fromClass(class{constructor(e){this.view=e,this.timeout=-1,this.set=!0;let{delay:t}=e.state.facet($y);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($y);t.length&&Qy(t.map(e=>Promise.resolve(e(this.view))),t=>{this.view.state.doc==e.doc&&this.view.dispatch(By(this.view.state,t.reduce((e,t)=>e.concat(t))))},e=>{gs(this.view.state,e)})}}update(e){let t=e.state.facet($y);(e.docChanged||t!=e.startState.facet($y)||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 Qy(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 $y=N.define({combine(e){return{sources:e.map(e=>e.source).filter(e=>e!=null),...ea(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:eb,tooltipFilter:eb,needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t,hideOn:(e,t)=>e?t?(n,r,i)=>e(n,r,i)||t(n,r,i):e:t,autoPanel:(e,t)=>e||t})}}});function eb(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function tb(e,t={}){return[$y.of({source:e,config:t}),Zy,fb]}function nb(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 rb(e,t,n){let r=n?nb(t.actions):[];return R(`li`,{class:`cm-diagnostic cm-diagnostic-`+t.severity},R(`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=Ly(e.state.field(Wy).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),R(`u`,s.slice(c,c+1)),s.slice(c+1)];return R(`button`,{type:`button`,class:`cm-diagnosticAction`+(n.markClass?` `+n.markClass:``),onclick:o,onmousedown:o,"aria-label":` Action: ${s}${c<0?``:` (access key "${r[i]})"`}.`},l)}),t.source&&R(`div`,{class:`cm-diagnosticSource`},t.source))}var ib=class extends Qa{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return R(`span`,{class:`cm-lintPoint cm-lintPoint-`+this.sev})}},ab=class{constructor(e,t){this.diagnostic=t,this.id=`item_`+Math.floor(Math.random()*4294967295).toString(16),this.dom=rb(e,t,!0),this.dom.id=this.id,this.dom.setAttribute(`role`,`option`)}},ob=class e{constructor(e){this.view=e,this.items=[];let t=t=>{if(!(t.ctrlKey||t.altKey||t.metaKey)){if(t.keyCode==27)Yy(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=nb(n.actions);for(let i=0;i<r.length;i++)if(r[i].toUpperCase().charCodeAt(0)==t.keyCode){let t=Ly(this.view.state.field(Wy).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=R(`ul`,{tabIndex:0,role:`listbox`,"aria-label":this.view.state.phrase(`Diagnostics`),onkeydown:t,onclick:n}),this.dom=R(`div`,{class:`cm-panel-lint`},this.list,R(`button`,{type:`button`,name:`close`,"aria-label":this.view.state.phrase(`close`),onclick:()=>Yy(this.view)},`×`)),this.update()}get selectedIndex(){let e=this.view.state.field(Wy).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(Wy),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 ab(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 ab(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=Ly(this.view.state.field(Wy).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:Uy.of(t)})}static open(t){return new e(t)}};function sb(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 cb(e){return sb(`<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 lb=G.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:cb(`#d11`)},".cm-lintRange-warning":{backgroundImage:cb(`orange`)},".cm-lintRange-info":{backgroundImage:cb(`#999`)},".cm-lintRange-hint":{backgroundImage:cb(`#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}},"&dark .cm-lintRange-active":{backgroundColor:`#86714a80`},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:`#2e343e`}}});function ub(e){return e==`error`?4:e==`warning`?3:e==`info`?2:1}function db(e){let t=`hint`,n=1;for(let r of e){let e=ub(r.severity);e>n&&(n=e,t=r.severity)}return t}var fb=[Wy,G.decorations.compute([Wy],e=>{let{selected:t,panel:n}=e.field(Wy);return!t||!n||t.from==t.to?B.none:B.set([Gy.range(t.from,t.to)])}),tf(Ky,{hideOn:Ry}),lb],pb=[Lf(),Vf(),_d(),Ym(),Qp(),Qu(),sd(),I.allowMultipleSelections.of(!0),wp(),im(sm,{fallback:!0}),_m(),hy(),My(),Pd(),Ld(),wd(),g_(),Pu.of([...xy,...n_,...av,...mh,...Up,...Ny,...Xy])];_d(),Ym(),Qu(),im(sm,{fallback:!0}),Pu.of([...n_,...mh]);var mb=im(em.define([{tag:A.keyword,color:`var(--gq-syn-keyword)`},{tag:A.definitionKeyword,color:`var(--gq-syn-keyword)`,fontWeight:`500`},{tag:A.propertyName,color:`var(--gq-syn-field)`},{tag:A.atom,color:`var(--gq-syn-type)`},{tag:[A.special(A.name)],color:`var(--gq-syn-type)`},{tag:A.string,color:`var(--gq-syn-string)`},{tag:[A.integer,A.float],color:`var(--gq-syn-number)`},{tag:A.bool,color:`var(--gq-syn-number)`},{tag:A.null,color:`var(--gq-text-tertiary)`},{tag:A.lineComment,color:`var(--gq-syn-comment)`,fontStyle:`italic`},{tag:A.variableName,color:`var(--gq-syn-variable)`},{tag:A.modifier,color:`var(--gq-syn-directive)`},{tag:A.attributeName,color:`var(--gq-syn-variable)`},{tag:[A.paren,A.brace,A.separator,A.punctuation],color:`var(--gq-syn-punctuation)`}]));function hb({value:e,onChange:t,extensions:n=[],readOnly:r=!1,placeholder:i}){let a=(0,l.useRef)(null),o=(0,l.useRef)(null),s=(0,l.useRef)(t);s.current=t;let c=(0,l.useRef)(new Ti);return(0,l.useEffect)(()=>{if(!a.current)return;let t=G.updateListener.of(e=>{e.docChanged&&s.current?.(e.state.doc.toString())}),l=[pb,mb,G.theme({"&":{height:`100%`},".cm-content":{fontFamily:`var(--gq-font-mono)`,fontSize:`var(--gq-editor-font-size, 13px)`,lineHeight:`var(--gq-editor-line-height, 1.6)`},".cm-gutters":{backgroundColor:`transparent`,borderRight:`1px solid var(--gq-border)`,color:`var(--gq-text-tertiary)`,fontSize:`11px`,minWidth:`36px`},".cm-activeLineGutter":{backgroundColor:`transparent`,color:`var(--gq-text-secondary)`},".cm-activeLine":{backgroundColor:`rgba(255, 255, 255, 0.02)`},".cm-cursor":{borderLeftColor:`var(--gq-accent)`,borderLeftWidth:`1.5px`},".cm-selectionBackground":{backgroundColor:`var(--gq-accent-subtle) !important`},"&.cm-focused .cm-selectionBackground":{backgroundColor:`var(--gq-accent-muted) !important`},".cm-tooltip":{backgroundColor:`var(--gq-bg-elevated)`,border:`1px solid var(--gq-border-active)`,borderRadius:`var(--gq-radius)`,color:`var(--gq-text)`,fontSize:`12px`,boxShadow:`0 8px 24px rgba(0, 0, 0, 0.5)`},".cm-tooltip-autocomplete":{"& > ul":{fontFamily:`var(--gq-font-mono)`,fontSize:`12px`},"& > ul > li":{padding:`2px 8px`},"& > ul > li[aria-selected]":{backgroundColor:`var(--gq-accent-subtle)`,color:`var(--gq-accent)`}},".cm-completionLabel":{fontFamily:`var(--gq-font-mono)`},".cm-completionDetail":{fontFamily:`var(--gq-font-mono)`,color:`var(--gq-text-tertiary)`,fontSize:`10px`,fontStyle:`normal`}}),t,c.current.of(n)];r&&(l.push(I.readOnly.of(!0)),l.push(G.editable.of(!1))),i&&l.push(Od(i));let u=new G({state:I.create({doc:e,extensions:l}),parent:a.current});return o.current=u,()=>{u.destroy(),o.current=null}},[]),(0,l.useEffect)(()=>{let e=o.current;e&&e.dispatch({effects:c.current.reconfigure(n)})},[n]),(0,l.useEffect)(()=>{let t=o.current;if(!t)return;let n=t.state.doc.toString();n!==e&&t.dispatch({changes:{from:0,to:n.length,insert:e}})},[e]),{containerRef:a,viewRef:o}}function gb({className:e}){let{editor:t}=Dt(),{containerRef:n}=hb({value:h(t,e=>e.headers),onChange:h(t,e=>e.setHeaders),extensions:(0,l.useMemo)(()=>[Mm()],[]),placeholder:`{ "Authorization": "Bearer ..." }`});return(0,u.jsx)(`div`,{ref:n,className:E(`flex-1 overflow-auto`,e)})}function _b(e){let t=Object.keys(e),n=t.length,r=Array(n);for(let i=0;i<n;++i)r[i]=e[t[i]];return r}function K(e,t){return vb(t,bb(e.string))}function vb(e,t){return!t||t.trim()===``||t.trim()===`:`||t.trim()===`{`?yb(e,e=>!e.isDeprecated):yb(yb(e.map(e=>({proximity:xb(bb(e.label),t),entry:e})),e=>e.proximity<=2),e=>!e.entry.isDeprecated).sort((e,t)=>(e.entry.isDeprecated?1:0)-(t.entry.isDeprecated?1:0)||e.proximity-t.proximity||e.entry.label.length-t.entry.label.length).map(e=>e.entry)}function yb(e,t){let n=e.filter(t);return n.length===0?e:n}function bb(e){return e.toLowerCase().replaceAll(/\W/g,``)}function xb(e,t){let n=Sb(t,e);return e.length>t.length&&(n-=e.length-t.length-1,n+=e.indexOf(t)===0?0:.5),n}function Sb(e,t){let n,r,i=[],a=e.length,o=t.length;for(n=0;n<=a;n++)i[n]=[n];for(r=1;r<=o;r++)i[0][r]=r;for(n=1;n<=a;n++)for(r=1;r<=o;r++){let a=e[n-1]===t[r-1]?0:1;i[n][r]=Math.min(i[n-1][r]+1,i[n][r-1]+1,i[n-1][r-1]+a),n>1&&r>1&&e[n-1]===t[r-2]&&e[n-2]===t[r-1]&&(i[n][r]=Math.min(i[n][r],i[n-2][r-2]+a))}return i[a][o]}var Cb=e=>` {\n $${e??1}\n}`,wb=(e,t,n)=>{if(!t)return n??e;let r=(0,d.getNamedType)(t);return(0,d.isObjectType)(r)||(0,d.isInputObjectType)(r)||(0,d.isListType)(r)||(0,d.isAbstractType)(r)?e+Cb():n??e},Tb=(e,t,n)=>(0,d.isListType)(t)?e+`[${wb(``,(0,d.getNamedType)(t.ofType),`$1`)}]`:wb(e,t,n),Eb=e=>{let t=e.args.filter(e=>e.type.toString().endsWith(`!`));if(t.length)return e.name+`(${t.map((e,t)=>`${e.name}: $${t+1}`)}) ${wb(``,e.type,`
|
|
13
|
+
`)}`},Db;(function(e){function t(e){return typeof e==`string`}e.is=t})(Db||={});var Ob;(function(e){function t(e){return typeof e==`string`}e.is=t})(Ob||={});var kb;(function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647;function t(t){return typeof t==`number`&&e.MIN_VALUE<=t&&t<=e.MAX_VALUE}e.is=t})(kb||={});var Ab;(function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647;function t(t){return typeof t==`number`&&e.MIN_VALUE<=t&&t<=e.MAX_VALUE}e.is=t})(Ab||={});var jb;(function(e){function t(e,t){return e===Number.MAX_VALUE&&(e=Ab.MAX_VALUE),t===Number.MAX_VALUE&&(t=Ab.MAX_VALUE),{line:e,character:t}}e.create=t;function n(e){let t=e;return q.objectLiteral(t)&&q.uinteger(t.line)&&q.uinteger(t.character)}e.is=n})(jb||={});var Mb;(function(e){function t(e,t,n,r){if(q.uinteger(e)&&q.uinteger(t)&&q.uinteger(n)&&q.uinteger(r))return{start:jb.create(e,t),end:jb.create(n,r)};if(jb.is(e)&&jb.is(t))return{start:e,end:t};throw Error(`Range#create called with invalid arguments[${e}, ${t}, ${n}, ${r}]`)}e.create=t;function n(e){let t=e;return q.objectLiteral(t)&&jb.is(t.start)&&jb.is(t.end)}e.is=n})(Mb||={});var Nb;(function(e){function t(e,t){return{uri:e,range:t}}e.create=t;function n(e){let t=e;return q.objectLiteral(t)&&Mb.is(t.range)&&(q.string(t.uri)||q.undefined(t.uri))}e.is=n})(Nb||={});var Pb;(function(e){function t(e,t,n,r){return{targetUri:e,targetRange:t,targetSelectionRange:n,originSelectionRange:r}}e.create=t;function n(e){let t=e;return q.objectLiteral(t)&&Mb.is(t.targetRange)&&q.string(t.targetUri)&&Mb.is(t.targetSelectionRange)&&(Mb.is(t.originSelectionRange)||q.undefined(t.originSelectionRange))}e.is=n})(Pb||={});var Fb;(function(e){function t(e,t,n,r){return{red:e,green:t,blue:n,alpha:r}}e.create=t;function n(e){let t=e;return q.objectLiteral(t)&&q.numberRange(t.red,0,1)&&q.numberRange(t.green,0,1)&&q.numberRange(t.blue,0,1)&&q.numberRange(t.alpha,0,1)}e.is=n})(Fb||={});var Ib;(function(e){function t(e,t){return{range:e,color:t}}e.create=t;function n(e){let t=e;return q.objectLiteral(t)&&Mb.is(t.range)&&Fb.is(t.color)}e.is=n})(Ib||={});var Lb;(function(e){function t(e,t,n){return{label:e,textEdit:t,additionalTextEdits:n}}e.create=t;function n(e){let t=e;return q.objectLiteral(t)&&q.string(t.label)&&(q.undefined(t.textEdit)||Kb.is(t))&&(q.undefined(t.additionalTextEdits)||q.typedArray(t.additionalTextEdits,Kb.is))}e.is=n})(Lb||={});var Rb;(function(e){e.Comment=`comment`,e.Imports=`imports`,e.Region=`region`})(Rb||={});var zb;(function(e){function t(e,t,n,r,i,a){let o={startLine:e,endLine:t};return q.defined(n)&&(o.startCharacter=n),q.defined(r)&&(o.endCharacter=r),q.defined(i)&&(o.kind=i),q.defined(a)&&(o.collapsedText=a),o}e.create=t;function n(e){let t=e;return q.objectLiteral(t)&&q.uinteger(t.startLine)&&q.uinteger(t.startLine)&&(q.undefined(t.startCharacter)||q.uinteger(t.startCharacter))&&(q.undefined(t.endCharacter)||q.uinteger(t.endCharacter))&&(q.undefined(t.kind)||q.string(t.kind))}e.is=n})(zb||={});var Bb;(function(e){function t(e,t){return{location:e,message:t}}e.create=t;function n(e){let t=e;return q.defined(t)&&Nb.is(t.location)&&q.string(t.message)}e.is=n})(Bb||={});var Vb;(function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4})(Vb||={});var Hb;(function(e){e.Unnecessary=1,e.Deprecated=2})(Hb||={});var Ub;(function(e){function t(e){let t=e;return q.objectLiteral(t)&&q.string(t.href)}e.is=t})(Ub||={});var Wb;(function(e){function t(e,t,n,r,i,a){let o={range:e,message:t};return q.defined(n)&&(o.severity=n),q.defined(r)&&(o.code=r),q.defined(i)&&(o.source=i),q.defined(a)&&(o.relatedInformation=a),o}e.create=t;function n(e){let t=e;return q.defined(t)&&Mb.is(t.range)&&q.string(t.message)&&(q.number(t.severity)||q.undefined(t.severity))&&(q.integer(t.code)||q.string(t.code)||q.undefined(t.code))&&(q.undefined(t.codeDescription)||q.string(t.codeDescription?.href))&&(q.string(t.source)||q.undefined(t.source))&&(q.undefined(t.relatedInformation)||q.typedArray(t.relatedInformation,Bb.is))}e.is=n})(Wb||={});var Gb;(function(e){function t(e,t,...n){let r={title:e,command:t};return q.defined(n)&&n.length>0&&(r.arguments=n),r}e.create=t;function n(e){let t=e;return q.defined(t)&&q.string(t.title)&&q.string(t.command)}e.is=n})(Gb||={});var Kb;(function(e){function t(e,t){return{range:e,newText:t}}e.replace=t;function n(e,t){return{range:{start:e,end:e},newText:t}}e.insert=n;function r(e){return{range:e,newText:``}}e.del=r;function i(e){let t=e;return q.objectLiteral(t)&&q.string(t.newText)&&Mb.is(t.range)}e.is=i})(Kb||={});var qb;(function(e){function t(e,t,n){let r={label:e};return t!==void 0&&(r.needsConfirmation=t),n!==void 0&&(r.description=n),r}e.create=t;function n(e){let t=e;return q.objectLiteral(t)&&q.string(t.label)&&(q.boolean(t.needsConfirmation)||t.needsConfirmation===void 0)&&(q.string(t.description)||t.description===void 0)}e.is=n})(qb||={});var Jb;(function(e){function t(e){let t=e;return q.string(t)}e.is=t})(Jb||={});var Yb;(function(e){function t(e,t,n){return{range:e,newText:t,annotationId:n}}e.replace=t;function n(e,t,n){return{range:{start:e,end:e},newText:t,annotationId:n}}e.insert=n;function r(e,t){return{range:e,newText:``,annotationId:t}}e.del=r;function i(e){let t=e;return Kb.is(t)&&(qb.is(t.annotationId)||Jb.is(t.annotationId))}e.is=i})(Yb||={});var Xb;(function(e){function t(e,t){return{textDocument:e,edits:t}}e.create=t;function n(e){let t=e;return q.defined(t)&&rx.is(t.textDocument)&&Array.isArray(t.edits)}e.is=n})(Xb||={});var Zb;(function(e){function t(e,t,n){let r={kind:`create`,uri:e};return t!==void 0&&(t.overwrite!==void 0||t.ignoreIfExists!==void 0)&&(r.options=t),n!==void 0&&(r.annotationId=n),r}e.create=t;function n(e){let t=e;return t&&t.kind===`create`&&q.string(t.uri)&&(t.options===void 0||(t.options.overwrite===void 0||q.boolean(t.options.overwrite))&&(t.options.ignoreIfExists===void 0||q.boolean(t.options.ignoreIfExists)))&&(t.annotationId===void 0||Jb.is(t.annotationId))}e.is=n})(Zb||={});var Qb;(function(e){function t(e,t,n,r){let i={kind:`rename`,oldUri:e,newUri:t};return n!==void 0&&(n.overwrite!==void 0||n.ignoreIfExists!==void 0)&&(i.options=n),r!==void 0&&(i.annotationId=r),i}e.create=t;function n(e){let t=e;return t&&t.kind===`rename`&&q.string(t.oldUri)&&q.string(t.newUri)&&(t.options===void 0||(t.options.overwrite===void 0||q.boolean(t.options.overwrite))&&(t.options.ignoreIfExists===void 0||q.boolean(t.options.ignoreIfExists)))&&(t.annotationId===void 0||Jb.is(t.annotationId))}e.is=n})(Qb||={});var $b;(function(e){function t(e,t,n){let r={kind:`delete`,uri:e};return t!==void 0&&(t.recursive!==void 0||t.ignoreIfNotExists!==void 0)&&(r.options=t),n!==void 0&&(r.annotationId=n),r}e.create=t;function n(e){let t=e;return t&&t.kind===`delete`&&q.string(t.uri)&&(t.options===void 0||(t.options.recursive===void 0||q.boolean(t.options.recursive))&&(t.options.ignoreIfNotExists===void 0||q.boolean(t.options.ignoreIfNotExists)))&&(t.annotationId===void 0||Jb.is(t.annotationId))}e.is=n})($b||={});var ex;(function(e){function t(e){let t=e;return t&&(t.changes!==void 0||t.documentChanges!==void 0)&&(t.documentChanges===void 0||t.documentChanges.every(e=>q.string(e.kind)?Zb.is(e)||Qb.is(e)||$b.is(e):Xb.is(e)))}e.is=t})(ex||={});var tx;(function(e){function t(e){return{uri:e}}e.create=t;function n(e){let t=e;return q.defined(t)&&q.string(t.uri)}e.is=n})(tx||={});var nx;(function(e){function t(e,t){return{uri:e,version:t}}e.create=t;function n(e){let t=e;return q.defined(t)&&q.string(t.uri)&&q.integer(t.version)}e.is=n})(nx||={});var rx;(function(e){function t(e,t){return{uri:e,version:t}}e.create=t;function n(e){let t=e;return q.defined(t)&&q.string(t.uri)&&(t.version===null||q.integer(t.version))}e.is=n})(rx||={});var ix;(function(e){function t(e,t,n,r){return{uri:e,languageId:t,version:n,text:r}}e.create=t;function n(e){let t=e;return q.defined(t)&&q.string(t.uri)&&q.string(t.languageId)&&q.integer(t.version)&&q.string(t.text)}e.is=n})(ix||={});var ax;(function(e){e.PlainText=`plaintext`,e.Markdown=`markdown`;function t(t){let n=t;return n===e.PlainText||n===e.Markdown}e.is=t})(ax||={});var ox;(function(e){function t(e){let t=e;return q.objectLiteral(e)&&ax.is(t.kind)&&q.string(t.value)}e.is=t})(ox||={});var sx;(function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25})(sx||={});var cx;(function(e){e.PlainText=1,e.Snippet=2})(cx||={});var lx;(function(e){e.Deprecated=1})(lx||={});var ux;(function(e){function t(e,t,n){return{newText:e,insert:t,replace:n}}e.create=t;function n(e){let t=e;return t&&q.string(t.newText)&&Mb.is(t.insert)&&Mb.is(t.replace)}e.is=n})(ux||={});var dx;(function(e){e.asIs=1,e.adjustIndentation=2})(dx||={});var fx;(function(e){function t(e){let t=e;return t&&(q.string(t.detail)||t.detail===void 0)&&(q.string(t.description)||t.description===void 0)}e.is=t})(fx||={});var px;(function(e){function t(e){return{label:e}}e.create=t})(px||={});var mx;(function(e){function t(e,t){return{items:e||[],isIncomplete:!!t}}e.create=t})(mx||={});var hx;(function(e){function t(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,`\\$&`)}e.fromPlainText=t;function n(e){let t=e;return q.string(t)||q.objectLiteral(t)&&q.string(t.language)&&q.string(t.value)}e.is=n})(hx||={});var gx;(function(e){function t(e){let t=e;return!!t&&q.objectLiteral(t)&&(ox.is(t.contents)||hx.is(t.contents)||q.typedArray(t.contents,hx.is))&&(e.range===void 0||Mb.is(e.range))}e.is=t})(gx||={});var _x;(function(e){function t(e,t){return t?{label:e,documentation:t}:{label:e}}e.create=t})(_x||={});var vx;(function(e){function t(e,t,...n){let r={label:e};return q.defined(t)&&(r.documentation=t),q.defined(n)?r.parameters=n:r.parameters=[],r}e.create=t})(vx||={});var yx;(function(e){e.Text=1,e.Read=2,e.Write=3})(yx||={});var bx;(function(e){function t(e,t){let n={range:e};return q.number(t)&&(n.kind=t),n}e.create=t})(bx||={});var xx;(function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26})(xx||={});var Sx;(function(e){e.Deprecated=1})(Sx||={});var Cx;(function(e){function t(e,t,n,r,i){let a={name:e,kind:t,location:{uri:r,range:n}};return i&&(a.containerName=i),a}e.create=t})(Cx||={});var wx;(function(e){function t(e,t,n,r){return r===void 0?{name:e,kind:t,location:{uri:n}}:{name:e,kind:t,location:{uri:n,range:r}}}e.create=t})(wx||={});var Tx;(function(e){function t(e,t,n,r,i,a){let o={name:e,detail:t,kind:n,range:r,selectionRange:i};return a!==void 0&&(o.children=a),o}e.create=t;function n(e){let t=e;return t&&q.string(t.name)&&q.number(t.kind)&&Mb.is(t.range)&&Mb.is(t.selectionRange)&&(t.detail===void 0||q.string(t.detail))&&(t.deprecated===void 0||q.boolean(t.deprecated))&&(t.children===void 0||Array.isArray(t.children))&&(t.tags===void 0||Array.isArray(t.tags))}e.is=n})(Tx||={});var Ex;(function(e){e.Empty=``,e.QuickFix=`quickfix`,e.Refactor=`refactor`,e.RefactorExtract=`refactor.extract`,e.RefactorInline=`refactor.inline`,e.RefactorRewrite=`refactor.rewrite`,e.Source=`source`,e.SourceOrganizeImports=`source.organizeImports`,e.SourceFixAll=`source.fixAll`})(Ex||={});var Dx;(function(e){e.Invoked=1,e.Automatic=2})(Dx||={});var Ox;(function(e){function t(e,t,n){let r={diagnostics:e};return t!=null&&(r.only=t),n!=null&&(r.triggerKind=n),r}e.create=t;function n(e){let t=e;return q.defined(t)&&q.typedArray(t.diagnostics,Wb.is)&&(t.only===void 0||q.typedArray(t.only,q.string))&&(t.triggerKind===void 0||t.triggerKind===Dx.Invoked||t.triggerKind===Dx.Automatic)}e.is=n})(Ox||={});var kx;(function(e){function t(e,t,n){let r={title:e},i=!0;return typeof t==`string`?(i=!1,r.kind=t):Gb.is(t)?r.command=t:r.edit=t,i&&n!==void 0&&(r.kind=n),r}e.create=t;function n(e){let t=e;return t&&q.string(t.title)&&(t.diagnostics===void 0||q.typedArray(t.diagnostics,Wb.is))&&(t.kind===void 0||q.string(t.kind))&&(t.edit!==void 0||t.command!==void 0)&&(t.command===void 0||Gb.is(t.command))&&(t.isPreferred===void 0||q.boolean(t.isPreferred))&&(t.edit===void 0||ex.is(t.edit))}e.is=n})(kx||={});var Ax;(function(e){function t(e,t){let n={range:e};return q.defined(t)&&(n.data=t),n}e.create=t;function n(e){let t=e;return q.defined(t)&&Mb.is(t.range)&&(q.undefined(t.command)||Gb.is(t.command))}e.is=n})(Ax||={});var jx;(function(e){function t(e,t){return{tabSize:e,insertSpaces:t}}e.create=t;function n(e){let t=e;return q.defined(t)&&q.uinteger(t.tabSize)&&q.boolean(t.insertSpaces)}e.is=n})(jx||={});var Mx;(function(e){function t(e,t,n){return{range:e,target:t,data:n}}e.create=t;function n(e){let t=e;return q.defined(t)&&Mb.is(t.range)&&(q.undefined(t.target)||q.string(t.target))}e.is=n})(Mx||={});var Nx;(function(e){function t(e,t){return{range:e,parent:t}}e.create=t;function n(t){let n=t;return q.objectLiteral(n)&&Mb.is(n.range)&&(n.parent===void 0||e.is(n.parent))}e.is=n})(Nx||={});var Px;(function(e){e.namespace=`namespace`,e.type=`type`,e.class=`class`,e.enum=`enum`,e.interface=`interface`,e.struct=`struct`,e.typeParameter=`typeParameter`,e.parameter=`parameter`,e.variable=`variable`,e.property=`property`,e.enumMember=`enumMember`,e.event=`event`,e.function=`function`,e.method=`method`,e.macro=`macro`,e.keyword=`keyword`,e.modifier=`modifier`,e.comment=`comment`,e.string=`string`,e.number=`number`,e.regexp=`regexp`,e.operator=`operator`,e.decorator=`decorator`})(Px||={});var Fx;(function(e){e.declaration=`declaration`,e.definition=`definition`,e.readonly=`readonly`,e.static=`static`,e.deprecated=`deprecated`,e.abstract=`abstract`,e.async=`async`,e.modification=`modification`,e.documentation=`documentation`,e.defaultLibrary=`defaultLibrary`})(Fx||={});var Ix;(function(e){function t(e){let t=e;return q.objectLiteral(t)&&(t.resultId===void 0||typeof t.resultId==`string`)&&Array.isArray(t.data)&&(t.data.length===0||typeof t.data[0]==`number`)}e.is=t})(Ix||={});var Lx;(function(e){function t(e,t){return{range:e,text:t}}e.create=t;function n(e){let t=e;return t!=null&&Mb.is(t.range)&&q.string(t.text)}e.is=n})(Lx||={});var Rx;(function(e){function t(e,t,n){return{range:e,variableName:t,caseSensitiveLookup:n}}e.create=t;function n(e){let t=e;return t!=null&&Mb.is(t.range)&&q.boolean(t.caseSensitiveLookup)&&(q.string(t.variableName)||t.variableName===void 0)}e.is=n})(Rx||={});var zx;(function(e){function t(e,t){return{range:e,expression:t}}e.create=t;function n(e){let t=e;return t!=null&&Mb.is(t.range)&&(q.string(t.expression)||t.expression===void 0)}e.is=n})(zx||={});var Bx;(function(e){function t(e,t){return{frameId:e,stoppedLocation:t}}e.create=t;function n(e){let t=e;return q.defined(t)&&Mb.is(e.stoppedLocation)}e.is=n})(Bx||={});var Vx;(function(e){e.Type=1,e.Parameter=2;function t(e){return e===1||e===2}e.is=t})(Vx||={});var Hx;(function(e){function t(e){return{value:e}}e.create=t;function n(e){let t=e;return q.objectLiteral(t)&&(t.tooltip===void 0||q.string(t.tooltip)||ox.is(t.tooltip))&&(t.location===void 0||Nb.is(t.location))&&(t.command===void 0||Gb.is(t.command))}e.is=n})(Hx||={});var Ux;(function(e){function t(e,t,n){let r={position:e,label:t};return n!==void 0&&(r.kind=n),r}e.create=t;function n(e){let t=e;return q.objectLiteral(t)&&jb.is(t.position)&&(q.string(t.label)||q.typedArray(t.label,Hx.is))&&(t.kind===void 0||Vx.is(t.kind))&&t.textEdits===void 0||q.typedArray(t.textEdits,Kb.is)&&(t.tooltip===void 0||q.string(t.tooltip)||ox.is(t.tooltip))&&(t.paddingLeft===void 0||q.boolean(t.paddingLeft))&&(t.paddingRight===void 0||q.boolean(t.paddingRight))}e.is=n})(Ux||={});var Wx;(function(e){function t(e){return{kind:`snippet`,value:e}}e.createSnippet=t})(Wx||={});var Gx;(function(e){function t(e,t,n,r){return{insertText:e,filterText:t,range:n,command:r}}e.create=t})(Gx||={});var Kx;(function(e){function t(e){return{items:e}}e.create=t})(Kx||={});var qx;(function(e){e.Invoked=0,e.Automatic=1})(qx||={});var Jx;(function(e){function t(e,t){return{range:e,text:t}}e.create=t})(Jx||={});var Yx;(function(e){function t(e,t){return{triggerKind:e,selectedCompletionInfo:t}}e.create=t})(Yx||={});var Xx;(function(e){function t(e){let t=e;return q.objectLiteral(t)&&Ob.is(t.uri)&&q.string(t.name)}e.is=t})(Xx||={});var Zx;(function(e){function t(e,t,n,r){return new Qx(e,t,n,r)}e.create=t;function n(e){let t=e;return!!(q.defined(t)&&q.string(t.uri)&&(q.undefined(t.languageId)||q.string(t.languageId))&&q.uinteger(t.lineCount)&&q.func(t.getText)&&q.func(t.positionAt)&&q.func(t.offsetAt))}e.is=n;function r(e,t){let n=e.getText(),r=i(t,(e,t)=>{let n=e.range.start.line-t.range.start.line;return n===0?e.range.start.character-t.range.start.character:n}),a=n.length;for(let t=r.length-1;t>=0;t--){let i=r[t],o=e.offsetAt(i.range.start),s=e.offsetAt(i.range.end);if(s<=a)n=n.substring(0,o)+i.newText+n.substring(s,n.length);else throw Error(`Overlapping edit`);a=o}return n}e.applyEdits=r;function i(e,t){if(e.length<=1)return e;let n=e.length/2|0,r=e.slice(0,n),a=e.slice(n);i(r,t),i(a,t);let o=0,s=0,c=0;for(;o<r.length&&s<a.length;)t(r[o],a[s])<=0?e[c++]=r[o++]:e[c++]=a[s++];for(;o<r.length;)e[c++]=r[o++];for(;s<a.length;)e[c++]=a[s++];return e}})(Zx||={});var Qx=class{constructor(e,t,n,r){this._uri=e,this._languageId=t,this._version=n,this._content=r,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content}update(e,t){this._content=e.text,this._version=t,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let e=[],t=this._content,n=!0;for(let r=0;r<t.length;r++){n&&=(e.push(r),!1);let i=t.charAt(r);n=i===`\r`||i===`
|
|
14
|
+
`,i===`\r`&&r+1<t.length&&t.charAt(r+1)===`
|
|
15
|
+
`&&r++}n&&t.length>0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),n=0,r=t.length;if(r===0)return jb.create(0,e);for(;n<r;){let i=Math.floor((n+r)/2);t[i]>e?r=i:n=i+1}let i=n-1;return jb.create(i,e-t[i])}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let n=t[e.line],r=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,r),n)}get lineCount(){return this.getLineOffsets().length}},q;(function(e){let t=Object.prototype.toString;function n(e){return e!==void 0}e.defined=n;function r(e){return e===void 0}e.undefined=r;function i(e){return e===!0||e===!1}e.boolean=i;function a(e){return t.call(e)===`[object String]`}e.string=a;function o(e){return t.call(e)===`[object Number]`}e.number=o;function s(e,n,r){return t.call(e)===`[object Number]`&&n<=e&&e<=r}e.numberRange=s;function c(e){return t.call(e)===`[object Number]`&&-2147483648<=e&&e<=2147483647}e.integer=c;function l(e){return t.call(e)===`[object Number]`&&0<=e&&e<=2147483647}e.uinteger=l;function u(e){return t.call(e)===`[object Function]`}e.func=u;function d(e){return typeof e==`object`&&!!e}e.objectLiteral=d;function f(e,t){return Array.isArray(e)&&e.every(t)}e.typedArray=f})(q||={});var $x=class{constructor(e){this._start=0,this._pos=0,this.getStartOfToken=()=>this._start,this.getCurrentPosition=()=>this._pos,this.eol=()=>this._sourceText.length===this._pos,this.sol=()=>this._pos===0,this.peek=()=>this._sourceText.charAt(this._pos)||null,this.next=()=>{let e=this._sourceText.charAt(this._pos);return this._pos++,e},this.eat=e=>{if(this._testNextCharacter(e))return this._start=this._pos,this._pos++,this._sourceText.charAt(this._pos-1)},this.eatWhile=e=>{let t=this._testNextCharacter(e),n=!1;for(t&&(n=t,this._start=this._pos);t;)this._pos++,t=this._testNextCharacter(e),n=!0;return n},this.eatSpace=()=>this.eatWhile(/[\s\u00a0]/),this.skipToEnd=()=>{this._pos=this._sourceText.length},this.skipTo=e=>{this._pos=e},this.match=(e,t=!0,n=!1)=>{let r=null,i=null;return typeof e==`string`?(i=new RegExp(e,n?`i`:`g`).test(this._sourceText.slice(this._pos,this._pos+e.length)),r=e):e instanceof RegExp&&(i=this._sourceText.slice(this._pos).match(e),r=i?.[0]),i!=null&&(typeof e==`string`||i instanceof Array&&this._sourceText.startsWith(i[0],this._pos))?(t&&(this._start=this._pos,r&&r.length&&(this._pos+=r.length)),i):!1},this.backUp=e=>{this._pos-=e},this.column=()=>this._pos,this.indentation=()=>{let e=this._sourceText.match(/\s*/),t=0;if(e&&e.length!==0){let n=e[0],r=0;for(;n.length>r;)n.charCodeAt(r)===9?t+=2:t++,r++}return t},this.current=()=>this._sourceText.slice(this._start,this._pos),this._sourceText=e}_testNextCharacter(e){let t=this._sourceText.charAt(this._pos),n=!1;return n=typeof e==`string`?t===e:e instanceof RegExp?e.test(t):e(t),n}};function J(e){return{ofRule:e}}function Y(e,t){return{ofRule:e,isList:!0,separator:t}}function eS(e,t){let n=e.match;return e.match=e=>{let r=!1;return n&&(r=n(e)),r&&t.every(t=>t.match&&!t.match(e))},e}function tS(e,t){return{style:t,match:t=>t.kind===e}}function X(e,t){return{style:t||`punctuation`,match:t=>t.kind===`Punctuation`&&t.value===e}}var nS=e=>e===` `||e===` `||e===`,`||e===`
|
|
16
|
+
`||e===`\r`||e===``||e===`\xA0`,rS={Name:/^[_A-Za-z][_0-9A-Za-z]*/,Punctuation:/^(?:!|\$|\(|\)|\.\.\.|:|=|&|@|\[|]|\{|\||\})/,Number:/^-?(?:0|(?:[1-9][0-9]*))(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?/,String:/^(?:"""(?:\\"""|[^"]|"[^"]|""[^"])*(?:""")?|"(?:[^"\\]|\\(?:"|\/|\\|b|f|n|r|t|u[0-9a-fA-F]{4}))*"?)/,Comment:/^#.*/},iS={Document:[Y(`Definition`)],Definition(e){switch(e.value){case`{`:return`ShortQuery`;case`query`:return`Query`;case`mutation`:return`Mutation`;case`subscription`:return`Subscription`;case`fragment`:return d.Kind.FRAGMENT_DEFINITION;case`schema`:return`SchemaDef`;case`scalar`:return`ScalarDef`;case`type`:return`ObjectTypeDef`;case`interface`:return`InterfaceDef`;case`union`:return`UnionDef`;case`enum`:return`EnumDef`;case`input`:return`InputDef`;case`extend`:return`ExtendDef`;case`directive`:return`DirectiveDef`}},ShortQuery:[`SelectionSet`],Query:[aS(`query`),J(Z(`def`)),J(`VariableDefinitions`),Y(`Directive`),`SelectionSet`],Mutation:[aS(`mutation`),J(Z(`def`)),J(`VariableDefinitions`),Y(`Directive`),`SelectionSet`],Subscription:[aS(`subscription`),J(Z(`def`)),J(`VariableDefinitions`),Y(`Directive`),`SelectionSet`],VariableDefinitions:[X(`(`),Y(`VariableDefinition`),X(`)`)],VariableDefinition:[`Variable`,X(`:`),`Type`,J(`DefaultValue`)],Variable:[X(`$`,`variable`),Z(`variable`)],DefaultValue:[X(`=`),`Value`],SelectionSet:[X(`{`),Y(`Selection`),X(`}`)],Selection(e,t){return e.value===`...`?t.match(/[\s\u00a0,]*(on\b|@|{)/,!1)?`InlineFragment`:`FragmentSpread`:t.match(/[\s\u00a0,]*:/,!1)?`AliasedField`:`Field`},AliasedField:[Z(`property`),X(`:`),Z(`qualifier`),J(`Arguments`),Y(`Directive`),J(`SelectionSet`)],Field:[Z(`property`),J(`Arguments`),Y(`Directive`),J(`SelectionSet`)],Arguments:[X(`(`),Y(`Argument`),X(`)`)],Argument:[Z(`attribute`),X(`:`),`Value`],FragmentSpread:[X(`...`),Z(`def`),Y(`Directive`)],InlineFragment:[X(`...`),J(`TypeCondition`),Y(`Directive`),`SelectionSet`],FragmentDefinition:[aS(`fragment`),J(eS(Z(`def`),[aS(`on`)])),`TypeCondition`,Y(`Directive`),`SelectionSet`],TypeCondition:[aS(`on`),`NamedType`],Value(e){switch(e.kind){case`Number`:return`NumberValue`;case`String`:return`StringValue`;case`Punctuation`:switch(e.value){case`[`:return`ListValue`;case`{`:return`ObjectValue`;case`$`:return`Variable`;case`&`:return`NamedType`}return null;case`Name`:switch(e.value){case`true`:case`false`:return`BooleanValue`}return e.value===`null`?`NullValue`:`EnumValue`}},NumberValue:[tS(`Number`,`number`)],StringValue:[{style:`string`,match:e=>e.kind===`String`,update(e,t){t.value.startsWith(`"""`)&&(e.inBlockstring=!t.value.slice(3).endsWith(`"""`))}}],BooleanValue:[tS(`Name`,`builtin`)],NullValue:[tS(`Name`,`keyword`)],EnumValue:[Z(`string-2`)],ListValue:[X(`[`),Y(`Value`),X(`]`)],ObjectValue:[X(`{`),Y(`ObjectField`),X(`}`)],ObjectField:[Z(`attribute`),X(`:`),`Value`],Type(e){return e.value===`[`?`ListType`:`NonNullType`},ListType:[X(`[`),`Type`,X(`]`),J(X(`!`))],NonNullType:[`NamedType`,J(X(`!`))],NamedType:[oS(`atom`)],Directive:[X(`@`,`meta`),Z(`meta`),J(`Arguments`)],DirectiveDef:[aS(`directive`),X(`@`,`meta`),Z(`meta`),J(`ArgumentsDef`),aS(`on`),Y(`DirectiveLocation`,X(`|`))],InterfaceDef:[aS(`interface`),Z(`atom`),J(`Implements`),Y(`Directive`),X(`{`),Y(`FieldDef`),X(`}`)],Implements:[aS(`implements`),Y(`NamedType`,X(`&`))],DirectiveLocation:[Z(`string-2`)],SchemaDef:[aS(`schema`),Y(`Directive`),X(`{`),Y(`OperationTypeDef`),X(`}`)],OperationTypeDef:[Z(`keyword`),X(`:`),Z(`atom`)],ScalarDef:[aS(`scalar`),Z(`atom`),Y(`Directive`)],ObjectTypeDef:[aS(`type`),Z(`atom`),J(`Implements`),Y(`Directive`),X(`{`),Y(`FieldDef`),X(`}`)],FieldDef:[Z(`property`),J(`ArgumentsDef`),X(`:`),`Type`,Y(`Directive`)],ArgumentsDef:[X(`(`),Y(`InputValueDef`),X(`)`)],InputValueDef:[Z(`attribute`),X(`:`),`Type`,J(`DefaultValue`),Y(`Directive`)],UnionDef:[aS(`union`),Z(`atom`),Y(`Directive`),X(`=`),Y(`UnionMember`,X(`|`))],UnionMember:[`NamedType`],EnumDef:[aS(`enum`),Z(`atom`),Y(`Directive`),X(`{`),Y(`EnumValueDef`),X(`}`)],EnumValueDef:[Z(`string-2`),Y(`Directive`)],InputDef:[aS(`input`),Z(`atom`),Y(`Directive`),X(`{`),Y(`InputValueDef`),X(`}`)],ExtendDef:[aS(`extend`),`ExtensionDefinition`],ExtensionDefinition(e){switch(e.value){case`schema`:return d.Kind.SCHEMA_EXTENSION;case`scalar`:return d.Kind.SCALAR_TYPE_EXTENSION;case`type`:return d.Kind.OBJECT_TYPE_EXTENSION;case`interface`:return d.Kind.INTERFACE_TYPE_EXTENSION;case`union`:return d.Kind.UNION_TYPE_EXTENSION;case`enum`:return d.Kind.ENUM_TYPE_EXTENSION;case`input`:return d.Kind.INPUT_OBJECT_TYPE_EXTENSION}},[d.Kind.SCHEMA_EXTENSION]:[`SchemaDef`],[d.Kind.SCALAR_TYPE_EXTENSION]:[`ScalarDef`],[d.Kind.OBJECT_TYPE_EXTENSION]:[`ObjectTypeDef`],[d.Kind.INTERFACE_TYPE_EXTENSION]:[`InterfaceDef`],[d.Kind.UNION_TYPE_EXTENSION]:[`UnionDef`],[d.Kind.ENUM_TYPE_EXTENSION]:[`EnumDef`],[d.Kind.INPUT_OBJECT_TYPE_EXTENSION]:[`InputDef`]};function aS(e){return{style:`keyword`,match:t=>t.kind===`Name`&&t.value===e}}function Z(e){return{style:e,match:e=>e.kind===`Name`,update(e,t){e.name=t.value}}}function oS(e){return{style:e,match:e=>e.kind===`Name`,update(e,t){e.prevState?.prevState&&(e.name=t.value,e.prevState.prevState.type=t.value)}}}function sS(e={eatWhitespace:e=>e.eatWhile(nS),lexRules:rS,parseRules:iS,editorConfig:{}}){return{startState(){let t={level:0,step:0,name:null,kind:null,type:null,rule:null,needsSeparator:!1,prevState:null};return dS(e.parseRules,t,d.Kind.DOCUMENT),t},token(t,n){return cS(t,n,e)}}}function cS(e,t,n){if(t.inBlockstring)return e.match(/.*"""/)?(t.inBlockstring=!1,`string`):(e.skipToEnd(),`string`);let{lexRules:r,parseRules:i,eatWhitespace:a,editorConfig:o}=n;if(t.rule&&t.rule.length===0?fS(t):t.needsAdvance&&(t.needsAdvance=!1,pS(t,!0)),e.sol()){let n=o?.tabSize||2;t.indentLevel=Math.floor(e.indentation()/n)}if(a(e))return`ws`;let s=gS(r,e);if(!s)return e.match(/\S+/)||e.match(/\s/),dS(uS,t,`Invalid`),`invalidchar`;if(s.kind===`Comment`)return dS(uS,t,`Comment`),`comment`;let c=lS({},t);if(s.kind===`Punctuation`){if(/^[{([]/.test(s.value))t.indentLevel!==void 0&&(t.levels=(t.levels||[]).concat(t.indentLevel+1));else if(/^[})\]]/.test(s.value)){let e=t.levels=(t.levels||[]).slice(0,-1);t.indentLevel&&e.length>0&&e.at(-1)<t.indentLevel&&(t.indentLevel=e.at(-1))}}for(;t.rule;){let n=typeof t.rule==`function`?t.step===0?t.rule(s,e):null:t.rule[t.step];if(t.needsSeparator&&(n=n?.separator),n){if(n.ofRule&&(n=n.ofRule),typeof n==`string`){dS(i,t,n);continue}if(n.match?.call(n,s))return n.update&&n.update(t,s),s.kind===`Punctuation`?pS(t,!0):t.needsAdvance=!0,n.style}hS(t)}return lS(t,c),dS(uS,t,`Invalid`),`invalidchar`}function lS(e,t){let n=Object.keys(t);for(let r=0;r<n.length;r++)e[n[r]]=t[n[r]];return e}var uS={Invalid:[],Comment:[]};function dS(e,t,n){if(!e[n])throw TypeError(`Unknown rule: `+n);t.prevState=Object.assign({},t),t.kind=n,t.name=null,t.type=null,t.rule=e[n],t.step=0,t.needsSeparator=!1}function fS(e){e.prevState&&=(e.kind=e.prevState.kind,e.name=e.prevState.name,e.type=e.prevState.type,e.rule=e.prevState.rule,e.step=e.prevState.step,e.needsSeparator=e.prevState.needsSeparator,e.prevState.prevState)}function pS(e,t){if(mS(e)&&e.rule){let n=e.rule[e.step];if(n.separator){let{separator:t}=n;if(e.needsSeparator=!e.needsSeparator,!e.needsSeparator&&t.ofRule)return}if(t)return}for(e.needsSeparator=!1,e.step++;e.rule&&!(Array.isArray(e.rule)&&e.step<e.rule.length);)fS(e),e.rule&&(mS(e)?e.rule?.[e.step].separator&&(e.needsSeparator=!e.needsSeparator):(e.needsSeparator=!1,e.step++))}function mS(e){let t=Array.isArray(e.rule)&&typeof e.rule[e.step]!=`string`&&e.rule[e.step];return t&&t.isList}function hS(e){for(;e.rule&&!(Array.isArray(e.rule)&&e.rule[e.step].ofRule);)fS(e);e.rule&&pS(e,!1)}function gS(e,t){let n=Object.keys(e);for(let r=0;r<n.length;r++){let i=t.match(e[n[r]]);if(i&&i instanceof Array)return{kind:n[r],value:i[0]}}}function _S(e,t){let n=e.split(`
|
|
17
|
+
`),r=sS(),i=r.startState(),a=``,o=new $x(``);for(let e=0;e<n.length;e++){for(o=new $x(n[e]);!o.eol()&&(a=r.token(o,i),t(o,i,a,e)!==`BREAK`););t(o,i,a,e),i.kind||(i=r.startState())}return{start:o.getStartOfToken(),end:o.getCurrentPosition(),string:o.current(),state:i,style:a}}var vS;(function(e){e.TYPE_SYSTEM=`TYPE_SYSTEM`,e.EXECUTABLE=`EXECUTABLE`,e.UNKNOWN=`UNKNOWN`})(vS||={});var yS=[d.Kind.SCHEMA_DEFINITION,d.Kind.OPERATION_TYPE_DEFINITION,d.Kind.SCALAR_TYPE_DEFINITION,d.Kind.OBJECT_TYPE_DEFINITION,d.Kind.INTERFACE_TYPE_DEFINITION,d.Kind.UNION_TYPE_DEFINITION,d.Kind.ENUM_TYPE_DEFINITION,d.Kind.INPUT_OBJECT_TYPE_DEFINITION,d.Kind.DIRECTIVE_DEFINITION,d.Kind.SCHEMA_EXTENSION,d.Kind.SCALAR_TYPE_EXTENSION,d.Kind.OBJECT_TYPE_EXTENSION,d.Kind.INTERFACE_TYPE_EXTENSION,d.Kind.UNION_TYPE_EXTENSION,d.Kind.ENUM_TYPE_EXTENSION,d.Kind.INPUT_OBJECT_TYPE_EXTENSION],bS=e=>{let t=vS.UNKNOWN;if(e)try{(0,d.visit)((0,d.parse)(e),{enter(e){if(e.kind===`Document`){t=vS.EXECUTABLE;return}return yS.includes(e.kind)?(t=vS.TYPE_SYSTEM,d.BREAK):!1}})}catch{return t}return t};function xS(e,t){return t?.endsWith(`.graphqls`)?vS.TYPE_SYSTEM:bS(e)}function SS(e,t,n=0){let r=null,i=null,a=null,o=_S(e,(e,o,s,c)=>{if(!(c!==t.line||e.getCurrentPosition()+n<t.character+1))return r=s,i=Object.assign({},o),a=e.current(),`BREAK`});return{start:o.start,end:o.end,string:a||o.string,state:i||o.state,style:r||o.style}}function CS(e,t,n,r,i){let a=r||SS(e,t,1);if(!a)return null;let o=a.state.kind===`Invalid`?a.state.prevState:a.state;return o?{token:a,state:o,typeInfo:DS(n,a.state),mode:i?.mode||xS(e,i?.uri)}:null}function wS(e,t,n){return n===d.SchemaMetaFieldDef.name&&e.getQueryType()===t?d.SchemaMetaFieldDef:n===d.TypeMetaFieldDef.name&&e.getQueryType()===t?d.TypeMetaFieldDef:n===d.TypeNameMetaFieldDef.name&&(0,d.isCompositeType)(t)?d.TypeNameMetaFieldDef:`getFields`in t?t.getFields()[n]:null}function TS(e,t){let n=[],r=e;for(;r?.kind;)n.push(r),r=r.prevState;for(let e=n.length-1;e>=0;e--)t(n[e])}function ES(e){let t;return TS(e,e=>{switch(e.kind){case`Query`:case`ShortQuery`:case`Mutation`:case`Subscription`:case`FragmentDefinition`:t=e;break}}),t}function DS(e,t){let n,r,i,a,o,s,c,l,u,f,p;return TS(t,t=>{switch(t.kind){case Q.QUERY:case`ShortQuery`:f=e.getQueryType();break;case Q.MUTATION:f=e.getMutationType();break;case Q.SUBSCRIPTION:f=e.getSubscriptionType();break;case Q.INLINE_FRAGMENT:case Q.FRAGMENT_DEFINITION:t.type&&(f=e.getType(t.type));break;case Q.FIELD:case Q.ALIASED_FIELD:!f||!t.name?o=null:(o=u?wS(e,u,t.name):null,f=o?o.type:null);break;case Q.SELECTION_SET:u=(0,d.getNamedType)(f);break;case Q.DIRECTIVE:i=t.name?e.getDirective(t.name):null;break;case Q.INTERFACE_DEF:t.name&&(c=null,p=new d.GraphQLInterfaceType({name:t.name,interfaces:[],fields:{}}));break;case Q.OBJECT_TYPE_DEF:t.name&&(p=null,c=new d.GraphQLObjectType({name:t.name,interfaces:[],fields:{}}));break;case Q.ARGUMENTS:if(t.prevState)switch(t.prevState.kind){case Q.FIELD:r=o&&o.args;break;case Q.DIRECTIVE:r=i&&i.args;break;case Q.ALIASED_FIELD:{let n=t.prevState?.name;if(!n){r=null;break}let i=u?wS(e,u,n):null;if(!i){r=null;break}r=i.args;break}default:r=null;break}else r=null;break;case Q.ARGUMENT:if(r){for(let e=0;e<r.length;e++)if(r[e].name===t.name){n=r[e];break}}s=n?.type;break;case Q.VARIABLE_DEFINITION:case Q.VARIABLE:f=s;break;case Q.ENUM_VALUE:let m=(0,d.getNamedType)(s);a=m instanceof d.GraphQLEnumType?m.getValues().find(e=>e.value===t.name):null;break;case Q.LIST_VALUE:let h=(0,d.getNullableType)(s);s=h instanceof d.GraphQLList?h.ofType:null;break;case Q.OBJECT_VALUE:let g=(0,d.getNamedType)(s);l=g instanceof d.GraphQLInputObjectType?g.getFields():null;break;case Q.OBJECT_FIELD:let _=t.name&&l?l[t.name]:null;s=_?.type,o=_,f=o?o.type:null;break;case Q.NAMED_TYPE:t.name&&(f=e.getType(t.name));break}}),{argDef:n,argDefs:r,directiveDef:i,enumValue:a,fieldDef:o,inputType:s,objectFieldDefs:l,parentType:u,type:f,interfaceDef:p,objectTypeDef:c}}var Q=Object.assign(Object.assign({},d.Kind),{ALIASED_FIELD:`AliasedField`,ARGUMENTS:`Arguments`,SHORT_QUERY:`ShortQuery`,QUERY:`Query`,MUTATION:`Mutation`,SUBSCRIPTION:`Subscription`,TYPE_CONDITION:`TypeCondition`,INVALID:`Invalid`,COMMENT:`Comment`,SCHEMA_DEF:`SchemaDef`,SCALAR_DEF:`ScalarDef`,OBJECT_TYPE_DEF:`ObjectTypeDef`,OBJECT_VALUE:`ObjectValue`,LIST_VALUE:`ListValue`,INTERFACE_DEF:`InterfaceDef`,UNION_DEF:`UnionDef`,ENUM_DEF:`EnumDef`,ENUM_VALUE:`EnumValue`,FIELD_DEF:`FieldDef`,INPUT_DEF:`InputDef`,INPUT_VALUE_DEF:`InputValueDef`,ARGUMENTS_DEF:`ArgumentsDef`,EXTEND_DEF:`ExtendDef`,EXTENSION_DEFINITION:`ExtensionDefinition`,DIRECTIVE_DEF:`DirectiveDef`,IMPLEMENTS:`Implements`,VARIABLE_DEFINITIONS:`VariableDefinitions`,TYPE:`Type`,VARIABLE:`Variable`}),$;(function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25})($||={});var OS={command:`editor.action.triggerSuggest`,title:`Suggestions`},kS=e=>{let t=[];if(e)try{(0,d.visit)((0,d.parse)(e),{FragmentDefinition(e){t.push(e)}})}catch{return[]}return t};function AS(e,t,n,r,i,a){let o=Object.assign(Object.assign({},a),{schema:e}),s=CS(t,n,e,r,a);if(!s)return[];let{state:c,typeInfo:l,mode:u,token:f}=s,{kind:p,step:m,prevState:h}=c;if(p===Q.DOCUMENT)return u===vS.TYPE_SYSTEM?NS(f):u===vS.EXECUTABLE?PS(f):FS(f);if(p===Q.EXTEND_DEF)return IS(f);if(h?.prevState?.kind===Q.EXTENSION_DEFINITION&&c.name)return K(f,[]);if(h?.kind===d.Kind.SCALAR_TYPE_EXTENSION)return K(f,Object.values(e.getTypeMap()).filter(d.isScalarType).map(e=>({label:e.name,kind:$.Function})));if(h?.kind===d.Kind.OBJECT_TYPE_EXTENSION)return K(f,Object.values(e.getTypeMap()).filter(e=>(0,d.isObjectType)(e)&&!e.name.startsWith(`__`)).map(e=>({label:e.name,kind:$.Function})));if(h?.kind===d.Kind.INTERFACE_TYPE_EXTENSION)return K(f,Object.values(e.getTypeMap()).filter(d.isInterfaceType).map(e=>({label:e.name,kind:$.Function})));if(h?.kind===d.Kind.UNION_TYPE_EXTENSION)return K(f,Object.values(e.getTypeMap()).filter(d.isUnionType).map(e=>({label:e.name,kind:$.Function})));if(h?.kind===d.Kind.ENUM_TYPE_EXTENSION)return K(f,Object.values(e.getTypeMap()).filter(e=>(0,d.isEnumType)(e)&&!e.name.startsWith(`__`)).map(e=>({label:e.name,kind:$.Function})));if(h?.kind===d.Kind.INPUT_OBJECT_TYPE_EXTENSION)return K(f,Object.values(e.getTypeMap()).filter(d.isInputObjectType).map(e=>({label:e.name,kind:$.Function})));if(p===Q.IMPLEMENTS||p===Q.NAMED_TYPE&&h?.kind===Q.IMPLEMENTS)return zS(f,c,e,t,l);if(p===Q.SELECTION_SET||p===Q.FIELD||p===Q.ALIASED_FIELD)return LS(f,l,o);if(p===Q.ARGUMENTS||p===Q.ARGUMENT&&m===0){let{argDefs:e}=l;if(e)return K(f,e.map(e=>({label:e.name,insertText:Tb(e.name+`: `,e.type),insertTextMode:dx.adjustIndentation,insertTextFormat:cx.Snippet,command:OS,labelDetails:{detail:` `+String(e.type)},documentation:e.description??void 0,kind:$.Variable,type:e.type})))}if((p===Q.OBJECT_VALUE||p===Q.OBJECT_FIELD&&m===0)&&l.objectFieldDefs){let e=_b(l.objectFieldDefs),t=p===Q.OBJECT_VALUE?$.Value:$.Field;return K(f,e.map(e=>({label:e.name,detail:String(e.type),documentation:e?.description??void 0,kind:t,type:e.type,insertText:Tb(e.name+`: `,e.type),insertTextMode:dx.adjustIndentation,insertTextFormat:cx.Snippet,command:OS})))}if(p===Q.ENUM_VALUE||p===Q.LIST_VALUE&&m===1||p===Q.OBJECT_FIELD&&m===2||p===Q.ARGUMENT&&m===2)return RS(f,l,t,e);if(p===Q.VARIABLE&&m===1){let n=(0,d.getNamedType)(l.inputType);return K(f,US(t,e,f).filter(e=>e.detail===n?.name))}if(p===Q.TYPE_CONDITION&&m===1||p===Q.NAMED_TYPE&&h!=null&&h.kind===Q.TYPE_CONDITION)return BS(f,l,e,p);if(p===Q.FRAGMENT_SPREAD&&m===1)return VS(f,l,e,t,Array.isArray(i)?i:kS(i));let g=YS(c);return g.kind===Q.FIELD_DEF?K(f,Object.values(e.getTypeMap()).filter(e=>(0,d.isOutputType)(e)&&!e.name.startsWith(`__`)).map(e=>({label:e.name,kind:$.Function,insertText:a?.fillLeafsOnComplete?e.name+`
|
|
18
|
+
`:e.name,insertTextMode:dx.adjustIndentation}))):g.kind===Q.INPUT_VALUE_DEF&&m===2?K(f,Object.values(e.getTypeMap()).filter(e=>(0,d.isInputType)(e)&&!e.name.startsWith(`__`)).map(e=>({label:e.name,kind:$.Function,insertText:a?.fillLeafsOnComplete?e.name+`
|
|
19
|
+
$1`:e.name,insertTextMode:dx.adjustIndentation,insertTextFormat:cx.Snippet}))):p===Q.VARIABLE_DEFINITION&&m===2||p===Q.LIST_TYPE&&m===1||p===Q.NAMED_TYPE&&h&&(h.kind===Q.VARIABLE_DEFINITION||h.kind===Q.LIST_TYPE||h.kind===Q.NON_NULL_TYPE)?GS(f,e,p):p===Q.DIRECTIVE?KS(f,c,e,p):p===Q.DIRECTIVE_DEF?qS(f,c,e,p):[]}var jS=[{label:`type`,kind:$.Function},{label:`interface`,kind:$.Function},{label:`union`,kind:$.Function},{label:`input`,kind:$.Function},{label:`scalar`,kind:$.Function},{label:`schema`,kind:$.Function}],MS=[{label:`query`,kind:$.Function},{label:`mutation`,kind:$.Function},{label:`subscription`,kind:$.Function},{label:`fragment`,kind:$.Function},{label:`{`,kind:$.Constructor}];function NS(e){return K(e,[{label:`extend`,kind:$.Function},...jS])}function PS(e){return K(e,MS)}function FS(e){return K(e,[{label:`extend`,kind:$.Function},...MS,...jS])}function IS(e){return K(e,jS)}function LS(e,t,n){if(t.parentType){let{parentType:r}=t,i=[];return`getFields`in r&&(i=_b(r.getFields())),(0,d.isCompositeType)(r)&&i.push(d.TypeNameMetaFieldDef),r===(n?.schema)?.getQueryType()&&i.push(d.SchemaMetaFieldDef,d.TypeMetaFieldDef),K(e,i.map((t,r)=>{let i={sortText:String(r)+t.name,label:t.name,detail:String(t.type),documentation:t.description??void 0,deprecated:!!t.deprecationReason,isDeprecated:!!t.deprecationReason,deprecationReason:t.deprecationReason,kind:$.Field,labelDetails:{detail:` `+t.type.toString()},type:t.type};return n?.fillLeafsOnComplete&&(i.insertText=Eb(t),i.insertText||=wb(t.name,t.type,t.name+(e.state.needsAdvance?``:`
|
|
20
|
+
`)),i.insertText&&(i.insertTextFormat=cx.Snippet,i.insertTextMode=dx.adjustIndentation,i.command=OS)),i}))}return[]}function RS(e,t,n,r){let i=(0,d.getNamedType)(t.inputType),a=US(n,r,e).filter(e=>e.detail===i?.name);return i instanceof d.GraphQLEnumType?K(e,i.getValues().map(e=>({label:e.name,detail:String(i),documentation:e.description??void 0,deprecated:!!e.deprecationReason,isDeprecated:!!e.deprecationReason,deprecationReason:e.deprecationReason,kind:$.EnumMember,type:i})).concat(a)):i===d.GraphQLBoolean?K(e,a.concat([{label:`true`,detail:String(d.GraphQLBoolean),documentation:`Not false.`,kind:$.Variable,type:d.GraphQLBoolean},{label:`false`,detail:String(d.GraphQLBoolean),documentation:`Not true.`,kind:$.Variable,type:d.GraphQLBoolean}])):a}function zS(e,t,n,r,i){if(t.needsSeparator)return[];let a=_b(n.getTypeMap()).filter(d.isInterfaceType),o=a.map(({name:e})=>e),s=new Set;_S(r,(e,t)=>{if(t.name&&(t.kind===Q.INTERFACE_DEF&&!o.includes(t.name)&&s.add(t.name),t.kind===Q.NAMED_TYPE&&t.prevState?.kind===Q.IMPLEMENTS)){if(i.interfaceDef){if(i.interfaceDef?.getInterfaces().find(({name:e})=>e===t.name))return;let e=n.getType(t.name),r=i.interfaceDef?.toConfig();i.interfaceDef=new d.GraphQLInterfaceType(Object.assign(Object.assign({},r),{interfaces:[...r.interfaces,e||new d.GraphQLInterfaceType({name:t.name,fields:{}})]}))}else if(i.objectTypeDef){if(i.objectTypeDef?.getInterfaces().find(({name:e})=>e===t.name))return;let e=n.getType(t.name),r=i.objectTypeDef?.toConfig();i.objectTypeDef=new d.GraphQLObjectType(Object.assign(Object.assign({},r),{interfaces:[...r.interfaces,e||new d.GraphQLInterfaceType({name:t.name,fields:{}})]}))}}});let c=i.interfaceDef||i.objectTypeDef,l=(c?.getInterfaces()||[]).map(({name:e})=>e);return K(e,a.concat([...s].map(e=>({name:e}))).filter(({name:e})=>e!==c?.name&&!l.includes(e)).map(e=>{let t={label:e.name,kind:$.Interface,type:e};return e?.description&&(t.documentation=e.description),t}))}function BS(e,t,n,r){let i;if(t.parentType)if((0,d.isAbstractType)(t.parentType)){let e=(0,d.assertAbstractType)(t.parentType),r=n.getPossibleTypes(e),a=Object.create(null);for(let e of r)for(let t of e.getInterfaces())a[t.name]=t;i=r.concat(_b(a))}else i=[t.parentType];else i=_b(n.getTypeMap()).filter(e=>(0,d.isCompositeType)(e)&&!e.name.startsWith(`__`));return K(e,i.map(e=>{let t=(0,d.getNamedType)(e);return{label:String(e),documentation:t?.description||``,kind:$.Field}}))}function VS(e,t,n,r,i){if(!r)return[];let a=n.getTypeMap(),o=ES(e.state),s=WS(r);return i&&i.length>0&&s.push(...i),K(e,s.filter(e=>a[e.typeCondition.name.value]&&!(o&&o.kind===Q.FRAGMENT_DEFINITION&&o.name===e.name.value)&&(0,d.isCompositeType)(t.parentType)&&(0,d.isCompositeType)(a[e.typeCondition.name.value])&&(0,d.doTypesOverlap)(n,t.parentType,a[e.typeCondition.name.value])).map(e=>({label:e.name.value,detail:String(a[e.typeCondition.name.value]),documentation:`fragment ${e.name.value} on ${e.typeCondition.name.value}`,labelDetails:{detail:`fragment ${e.name.value} on ${e.typeCondition.name.value}`},kind:$.Field,type:a[e.typeCondition.name.value]})))}var HS=(e,t)=>{if(e.prevState?.kind===t)return e.prevState;if(e.prevState?.prevState?.kind===t)return e.prevState.prevState;if(e.prevState?.prevState?.prevState?.kind===t)return e.prevState.prevState.prevState;if(e.prevState?.prevState?.prevState?.prevState?.kind===t)return e.prevState.prevState.prevState.prevState};function US(e,t,n){let r=null,i,a=Object.create({});return _S(e,(e,o)=>{if(o?.kind===Q.VARIABLE&&o.name&&(r=o.name),o?.kind===Q.NAMED_TYPE&&r){let e=HS(o,Q.TYPE);e?.type&&(i=t.getType(e?.type))}if(r&&i&&!a[r]){let e=n.string===`$`||n?.state?.kind===`Variable`?r:`$`+r;a[r]={detail:i.toString(),insertText:e,label:`$`+r,rawInsert:e,type:i,kind:$.Variable},r=null,i=null}}),_b(a)}function WS(e){let t=[];return _S(e,(e,n)=>{n.kind===Q.FRAGMENT_DEFINITION&&n.name&&n.type&&t.push({kind:Q.FRAGMENT_DEFINITION,name:{kind:d.Kind.NAME,value:n.name},selectionSet:{kind:Q.SELECTION_SET,selections:[]},typeCondition:{kind:Q.NAMED_TYPE,name:{kind:d.Kind.NAME,value:n.type}}})}),t}function GS(e,t,n){return K(e,_b(t.getTypeMap()).filter(d.isInputType).map(e=>({label:e.name,documentation:e?.description||``,kind:$.Variable})))}function KS(e,t,n,r){return t.prevState?.kind?K(e,n.getDirectives().filter(e=>JS(t.prevState,e)).map(e=>({label:e.name,documentation:e?.description||``,kind:$.Function}))):[]}function qS(e,t,n,r){return K(e,n.getDirectives().find(e=>e.name===t.name)?.args.map(e=>({label:e.name,documentation:e.description||``,kind:$.Field}))||[])}function JS(e,t){if(!e?.kind)return!1;let{kind:n,prevState:r}=e,{locations:i}=t;switch(n){case Q.QUERY:return i.includes(d.DirectiveLocation.QUERY);case Q.MUTATION:return i.includes(d.DirectiveLocation.MUTATION);case Q.SUBSCRIPTION:return i.includes(d.DirectiveLocation.SUBSCRIPTION);case Q.FIELD:case Q.ALIASED_FIELD:return i.includes(d.DirectiveLocation.FIELD);case Q.FRAGMENT_DEFINITION:return i.includes(d.DirectiveLocation.FRAGMENT_DEFINITION);case Q.FRAGMENT_SPREAD:return i.includes(d.DirectiveLocation.FRAGMENT_SPREAD);case Q.INLINE_FRAGMENT:return i.includes(d.DirectiveLocation.INLINE_FRAGMENT);case Q.SCHEMA_DEF:return i.includes(d.DirectiveLocation.SCHEMA);case Q.SCALAR_DEF:return i.includes(d.DirectiveLocation.SCALAR);case Q.OBJECT_TYPE_DEF:return i.includes(d.DirectiveLocation.OBJECT);case Q.FIELD_DEF:return i.includes(d.DirectiveLocation.FIELD_DEFINITION);case Q.INTERFACE_DEF:return i.includes(d.DirectiveLocation.INTERFACE);case Q.UNION_DEF:return i.includes(d.DirectiveLocation.UNION);case Q.ENUM_DEF:return i.includes(d.DirectiveLocation.ENUM);case Q.ENUM_VALUE:return i.includes(d.DirectiveLocation.ENUM_VALUE);case Q.INPUT_DEF:return i.includes(d.DirectiveLocation.INPUT_OBJECT);case Q.INPUT_VALUE_DEF:switch(r?.kind){case Q.ARGUMENTS_DEF:return i.includes(d.DirectiveLocation.ARGUMENT_DEFINITION);case Q.INPUT_DEF:return i.includes(d.DirectiveLocation.INPUT_FIELD_DEFINITION)}}return!1}function YS(e){return e.prevState&&e.kind&&[Q.NAMED_TYPE,Q.LIST_TYPE,Q.TYPE,Q.NON_NULL_TYPE].includes(e.kind)?YS(e.prevState):e}o(((e,t)=>{function n(e,t){if(e!=null)return e;var n=Error(t===void 0?`Got unexpected `+e:t);throw n.framesToPop=1,n}t.exports=n,t.exports.default=n,Object.defineProperty(t.exports,`__esModule`,{value:!0})}))();var XS=class{constructor(e,t){this.containsPosition=e=>this.start.line===e.line?this.start.character<=e.character:this.end.line===e.line?this.end.character>=e.character:this.start.line<=e.line&&this.end.line>=e.line,this.start=e,this.end=t}setStart(e,t){this.start=new ZS(e,t)}setEnd(e,t){this.end=new ZS(e,t)}},ZS=class{constructor(e,t){this.lessThanOrEqualTo=e=>this.line<e.line||this.line===e.line&&this.character<=e.character,this.line=e,this.character=t}setLine(e){this.line=e}setCharacter(e){this.character=e}},QS=[d.LoneSchemaDefinitionRule,d.UniqueOperationTypesRule,d.UniqueTypeNamesRule,d.UniqueEnumValueNamesRule,d.UniqueFieldDefinitionNamesRule,d.UniqueDirectiveNamesRule,d.KnownTypeNamesRule,d.KnownDirectivesRule,d.UniqueDirectivesPerLocationRule,d.PossibleTypeExtensionsRule,d.UniqueArgumentNamesRule,d.UniqueInputFieldNamesRule,d.UniqueVariableNamesRule,d.FragmentsOnCompositeTypesRule,d.ProvidedRequiredArgumentsRule];function $S(e,t,n,r,i){let a=d.specifiedRules.filter(e=>!(e===d.NoUnusedFragmentsRule||e===d.ExecutableDefinitionsRule||r&&e===d.KnownFragmentNamesRule));return n&&Array.prototype.push.apply(a,n),i&&Array.prototype.push.apply(a,QS),(0,d.validate)(e,t,a).filter(e=>{if(e.message.includes(`Unknown directive`)&&e.nodes){let t=e.nodes[0];if(t&&t.kind===d.Kind.DIRECTIVE){let e=t.name.value;if(e===`arguments`||e===`argumentDefinitions`)return!1}}return!0})}var eC={Error:`Error`,Warning:`Warning`,Information:`Information`,Hint:`Hint`},tC={[eC.Error]:1,[eC.Warning]:2,[eC.Information]:3,[eC.Hint]:4},nC=(e,t)=>{if(!e)throw Error(t)};function rC(e,t=null,n,r,i){let a=null,o=``;i&&(o=typeof i==`string`?i:i.reduce((e,t)=>e+(0,d.print)(t)+`
|
|
21
|
+
|
|
22
|
+
`,``));let s=o?`${e}\n\n${o}`:e;try{a=(0,d.parse)(s)}catch(e){if(e instanceof d.GraphQLError){let t=oC(e.locations?.[0]??{line:0,column:0},s);return[{severity:tC.Error,message:e.message,source:`GraphQL: Syntax`,range:t}]}throw e}return iC(a,t,n,r)}function iC(e,t=null,n,r){if(!t)return[];let i=$S(t,e,n,r).flatMap(e=>aC(e,tC.Error,`Validation`)),a=(0,d.validate)(t,e,[d.NoDeprecatedCustomRule]).flatMap(e=>aC(e,tC.Warning,`Deprecation`));return i.concat(a)}function aC(e,t,n){if(!e.nodes)return[];let r=[];for(let[i,a]of e.nodes.entries()){let o=a.kind!==`Variable`&&`name`in a&&a.name!==void 0?a.name:`variable`in a&&a.variable!==void 0?a.variable:a;if(o){nC(e.locations,`GraphQL validation error requires locations.`);let a=e.locations[i],s=sC(o),c=a.column+(s.end-s.start);r.push({source:`GraphQL: ${n}`,message:e.message,severity:t,range:new XS(new ZS(a.line-1,a.column-1),new ZS(a.line-1,c))})}}return r}function oC(e,t){let n=sS(),r=n.startState(),i=t.split(`
|
|
23
|
+
`);nC(i.length>=e.line,`Query text must have more lines than where the error happened`);let a=null;for(let t=0;t<e.line;t++)for(a=new $x(i[t]);!a.eol()&&n.token(a,r)!==`invalidchar`;);nC(a,`Expected Parser stream to be available.`);let o=e.line-1,s=a.getStartOfToken(),c=a.getCurrentPosition();return new XS(new ZS(o,s),new ZS(o,c))}function sC(e){let t=e.loc;return nC(t,`Expected ASTNode to have a location.`),t}function cC(e,t){return e.line(t.line+1).from+t.character}function lC(e,t){let n=e.lineAt(t);return new uC(n.number-1,t-n.from)}var uC=class{constructor(e,t){this.line=e,this.character=t}setLine(e){this.line=e}setCharacter(e){this.character=e}lessThanOrEqualTo(e){return this.line<e.line||this.line===e.line&&this.character<=e.character}},dC=()=>navigator.userAgent.includes(`Mac`),fC=e=>dC()?e.metaKey:e.ctrlKey,pC=P.define(),mC=bi.define({create(){},update(e,t){for(let e of t.effects)if(e.is(pC))return e.value;return e}}),hC=P.define(),gC=bi.define({create(){},update(e,t){for(let e of t.effects)if(e.is(hC))return e.value;return e}}),_C=e=>e.field(mC),vC=e=>e.field(gC),yC={showErrorOnInvalidSchema:!0},bC=(e,t)=>[mC.init(()=>e),gC.init(()=>Object.assign(Object.assign({},yC),t))],xC={__proto__:null,query:241,mutation:243,subscription:245,on:86,fragment:92,schema:102,scalar:114,type:120,implements:126,interface:140,union:146,enum:154,input:164,directive:172,repeatable:176,extend:192},SC=qn.deserialize({version:14,states:"LWOYQPOOO!WQPO'#C}O!`QPO'#C_OOQO'#C_'#C_O!iQPO'#DYOOQO'#Ev'#EvOOQO'#D_'#D_O!nQPO'#D^O#_QPO'#D^O!iQPO'#DhO!iQPO'#DrO!iQPO'#DuO!iQPO'#DyO!iQPO'#EOOOQO'#Dd'#DdO#fQPO'#ESOOQO'#D]'#D]O!vQPO'#E^OOQO'#Ea'#EaOOQO'#E]'#E]OOQO'#FT'#FTOOQO'#Eu'#EuOOQO'#Eh'#EhQYQPOOOOQO'#C`'#C`OOQO'#DZ'#DZOOQO'#D`'#D`OOQO'#Di'#DiOOQO'#Ds'#DsOOQO'#Dv'#DvOOQO'#Dz'#DzOOQO'#EP'#EPOOQO'#ET'#ETOOQO'#E_'#E_O#kQPO'#CaO$VQPO'#DQO$[QPO'#DPO$sQPO'#DPO$xQPO'#DSO%WQPO'#DOOOQO'#En'#EnO%fQPO,59iOOQO'#Ca'#CaO%qQPO'#CxOOQO'#El'#ElO'hQPO'#CwO)[QPO'#CdOOQO,58y,58yO)aQPO,58yO)fQPO,58yO)nQPO,58yOOQO'#DT'#DTO)yQPO,59tO{QPO'#FUOOQO'#Db'#DbOOQO,59x,59xO*OQPO,59xO!nQPO,59xO!iQPO,5:PO!iQPO,5:SO!iQPO,5:^O!iQPO,5:aO!iQPO,5:eO!iQPO,5:jO*TQPO,5:nOOQO'#Df'#DfO*YQPO,5:SO+aQPO,5:^O,hQPO,5:aO-oQPO,5:eO.sQPO,5:jO/wQPO,5:nO!nQPO,5:xO!iQPO,5:|O!iQPO,5:}O!iQPO,5;OO!iQPO,5;PO!iQPO,5;QO!iQPO,5;ROOQO-E8f-E8fOOQO,59l,59lO0VQPO'#CzOOQO,59k,59kO0[QPO,59kO0mQPO,59kOOQO'#DR'#DRO0tQPO,59kO1OQPO,59nO!iQPO'#DVOOQO,59p,59pO)aQPO,59pO)fQPO,59pOOQO'#DW'#DWOOQO,59j,59jOOQO-E8l-E8lOOQO1G/T1G/TOOQO,59d,59dOOQO-E8j-E8jO1aQPO'#CeOOQO'#Ei'#EiO1fQPO,59OOOQO1G.e1G.eO)aQPO1G.eO)fQPO1G.eO)fQPO1G/`O1nQPO'#DcO1sQPO,5;pOOQO1G/d1G/dO*OQPO1G/dO1xQPO1G/kO4QQPO1G/nO5]QPO1G/xO6hQPO1G/{O7pQPO1G0PO8xQPO1G0UO/wQPO1G0YO9PQPO1G/nO9WQPO'#DkO9`QPO'#FWOOQO'#Dn'#DnOOQO1G/n1G/nO9hQPO1G/nOOQO'#Dl'#DlO:iQPO1G/xOOQO1G/x1G/xO:pQPO1G/xO;qQPO1G/{O;xQPO'#DxO5dQPO1G/{O<QQQO'#FYOOQO'#D|'#D|OOQO1G0P1G0PO6oQPO1G0PO9`QPO'#FZOOQO'#ER'#EROOQO1G0U1G0UO7wQPO1G0UO<YQPO'#DqO!iQPO'#DqOOQO'#Ep'#EpO<_QPO'#DpO<pQSO1G0YO)yQPO1G0YO>QQPO1G0YOOQO'#EV'#EVOOQO1G0d1G0dO>YQPO1G0dO!qQPO1G0hO?ZQPO1G0iO?ZQPO1G0jO?fQPO1G0kO?nQPO1G0lO?vQPO1G0mOOQO'#C|'#C|O@OQPO'#C{OOQO'#Em'#EmO@TQPO,59fOOQO1G/V1G/VO@]QPO1G/VO@nQPO1G/VOOQO1G/Y1G/YOOQO'#Cg'#CgOOQO,59q,59qOOQO1G/[1G/[O)aQPO1G/[O@uQPO,59POOQO-E8g-E8gOOQO1G.j1G.jOOQO7+$P7+$PO)aQPO7+$POOQO7+$z7+$zO)aQPO7+$zO!iQPO,59}OOQO1G1[1G1[OOQO7+%O7+%OOOQO7+%V7+%VOBOQPO7+%YOOQO7+%Y7+%YO@}QPO7+%YOCZQPO7+%dOOQO7+%d7+%dOBYQPO7+%dODfQPO7+%gODmQPO7+%gOOQO7+%k7+%kODtQPO7+%kOOQO7+%p7+%pOEuQPO7+%pO<pQSO7+%tO)yQPO7+%tO>QQPO7+%tO!iQPO,5:VOOQO,5:V,5:VOFvQPO'#DoO!iQPO'#DoOOQO'#Eo'#EoOGRQPO,5;rO!iQPO,5:dOOQO,5:d,5:dOG^QQO'#D}OGlQQO'#D}OOQO'#Eq'#EqOGqQQO,5;tOG|QPO,5;uO@uQPO,5:]OHXQPO,5:]OOQO-E8n-E8nOOQO'#EZ'#EZOOQO'#E['#E[OOQO'#EY'#EYOH^QPO7+%tOOQO'#EX'#EXO<sQSO'#EXOOQO7+&O7+&OOOQO7+&S7+&SOJcQPO7+&TOOQO7+&T7+&TOIbQPO7+&TOKnQPO7+&UOOQO7+&U7+&UOJmQPO7+&UOLyQPO7+&VOMQQPO7+&VOOQO7+&W7+&WOMXQPO7+&WOOQO7+&X7+&XONYQPO7+&XO! ZQQO,59gOOQO-E8k-E8kOOQO1G/Q1G/QOOQO7+$q7+$qO! xQPO7+$qOOQO7+$v7+$vO@uQPO'#CjO!!ZQPO'#E|OOQO'#E|'#E|O!#UQPO1G.kOOQO<<Gk<<GkOOQO<<Hf<<HfOOQO1G/i1G/iOOQO<<Ht<<HtO!#gQPO<<HtOOQO<<IO<<IOO!$hQPO<<IOO!%iQPO<<IROOQO<<IV<<IVOOQO<<I[<<I[O!&mQPO<<I`O<pQSO<<I`O)yQPO<<I`OOQO1G/q1G/qO@uQPO,5:ZO!'qQPO,5:ZO!'vQPO,5:ZOOQO-E8m-E8mOOQO1G1^1G1^OOQO1G0O1G0OO!(RQQO'#CxO!(dQQO'#CwOOQO,5:i,5:iO!(rQQO,5:iOOQO-E8o-E8oOOQO1G1`1G1`OOQO1G1a1G1aO!)QQPO1G/wO@uQPO1G/wO<sQSO,5:sOOQO,5:s,5:sOOQO<<Io<<IoO!)lQPO<<IoOOQO<<Ip<<IpO!*mQPO<<IpO!+nQPO<<IqOOQO<<Ir<<IrOOQO<<Is<<IsO!,rQQO'#CsO!,yQPO'#CvOOQO'#FP'#FPO!-RQPO1G/ROOQO<<H]<<H]O!-^QPO,59UOOQO,59V,59VO! ZQQO'#ClOOQO7+$V7+$VO!-cQPO7+$VO!-nQPO7+$VOOQOAN>`AN>`OOQOAN>jAN>jO!-|QPOAN>zO<pQSOAN>zO!/QQPO1G/uO@uQPO1G/uO!/`QPO1G/uOOQO1G0T1G0TOOQO7+%c7+%cO!/eQPO7+%cO!/|QPO7+%cOOQO1G0_1G0_OOQOAN?ZAN?ZOOQOAN?[AN?[O!0TQQO'#EjO!0xQQO,59_OOQO,59_,59_O!1PQPO'#FROOQO'#Ek'#EkO!1UQPO,59bOOQO,59b,59bOOQO7+$m7+$mOOQO1G.p1G.pOOQO,59W,59WOOQO<<Gq<<GqO!1^QPO<<GqO!1iQPOG24fOOQO7+%a7+%aO!2mQPO7+%aO@uQPO7+%aOOQO<<H}<<H}O!2{QPO<<H}OOQO,5;U,5;UOOQO-E8h-E8hOOQO1G.y1G.yO! ZQQO,5;mOOQO-E8i-E8iOOQO1G.|1G.|OOQOAN=]AN=]OOQO<<H{<<H{O!3dQPO<<H{OOQOAN>iAN>iO!3rQPO1G1XOOQOAN>gAN>gOOQO7+&s7+&s",stateData:"!4S~O#hOSPOS~OcUOiPO!OiO!TjO!^kO!hlO!kmO!onO!toO!xpO#SqO#lhO#mhO#nhO~O#krO#vvO~OV!OOiPOm{O#kzO~Oi!VOm{O~O!TjO!Z!cO!^kO!hlO!kmO!onO!toO~O!xpO~P!vOm!iO~OVuXhuXiuXmuX#kuX#oTX#tuX#vuX~O#o!rO~OV!sOiPOm{OhsX#ksX#tsX#vsX~O#k!wO~OiPOm{O{#OO#kzO~O#t#POhrX#krX#vrX~Oh#RO#krO#vvO~OV!sOilXmlXhlX#klX#tlX#vlXclX!OlX!TlX!^lX!hlX!klX!olX!tlX!xlX#SlX#flX#llX#mlX#nlX#rlXUlXYlX{lX!zlX#olX~Om{OikXhkX#kkX#tkX#vkXckX!OkX!TkX!^kX!hkX!kkX!okX!tkX!xkX#SkX#fkX#lkX#mkX#nkX#rkXUkXYkX{kX!zkX#okX~OY#UO~OiPO~OiPOm{O~OV!OOiPOm{O~O{#OO~Oi!VO~Om#gO~Oi#jOm{O!a#nOc![a!O![a!T![a!^![a!h![a!k![a!o![a!t![a!x![a#S![a#f![a#l![a#m![a#n![a~Oi#jOm{O!a#nOc!fa!O!fa!T!fa!^!fa!h!fa!k!fa!o!fa!t!fa!x!fa#S!fa#f!fa#l!fa#m!fa#n!fa~Om{O#r#sOc!iai!ia!O!ia!T!ia!^!ia!h!ia!k!ia!o!ia!t!ia!x!ia#S!ia#f!ia#l!ia#m!ia#n!ia~Oi#uOm{Oc!ma!O!ma!T!ma!^!ma!h!ma!k!ma!o!ma!t!ma!x!ma#S!ma#f!ma#l!ma#m!ma#n!ma~Oi#yOm{Oc!ra!O!ra!T!ra!^!ra!h!ra!k!ra!o!ra!t!ra!x!ra#S!ra#f!ra#l!ra#m!ra#n!ra~OcUO{#OO!z$UO#kzO~O#k$_O~OiPOhsa#ksa#tsa#vsa~Om{O~P0[OV!sOm{O~P0[Om{Ohva#kva#tva#vva~O#o$kO~OU$mOY#UO~O#o$rO~Oh$sO~Om{Oc!Xii!Xi!O!Xi!T!Xi!^!Xi!h!Xi!k!Xi!o!Xi!t!Xi!x!Xi#S!Xi#f!Xi#l!Xi#m!Xi#n!Xi~Oi#jOm{Oc![i!O![i!T![i!^![i!h![i!k![i!o![i!t![i!x![i#S![i#f![i#l![i#m![i#n![i~O!a#nO~P2|Oi#jOm{Oc!fi!O!fi!T!fi!^!fi!h!fi!k!fi!o!fi!t!fi!x!fi#S!fi#f!fi#l!fi#m!fi#n!fi~O!a#nO~P4XO#r#sOc!iii!ii!O!ii!T!ii!^!ii!h!ii!k!ii!o!ii!t!ii!x!ii#S!ii#f!ii#l!ii#m!ii#n!ii~Om{O~P5dOi#uOc!mi!O!mi!T!mi!^!mi!h!mi!k!mi!o!mi!t!mi!x!mi#S!mi#f!mi#l!mi#m!mi#n!mi~Om{O~P6oOi#yOc!ri!O!ri!T!ri!^!ri!h!ri!k!ri!o!ri!t!ri!x!ri#S!ri#f!ri#l!ri#m!ri#n!ri~Om{O~P7wO#y%VO~P2|O#kzO#y%VO~OcUO#kzO~Oi#jOc![i!O![i!T![i!^![i!h![i!k![i!o![i!t![i!x![i#S![i#f![i#l![i#m![i#n![i~O#y%VO~P4XOi#jOc!fi!O!fi!T!fi!^!fi!h!fi!k!fi!o!fi!t!fi!x!fi#S!fi#f!fi#l!fi#m!fi#n!fi~O#{%]O~P5gO#kzO#{%]O~OcUOf%_O~O#o%dO~OcUO#kzO{!dX!z!dX#o!dX~O#{%lO$O%gO$P%gO$Q%gO$R%gO$S%gO$T%gO$U%gO$V%gO$W%hO$X%hO$Y%hO$Z%hO$[%hO$]%hO$^%hO$_%hO$`%hO$a%hO$b%hO~O{#OO!z$UO~Oi!VOc#Qi!O#Qi!T#Qi!^#Qi!h#Qi!k#Qi!o#Qi!t#Qi!x#Qi#S#Qi#f#Qi#l#Qi#m#Qi#n#Qi~Oi#jOm{O!a#nO~Om{O#r#sO~Oi#uOm{O~Oi#yOm{O~O#o%{O~OU%}O#k$_O~OiPOhsi#ksi#tsi#vsi~Om{O~P@]O]&RO#kzO~Oi#jOc![q!O![q!T![q!^![q!h![q!k![q!o![q!t![q!x![q#S![q#f![q#l![q#m![q#n![q~Om{O#y%VO~P@}Oi#jOc!fq!O!fq!T!fq!^!fq!h!fq!k!fq!o!fq!t!fq!x!fq#S!fq#f!fq#l!fq#m!fq#n!fq~Om{O#y%VO~PBYOc!iqi!iq!O!iq!T!iq!^!iq!h!iq!k!iq!o!iq!t!iq!x!iq#S!iq#f!iq#l!iq#m!iq#n!iq~O#{%]O~PCeO#r#sO~PCeOi#uOc!mq!O!mq!T!mq!^!mq!h!mq!k!mq!o!mq!t!mq!x!mq#S!mq#f!mq#l!mq#m!mq#n!mq~Oi#yOc!rq!O!rq!T!rq!^!rq!h!rq!k!rq!o!rq!t!rq!x!rq#S!rq#f!rq#l!rq#m!rq#n!rq~OcUO#kzO#o&eO~OcUOh&iO#kzO~Om&kOc!qXf!qXh!qX~Of&nO~OcUOf%_Oh&pO~OcUOh&qO#kzO~O#o&sO~O#{&tOc!vqi!vq!O!vq!T!vq!^!vq!h!vq!k!vq!o!vq!t!vq!x!vq#S!vq#f!vq#l!vq#m!vq#n!vq~Oi#jOc#Vq!O#Vq!T#Vq!^#Vq!h#Vq!k#Vq!o#Vq!t#Vq!x#Vq#S#Vq#f#Vq#l#Vq#m#Vq#n#Vq~Om{O#y%VO~PIbOi#jOc#Wq!O#Wq!T#Wq!^#Wq!h#Wq!k#Wq!o#Wq!t#Wq!x#Wq#S#Wq#f#Wq#l#Wq#m#Wq#n#Wq~Om{O#y%VO~PJmOc#Xqi#Xq!O#Xq!T#Xq!^#Xq!h#Xq!k#Xq!o#Xq!t#Xq!x#Xq#S#Xq#f#Xq#l#Xq#m#Xq#n#Xq~O#{%]O~PKxO#r#sO~PKxOi#uOc#Yq!O#Yq!T#Yq!^#Yq!h#Yq!k#Yq!o#Yq!t#Yq!x#Yq#S#Yq#f#Yq#l#Yq#m#Yq#n#Yq~Oi#yOc#Zq!O#Zq!T#Zq!^#Zq!h#Zq!k#Zq!o#Zq!t#Zq!x#Zq#S#Zq#f#Zq#l#Zq#m#Zq#n#Zq~OY'PO]&}Oa'POb'POc'POd'POe'POf'POi'OO~OiPOhsq#ksq#tsq#vsq~O#q'TOU#pXY#pXm#pX#r#pX#t#pXc#pX{#pX!z#pX#k#pX[#pXh#pX#o#pX~Om{O#r'UO#t'VOUXiYXi~Oi#jOc![y!O![y!T![y!^![y!h![y!k![y!o![y!t![y!x![y#S![y#f![y#l![y#m![y#n![y~Oi#jOc!fy!O!fy!T!fy!^!fy!h!fy!k!fy!o!fy!t!fy!x!fy#S!fy#f!fy#l!fy#m!fy#n!fy~O#{%]Oc!iyi!iy!O!iy!T!iy!^!iy!h!iy!k!iy!o!iy!t!iy!x!iy#S!iy#f!iy#l!iy#m!iy#n!iy~O#{&tOc!vyi!vy!O!vy!T!vy!^!vy!h!vy!k!vy!o!vy!t!vy!x!vy#S!vy#f!vy#l!vy#m!vy#n!vy~O#o'_O~OcUO#kzO#o'_O~OV!sOclXflXhlXmlX~Om&kOckXfkXhkX~Om&kOc!qaf!qah!qa~Om{O#r'UOc!ei{!ei!z!ei#k!eih!ei#o!ei~Oi#jOc#Vy!O#Vy!T#Vy!^#Vy!h#Vy!k#Vy!o#Vy!t#Vy!x#Vy#S#Vy#f#Vy#l#Vy#m#Vy#n#Vy~Oi#jOc#Wy!O#Wy!T#Wy!^#Wy!h#Wy!k#Wy!o#Wy!t#Wy!x#Wy#S#Wy#f#Wy#l#Wy#m#Wy#n#Wy~O#{%]Oc#Xyi#Xy!O#Xy!T#Xy!^#Xy!h#Xy!k#Xy!o#Xy!t#Xy!x#Xy#S#Xy#f#Xy#l#Xy#m#Xy#n#Xy~O['jO~P! ZOh'nO#kzO~O#t'oOUoi#koi~O['pO~O#t'rOUXqYXq~Om{O#t'rOUXqYXq~O#{&tOc!v!Ri!v!R!O!v!R!T!v!R!^!v!R!h!v!R!k!v!R!o!v!R!t!v!R!x!v!R#S!v!R#f!v!R#l!v!R#m!v!R#n!v!R~Om{Oc!cih!ci#k!ci~O#o'wO~Om{Oc!eq{!eq!z!eq#k!eqh!eq#o!eq~O#r'UO~P!/eO#t'zOY#^X[#^X]#^Xa#^Xb#^Xc#^Xd#^Xe#^Xf#^Xi#^X~O['|O~P! ZO#o'}O~Oh(PO#kzO~O#t(QOUXyYXy~O#{&tOc!v!Zi!v!Z!O!v!Z!T!v!Z!^!v!Z!h!v!Z!k!v!Z!o!v!Z!t!v!Z!x!v!Z#S!v!Z#f!v!Z#l!v!Z#m!v!Z#n!v!Z~Om{Oc!cqh!cq#k!cq~Om{Oc!ey{!ey!z!ey#k!eyh!ey#o!ey~Om{Oc!cyh!cy#k!cy~O#t(WOh#ui#k#ui~Odefe~",goto:":k$OPPP$P$T$[PP&d&jP&nPP'Z'd'mPPPPPP'vPP'v'}*|P,T,_,c,g-k-o-s-w-o.O-o.U.[P$P.oP.s.w.{/bP/l/|.w0P0TP0P0ZP0e0wP1P2T2X2e0P2nP0P2xP3S0P3dP3n4O0P4SP4^.w4nP4uP5P5]5i5i.s5q5uP5q5y5y5y5y5y5y5}6T6Z6a6g7r7x8O8U8cPPP8i8mPPPPP8qPP9WP9eP8m9iP9qP:Z:cTTOgSQOgR#]!VSsPyQ!SQS!TSvQ!dXQ!eYQ!fZQ!g[Q!h]Q#a![Q#b!]Q#c!^Q#d!_Q#e!`Q#f!a^#}!i#g#y$Q%X%c&gQ$X!kQ$Y!lQ$Z!mQ$[!nQ$]!oQ$^!pj$g!z#i#s$k$r%V%]%d&R&e&s'_'wS%X#j%[Q%e$OQ&g%YT'k'O'mQ!RQR#Z!ST#V!O#WQ$h!zQ%W#iQ%^#s^&S$k%d&R&e&s'_'wQ&X$rQ&d%VR&j%]_&S$k%d&R&e&s'_'w_&T$k%d&R&e&s'_'wQ'X&UQ'c&rR'y'dZ'P%{&}'U'i'}Q!QQQ!YVQ!utQ!|vS#Y!R!SQ#`!ZQ#m!dQ#q!eQ#t!fQ#x!gQ#|!hQ$W!jS$d!v!xQ$f!yQ$j!}Q$o#ZQ$q#[Q$u#aS$x#b#hS${#c#oQ$}#dQ%P#eQ%R#fQ%n$XQ%q$YQ%t$ZQ%v$[Q%x$]Q%z$^Q&P$eQ&Z$vQ&]$yQ&m%_Q&w%oQ&y%rQ'W&UQ'a&nQ'b&rQ's'XQ'u'^S'x'c'dQ(R'vQ(T'yR(V(S#Z|QVtv}!R!S!Z!d!e!f!g!h!j!v!x!y!}#Z#[#a#b#c#d#e#f#h#o$X$Y$Z$[$]$^$e$v$y%_%o%r&U&l&n&r'X'^'c'd'v'y(SQ!vtS#S{&kR$e!xT$a!s$bT$`!s$bSROgQ!PQQ!ttQ!{vU#X!Q!R!SU$c!u!v!xS$i!|!}S$n#Y#ZQ$p#[S&O$d$eQ&Q$jQ&V$oQ&W$qR'R&PTxPyTwPyTuPyStPyR!xuQ!USR!yvQ!}vR#[!US!zv!UQ$R!iU%S#g$S$TS&b%T%UR']&cTSOgTdOgT`OgSWOg^$O!i#g#y$Q%X%c&gS%Y#j%[T%`#u%bSVOgQ!ZWR!jaQ!XVS#_!Y!ZQ$V!jQ$t#`R%m$WR#^!VT^OgQ![WR!kaSXOgQ!]WR!laQ#h!dQ#o!eQ$v#bQ$y#cQ%o$YR%r$Z]#i!d!e#b#c$Y$ZQ#l!dQ#p!eU$w#b#h#mU$z#c#o#qQ%p$YQ%s$ZS&Y$v$xS&[$y${S&v%o%qS&x%r%tQ'Y&ZQ'Z&]Q'f&wR'g&yT%Z#j%[Q$T!iQ%U#gQ&f%XR'`&g_$P!i#g#y$Q%X%c&gSYOgQ!^WR!maSZOgQ!_WR!naQ#r!fS$|#d#tQ%u$[Q&^$}R&z%vS[OgQ!`WR!oaQ#w!gS%O#e#xQ%w$]Q&_%PR&{%xT%a#u%bS]OgQ!aWR!paQ#{!hS%Q#f#|Q%y$^Q&`%RR&|%zS_OgR!bWQ$S!iS%T#g$TR&c%UQ%j$RQ&a%SQ'[&bR't']W%k$R%S&b']Q&u%lR'e&t]%i$R%S%l&b&t']TcOgTaOgTbOgQgOR!qgQ#W!OR$l#WQ'i&}R'{'iQ'm'OR(O'm#Q}QVtv!R!S!Z!d!e!f!g!h!j!v!x!y!}#Z#[#a#b#c#d#e#f#h#o$X$Y$Z$[$]$^$e$v$y%o%r&U&r'X'^'c'd'v'y(SS#T}&lT&l%_&nQ$b!sR%|$bQyPR#QyQ%[#jR&h%[W$Q!i#g%X&gQ%c#yT%f$Q%cQ%b#uR&o%bTfOgTeOgQ&U$kQ&r%dQ'S&RQ'^&eQ'd&sQ'v'_R(S'wQ'Q%{S'h&}'iQ'q'UR(U'}T'l'O'm]!WV!Y!Z!j#`$W}#k!d!e#b#c#h#m#o#q$Y$Z$v$x$y${%o%q%r%t&Z&]&w&y]#v!g#e#x$]%P%x]#z!h#f#|$^%R%z",nodeNames:`⚠ Comment Document OperationDefinition OperationType Name ) ( VariableDefinitions VariableDefinition Variable NamedType ] [ ListType NonNullType DefaultValue IntValue FloatValue StringValue BooleanValue NullValue EnumValue ListValue } { ObjectValue Directives Directive DirectiveName Arguments Argument ArgumentAttributeName SelectionSet Selection Field Alias FieldName FragmentSpread FragmentName InlineFragment TypeCondition OnKeyword on FragmentDefinition FragmentKeyword fragment TypeSystemDefinition SchemaDefinition Description SchemaKeyword schema RootTypeDefinition RootOperationTypeDefinition TypeDefinition ScalarTypeDefinition ScalarKeyword scalar ObjectTypeDefinition TypeKeyword type ImplementsInterfaces ImplementsKeyword implements FieldsDefinition FieldDefinition ArgumentsDefinition InputValueDefinition InterfaceTypeDefinition InterfaceKeyword interface UnionTypeDefinition UnionKeyword union UnionMemberTypes EnumTypeDefinition EnumKeyword enum EnumValuesDefinition EnumValueDefinition InputObjectTypeDefinition InputKeyword input InputFieldsDefinition DirectiveDefinition DirectiveKeyword directive RepeatableKeyword repeatable DirectiveLocations DirectiveLocation ExecutableDirectiveLocation TypeSystemDirectiveLocation TypeSystemExtension SchemaExtension ExtendKeyword extend TypeExtension ScalarTypeExtension ObjectTypeExtension InterfaceTypeExtension UnionTypeExtension EnumTypeExtension InputObjectTypeExtension`,maxTerm:156,nodeProps:[[`openedBy`,6,`(`,12,`[`,24,`{`],[`closedBy`,7,`)`,13,`]`,25,`}`]],skippedNodes:[0,1],repeatNodeCount:10,tokenData:"#Ci~R!XX^$npq$nqr%crs%hst4ptu4{vw5jxy5oyz5t|}5y}!O6O!O!P7g!Q![6U![!]7x!_!`7}!b!c8S!c!d8q!d!g9[!g!hCZ!h!iHd!i!k9[!k!l!/v!l!o9[!o!p!Id!p!q9[!q!r!Mm!r!s9[!s!t#!u!t!u9[!u!v#%d!v!w9[!w!x#0n!x!y#3]!y!}9[!}#O#=[#P#Q#=a#R#S9[#T#Y9[#Y#Z#=f#Z#b9[#b#c#@Q#c#h9[#h#i#BU#i#o9[#o#p#CY#p#q#C_#q#r#Cd#y#z$n$f$g$n#BY#BZ$n$IS$I_$n$I|$JO$n$JT$JU$n$KV$KW$n&FU&FV$n~$sY#h~X^$npq$n#y#z$n$f$g$n#BY#BZ$n$IS$I_$n$I|$JO$n$JT$JU$n$KV$KW$n&FU&FV$n~%hO#q~~%kVOY&QZ]&Q^r&Qrs(as#O&Q#O#P&o#P~&Q~&TVOY&QZ]&Q^r&Qrs&js#O&Q#O#P&o#P~&Q~&oOc~~&rXrs&Q!P!Q&Q#O#P&Q#U#V&Q#Y#Z&Q#b#c&Q#f#g&Q#h#i&Q#i#j'_~'bR!QX^r(irs)_s#O(i#O#P)w#P~(i~)[PYZ(i~)bROr(irs)ks~(i~)nROr(irs&js~(i~)zXrs*g!P!Q(i#O#P(i#U#V(i#Y#Z(i#b#c(i#f#g(i#h#i(i#i#j3n~*jXOY(iYZ(iZ](i]^)X^r(irs+Vs#O(i#O#P)w#P~(i~+YROr(irs+cs~(i~+fXOY(iYZ(iZ](i]^(i^r(irs,Rs#O(i#O#P,a#P~(i~,WRc~Or(irs)ks~(i~,dfOY(iYZ(iZ](i]^)X^r(irs-xs!P(i!P!Q(i!Q#O(i#O#P,a#P#U(i#U#V(i#V#Y(i#Y#Z(i#Z#b(i#b#c(i#c#f(i#f#g(i#g#h(i#h#i(i#i#j/f#j~(i~-{XOY(iYZ(iZ](i]^(i^r(irs.hs#O(i#O#P,a#P~(i~.kROr(irs.ts~(i~.yXc~OY(iYZ(iZ](i]^(i^r(irs,Rs#O(i#O#P,a#P~(i~/i_OY(iYZ(iZ](i]^)X^r(irs)_s!Q(i!QX^r(irs)_s!Q(i!QX^r(irs)_s!Q(i!QX^r(irs)_s!Q(i!Q![(i![!c(i!c!i(i!i#O(i#O#P)w#P#T(i#T#Z(i#Z~(i~3qR!Q![3z!c!i3z#T#Z3z~3}R!Q![4W!c!i4W#T#Z4W~4ZR!Q![4d!c!i4d#T#Z4d~4gR!Q![(i!c!i(i#T#Z(i~4uQP~OY4pZ~4p~5OR!c!}5X#R#S5X#T#o5X~5^SY~!Q![5X!c!}5X#R#S5X#T#o5X~5oO#y~~5tOV~~5yOU~~6OO#t~~6RP!Q![6U~6ZSa~!O!P6g!Q![6U!g!h6{#X#Y6{~6jP!Q![6m~6rRb~!Q![6m!g!h6{#X#Y6{~7OR{|7X}!O7X!Q![7_~7[P!Q![7_~7dPb~!Q![7_~7jP!O!P7m~7pP!O!P7s~7xO#v~~7}O#o~~8SO#r~~8VR!c!}8`#R#S8`#T#o8`~8eSm~!Q![8`!c!}8`#R#S8`#T#o8`V8xU#kPfQ!Q![9[!c!t9[!t!u9o!u!}9[#R#S9[#T#o9[R9cS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V9vU#kPfQ!Q![9[!c!i9[!i!j:Y!j!}9[#R#S9[#T#o9[V:aU#kPfQ!Q![9[!c!w9[!w!x:s!x!}9[#R#S9[#T#o9[V:zU#kPfQ!Q![9[!c!o9[!o!p;^!p!}9[#R#S9[#T#o9[V;eU#kPfQ!Q![9[!c!g9[!g!h;w!h!}9[#R#S9[#T#o9[V<OU#kPfQ!Q![9[!c!p9[!p!q<b!q!}9[#R#S9[#T#o9[V<iU#kPfQ!Q![9[!c!v9[!v!w<{!w!}9[#R#S9[#T#o9[V=SS#kPfQ!Q![9[!c!}9[#R#S=`#T#o9[V=gU#kPfQ!Q![9[!c!f9[!f!g=y!g!}9[#R#S9[#T#o9[V>QU#kPfQ!Q![9[!c!g9[!g!h>d!h!}9[#R#S9[#T#o9[V>kU#kPfQ!Q![9[!c!h9[!h!i>}!i!}9[#R#S9[#T#o9[V?UU#kPfQ!Q![9[!c!k9[!k!l?h!l!}9[#R#S9[#T#o9[V?oU#kPfQ!Q![9[!c!p9[!p!q@R!q!}9[#R#S9[#T#o9[V@YU#kPfQ!Q![9[!c!k9[!k!l@l!l!}9[#R#S9[#T#o9[V@sU#kPfQ!Q![9[!c!v9[!v!wAV!w!}9[#R#S9[#T#o9[VA^U#kPfQ!Q![9[!c!k9[!k!lAp!l!}9[#R#S9[#T#o9[VAwU#kPfQ!Q![9[!c!q9[!q!rBZ!r!}9[#R#S9[#T#o9[VBbU#kPfQ!Q![9[!c!p9[!p!qBt!q!}9[#R#S9[#T#o9[VB}S$[S#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[VCbU#kPfQ!Q![9[!c!p9[!p!qCt!q!}9[#R#S9[#T#o9[VC{U#kPfQ!Q![9[!c!w9[!w!xD_!x!}9[#R#S9[#T#o9[VDfU#kPfQ!Q![9[!c!o9[!o!pDx!p!}9[#R#S9[#T#o9[VERS$_S#kPfQ!Q![9[!c!}9[#R#SE_#T#o9[VEfU#kPfQ!Q![9[!c!x9[!x!yEx!y!}9[#R#S9[#T#o9[VFPT#kPfQ!Q![9[!c!dF`!d!}9[#R#S9[#T#o9[VFgU#kPfQ!Q![9[!c!n9[!n!oFy!o!}9[#R#S9[#T#o9[VGQU#kPfQ!Q![9[!c!w9[!w!xGd!x!}9[#R#S9[#T#o9[VGkU#kPfQ!Q![9[!c!g9[!g!hG}!h!}9[#R#S9[#T#o9[VHWS$`S#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[VHkW#kPfQ!Q![9[!c!k9[!k!lIT!l!t9[!t!u!#S!u!}9[#R#S9[#T#o9[VI[U#kPfQ!Q![9[!c!g9[!g!hIn!h!}9[#R#S9[#T#o9[VIuU#kPfQ!Q![9[!c!n9[!n!oJX!o!}9[#R#S9[#T#o9[VJ`U#kPfQ!Q![9[!c!f9[!f!gJr!g!}9[#R#S9[#T#o9[VJ{S$RS#kPfQ!Q![9[!c!}9[#R#SKX#T#o9[VK`U#kPfQ!Q![9[!c!f9[!f!gKr!g!}9[#R#S9[#T#o9[VKyU#kPfQ!Q![9[!c!g9[!g!hL]!h!}9[#R#S9[#T#o9[VLdU#kPfQ!Q![9[!c!h9[!h!iLv!i!}9[#R#S9[#T#o9[VL}U#kPfQ!Q![9[!c!k9[!k!lMa!l!}9[#R#S9[#T#o9[VMhU#kPfQ!Q![9[!c!p9[!p!qMz!q!}9[#R#S9[#T#o9[VNRU#kPfQ!Q![9[!c!k9[!k!lNe!l!}9[#R#S9[#T#o9[VNlU#kPfQ!Q![9[!c!v9[!v!w! O!w!}9[#R#S9[#T#o9[V! VU#kPfQ!Q![9[!c!k9[!k!l! i!l!}9[#R#S9[#T#o9[V! pU#kPfQ!Q![9[!c!q9[!q!r!!S!r!}9[#R#S9[#T#o9[V!!ZU#kPfQ!Q![9[!c!p9[!p!q!!m!q!}9[#R#S9[#T#o9[V!!vS$ZS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V!#ZT#kPfQ!Q![9[!c!d!#j!d!}9[#R#S9[#T#o9[V!#qU#kPfQ!Q![9[!c!i9[!i!j!$T!j!}9[#R#S9[#T#o9[V!$[U#kPfQ!Q![9[!c!o9[!o!p!$n!p!}9[#R#S9[#T#o9[V!$uU#kPfQ!Q![9[!c!g9[!g!h!%X!h!}9[#R#S9[#T#o9[V!%`U#kPfQ!Q![9[!c!p9[!p!q!%r!q!}9[#R#S9[#T#o9[V!%yU#kPfQ!Q![9[!c!v9[!v!w!&]!w!}9[#R#S9[#T#o9[V!&dS#kPfQ!Q![9[!c!}9[#R#S!&p#T#o9[V!&wW#kPfQ!Q![9[!c!f9[!f!g!'a!g!u9[!u!v!,q!v!}9[#R#S9[#T#o9[V!'hU#kPfQ!Q![9[!c!g9[!g!h!'z!h!}9[#R#S9[#T#o9[V!(RU#kPfQ!Q![9[!c!h9[!h!i!(e!i!}9[#R#S9[#T#o9[V!(lU#kPfQ!Q![9[!c!k9[!k!l!)O!l!}9[#R#S9[#T#o9[V!)VU#kPfQ!Q![9[!c!p9[!p!q!)i!q!}9[#R#S9[#T#o9[V!)pU#kPfQ!Q![9[!c!k9[!k!l!*S!l!}9[#R#S9[#T#o9[V!*ZU#kPfQ!Q![9[!c!v9[!v!w!*m!w!}9[#R#S9[#T#o9[V!*tU#kPfQ!Q![9[!c!k9[!k!l!+W!l!}9[#R#S9[#T#o9[V!+_U#kPfQ!Q![9[!c!q9[!q!r!+q!r!}9[#R#S9[#T#o9[V!+xU#kPfQ!Q![9[!c!p9[!p!q!,[!q!}9[#R#S9[#T#o9[V!,eS$SS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V!,xU#kPfQ!Q![9[!c!r9[!r!s!-[!s!}9[#R#S9[#T#o9[V!-cU#kPfQ!Q![9[!c!t9[!t!u!-u!u!}9[#R#S9[#T#o9[V!-|U#kPfQ!Q![9[!c!g9[!g!h!.`!h!}9[#R#S9[#T#o9[V!.gT#kPfQ!Q![9[!c!d!.v!d!}9[#R#S9[#T#o9[V!.}U#kPfQ!Q![9[!c!f9[!f!g!/a!g!}9[#R#S9[#T#o9[V!/jS$TS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V!/}U#kPfQ!Q![9[!c!p9[!p!q!0a!q!}9[#R#S9[#T#o9[V!0hY#kPfQ!Q![9[!c!n9[!n!o!1W!o!r9[!r!s!7|!s!v9[!v!w!Et!w!}9[#R#S9[#T#o9[V!1_U#kPfQ!Q![9[!c!k9[!k!l!1q!l!}9[#R#S9[#T#o9[V!1xU#kPfQ!Q![9[!c!p9[!p!q!2[!q!}9[#R#S9[#T#o9[V!2cU#kPfQ!Q![9[!c!g9[!g!h!2u!h!}9[#R#S9[#T#o9[V!2|S#kPfQ!Q![9[!c!}9[#R#S!3Y#T#o9[V!3aU#kPfQ!Q![9[!c!h9[!h!i!3s!i!}9[#R#S9[#T#o9[V!3zU#kPfQ!Q![9[!c!t9[!t!u!4^!u!}9[#R#S9[#T#o9[V!4eT#kPfQ!Q![9[!c!d!4t!d!}9[#R#S9[#T#o9[V!4{U#kPfQ!Q![9[!c!i9[!i!j!5_!j!}9[#R#S9[#T#o9[V!5fU#kPfQ!Q![9[!c!o9[!o!p!5x!p!}9[#R#S9[#T#o9[V!6PU#kPfQ!Q![9[!c!g9[!g!h!6c!h!}9[#R#S9[#T#o9[V!6jU#kPfQ!Q![9[!c!p9[!p!q!6|!q!}9[#R#S9[#T#o9[V!7TU#kPfQ!Q![9[!c!v9[!v!w!7g!w!}9[#R#S9[#T#o9[V!7pS$US#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V!8TU#kPfQ!Q![9[!c!w9[!w!x!8g!x!}9[#R#S9[#T#o9[V!8nU#kPfQ!Q![9[!c!v9[!v!w!9Q!w!}9[#R#S9[#T#o9[V!9XS#kPfQ!Q![9[!c!}9[#R#S!9e#T#o9[V!9lW#kPfQ!Q![9[!c!h9[!h!i!:U!i!q9[!q!r!Bl!r!}9[#R#S9[#T#o9[V!:]U#kPfQ!Q![9[!c!k9[!k!l!:o!l!}9[#R#S9[#T#o9[V!:vU#kPfQ!Q![9[!c!g9[!g!h!;Y!h!}9[#R#S9[#T#o9[V!;aU#kPfQ!Q![9[!c!n9[!n!o!;s!o!}9[#R#S9[#T#o9[V!;zU#kPfQ!Q![9[!c!f9[!f!g!<^!g!}9[#R#S9[#T#o9[V!<eS#kPfQ!Q![9[!c!}9[#R#S!<q#T#o9[V!<xU#kPfQ!Q![9[!c!f9[!f!g!=[!g!}9[#R#S9[#T#o9[V!=cU#kPfQ!Q![9[!c!g9[!g!h!=u!h!}9[#R#S9[#T#o9[V!=|U#kPfQ!Q![9[!c!h9[!h!i!>`!i!}9[#R#S9[#T#o9[V!>gU#kPfQ!Q![9[!c!k9[!k!l!>y!l!}9[#R#S9[#T#o9[V!?QU#kPfQ!Q![9[!c!p9[!p!q!?d!q!}9[#R#S9[#T#o9[V!?kU#kPfQ!Q![9[!c!k9[!k!l!?}!l!}9[#R#S9[#T#o9[V!@UU#kPfQ!Q![9[!c!v9[!v!w!@h!w!}9[#R#S9[#T#o9[V!@oU#kPfQ!Q![9[!c!k9[!k!l!AR!l!}9[#R#S9[#T#o9[V!AYU#kPfQ!Q![9[!c!q9[!q!r!Al!r!}9[#R#S9[#T#o9[V!AsU#kPfQ!Q![9[!c!p9[!p!q!BV!q!}9[#R#S9[#T#o9[V!B`S$bS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V!BsU#kPfQ!Q![9[!c!d9[!d!e!CV!e!}9[#R#S9[#T#o9[V!C^U#kPfQ!Q![9[!c!l9[!l!m!Cp!m!}9[#R#S9[#T#o9[V!CwU#kPfQ!Q![9[!c!g9[!g!h!DZ!h!}9[#R#S9[#T#o9[V!DbU#kPfQ!Q![9[!c!e9[!e!f!Dt!f!}9[#R#S9[#T#o9[V!D{U#kPfQ!Q![9[!c!v9[!v!w!E_!w!}9[#R#S9[#T#o9[V!EhS$aS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V!E{U#kPfQ!Q![9[!c!g9[!g!h!F_!h!}9[#R#S9[#T#o9[V!FfU#kPfQ!Q![9[!c!t9[!t!u!Fx!u!}9[#R#S9[#T#o9[V!GPU#kPfQ!Q![9[!c!h9[!h!i!Gc!i!}9[#R#S9[#T#o9[V!GjT#kPfQ!Q![9[!c!d!Gy!d!}9[#R#S9[#T#o9[V!HQU#kPfQ!Q![9[!c!e9[!e!f!Hd!f!}9[#R#S9[#T#o9[V!HkU#kPfQ!Q![9[!c!g9[!g!h!H}!h!}9[#R#S9[#T#o9[V!IWS$]S#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V!IkU#kPfQ!Q![9[!c!w9[!w!x!I}!x!}9[#R#S9[#T#o9[V!JUU#kPfQ!Q![9[!c!v9[!v!w!Jh!w!}9[#R#S9[#T#o9[V!JoT#kPfQ!Q![9[!c!d!KO!d!}9[#R#S9[#T#o9[V!KVU#kPfQ!Q![9[!c!v9[!v!w!Ki!w!}9[#R#S9[#T#o9[V!KpU#kPfQ!Q![9[!c!k9[!k!l!LS!l!}9[#R#S9[#T#o9[V!LZU#kPfQ!Q![9[!c!q9[!q!r!Lm!r!}9[#R#S9[#T#o9[V!LtU#kPfQ!Q![9[!c!p9[!p!q!MW!q!}9[#R#S9[#T#o9[V!MaS$PS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V!MtU#kPfQ!Q![9[!c!d9[!d!e!NW!e!}9[#R#S9[#T#o9[V!N_U#kPfQ!Q![9[!c!l9[!l!m!Nq!m!}9[#R#S9[#T#o9[V!NxU#kPfQ!Q![9[!c!g9[!g!h# [!h!}9[#R#S9[#T#o9[V# cU#kPfQ!Q![9[!c!e9[!e!f# u!f!}9[#R#S9[#T#o9[V# |U#kPfQ!Q![9[!c!v9[!v!w#!`!w!}9[#R#S9[#T#o9[V#!iS$YS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V#!|U#kPfQ!Q![9[!c!w9[!w!x##`!x!}9[#R#S9[#T#o9[V##gU#kPfQ!Q![9[!c!g9[!g!h##y!h!}9[#R#S9[#T#o9[V#$QU#kPfQ!Q![9[!c!t9[!t!u#$d!u!}9[#R#S9[#T#o9[V#$kU#kPfQ!Q![9[!c!{9[!{!|#$}!|!}9[#R#S9[#T#o9[V#%WS$OS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V#%kW#kPfQ!Q![9[!c!e9[!e!f#&T!f!w9[!w!x#*s!x!}9[#R#S9[#T#o9[V#&[V#kPfQ!Q![9[!c!d#&q!d!j9[!j!k#(r!k!}9[#R#S9[#T#o9[V#&xU#kPfQ!Q![9[!c!n9[!n!o#'[!o!}9[#R#S9[#T#o9[V#'cT#kPfQ!Q![9[!c!d#'r!d!}9[#R#S9[#T#o9[V#'yU#kPfQ!Q![9[!c!t9[!t!u#(]!u!}9[#R#S9[#T#o9[V#(fS$XS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V#(yU#kPfQ!Q![9[!c!g9[!g!h#)]!h!}9[#R#S9[#T#o9[V#)dU#kPfQ!Q![9[!c!o9[!o!p#)v!p!}9[#R#S9[#T#o9[V#)}T#kPfQ!Q![9[!c!d#*^!d!}9[#R#S9[#T#o9[V#*gS$WS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V#*zU#kPfQ!Q![9[!c!d9[!d!e#+^!e!}9[#R#S9[#T#o9[V#+eU#kPfQ!Q![9[!c!u9[!u!v#+w!v!}9[#R#S9[#T#o9[V#,OU#kPfQ!Q![9[!c!e9[!e!f#,b!f!}9[#R#S9[#T#o9[V#,iU#kPfQ!Q![9[!c!t9[!t!u#,{!u!}9[#R#S9[#T#o9[V#-SU#kPfQ!Q![9[!c!k9[!k!l#-f!l!}9[#R#S9[#T#o9[V#-mU#kPfQ!Q![9[!c!r9[!r!s#.P!s!}9[#R#S9[#T#o9[V#.WU#kPfQ!Q![9[!c!v9[!v!w#.j!w!}9[#R#S9[#T#o9[V#.qU#kPfQ!Q![9[!c!k9[!k!l#/T!l!}9[#R#S9[#T#o9[V#/[U#kPfQ!Q![9[!c!q9[!q!r#/n!r!}9[#R#S9[#T#o9[V#/uU#kPfQ!Q![9[!c!p9[!p!q#0X!q!}9[#R#S9[#T#o9[V#0bS$QS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V#0uU#kPfQ!Q![9[!c!p9[!p!q#1X!q!}9[#R#S9[#T#o9[V#1`U#kPfQ!Q![9[!c!k9[!k!l#1r!l!}9[#R#S9[#T#o9[V#1yU#kPfQ!Q![9[!c!q9[!q!r#2]!r!}9[#R#S9[#T#o9[V#2dU#kPfQ!Q![9[!c!p9[!p!q#2v!q!}9[#R#S9[#T#o9[V#3PS$^S#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V#3dT#kPfQ!Q![9[!c!d#3s!d!}9[#R#S9[#T#o9[V#3zU#kPfQ!Q![9[!c!t9[!t!u#4^!u!}9[#R#S9[#T#o9[V#4eU#kPfQ!Q![9[!c!k9[!k!l#4w!l!}9[#R#S9[#T#o9[V#5OT#kPfQ!Q![9[!c!d#5_!d!}9[#R#S9[#T#o9[V#5fU#kPfQ!Q![9[!c!d9[!d!e#5x!e!}9[#R#S9[#T#o9[V#6PU#kPfQ!Q![9[!c!n9[!n!o#6c!o!}9[#R#S9[#T#o9[V#6jU#kPfQ!Q![9[!c!g9[!g!h#6|!h!}9[#R#S9[#T#o9[V#7TS#kPfQ!Q![9[!c!}9[#R#S#7a#T#o9[V#7hU#kPfQ!Q![9[!c!f9[!f!g#7z!g!}9[#R#S9[#T#o9[V#8RU#kPfQ!Q![9[!c!g9[!g!h#8e!h!}9[#R#S9[#T#o9[V#8lU#kPfQ!Q![9[!c!h9[!h!i#9O!i!}9[#R#S9[#T#o9[V#9VU#kPfQ!Q![9[!c!k9[!k!l#9i!l!}9[#R#S9[#T#o9[V#9pU#kPfQ!Q![9[!c!p9[!p!q#:S!q!}9[#R#S9[#T#o9[V#:ZU#kPfQ!Q![9[!c!k9[!k!l#:m!l!}9[#R#S9[#T#o9[V#:tU#kPfQ!Q![9[!c!v9[!v!w#;W!w!}9[#R#S9[#T#o9[V#;_U#kPfQ!Q![9[!c!k9[!k!l#;q!l!}9[#R#S9[#T#o9[V#;xU#kPfQ!Q![9[!c!q9[!q!r#<[!r!}9[#R#S9[#T#o9[V#<cU#kPfQ!Q![9[!c!p9[!p!q#<u!q!}9[#R#S9[#T#o9[V#=OS$VS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[~#=aO]~~#=fO[~R#=mT#kPfQ!Q![9[!c!}9[#R#S9[#T#U#=|#U#o9[R#>TU#kPfQ!Q![9[!c!}9[#R#S9[#T#`9[#`#a#>g#a#o9[R#>nU#kPfQ!Q![9[!c!}9[#R#S9[#T#g9[#g#h#?Q#h#o9[R#?XU#kPfQ!Q![9[!c!}9[#R#S9[#T#X9[#X#Y#?k#Y#o9[R#?tS#kPdQfQ!Q![9[!c!}9[#R#S9[#T#o9[R#@XU#kPfQ!Q![9[!c!}9[#R#S9[#T#i9[#i#j#@k#j#o9[R#@rU#kPfQ!Q![9[!c!}9[#R#S9[#T#`9[#`#a#AU#a#o9[R#A]U#kPfQ!Q![9[!c!}9[#R#S9[#T#`9[#`#a#Ao#a#o9[R#AxS#kPeQfQ!Q![9[!c!}9[#R#S9[#T#o9[R#B]U#kPfQ!Q![9[!c!}9[#R#S9[#T#f9[#f#g#Bo#g#o9[R#BvU#kPfQ!Q![9[!c!}9[#R#S9[#T#i9[#i#j#?Q#j#o9[~#C_Oi~~#CdO#{~~#CiOh~",tokenizers:[0,1,2],topRules:{Document:[0,2]},specialized:[{term:119,get:e=>xC[e]||-1}],tokenPrec:2989}),CC=`RootTypeDefinition InputFieldsDefinition EnumValuesDefinition FieldsDefinition SelectionSet { }`,wC=`scalar type interface union enum input implements fragment extend schema directive on repeatable`,TC=`( ) { } : [ ]`,EC=qf.define({parser:SC.configure({props:[rr({Variable:A.variableName,BooleanValue:A.bool,Description:A.string,StringValue:A.string,Comment:A.lineComment,IntValue:A.integer,FloatValue:A.float,EnumValue:A.special(A.name),NullValue:A.null,DirectiveName:A.modifier,[wC]:A.keyword,OperationType:A.definitionKeyword,FieldName:A.propertyName,Field:A.propertyName,ArgumentAttributeName:A.attributeName,Name:A.atom,"( )":A.paren,"{ }":A.brace,",":A.separator,[TC]:A.punctuation}),dp.add({[CC]:bp({closing:`}`,align:!0})}),Ep.add({[CC]:Dp})]}),languageData:{commentTokens:{line:`#`},indentOnInput:/^\s*(\{|\})$/}});function DC(){return new ip(EC)}var OC=/^[a-zA-Z0-9_@(]$/,kC=EC.data.of({autocomplete(e){let t=_C(e.state),n=vC(e.state);if(!t)return null;let r=e.matchBefore(/\w*/);if(!r)return null;let i=r.text.split(``).pop();if(!OC.test(i)&&!e.explicit)return null;let a=AS(t,e.state.doc.toString(),lC(e.state.doc,e.pos),void 0,void 0,n?.autocompleteOptions);return a.length===0?null:{from:r.from,options:a.map(t=>({label:t.label,detail:t.detail||``,info(r){if(n?.onCompletionInfoRender)return n.onCompletionInfoRender(t,e,r);if(t.documentation||t.isDeprecated&&t.deprecationReason){let e=document.createElement(`div`);return e.textContent=t.documentation||t.deprecationReason||``,e}}}))}}}),AC=G.domEventHandlers({click(e,t){let n=_C(t.state);if(!n)return;let r=t.state.selection.main.head,i=lC(t.state.doc,r),a=DS(n,SS(t.state.doc.toString(),i).state),o=vC(t.state);o?.onShowInDocs&&fC(e)&&o.onShowInDocs(a.fieldDef?.name,a.type?.toString(),a.parentType?.toString())}}),jC=[`error`,`warning`,`info`],MC=tb(e=>{let t=_C(e.state),n=vC(e.state);if(!t)return[];let r=(0,d.validateSchema)(t);if(r.length){if(!n?.showErrorOnInvalidSchema)return[];let t=r.map(e=>e.message);return[{from:0,to:e.state.doc.length,severity:`error`,message:t.join(`
|
|
24
|
+
`),actions:[]}]}return rC(e.state.doc.toString(),t).map(t=>{if(!t.severity||!t.source)return null;let n=cC(e.state.doc,new uC(t.range.start.line,t.range.start.character)),r=Math.max(0,Math.min(n,e.state.doc.length)),i=cC(e.state.doc,new uC(t.range.end.line,t.range.end.character-1)),a=Math.min(Math.max(r+1,i),e.state.doc.length);return{from:r,to:r===a?a+1:a,severity:jC[t.severity-1],message:t.message,actions:[]}}).filter(e=>!!e)},{needsRefresh(e){return e.startState.field(mC)!==e.state.field(mC)||e.startState.field(gC)!==e.state.field(gC)}});function NC(e,t){return[DC(),kC,MC,AC,bC(e,t)]}function PC({className:e}){let{editor:t,schema:n}=Dt(),r=h(t,e=>e.query),i=h(t,e=>e.setQuery),a=h(n,e=>e.schema),{containerRef:o}=hb({value:r,onChange:i,extensions:(0,l.useMemo)(()=>[NC(a??void 0)],[a]),placeholder:`# Write your GraphQL query here...`});return(0,u.jsx)(`div`,{ref:o,className:E(`flex-1 overflow-auto`,e)})}function FC({className:e}){let{execution:t}=Dt(),n=h(t,e=>e.response),r=h(t,e=>e.error),{containerRef:i}=hb({value:r?JSON.stringify({error:r.message},null,2):n??``,extensions:(0,l.useMemo)(()=>[Mm()],[]),readOnly:!0,placeholder:`Response will appear here...`});return(0,u.jsx)(`div`,{ref:i,className:E(`flex-1 overflow-auto`,e)})}function IC({className:e}){let{editor:t}=Dt(),{containerRef:n}=hb({value:h(t,e=>e.variables),onChange:h(t,e=>e.setVariables),extensions:(0,l.useMemo)(()=>[Mm()],[]),placeholder:`{ "key": "value" }`});return(0,u.jsx)(`div`,{ref:n,className:E(`flex-1 overflow-auto`,e)})}var LC=new Map([[`bold`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z`}))],[`duotone`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M176,128,96,208V48Z`,opacity:`0.2`}),l.createElement(`path`,{d:`M181.66,122.34l-80-80A8,8,0,0,0,88,48V208a8,8,0,0,0,13.66,5.66l80-80A8,8,0,0,0,181.66,122.34ZM104,188.69V67.31L164.69,128Z`}))],[`fill`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M181.66,133.66l-80,80A8,8,0,0,1,88,208V48a8,8,0,0,1,13.66-5.66l80,80A8,8,0,0,1,181.66,133.66Z`}))],[`light`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M180.24,132.24l-80,80a6,6,0,0,1-8.48-8.48L167.51,128,91.76,52.24a6,6,0,0,1,8.48-8.48l80,80A6,6,0,0,1,180.24,132.24Z`}))],[`regular`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z`}))],[`thin`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M178.83,130.83l-80,80a4,4,0,0,1-5.66-5.66L170.34,128,93.17,50.83a4,4,0,0,1,5.66-5.66l80,80A4,4,0,0,1,178.83,130.83Z`}))]]),RC=new Map([[`bold`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M79.51,144.49a12,12,0,1,1,17-17L112,143l47.51-47.52a12,12,0,0,1,17,17l-56,56a12,12,0,0,1-17,0ZM228,48V208a20,20,0,0,1-20,20H48a20,20,0,0,1-20-20V48A20,20,0,0,1,48,28H208A20,20,0,0,1,228,48Zm-24,4H52V204H204Z`}))],[`duotone`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M216,48V208a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V48a8,8,0,0,1,8-8H208A8,8,0,0,1,216,48Z`,opacity:`0.2`}),l.createElement(`path`,{d:`M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM224,48V208a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V48A16,16,0,0,1,48,32H208A16,16,0,0,1,224,48ZM208,208V48H48V208H208Z`}))],[`fill`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm-34.34,77.66-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35a8,8,0,0,1,11.32,11.32Z`}))],[`light`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M172.24,99.76a6,6,0,0,1,0,8.48l-56,56a6,6,0,0,1-8.48,0l-24-24a6,6,0,0,1,8.48-8.48L112,151.51l51.76-51.75A6,6,0,0,1,172.24,99.76ZM222,48V208a14,14,0,0,1-14,14H48a14,14,0,0,1-14-14V48A14,14,0,0,1,48,34H208A14,14,0,0,1,222,48Zm-12,0a2,2,0,0,0-2-2H48a2,2,0,0,0-2,2V208a2,2,0,0,0,2,2H208a2,2,0,0,0,2-2Z`}))],[`regular`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM224,48V208a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V48A16,16,0,0,1,48,32H208A16,16,0,0,1,224,48ZM208,208V48H48V208H208Z`}))],[`thin`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M170.83,101.17a4,4,0,0,1,0,5.66l-56,56a4,4,0,0,1-5.66,0l-24-24a4,4,0,0,1,5.66-5.66L112,154.34l53.17-53.17A4,4,0,0,1,170.83,101.17ZM220,48V208a12,12,0,0,1-12,12H48a12,12,0,0,1-12-12V48A12,12,0,0,1,48,36H208A12,12,0,0,1,220,48Zm-8,0a4,4,0,0,0-4-4H48a4,4,0,0,0-4,4V208a4,4,0,0,0,4,4H208a4,4,0,0,0,4-4Z`}))]]),zC=new Map([[`bold`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M140,80v41.21l34.17,20.5a12,12,0,1,1-12.34,20.58l-40-24A12,12,0,0,1,116,128V80a12,12,0,0,1,24,0ZM128,28A99.38,99.38,0,0,0,57.24,57.34c-4.69,4.74-9,9.37-13.24,14V64a12,12,0,0,0-24,0v40a12,12,0,0,0,12,12H72a12,12,0,0,0,0-24H57.77C63,86,68.37,80.22,74.26,74.26a76,76,0,1,1,1.58,109,12,12,0,0,0-16.48,17.46A100,100,0,1,0,128,28Z`}))],[`duotone`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z`,opacity:`0.2`}),l.createElement(`path`,{d:`M136,80v43.47l36.12,21.67a8,8,0,0,1-8.24,13.72l-40-24A8,8,0,0,1,120,128V80a8,8,0,0,1,16,0Zm-8-48A95.44,95.44,0,0,0,60.08,60.15C52.81,67.51,46.35,74.59,40,82V64a8,8,0,0,0-16,0v40a8,8,0,0,0,8,8H72a8,8,0,0,0,0-16H49c7.15-8.42,14.27-16.35,22.39-24.57a80,80,0,1,1,1.66,114.75,8,8,0,1,0-11,11.64A96,96,0,1,0,128,32Z`}))],[`fill`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M224,128A96,96,0,0,1,62.11,197.82a8,8,0,1,1,11-11.64A80,80,0,1,0,71.43,71.43C67.9,75,64.58,78.51,61.35,82L77.66,98.34A8,8,0,0,1,72,112H32a8,8,0,0,1-8-8V64a8,8,0,0,1,13.66-5.66L50,70.7c3.22-3.49,6.54-7,10.06-10.55A96,96,0,0,1,224,128ZM128,72a8,8,0,0,0-8,8v48a8,8,0,0,0,3.88,6.86l40,24a8,8,0,1,0,8.24-13.72L136,123.47V80A8,8,0,0,0,128,72Z`}))],[`light`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M134,80v44.6l37.09,22.25a6,6,0,0,1-6.18,10.3l-40-24A6,6,0,0,1,122,128V80a6,6,0,0,1,12,0Zm-6-46A93.4,93.4,0,0,0,61.51,61.56c-8.58,8.68-16,17-23.51,25.8V64a6,6,0,0,0-12,0v40a6,6,0,0,0,6,6H72a6,6,0,0,0,0-12H44.73C52.86,88.29,60.79,79.35,70,70a82,82,0,1,1,1.7,117.62,6,6,0,1,0-8.24,8.72A94,94,0,1,0,128,34Z`}))],[`regular`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M136,80v43.47l36.12,21.67a8,8,0,0,1-8.24,13.72l-40-24A8,8,0,0,1,120,128V80a8,8,0,0,1,16,0Zm-8-48A95.44,95.44,0,0,0,60.08,60.15C52.81,67.51,46.35,74.59,40,82V64a8,8,0,0,0-16,0v40a8,8,0,0,0,8,8H72a8,8,0,0,0,0-16H49c7.15-8.42,14.27-16.35,22.39-24.57a80,80,0,1,1,1.66,114.75,8,8,0,1,0-11,11.64A96,96,0,1,0,128,32Z`}))],[`thin`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M132,80v45.74l38.06,22.83a4,4,0,0,1-4.12,6.86l-40-24A4,4,0,0,1,124,128V80a4,4,0,0,1,8,0Zm-4-44A91.42,91.42,0,0,0,62.93,63C53.05,73,44.66,82.47,36,92.86V64a4,4,0,0,0-8,0v40a4,4,0,0,0,4,4H72a4,4,0,0,0,0-8H40.47C49.61,89,58.3,79,68.6,68.6a84,84,0,1,1,1.75,120.49,4,4,0,1,0-5.5,5.82A92,92,0,1,0,128,36Z`}))]]),BC=new Map([[`bold`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212ZM163.27,77l-56,24a12,12,0,0,0-6.3,6.3l-24,56A12,12,0,0,0,92.73,179l56-24a12,12,0,0,0,6.3-6.3l24-56A12,12,0,0,0,163.27,77Zm-28.41,57.89-24,10.29,10.29-24,24-10.29Z`}))],[`duotone`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M128,32a96,96,0,1,0,96,96A96,96,0,0,0,128,32Zm16,112L80,176l32-64,64-32Z`,opacity:`0.2`}),l.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216ZM172.42,72.84l-64,32a8.05,8.05,0,0,0-3.58,3.58l-32,64A8,8,0,0,0,80,184a8.1,8.1,0,0,0,3.58-.84l64-32a8.05,8.05,0,0,0,3.58-3.58l32-64a8,8,0,0,0-10.74-10.74ZM138,138,97.89,158.11,118,118l40.15-20.07Z`}))],[`fill`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm51.58,57.79-32,64a4.08,4.08,0,0,1-1.79,1.79l-64,32a4,4,0,0,1-5.37-5.37l32-64a4.08,4.08,0,0,1,1.79-1.79l64-32A4,4,0,0,1,179.58,81.79Z`}))],[`light`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218ZM173.32,74.63l-64,32a6,6,0,0,0-2.69,2.69l-32,64A6,6,0,0,0,80,182a6.06,6.06,0,0,0,2.68-.63l64-32a6,6,0,0,0,2.69-2.69l32-64a6,6,0,0,0-8.05-8.05Zm-33.79,64.9L93.42,162.58l23-46.11,46.11-23Z`}))],[`regular`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216ZM172.42,72.84l-64,32a8.05,8.05,0,0,0-3.58,3.58l-32,64A8,8,0,0,0,80,184a8.1,8.1,0,0,0,3.58-.84l64-32a8.05,8.05,0,0,0,3.58-3.58l32-64a8,8,0,0,0-10.74-10.74ZM138,138,97.89,158.11,118,118l40.15-20.07Z`}))],[`thin`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220ZM174.21,76.42l-64,32a4.08,4.08,0,0,0-1.79,1.79l-32,64A4,4,0,0,0,80,180a4.05,4.05,0,0,0,1.79-.42l64-32a4.08,4.08,0,0,0,1.79-1.79l32-64a4,4,0,0,0-5.37-5.37ZM141,141l-52.08,26L115,115l52.08-26Z`}))]]),VC=new Map([[`bold`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M252,152a12,12,0,0,1-12,12H228v12a12,12,0,0,1-24,0V164H192a12,12,0,0,1,0-24h12V128a12,12,0,0,1,24,0v12h12A12,12,0,0,1,252,152ZM56,76H68V88a12,12,0,0,0,24,0V76h12a12,12,0,1,0,0-24H92V40a12,12,0,0,0-24,0V52H56a12,12,0,0,0,0,24ZM184,188h-4v-4a12,12,0,0,0-24,0v4h-4a12,12,0,0,0,0,24h4v4a12,12,0,0,0,24,0v-4h4a12,12,0,0,0,0-24ZM222.14,82.83,82.82,222.14a20,20,0,0,1-28.28,0L33.85,201.46a20,20,0,0,1,0-28.29L173.17,33.86a20,20,0,0,1,28.28,0l20.69,20.68A20,20,0,0,1,222.14,82.83ZM159,112,144,97,53.65,187.31l15,15Zm43.31-43.31-15-15L161,80l15,15Z`}))],[`duotone`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M176,112,74.34,213.66a8,8,0,0,1-11.31,0L42.34,193a8,8,0,0,1,0-11.31L144,80Z`,opacity:`0.2`}),l.createElement(`path`,{d:`M248,152a8,8,0,0,1-8,8H224v16a8,8,0,0,1-16,0V160H192a8,8,0,0,1,0-16h16V128a8,8,0,0,1,16,0v16h16A8,8,0,0,1,248,152ZM56,72H72V88a8,8,0,0,0,16,0V72h16a8,8,0,0,0,0-16H88V40a8,8,0,0,0-16,0V56H56a8,8,0,0,0,0,16ZM184,192h-8v-8a8,8,0,0,0-16,0v8h-8a8,8,0,0,0,0,16h8v8a8,8,0,0,0,16,0v-8h8a8,8,0,0,0,0-16ZM219.31,80,80,219.31a16,16,0,0,1-22.62,0L36.68,198.63a16,16,0,0,1,0-22.63L176,36.69a16,16,0,0,1,22.63,0l20.68,20.68A16,16,0,0,1,219.31,80Zm-54.63,32L144,91.31l-96,96L68.68,208ZM208,68.69,187.31,48l-32,32L176,100.69Z`}))],[`fill`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M248,152a8,8,0,0,1-8,8H224v16a8,8,0,0,1-16,0V160H192a8,8,0,0,1,0-16h16V128a8,8,0,0,1,16,0v16h16A8,8,0,0,1,248,152ZM56,72H72V88a8,8,0,0,0,16,0V72h16a8,8,0,0,0,0-16H88V40a8,8,0,0,0-16,0V56H56a8,8,0,0,0,0,16ZM184,192h-8v-8a8,8,0,0,0-16,0v8h-8a8,8,0,0,0,0,16h8v8a8,8,0,0,0,16,0v-8h8a8,8,0,0,0,0-16ZM219.31,80,80,219.31a16,16,0,0,1-22.62,0L36.68,198.63a16,16,0,0,1,0-22.63L176,36.69a16,16,0,0,1,22.63,0l20.68,20.68A16,16,0,0,1,219.31,80ZM208,68.69,187.31,48l-32,32L176,100.69Z`}))],[`light`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M246,152a6,6,0,0,1-6,6H222v18a6,6,0,0,1-12,0V158H192a6,6,0,0,1,0-12h18V128a6,6,0,0,1,12,0v18h18A6,6,0,0,1,246,152ZM56,70H74V88a6,6,0,0,0,12,0V70h18a6,6,0,0,0,0-12H86V40a6,6,0,0,0-12,0V58H56a6,6,0,0,0,0,12ZM184,194H174V184a6,6,0,0,0-12,0v10H152a6,6,0,0,0,0,12h10v10a6,6,0,0,0,12,0V206h10a6,6,0,0,0,0-12ZM217.9,78.59,78.58,217.9a14,14,0,0,1-19.8,0L38.09,197.21a14,14,0,0,1,0-19.8L177.41,38.1a14,14,0,0,1,19.8,0L217.9,58.79A14,14,0,0,1,217.9,78.59ZM167.51,112,144,88.49,46.58,185.9a2,2,0,0,0,0,2.83l20.69,20.68a2,2,0,0,0,2.82,0h0Zm41.9-44.73L188.73,46.59a2,2,0,0,0-2.83,0L152.48,80,176,103.52,209.41,70.1A2,2,0,0,0,209.41,67.27Z`}))],[`regular`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M48,64a8,8,0,0,1,8-8H72V40a8,8,0,0,1,16,0V56h16a8,8,0,0,1,0,16H88V88a8,8,0,0,1-16,0V72H56A8,8,0,0,1,48,64ZM184,192h-8v-8a8,8,0,0,0-16,0v8h-8a8,8,0,0,0,0,16h8v8a8,8,0,0,0,16,0v-8h8a8,8,0,0,0,0-16Zm56-48H224V128a8,8,0,0,0-16,0v16H192a8,8,0,0,0,0,16h16v16a8,8,0,0,0,16,0V160h16a8,8,0,0,0,0-16ZM219.31,80,80,219.31a16,16,0,0,1-22.62,0L36.68,198.63a16,16,0,0,1,0-22.63L176,36.69a16,16,0,0,1,22.63,0l20.68,20.68A16,16,0,0,1,219.31,80Zm-54.63,32L144,91.31l-96,96L68.68,208ZM208,68.69,187.31,48l-32,32L176,100.69Z`}))],[`thin`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M244,152a4,4,0,0,1-4,4H220v20a4,4,0,0,1-8,0V156H192a4,4,0,0,1,0-8h20V128a4,4,0,0,1,8,0v20h20A4,4,0,0,1,244,152ZM56,68H76V88a4,4,0,0,0,8,0V68h20a4,4,0,0,0,0-8H84V40a4,4,0,0,0-8,0V60H56a4,4,0,0,0,0,8ZM184,196H172V184a4,4,0,0,0-8,0v12H152a4,4,0,0,0,0,8h12v12a4,4,0,0,0,8,0V204h12a4,4,0,0,0,0-8ZM216.48,77.17,77.17,216.49a12,12,0,0,1-17,0L39.51,195.8a12,12,0,0,1,0-17L178.83,39.51a12,12,0,0,1,17,0L216.48,60.2A12,12,0,0,1,216.48,77.17ZM170.34,112,144,85.66,45.17,184.49a4,4,0,0,0,0,5.65l20.68,20.69a4,4,0,0,0,5.66,0Zm40.49-46.14L190.14,45.17a4,4,0,0,0-5.66,0L149.65,80,176,106.34l34.83-34.83A4,4,0,0,0,210.83,65.86Z`}))]]),HC=new Map([[`bold`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M234.49,111.07,90.41,22.94A20,20,0,0,0,60,39.87V216.13a20,20,0,0,0,30.41,16.93l144.08-88.13a19.82,19.82,0,0,0,0-33.86ZM84,208.85V47.15L216.16,128Z`}))],[`duotone`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M228.23,134.69,84.15,222.81A8,8,0,0,1,72,216.12V39.88a8,8,0,0,1,12.15-6.69l144.08,88.12A7.82,7.82,0,0,1,228.23,134.69Z`,opacity:`0.2`}),l.createElement(`path`,{d:`M232.4,114.49,88.32,26.35a16,16,0,0,0-16.2-.3A15.86,15.86,0,0,0,64,39.87V216.13A15.94,15.94,0,0,0,80,232a16.07,16.07,0,0,0,8.36-2.35L232.4,141.51a15.81,15.81,0,0,0,0-27ZM80,215.94V40l143.83,88Z`}))],[`fill`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M240,128a15.74,15.74,0,0,1-7.6,13.51L88.32,229.65a16,16,0,0,1-16.2.3A15.86,15.86,0,0,1,64,216.13V39.87a15.86,15.86,0,0,1,8.12-13.82,16,16,0,0,1,16.2.3L232.4,114.49A15.74,15.74,0,0,1,240,128Z`}))],[`light`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M231.36,116.19,87.28,28.06a14,14,0,0,0-14.18-.27A13.69,13.69,0,0,0,66,39.87V216.13a13.69,13.69,0,0,0,7.1,12.08,14,14,0,0,0,14.18-.27l144.08-88.13a13.82,13.82,0,0,0,0-23.62Zm-6.26,13.38L81,217.7a2,2,0,0,1-2.06,0,1.78,1.78,0,0,1-1-1.61V39.87a1.78,1.78,0,0,1,1-1.61A2.06,2.06,0,0,1,80,38a2,2,0,0,1,1,.31L225.1,126.43a1.82,1.82,0,0,1,0,3.14Z`}))],[`regular`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M232.4,114.49,88.32,26.35a16,16,0,0,0-16.2-.3A15.86,15.86,0,0,0,64,39.87V216.13A15.94,15.94,0,0,0,80,232a16.07,16.07,0,0,0,8.36-2.35L232.4,141.51a15.81,15.81,0,0,0,0-27ZM80,215.94V40l143.83,88Z`}))],[`thin`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M230.32,117.9,86.24,29.79a11.91,11.91,0,0,0-12.17-.23A11.71,11.71,0,0,0,68,39.89V216.11a11.71,11.71,0,0,0,6.07,10.33,11.91,11.91,0,0,0,12.17-.23L230.32,138.1a11.82,11.82,0,0,0,0-20.2Zm-4.18,13.37L82.06,219.39a4,4,0,0,1-4.07.07,3.77,3.77,0,0,1-2-3.35V39.89a3.77,3.77,0,0,1,2-3.35,4,4,0,0,1,4.07.07l144.08,88.12a3.8,3.8,0,0,1,0,6.54Z`}))]]),UC=new Map([[`bold`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M228,128a12,12,0,0,1-12,12H140v76a12,12,0,0,1-24,0V140H40a12,12,0,0,1,0-24h76V40a12,12,0,0,1,24,0v76h76A12,12,0,0,1,228,128Z`}))],[`duotone`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`,opacity:`0.2`}),l.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z`}))],[`fill`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM184,136H136v48a8,8,0,0,1-16,0V136H72a8,8,0,0,1,0-16h48V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z`}))],[`light`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M222,128a6,6,0,0,1-6,6H134v82a6,6,0,0,1-12,0V134H40a6,6,0,0,1,0-12h82V40a6,6,0,0,1,12,0v82h82A6,6,0,0,1,222,128Z`}))],[`regular`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z`}))],[`thin`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M220,128a4,4,0,0,1-4,4H132v84a4,4,0,0,1-8,0V132H40a4,4,0,0,1,0-8h84V40a4,4,0,0,1,8,0v84h84A4,4,0,0,1,220,128Z`}))]]),WC=new Map([[`bold`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M208,28H48A20,20,0,0,0,28,48V208a20,20,0,0,0,20,20H208a20,20,0,0,0,20-20V48A20,20,0,0,0,208,28Zm-4,176H52V52H204Z`}))],[`duotone`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M216,48V208a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V48a8,8,0,0,1,8-8H208A8,8,0,0,1,216,48Z`,opacity:`0.2`}),l.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,176H48V48H208V208Z`}))],[`fill`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M224,48V208a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V48A16,16,0,0,1,48,32H208A16,16,0,0,1,224,48Z`}))],[`light`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M208,34H48A14,14,0,0,0,34,48V208a14,14,0,0,0,14,14H208a14,14,0,0,0,14-14V48A14,14,0,0,0,208,34Zm2,174a2,2,0,0,1-2,2H48a2,2,0,0,1-2-2V48a2,2,0,0,1,2-2H208a2,2,0,0,1,2,2Z`}))],[`regular`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,176H48V48H208V208Z`}))],[`thin`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M208,36H48A12,12,0,0,0,36,48V208a12,12,0,0,0,12,12H208a12,12,0,0,0,12-12V48A12,12,0,0,0,208,36Zm4,172a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V48a4,4,0,0,1,4-4H208a4,4,0,0,1,4,4Z`}))]]),GC=new Map([[`bold`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M243,96a20.33,20.33,0,0,0-17.74-14l-56.59-4.57L146.83,24.62a20.36,20.36,0,0,0-37.66,0L87.35,77.44,30.76,82A20.45,20.45,0,0,0,19.1,117.88l43.18,37.24-13.2,55.7A20.37,20.37,0,0,0,79.57,233L128,203.19,176.43,233a20.39,20.39,0,0,0,30.49-22.15l-13.2-55.7,43.18-37.24A20.43,20.43,0,0,0,243,96ZM172.53,141.7a12,12,0,0,0-3.84,11.86L181.58,208l-47.29-29.08a12,12,0,0,0-12.58,0L74.42,208l12.89-54.4a12,12,0,0,0-3.84-11.86L41.2,105.24l55.4-4.47a12,12,0,0,0,10.13-7.38L128,41.89l21.27,51.5a12,12,0,0,0,10.13,7.38l55.4,4.47Z`}))],[`duotone`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M229.06,108.79l-48.7,42,14.88,62.79a8.4,8.4,0,0,1-12.52,9.17L128,189.09,73.28,222.74a8.4,8.4,0,0,1-12.52-9.17l14.88-62.79-48.7-42A8.46,8.46,0,0,1,31.73,94L95.64,88.8l24.62-59.6a8.36,8.36,0,0,1,15.48,0l24.62,59.6L224.27,94A8.46,8.46,0,0,1,229.06,108.79Z`,opacity:`0.2`}),l.createElement(`path`,{d:`M239.18,97.26A16.38,16.38,0,0,0,224.92,86l-59-4.76L143.14,26.15a16.36,16.36,0,0,0-30.27,0L90.11,81.23,31.08,86a16.46,16.46,0,0,0-9.37,28.86l45,38.83L53,211.75a16.38,16.38,0,0,0,24.5,17.82L128,198.49l50.53,31.08A16.4,16.4,0,0,0,203,211.75l-13.76-58.07,45-38.83A16.43,16.43,0,0,0,239.18,97.26Zm-15.34,5.47-48.7,42a8,8,0,0,0-2.56,7.91l14.88,62.8a.37.37,0,0,1-.17.48c-.18.14-.23.11-.38,0l-54.72-33.65a8,8,0,0,0-8.38,0L69.09,215.94c-.15.09-.19.12-.38,0a.37.37,0,0,1-.17-.48l14.88-62.8a8,8,0,0,0-2.56-7.91l-48.7-42c-.12-.1-.23-.19-.13-.5s.18-.27.33-.29l63.92-5.16A8,8,0,0,0,103,91.86l24.62-59.61c.08-.17.11-.25.35-.25s.27.08.35.25L153,91.86a8,8,0,0,0,6.75,4.92l63.92,5.16c.15,0,.24,0,.33.29S224,102.63,223.84,102.73Z`}))],[`fill`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M234.29,114.85l-45,38.83L203,211.75a16.4,16.4,0,0,1-24.5,17.82L128,198.49,77.47,229.57A16.4,16.4,0,0,1,53,211.75l13.76-58.07-45-38.83A16.46,16.46,0,0,1,31.08,86l59-4.76,22.76-55.08a16.36,16.36,0,0,1,30.27,0l22.75,55.08,59,4.76a16.46,16.46,0,0,1,9.37,28.86Z`}))],[`light`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M237.28,97.87A14.18,14.18,0,0,0,224.76,88l-60.25-4.87-23.22-56.2a14.37,14.37,0,0,0-26.58,0L91.49,83.11,31.24,88a14.18,14.18,0,0,0-12.52,9.89A14.43,14.43,0,0,0,23,113.32L69,152.93l-14,59.25a14.4,14.4,0,0,0,5.59,15,14.1,14.1,0,0,0,15.91.6L128,196.12l51.58,31.71a14.1,14.1,0,0,0,15.91-.6,14.4,14.4,0,0,0,5.59-15l-14-59.25L233,113.32A14.43,14.43,0,0,0,237.28,97.87Zm-12.14,6.37-48.69,42a6,6,0,0,0-1.92,5.92l14.88,62.79a2.35,2.35,0,0,1-.95,2.57,2.24,2.24,0,0,1-2.6.1L131.14,184a6,6,0,0,0-6.28,0L70.14,217.61a2.24,2.24,0,0,1-2.6-.1,2.35,2.35,0,0,1-1-2.57l14.88-62.79a6,6,0,0,0-1.92-5.92l-48.69-42a2.37,2.37,0,0,1-.73-2.65,2.28,2.28,0,0,1,2.07-1.65l63.92-5.16a6,6,0,0,0,5.06-3.69l24.63-59.6a2.35,2.35,0,0,1,4.38,0l24.63,59.6a6,6,0,0,0,5.06,3.69l63.92,5.16a2.28,2.28,0,0,1,2.07,1.65A2.37,2.37,0,0,1,225.14,104.24Z`}))],[`regular`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M239.18,97.26A16.38,16.38,0,0,0,224.92,86l-59-4.76L143.14,26.15a16.36,16.36,0,0,0-30.27,0L90.11,81.23,31.08,86a16.46,16.46,0,0,0-9.37,28.86l45,38.83L53,211.75a16.38,16.38,0,0,0,24.5,17.82L128,198.49l50.53,31.08A16.4,16.4,0,0,0,203,211.75l-13.76-58.07,45-38.83A16.43,16.43,0,0,0,239.18,97.26Zm-15.34,5.47-48.7,42a8,8,0,0,0-2.56,7.91l14.88,62.8a.37.37,0,0,1-.17.48c-.18.14-.23.11-.38,0l-54.72-33.65a8,8,0,0,0-8.38,0L69.09,215.94c-.15.09-.19.12-.38,0a.37.37,0,0,1-.17-.48l14.88-62.8a8,8,0,0,0-2.56-7.91l-48.7-42c-.12-.1-.23-.19-.13-.5s.18-.27.33-.29l63.92-5.16A8,8,0,0,0,103,91.86l24.62-59.61c.08-.17.11-.25.35-.25s.27.08.35.25L153,91.86a8,8,0,0,0,6.75,4.92l63.92,5.16c.15,0,.24,0,.33.29S224,102.63,223.84,102.73Z`}))],[`thin`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M235.36,98.49A12.21,12.21,0,0,0,224.59,90l-61.47-5L139.44,27.67a12.37,12.37,0,0,0-22.88,0L92.88,85,31.41,90a12.45,12.45,0,0,0-7.07,21.84l46.85,40.41L56.87,212.64a12.35,12.35,0,0,0,18.51,13.49L128,193.77l52.62,32.36a12.12,12.12,0,0,0,13.69-.51,12.28,12.28,0,0,0,4.82-13l-14.32-60.42,46.85-40.41A12.29,12.29,0,0,0,235.36,98.49Zm-8.93,7.26-48.68,42a4,4,0,0,0-1.28,3.95l14.87,62.79a4.37,4.37,0,0,1-1.72,4.65,4.24,4.24,0,0,1-4.81.18L130.1,185.67a4,4,0,0,0-4.2,0L71.19,219.32a4.24,4.24,0,0,1-4.81-.18,4.37,4.37,0,0,1-1.72-4.65L79.53,151.7a4,4,0,0,0-1.28-3.95l-48.68-42A4.37,4.37,0,0,1,28.25,101a4.31,4.31,0,0,1,3.81-3L96,92.79a4,4,0,0,0,3.38-2.46L124,30.73a4.35,4.35,0,0,1,8.08,0l24.62,59.6A4,4,0,0,0,160,92.79l63.9,5.15a4.31,4.31,0,0,1,3.81,3A4.37,4.37,0,0,1,226.43,105.75Z`}))]]),KC=new Map([[`bold`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M200,36H56A20,20,0,0,0,36,56V200a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V56A20,20,0,0,0,200,36Zm-4,160H60V60H196Z`}))],[`duotone`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M208,56V200a8,8,0,0,1-8,8H56a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H200A8,8,0,0,1,208,56Z`,opacity:`0.2`}),l.createElement(`path`,{d:`M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z`}))],[`fill`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`}))],[`light`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M200,42H56A14,14,0,0,0,42,56V200a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V56A14,14,0,0,0,200,42Zm2,158a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V56a2,2,0,0,1,2-2H200a2,2,0,0,1,2,2Z`}))],[`regular`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z`}))],[`thin`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M200,44H56A12,12,0,0,0,44,56V200a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V56A12,12,0,0,0,200,44Zm4,156a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V56a4,4,0,0,1,4-4H200a4,4,0,0,1,4,4Z`}))]]),qC=new Map([[`bold`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M216,48H180V36A28,28,0,0,0,152,8H104A28,28,0,0,0,76,36V48H40a12,12,0,0,0,0,24h4V208a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V72h4a12,12,0,0,0,0-24ZM100,36a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4V48H100Zm88,168H68V72H188ZM116,104v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Zm48,0v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Z`}))],[`duotone`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z`,opacity:`0.2`}),l.createElement(`path`,{d:`M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z`}))],[`fill`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM112,168a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm0-120H96V40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8Z`}))],[`light`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M216,50H174V40a22,22,0,0,0-22-22H104A22,22,0,0,0,82,40V50H40a6,6,0,0,0,0,12H50V208a14,14,0,0,0,14,14H192a14,14,0,0,0,14-14V62h10a6,6,0,0,0,0-12ZM94,40a10,10,0,0,1,10-10h48a10,10,0,0,1,10,10V50H94ZM194,208a2,2,0,0,1-2,2H64a2,2,0,0,1-2-2V62H194ZM110,104v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Zm48,0v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Z`}))],[`regular`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z`}))],[`thin`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M216,52H172V40a20,20,0,0,0-20-20H104A20,20,0,0,0,84,40V52H40a4,4,0,0,0,0,8H52V208a12,12,0,0,0,12,12H192a12,12,0,0,0,12-12V60h12a4,4,0,0,0,0-8ZM92,40a12,12,0,0,1,12-12h48a12,12,0,0,1,12,12V52H92ZM196,208a4,4,0,0,1-4,4H64a4,4,0,0,1-4-4V60H196ZM108,104v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Zm48,0v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Z`}))]]),JC=new Map([[`bold`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M160,116h48a20,20,0,0,0,20-20V48a20,20,0,0,0-20-20H160a20,20,0,0,0-20,20V60H128a28,28,0,0,0-28,28v28H76v-4A20,20,0,0,0,56,92H24A20,20,0,0,0,4,112v32a20,20,0,0,0,20,20H56a20,20,0,0,0,20-20v-4h24v28a28,28,0,0,0,28,28h12v12a20,20,0,0,0,20,20h48a20,20,0,0,0,20-20V160a20,20,0,0,0-20-20H160a20,20,0,0,0-20,20v12H128a4,4,0,0,1-4-4V88a4,4,0,0,1,4-4h12V96A20,20,0,0,0,160,116ZM52,140H28V116H52Zm112,24h40v40H164Zm0-112h40V92H164Z`}))],[`duotone`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M64,112v32a8,8,0,0,1-8,8H24a8,8,0,0,1-8-8V112a8,8,0,0,1,8-8H56A8,8,0,0,1,64,112ZM208,40H160a8,8,0,0,0-8,8V96a8,8,0,0,0,8,8h48a8,8,0,0,0,8-8V48A8,8,0,0,0,208,40Zm0,112H160a8,8,0,0,0-8,8v48a8,8,0,0,0,8,8h48a8,8,0,0,0,8-8V160A8,8,0,0,0,208,152Z`,opacity:`0.2`}),l.createElement(`path`,{d:`M160,112h48a16,16,0,0,0,16-16V48a16,16,0,0,0-16-16H160a16,16,0,0,0-16,16V64H128a24,24,0,0,0-24,24v32H72v-8A16,16,0,0,0,56,96H24A16,16,0,0,0,8,112v32a16,16,0,0,0,16,16H56a16,16,0,0,0,16-16v-8h32v32a24,24,0,0,0,24,24h16v16a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V160a16,16,0,0,0-16-16H160a16,16,0,0,0-16,16v16H128a8,8,0,0,1-8-8V88a8,8,0,0,1,8-8h16V96A16,16,0,0,0,160,112ZM56,144H24V112H56v32Zm104,16h48v48H160Zm0-112h48V96H160Z`}))],[`fill`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M144,96V80H128a8,8,0,0,0-8,8v80a8,8,0,0,0,8,8h16V160a16,16,0,0,1,16-16h48a16,16,0,0,1,16,16v48a16,16,0,0,1-16,16H160a16,16,0,0,1-16-16V192H128a24,24,0,0,1-24-24V136H72v8a16,16,0,0,1-16,16H24A16,16,0,0,1,8,144V112A16,16,0,0,1,24,96H56a16,16,0,0,1,16,16v8h32V88a24,24,0,0,1,24-24h16V48a16,16,0,0,1,16-16h48a16,16,0,0,1,16,16V96a16,16,0,0,1-16,16H160A16,16,0,0,1,144,96Z`}))],[`light`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M160,110h48a14,14,0,0,0,14-14V48a14,14,0,0,0-14-14H160a14,14,0,0,0-14,14V66H128a22,22,0,0,0-22,22v34H70V112A14,14,0,0,0,56,98H24a14,14,0,0,0-14,14v32a14,14,0,0,0,14,14H56a14,14,0,0,0,14-14V134h36v34a22,22,0,0,0,22,22h18v18a14,14,0,0,0,14,14h48a14,14,0,0,0,14-14V160a14,14,0,0,0-14-14H160a14,14,0,0,0-14,14v18H128a10,10,0,0,1-10-10V88a10,10,0,0,1,10-10h18V96A14,14,0,0,0,160,110ZM58,144a2,2,0,0,1-2,2H24a2,2,0,0,1-2-2V112a2,2,0,0,1,2-2H56a2,2,0,0,1,2,2Zm100,16a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2v48a2,2,0,0,1-2,2H160a2,2,0,0,1-2-2Zm0-112a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2V96a2,2,0,0,1-2,2H160a2,2,0,0,1-2-2Z`}))],[`regular`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M160,112h48a16,16,0,0,0,16-16V48a16,16,0,0,0-16-16H160a16,16,0,0,0-16,16V64H128a24,24,0,0,0-24,24v32H72v-8A16,16,0,0,0,56,96H24A16,16,0,0,0,8,112v32a16,16,0,0,0,16,16H56a16,16,0,0,0,16-16v-8h32v32a24,24,0,0,0,24,24h16v16a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V160a16,16,0,0,0-16-16H160a16,16,0,0,0-16,16v16H128a8,8,0,0,1-8-8V88a8,8,0,0,1,8-8h16V96A16,16,0,0,0,160,112ZM56,144H24V112H56v32Zm104,16h48v48H160Zm0-112h48V96H160Z`}))],[`thin`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M160,108h48a12,12,0,0,0,12-12V48a12,12,0,0,0-12-12H160a12,12,0,0,0-12,12V68H128a20,20,0,0,0-20,20v36H68V112a12,12,0,0,0-12-12H24a12,12,0,0,0-12,12v32a12,12,0,0,0,12,12H56a12,12,0,0,0,12-12V132h40v36a20,20,0,0,0,20,20h20v20a12,12,0,0,0,12,12h48a12,12,0,0,0,12-12V160a12,12,0,0,0-12-12H160a12,12,0,0,0-12,12v20H128a12,12,0,0,1-12-12V88a12,12,0,0,1,12-12h20V96A12,12,0,0,0,160,108ZM60,144a4,4,0,0,1-4,4H24a4,4,0,0,1-4-4V112a4,4,0,0,1,4-4H56a4,4,0,0,1,4,4Zm96,16a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4v48a4,4,0,0,1-4,4H160a4,4,0,0,1-4-4Zm0-112a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4V96a4,4,0,0,1-4,4H160a4,4,0,0,1-4-4Z`}))]]),YC=new Map([[`bold`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z`}))],[`duotone`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`,opacity:`0.2`}),l.createElement(`path`,{d:`M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`fill`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`light`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z`}))],[`regular`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`thin`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z`}))]]),XC=(0,l.createContext)({color:`currentColor`,size:`1em`,weight:`regular`,mirrored:!1}),ZC=l.forwardRef((e,t)=>{let{alt:n,color:r,size:i,weight:a,mirrored:o,children:s,weights:c,...u}=e,{color:d=`currentColor`,size:f,weight:p=`regular`,mirrored:m=!1,...h}=l.useContext(XC);return l.createElement(`svg`,{ref:t,xmlns:`http://www.w3.org/2000/svg`,width:i??f,height:i??f,fill:r??d,viewBox:`0 0 256 256`,transform:o||m?`scale(-1, 1)`:void 0,...h,...u},!!n&&l.createElement(`title`,null,n),s,c.get(a??p))});ZC.displayName=`IconBase`;var QC=l.forwardRef((e,t)=>l.createElement(ZC,{ref:t,...e,weights:LC}));QC.displayName=`CaretRightIcon`;var $C=QC,ew=l.forwardRef((e,t)=>l.createElement(ZC,{ref:t,...e,weights:RC}));ew.displayName=`CheckSquareIcon`;var tw=ew,nw=l.forwardRef((e,t)=>l.createElement(ZC,{ref:t,...e,weights:zC}));nw.displayName=`ClockCounterClockwiseIcon`;var rw=nw,iw=l.forwardRef((e,t)=>l.createElement(ZC,{ref:t,...e,weights:BC}));iw.displayName=`CompassIcon`;var aw=iw,ow=l.forwardRef((e,t)=>l.createElement(ZC,{ref:t,...e,weights:VC}));ow.displayName=`MagicWandIcon`;var sw=ow,cw=l.forwardRef((e,t)=>l.createElement(ZC,{ref:t,...e,weights:HC}));cw.displayName=`PlayIcon`;var lw=cw,uw=l.forwardRef((e,t)=>l.createElement(ZC,{ref:t,...e,weights:UC}));uw.displayName=`PlusIcon`;var dw=uw,fw=l.forwardRef((e,t)=>l.createElement(ZC,{ref:t,...e,weights:WC}));fw.displayName=`SquareIcon`;var pw=fw,mw=l.forwardRef((e,t)=>l.createElement(ZC,{ref:t,...e,weights:GC}));mw.displayName=`StarIcon`;var hw=mw,gw=l.forwardRef((e,t)=>l.createElement(ZC,{ref:t,...e,weights:KC}));gw.displayName=`StopIcon`;var _w=gw,vw=l.forwardRef((e,t)=>l.createElement(ZC,{ref:t,...e,weights:qC}));vw.displayName=`TrashIcon`;var yw=vw,bw=l.forwardRef((e,t)=>l.createElement(ZC,{ref:t,...e,weights:JC}));bw.displayName=`TreeStructureIcon`;var xw=bw,Sw=l.forwardRef((e,t)=>l.createElement(ZC,{ref:t,...e,weights:YC}));Sw.displayName=`XIcon`;var Cw=Sw;function ww(){let{schema:e}=Dt();return{schema:h(e,e=>e.schema),isLoading:h(e,e=>e.isLoading),error:h(e,e=>e.error)}}function Tw(e){return(0,d.isNonNullType)(e)||(0,d.isListType)(e)?Tw(e.ofType):e}function Ew(e){return(0,d.isNonNullType)(e)?`${Ew(e.ofType)}!`:(0,d.isListType)(e)?`[${Ew(e.ofType)}]`:e.name}function Dw(e){let t=Tw(e);return(0,d.isScalarType)(t)||(0,d.isEnumType)(t)}function Ow(e,t,n,r=``){let i=[];for(let[a,o]of Object.entries(e)){let e=n?`${n}.${a}`:a,s=t[e],c=``;if(s){let e=Object.entries(s).filter(([,e])=>e.enabled);e.length>0&&(c=`(${e.map(([e])=>`${e}: $${e}`).join(`, `)})`)}o===!0?i.push(`${r} ${a}${c}`):(i.push(`${r} ${a}${c} {`),i.push(Ow(o,t,e,r+` `)),i.push(`${r} }`))}return i.join(`
|
|
25
|
+
`)}function kw(e){let t=[],n=new Set;for(let r of Object.values(e))for(let[e,i]of Object.entries(r))i.enabled&&!n.has(e)&&(n.add(e),t.push({name:e,type:i.type,value:i.value}));return t}function Aw(e,t,n){if(Object.keys(t).length===0)return{query:``,variables:{}};let r=kw(n),i=Ow(t,n,``),a=e;r.length>0&&(a=`${e} (${r.map(e=>`$${e.name}: ${e.type}`).join(`, `)})`);let o=`${a} {\n${i}\n}`,s={};for(let e of r)e.value===``?s[e.name]=null:e.value===`true`?s[e.name]=!0:e.value===`false`?s[e.name]=!1:/^\d+$/.test(e.value)?s[e.name]=Number.parseInt(e.value,10):/^\d+\.\d+$/.test(e.value)?s[e.name]=Number.parseFloat(e.value):s[e.name]=e.value;return{query:o,variables:s}}function jw({arg:e,enabled:t,value:n,onToggle:r,onChange:i}){let a=Tw(e.type),o=(0,d.isNonNullType)(e.type),s=(0,d.isEnumType)(a)?a.getValues().map(e=>e.name).join(` | `):a.name??`value`;return(0,u.jsxs)(`div`,{className:`flex items-center gap-1 ml-5 py-0.5`,children:[(0,u.jsx)(`button`,{type:`button`,onClick:r,className:`flex items-center justify-center w-3 h-3 flex-shrink-0`,children:t?(0,u.jsx)(tw,{size:12,weight:`fill`,className:`text-gq-syn-variable`}):(0,u.jsx)(pw,{size:12,className:`text-gq-text-tertiary`})}),(0,u.jsxs)(`span`,{className:E(`text-[11px] font-gq-mono flex-shrink-0`,t?`text-gq-syn-variable`:`text-gq-text-tertiary`),children:[`$`,e.name]}),(0,u.jsxs)(`span`,{className:`text-[10px] font-gq-mono text-gq-text-tertiary flex-shrink-0`,children:[Ew(e.type),o&&(0,u.jsx)(`span`,{className:`text-gq-error`,children:`*`})]}),t&&((0,d.isEnumType)(a)?(0,u.jsxs)(`select`,{value:n,onChange:e=>i(e.target.value),className:`bg-gq-bg border border-gq-border rounded-[3px] px-1 py-0 text-[11px] font-gq-mono text-gq-text focus:outline-none focus:border-gq-accent/50`,children:[(0,u.jsx)(`option`,{value:``,children:`—`}),a.getValues().map(e=>(0,u.jsx)(`option`,{value:e.name,children:e.name},e.name))]}):(0,u.jsx)(`input`,{type:`text`,value:n,onChange:e=>i(e.target.value),placeholder:s,className:`flex-1 bg-gq-bg border border-gq-border rounded-[3px] px-1 py-0 text-[11px] font-gq-mono text-gq-text placeholder:text-gq-text-tertiary focus:outline-none focus:border-gq-accent/50 min-w-0 max-w-[80px]`}))]})}function Mw({field:e,depth:t,fieldPath:n,selections:r,argSelections:i,onToggle:a,onToggleArg:o,onSetArgValue:s}){let[c,f]=(0,l.useState)(!1),p=Tw(e.type),m=Dw(e.type),h=e.name in r,g=e.args.length>0,_=e.args.some(e=>(0,d.isNonNullType)(e.type)),v=()=>{if(m)a([e.name],!0);else{if(!c&&_&&!h)for(let t of e.args)(0,d.isNonNullType)(t.type)&&o(n,t);f(!c),h||a([e.name],!1)}},y=(0,d.isObjectType)(p)||(0,d.isInputObjectType)(p)?Object.values(p.getFields()):null,ee=typeof r[e.name]==`object`?r[e.name]:{},b=i[n];return(0,u.jsxs)(`li`,{children:[(0,u.jsxs)(`div`,{className:E(`flex items-center gap-1 py-[2px] cursor-pointer group`,`hover:bg-gq-bg-elevated transition-colors`),style:{paddingLeft:t*12+4},children:[m?(0,u.jsx)(`button`,{type:`button`,onClick:v,className:`flex items-center justify-center w-4 h-4`,children:h?(0,u.jsx)(tw,{size:14,weight:`fill`,className:`text-gq-accent`}):(0,u.jsx)(pw,{size:14,className:`text-gq-text-tertiary group-hover:text-gq-text-secondary`})}):(0,u.jsx)(`button`,{type:`button`,onClick:v,className:`flex items-center justify-center w-4 h-4`,children:(0,u.jsx)($C,{size:9,className:E(`text-gq-text-tertiary transition-transform`,c&&`rotate-90`)})}),(0,u.jsx)(`button`,{type:`button`,onClick:v,className:E(`text-xs font-gq-mono truncate`,h?`text-gq-text`:`text-gq-text-secondary`),children:e.name}),(0,u.jsx)(`span`,{className:`text-[10px] font-gq-mono text-gq-text-tertiary ml-auto mr-1 opacity-0 group-hover:opacity-100 transition-opacity`,children:p.name}),g&&(0,u.jsxs)(`span`,{className:E(`text-[10px] font-gq-mono px-0.5 rounded-[2px]`,_?`text-gq-warning`:`text-gq-text-tertiary`),children:[`(`,e.args.length,`)`]})]}),(h||c)&&g&&(0,u.jsx)(`div`,{style:{paddingLeft:t*12+4},children:e.args.map(e=>(0,u.jsx)(jw,{arg:e,enabled:b?.[e.name]?.enabled??!1,value:b?.[e.name]?.value??``,onToggle:()=>o(n,e),onChange:t=>s(n,e.name,t)},e.name))}),c&&y&&(0,u.jsx)(`ul`,{children:y.map(r=>(0,u.jsx)(Mw,{field:r,depth:t+1,fieldPath:`${n}.${r.name}`,selections:ee,argSelections:i,onToggle:(t,n)=>a([e.name,...t],n),onToggleArg:o,onSetArgValue:s},r.name))})]})}function Nw({label:e,type:t,selections:n,argSelections:r,onToggle:i,onToggleArg:a,onSetArgValue:o}){let[s,c]=(0,l.useState)(e===`query`),d=Object.values(t.getFields());return(0,u.jsxs)(`div`,{children:[(0,u.jsxs)(`button`,{type:`button`,onClick:()=>c(!s),className:`flex items-center gap-1.5 w-full px-2 py-1 text-left hover:bg-gq-bg-elevated transition-colors`,children:[(0,u.jsx)($C,{size:9,className:E(`text-gq-text-tertiary transition-transform`,s&&`rotate-90`)}),(0,u.jsx)(`span`,{className:`text-xs font-gq-mono font-medium text-gq-accent`,children:e}),(0,u.jsx)(`span`,{className:`text-[10px] font-gq-mono text-gq-text-tertiary`,children:t.name})]}),s&&(0,u.jsx)(`ul`,{children:d.map(e=>(0,u.jsx)(Mw,{field:e,depth:1,fieldPath:e.name,selections:n,argSelections:r,onToggle:i,onToggleArg:a,onSetArgValue:o},e.name))})]})}function Pw({className:e}){let{schema:t,isLoading:n,error:r}=ww(),{editor:i}=Dt(),a=h(i,e=>e.setQuery),o=h(i,e=>e.setVariables),[s,c]=(0,l.useState)({query:{},mutation:{},subscription:{}}),[d,f]=(0,l.useState)({}),p=(0,l.useCallback)((e,t)=>{let n=[],r={};for(let i of[`query`,`mutation`,`subscription`])if(Object.keys(e[i]).length>0){let a=Aw(i,e[i],t);a.query&&(n.push(a.query),r={...r,...a.variables})}a(n.join(`
|
|
26
|
+
|
|
27
|
+
`)||``),Object.keys(r).length>0?o(JSON.stringify(r,null,2)):o(``)},[a,o]),m=(0,l.useCallback)((e,t,n)=>{c(r=>{let i={...r},a={...i[e]};i[e]=a;let o=a;for(let e=0;e<t.length-1;e++){let n=t[e];(!(n in o)||o[n]===!0)&&(o[n]={}),o[n]={...o[n]},o=o[n]}let s=t[t.length-1];n?s in o?delete o[s]:o[s]=!0:s in o?delete o[s]:o[s]={};let c=e=>{let t={};for(let[n,r]of Object.entries(e))if(r===!0)t[n]=!0;else{let e=c(r);Object.keys(e).length>0&&(t[n]=e)}return t};return i[e]=c(i[e]),p(i,d),i})},[d,p]),g=(0,l.useCallback)((e,t)=>{f(n=>{let r={...n},i={...r[e]??{}},a=i[t.name];return a?.enabled?i[t.name]={...a,enabled:!1}:i[t.name]={enabled:!0,value:a?.value??``,type:Ew(t.type)},r[e]=i,p(s,r),r})},[s,p]),_=(0,l.useCallback)((e,t,n)=>{f(r=>{let i={...r},a={...i[e]??{}},o=a[t];return o&&(a[t]={...o,value:n}),i[e]=a,p(s,i),i})},[s,p]);if(n)return(0,u.jsx)(`div`,{className:E(`flex items-center justify-center h-full text-gq-text-tertiary text-xs font-gq-mono`,e),children:`Loading schema...`});if(r||!t)return(0,u.jsx)(`div`,{className:E(`flex items-center justify-center h-full text-gq-text-tertiary text-xs font-gq-mono p-3`,e),children:r?.message??`No schema available`});let v=t.getQueryType(),y=t.getMutationType(),ee=t.getSubscriptionType();return(0,u.jsx)(`div`,{className:E(`flex flex-col h-full`,e),children:(0,u.jsxs)(`div`,{className:`flex-1 overflow-y-auto py-0.5`,children:[v&&(0,u.jsx)(Nw,{label:`query`,type:v,selections:s.query,argSelections:d,onToggle:(e,t)=>m(`query`,e,t),onToggleArg:g,onSetArgValue:_}),y&&(0,u.jsx)(Nw,{label:`mutation`,type:y,selections:s.mutation,argSelections:d,onToggle:(e,t)=>m(`mutation`,e,t),onToggleArg:g,onSetArgValue:_}),ee&&(0,u.jsx)(Nw,{label:`subscription`,type:ee,selections:s.subscription,argSelections:d,onToggle:(e,t)=>m(`subscription`,e,t),onToggleArg:g,onSetArgValue:_})]})})}function Fw(e){try{return(0,d.print)((0,d.parse)(e))}catch{return e}}function Iw(e){return p(t=>({query:e??``,variables:``,headers:``,setQuery:e=>t({query:e}),setVariables:e=>t({variables:e}),setHeaders:e=>t({headers:e}),prettify:()=>t(e=>({query:Fw(e.query)}))}))}function Lw(){return p((e,t)=>({response:null,isLoading:!1,error:null,duration:null,abortController:null,execute:async(n,r)=>{let i=t();i.abortController&&i.abortController.abort();let a=new AbortController;e({isLoading:!0,error:null,abortController:a});let o=performance.now();try{let t=await n(r,a.signal),i=Math.round(performance.now()-o);e({response:JSON.stringify(t,null,2),isLoading:!1,duration:i,abortController:null})}catch(t){if(t.name===`AbortError`){e({isLoading:!1,abortController:null});return}e({error:t instanceof Error?t:Error(String(t)),isLoading:!1,duration:Math.round(performance.now()-o),abortController:null})}},cancel:()=>{let{abortController:n}=t();n&&(n.abort(),e({isLoading:!1,abortController:null}))}}))}var Rw=100;function zw(){return p(e=>({entries:[],addEntry:t=>e(e=>({entries:[{...t,id:crypto.randomUUID(),timestamp:Date.now(),favorite:!1},...e.entries].slice(0,Rw)})),removeEntry:t=>e(e=>({entries:e.entries.filter(e=>e.id!==t)})),toggleFavorite:t=>e(e=>({entries:e.entries.map(e=>e.id===t?{...e,favorite:!e.favorite}:e)})),clearHistory:()=>e(e=>({entries:e.entries.filter(e=>e.favorite)}))}))}async function Bw(e){let t=await e({query:(0,d.getIntrospectionQuery)()});if(`data`in t&&t.data)return(0,d.buildClientSchema)(t.data);let n=`errors`in t&&t.errors?t.errors.map(e=>e.message).join(`, `):`Unknown error`;throw Error(`Introspection failed: ${n}`)}function Vw(e){return p(t=>({schema:e??null,isLoading:!1,error:null,fetchSchema:async e=>{t({isLoading:!0,error:null});try{t({schema:await Bw(e),isLoading:!1})}catch(e){t({error:e instanceof Error?e:Error(String(e)),isLoading:!1})}},setSchema:e=>t({schema:e,error:null})}))}var Hw=0;function Uw(e){return Hw++,{id:crypto.randomUUID(),name:e??`Query ${Hw}`,query:``,variables:``,headers:``,response:null}}function Ww(e){let t=e?.length?e:[Uw()],n=t[0].id;return p((e,r)=>({tabs:t,activeTabId:n,addTab:()=>{let t=Uw();e(e=>({tabs:[...e.tabs,t],activeTabId:t.id}))},removeTab:t=>{let{tabs:n,activeTabId:i}=r();if(n.length<=1)return;let a=n.findIndex(e=>e.id===t),o=n.filter(e=>e.id!==t);e({tabs:o,activeTabId:i===t?o[Math.min(a,o.length-1)]?.id??o[0].id:i})},setActiveTab:t=>e({activeTabId:t}),updateTab:(t,n)=>e(e=>({tabs:e.tabs.map(e=>e.id===t?{...e,...n}:e)}))}))}function Gw(){return p(e=>({activeSidebarPanel:null,editorToolsTab:`variables`,toggleSidebarPanel:t=>e(e=>({activeSidebarPanel:e.activeSidebarPanel===t?null:t})),setEditorToolsTab:t=>e({editorToolsTab:t})}))}function Kw({endpoint:e,headers:t,defaultQuery:n,defaultTabs:r,schema:i,fetcher:a,storage:o,children:s}){let c=(0,l.useMemo)(()=>a??Tt(e,t),[a,e,t]),d=(0,l.useRef)(null);d.current||={editor:Iw(n),schema:Vw(i),execution:Lw(),tabs:Ww(r),history:zw(),ui:Gw()};let f=d.current;return(0,l.useEffect)(()=>{i||f.schema.getState().fetchSchema(c)},[i,c,f.schema]),(0,l.useEffect)(()=>{i&&f.schema.getState().setSchema(i)},[i,f.schema]),(0,u.jsx)(Et.Provider,{value:f,children:s})}function qw({className:e}){let{history:t,editor:n}=Dt(),r=h(t,e=>e.entries),i=h(t,e=>e.removeEntry),a=h(t,e=>e.toggleFavorite),o=h(t,e=>e.clearHistory),s=h(n,e=>e.setQuery),c=h(n,e=>e.setVariables),l=h(n,e=>e.setHeaders),d=e=>{s(e.query),c(e.variables),l(e.headers)};return(0,u.jsxs)(`div`,{className:E(`flex flex-col h-full`,e),children:[r.length>0&&(0,u.jsx)(`div`,{className:`flex items-center justify-end px-2 py-1 border-b border-gq-border`,children:(0,u.jsx)(`button`,{type:`button`,onClick:o,className:`text-[10px] font-gq-mono text-gq-text-tertiary hover:text-gq-error transition-colors`,children:`Clear`})}),(0,u.jsx)(`div`,{className:`flex-1 overflow-y-auto`,children:r.length===0?(0,u.jsx)(`div`,{className:`flex items-center justify-center h-full text-gq-text-tertiary text-[11px] font-gq-mono`,children:`No history`}):(0,u.jsx)(`ul`,{children:r.map(e=>(0,u.jsxs)(`li`,{className:`group relative border-b border-gq-border`,children:[(0,u.jsxs)(`button`,{type:`button`,onClick:()=>d(e),className:`w-full text-left px-2 py-1.5 hover:bg-gq-bg-elevated transition-colors`,children:[(0,u.jsx)(`pre`,{className:`text-[10px] font-gq-mono text-gq-text-secondary truncate leading-relaxed`,children:e.query.trim().slice(0,60)}),(0,u.jsx)(`span`,{className:`text-[9px] text-gq-text-tertiary font-gq-mono`,children:new Date(e.timestamp).toLocaleTimeString()})]}),(0,u.jsxs)(`div`,{className:`absolute right-1 top-1/2 -translate-y-1/2 hidden group-hover:flex gap-0.5`,children:[(0,u.jsx)(`button`,{type:`button`,onClick:()=>a(e.id),className:E(`p-0.5 transition-colors`,e.favorite?`text-gq-warning`:`text-gq-text-tertiary hover:text-gq-warning`),children:(0,u.jsx)(hw,{size:10,weight:e.favorite?`fill`:`regular`})}),(0,u.jsx)(`button`,{type:`button`,onClick:()=>i(e.id),className:`p-0.5 text-gq-text-tertiary hover:text-gq-error transition-colors`,children:(0,u.jsx)(yw,{size:10})})]})]},e.id))})})]})}function Jw(e){return(0,d.isNonNullType)(e)?`${Jw(e.ofType)}!`:(0,d.isListType)(e)?`[${Jw(e.ofType)}]`:e.name}function Yw({type:e}){let t=`text-gq-info`;(0,d.isScalarType)(e)&&(t=`text-gq-warning`),(0,d.isEnumType)(e)&&(t=`text-gq-syn-directive`),(0,d.isInputObjectType)(e)&&(t=`text-gq-syn-variable`),(0,d.isInterfaceType)(e)&&(t=`text-gq-accent`),(0,d.isUnionType)(e)&&(t=`text-gq-syn-string`);let n=`T`;return(0,d.isScalarType)(e)&&(n=`S`),(0,d.isEnumType)(e)&&(n=`E`),(0,d.isInputObjectType)(e)&&(n=`I`),(0,d.isInterfaceType)(e)&&(n=`IF`),(0,d.isUnionType)(e)&&(n=`U`),(0,u.jsx)(`span`,{className:E(`text-[9px] font-gq-mono`,t),children:n})}function Xw({field:e}){return(0,u.jsxs)(`div`,{className:`flex items-center gap-1.5 px-3 py-0.5 text-[11px]`,children:[(0,u.jsx)(`span`,{className:`text-gq-text font-gq-mono`,children:e.name}),(0,u.jsx)(`span`,{className:`text-gq-text-tertiary font-gq-mono text-[10px]`,children:Jw(e.type)})]})}function Zw({type:e}){let[t,n]=(0,l.useState)(!1),r=(0,d.isObjectType)(e)||(0,d.isInputObjectType)(e)||(0,d.isInterfaceType)(e)?Object.values(e.getFields()):null;return(0,u.jsxs)(`li`,{children:[(0,u.jsxs)(`button`,{type:`button`,onClick:()=>n(!t),className:`flex items-center gap-1.5 w-full px-2 py-1 text-left hover:bg-gq-bg-elevated transition-colors`,children:[r?(0,u.jsx)($C,{size:8,className:E(`text-gq-text-tertiary transition-transform`,t&&`rotate-90`)}):(0,u.jsx)(`span`,{className:`w-2`}),(0,u.jsx)(`span`,{className:`text-[11px] font-gq-mono text-gq-text`,children:e.name}),(0,u.jsx)(Yw,{type:e})]}),t&&r&&(0,u.jsx)(`ul`,{className:`ml-3 border-l border-gq-border`,children:r.map(e=>(0,u.jsx)(Xw,{field:e},e.name))})]})}function Qw({className:e}){let{schema:t,isLoading:n,error:r}=ww(),[i,a]=(0,l.useState)(``);if(n)return(0,u.jsx)(`div`,{className:E(`flex items-center justify-center h-full text-gq-text-tertiary text-[11px] font-gq-mono`,e),children:`Loading...`});if(r)return(0,u.jsx)(`div`,{className:E(`flex items-center justify-center h-full text-gq-error text-[11px] font-gq-mono p-3`,e),children:r.message});if(!t)return(0,u.jsx)(`div`,{className:E(`flex items-center justify-center h-full text-gq-text-tertiary text-[11px] font-gq-mono`,e),children:`No schema`});let o=t.getTypeMap(),s=Object.values(o).filter(e=>!e.name.startsWith(`__`)).filter(e=>!i||e.name.toLowerCase().includes(i.toLowerCase())).sort((e,t)=>e.name.localeCompare(t.name)),c=[t.getQueryType(),t.getMutationType(),t.getSubscriptionType()].filter(e=>e!=null),d=s.filter(e=>!c.some(t=>t.name===e.name));return(0,u.jsxs)(`div`,{className:E(`flex flex-col h-full`,e),children:[(0,u.jsx)(`div`,{className:`px-2 py-1.5 border-b border-gq-border`,children:(0,u.jsx)(`input`,{type:`text`,value:i,onChange:e=>a(e.target.value),placeholder:`Filter types...`,className:`w-full bg-gq-bg-secondary border border-gq-border rounded-gq px-1.5 py-0.5 text-[11px] font-gq-mono text-gq-text placeholder:text-gq-text-tertiary focus:outline-none focus:border-gq-accent/50`})}),(0,u.jsxs)(`ul`,{className:`flex-1 overflow-y-auto py-0.5`,children:[c.map(e=>(0,u.jsx)(Zw,{type:e},e.name)),c.length>0&&d.length>0&&(0,u.jsx)(`li`,{className:`border-t border-gq-border my-0.5`}),d.map(e=>(0,u.jsx)(Zw,{type:e},e.name))]})]})}function $w({icon:e,title:t,isActive:n,onClick:r}){return(0,u.jsx)(`button`,{type:`button`,onClick:r,title:t,className:E(`flex items-center justify-center w-7 h-7 rounded-[3px] transition-colors`,n?`text-gq-accent bg-gq-accent-subtle`:`text-gq-text-tertiary hover:text-gq-text-secondary`),children:e})}function eT({showHistory:e=!0,showSchemaExplorer:t=!0,plugins:n=[],className:r}){let{ui:i}=Dt(),a=h(i,e=>e.activeSidebarPanel),o=h(i,e=>e.toggleSidebarPanel);return(0,u.jsxs)(`div`,{className:E(Kt().sidebar(),r),style:{width:`var(--gq-sidebar-width)`},children:[(0,u.jsx)($w,{icon:(0,u.jsx)(aw,{size:16}),title:`Explorer`,isActive:a===`explorer`,onClick:()=>o(`explorer`)}),t&&(0,u.jsx)($w,{icon:(0,u.jsx)(xw,{size:16}),title:`Schema`,isActive:a===`schema`,onClick:()=>o(`schema`)}),e&&(0,u.jsx)($w,{icon:(0,u.jsx)(rw,{size:16}),title:`History`,isActive:a===`history`,onClick:()=>o(`history`)}),n.map(e=>(0,u.jsx)($w,{icon:e.icon??(0,u.jsx)(`span`,{className:`text-[9px] font-gq-mono`,children:e.name[0]}),title:e.title??e.name,isActive:a===e.name,onClick:()=>o(e.name)},e.name))]})}function tT({name:e,isActive:t,canClose:n,onClick:r,onClose:i}){return(0,u.jsxs)(`button`,{type:`button`,onClick:r,className:E(`group relative flex items-center gap-1 px-2.5 h-[var(--gq-toolbar-height)] text-[11px] font-gq-mono transition-colors`,t?`text-gq-text`:`text-gq-text-tertiary hover:text-gq-text-secondary`),children:[(0,u.jsx)(`span`,{children:e}),n&&(0,u.jsx)(`span`,{role:`button`,tabIndex:-1,onClick:e=>{e.stopPropagation(),i()},onKeyDown:e=>{e.key===`Enter`&&(e.stopPropagation(),i())},className:`opacity-0 group-hover:opacity-100 transition-opacity hover:text-gq-error`,children:(0,u.jsx)(Cw,{size:9})}),t&&(0,u.jsx)(`span`,{className:`absolute bottom-0 left-2.5 right-2.5 h-px bg-gq-accent`})]})}function nT({className:e}){let{tabs:t}=Dt(),n=h(t,e=>e.tabs),r=h(t,e=>e.activeTabId),i=h(t,e=>e.addTab),a=h(t,e=>e.removeTab),o=h(t,e=>e.setActiveTab);return(0,u.jsxs)(`div`,{className:E(Kt().tabs(),e),children:[n.map(e=>(0,u.jsx)(tT,{name:e.name,isActive:e.id===r,canClose:n.length>1,onClick:()=>o(e.id),onClose:()=>a(e.id)},e.id)),(0,u.jsx)(`button`,{type:`button`,onClick:i,className:`flex items-center justify-center w-6 h-6 text-gq-text-tertiary hover:text-gq-text-secondary transition-colors`,title:`New Tab`,children:(0,u.jsx)(dw,{size:10})})]})}function rT({isLoading:e,onExecute:t,onCancel:n,className:r}){let i=Kt();return(0,u.jsx)(`button`,{type:`button`,onClick:e?n:t,className:E(i.executeButton(),e&&`bg-gq-error hover:bg-gq-error/80`,r),title:e?`Cancel (Esc)`:`Execute (Ctrl+Enter)`,children:e?(0,u.jsx)(_w,{size:11,weight:`fill`}):(0,u.jsx)(lw,{size:11,weight:`fill`})})}function iT({onPrettify:e,className:t}){return(0,u.jsx)(`button`,{type:`button`,onClick:e,className:E(`inline-flex items-center justify-center p-1 rounded-gq text-gq-text-tertiary`,`transition-colors hover:text-gq-text-secondary hover:bg-gq-bg-elevated`,t),title:`Prettify (Ctrl+Shift+P)`,children:(0,u.jsx)(sw,{size:13})})}function aT({onExecute:e,className:t}){let{execution:n,editor:r}=Dt(),i=h(n,e=>e.isLoading),a=h(n,e=>e.cancel),o=h(r,e=>e.prettify),s=h(n,e=>e.duration);return(0,u.jsxs)(`div`,{className:E(Kt().toolbar(),t),style:{height:`var(--gq-toolbar-height)`},children:[(0,u.jsxs)(`div`,{className:`flex items-center gap-1.5 mr-auto`,children:[(0,u.jsx)(rT,{isLoading:i,onExecute:e,onCancel:a}),(0,u.jsx)(iT,{onPrettify:o})]}),s!==null&&(0,u.jsxs)(`span`,{className:`text-[10px] font-gq-mono text-gq-text-tertiary tabular-nums`,children:[s,`ms`]})]})}function oT({direction:e,first:t,second:n,defaultRatio:r=.5,minRatio:i=.2,maxRatio:a=.8,className:o}){let[s,c]=(0,l.useState)(r),d=(0,l.useRef)(null),f=(0,l.useRef)(!1),p=(0,l.useCallback)(t=>{t.preventDefault(),f.current=!0;let n=t.currentTarget;n.setPointerCapture(t.pointerId);let r=t=>{if(!f.current||!d.current)return;let n=d.current.getBoundingClientRect(),r=e===`horizontal`?(t.clientX-n.left)/n.width:(t.clientY-n.top)/n.height;c(Math.min(a,Math.max(i,r)))},o=()=>{f.current=!1,n.removeEventListener(`pointermove`,r),n.removeEventListener(`pointerup`,o)};n.addEventListener(`pointermove`,r),n.addEventListener(`pointerup`,o)},[e,i,a]),m=e===`horizontal`;return(0,u.jsxs)(`div`,{ref:d,className:E(`flex overflow-hidden h-full`,m?`flex-row`:`flex-col`,o),children:[(0,u.jsx)(`div`,{className:`overflow-hidden flex flex-col`,style:{flexBasis:`${s*100}%`,flexShrink:0},children:t}),(0,u.jsx)(`div`,{onPointerDown:p,className:E(`flex-shrink-0 relative z-10`,m?`w-px cursor-col-resize hover:w-[2px] bg-gq-border hover:bg-gq-accent transition-all`:`h-px cursor-row-resize hover:h-[2px] bg-gq-border hover:bg-gq-accent transition-all`)}),(0,u.jsx)(`div`,{className:`overflow-hidden flex flex-col flex-1`,style:{flexBasis:`${(1-s)*100}%`},children:n})]})}function sT({children:e}){return(0,u.jsx)(`div`,{className:`flex items-center px-2 h-7 border-b border-gq-border`,children:(0,u.jsx)(`span`,{className:`text-[10px] font-gq-mono text-gq-text-tertiary uppercase tracking-widest`,children:e})})}function cT({endpoint:e,headers:t,enableHeaders:n=!0,showHistory:r=!0,showSchemaExplorer:i=!0,plugins:a=[],onEditQuery:o,onEditVariables:s,onEditHeaders:c,onExecute:d,classNames:f,className:p}){let m=Dt(),g=h(m.ui,e=>e.activeSidebarPanel),_=h(m.execution,e=>e.isLoading),v=Kt();(0,l.useEffect)(()=>{if(o)return m.editor.subscribe(e=>o(e.query))},[m.editor,o]),(0,l.useEffect)(()=>{if(s)return m.editor.subscribe(e=>s(e.variables))},[m.editor,s]),(0,l.useEffect)(()=>{if(c)return m.editor.subscribe(e=>c(e.headers))},[m.editor,c]);let y=(0,l.useCallback)(async()=>{let{query:n,variables:r,headers:i}=m.editor.getState(),a=Tt(e,t),o;try{o=r?JSON.parse(r):void 0}catch{}let s;try{s=i?JSON.parse(i):void 0}catch{}d?.({query:n,variables:r}),await m.execution.getState().execute(a,{query:n,variables:o,headers:s}),m.history.getState().addEntry({query:n,variables:r,headers:i,operationName:null})},[m,e,t,d]);return(0,l.useEffect)(()=>{let e=e=>{let t=e.metaKey||e.ctrlKey;t&&e.key===`Enter`&&(e.preventDefault(),_?m.execution.getState().cancel():y()),t&&e.shiftKey&&e.key===`p`&&(e.preventDefault(),m.editor.getState().prettify()),e.key===`Escape`&&_&&m.execution.getState().cancel()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[y,_,m]),(0,u.jsxs)(`div`,{className:E(v.root(),f?.root,p),children:[(0,u.jsx)(eT,{showHistory:r,showSchemaExplorer:i,plugins:a,className:f?.sidebar}),g&&(0,u.jsxs)(`div`,{className:E(v.sidebarPanel(),f?.sidebarPanel),style:{width:260},children:[g===`explorer`&&(0,u.jsx)(Pw,{}),g===`schema`&&(0,u.jsx)(Qw,{}),g===`history`&&(0,u.jsx)(qw,{}),a.map(e=>g===e.name&&(0,u.jsx)(`div`,{className:`h-full`,children:e.content({schema:m.schema.getState().schema,query:m.editor.getState().query,variables:m.editor.getState().variables,execute:y})},e.name))]}),(0,u.jsx)(oT,{direction:`horizontal`,className:`flex-1`,defaultRatio:.5,first:(0,u.jsxs)(`div`,{className:E(`flex flex-col h-full`,v.editor(),f?.editor),children:[(0,u.jsx)(nT,{className:f?.tabs}),(0,u.jsx)(aT,{onExecute:y,className:f?.toolbar}),(0,u.jsx)(oT,{direction:`vertical`,className:`flex-1`,defaultRatio:.7,minRatio:.3,first:(0,u.jsx)(PC,{}),second:n?(0,u.jsx)(oT,{direction:`horizontal`,className:`h-full`,defaultRatio:.5,first:(0,u.jsxs)(`div`,{className:E(`flex flex-col h-full border-t border-gq-border`,f?.variablesEditor),children:[(0,u.jsx)(sT,{children:`Variables`}),(0,u.jsx)(IC,{})]}),second:(0,u.jsxs)(`div`,{className:E(`flex flex-col h-full border-t border-gq-border`,f?.headersEditor),children:[(0,u.jsx)(sT,{children:`Headers`}),(0,u.jsx)(gb,{})]})}):(0,u.jsxs)(`div`,{className:E(`flex flex-col h-full border-t border-gq-border`,f?.variablesEditor),children:[(0,u.jsx)(sT,{children:`Variables`}),(0,u.jsx)(IC,{})]})})]}),second:(0,u.jsxs)(`div`,{className:E(`flex flex-col h-full`,v.response(),f?.response),children:[(0,u.jsx)(lT,{}),(0,u.jsx)(FC,{})]})})]})}function lT(){let{execution:e}=Dt(),t=h(e,e=>e.isLoading),n=h(e,e=>e.duration);return(0,u.jsxs)(`div`,{className:`flex items-center px-2 h-7 border-b border-gq-border relative overflow-hidden`,children:[(0,u.jsx)(`span`,{className:`text-[10px] font-gq-mono text-gq-text-tertiary uppercase tracking-widest`,children:`Response`}),n!==null&&!t&&(0,u.jsxs)(`span`,{className:`ml-auto text-[10px] font-gq-mono text-gq-text-tertiary tabular-nums`,children:[n,`ms`]}),t&&(0,u.jsx)(`div`,{className:`absolute bottom-0 left-0 right-0 h-px bg-gq-border overflow-hidden`,children:(0,u.jsx)(`div`,{className:`h-full w-1/4 bg-gq-accent animate-[gq-shimmer_1s_ease-in-out_infinite]`})})]})}function uT({endpoint:e,headers:t,defaultQuery:n,schema:r,fetcher:i,storage:a,defaultTabs:o,...s}){return(0,u.jsx)(Kw,{endpoint:e,headers:t,defaultQuery:n,defaultTabs:o,schema:r,fetcher:i,storage:a,children:(0,u.jsx)(cT,{endpoint:e,headers:t,...s})})}function dT(){let e=Dt();return{query:h(e.editor,e=>e.query),variables:h(e.editor,e=>e.variables),headers:h(e.editor,e=>e.headers),setQuery:h(e.editor,e=>e.setQuery),setVariables:h(e.editor,e=>e.setVariables),setHeaders:h(e.editor,e=>e.setHeaders),prettify:h(e.editor,e=>e.prettify),schema:h(e.schema,e=>e.schema),response:h(e.execution,e=>e.response),isLoading:h(e.execution,e=>e.isLoading),error:h(e.execution,e=>e.error),duration:h(e.execution,e=>e.duration),activeTab:h(e.tabs,e=>e.tabs.find(t=>t.id===e.activeTabId)??e.tabs[0]),tabs:h(e.tabs,e=>e.tabs)}}function fT(e,t){let n=Dt();return(0,l.useCallback)(async()=>{let{query:r,variables:i,headers:a}=n.editor.getState(),o=Tt(e,t),s;try{s=i?JSON.parse(i):void 0}catch{}let c;try{c=a?JSON.parse(a):void 0}catch{}await n.execution.getState().execute(o,{query:r,variables:s,headers:c}),n.history.getState().addEntry({query:r,variables:i,headers:a,operationName:null})},[n,e,t])}function pT(){let{execution:e}=Dt();return{response:h(e,e=>e.response),isLoading:h(e,e=>e.isLoading),error:h(e,e=>e.error),duration:h(e,e=>e.duration),cancel:h(e,e=>e.cancel)}}exports.ExecuteButton=rT,exports.GraphiQ=uT,exports.GraphiQProvider=Kw,exports.HeadersEditor=gb,exports.PrettifyButton=iT,exports.QueryEditor=PC,exports.QueryExplorer=Pw,exports.QueryHistory=qw,exports.Resizable=oT,exports.ResponseViewer=FC,exports.SchemaExplorer=Qw,exports.Sidebar=eT,exports.Tab=tT,exports.TabBar=nT,exports.Toolbar=aT,exports.VariablesEditor=IC,exports.cn=E,exports.graphiqVariants=Kt,exports.useExecute=fT,exports.useGraphiQ=dT,exports.useQuery=pT,exports.useSchema=ww;
|
|
28
|
+
//# sourceMappingURL=graphiq.cjs.map
|