UNPKG

iobroker.lovelace

Version:

With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI

1 lines 80.9 kB
(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[9649],{86876:(t,e,r)=>{"use strict";r.d(e,{wQ:()=>dt,xi:()=>ft,at:()=>ut});var n=r(77885),i=r(23414),s=r(19753),o=r(64928),l=r(26856);const a=s.tk.baseTheme({".cm-matchingBracket":{color:"#0b0"},".cm-nonmatchingBracket":{color:"#a22"}}),h="()[]{}",c=n.r$.define({combine:t=>(0,n.BO)(t,{afterCursor:!0,brackets:h,maxScanDistance:1e4})}),u=s.p.mark({class:"cm-matchingBracket"}),f=s.p.mark({class:"cm-nonmatchingBracket"});n.QQ.define({create:()=>s.p.none,update(t,e){if(!e.docChanged&&!e.selection)return t;let r=[],n=e.state.facet(c);for(let t of e.state.selection.ranges){if(!t.empty)continue;let i=p(e.state,t.head,-1,n)||t.head>0&&p(e.state,t.head-1,1,n)||n.afterCursor&&(p(e.state,t.head,1,n)||t.head<e.state.doc.length&&p(e.state,t.head+1,-1,n));if(!i)continue;let s=i.matched?u:f;r.push(s.range(i.start.from,i.start.to)),i.end&&r.push(s.range(i.end.from,i.end.to))}return s.p.set(r,!0)},provide:t=>s.tk.decorations.from(t)});function d(t,e,r){let n=t.prop(e<0?l.md.openedBy:l.md.closedBy);if(n)return n;if(1==t.name.length){let n=r.indexOf(t.name);if(n>-1&&n%2==(e<0?1:0))return[r[n+e]]}return null}function p(t,e,r,n={}){let i,s=n.maxScanDistance||1e4,l=n.brackets||h,a=(0,o.qz)(t),c=a.resolve(e,r);return(i=d(c.type,r,l))?function(t,e,r,n,i,s){let o=n.parent,l={from:n.from,to:n.to},a=0,h=null==o?void 0:o.cursor;if(h&&(r<0?h.childBefore(n.from):h.childAfter(n.to)))do{if(r<0?h.to<=n.from:h.from>=n.to){if(0==a&&i.indexOf(h.type.name)>-1)return{start:l,end:{from:h.from,to:h.to},matched:!0};if(d(h.type,r,s))a++;else if(d(h.type,-r,s)&&(a--,0==a))return{start:l,end:{from:h.from,to:h.to},matched:!1}}}while(r<0?h.prevSibling():h.nextSibling());return{start:l,matched:!1}}(0,0,r,c,i,l):function(t,e,r,n,i,s,o){let l=r<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),a=o.indexOf(l);if(a<0||a%2==0!=r>0)return null;let h={from:r<0?e-1:e,to:r>0?e+1:e},c=t.doc.iterRange(e,r>0?t.doc.length:0),u=0;for(let t=0;!c.next().done&&t<=s;){let s=c.value;r<0&&(t+=s.length);let l=e+t*r;for(let t=r>0?0:s.length-1,e=r>0?s.length:-1;t!=e;t+=r){let e=o.indexOf(s[t]);if(!(e<0||n.resolve(l+t,1).type!=i))if(e%2==0==r>0)u++;else{if(1==u)return{start:h,end:{from:l+t,to:l+t+1},matched:e>>1==a>>1};u--}}r>0&&(t+=s.length)}return c.done?{start:h,matched:!1}:null}(t,e,r,a,c.type,s,l)}function m(t,e){return n.jT.create(t.ranges.map(e),t.mainIndex)}function g(t,e){return t.update({selection:e,scrollIntoView:!0,annotations:n.YW.userEvent.of("keyboardselection")})}function b({state:t,dispatch:e},r){let n=m(t.selection,r);return!n.eq(t.selection)&&(e(g(t,n)),!0)}function y(t,e){return n.jT.cursor(e?t.to:t.from)}function k(t,e){return b(t,(r=>r.empty?t.moveByChar(r,e):y(r,e)))}const x=t=>k(t,t.textDirection!=s.Nm.LTR),v=t=>k(t,t.textDirection==s.Nm.LTR);function w(t,e){return b(t,(r=>r.empty?t.moveByGroup(r,e):y(r,e)))}function C(t,e,r){if(e.type.prop(r))return!0;let n=e.to-e.from;return n&&(n>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function S(t,e,r){let i,s,a=(0,o.qz)(t).resolve(e.head),h=r?l.md.closedBy:l.md.openedBy;for(let n=e.head;;){let e=r?a.childAfter(n):a.childBefore(n);if(!e)break;C(t,e,h)?a=e:n=r?e.to:e.from}return s=a.type.prop(h)&&(i=r?p(t,a.from,1):p(t,a.to,-1))&&i.matched?r?i.end.to:i.end.from:r?a.to:a.from,n.jT.cursor(s,r?-1:1)}function A(t,e){return b(t,(r=>r.empty?t.moveVertically(r,e):y(r,e)))}const M=t=>A(t,!1),T=t=>A(t,!0);function N(t,e){return b(t,(r=>r.empty?t.moveVertically(r,e,t.dom.clientHeight):y(r,e)))}const P=t=>N(t,!1),L=t=>N(t,!0);function B(t,e,r){let i=t.visualLineAt(e.head),s=t.moveToLineBoundary(e,r);if(s.head==e.head&&s.head!=(r?i.to:i.from)&&(s=t.moveToLineBoundary(e,r,!1)),!r&&s.head==i.from&&i.length){let r=/^\s*/.exec(t.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;r&&e.head!=i.from+r&&(s=n.jT.cursor(i.from+r))}return s}const D=t=>b(t,(e=>n.jT.cursor(t.visualLineAt(e.head).from,1))),O=t=>b(t,(e=>n.jT.cursor(t.visualLineAt(e.head).to,-1)));function R(t,e,r){let i=!1,s=m(t.selection,(e=>{let s=p(t,e.head,-1)||p(t,e.head,1)||e.head>0&&p(t,e.head-1,1)||e.head<t.doc.length&&p(t,e.head+1,-1);if(!s||!s.end)return e;i=!0;let o=s.start.from==e.head?s.end.to:s.end.from;return r?n.jT.range(e.anchor,o):n.jT.cursor(o)}));return!!i&&(e(g(t,s)),!0)}function E(t,e){let r=m(t.state.selection,(t=>{let r=e(t);return n.jT.range(t.anchor,r.head,r.goalColumn)}));return!r.eq(t.state.selection)&&(t.dispatch(g(t.state,r)),!0)}function z(t,e){return E(t,(r=>t.moveByChar(r,e)))}const j=t=>z(t,t.textDirection!=s.Nm.LTR),I=t=>z(t,t.textDirection==s.Nm.LTR);function q(t,e){return E(t,(r=>t.moveByGroup(r,e)))}function _(t,e){return E(t,(r=>t.moveVertically(r,e)))}const W=t=>_(t,!1),$=t=>_(t,!0);function V(t,e){return E(t,(r=>t.moveVertically(r,e,t.dom.clientHeight)))}const U=t=>V(t,!1),H=t=>V(t,!0),G=t=>E(t,(e=>n.jT.cursor(t.visualLineAt(e.head).from))),Q=t=>E(t,(e=>n.jT.cursor(t.visualLineAt(e.head).to))),F=({state:t,dispatch:e})=>(e(g(t,{anchor:0})),!0),J=({state:t,dispatch:e})=>(e(g(t,{anchor:t.doc.length})),!0),K=({state:t,dispatch:e})=>(e(g(t,{anchor:t.selection.main.anchor,head:0})),!0),Y=({state:t,dispatch:e})=>(e(g(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0);function X({state:t,dispatch:e},r){let i=t.changeByRange((t=>{let{from:e,to:i}=t;if(e==i){let t=r(e);e=Math.min(e,t),i=Math.max(i,t)}return e==i?{range:t}:{changes:{from:e,to:i},range:n.jT.cursor(e)}}));return!i.changes.empty&&(e(t.update(i,{scrollIntoView:!0,annotations:n.YW.userEvent.of("delete")})),!0)}const Z=(t,e,r)=>X(t,(n=>{let s,l,{state:a}=t,h=a.doc.lineAt(n);if(!e&&n>h.from&&n<h.from+200&&!/[^ \t]/.test(s=h.text.slice(0,n-h.from))){if("\t"==s[s.length-1])return n-1;let t=(0,i.IS)(s,0,a.tabSize)%(0,o.y1)(a)||(0,o.y1)(a);for(let e=0;e<t&&" "==s[s.length-1-e];e++)n--;return n}if(r){let t=h.text.slice(n-h.from+(e?0:-2),n-h.from+(e?2:0)),r=t?(0,i.nZ)((0,i.gm)(t,0)):1;l=e?Math.min(a.doc.length,n+r):Math.max(0,n-r)}else l=(0,i.cp)(h.text,n-h.from,e)+h.from;return l==n&&h.number!=(e?a.doc.lines:1)&&(l+=e?1:-1),l})),tt=t=>Z(t,!1,!0),et=t=>Z(t,!0,!1),rt=(t,e)=>X(t,(r=>{let n=r,{state:s}=t,o=s.doc.lineAt(n),l=s.charCategorizer(n);for(let t=null;;){if(n==(e?o.to:o.from)){n==r&&o.number!=(e?s.doc.lines:1)&&(n+=e?1:-1);break}let a=(0,i.cp)(o.text,n-o.from,e)+o.from,h=o.text.slice(Math.min(n,a)-o.from,Math.max(n,a)-o.from),c=l(h);if(null!=t&&c!=t)break;" "==h&&n==r||(t=c),n=a}return n})),nt=t=>rt(t,!1),it=t=>rt(t,!0),st=t=>X(t,(e=>{let r=t.visualLineAt(e).to;return e<r?r:Math.min(t.state.doc.length,e+1)}));function ot(t){let e=[],r=-1;for(let n of t.selection.ranges){let i=t.doc.lineAt(n.from),s=t.doc.lineAt(n.to);r==i.number?e[e.length-1].to=s.to:e.push({from:i.from,to:s.to}),r=s.number}return e}function lt(t,e,r){let n=[];for(let e of ot(t)){if(r?e.to==t.doc.length:0==e.from)continue;let i=t.doc.lineAt(r?e.to+1:e.from-1);r?n.push({from:e.to,to:i.to},{from:e.from,insert:i.text+t.lineBreak}):n.push({from:i.from,to:e.from},{from:e.to,insert:t.lineBreak+i.text})}return!!n.length&&(e(t.update({changes:n,scrollIntoView:!0})),!0)}function at(t,e,r){let n=[];for(let e of ot(t))r?n.push({from:e.from,insert:t.doc.slice(e.from,e.to)+t.lineBreak}):n.push({from:e.to,insert:t.lineBreak+t.doc.slice(e.from,e.to)});return e(t.update({changes:n,scrollIntoView:!0})),!0}function ht(t,e){let r=-1;return t.changeByRange((i=>{let s=[];for(let n=i.from;n<=i.to;){let o=t.doc.lineAt(n);o.number>r&&(i.empty||i.to>o.from)&&(e(o,s,i),r=o.number),n=o.to+1}let o=t.changes(s);return{changes:s,range:n.jT.range(o.mapPos(i.anchor,1),o.mapPos(i.head,1))}}))}const ct=({state:t,dispatch:e})=>{let r=Object.create(null),n=new o.Gn(t,{overrideIndentation:t=>{let e=r[t];return null==e?-1:e}}),i=ht(t,((e,i,s)=>{let l=(0,o.K0)(n,e.from);if(null==l)return;let a=/^\s*/.exec(e.text)[0],h=(0,o.SS)(t,l);(a!=h||s.from<e.from+a.length)&&(r[e.from]=l,i.push({from:e.from,to:e.from+a.length,insert:h}))}));return i.changes.empty||e(t.update(i)),!0},ut=({state:t,dispatch:e})=>(e(t.update(ht(t,((e,r)=>{r.push({from:e.from,insert:t.facet(o.c)})})))),!0),ft=({state:t,dispatch:e})=>(e(t.update(ht(t,((e,r)=>{let n=/^\s*/.exec(e.text)[0];if(!n)return;let s=(0,i.IS)(n,0,t.tabSize),l=0,a=(0,o.SS)(t,Math.max(0,s-(0,o.y1)(t)));for(;l<n.length&&l<a.length&&n.charCodeAt(l)==a.charCodeAt(l);)l++;r.push({from:e.from+l,to:e.from+n.length,insert:a.slice(l)})})))),!0),dt=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:t=>b(t,(e=>S(t.state,e,t.textDirection!=s.Nm.LTR))),shift:t=>E(t,(e=>S(t.state,e,t.textDirection!=s.Nm.LTR)))},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:t=>b(t,(e=>S(t.state,e,t.textDirection==s.Nm.LTR))),shift:t=>E(t,(e=>S(t.state,e,t.textDirection==s.Nm.LTR)))},{key:"Alt-ArrowUp",run:({state:t,dispatch:e})=>lt(t,e,!1)},{key:"Shift-Alt-ArrowUp",run:({state:t,dispatch:e})=>at(t,e,!1)},{key:"Alt-ArrowDown",run:({state:t,dispatch:e})=>lt(t,e,!0)},{key:"Shift-Alt-ArrowDown",run:({state:t,dispatch:e})=>at(t,e,!0)},{key:"Escape",run:({state:t,dispatch:e})=>{let r=t.selection,i=null;return r.ranges.length>1?i=n.jT.create([r.main]):r.main.empty||(i=n.jT.create([n.jT.cursor(r.main.head)])),!!i&&(e(g(t,i)),!0)}},{key:"Alt-l",run:({state:t,dispatch:e})=>{let r=ot(t).map((({from:e,to:r})=>n.jT.range(e,Math.min(r+1,t.doc.length))));return e(t.update({selection:n.jT.create(r),annotations:n.YW.userEvent.of("keyboardselection")})),!0}},{key:"Mod-i",run:({state:t,dispatch:e})=>{let r=m(t.selection,(e=>{var r;let i=(0,o.qz)(t).resolve(e.head,1);for(;!(i.from<e.from&&i.to>=e.to||i.to>e.to&&i.from<=e.from)&&(null===(r=i.parent)||void 0===r?void 0:r.parent);)i=i.parent;return n.jT.range(i.to,i.from)}));return e(g(t,r)),!0}},{key:"Mod-[",run:ft},{key:"Mod-]",run:ut},{key:"Mod-Alt-\\",run:ct},{key:"Shift-Mod-k",run:t=>{let{state:e}=t,r=e.changes(ot(e).map((({from:t,to:r})=>(t>0?t--:r<e.doc.length&&r++,{from:t,to:r})))),n=m(e.selection,(e=>t.moveVertically(e,!0))).map(r);return t.dispatch({changes:r,selection:n,scrollIntoView:!0}),!0}},{key:"Shift-Mod-\\",run:({state:t,dispatch:e})=>R(t,e,!1)}].concat([{key:"ArrowLeft",run:x,shift:j},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:t=>w(t,t.textDirection!=s.Nm.LTR),shift:t=>q(t,t.textDirection!=s.Nm.LTR)},{mac:"Cmd-ArrowLeft",run:D,shift:G},{key:"ArrowRight",run:v,shift:I},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:t=>w(t,t.textDirection==s.Nm.LTR),shift:t=>q(t,t.textDirection==s.Nm.LTR)},{mac:"Cmd-ArrowRight",run:O,shift:Q},{key:"ArrowUp",run:M,shift:W},{mac:"Cmd-ArrowUp",run:F,shift:K},{mac:"Ctrl-ArrowUp",run:P,shift:U},{key:"ArrowDown",run:T,shift:$},{mac:"Cmd-ArrowDown",run:J,shift:Y},{mac:"Ctrl-ArrowDown",run:L,shift:H},{key:"PageUp",run:P,shift:U},{key:"PageDown",run:L,shift:H},{key:"Home",run:t=>b(t,(e=>B(t,e,!1))),shift:t=>E(t,(e=>B(t,e,!1)))},{key:"Mod-Home",run:F,shift:K},{key:"End",run:t=>b(t,(e=>B(t,e,!0))),shift:t=>E(t,(e=>B(t,e,!0)))},{key:"Mod-End",run:J,shift:Y},{key:"Enter",run:({state:t,dispatch:e})=>{let r=t.changeByRange((({from:e,to:r})=>{let s=e==r&&function(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let r,n=(0,o.qz)(t).resolve(e),i=n.childBefore(e),s=n.childAfter(e);return i&&s&&i.to<=e&&s.from>=e&&(r=i.type.prop(l.md.closedBy))&&r.indexOf(s.name)>-1&&t.doc.lineAt(i.to).from==t.doc.lineAt(s.from).from?{from:i.to,to:s.from}:null}(t,e),a=new o.Gn(t,{simulateBreak:e,simulateDoubleBreak:!!s}),h=(0,o.K0)(a,e);null==h&&(h=/^\s*/.exec(t.doc.lineAt(e).text)[0].length);let c=t.doc.lineAt(e);for(;r<c.to&&/\s/.test(c.text.slice(r-c.from,r+1-c.from));)r++;s?({from:e,to:r}=s):e>c.from&&e<c.from+100&&!/\S/.test(c.text.slice(0,e))&&(e=c.from);let u=["",(0,o.SS)(t,h)];return s&&u.push((0,o.SS)(t,a.lineIndent(c))),{changes:{from:e,to:r,insert:i.xv.of(u)},range:n.jT.cursor(e+1+u[1].length)}}));return e(t.update(r,{scrollIntoView:!0})),!0}},{key:"Mod-a",run:({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},annotations:n.YW.userEvent.of("keyboardselection")})),!0)},{key:"Backspace",run:tt,shift:tt},{key:"Delete",run:et,shift:et},{key:"Mod-Backspace",mac:"Alt-Backspace",run:nt},{key:"Mod-Delete",mac:"Alt-Delete",run:it},{mac:"Mod-Backspace",run:t=>X(t,(e=>{let r=t.visualLineAt(e).from;return e>r?r:Math.max(0,e-1)}))},{mac:"Mod-Delete",run:st}].concat([{key:"Ctrl-b",run:x,shift:j},{key:"Ctrl-f",run:v,shift:I},{key:"Ctrl-p",run:M,shift:W},{key:"Ctrl-n",run:T,shift:$},{key:"Ctrl-a",run:D,shift:G},{key:"Ctrl-e",run:O,shift:Q},{key:"Ctrl-d",run:et},{key:"Ctrl-h",run:t=>Z(t,!1,!1)},{key:"Ctrl-k",run:st},{key:"Alt-d",run:it},{key:"Ctrl-Alt-h",run:nt},{key:"Ctrl-o",run:({state:t,dispatch:e})=>{let r=t.changeByRange((t=>({changes:{from:t.from,to:t.to,insert:i.xv.of(["",""])},range:n.jT.cursor(t.from)})));return e(t.update(r,{scrollIntoView:!0,annotations:n.YW.userEvent.of("input")})),!0}},{key:"Ctrl-t",run:({state:t,dispatch:e})=>{let r=t.changeByRange((e=>{if(!e.empty||0==e.from||e.from==t.doc.length)return{range:e};let r=e.from,s=t.doc.lineAt(r),o=r==s.from?r-1:(0,i.cp)(s.text,r-s.from,!1)+s.from,l=r==s.to?r+1:(0,i.cp)(s.text,r-s.from,!0)+s.from;return{changes:{from:o,to:l,insert:t.doc.slice(r,l).append(t.doc.slice(o,r))},range:n.jT.cursor(l)}}));return!r.changes.empty&&(e(t.update(r,{scrollIntoView:!0})),!0)}},{key:"Alt-f",run:t=>w(t,!0),shift:t=>q(t,!0)},{key:"Alt-b",run:t=>w(t,!1),shift:t=>q(t,!1)},{key:"Alt-<",run:F},{key:"Alt->",run:J},{key:"Ctrl-v",run:L},{key:"Alt-v",run:P}].map((t=>({mac:t.key,run:t.run,shift:t.shift})))))},15230:(t,e,r)=>{"use strict";r.d(e,{Eu:()=>C});var n=r(19753),i=r(13764),s=r(77885);class o extends i.uU{compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}toDOM(t){return null}at(t){return this.range(t)}}o.prototype.elementClass="",o.prototype.mapMode=s.gc.TrackBefore;const l={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>i.Xs.empty,lineMarker:()=>null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},a=s.r$.define();function h(t){return[f(),a.of(Object.assign(Object.assign({},l),t))]}const c=n.tk.baseTheme({".cm-gutters":{display:"flex",height:"100%",boxSizing:"border-box",left:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#999",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",height:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"}}),u=s.r$.define({combine:t=>t.some((t=>t))});function f(t){let e=[d,c];return t&&!1===t.fixed&&e.push(u.of(!0)),e}const d=n.lg.fromClass(class{constructor(t){this.view=t,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.gutters=t.state.facet(a).map((e=>new g(t,e)));for(let t of this.gutters)this.dom.appendChild(t.dom);this.fixed=!t.state.facet(u),this.fixed&&(this.dom.style.position="sticky"),t.scrollDOM.insertBefore(this.dom,t.contentDOM),this.syncGutters()}update(t){this.updateGutters(t)&&this.syncGutters()}syncGutters(){let t=this.gutters.map((t=>new m(t,this.view.viewport)));this.view.viewportLines((e=>{let r;if(Array.isArray(e.type)){for(let t of e.type)if(t.type==n.kH.Text){r=t;break}}else r=e.type==n.kH.Text?e:void 0;if(r)for(let e of t)e.line(this.view,r)}),0);for(let e of t)e.finish();this.dom.style.minHeight=this.view.contentHeight+"px",this.view.state.facet(u)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"")}updateGutters(t){let e=t.startState.facet(a),r=t.state.facet(a),n=t.docChanged||t.heightChanged||t.viewportChanged;if(e==r)for(let e of this.gutters)e.update(t)&&(n=!0);else{n=!0;let i=[];for(let n of r){let r=e.indexOf(n);r<0?i.push(new g(this.view,n)):(this.gutters[r].update(t),i.push(this.gutters[r]))}for(let t of this.gutters)t.dom.remove();for(let t of i)this.dom.appendChild(t.dom);this.gutters=i}return n}destroy(){this.dom.remove()}},{provide:n.BF.scrollMargins.from((t=>0!=t.gutters.length&&t.fixed?t.view.textDirection==n.Nm.LTR?{left:t.dom.offsetWidth}:{right:t.dom.offsetWidth}:null))});function p(t){return Array.isArray(t)?t:[t]}class m{constructor(t,e){this.gutter=t,this.localMarkers=[],this.i=0,this.height=0,this.cursor=i.Xs.iter(t.markers,e.from)}line(t,e){for(this.localMarkers.length&&(this.localMarkers=[]);this.cursor.value&&this.cursor.from<=e.from;)this.cursor.from==e.from&&this.localMarkers.push(this.cursor.value),this.cursor.next();let r=this.gutter.config.lineMarker(t,e,this.localMarkers);r&&this.localMarkers.unshift(r);let n=this.gutter;if(0==this.localMarkers.length&&!n.config.renderEmptyElements)return;let i=e.top-this.height;if(this.i==n.elements.length){let r=new b(t,e.height,i,this.localMarkers);n.elements.push(r),n.dom.appendChild(r.dom)}else{let r=this.localMarkers,s=n.elements[this.i];(function(t,e){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!t[r].compare(e[r]))return!1;return!0})(r,s.markers)&&(r=s.markers,this.localMarkers.length=0),s.update(t,e.height,i,r)}this.height=e.bottom,this.i++}finish(){let t=this.gutter;for(;t.elements.length>this.i;)t.dom.removeChild(t.elements.pop().dom)}}class g{constructor(t,e){this.view=t,this.config=e,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let r in e.domEventHandlers)this.dom.addEventListener(r,(n=>{let i=t.visualLineAtHeight(n.clientY,t.contentDOM.getBoundingClientRect().top);e.domEventHandlers[r](t,i,n)&&n.preventDefault()}));this.markers=p(e.markers(t)),e.initialSpacer&&(this.spacer=new b(t,0,0,[e.initialSpacer(t)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(t){let e=this.markers;if(this.markers=p(this.config.markers(t.view)),this.spacer&&this.config.updateSpacer){let e=this.config.updateSpacer(this.spacer.markers[0],t);e!=this.spacer.markers[0]&&this.spacer.update(t.view,0,0,[e])}return this.markers!=e}}class b{constructor(t,e,r,n){this.height=-1,this.above=0,this.dom=document.createElement("div"),this.update(t,e,r,n)}update(t,e,r,n){if(this.height!=e&&(this.dom.style.height=(this.height=e)+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),this.markers!=n){this.markers=n;for(let t;t=this.dom.lastChild;)t.remove();let e="cm-gutterElement";for(let r of n){let n=r.toDOM(t);n&&this.dom.appendChild(n);let i=r.elementClass;i&&(e+=" "+i)}this.dom.className=e}}}const y=s.r$.define(),k=s.r$.define({combine:t=>(0,s.BO)(t,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(t,e){let r=Object.assign({},t);for(let t in e){let n=r[t],i=e[t];r[t]=n?(t,e,r)=>n(t,e,r)||i(t,e,r):i}return r}})});class x extends o{constructor(t){super(),this.number=t}eq(t){return this.number==t.number}toDOM(){return document.createTextNode(this.number)}}function v(t,e){return t.state.facet(k).formatNumber(e,t.state)}const w=h({class:"cm-lineNumbers",markers:t=>t.state.facet(y),lineMarker:(t,e,r)=>r.length?null:new x(v(t,t.state.doc.lineAt(e.from).number)),initialSpacer:t=>new x(v(t,S(t.state.doc.lines))),updateSpacer(t,e){let r=v(e.view,S(e.view.state.doc.lines));return r==t.number?t:new x(r)}});function C(t={}){return[k.of(t),w]}function S(t){let e=9;for(;e<t;)e=10*e+9;return e}},49619:(t,e,r)=>{"use strict";r.d(e,{Qf:()=>v,Gv:()=>p,pJ:()=>_});var n=r(26856),i=r(62038),s=r(19753),o=r(77885),l=r(64928),a=r(13764);let h=0;class c{constructor(t,e,r){this.set=t,this.base=e,this.modified=r,this.id=h++}static define(t){if(null==t?void 0:t.base)throw new Error("Can not derive from a modified tag");let e=new c([],null,[]);if(e.set.push(e),t)for(let r of t.set)e.set.push(r);return e}static defineModifier(){let t=new f;return e=>e.modified.indexOf(t)>-1?e:f.get(e.base||e,e.modified.concat(t).sort(((t,e)=>t.id-e.id)))}}let u=0;class f{constructor(){this.instances=[],this.id=u++}static get(t,e){if(!e.length)return t;let r=e[0].instances.find((r=>{return r.base==t&&(n=e,i=r.modified,n.length==i.length&&n.every(((t,e)=>t==i[e])));var n,i}));if(r)return r;let n=[],i=new c(n,t,e);for(let t of e)t.instances.push(i);let s=d(e);for(let e of t.set)for(let t of s)n.push(f.get(e,t));return i}}function d(t){let e=[t];for(let r=0;r<t.length;r++)for(let n of d(t.slice(0,r).concat(t.slice(r+1))))e.push(n);return e}function p(t){let e=Object.create(null);for(let r in t){let n=t[r];Array.isArray(n)||(n=[n]);for(let t of r.split(" "))if(t){let r=[],i=2,s=t;for(let e=0;;){if("..."==s&&e>0&&e+3==t.length){i=1;break}let n=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(s);if(!n)throw new RangeError("Invalid path: "+t);if(r.push("*"==n[0]?null:'"'==n[0][0]?JSON.parse(n[0]):n[0]),e+=n[0].length,e==t.length)break;let o=t[e++];if(e==t.length&&"!"==o){i=0;break}if("/"!=o)throw new RangeError("Invalid path: "+t);s=t.slice(e)}let o=r.length-1,l=r[o];if(!l)throw new RangeError("Invalid path: "+t);let a=new x(n,i,o>0?r.slice(0,o):null);e[l]=a.sort(e[l])}}return m.add(e)}const m=new n.md,g=o.r$.define({combine:t=>t.length?v.combinedMatch(t):null}),b=o.r$.define({combine:t=>t.length?t[0].match:null});function y(){return null}function k(t){return t.facet(g)||t.facet(b)||y}class x{constructor(t,e,r,n){this.tags=t,this.mode=e,this.context=r,this.next=n}sort(t){return!t||t.depth<this.depth?(this.next=t,this):(t.next=this.sort(t.next),t)}get depth(){return this.context?this.context.length:0}}class v{constructor(t,e){let r;function n(t){let e=i.V.newName();return(r||(r=Object.create(null)))["."+e]=t,e}this.map=Object.create(null),this.all="string"==typeof e.all?e.all:e.all?n(e.all):null;for(let e of t){let t=(e.class||n(Object.assign({},e,{tag:null})))+(this.all?" "+this.all:""),r=e.tag;if(Array.isArray(r))for(let e of r)this.map[e.id]=t;else this.map[r.id]=t}this.module=r?new i.V(r):null,this.scope=e.scope||null,this.match=this.match.bind(this);let o=[w];this.module&&o.push(s.tk.styleModule.of(this.module)),this.extension=o.concat(g.of(this)),this.fallback=o.concat(b.of(this))}match(t,e){if(this.scope&&e!=this.scope)return null;for(let e of t.set){let r=this.map[e.id];if(void 0!==r)return e!=t&&(this.map[t.id]=r),r}return this.map[t.id]=this.all}static combinedMatch(t){if(1==t.length)return t[0].match;let e=t.some((t=>t.scope))?void 0:Object.create(null);return(r,n)=>{let i=e&&e[r.id];if(void 0!==i)return i;let s=null;for(let e of t){let t=e.match(r,n);t&&(s=s?s+" "+t:t)}return e&&(e[r.id]=s),s}}static define(t,e){return new v(t,e||{})}static get(t,e,r){return k(t)(e,r||n.Jq.none)}}const w=o.Wl.fallback(s.lg.fromClass(class{constructor(t){this.markCache=Object.create(null),this.tree=(0,l.qz)(t.state),this.decorations=this.buildDeco(t,k(t.state))}update(t){let e=(0,l.qz)(t.state),r=k(t.state),n=r!=t.startState.facet(g);e.length<t.view.viewport.to&&!n?this.decorations=this.decorations.map(t.changes):(e!=this.tree||t.viewportChanged||n)&&(this.tree=e,this.decorations=this.buildDeco(t.view,r))}buildDeco(t,e){if(e==y||!this.tree.length)return s.p.none;let r=new a.f_;for(let{from:n,to:i}of t.visibleRanges)S(this.tree,n,i,e,((t,e,n)=>{r.add(t,e,this.markCache[n]||(this.markCache[n]=s.p.mark({class:n})))}));return r.finish()}},{decorations:t=>t.decorations})),C=[""];function S(t,e,r,n,i){let s=e,o="",l=t.topNode.cursor;!function t(a,h,c){let{type:u,from:f,to:d}=l;if(f>=r||d<=e)return;C[h]=u.name,u.isTop&&(c=u);let p=a,g=u.prop(m),b=!1;for(;g;){if(!g.context||A(g.context,C,h)){for(let t of g.tags){let e=n(t,c);e&&(p&&(p+=" "),p+=e,1==g.mode?a+=(a?" ":"")+e:0==g.mode&&(b=!0))}break}g=g.next}if(p!=o&&(f>s&&o&&i(s,l.from,o),s=f,o=p),!b&&l.firstChild()){do{let e=l.to;if(t(a,h+1,c),o!=p){let t=Math.min(r,e);t>s&&o&&i(s,t,o),s=t,o=p}}while(l.nextSibling());l.parent()}}("",0,t.type)}function A(t,e,r){if(t.length>r-1)return!1;for(let n=r-1,i=t.length-1;i>=0;i--,n--){let r=t[i];if(r&&r!=e[n])return!1}return!0}const M=c.define,T=M(),N=M(),P=M(N),L=M(),B=M(L),D=M(L),O=M(),R=M(O),E=M(),z=M(),j=M(),I=M(j),q=M(),_={comment:T,lineComment:M(T),blockComment:M(T),docComment:M(T),name:N,variableName:M(N),typeName:P,tagName:M(P),propertyName:M(N),className:M(N),labelName:M(N),namespace:M(N),macroName:M(N),literal:L,string:B,docString:M(B),character:M(B),number:D,integer:M(D),float:M(D),bool:M(L),regexp:M(L),escape:M(L),color:M(L),url:M(L),keyword:E,self:M(E),null:M(E),atom:M(E),unit:M(E),modifier:M(E),operatorKeyword:M(E),controlKeyword:M(E),definitionKeyword:M(E),operator:z,derefOperator:M(z),arithmeticOperator:M(z),logicOperator:M(z),bitwiseOperator:M(z),compareOperator:M(z),updateOperator:M(z),definitionOperator:M(z),typeOperator:M(z),controlOperator:M(z),punctuation:j,separator:M(j),bracket:I,angleBracket:M(I),squareBracket:M(I),paren:M(I),brace:M(I),content:O,heading:R,heading1:M(R),heading2:M(R),heading3:M(R),heading4:M(R),heading5:M(R),heading6:M(R),contentSeparator:M(O),list:M(O),quote:M(O),emphasis:M(O),strong:M(O),link:M(O),monospace:M(O),inserted:M(),deleted:M(),changed:M(),invalid:M(),meta:q,documentMeta:M(q),annotation:M(q),processingInstruction:M(q),definition:c.defineModifier(),constant:c.defineModifier(),function:c.defineModifier(),standard:c.defineModifier(),local:c.defineModifier(),special:c.defineModifier()};v.define([{tag:_.link,textDecoration:"underline"},{tag:_.heading,textDecoration:"underline",fontWeight:"bold"},{tag:_.emphasis,fontStyle:"italic"},{tag:_.strong,fontWeight:"bold"},{tag:_.keyword,color:"#708"},{tag:[_.atom,_.bool,_.url,_.contentSeparator,_.labelName],color:"#219"},{tag:[_.literal,_.inserted],color:"#164"},{tag:[_.string,_.deleted],color:"#a11"},{tag:[_.regexp,_.escape,_.special(_.string)],color:"#e40"},{tag:_.definition(_.variableName),color:"#00f"},{tag:_.local(_.variableName),color:"#30a"},{tag:[_.typeName,_.namespace],color:"#085"},{tag:_.className,color:"#167"},{tag:[_.special(_.variableName),_.macroName],color:"#256"},{tag:_.definition(_.propertyName),color:"#00c"},{tag:_.comment,color:"#940"},{tag:_.meta,color:"#7a757a"},{tag:_.invalid,color:"#f00"}]),v.define([{tag:_.link,class:"cmt-link"},{tag:_.heading,class:"cmt-heading"},{tag:_.emphasis,class:"cmt-emphasis"},{tag:_.strong,class:"cmt-strong"},{tag:_.keyword,class:"cmt-keyword"},{tag:_.atom,class:"cmt-atom"},{tag:_.bool,class:"cmt-bool"},{tag:_.url,class:"cmt-url"},{tag:_.labelName,class:"cmt-labelName"},{tag:_.inserted,class:"cmt-inserted"},{tag:_.deleted,class:"cmt-deleted"},{tag:_.literal,class:"cmt-literal"},{tag:_.string,class:"cmt-string"},{tag:_.number,class:"cmt-number"},{tag:[_.regexp,_.escape,_.special(_.string)],class:"cmt-string2"},{tag:_.variableName,class:"cmt-variableName"},{tag:_.local(_.variableName),class:"cmt-variableName cmt-local"},{tag:_.definition(_.variableName),class:"cmt-variableName cmt-definition"},{tag:_.special(_.variableName),class:"cmt-variableName2"},{tag:_.typeName,class:"cmt-typeName"},{tag:_.namespace,class:"cmt-namespace"},{tag:_.macroName,class:"cmt-macroName"},{tag:_.propertyName,class:"cmt-propertyName"},{tag:_.operator,class:"cmt-operator"},{tag:_.comment,class:"cmt-comment"},{tag:_.meta,class:"cmt-meta"},{tag:_.invalid,class:"cmt-invalid"},{tag:_.punctuation,class:"cmt-punctuation"}])},64928:(t,e,r)=>{"use strict";r.d(e,{Gn:()=>A,SQ:()=>h,kU:()=>a,y1:()=>w,K0:()=>S,tK:()=>x,SS:()=>C,c:()=>v,mi:()=>l,qz:()=>u});var n=r(26856),i=r(23414),s=r(77885),o=r(19753);const l=new n.md;function a(t){return s.r$.define({combine:t?e=>e.concat(t):void 0})}class h{constructor(t,e,r,n=[]){this.data=t,this.topNode=r,s.yy.prototype.hasOwnProperty("tree")||Object.defineProperty(s.yy.prototype,"tree",{get(){return u(this)}}),this.parser=e,this.extension=[k.of(this),s.yy.languageData.of(((t,e)=>t.facet(c(t,e))))].concat(n)}isActiveAt(t,e){return c(t,e)==this.data}findRegions(t){let e=t.facet(k);if((null==e?void 0:e.data)==this.data)return[{from:0,to:t.doc.length}];if(!e||!e.allowsNesting)return[];let r=[];return u(t).iterate({enter:(t,e,n)=>{if(t.isTop&&t.prop(l)==this.data)return r.push({from:e,to:n}),!1}}),r}get allowsNesting(){return!0}parseString(t){let e,r=i.xv.of(t.split("\n")),o=this.parser.startParse(new f(r),0,new d(this.parser,s.yy.create({doc:r}),[],n.mp.empty,{from:0,to:t.length},[],null));for(;!(e=o.advance()););return e}}function c(t,e){let r=t.facet(k);if(!r)return null;if(!r.allowsNesting)return r.data;let n=u(t).resolve(e,-1);for(;n;){let t=n.type.prop(l);if(t)return t;n=n.parent}return r.data}h.setState=s.Py.define();function u(t){let e=t.field(h.state,!1);return e?e.tree:n.mp.empty}class f{constructor(t,e=t.length){this.doc=t,this.length=e,this.cursorPos=0,this.string="",this.prevString="",this.cursor=t.iter()}syncTo(t){return t<this.cursorPos&&(this.cursor=this.doc.iter(),this.cursorPos=0),this.prevString=t==this.cursorPos?this.string:"",this.string=this.cursor.next(t-this.cursorPos).value,this.cursorPos=t+this.string.length,this.cursorPos-this.string.length}get(t){if(t>=this.length)return-1;let e=this.cursorPos-this.string.length;if(t<e||t>=this.cursorPos){if(t<e&&t>=e-this.prevString.length)return this.prevString.charCodeAt(t-(e-this.prevString.length));e=this.syncTo(t)}return this.string.charCodeAt(t-e)}lineAfter(t){if(t>=this.length||t<0)return"";let e=this.cursorPos-this.string.length;return(t<e||t>=this.cursorPos)&&(e=this.syncTo(t)),this.cursor.lineBreak?"":this.string.slice(t-e,Math.min(this.length-e,this.string.length))}read(t,e){let r=this.cursorPos-this.string.length;return t<r||e>=this.cursorPos?this.doc.sliceString(t,e):this.string.slice(t-r,e-r)}clip(t){return new f(this.doc,t)}}class d{constructor(t,e,r=[],n,i,s,o){this.parser=t,this.state=e,this.fragments=r,this.tree=n,this.viewport=i,this.skipped=s,this.scheduleOn=o,this.parse=null,this.tempSkipped=[]}work(t,e){if(this.tree!=n.mp.empty&&(null==e?this.tree.length==this.state.doc.length:this.tree.length>=e))return this.takeTree(),!0;this.parse||(this.parse=this.parser.startParse(new f(this.state.doc),0,this));let r=Date.now()+t;for(;;){let t=this.parse.advance();if(t)return this.fragments=this.withoutTempSkipped(n.i9.addTree(t)),this.parse=null,this.tree=t,!0;if(null!=e&&this.parse.pos>=e)return this.takeTree(),!0;if(Date.now()>r)return!1}}takeTree(){this.parse&&this.parse.pos>this.tree.length&&(this.tree=this.parse.forceFinish(),this.fragments=this.withoutTempSkipped(n.i9.addTree(this.tree,this.fragments,!0)))}withoutTempSkipped(t){for(let e;e=this.tempSkipped.pop();)t=p(t,e.from,e.to);return t}changes(t,e){let{fragments:r,tree:i,viewport:s,skipped:o}=this;if(this.takeTree(),!t.empty){let e=[];if(t.iterChangedRanges(((t,r,n,i)=>e.push({fromA:t,toA:r,fromB:n,toB:i}))),r=n.i9.applyChanges(r,e),i=n.mp.empty,s={from:t.mapPos(s.from,-1),to:t.mapPos(s.to,1)},this.skipped.length){o=[];for(let e of this.skipped){let r=t.mapPos(e.from,1),n=t.mapPos(e.to,-1);r<n&&o.push({from:r,to:n})}}}return new d(this.parser,e,r,i,s,o,this.scheduleOn)}updateViewport(t){this.viewport=t;let e=this.skipped.length;for(let e=0;e<this.skipped.length;e++){let{from:r,to:n}=this.skipped[e];r<t.to&&n>t.from&&(this.fragments=p(this.fragments,r,n),this.skipped.splice(e--,1))}return this.skipped.length<e}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(t,e){this.skipped.push({from:t,to:e})}static getSkippingParser(t){return{startParse:(e,r,i)=>({pos:r,advance(){let s=i;return s.tempSkipped.push({from:r,to:e.length}),t&&(s.scheduleOn=s.scheduleOn?Promise.all([s.scheduleOn,t]):t),this.pos=e.length,new n.mp(n.Jq.none,[],[],e.length-r)},forceFinish(){return this.advance()}})}}movedPast(t){return this.tree.length<t&&this.parse&&this.parse.pos>=t}}function p(t,e,r){return n.i9.applyChanges(t,[{fromA:e,toA:r,fromB:e,toB:r}])}d.skippingParser=d.getSkippingParser();class m{constructor(t){this.context=t,this.tree=t.tree}apply(t){if(!t.docChanged)return this;let e=this.context.changes(t.changes,t.state),r=this.context.tree.length==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.tree.length),e.viewport.to);return e.work(25,r)||e.takeTree(),new m(e)}static init(t){let e=new d(t.facet(k).parser,t,[],n.mp.empty,{from:0,to:t.doc.length},[],null);return e.work(25)||e.takeTree(),new m(e)}}h.state=s.QQ.define({create:m.init,update(t,e){for(let t of e.effects)if(t.is(h.setState))return t.value;return e.startState.facet(k)!=e.state.facet(k)?m.init(e.state):t.apply(e)}});let g="undefined"!=typeof window&&window.requestIdleCallback||((t,{timeout:e})=>setTimeout(t,e)),b="undefined"!=typeof window&&window.cancelIdleCallback||clearTimeout;const y=o.lg.fromClass(class{constructor(t){this.view=t,this.working=-1,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(t){let e=this.view.state.field(h.state).context;t.viewportChanged&&(e.updateViewport(t.view.viewport)&&e.reset(),this.view.viewport.to>e.tree.length&&this.scheduleWork()),t.docChanged&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(e)}scheduleWork(t=!1){if(this.working>-1)return;let{state:e}=this.view,r=e.field(h.state);!t&&r.tree.length>=e.doc.length||(this.working=g(this.work,{timeout:500}))}work(t){this.working=-1;let e=Date.now();if(this.chunkEnd<e&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=e+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:r,viewport:{to:n}}=this.view,i=r.field(h.state);if(i.tree.length>=n+1e6)return;let s=Math.min(this.chunkBudget,t?Math.max(25,t.timeRemaining()):100),o=i.context.work(s,n+1e6);this.chunkBudget-=Date.now()-e,(o||this.chunkBudget<=0||i.context.movedPast(n))&&(i.context.takeTree(),this.view.dispatch({effects:h.setState.of(new m(i.context))})),!o&&this.chunkBudget>0&&this.scheduleWork(),this.checkAsyncSchedule(i.context)}checkAsyncSchedule(t){t.scheduleOn&&(t.scheduleOn.then((()=>this.scheduleWork(!0))),t.scheduleOn=null)}destroy(){this.working>=0&&b(this.working)}},{eventHandlers:{focus(){this.scheduleWork()}}}),k=s.r$.define({combine:t=>t.length?t[0]:null,enables:[h.state,y]});const x=s.r$.define(),v=s.r$.define({combine:t=>{if(!t.length)return" ";if(!/^(?: +|\t+)$/.test(t[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return t[0]}});function w(t){let e=t.facet(v);return 9==e.charCodeAt(0)?t.tabSize*e.length:e.length}function C(t,e){let r="",n=t.tabSize;if(9==t.facet(v).charCodeAt(0))for(;e>=n;)r+="\t",e-=n;for(let t=0;t<e;t++)r+=" ";return r}function S(t,e){t instanceof s.yy&&(t=new A(t));for(let r of t.state.facet(x)){let n=r(t,e);if(null!=n)return n}let r=u(t.state);return r?function(t,e,r){let n=e.resolve(r);for(let t=n,e=r;;){let r=t.childBefore(e);if(!r)break;r.type.isError&&r.from==r.to?(n=t,e=r.from):(t=r,e=t.to+1)}return N(n,r,t)}(t,r,e):null}class A{constructor(t,e={}){this.state=t,this.options=e,this.unit=w(t)}textAfterPos(t){var e,r;let n=null===(e=this.options)||void 0===e?void 0:e.simulateBreak;return t==n&&(null===(r=this.options)||void 0===r?void 0:r.simulateDoubleBreak)?"":this.state.sliceDoc(t,Math.min(t+100,null!=n&&n>t?n:1e9,this.state.doc.lineAt(t).to))}column(t){var e;let r=this.state.doc.lineAt(t),n=r.text.slice(0,t-r.from),i=this.countColumn(n,t-r.from),s=(null===(e=this.options)||void 0===e?void 0:e.overrideIndentation)?this.options.overrideIndentation(r.from):-1;return s>-1&&(i+=s-this.countColumn(n,n.search(/\S/))),i}countColumn(t,e){return(0,i.IS)(e<0?t:t.slice(0,e),0,this.state.tabSize)}lineIndent(t){var e;let r=null===(e=this.options)||void 0===e?void 0:e.overrideIndentation;if(r){let e=r(t.from);if(e>-1)return e}return this.countColumn(t.text,t.text.search(/\S/))}}const M=new n.md;function T(t){let e=t.type.prop(M);if(e)return e;let r,i=t.firstChild;if(i&&(r=i.type.prop(n.md.closedBy))){let e=t.lastChild,n=e&&r.indexOf(e.name)>-1;return t=>D(t,!0,1,void 0,n&&!function(t){var e,r;return t.pos==(null===(e=t.options)||void 0===e?void 0:e.simulateBreak)&&(null===(r=t.options)||void 0===r?void 0:r.simulateDoubleBreak)}(t)?e.from:void 0)}return null==t.parent?P:null}function N(t,e,r){for(;t;t=t.parent){let n=T(t);if(n)return n(new L(r,e,t))}return null}function P(){return 0}class L extends A{constructor(t,e,r){super(t.state,t.options),this.base=t,this.pos=e,this.node=r}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){let t=this.state.doc.lineAt(this.node.from);for(;;){let e=this.node.resolve(t.from);for(;e.parent&&e.parent.from==e.from;)e=e.parent;if(B(e,this.node))break;t=this.state.doc.lineAt(e.from)}return this.lineIndent(t)}continue(){let t=this.node.parent;return t?N(t,this.pos,this.base):0}}function B(t,e){for(let r=e;r;r=r.parent)if(t==r)return!0;return!1}function D(t,e,r,n,i){let s=t.textAfter,o=s.match(/^\s*/)[0].length,l=n&&s.slice(o,o+n.length)==n||i==t.pos+o,a=e?function(t){var e;let r=t.node,n=r.childAfter(r.from),i=r.lastChild;if(!n)return null;let s=null===(e=t.options)||void 0===e?void 0:e.simulateBreak,o=t.state.doc.lineAt(n.from),l=null==s||s<=o.from?o.to:Math.min(o.to,s);for(let t=n.to;;){let e=r.childAfter(t);if(!e||e==i)return null;if(!e.type.isSkipped)return e.from<l?n:null;t=e.to}}(t):null;return a?l?t.column(a.from):t.column(a.to):t.baseIndent+(l?0:t.unit*r)}s.r$.define(),new n.md},49413:(t,e,r)=>{"use strict";r.d(e,{b:()=>h});var n=["and","as","block","endblock","by","cycle","debug","else","elif","extends","filter","endfilter","firstof","for","endfor","if","endif","ifchanged","endifchanged","ifequal","endifequal","ifnotequal","endifnotequal","in","include","load","not","now","or","parsed","regroup","reversed","spaceless","endspaceless","ssi","templatetag","openblock","closeblock","openvariable","closevariable","openbrace","closebrace","opencomment","closecomment","widthratio","url","with","endwith","get_current_language","trans","endtrans","noop","blocktrans","endblocktrans","get_available_languages","get_current_language_bidi","plural"],i=/^[+\-*&%=<>!?|~^]/,s=/^[:\[\(\{]/,o=["true","false"],l=/^(\d[+\-\*\/])?\d+(\.\d+)?/;function a(t,e){var r=t.peek();if(e.incomment)return t.skipTo("#}")?(t.eatWhile(/\#|}/),e.incomment=!1):t.skipToEnd(),"comment";if(e.intag){if(e.operator){if(e.operator=!1,t.match(o))return"atom";if(t.match(l))return"number"}if(e.sign){if(e.sign=!1,t.match(o))return"atom";if(t.match(l))return"number"}if(e.instring)return r==e.instring&&(e.instring=!1),t.next(),"string";if("'"==r||'"'==r)return e.instring=r,t.next(),"string";if(t.match(e.intag+"}")||t.eat("-")&&t.match(e.intag+"}"))return e.intag=!1,"tag";if(t.match(i))return e.operator=!0,"operator";if(t.match(s))e.sign=!0;else if(t.eat(" ")||t.sol()){if(t.match(n))return"keyword";if(t.match(o))return"atom";if(t.match(l))return"number";t.sol()&&t.next()}else t.next();return"variable"}if(t.eat("{")){if(t.eat("#"))return e.incomment=!0,t.skipTo("#}")?(t.eatWhile(/\#|}/),e.incomment=!1):t.skipToEnd(),"comment";if(r=t.eat(/\{|%/))return e.intag=r,"{"==r&&(e.intag="}"),t.eat("-"),"tag"}t.next()}n=new RegExp("(("+n.join(")|(")+"))\\b"),o=new RegExp("(("+o.join(")|(")+"))\\b");const h={startState:function(){return{tokenize:a}},token:function(t,e){return e.tokenize(t,e)},languageData:{commentTokens:{block:{open:"{#",close:"#}"}}}}},8987:(t,e,r)=>{"use strict";r.d(e,{r:()=>i});var n=new RegExp("\\b(("+["true","false","on","off","yes","no"].join(")|(")+"))$","i");const i={token:function(t,e){var r=t.peek(),i=e.escaped;if(e.escaped=!1,"#"==r&&(0==t.pos||/\s/.test(t.string.charAt(t.pos-1))))return t.skipToEnd(),"comment";if(t.match(/^('([^']|\\.)*'?|"([^"]|\\.)*"?)/))return"string";if(e.literal&&t.indentation()>e.keyCol)return t.skipToEnd(),"string";if(e.literal&&(e.literal=!1),t.sol()){if(e.keyCol=0,e.pair=!1,e.pairStart=!1,t.match("---"))return"def";if(t.match("..."))return"def";if(t.match(/^\s*-\s+/))return"meta"}if(t.match(/^(\{|\}|\[|\])/))return"{"==r?e.inlinePairs++:"}"==r?e.inlinePairs--:"["==r?e.inlineList++:e.inlineList--,"meta";if(e.inlineList>0&&!i&&","==r)return t.next(),"meta";if(e.inlinePairs>0&&!i&&","==r)return e.keyCol=0,e.pair=!1,e.pairStart=!1,t.next(),"meta";if(e.pairStart){if(t.match(/^\s*(\||\>)\s*/))return e.literal=!0,"meta";if(t.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i))return"variable";if(0==e.inlinePairs&&t.match(/^\s*-?[0-9\.\,]+\s?$/))return"number";if(e.inlinePairs>0&&t.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/))return"number";if(t.match(n))return"keyword"}return!e.pair&&t.match(/^\s*(?:[,\[\]{}&*!|>'"%@`][^\s'":]|[^,\[\]{}#&*!|>'"%@`])[^#]*?(?=\s*:($|\s))/)?(e.pair=!0,e.keyCol=t.indentation(),"atom"):e.pair&&t.match(/^:\s*/)?(e.pairStart=!0,"meta"):(e.pairStart=!1,e.escaped="\\"==r,t.next(),null)},startState:function(){return{pair:!1,pairStart:!1,keyCol:0,inlinePairs:0,inlineList:0,literal:!1,escaped:!1}},languageData:{commentTokens:{line:"#"}}}},63637:(t,e,r)=>{"use strict";r.d(e,{Z:()=>h});var n=r(77885),i=r(19753),s=r(23414);const o=2e3;function l(t,e){let r=t.posAtCoords({x:e.clientX,y:e.clientY});if(null==r)return null;let n=t.state.doc.lineAt(r),i=r-n.from,l=i>o?-1:i==n.length?function(t,e){let r=t.coordsAtPos(t.viewport.from);return r?Math.round(Math.abs((r.left-e)/t.defaultCharacterWidth)):-1}(t,e.clientX):(0,s.IS)(n.text.slice(0,r-n.from),0,t.state.tabSize);return{line:n.number,col:l,off:i}}function a(t,e){let r=l(t,e),i=t.state.selection;return r?{update(t){if(t.docChanged){let e=t.changes.mapPos(t.startState.doc.line(r.line).from),n=t.state.doc.lineAt(e);r={line:n.number,col:r.col,off:Math.min(r.off,n.length)},i=i.map(t.changes)}},get(e,a,h){let c=l(t,e);if(!c)return i;let u=function(t,e,r){let i=Math.min(e.line,r.line),l=Math.max(e.line,r.line),a=[];if(e.off>o||r.off>o||e.col<0||r.col<0){let s=Math.min(e.off,r.off),o=Math.max(e.off,r.off);for(let e=i;e<=l;e++){let r=t.doc.line(e);r.length<=o&&a.push(n.jT.range(r.from+s,r.to+o))}}else{let h=Math.min(e.col,r.col),c=Math.max(e.col,r.col);for(let e=i;e<=l;e++){let r=t.doc.line(e),i=r.length>o?r.text.slice(0,2*c):r.text,l=(0,s.Gz)(i,0,h,t.tabSize),u=(0,s.Gz)(i,0,c,t.tabSize);l.leftOver||a.push(n.jT.range(r.from+l.offset,r.from+u.offset))}}return a}(t.state,r,c);return u.length?h?n.jT.create(u.concat(i.ranges)):n.jT.create(u):i}}:null}function h(t){let e=(null==t?void 0:t.eventFilter)||(t=>t.altKey&&0==t.button);return i.tk.mouseSelectionStyle.of(((t,r)=>e(r)?a(t,r):null))}},72360:(t,e,r)=>{"use strict";r.d(e,{sW:()=>L,Lp:()=>tt});var n=r(19753),i=r(77885);const s=i.r$.define({combine(t){let e,r;for(let n of t)e=e||n.topContainer,r=r||n.bottomContainer;return{topContainer:e,bottomContainer:r}}});function o(t,e){let r=t.plugin(l),n=r?r.specs.indexOf(e):-1;return n>-1?r.panels[n]:null}const l=n.lg.fromClass(class{constructor(t){this.input=t.state.facet(u),this.specs=this.input.filter((t=>t)),this.panels=this.specs.map((e=>e(t)));let e=t.state.facet(s);this.top=new a(t,!0,e.topContainer),this.bottom=new a(t,!1,e.bottomContainer),this.top.sync(this.panels.filter((t=>t.top))),this.bottom.sync(this.panels.filter((t=>!t.top)));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.class&&t.dom.classList.add(t.class),t.mount&&t.mount()}update(t){let e=t.state.facet(s);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new a(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new a(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let r=t.state.facet(u);if(r!=this.input){let e=r.filter((t=>t)),n=[],i=[],s=[],o=[];for(let r of e){let e,l=this.specs.indexOf(r);l<0?(e=r(t.view),o.push(e)):(e=this.panels[l],e.update&&e.update(t)),n.push(e),(e.top?i:s).push(e)}this.specs=e,this.panels=n,this.top.sync(i),this.bottom.sync(s);for(let t of o)t.dom.classList.add("cm-panel"),t.class&&t.dom.classList.add(t.class),t.mount&&t.mount()}else for(let e of this.panels)e.update&&e.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:n.BF.scrollMargins.from((t=>({top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()})))});class a{constructor(t,e,r){this.view=t,this.top=e,this.container=r,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(t){this.panels=t,this.syncDOM()}syncDOM(){if(0==this.panels.length)return void(this.dom&&(this.dom.remove(),this.dom=void 0));if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let t=this.dom.firstChild;for(let e of this.panels)if(e.dom.parentNode==this.dom){for(;t!=e.dom;)t=h(t);t=t.nextSibling}else this.dom.insertBefore(e.dom,t);for(;t;)t=h(t)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-this.view.scrollDOM.getBoundingClientRect().top:this.view.scrollDOM.getBoundingClientRect().bottom-this.dom.getBoundingClientRect().top)}syncClasses(){if(this.container&&this.classes!=this.view.themeClasses){for(let t of this.classes.split(" "))t&&this.container.classList.remove(t);for(let t of(this.classes=this.view.themeClasses).split(" "))t&&this.container.classList.add(t)}}}function h(t){let e=t.nextSibling;return t.remove(),e}const c=n.tk.baseTheme({".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"}}),u=i.r$.define({enables:[l,c]});var f=r(13764);function d(){var t=arguments[0];"string"==typeof t&&(t=document.createElement(t));var e=1,r=arguments[1];if(r&&"object"==typeof r&&null==r.nodeType&&!Array.isArray(r)){for(var n in r)if(Object.prototype.hasOwnProperty.call(r,n)){var i=r[n];"string"==typeof i?t.setAttribute(n,i):null!=i&&(t[n]=i)}e++}for(;e<arguments.length;e++)p(t,arguments[e]);return t}function p(t,e){if("string"==typeof e)t.appendChild(document.createTextNode(e));else if(null==e);else if(null!=e.nodeType)t.appendChild(e);else{if(!Array.isArray(e))throw new RangeError("Unsupported child node: "+e);for(var r=0;r<e.length;r++)p(t,e[r])}}var m=r(23414);const g="function"==typeof String.prototype.normalize?t=>t.normalize("NFKD"):t=>t;class b{constructor(t,e,r=0,n=t.length,i){this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(r,n),this.bufferStart=r,this.normalize=i?t=>i(g(t)):g,this.query=this.normalize(e)}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(0,m.gm)(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let e=(0,m.bg)(t),r=this.bufferStart+this.bufferPos;this.bufferPos+=(0,m.nZ)(t);let n=this.normalize(e);for(let t=0,i=r;;t++){let s=n.charCodeAt(t),o=this.match(s,i);if(o)return this.value=o,this;if(t==n.length-1)break;i==r&&t<e.length&&e.charCodeAt(t)==s&&i++}}}match(t,e){let r=null;for(let n=0;n<this.matches.length;n+=2){let i=this.matches[n],s=!1;this.query.charCodeAt(i)==t&&(i==this.query.length-1?r={from:this.matches[n+1],to:e+1}:(this.matches[n]++,s=!0)),s||(this.matches.splice(n,2),n-=2)}return this.query.charCodeAt(0)==t&&(1==this.query.length?r={from:e,to:e+1}:this.matches.push(1,e)),r}}const y={from:-1,to:-1,match:/.*/.exec("")},k="gm"+(null==/x/.unicode?"":"u");class x{constructor(t,e,r,n=0,i=t.length){if(this.to=i,this.curLine="",this.done=!1,this.value=y,/\\[sWDnr]|\n|\r|\[\^/.test(e))return new C(t,e,r,n,i);this.re=new RegExp(e,k+((null==r?void 0:r.ignoreCase)?"i":"")),this.iter=t.iter();let s=t.lineAt(n);this.curLineStart=s.from,this.matchPos=n,this.getLine(this.curLineStart)}getLine(t){this.iter.next(t),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 t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;let e=this.matchPos<=this.to&&this.re.exec(this.curLine);if(e){let r=this.curLineStart+e.index,n=r+e[0].length;if(this.matchPos=n+(r==n?1:0),r==this.curLine.length&&this.nextLine(),r<n||r>this.value.to)return this.value={from:r,to:n,match:e},this;t=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length<this.to))return this.done=!0,this;this.nextLine(),t=0}}}}const v=new WeakMap;class w{constructor(t,e){this.from=t,this.text=e}get to(){return this.from+this.text.length}static get(t,e,r){let n=v.get(t);if(!n||n.from>=r||n.to<=e){let n=new w(e,t.sliceString(e,r));return v.set(t,n),n}if(n.from==e&&n.to==r)return n;let{text:i,from:s}=n;return s>e&&(i=t.sliceString(e,s)+i,s=e),n.to<r&&(i+=t.sliceString(n.to,r)),v.set(t,new w(s,i)),new w(e,i.slice(e-s,r-s))}}class C{constructor(t,e,r,n,i){this.text=t,this.to=i,this.done=!1,this.value=y,this.matchPos=n,this.re=new RegExp(e,k+((null==r?void 0:r.ignoreCase)?"i":"")),this.flat=w.get(t,n,this.chunkEnd(n+5e3))}chunkEnd(t){return t>=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,e=this.re.exec(this.flat.text);if(e&&!e[0]&&e.index==t&&(this.re.lastIndex=t+1,e=this.re.exec(this.flat.text)),e&&this.flat.to<this.to&&e.index+e[0].length>this.flat.text.length-10&&(e=null),e){let t=this.flat.from+e.index,r=t+e[0].length;return this.value={from:t,to:r,match:e},this.matchPos=r+(t==r?1:0),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=w.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}function S(t){let e=d("input",{class:"cm-textfield",name:"line"});function r(){let r=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(e.value);if(!r)return;let{state:n}=t,s=n.doc.lineAt(n.selection.main.head),[,o,l,a,h]=r,c=a?+a.slice(1):0,u=l?+l:s.number;i