http-up
Version:
Simple share folder via http with upload
1 lines • 525 kB
JavaScript
var cm6=function(t){"use strict";let e=[],i=[];function n(t){if(t<768)return!1;for(let n=0,r=e.length;;){let s=n+r>>1;if(t<e[s])r=s;else{if(!(t>=i[s]))return!0;n=s+1}if(n==r)return!1}}function r(t){return t>=127462&&t<=127487}(()=>{let t="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((t=>t?parseInt(t,36):1));for(let n=0,r=0;n<t.length;n++)(n%2?i:e).push(r+=t[n])})();function s(t,e,i=!0,n=!0){return(i?o:a)(t,e,n)}function o(t,e,i){if(e==t.length)return e;e&&h(t.charCodeAt(e))&&c(t.charCodeAt(e-1))&&e--;let s=l(t,e);for(e+=O(s);e<t.length;){let o=l(t,e);if(8205==s||8205==o||i&&n(o))e+=O(o),s=o;else{if(!r(o))break;{let i=0,n=e-2;for(;n>=0&&r(l(t,n));)i++,n-=2;if(i%2==0)break;e+=2}}}return e}function a(t,e,i){for(;e>0;){let n=o(t,e-2,i);if(n<e)return n;e--}return 0}function l(t,e){let i=t.charCodeAt(e);if(!c(i)||e+1==t.length)return i;let n=t.charCodeAt(e+1);return h(n)?n-56320+(i-55296<<10)+65536:i}function h(t){return t>=56320&&t<57344}function c(t){return t>=55296&&t<56320}function O(t){return t<65536?1:2}class u{lineAt(t){if(t<0||t>this.length)throw new RangeError(`Invalid position ${t} in document of length ${this.length}`);return this.lineInner(t,!1,1,0)}line(t){if(t<1||t>this.lines)throw new RangeError(`Invalid line number ${t} in ${this.lines}-line document`);return this.lineInner(t,!0,1,0)}replace(t,e,i){[t,e]=y(this,t,e);let n=[];return this.decompose(0,t,n,2),i.length&&i.decompose(0,i.length,n,3),this.decompose(e,this.length,n,1),d.from(n,this.length-(e-t)+i.length)}append(t){return this.replace(this.length,this.length,t)}slice(t,e=this.length){[t,e]=y(this,t,e);let i=[];return this.decompose(t,e,i,0),d.from(i,e-t)}eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;let e=this.scanIdentical(t,1),i=this.length-this.scanIdentical(t,-1),n=new g(this),r=new g(t);for(let t=e,s=e;;){if(n.next(t),r.next(t),t=0,n.lineBreak!=r.lineBreak||n.done!=r.done||n.value!=r.value)return!1;if(s+=n.value.length,n.done||s>=i)return!0}}iter(t=1){return new g(this,t)}iterRange(t,e=this.length){return new Q(this,t,e)}iterLines(t,e){let i;if(null==t)i=this.iter();else{null==e&&(e=this.lines+1);let n=this.line(t).from;i=this.iterRange(n,Math.max(n,e==this.lines+1?this.length:e<=1?0:this.line(e-1).to))}return new b(i)}toString(){return this.sliceString(0)}toJSON(){let t=[];return this.flatten(t),t}constructor(){}static of(t){if(0==t.length)throw new RangeError("A document must have at least one line");return 1!=t.length||t[0]?t.length<=32?new f(t):d.from(f.split(t,[])):u.empty}}class f extends u{constructor(t,e=function(t){let e=-1;for(let i of t)e+=i.length+1;return e}(t)){super(),this.text=t,this.length=e}get lines(){return this.text.length}get children(){return null}lineInner(t,e,i,n){for(let r=0;;r++){let s=this.text[r],o=n+s.length;if((e?i:o)>=t)return new S(n,o,i,s);n=o+1,i++}}decompose(t,e,i,n){let r=t<=0&&e>=this.length?this:new f(m(this.text,t,e),Math.min(e,this.length)-Math.max(0,t));if(1&n){let t=i.pop(),e=p(r.text,t.text.slice(),0,r.length);if(e.length<=32)i.push(new f(e,t.length+r.length));else{let t=e.length>>1;i.push(new f(e.slice(0,t)),new f(e.slice(t)))}}else i.push(r)}replace(t,e,i){if(!(i instanceof f))return super.replace(t,e,i);[t,e]=y(this,t,e);let n=p(this.text,p(i.text,m(this.text,0,t)),e),r=this.length+i.length-(e-t);return n.length<=32?new f(n,r):d.from(f.split(n,[]),r)}sliceString(t,e=this.length,i="\n"){[t,e]=y(this,t,e);let n="";for(let r=0,s=0;r<=e&&s<this.text.length;s++){let o=this.text[s],a=r+o.length;r>t&&s&&(n+=i),t<a&&e>r&&(n+=o.slice(Math.max(0,t-r),e-r)),r=a+1}return n}flatten(t){for(let e of this.text)t.push(e)}scanIdentical(){return 0}static split(t,e){let i=[],n=-1;for(let r of t)i.push(r),n+=r.length+1,32==i.length&&(e.push(new f(i,n)),i=[],n=-1);return n>-1&&e.push(new f(i,n)),e}}class d extends u{constructor(t,e){super(),this.children=t,this.length=e,this.lines=0;for(let e of t)this.lines+=e.lines}lineInner(t,e,i,n){for(let r=0;;r++){let s=this.children[r],o=n+s.length,a=i+s.lines-1;if((e?a:o)>=t)return s.lineInner(t,e,i,n);n=o+1,i=a+1}}decompose(t,e,i,n){for(let r=0,s=0;s<=e&&r<this.children.length;r++){let o=this.children[r],a=s+o.length;if(t<=a&&e>=s){let r=n&((s<=t?1:0)|(a>=e?2:0));s>=t&&a<=e&&!r?i.push(o):o.decompose(t-s,e-s,i,r)}s=a+1}}replace(t,e,i){if([t,e]=y(this,t,e),i.lines<this.lines)for(let n=0,r=0;n<this.children.length;n++){let s=this.children[n],o=r+s.length;if(t>=r&&e<=o){let a=s.replace(t-r,e-r,i),l=this.lines-s.lines+a.lines;if(a.lines<l>>4&&a.lines>l>>6){let r=this.children.slice();return r[n]=a,new d(r,this.length-(e-t)+i.length)}return super.replace(r,o,a)}r=o+1}return super.replace(t,e,i)}sliceString(t,e=this.length,i="\n"){[t,e]=y(this,t,e);let n="";for(let r=0,s=0;r<this.children.length&&s<=e;r++){let o=this.children[r],a=s+o.length;s>t&&r&&(n+=i),t<a&&e>s&&(n+=o.sliceString(t-s,e-s,i)),s=a+1}return n}flatten(t){for(let e of this.children)e.flatten(t)}scanIdentical(t,e){if(!(t instanceof d))return 0;let i=0,[n,r,s,o]=e>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;n+=e,r+=e){if(n==s||r==o)return i;let a=this.children[n],l=t.children[r];if(a!=l)return i+a.scanIdentical(l,e);i+=a.length+1}}static from(t,e=t.reduce(((t,e)=>t+e.length+1),-1)){let i=0;for(let e of t)i+=e.lines;if(i<32){let i=[];for(let e of t)e.flatten(i);return new f(i,e)}let n=Math.max(32,i>>5),r=n<<1,s=n>>1,o=[],a=0,l=-1,h=[];function c(t){let e;if(t.lines>r&&t instanceof d)for(let e of t.children)c(e);else t.lines>s&&(a>s||!a)?(O(),o.push(t)):t instanceof f&&a&&(e=h[h.length-1])instanceof f&&t.lines+e.lines<=32?(a+=t.lines,l+=t.length+1,h[h.length-1]=new f(e.text.concat(t.text),e.length+1+t.length)):(a+t.lines>n&&O(),a+=t.lines,l+=t.length+1,h.push(t))}function O(){0!=a&&(o.push(1==h.length?h[0]:d.from(h,l)),l=-1,a=h.length=0)}for(let e of t)c(e);return O(),1==o.length?o[0]:new d(o,e)}}function p(t,e,i=0,n=1e9){for(let r=0,s=0,o=!0;s<t.length&&r<=n;s++){let a=t[s],l=r+a.length;l>=i&&(l>n&&(a=a.slice(0,n-r)),r<i&&(a=a.slice(i-r)),o?(e[e.length-1]+=a,o=!1):e.push(a)),r=l+1}return e}function m(t,e,i){return p(t,[""],e,i)}u.empty=new f([""],0);class g{constructor(t,e=1){this.dir=e,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[t],this.offsets=[e>0?1:(t instanceof f?t.text.length:t.children.length)<<1]}nextInner(t,e){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,n=this.nodes[i],r=this.offsets[i],s=r>>1,o=n instanceof f?n.text.length:n.children.length;if(s==(e>0?o:0)){if(0==i)return this.done=!0,this.value="",this;e>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((1&r)==(e>0?0:1)){if(this.offsets[i]+=e,0==t)return this.lineBreak=!0,this.value="\n",this;t--}else if(n instanceof f){let r=n.text[s+(e<0?-1:0)];if(this.offsets[i]+=e,r.length>Math.max(0,t))return this.value=0==t?r:e>0?r.slice(t):r.slice(0,r.length-t),this;t-=r.length}else{let r=n.children[s+(e<0?-1:0)];t>r.length?(t-=r.length,this.offsets[i]+=e):(e<0&&this.offsets[i]--,this.nodes.push(r),this.offsets.push(e>0?1:(r instanceof f?r.text.length:r.children.length)<<1))}}}next(t=0){return t<0&&(this.nextInner(-t,-this.dir),t=this.value.length),this.nextInner(t,this.dir)}}class Q{constructor(t,e,i){this.value="",this.done=!1,this.cursor=new g(t,e>i?-1:1),this.pos=e>i?t.length:0,this.from=Math.min(e,i),this.to=Math.max(e,i)}nextInner(t,e){if(e<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;t+=Math.max(0,e<0?this.pos-this.to:this.from-this.pos);let i=e<0?this.pos-this.from:this.to-this.pos;t>i&&(t=i),i-=t;let{value:n}=this.cursor.next(t);return this.pos+=(n.length+t)*e,this.value=n.length<=i?n:e<0?n.slice(n.length-i):n.slice(0,i),this.done=!this.value,this}next(t=0){return t<0?t=Math.max(t,this.from-this.pos):t>0&&(t=Math.min(t,this.to-this.pos)),this.nextInner(t,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&""!=this.value}}class b{constructor(t){this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}next(t=0){let{done:e,lineBreak:i,value:n}=this.inner.next(t);return e&&this.afterBreak?(this.value="",this.afterBreak=!1):e?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=n,this.afterBreak=!1),this}get lineBreak(){return!1}}"undefined"!=typeof Symbol&&(u.prototype[Symbol.iterator]=function(){return this.iter()},g.prototype[Symbol.iterator]=Q.prototype[Symbol.iterator]=b.prototype[Symbol.iterator]=function(){return this});let S=class{constructor(t,e,i,n){this.from=t,this.to=e,this.number=i,this.text=n}get length(){return this.to-this.from}};function y(t,e,i){return[e=Math.max(0,Math.min(t.length,e)),Math.max(e,Math.min(t.length,i))]}function x(t,e,i=!0,n=!0){return s(t,e,i,n)}function w(t,e){let i=t.charCodeAt(e);if(!(n=i,n>=55296&&n<56320&&e+1!=t.length))return i;var n;let r=t.charCodeAt(e+1);return function(t){return t>=56320&&t<57344}(r)?r-56320+(i-55296<<10)+65536:i}function k(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t)))}function v(t){return t<65536?1:2}const $=/\r\n?|\n/;var P=function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t}(P||(P={}));class T{constructor(t){this.sections=t}get length(){let t=0;for(let e=0;e<this.sections.length;e+=2)t+=this.sections[e];return t}get newLength(){let t=0;for(let e=0;e<this.sections.length;e+=2){let i=this.sections[e+1];t+=i<0?this.sections[e]:i}return t}get empty(){return 0==this.sections.length||2==this.sections.length&&this.sections[1]<0}iterGaps(t){for(let e=0,i=0,n=0;e<this.sections.length;){let r=this.sections[e++],s=this.sections[e++];s<0?(t(i,n,r),n+=r):n+=s,i+=r}}iterChangedRanges(t,e=!1){R(this,t,e)}get invertedDesc(){let t=[];for(let e=0;e<this.sections.length;){let i=this.sections[e++],n=this.sections[e++];n<0?t.push(i,n):t.push(n,i)}return new T(t)}composeDesc(t){return this.empty?t:t.empty?this:Z(this,t)}mapDesc(t,e=!1){return t.empty?this:q(this,t,e)}mapPos(t,e=-1,i=P.Simple){let n=0,r=0;for(let s=0;s<this.sections.length;){let o=this.sections[s++],a=this.sections[s++],l=n+o;if(a<0){if(l>t)return r+(t-n);r+=o}else{if(i!=P.Simple&&l>=t&&(i==P.TrackDel&&n<t&&l>t||i==P.TrackBefore&&n<t||i==P.TrackAfter&&l>t))return null;if(l>t||l==t&&e<0&&!o)return t==n||e<0?r:r+a;r+=a}n=l}if(t>n)throw new RangeError(`Position ${t} is out of range for changeset of length ${n}`);return r}touchesRange(t,e=t){for(let i=0,n=0;i<this.sections.length&&n<=e;){let r=n+this.sections[i++];if(this.sections[i++]>=0&&n<=e&&r>=t)return!(n<t&&r>e)||"cover";n=r}return!1}toString(){let t="";for(let e=0;e<this.sections.length;){let i=this.sections[e++],n=this.sections[e++];t+=(t?" ":"")+i+(n>=0?":"+n:"")}return t}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some((t=>"number"!=typeof t)))throw new RangeError("Invalid JSON representation of ChangeDesc");return new T(t)}static create(t){return new T(t)}}class C extends T{constructor(t,e){super(t),this.inserted=e}apply(t){if(this.length!=t.length)throw new RangeError("Applying change set to a document with the wrong length");return R(this,((e,i,n,r,s)=>t=t.replace(n,n+(i-e),s)),!1),t}mapDesc(t,e=!1){return q(this,t,e,!0)}invert(t){let e=this.sections.slice(),i=[];for(let n=0,r=0;n<e.length;n+=2){let s=e[n],o=e[n+1];if(o>=0){e[n]=o,e[n+1]=s;let a=n>>1;for(;i.length<a;)i.push(u.empty);i.push(s?t.slice(r,r+s):u.empty)}r+=s}return new C(e,i)}compose(t){return this.empty?t:t.empty?this:Z(this,t,!0)}map(t,e=!1){return t.empty?this:q(this,t,e,!0)}iterChanges(t,e=!1){R(this,t,e)}get desc(){return T.create(this.sections)}filter(t){let e=[],i=[],n=[],r=new V(this);t:for(let s=0,o=0;;){let a=s==t.length?1e9:t[s++];for(;o<a||o==a&&0==r.len;){if(r.done)break t;let t=Math.min(r.len,a-o);X(n,t,-1);let s=-1==r.ins?-1:0==r.off?r.ins:0;X(e,t,s),s>0&&A(i,e,r.text),r.forward(t),o+=t}let l=t[s++];for(;o<l;){if(r.done)break t;let t=Math.min(r.len,l-o);X(e,t,-1),X(n,t,-1==r.ins?-1:0==r.off?r.ins:0),r.forward(t),o+=t}}return{changes:new C(e,i),filtered:T.create(n)}}toJSON(){let t=[];for(let e=0;e<this.sections.length;e+=2){let i=this.sections[e],n=this.sections[e+1];n<0?t.push(i):0==n?t.push([i]):t.push([i].concat(this.inserted[e>>1].toJSON()))}return t}static of(t,e,i){let n=[],r=[],s=0,o=null;function a(t=!1){if(!t&&!n.length)return;s<e&&X(n,e-s,-1);let i=new C(n,r);o=o?o.compose(i.map(o)):i,n=[],r=[],s=0}return function t(l){if(Array.isArray(l))for(let e of l)t(e);else if(l instanceof C){if(l.length!=e)throw new RangeError(`Mismatched change set length (got ${l.length}, expected ${e})`);a(),o=o?o.compose(l.map(o)):l}else{let{from:t,to:o=t,insert:h}=l;if(t>o||t<0||o>e)throw new RangeError(`Invalid change range ${t} to ${o} (in doc of length ${e})`);let c=h?"string"==typeof h?u.of(h.split(i||$)):h:u.empty,O=c.length;if(t==o&&0==O)return;t<s&&a(),t>s&&X(n,t-s,-1),X(n,o-t,O),A(r,n,c),s=o}}(t),a(!o),o}static empty(t){return new C(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw new RangeError("Invalid JSON representation of ChangeSet");let e=[],i=[];for(let n=0;n<t.length;n++){let r=t[n];if("number"==typeof r)e.push(r,-1);else{if(!Array.isArray(r)||"number"!=typeof r[0]||r.some(((t,e)=>e&&"string"!=typeof t)))throw new RangeError("Invalid JSON representation of ChangeSet");if(1==r.length)e.push(r[0],0);else{for(;i.length<n;)i.push(u.empty);i[n]=u.of(r.slice(1)),e.push(r[0],i[n].length)}}}return new C(e,i)}static createSet(t,e){return new C(t,e)}}function X(t,e,i,n=!1){if(0==e&&i<=0)return;let r=t.length-2;r>=0&&i<=0&&i==t[r+1]?t[r]+=e:r>=0&&0==e&&0==t[r]?t[r+1]+=i:n?(t[r]+=e,t[r+1]+=i):t.push(e,i)}function A(t,e,i){if(0==i.length)return;let n=e.length-2>>1;if(n<t.length)t[t.length-1]=t[t.length-1].append(i);else{for(;t.length<n;)t.push(u.empty);t.push(i)}}function R(t,e,i){let n=t.inserted;for(let r=0,s=0,o=0;o<t.sections.length;){let a=t.sections[o++],l=t.sections[o++];if(l<0)r+=a,s+=a;else{let h=r,c=s,O=u.empty;for(;h+=a,c+=l,l&&n&&(O=O.append(n[o-2>>1])),!(i||o==t.sections.length||t.sections[o+1]<0);)a=t.sections[o++],l=t.sections[o++];e(r,h,s,c,O),r=h,s=c}}}function q(t,e,i,n=!1){let r=[],s=n?[]:null,o=new V(t),a=new V(e);for(let t=-1;;){if(o.done&&a.len||a.done&&o.len)throw new Error("Mismatched change set lengths");if(-1==o.ins&&-1==a.ins){let t=Math.min(o.len,a.len);X(r,t,-1),o.forward(t),a.forward(t)}else if(a.ins>=0&&(o.ins<0||t==o.i||0==o.off&&(a.len<o.len||a.len==o.len&&!i))){let e=a.len;for(X(r,a.ins,-1);e;){let i=Math.min(o.len,e);o.ins>=0&&t<o.i&&o.len<=i&&(X(r,0,o.ins),s&&A(s,r,o.text),t=o.i),o.forward(i),e-=i}a.next()}else{if(!(o.ins>=0)){if(o.done&&a.done)return s?C.createSet(r,s):T.create(r);throw new Error("Mismatched change set lengths")}{let e=0,i=o.len;for(;i;)if(-1==a.ins){let t=Math.min(i,a.len);e+=t,i-=t,a.forward(t)}else{if(!(0==a.ins&&a.len<i))break;i-=a.len,a.next()}X(r,e,t<o.i?o.ins:0),s&&t<o.i&&A(s,r,o.text),t=o.i,o.forward(o.len-i)}}}}function Z(t,e,i=!1){let n=[],r=i?[]:null,s=new V(t),o=new V(e);for(let t=!1;;){if(s.done&&o.done)return r?C.createSet(n,r):T.create(n);if(0==s.ins)X(n,s.len,0,t),s.next();else if(0!=o.len||o.done){if(s.done||o.done)throw new Error("Mismatched change set lengths");{let e=Math.min(s.len2,o.len),i=n.length;if(-1==s.ins){let i=-1==o.ins?-1:o.off?0:o.ins;X(n,e,i,t),r&&i&&A(r,n,o.text)}else-1==o.ins?(X(n,s.off?0:s.len,e,t),r&&A(r,n,s.textBit(e))):(X(n,s.off?0:s.len,o.off?0:o.ins,t),r&&!o.off&&A(r,n,o.text));t=(s.ins>e||o.ins>=0&&o.len>e)&&(t||n.length>i),s.forward2(e),o.forward(e)}}else X(n,0,o.ins,t),r&&A(r,n,o.text),o.next()}}class V{constructor(t){this.set=t,this.i=0,this.next()}next(){let{sections:t}=this.set;this.i<t.length?(this.len=t[this.i++],this.ins=t[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return-2==this.ins}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:t}=this.set,e=this.i-2>>1;return e>=t.length?u.empty:t[e]}textBit(t){let{inserted:e}=this.set,i=this.i-2>>1;return i>=e.length&&!t?u.empty:e[i].slice(this.off,null==t?void 0:this.off+t)}forward(t){t==this.len?this.next():(this.len-=t,this.off+=t)}forward2(t){-1==this.ins?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}}class _{constructor(t,e,i){this.from=t,this.to=e,this.flags=i}get anchor(){return 32&this.flags?this.to:this.from}get head(){return 32&this.flags?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return 8&this.flags?-1:16&this.flags?1:0}get bidiLevel(){let t=7&this.flags;return 7==t?null:t}get goalColumn(){let t=this.flags>>6;return 16777215==t?void 0:t}map(t,e=-1){let i,n;return this.empty?i=n=t.mapPos(this.from,e):(i=t.mapPos(this.from,1),n=t.mapPos(this.to,-1)),i==this.from&&n==this.to?this:new _(i,n,this.flags)}extend(t,e=t){if(t<=this.anchor&&e>=this.anchor)return M.range(t,e);let i=Math.abs(t-this.anchor)>Math.abs(e-this.anchor)?t:e;return M.range(this.anchor,i)}eq(t,e=!1){return!(this.anchor!=t.anchor||this.head!=t.head||e&&this.empty&&this.assoc!=t.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(t){if(!t||"number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid JSON representation for SelectionRange");return M.range(t.anchor,t.head)}static create(t,e,i){return new _(t,e,i)}}class M{constructor(t,e){this.ranges=t,this.mainIndex=e}map(t,e=-1){return t.empty?this:M.create(this.ranges.map((i=>i.map(t,e))),this.mainIndex)}eq(t,e=!1){if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(let i=0;i<this.ranges.length;i++)if(!this.ranges[i].eq(t.ranges[i],e))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return 1==this.ranges.length?this:new M([this.main],0)}addRange(t,e=!0){return M.create([t].concat(this.ranges),e?0:this.mainIndex+1)}replaceRange(t,e=this.mainIndex){let i=this.ranges.slice();return i[e]=t,M.create(i,this.mainIndex)}toJSON(){return{ranges:this.ranges.map((t=>t.toJSON())),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||"number"!=typeof t.main||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new M(t.ranges.map((t=>_.fromJSON(t))),t.main)}static single(t,e=t){return new M([M.range(t,e)],0)}static create(t,e=0){if(0==t.length)throw new RangeError("A selection needs at least one range");for(let i=0,n=0;n<t.length;n++){let r=t[n];if(r.empty?r.from<=i:r.from<i)return M.normalized(t.slice(),e);i=r.to}return new M(t,e)}static cursor(t,e=0,i,n){return _.create(t,t,(0==e?0:e<0?8:16)|(null==i?7:Math.min(6,i))|(null!=n?n:16777215)<<6)}static range(t,e,i,n){let r=(null!=i?i:16777215)<<6|(null==n?7:Math.min(6,n));return e<t?_.create(e,t,48|r):_.create(t,e,(e>t?8:0)|r)}static normalized(t,e=0){let i=t[e];t.sort(((t,e)=>t.from-e.from)),e=t.indexOf(i);for(let i=1;i<t.length;i++){let n=t[i],r=t[i-1];if(n.empty?n.from<=r.to:n.from<r.to){let s=r.from,o=Math.max(n.to,r.to);i<=e&&e--,t.splice(--i,2,n.anchor>n.head?M.range(o,s):M.range(s,o))}}return new M(t,e)}}function U(t,e){for(let i of t.ranges)if(i.to>e)throw new RangeError("Selection points outside of document")}let E=0;class j{constructor(t,e,i,n,r){this.combine=t,this.compareInput=e,this.compare=i,this.isStatic=n,this.id=E++,this.default=t([]),this.extensions="function"==typeof r?r(this):r}get reader(){return this}static define(t={}){return new j(t.combine||(t=>t),t.compareInput||((t,e)=>t===e),t.compare||(t.combine?(t,e)=>t===e:D),!!t.static,t.enables)}of(t){return new W([],this,0,t)}compute(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new W(t,this,1,e)}computeN(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new W(t,this,2,e)}from(t,e){return e||(e=t=>t),this.compute([t],(i=>e(i.field(t))))}}function D(t,e){return t==e||t.length==e.length&&t.every(((t,i)=>t===e[i]))}class W{constructor(t,e,i,n){this.dependencies=t,this.facet=e,this.type=i,this.value=n,this.id=E++}dynamicSlot(t){var e;let i=this.value,n=this.facet.compareInput,r=this.id,s=t[r]>>1,o=2==this.type,a=!1,l=!1,h=[];for(let i of this.dependencies)"doc"==i?a=!0:"selection"==i?l=!0:0==(1&(null!==(e=t[i.id])&&void 0!==e?e:1))&&h.push(t[i.id]);return{create:t=>(t.values[s]=i(t),1),update(t,e){if(a&&e.docChanged||l&&(e.docChanged||e.selection)||B(t,h)){let e=i(t);if(o?!z(e,t.values[s],n):!n(e,t.values[s]))return t.values[s]=e,1}return 0},reconfigure:(t,e)=>{let a,l=e.config.address[r];if(null!=l){let r=st(e,l);if(this.dependencies.every((i=>i instanceof j?e.facet(i)===t.facet(i):!(i instanceof Y)||e.field(i,!1)==t.field(i,!1)))||(o?z(a=i(t),r,n):n(a=i(t),r)))return t.values[s]=r,0}else a=i(t);return t.values[s]=a,1}}}}function z(t,e,i){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!i(t[n],e[n]))return!1;return!0}function B(t,e){let i=!1;for(let n of e)1&rt(t,n)&&(i=!0);return i}function G(t,e,i){let n=i.map((e=>t[e.id])),r=i.map((t=>t.type)),s=n.filter((t=>!(1&t))),o=t[e.id]>>1;function a(t){let i=[];for(let e=0;e<n.length;e++){let s=st(t,n[e]);if(2==r[e])for(let t of s)i.push(t);else i.push(s)}return e.combine(i)}return{create(t){for(let e of n)rt(t,e);return t.values[o]=a(t),1},update(t,i){if(!B(t,s))return 0;let n=a(t);return e.compare(n,t.values[o])?0:(t.values[o]=n,1)},reconfigure(t,r){let s=B(t,n),l=r.config.facets[e.id],h=r.facet(e);if(l&&!s&&D(i,l))return t.values[o]=h,0;let c=a(t);return e.compare(c,h)?(t.values[o]=h,0):(t.values[o]=c,1)}}}const L=j.define({static:!0});class Y{constructor(t,e,i,n,r){this.id=t,this.createF=e,this.updateF=i,this.compareF=n,this.spec=r,this.provides=void 0}static define(t){let e=new Y(E++,t.create,t.update,t.compare||((t,e)=>t===e),t);return t.provide&&(e.provides=t.provide(e)),e}create(t){let e=t.facet(L).find((t=>t.field==this));return((null==e?void 0:e.create)||this.createF)(t)}slot(t){let e=t[this.id]>>1;return{create:t=>(t.values[e]=this.create(t),1),update:(t,i)=>{let n=t.values[e],r=this.updateF(n,i);return this.compareF(n,r)?0:(t.values[e]=r,1)},reconfigure:(t,i)=>{let n,r=t.facet(L),s=i.facet(L);return(n=r.find((t=>t.field==this)))&&n!=s.find((t=>t.field==this))?(t.values[e]=n.create(t),1):null!=i.config.address[this.id]?(t.values[e]=i.field(this),0):(t.values[e]=this.create(t),1)}}}init(t){return[this,L.of({field:this,create:t})]}get extension(){return this}}const I=4,N=3,F=2,H=1;function J(t){return e=>new tt(e,t)}const K={highest:J(0),high:J(H),default:J(F),low:J(N),lowest:J(I)};class tt{constructor(t,e){this.inner=t,this.prec=e}}class et{of(t){return new it(this,t)}reconfigure(t){return et.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class it{constructor(t,e){this.compartment=t,this.inner=e}}class nt{constructor(t,e,i,n,r,s){for(this.base=t,this.compartments=e,this.dynamicSlots=i,this.address=n,this.staticValues=r,this.facets=s,this.statusTemplate=[];this.statusTemplate.length<i.length;)this.statusTemplate.push(0)}staticFacet(t){let e=this.address[t.id];return null==e?t.default:this.staticValues[e>>1]}static resolve(t,e,i){let n=[],r=Object.create(null),s=new Map;for(let i of function(t,e,i){let n=[[],[],[],[],[]],r=new Map;function s(t,o){let a=r.get(t);if(null!=a){if(a<=o)return;let e=n[a].indexOf(t);e>-1&&n[a].splice(e,1),t instanceof it&&i.delete(t.compartment)}if(r.set(t,o),Array.isArray(t))for(let e of t)s(e,o);else if(t instanceof it){if(i.has(t.compartment))throw new RangeError("Duplicate use of compartment in extensions");let n=e.get(t.compartment)||t.inner;i.set(t.compartment,n),s(n,o)}else if(t instanceof tt)s(t.inner,t.prec);else if(t instanceof Y)n[o].push(t),t.provides&&s(t.provides,o);else if(t instanceof W)n[o].push(t),t.facet.extensions&&s(t.facet.extensions,F);else{let e=t.extension;if(!e)throw new Error(`Unrecognized extension value in extension set (${t}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(e,o)}}return s(t,F),n.reduce(((t,e)=>t.concat(e)))}(t,e,s))i instanceof Y?n.push(i):(r[i.facet.id]||(r[i.facet.id]=[])).push(i);let o=Object.create(null),a=[],l=[];for(let t of n)o[t.id]=l.length<<1,l.push((e=>t.slot(e)));let h=null==i?void 0:i.config.facets;for(let t in r){let e=r[t],n=e[0].facet,s=h&&h[t]||[];if(e.every((t=>0==t.type)))if(o[n.id]=a.length<<1|1,D(s,e))a.push(i.facet(n));else{let t=n.combine(e.map((t=>t.value)));a.push(i&&n.compare(t,i.facet(n))?i.facet(n):t)}else{for(let t of e)0==t.type?(o[t.id]=a.length<<1|1,a.push(t.value)):(o[t.id]=l.length<<1,l.push((e=>t.dynamicSlot(e))));o[n.id]=l.length<<1,l.push((t=>G(t,n,e)))}}let c=l.map((t=>t(o)));return new nt(t,s,c,o,a,r)}}function rt(t,e){if(1&e)return 2;let i=e>>1,n=t.status[i];if(4==n)throw new Error("Cyclic dependency between fields and/or facets");if(2&n)return n;t.status[i]=4;let r=t.computeSlot(t,t.config.dynamicSlots[i]);return t.status[i]=2|r}function st(t,e){return 1&e?t.config.staticValues[e>>1]:t.values[e>>1]}const ot=j.define(),at=j.define({combine:t=>t.some((t=>t)),static:!0}),lt=j.define({combine:t=>t.length?t[0]:void 0,static:!0}),ht=j.define(),ct=j.define(),Ot=j.define(),ut=j.define({combine:t=>!!t.length&&t[0]});class ft{constructor(t,e){this.type=t,this.value=e}static define(){return new dt}}class dt{of(t){return new ft(this,t)}}class pt{constructor(t){this.map=t}of(t){return new mt(this,t)}}class mt{constructor(t,e){this.type=t,this.value=e}map(t){let e=this.type.map(this.value,t);return void 0===e?void 0:e==this.value?this:new mt(this.type,e)}is(t){return this.type==t}static define(t={}){return new pt(t.map||(t=>t))}static mapEffects(t,e){if(!t.length)return t;let i=[];for(let n of t){let t=n.map(e);t&&i.push(t)}return i}}mt.reconfigure=mt.define(),mt.appendConfig=mt.define();class gt{constructor(t,e,i,n,r,s){this.startState=t,this.changes=e,this.selection=i,this.effects=n,this.annotations=r,this.scrollIntoView=s,this._doc=null,this._state=null,i&&U(i,e.newLength),r.some((t=>t.type==gt.time))||(this.annotations=r.concat(gt.time.of(Date.now())))}static create(t,e,i,n,r,s){return new gt(t,e,i,n,r,s)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(t){for(let e of this.annotations)if(e.type==t)return e.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let e=this.annotation(gt.userEvent);return!(!e||!(e==t||e.length>t.length&&e.slice(0,t.length)==t&&"."==e[t.length]))}}function Qt(t,e){let i=[];for(let n=0,r=0;;){let s,o;if(n<t.length&&(r==e.length||e[r]>=t[n]))s=t[n++],o=t[n++];else{if(!(r<e.length))return i;s=e[r++],o=e[r++]}!i.length||i[i.length-1]<s?i.push(s,o):i[i.length-1]<o&&(i[i.length-1]=o)}}function bt(t,e,i){var n;let r,s,o;return i?(r=e.changes,s=C.empty(e.changes.length),o=t.changes.compose(e.changes)):(r=e.changes.map(t.changes),s=t.changes.mapDesc(e.changes,!0),o=t.changes.compose(r)),{changes:o,selection:e.selection?e.selection.map(s):null===(n=t.selection)||void 0===n?void 0:n.map(r),effects:mt.mapEffects(t.effects,r).concat(mt.mapEffects(e.effects,s)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function St(t,e,i){let n=e.selection,r=wt(e.annotations);return e.userEvent&&(r=r.concat(gt.userEvent.of(e.userEvent))),{changes:e.changes instanceof C?e.changes:C.of(e.changes||[],i,t.facet(lt)),selection:n&&(n instanceof M?n:M.single(n.anchor,n.head)),effects:wt(e.effects),annotations:r,scrollIntoView:!!e.scrollIntoView}}function yt(t,e,i){let n=St(t,e.length?e[0]:{},t.doc.length);e.length&&!1===e[0].filter&&(i=!1);for(let r=1;r<e.length;r++){!1===e[r].filter&&(i=!1);let s=!!e[r].sequential;n=bt(n,St(t,e[r],s?n.changes.newLength:t.doc.length),s)}let r=gt.create(t,n.changes,n.selection,n.effects,n.annotations,n.scrollIntoView);return function(t){let e=t.startState,i=e.facet(Ot),n=t;for(let r=i.length-1;r>=0;r--){let s=i[r](t);s&&Object.keys(s).length&&(n=bt(n,St(e,s,t.changes.newLength),!0))}return n==t?t:gt.create(e,t.changes,t.selection,n.effects,n.annotations,n.scrollIntoView)}(i?function(t){let e=t.startState,i=!0;for(let n of e.facet(ht)){let e=n(t);if(!1===e){i=!1;break}Array.isArray(e)&&(i=!0===i?e:Qt(i,e))}if(!0!==i){let n,r;if(!1===i)r=t.changes.invertedDesc,n=C.empty(e.doc.length);else{let e=t.changes.filter(i);n=e.changes,r=e.filtered.mapDesc(e.changes).invertedDesc}t=gt.create(e,n,t.selection&&t.selection.map(r),mt.mapEffects(t.effects,r),t.annotations,t.scrollIntoView)}let n=e.facet(ct);for(let i=n.length-1;i>=0;i--){let r=n[i](t);t=r instanceof gt?r:Array.isArray(r)&&1==r.length&&r[0]instanceof gt?r[0]:yt(e,wt(r),!1)}return t}(r):r)}gt.time=ft.define(),gt.userEvent=ft.define(),gt.addToHistory=ft.define(),gt.remote=ft.define();const xt=[];function wt(t){return null==t?xt:Array.isArray(t)?t:[t]}var kt=function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t}(kt||(kt={}));const vt=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let $t;try{$t=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(t){}function Pt(t){return e=>{if(!/\S/.test(e))return kt.Space;if(function(t){if($t)return $t.test(t);for(let e=0;e<t.length;e++){let i=t[e];if(/\w/.test(i)||i>""&&(i.toUpperCase()!=i.toLowerCase()||vt.test(i)))return!0}return!1}(e))return kt.Word;for(let i=0;i<t.length;i++)if(e.indexOf(t[i])>-1)return kt.Word;return kt.Other}}class Tt{constructor(t,e,i,n,r,s){this.config=t,this.doc=e,this.selection=i,this.values=n,this.status=t.statusTemplate.slice(),this.computeSlot=r,s&&(s._state=this);for(let t=0;t<this.config.dynamicSlots.length;t++)rt(this,t<<1);this.computeSlot=null}field(t,e=!0){let i=this.config.address[t.id];if(null!=i)return rt(this,i),st(this,i);if(e)throw new RangeError("Field is not present in this state")}update(...t){return yt(this,t,!0)}applyTransaction(t){let e,i=this.config,{base:n,compartments:r}=i;for(let e of t.effects)e.is(et.reconfigure)?(i&&(r=new Map,i.compartments.forEach(((t,e)=>r.set(e,t))),i=null),r.set(e.value.compartment,e.value.extension)):e.is(mt.reconfigure)?(i=null,n=e.value):e.is(mt.appendConfig)&&(i=null,n=wt(n).concat(e.value));if(i)e=t.startState.values.slice();else{i=nt.resolve(n,r,this),e=new Tt(i,this.doc,this.selection,i.dynamicSlots.map((()=>null)),((t,e)=>e.reconfigure(t,this)),null).values}let s=t.startState.facet(at)?t.newSelection:t.newSelection.asSingle();new Tt(i,t.newDoc,s,e,((e,i)=>i.update(e,t)),t)}replaceSelection(t){return"string"==typeof t&&(t=this.toText(t)),this.changeByRange((e=>({changes:{from:e.from,to:e.to,insert:t},range:M.cursor(e.from+t.length)})))}changeByRange(t){let e=this.selection,i=t(e.ranges[0]),n=this.changes(i.changes),r=[i.range],s=wt(i.effects);for(let i=1;i<e.ranges.length;i++){let o=t(e.ranges[i]),a=this.changes(o.changes),l=a.map(n);for(let t=0;t<i;t++)r[t]=r[t].map(l);let h=n.mapDesc(a,!0);r.push(o.range.map(h)),n=n.compose(l),s=mt.mapEffects(s,l).concat(mt.mapEffects(wt(o.effects),h))}return{changes:n,selection:M.create(r,e.mainIndex),effects:s}}changes(t=[]){return t instanceof C?t:C.of(t,this.doc.length,this.facet(Tt.lineSeparator))}toText(t){return u.of(t.split(this.facet(Tt.lineSeparator)||$))}sliceDoc(t=0,e=this.doc.length){return this.doc.sliceString(t,e,this.lineBreak)}facet(t){let e=this.config.address[t.id];return null==e?t.default:(rt(this,e),st(this,e))}toJSON(t){let e={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(t)for(let i in t){let n=t[i];n instanceof Y&&null!=this.config.address[n.id]&&(e[i]=n.spec.toJSON(this.field(t[i]),this))}return e}static fromJSON(t,e={},i){if(!t||"string"!=typeof t.doc)throw new RangeError("Invalid JSON representation for EditorState");let n=[];if(i)for(let e in i)if(Object.prototype.hasOwnProperty.call(t,e)){let r=i[e],s=t[e];n.push(r.init((t=>r.spec.fromJSON(s,t))))}return Tt.create({doc:t.doc,selection:M.fromJSON(t.selection),extensions:e.extensions?n.concat([e.extensions]):n})}static create(t={}){let e=nt.resolve(t.extensions||[],new Map),i=t.doc instanceof u?t.doc:u.of((t.doc||"").split(e.staticFacet(Tt.lineSeparator)||$)),n=t.selection?t.selection instanceof M?t.selection:M.single(t.selection.anchor,t.selection.head):M.single(0);return U(n,i.length),e.staticFacet(at)||(n=n.asSingle()),new Tt(e,i,n,e.dynamicSlots.map((()=>null)),((t,e)=>e.create(t)),null)}get tabSize(){return this.facet(Tt.tabSize)}get lineBreak(){return this.facet(Tt.lineSeparator)||"\n"}get readOnly(){return this.facet(ut)}phrase(t,...e){for(let e of this.facet(Tt.phrases))if(Object.prototype.hasOwnProperty.call(e,t)){t=e[t];break}return e.length&&(t=t.replace(/\$(\$|\d*)/g,((t,i)=>{if("$"==i)return"$";let n=+(i||1);return!n||n>e.length?t:e[n-1]}))),t}languageDataAt(t,e,i=-1){let n=[];for(let r of this.facet(ot))for(let s of r(this,e,i))Object.prototype.hasOwnProperty.call(s,t)&&n.push(s[t]);return n}charCategorizer(t){return Pt(this.languageDataAt("wordChars",t).join(""))}wordAt(t){let{text:e,from:i,length:n}=this.doc.lineAt(t),r=this.charCategorizer(t),s=t-i,o=t-i;for(;s>0;){let t=x(e,s,!1);if(r(e.slice(t,s))!=kt.Word)break;s=t}for(;o<n;){let t=x(e,o);if(r(e.slice(o,t))!=kt.Word)break;o=t}return s==o?null:M.range(s+i,o+i)}}function Ct(t,e,i={}){let n={};for(let e of t)for(let t of Object.keys(e)){let r=e[t],s=n[t];if(void 0===s)n[t]=r;else if(s===r||void 0===r);else{if(!Object.hasOwnProperty.call(i,t))throw new Error("Config merge conflict for field "+t);n[t]=i[t](s,r)}}for(let t in e)void 0===n[t]&&(n[t]=e[t]);return n}Tt.allowMultipleSelections=at,Tt.tabSize=j.define({combine:t=>t.length?t[0]:4}),Tt.lineSeparator=lt,Tt.readOnly=ut,Tt.phrases=j.define({compare(t,e){let i=Object.keys(t),n=Object.keys(e);return i.length==n.length&&i.every((i=>t[i]==e[i]))}}),Tt.languageData=ot,Tt.changeFilter=ht,Tt.transactionFilter=ct,Tt.transactionExtender=Ot,et.reconfigure=mt.define();class Xt{eq(t){return this==t}range(t,e=t){return At.create(t,e,this)}}Xt.prototype.startSide=Xt.prototype.endSide=0,Xt.prototype.point=!1,Xt.prototype.mapMode=P.TrackDel;let At=class t{constructor(t,e,i){this.from=t,this.to=e,this.value=i}static create(e,i,n){return new t(e,i,n)}};function Rt(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class qt{constructor(t,e,i,n){this.from=t,this.to=e,this.value=i,this.maxPoint=n}get length(){return this.to[this.to.length-1]}findIndex(t,e,i,n=0){let r=i?this.to:this.from;for(let s=n,o=r.length;;){if(s==o)return s;let n=s+o>>1,a=r[n]-t||(i?this.value[n].endSide:this.value[n].startSide)-e;if(n==s)return a>=0?s:o;a>=0?o=n:s=n+1}}between(t,e,i,n){for(let r=this.findIndex(e,-1e9,!0),s=this.findIndex(i,1e9,!1,r);r<s;r++)if(!1===n(this.from[r]+t,this.to[r]+t,this.value[r]))return!1}map(t,e){let i=[],n=[],r=[],s=-1,o=-1;for(let a=0;a<this.value.length;a++){let l,h,c=this.value[a],O=this.from[a]+t,u=this.to[a]+t;if(O==u){let t=e.mapPos(O,c.startSide,c.mapMode);if(null==t)continue;if(l=h=t,c.startSide!=c.endSide&&(h=e.mapPos(O,c.endSide),h<l))continue}else if(l=e.mapPos(O,c.startSide),h=e.mapPos(u,c.endSide),l>h||l==h&&c.startSide>0&&c.endSide<=0)continue;(h-l||c.endSide-c.startSide)<0||(s<0&&(s=l),c.point&&(o=Math.max(o,h-l)),i.push(c),n.push(l-s),r.push(h-s))}return{mapped:i.length?new qt(n,r,i,o):null,pos:s}}}class Zt{constructor(t,e,i,n){this.chunkPos=t,this.chunk=e,this.nextLayer=i,this.maxPoint=n}static create(t,e,i,n){return new Zt(t,e,i,n)}get length(){let t=this.chunk.length-1;return t<0?0:Math.max(this.chunkEnd(t),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let t=this.nextLayer.size;for(let e of this.chunk)t+=e.value.length;return t}chunkEnd(t){return this.chunkPos[t]+this.chunk[t].length}update(t){let{add:e=[],sort:i=!1,filterFrom:n=0,filterTo:r=this.length}=t,s=t.filter;if(0==e.length&&!s)return this;if(i&&(e=e.slice().sort(Rt)),this.isEmpty)return e.length?Zt.of(e):this;let o=new Mt(this,null,-1).goto(0),a=0,l=[],h=new Vt;for(;o.value||a<e.length;)if(a<e.length&&(o.from-e[a].from||o.startSide-e[a].value.startSide)>=0){let t=e[a++];h.addInner(t.from,t.to,t.value)||l.push(t)}else 1==o.rangeIndex&&o.chunkIndex<this.chunk.length&&(a==e.length||this.chunkEnd(o.chunkIndex)<e[a].from)&&(!s||n>this.chunkEnd(o.chunkIndex)||r<this.chunkPos[o.chunkIndex])&&h.addChunk(this.chunkPos[o.chunkIndex],this.chunk[o.chunkIndex])?o.nextChunk():((!s||n>o.to||r<o.from||s(o.from,o.to,o.value))&&(h.addInner(o.from,o.to,o.value)||l.push(At.create(o.from,o.to,o.value))),o.next());return h.finishInner(this.nextLayer.isEmpty&&!l.length?Zt.empty:this.nextLayer.update({add:l,filter:s,filterFrom:n,filterTo:r}))}map(t){if(t.empty||this.isEmpty)return this;let e=[],i=[],n=-1;for(let r=0;r<this.chunk.length;r++){let s=this.chunkPos[r],o=this.chunk[r],a=t.touchesRange(s,s+o.length);if(!1===a)n=Math.max(n,o.maxPoint),e.push(o),i.push(t.mapPos(s));else if(!0===a){let{mapped:r,pos:a}=o.map(s,t);r&&(n=Math.max(n,r.maxPoint),e.push(r),i.push(a))}}let r=this.nextLayer.map(t);return 0==e.length?r:new Zt(i,e,r||Zt.empty,n)}between(t,e,i){if(!this.isEmpty){for(let n=0;n<this.chunk.length;n++){let r=this.chunkPos[n],s=this.chunk[n];if(e>=r&&t<=r+s.length&&!1===s.between(r,t-r,e-r,i))return}this.nextLayer.between(t,e,i)}}iter(t=0){return Ut.from([this]).goto(t)}get isEmpty(){return this.nextLayer==this}static iter(t,e=0){return Ut.from(t).goto(e)}static compare(t,e,i,n,r=-1){let s=t.filter((t=>t.maxPoint>0||!t.isEmpty&&t.maxPoint>=r)),o=e.filter((t=>t.maxPoint>0||!t.isEmpty&&t.maxPoint>=r)),a=_t(s,o,i),l=new jt(s,a,r),h=new jt(o,a,r);i.iterGaps(((t,e,i)=>Dt(l,t,h,e,i,n))),i.empty&&0==i.length&&Dt(l,0,h,0,0,n)}static eq(t,e,i=0,n){null==n&&(n=999999999);let r=t.filter((t=>!t.isEmpty&&e.indexOf(t)<0)),s=e.filter((e=>!e.isEmpty&&t.indexOf(e)<0));if(r.length!=s.length)return!1;if(!r.length)return!0;let o=_t(r,s),a=new jt(r,o,0).goto(i),l=new jt(s,o,0).goto(i);for(;;){if(a.to!=l.to||!Wt(a.active,l.active)||a.point&&(!l.point||!a.point.eq(l.point)))return!1;if(a.to>n)return!0;a.next(),l.next()}}static spans(t,e,i,n,r=-1){let s=new jt(t,null,r).goto(e),o=e,a=s.openStart;for(;;){let t=Math.min(s.to,i);if(s.point){let i=s.activeForPoint(s.to),r=s.pointFrom<e?i.length+1:s.point.startSide<0?i.length:Math.min(i.length,a);n.point(o,t,s.point,i,r,s.pointRank),a=Math.min(s.openEnd(t),i.length)}else t>o&&(n.span(o,t,s.active,a),a=s.openEnd(t));if(s.to>i)return a+(s.point&&s.to>i?1:0);o=s.to,s.next()}}static of(t,e=!1){let i=new Vt;for(let n of t instanceof At?[t]:e?function(t){if(t.length>1)for(let e=t[0],i=1;i<t.length;i++){let n=t[i];if(Rt(e,n)>0)return t.slice().sort(Rt);e=n}return t}(t):t)i.add(n.from,n.to,n.value);return i.finish()}static join(t){if(!t.length)return Zt.empty;let e=t[t.length-1];for(let i=t.length-2;i>=0;i--)for(let n=t[i];n!=Zt.empty;n=n.nextLayer)e=new Zt(n.chunkPos,n.chunk,e,Math.max(n.maxPoint,e.maxPoint));return e}}Zt.empty=new Zt([],[],null,-1),Zt.empty.nextLayer=Zt.empty;class Vt{finishChunk(t){this.chunks.push(new qt(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,t&&(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,e,i){this.addInner(t,e,i)||(this.nextLayer||(this.nextLayer=new Vt)).add(t,e,i)}addInner(t,e,i){let n=t-this.lastTo||i.startSide-this.last.endSide;if(n<=0&&(t-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return!(n<0)&&(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=t),this.from.push(t-this.chunkStart),this.to.push(e-this.chunkStart),this.last=i,this.lastFrom=t,this.lastTo=e,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,e-t)),!0)}addChunk(t,e){if((t-this.lastTo||e.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,e.maxPoint),this.chunks.push(e),this.chunkPos.push(t);let i=e.value.length-1;return this.last=e.value[i],this.lastFrom=e.from[i]+t,this.lastTo=e.to[i]+t,!0}finish(){return this.finishInner(Zt.empty)}finishInner(t){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return t;let e=Zt.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,e}}function _t(t,e,i){let n=new Map;for(let e of t)for(let t=0;t<e.chunk.length;t++)e.chunk[t].maxPoint<=0&&n.set(e.chunk[t],e.chunkPos[t]);let r=new Set;for(let t of e)for(let e=0;e<t.chunk.length;e++){let s=n.get(t.chunk[e]);null==s||(i?i.mapPos(s):s)!=t.chunkPos[e]||(null==i?void 0:i.touchesRange(s,s+t.chunk[e].length))||r.add(t.chunk[e])}return r}class Mt{constructor(t,e,i,n=0){this.layer=t,this.skip=e,this.minPoint=i,this.rank=n}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(t,e=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(t,e,!1),this}gotoInner(t,e,i){for(;this.chunkIndex<this.layer.chunk.length;){let e=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(e)||this.layer.chunkEnd(this.chunkIndex)<t||e.maxPoint<this.minPoint))break;this.chunkIndex++,i=!1}if(this.chunkIndex<this.layer.chunk.length){let n=this.layer.chunk[this.chunkIndex].findIndex(t-this.layer.chunkPos[this.chunkIndex],e,!0);(!i||this.rangeIndex<n)&&this.setRangeIndex(n)}this.next()}forward(t,e){(this.to-t||this.endSide-e)<0&&this.gotoInner(t,e,!0)}next(){for(;;){if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}{let t=this.layer.chunkPos[this.chunkIndex],e=this.layer.chunk[this.chunkIndex],i=t+e.from[this.rangeIndex];if(this.from=i,this.to=t+e.to[this.rangeIndex],this.value=e.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}}setRangeIndex(t){if(t==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=t}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(t){return this.from-t.from||this.startSide-t.startSide||this.rank-t.rank||this.to-t.to||this.endSide-t.endSide}}class Ut{constructor(t){this.heap=t}static from(t,e=null,i=-1){let n=[];for(let r=0;r<t.length;r++)for(let s=t[r];!s.isEmpty;s=s.nextLayer)s.maxPoint>=i&&n.push(new Mt(s,e,i,r));return 1==n.length?n[0]:new Ut(n)}get startSide(){return this.value?this.value.startSide:0}goto(t,e=-1e9){for(let i of this.heap)i.goto(t,e);for(let t=this.heap.length>>1;t>=0;t--)Et(this.heap,t);return this.next(),this}forward(t,e){for(let i of this.heap)i.forward(t,e);for(let t=this.heap.length>>1;t>=0;t--)Et(this.heap,t);(this.to-t||this.value.endSide-e)<0&&this.next()}next(){if(0==this.heap.length)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let t=this.heap[0];this.from=t.from,this.to=t.to,this.value=t.value,this.rank=t.rank,t.value&&t.next(),Et(this.heap,0)}}}function Et(t,e){for(let i=t[e];;){let n=1+(e<<1);if(n>=t.length)break;let r=t[n];if(n+1<t.length&&r.compare(t[n+1])>=0&&(r=t[n+1],n++),i.compare(r)<0)break;t[n]=i,t[e]=r,e=n}}class jt{constructor(t,e,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Ut.from(t,e,i)}goto(t,e=-1e9){return this.cursor.goto(t,e),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=t,this.endSide=e,this.openStart=-1,this.next(),this}forward(t,e){for(;this.minActive>-1&&(this.activeTo[this.minActive]-t||this.active[this.minActive].endSide-e)<0;)this.removeActive(this.minActive);this.cursor.forward(t,e)}removeActive(t){zt(this.active,t),zt(this.activeTo,t),zt(this.activeRank,t),this.minActive=Gt(this.active,this.activeTo)}addActive(t){let e=0,{value:i,to:n,rank:r}=this.cursor;for(;e<this.activeRank.length&&(r-this.activeRank[e]||n-this.activeTo[e])>0;)e++;Bt(this.active,e,i),Bt(this.activeTo,e,n),Bt(this.activeRank,e,r),t&&Bt(t,e,this.cursor.from),this.minActive=Gt(this.active,this.activeTo)}next(){let t=this.to,e=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let n=this.minActive;if(n>-1&&(this.activeTo[n]-this.cursor.from||this.active[n].endSide-this.cursor.startSide)<0){if(this.activeTo[n]>t){this.to=this.activeTo[n],this.endSide=this.active[n].endSide;break}this.removeActive(n),i&&zt(i,n)}else{if(!this.cursor.value){this.to=this.endSide=1e9;break}if(this.cursor.from>t){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}{let t=this.cursor.value;if(t.point){if(!(e&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)){this.point=t,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=t.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}this.cursor.next()}else this.addActive(i),this.cursor.next()}}}if(i){this.openStart=0;for(let e=i.length-1;e>=0&&i[e]<t;e--)this.openStart++}}activeForPoint(t){if(!this.active.length)return this.active;let e=[];for(let i=this.active.length-1;i>=0&&!(this.activeRank[i]<this.pointRank);i--)(this.activeTo[i]>t||this.activeTo[i]==t&&this.active[i].endSide>=this.point.endSide)&&e.push(this.active[i]);return e.reverse()}openEnd(t){let e=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>t;i--)e++;return e}}function Dt(t,e,i,n,r,s){t.goto(e),i.goto(n);let o=n+r,a=n,l=n-e;for(;;){let e=t.to+l-i.to,n=e||t.endSide-i.endSide,r=n<0?t.to+l:i.to,h=Math.min(r,o);if(t.point||i.point?t.point&&i.point&&(t.point==i.point||t.point.eq(i.point))&&Wt(t.activeForPoint(t.to),i.activeForPoint(i.to))||s.comparePoint(a,h,t.point,i.point):h>a&&!Wt(t.active,i.active)&&s.compareRange(a,h,t.active,i.active),r>o)break;(e||t.openEnd!=i.openEnd)&&s.boundChange&&s.boundChange(r),a=r,n<=0&&t.next(),n>=0&&i.next()}}function Wt(t,e){if(t.length!=e.length)return!1;for(let i=0;i<t.length;i++)if(t[i]!=e[i]&&!t[i].eq(e[i]))return!1;return!0}function zt(t,e){for(let i=e,n=t.length-1;i<n;i++)t[i]=t[i+1];t.pop()}function Bt(t,e,i){for(let i=t.length-1;i>=e;i--)t[i+1]=t[i];t[e]=i}function Gt(t,e){let i=-1,n=1e9;for(let r=0;r<e.length;r++)(e[r]-n||t[r].endSide-t[i].endSide)<0&&(i=r,n=e[r]);return i}function Lt(t,e,i=t.length){let n=0;for(let r=0;r<i&&r<t.length;)9==t.charCodeAt(r)?(n+=e-n%e,r++):(n++,r=x(t,r));return n}function Yt(t,e,i,n){for(let n=0,r=0;;){if(r>=e)return n;if(n==t.length)break;r+=9==t.charCodeAt(n)?i-r%i:1,n=x(t,n)}return!0===n?-1:t.length}const It="undefined"==typeof Symbol?"__ͼ":Symbol.for("ͼ"),Nt="undefined"==typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),Ft="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{};class Ht{constructor(t,e){this.rules=[];let{finish:i}=e||{};function n(t){return/^@/.test(t)?[t]:t.split(/,\s*/)}function r(t,e,s,o){let a=[],l=/^@(\w+)\b/.exec(t[0]),h=l&&"keyframes"==l[1];if(l&&null==e)return s.push(t[0]+";");for(let i in e){let o=e[i];if(/&/.test(i))r(i.split(/,\s*/).map((e=>t.map((t=>e.replace(/&/,t))))).reduce(((t,e)=>t.concat(e))),o,s);else if(o&&"object"==typeof o){if(!l)throw new RangeError("The value of a property ("+i+") should be a primitive value.");r(n(i),o,a,h)}else null!=o&&a.push(i.replace(/_.*/,"").replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))+": "+o+";")}(a.length||h)&&s.push((!i||l||o?t:t.map(i)).join(", ")+" {"+a.join(" ")+"}")}for(let e in t)r(n(e),t[e],this.rules)}getRules(){return this.rules.join("\n")}static newName(){let t=Ft[It]||1;return Ft[It]=t+1,"ͼ"+t.toString(36)}static mount(t,e,i){let n=t[Nt],r=i&&i.nonce;n?r&&n.setNonce(r):n=new Kt(t,r),n.mount(Array.isArray(e)?e:[e],t)}}let Jt=new Map;class Kt{constructor(t,e){let i=t.ownerDocument||t,n=i.defaultView;if(!t.head&&t.adoptedStyleSheets&&n.CSSStyleSheet){let e=Jt.get(i);if(e)return t[Nt]=e;this.sheet=new n.CSSStyleSheet,Jt.set(i,this)}else this.styleTag=i.createElement("style"),e&&this.styleTag.setAttribute("nonce",e);this.modules=[],t[Nt]=this}mount(t,e){let i=this.sheet,n=0,r=0;for(let e=0;e<t.length;e++){let s=t[e],o=this.modules.indexOf(s);if(o<r&&o>-1&&(this.modules.splice(o,1),r--,o=-1),-1==o){if(this.modules.splice(r++,0,s),i