diff --git a/public/temp/astra.js b/public/temp/astra.js new file mode 100644 index 00000000..b4075cf3 --- /dev/null +++ b/public/temp/astra.js @@ -0,0 +1,4451 @@ +var Astra=function(t){"use strict";let e=[],i=[];function n(t){if(t<768)return!1;for(let n=0,r=e.length;;){let o=n+r>>1;if(t=i[o]))return!0;n=o+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=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=s(t,e-2,i);if(n=56320&&t<57344}function c(t){return t>=55296&&t<56320}function u(t){return t<65536?1:2}class d{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]=x(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),f.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]=x(this,t,e);let i=[];return this.decompose(t,e,i,0),f.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 v(this),r=new v(t);for(let t=e,o=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(o+=n.value.length,n.done||o>=i)return!0}}iter(t=1){return new v(this,t)}iterRange(t,e=this.length){return new y(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 p(t):f.from(p.split(t,[])):d.empty}}class p extends d{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 o=this.text[r],s=n+o.length;if((e?i:s)>=t)return new w(n,s,i,o);n=s+1,i++}}decompose(t,e,i,n){let r=t<=0&&e>=this.length?this:new p(m(this.text,t,e),Math.min(e,this.length)-Math.max(0,t));if(1&n){let t=i.pop(),e=g(r.text,t.text.slice(),0,r.length);if(e.length<=32)i.push(new p(e,t.length+r.length));else{let t=e.length>>1;i.push(new p(e.slice(0,t)),new p(e.slice(t)))}}else i.push(r)}replace(t,e,i){if(!(i instanceof p))return super.replace(t,e,i);[t,e]=x(this,t,e);let n=g(this.text,g(i.text,m(this.text,0,t)),e),r=this.length+i.length-(e-t);return n.length<=32?new p(n,r):f.from(p.split(n,[]),r)}sliceString(t,e=this.length,i="\n"){[t,e]=x(this,t,e);let n="";for(let r=0,o=0;r<=e&&ot&&o&&(n+=i),tr&&(n+=s.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 p(i,n)),i=[],n=-1);return n>-1&&e.push(new p(i,n)),e}}class f extends d{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 o=this.children[r],s=n+o.length,a=i+o.lines-1;if((e?a:s)>=t)return o.lineInner(t,e,i,n);n=s+1,i=a+1}}decompose(t,e,i,n){for(let r=0,o=0;o<=e&&r=o){let r=n&((o<=t?1:0)|(a>=e?2:0));o>=t&&a<=e&&!r?i.push(s):s.decompose(t-o,e-o,i,r)}o=a+1}}replace(t,e,i){if([t,e]=x(this,t,e),i.lines=r&&e<=s){let a=o.replace(t-r,e-r,i),l=this.lines-o.lines+a.lines;if(a.lines>4&&a.lines>l>>6){let r=this.children.slice();return r[n]=a,new f(r,this.length-(e-t)+i.length)}return super.replace(r,s,a)}r=s+1}return super.replace(t,e,i)}sliceString(t,e=this.length,i="\n"){[t,e]=x(this,t,e);let n="";for(let r=0,o=0;rt&&r&&(n+=i),to&&(n+=s.sliceString(t-o,e-o,i)),o=a+1}return n}flatten(t){for(let e of this.children)e.flatten(t)}scanIdentical(t,e){if(!(t instanceof f))return 0;let i=0,[n,r,o,s]=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==o||r==s)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 p(i,e)}let n=Math.max(32,i>>5),r=n<<1,o=n>>1,s=[],a=0,l=-1,h=[];function c(t){let e;if(t.lines>r&&t instanceof f)for(let e of t.children)c(e);else t.lines>o&&(a>o||!a)?(u(),s.push(t)):t instanceof p&&a&&(e=h[h.length-1])instanceof p&&t.lines+e.lines<=32?(a+=t.lines,l+=t.length+1,h[h.length-1]=new p(e.text.concat(t.text),e.length+1+t.length)):(a+t.lines>n&&u(),a+=t.lines,l+=t.length+1,h.push(t))}function u(){0!=a&&(s.push(1==h.length?h[0]:f.from(h,l)),l=-1,a=h.length=0)}for(let e of t)c(e);return u(),1==s.length?s[0]:new f(s,e)}}function g(t,e,i=0,n=1e9){for(let r=0,o=0,s=!0;o=i&&(l>n&&(a=a.slice(0,n-r)),r0?1:(t instanceof p?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],o=r>>1,s=n instanceof p?n.text.length:n.children.length;if(o==(e>0?s: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 p){let r=n.text[o+(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[o+(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 p?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 y{constructor(t,e,i){this.value="",this.done=!1,this.cursor=new v(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&&(d.prototype[Symbol.iterator]=function(){return this.iter()},v.prototype[Symbol.iterator]=y.prototype[Symbol.iterator]=b.prototype[Symbol.iterator]=function(){return this});let w=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 x(t,e,i){return[e=Math.max(0,Math.min(t.length,e)),Math.max(e,Math.min(t.length,i))]}function _(t,e,i=!0,n=!0){return o(t,e,i,n)}function k(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 S(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t)))}function A(t){return t<65536?1:2}const C=/\r\n?|\n/;var M=function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t}(M||(M={}));class D{constructor(t){this.sections=t}get length(){let t=0;for(let e=0;et)return r+(t-n);r+=s}else{if(i!=M.Simple&&l>=t&&(i==M.TrackDel&&nt||i==M.TrackBefore&&nt))return null;if(l>t||l==t&&e<0&&!s)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=0&&n<=e&&r>=t)return!(ne)||"cover";n=r}return!1}toString(){let t="";for(let e=0;e=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 D(t)}static create(t){return new D(t)}}class T extends D{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 E(this,((e,i,n,r,o)=>t=t.replace(n,n+(i-e),o)),!1),t}mapDesc(t,e=!1){return P(this,t,e,!0)}invert(t){let e=this.sections.slice(),i=[];for(let n=0,r=0;n=0){e[n]=s,e[n+1]=o;let a=n>>1;for(;i.length0&&O(i,e,r.text),r.forward(t),s+=t}let l=t[o++];for(;s>1].toJSON()))}return t}static of(t,e,i){let n=[],r=[],o=0,s=null;function a(t=!1){if(!t&&!n.length)return;os||t<0||s>e)throw new RangeError(`Invalid change range ${t} to ${s} (in doc of length ${e})`);let c=h?"string"==typeof h?d.of(h.split(i||C)):h:d.empty,u=c.length;if(t==s&&0==u)return;to&&I(n,t-o,-1),I(n,s-t,u),O(r,n,c),o=s}}(t),a(!s),s}static empty(t){return new T(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;ne&&"string"!=typeof t)))throw new RangeError("Invalid JSON representation of ChangeSet");if(1==r.length)e.push(r[0],0);else{for(;i.length=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 O(t,e,i){if(0==i.length)return;let n=e.length-2>>1;if(n>1])),!(i||s==t.sections.length||t.sections[s+1]<0);)a=t.sections[s++],l=t.sections[s++];e(r,h,o,c,u),r=h,o=c}}}function P(t,e,i,n=!1){let r=[],o=n?[]:null,s=new R(t),a=new R(e);for(let t=-1;;){if(s.done&&a.len||a.done&&s.len)throw new Error("Mismatched change set lengths");if(-1==s.ins&&-1==a.ins){let t=Math.min(s.len,a.len);I(r,t,-1),s.forward(t),a.forward(t)}else if(a.ins>=0&&(s.ins<0||t==s.i||0==s.off&&(a.len=0&&t=0)){if(s.done&&a.done)return o?T.createSet(r,o):D.create(r);throw new Error("Mismatched change set lengths")}{let e=0,i=s.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.lene||s.ins>=0&&s.len>e)&&(t||n.length>i),o.forward2(e),s.forward(e)}}else I(n,0,s.ins,t),r&&O(r,n,s.text),s.next()}}class R{constructor(t){this.set=t,this.i=0,this.next()}next(){let{sections:t}=this.set;this.i>1;return e>=t.length?d.empty:t[e]}textBit(t){let{inserted:e}=this.set,i=this.i-2>>1;return i>=e.length&&!t?d.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 N{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 N(i,n,this.flags)}extend(t,e=t){if(t<=this.anchor&&e>=this.anchor)return B.range(t,e);let i=Math.abs(t-this.anchor)>Math.abs(e-this.anchor)?t:e;return B.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 B.range(t.anchor,t.head)}static create(t,e,i){return new N(t,e,i)}}class B{constructor(t,e){this.ranges=t,this.mainIndex=e}map(t,e=-1){return t.empty?this:B.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;it.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 B(t.ranges.map((t=>N.fromJSON(t))),t.main)}static single(t,e=t){return new B([B.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;nt?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;in.head?B.range(s,o):B.range(o,s))}}return new B(t,e)}}function z(t,e){for(let i of t.ranges)if(i.to>e)throw new RangeError("Selection points outside of document")}let $=0;class F{constructor(t,e,i,n,r){this.combine=t,this.compareInput=e,this.compare=i,this.isStatic=n,this.id=$++,this.default=t([]),this.extensions="function"==typeof r?r(this):r}get reader(){return this}static define(t={}){return new F(t.combine||(t=>t),t.compareInput||((t,e)=>t===e),t.compare||(t.combine?(t,e)=>t===e:V),!!t.static,t.enables)}of(t){return new H([],this,0,t)}compute(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new H(t,this,1,e)}computeN(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new H(t,this,2,e)}from(t,e){return e||(e=t=>t),this.compute([t],(i=>e(i.field(t))))}}function V(t,e){return t==e||t.length==e.length&&t.every(((t,i)=>t===e[i]))}class H{constructor(t,e,i,n){this.dependencies=t,this.facet=e,this.type=i,this.value=n,this.id=$++}dynamicSlot(t){var e;let i=this.value,n=this.facet.compareInput,r=this.id,o=t[r]>>1,s=2==this.type,a=!1,l=!1,h=[];for(let i of this.dependencies)"doc"==i?a=!0:"selection"==i?l=!0:1&(null!==(e=t[i.id])&&void 0!==e?e:1)||h.push(t[i.id]);return{create:t=>(t.values[o]=i(t),1),update(t,e){if(a&&e.docChanged||l&&(e.docChanged||e.selection)||U(t,h)){let e=i(t);if(s?!W(e,t.values[o],n):!n(e,t.values[o]))return t.values[o]=e,1}return 0},reconfigure:(t,e)=>{let a,l=e.config.address[r];if(null!=l){let r=ot(e,l);if(this.dependencies.every((i=>i instanceof F?e.facet(i)===t.facet(i):!(i instanceof q)||e.field(i,!1)==t.field(i,!1)))||(s?W(a=i(t),r,n):n(a=i(t),r)))return t.values[o]=r,0}else a=i(t);return t.values[o]=a,1}}}}function W(t,e,i){if(t.length!=e.length)return!1;for(let n=0;nt[e.id])),r=i.map((t=>t.type)),o=n.filter((t=>!(1&t))),s=t[e.id]>>1;function a(t){let i=[];for(let e=0;et===e),t);return t.provide&&(e.provides=t.provide(e)),e}create(t){let e=t.facet(G).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)=>null!=i.config.address[this.id]?(t.values[e]=i.field(this),0):(t.values[e]=this.create(t),1)}}init(t){return[this,G.of({field:this,create:t})]}get extension(){return this}}const Y=4,X=3,K=2,Z=1;function J(t){return e=>new tt(e,t)}const Q={highest:J(0),high:J(Z),default:J(K),low:J(X),lowest:J(Y)};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,o){for(this.base=t,this.compartments=e,this.dynamicSlots=i,this.address=n,this.staticValues=r,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(t,e,i){let n=[],r=Object.create(null),o=new Map;for(let i of function(t,e,i){let n=[[],[],[],[],[]],r=new Map;function o(t,s){let a=r.get(t);if(null!=a){if(a<=s)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,s),Array.isArray(t))for(let e of t)o(e,s);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),o(n,s)}else if(t instanceof tt)o(t.inner,t.prec);else if(t instanceof q)n[s].push(t),t.provides&&o(t.provides,s);else if(t instanceof H)n[s].push(t),t.facet.extensions&&o(t.facet.extensions,K);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.`);o(e,s)}}return o(t,K),n.reduce(((t,e)=>t.concat(e)))}(t,e,o))i instanceof q?n.push(i):(r[i.facet.id]||(r[i.facet.id]=[])).push(i);let s=Object.create(null),a=[],l=[];for(let t of n)s[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,o=h&&h[t]||[];if(e.every((t=>0==t.type)))if(s[n.id]=a.length<<1|1,V(o,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?(s[t.id]=a.length<<1|1,a.push(t.value)):(s[t.id]=l.length<<1,l.push((e=>t.dynamicSlot(e))));s[n.id]=l.length<<1,l.push((t=>j(t,n,e)))}}let c=l.map((t=>t(s)));return new nt(t,o,c,s,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 ot(t,e){return 1&e?t.config.staticValues[e>>1]:t.values[e>>1]}const st=F.define(),at=F.define({combine:t=>t.some((t=>t)),static:!0}),lt=F.define({combine:t=>t.length?t[0]:void 0,static:!0}),ht=F.define(),ct=F.define(),ut=F.define(),dt=F.define({combine:t=>!!t.length&&t[0]});class pt{constructor(t,e){this.type=t,this.value=e}static define(){return new ft}}class ft{of(t){return new pt(this,t)}}class gt{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 gt(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 vt{constructor(t,e,i,n,r,o){this.startState=t,this.changes=e,this.selection=i,this.effects=n,this.annotations=r,this.scrollIntoView=o,this._doc=null,this._state=null,i&&z(i,e.newLength),r.some((t=>t.type==vt.time))||(this.annotations=r.concat(vt.time.of(Date.now())))}static create(t,e,i,n,r,o){return new vt(t,e,i,n,r,o)}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(vt.userEvent);return!(!e||!(e==t||e.length>t.length&&e.slice(0,t.length)==t&&"."==e[t.length]))}}function yt(t,e){let i=[];for(let n=0,r=0;;){let o,s;if(n=t[n]))o=t[n++],s=t[n++];else{if(!(r=0;r--){let o=i[r](t);o&&Object.keys(o).length&&(n=bt(n,wt(e,o,t.changes.newLength),!0))}return n==t?t:vt.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:yt(i,e))}if(!0!==i){let n,r;if(!1===i)r=t.changes.invertedDesc,n=T.empty(e.doc.length);else{let e=t.changes.filter(i);n=e.changes,r=e.filtered.mapDesc(e.changes).invertedDesc}t=vt.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 vt?r:Array.isArray(r)&&1==r.length&&r[0]instanceof vt?r[0]:xt(e,kt(r),!1)}return t}(r):r)}vt.time=pt.define(),vt.userEvent=pt.define(),vt.addToHistory=pt.define(),vt.remote=pt.define();const _t=[];function kt(t){return null==t?_t:Array.isArray(t)?t:[t]}var St=function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t}(St||(St={}));const At=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let Ct;try{Ct=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(Mu){}function Mt(t){return e=>{if(!/\S/.test(e))return St.Space;if(function(t){if(Ct)return Ct.test(t);for(let e=0;e"€"&&(i.toUpperCase()!=i.toLowerCase()||At.test(i)))return!0}return!1}(e))return St.Word;for(let i=0;i-1)return St.Word;return St.Other}}class Dt{constructor(t,e,i,n,r,o){this.config=t,this.doc=e,this.selection=i,this.values=n,this.status=t.statusTemplate.slice(),this.computeSlot=r,o&&(o._state=this);for(let t=0;tr.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=kt(n).concat(e.value));if(i)e=t.startState.values.slice();else{i=nt.resolve(n,r,this),e=new Dt(i,this.doc,this.selection,i.dynamicSlots.map((()=>null)),((t,e)=>e.reconfigure(t,this)),null).values}let o=t.startState.facet(at)?t.newSelection:t.newSelection.asSingle();new Dt(i,t.newDoc,o,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:B.cursor(e.from+t.length)})))}changeByRange(t){let e=this.selection,i=t(e.ranges[0]),n=this.changes(i.changes),r=[i.range],o=kt(i.effects);for(let i=1;ir.spec.fromJSON(o,t))))}return Dt.create({doc:t.doc,selection:B.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 d?t.doc:d.of((t.doc||"").split(e.staticFacet(Dt.lineSeparator)||C)),n=t.selection?t.selection instanceof B?t.selection:B.single(t.selection.anchor,t.selection.head):B.single(0);return z(n,i.length),e.staticFacet(at)||(n=n.asSingle()),new Dt(e,i,n,e.dynamicSlots.map((()=>null)),((t,e)=>e.create(t)),null)}get tabSize(){return this.facet(Dt.tabSize)}get lineBreak(){return this.facet(Dt.lineSeparator)||"\n"}get readOnly(){return this.facet(dt)}phrase(t,...e){for(let e of this.facet(Dt.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(st))for(let o of r(this,e,i))Object.prototype.hasOwnProperty.call(o,t)&&n.push(o[t]);return n}charCategorizer(t){return Mt(this.languageDataAt("wordChars",t).join(""))}wordAt(t){let{text:e,from:i,length:n}=this.doc.lineAt(t),r=this.charCategorizer(t),o=t-i,s=t-i;for(;o>0;){let t=_(e,o,!1);if(r(e.slice(t,o))!=St.Word)break;o=t}for(;st.length?t[0]:4}),Dt.lineSeparator=lt,Dt.readOnly=dt,Dt.phrases=F.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]))}}),Dt.languageData=st,Dt.changeFilter=ht,Dt.transactionFilter=ct,Dt.transactionExtender=ut,et.reconfigure=mt.define();class It{eq(t){return this==t}range(t,e=t){return Ot.create(t,e,this)}}It.prototype.startSide=It.prototype.endSide=0,It.prototype.point=!1,It.prototype.mapMode=M.TrackDel;let Ot=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 Et(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class Pt{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 o=n,s=r.length;;){if(o==s)return o;let n=o+s>>1,a=r[n]-t||(i?this.value[n].endSide:this.value[n].startSide)-e;if(n==o)return a>=0?o:s;a>=0?s=n:o=n+1}}between(t,e,i,n){for(let r=this.findIndex(e,-1e9,!0),o=this.findIndex(i,1e9,!1,r);rh||l==h&&c.startSide>0&&c.endSide<=0)continue;(h-l||c.endSide-c.startSide)<0||(o<0&&(o=l),c.point&&(s=Math.max(s,h-l)),i.push(c),n.push(l-o),r.push(h-o))}return{mapped:i.length?new Pt(n,r,i,s):null,pos:o}}}class Lt{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 Lt(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,o=t.filter;if(0==e.length&&!o)return this;if(i&&(e=e.slice().sort(Et)),this.isEmpty)return e.length?Lt.of(e):this;let s=new Bt(this,null,-1).goto(0),a=0,l=[],h=new Rt;for(;s.value||a=0){let t=e[a++];h.addInner(t.from,t.to,t.value)||l.push(t)}else 1==s.rangeIndex&&s.chunkIndexthis.chunkEnd(s.chunkIndex)||rs.to||r=r&&t<=r+o.length&&!1===o.between(r,t-r,e-r,i))return}this.nextLayer.between(t,e,i)}}iter(t=0){return zt.from([this]).goto(t)}get isEmpty(){return this.nextLayer==this}static iter(t,e=0){return zt.from(t).goto(e)}static compare(t,e,i,n,r=-1){let o=t.filter((t=>t.maxPoint>0||!t.isEmpty&&t.maxPoint>=r)),s=e.filter((t=>t.maxPoint>0||!t.isEmpty&&t.maxPoint>=r)),a=Nt(o,s,i),l=new Ft(o,a,r),h=new Ft(s,a,r);i.iterGaps(((t,e,i)=>Vt(l,t,h,e,i,n))),i.empty&&0==i.length&&Vt(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)),o=e.filter((e=>!e.isEmpty&&t.indexOf(e)<0));if(r.length!=o.length)return!1;if(!r.length)return!0;let s=Nt(r,o),a=new Ft(r,s,0).goto(i),l=new Ft(o,s,0).goto(i);for(;;){if(a.to!=l.to||!Ht(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 o=new Ft(t,null,r).goto(e),s=e,a=o.openStart;for(;;){let t=Math.min(o.to,i);if(o.point){let i=o.activeForPoint(o.to),r=o.pointFroms&&(n.span(s,t,o.active,a),a=o.openEnd(t));if(o.to>i)return a+(o.point&&o.to>i?1:0);s=o.to,o.next()}}static of(t,e=!1){let i=new Rt;for(let n of t instanceof Ot?[t]:e?function(t){if(t.length>1)for(let e=t[0],i=1;i0)return t.slice().sort(Et);e=n}return t}(t):t)i.add(n.from,n.to,n.value);return i.finish()}static join(t){if(!t.length)return Lt.empty;let e=t[t.length-1];for(let i=t.length-2;i>=0;i--)for(let n=t[i];n!=Lt.empty;n=n.nextLayer)e=new Lt(n.chunkPos,n.chunk,e,Math.max(n.maxPoint,e.maxPoint));return e}}Lt.empty=new Lt([],[],null,-1),Lt.empty.nextLayer=Lt.empty;class Rt{finishChunk(t){this.chunks.push(new Pt(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 Rt)).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(Lt.empty)}finishInner(t){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return t;let e=Lt.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,e}}function Nt(t,e,i){let n=new Map;for(let e of t)for(let t=0;t=this.minPoint)break}}}setRangeIndex(t){if(t==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=i&&n.push(new Bt(o,e,i,r));return 1==n.length?n[0]:new zt(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--)$t(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--)$t(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(),$t(this.heap,0)}}}function $t(t,e){for(let i=t[e];;){let n=1+(e<<1);if(n>=t.length)break;let r=t[n];if(n+1=0&&(r=t[n+1],n++),i.compare(r)<0)break;t[n]=i,t[e]=r,e=n}}class Ft{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=zt.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){Wt(this.active,t),Wt(this.activeTo,t),Wt(this.activeRank,t),this.minActive=jt(this.active,this.activeTo)}addActive(t){let e=0,{value:i,to:n,rank:r}=this.cursor;for(;e0;)e++;Ut(this.active,e,i),Ut(this.activeTo,e,n),Ut(this.activeRank,e,r),t&&Ut(t,e,this.cursor.from),this.minActive=jt(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&&Wt(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=0&&i[e]=0&&!(this.activeRank[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 Vt(t,e,i,n,r,o){t.goto(e),i.goto(n);let s=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,s);if(t.point||i.point?t.point&&i.point&&(t.point==i.point||t.point.eq(i.point))&&Ht(t.activeForPoint(t.to),i.activeForPoint(i.to))||o.comparePoint(a,h,t.point,i.point):h>a&&!Ht(t.active,i.active)&&o.compareRange(a,h,t.active,i.active),r>s)break;(e||t.openEnd!=i.openEnd)&&o.boundChange&&o.boundChange(r),a=r,n<=0&&t.next(),n>=0&&i.next()}}function Ht(t,e){if(t.length!=e.length)return!1;for(let i=0;i=e;i--)t[i+1]=t[i];t[e]=i}function jt(t,e){let i=-1,n=1e9;for(let r=0;rt.map((t=>e.replace(/&/,t))))).reduce(((t,e)=>t.concat(e))),s,o);else if(s&&"object"==typeof s){if(!l)throw new RangeError("The value of a property ("+i+") should be a primitive value.");r(n(i),s,a,h)}else null!=s&&a.push(i.replace(/_.*/,"").replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))+": "+s+";")}(a.length||h)&&o.push((!i||l||s?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=Xt[qt]||1;return Xt[qt]=t+1,"ͼ"+t.toString(36)}static mount(t,e,i){let n=t[Yt],r=i&&i.nonce;n?r&&n.setNonce(r):n=new Jt(t,r),n.mount(Array.isArray(e)?e:[e],t)}}let Zt=new Map;class Jt{constructor(t,e){let i=t.ownerDocument||t,n=i.defaultView;if(!t.head&&t.adoptedStyleSheets&&n.CSSStyleSheet){let e=Zt.get(i);if(e)return t[Yt]=e;this.sheet=new n.CSSStyleSheet,Zt.set(i,this)}else this.styleTag=i.createElement("style"),e&&this.styleTag.setAttribute("nonce",e);this.modules=[],t[Yt]=this}mount(t,e){let i=this.sheet,n=0,r=0;for(let e=0;e-1&&(this.modules.splice(s,1),r--,s=-1),-1==s){if(this.modules.splice(r++,0,o),i)for(let t=0;t",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},ee="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),ie="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),ne=0;ne<10;ne++)Qt[48+ne]=Qt[96+ne]=String(ne);for(ne=1;ne<=24;ne++)Qt[ne+111]="F"+ne;for(ne=65;ne<=90;ne++)Qt[ne]=String.fromCharCode(ne+32),te[ne]=String.fromCharCode(ne);for(var re in Qt)te.hasOwnProperty(re)||(te[re]=Qt[re]);function oe(t){let e;return e=11==t.nodeType?t.getSelection?t:t.ownerDocument:t,e.getSelection()}function se(t,e){return!!e&&(t==e||t.contains(1!=e.nodeType?e.parentNode:e))}function ae(t,e){if(!e.anchorNode)return!1;try{return se(t,e.anchorNode)}catch(t){return!1}}function le(t){return 3==t.nodeType?xe(t,0,t.nodeValue.length).getClientRects():1==t.nodeType?t.getClientRects():[]}function he(t,e,i,n){return!!i&&(de(t,e,i,n,-1)||de(t,e,i,n,1))}function ce(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e}function ue(t){return 1==t.nodeType&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function de(t,e,i,n,r){for(;;){if(t==i&&e==n)return!0;if(e==(r<0?0:pe(t))){if("DIV"==t.nodeName)return!1;let i=t.parentNode;if(!i||1!=i.nodeType)return!1;e=ce(t)+(r<0?0:1),t=i}else{if(1!=t.nodeType)return!1;if(1==(t=t.childNodes[e+(r<0?-1:0)]).nodeType&&"false"==t.contentEditable)return!1;e=r<0?pe(t):0}}}function pe(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function fe(t,e){let i=e?t.left:t.right;return{left:i,right:i,top:t.top,bottom:t.bottom}}function ge(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function me(t,e){let i=e.width/t.offsetWidth,n=e.height/t.offsetHeight;return(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.width-t.offsetWidth)<1)&&(i=1),(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.height-t.offsetHeight)<1)&&(n=1),{scaleX:i,scaleY:n}}class ve{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(t){return this.anchorNode==t.anchorNode&&this.anchorOffset==t.anchorOffset&&this.focusNode==t.focusNode&&this.focusOffset==t.focusOffset}setRange(t){let{anchorNode:e,focusNode:i}=t;this.set(e,Math.min(t.anchorOffset,e?pe(e):0),i,Math.min(t.focusOffset,i?pe(i):0))}set(t,e,i,n){this.anchorNode=t,this.anchorOffset=e,this.focusNode=i,this.focusOffset=n}}let ye,be=null;function we(t){if(t.setActive)return t.setActive();if(be)return t.focus(be);let e=[];for(let i=t;i&&(e.push(i,i.scrollTop,i.scrollLeft),i!=i.ownerDocument);i=i.parentNode);if(t.focus(null==be?{get preventScroll(){return be={preventScroll:!0},!0}}:void 0),!be){be=!1;for(let t=0;tMath.max(1,t.scrollHeight-t.clientHeight-4)}function Ae(t,e){for(let i=t,n=e;;){if(3==i.nodeType&&n>0)return{node:i,offset:n};if(1==i.nodeType&&n>0){if("false"==i.contentEditable)return null;i=i.childNodes[n-1],n=pe(i)}else{if(!i.parentNode||ue(i))return null;n=ce(i),i=i.parentNode}}}function Ce(t,e){for(let i=t,n=e;;){if(3==i.nodeType&&ne)return i.domBoundsAround(t,e,l);if(c>=t&&-1==n&&(n=a,r=l),l>e&&i.dom.parentNode==this.dom){o=a,s=h;break}h=c,l=c+i.breakAfter}return{from:r,to:s<0?i+this.length:s,startDOM:(n?this.children[n-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o=0?this.children[o].dom:null}}markDirty(t=!1){this.flags|=2,this.markParentsDirty(t)}markParentsDirty(t){for(let e=this.parent;e;e=e.parent){if(t&&(e.flags|=2),1&e.flags)return;e.flags|=1,t=!1}}setParent(t){this.parent!=t&&(this.parent=t,7&this.flags&&this.markParentsDirty(!0))}setDOM(t){this.dom!=t&&(this.dom&&(this.dom.cmView=null),this.dom=t,t.cmView=this)}get rootView(){for(let t=this;;){let e=t.parent;if(!e)return t;t=e}}replaceChildren(t,e,i=De){this.markDirty();for(let n=t;nthis.pos||t==this.pos&&(e>0||0==this.i||this.children[this.i-1].breakAfter))return this.off=t-this.pos,this;let i=this.children[--this.i];this.pos-=i.length+i.breakAfter}}}function Ee(t,e,i,n,r,o,s,a,l){let{children:h}=t,c=h.length?h[e]:null,u=o.length?o[o.length-1]:null,d=u?u.breakAfter:s;if(!(e==n&&c&&!s&&!d&&o.length<2&&c.merge(i,r,o.length?u:null,0==i,a,l))){if(n0&&(!s&&o.length&&c.merge(i,c.length,o[0],!1,a,0)?c.breakAfter=o.shift().breakAfter:(i2);var je={mac:Ue||/Mac/.test(Le.platform),windows:/Win/.test(Le.platform),linux:/Linux|X11/.test(Le.platform),ie:$e,ie_version:Be?Re.documentMode||6:ze?+ze[1]:Ne?+Ne[1]:0,gecko:Fe,gecko_version:Fe?+(/Firefox\/(\d+)/.exec(Le.userAgent)||[0,0])[1]:0,chrome:!!Ve,chrome_version:Ve?+Ve[1]:0,ios:Ue,android:/Android\b/.test(Le.userAgent),webkit:He,safari:We,webkit_version:He?+(/\bAppleWebKit\/(\d+)/.exec(Le.userAgent)||[0,0])[1]:0,tabSize:null!=Re.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};class Ge extends Te{constructor(t){super(),this.text=t}get length(){return this.text.length}createDOM(t){this.setDOM(t||document.createTextNode(this.text))}sync(t,e){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text)}reuseDOM(t){3==t.nodeType&&this.createDOM(t)}merge(t,e,i){return!(8&this.flags||i&&(!(i instanceof Ge)||this.length-(e-t)+i.length>256||8&i.flags))&&(this.text=this.text.slice(0,t)+(i?i.text:"")+this.text.slice(e),this.markDirty(),!0)}split(t){let e=new Ge(this.text.slice(t));return this.text=this.text.slice(0,t),this.markDirty(),e.flags|=8&this.flags,e}localPosFromDOM(t,e){return t==this.dom?e:e?this.text.length:0}domAtPos(t){return new Me(this.dom,t)}domBoundsAround(t,e,i){return{from:i,to:i+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(t,e){return function(t,e,i){let n=t.nodeValue.length;e>n&&(e=n);let r=e,o=e,s=0;0==e&&i<0||e==n&&i>=0?je.chrome||je.gecko||(e?(r--,s=1):o=0)?0:a.length-1];je.safari&&!s&&0==l.width&&(l=Array.prototype.find.call(a,(t=>t.width))||l);return s?fe(l,s<0):l||null}(this.dom,t,e)}}class qe extends Te{constructor(t,e=[],i=0){super(),this.mark=t,this.children=e,this.length=i;for(let t of e)t.setParent(this)}setAttrs(t){if(ke(t),this.mark.class&&(t.className=this.mark.class),this.mark.attrs)for(let e in this.mark.attrs)t.setAttribute(e,this.mark.attrs[e]);return t}canReuseDOM(t){return super.canReuseDOM(t)&&!(8&(this.flags|t.flags))}reuseDOM(t){t.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(t),this.flags|=6)}sync(t,e){this.dom?4&this.flags&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(t,e)}merge(t,e,i,n,r,o){return(!i||!(!(i instanceof qe&&i.mark.eq(this.mark))||t&&r<=0||et&&e.push(i=t&&(n=r),i=s,r++}let o=this.length-t;return this.length=t,n>-1&&(this.children.length=n,this.markDirty()),new qe(this.mark,e,o)}domAtPos(t){return Ke(this,t)}coordsAt(t,e){return Je(this,t,e)}}class Ye extends Te{static create(t,e,i){return new Ye(t,e,i)}constructor(t,e,i){super(),this.widget=t,this.length=e,this.side=i,this.prevWidget=null}split(t){let e=Ye.create(this.widget,this.length-t,this.side);return this.length-=t,e}sync(t){this.dom&&this.widget.updateDOM(this.dom,t)||(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(t)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(t,e,i,n,r,o){return!(i&&(!(i instanceof Ye&&this.widget.compare(i.widget))||t>0&&r<=0||e0)?Me.before(this.dom):Me.after(this.dom,t==this.length)}domBoundsAround(){return null}coordsAt(t,e){let i=this.widget.coordsAt(this.dom,t,e);if(i)return i;let n=this.dom.getClientRects(),r=null;if(!n.length)return null;let o=this.side?this.side<0:t>0;for(let e=o?n.length-1:0;r=n[e],!(t>0?0==e:e==n.length-1||r.top0?Me.before(this.dom):Me.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(t){return this.dom.getBoundingClientRect()}get overrideDOMText(){return d.empty}get isHidden(){return!0}}function Ke(t,e){let i=t.dom,{children:n}=t,r=0;for(let t=0;rt&&e0;t--){let e=n[t-1];if(e.dom.parentNode==i)return e.domAtPos(e.length)}for(let t=r;t0&&e instanceof qe&&r.length&&(n=r[r.length-1])instanceof qe&&n.mark.eq(e.mark)?Ze(n,e.children[0],i-1):(r.push(e),e.setParent(t)),t.length+=e.length}function Je(t,e,i){let n=null,r=-1,o=null,s=-1;!function t(e,a){for(let l=0,h=0;l=a&&(c.children.length?t(c,a-h):(!o||o.isHidden&&i>0)&&(u>a||h==u&&c.getSide()>0)?(o=c,s=a-h):(h-1?1:0)!=r.length-(i&&r.indexOf(i)>-1?1:0))return!1;for(let o of n)if(o!=i&&(-1==r.indexOf(o)||t[o]!==e[o]))return!1;return!0}function ii(t,e,i){let n=!1;if(e)for(let r in e)i&&r in i||(n=!0,"style"==r?t.style.cssText="":t.removeAttribute(r));if(i)for(let r in i)e&&e[r]==i[r]||(n=!0,"style"==r?t.style.cssText=i[r]:t.setAttribute(r,i[r]));return n}function ni(t){let e=Object.create(null);for(let i=0;i0?3e8:-4e8:e>0?1e8:-1e8,new hi(t,e,e,i,t.widget||null,!1)}static replace(t){let e,i,n=!!t.block;if(t.isBlockGap)e=-5e8,i=4e8;else{let{start:r,end:o}=ci(t,n);e=(r?n?-3e8:-1:5e8)-1,i=1+(o?n?2e8:1:-6e8)}return new hi(t,e,i,n,t.widget||null,!0)}static line(t){return new li(t)}static set(t,e=!1){return Lt.of(t,e)}hasHeight(){return!!this.widget&&this.widget.estimatedHeight>-1}}si.none=Lt.empty;class ai extends si{constructor(t){let{start:e,end:i}=ci(t);super(e?-1:5e8,i?1:-6e8,null,t),this.tagName=t.tagName||"span",this.class=t.class||"",this.attrs=t.attributes||null}eq(t){var e,i;return this==t||t instanceof ai&&this.tagName==t.tagName&&(this.class||(null===(e=this.attrs)||void 0===e?void 0:e.class))==(t.class||(null===(i=t.attrs)||void 0===i?void 0:i.class))&&ei(this.attrs,t.attrs,"class")}range(t,e=t){if(t>=e)throw new RangeError("Mark decorations may not be empty");return super.range(t,e)}}ai.prototype.point=!1;class li extends si{constructor(t){super(-2e8,-2e8,null,t)}eq(t){return t instanceof li&&this.spec.class==t.spec.class&&ei(this.spec.attributes,t.spec.attributes)}range(t,e=t){if(e!=t)throw new RangeError("Line decoration ranges must be zero-length");return super.range(t,e)}}li.prototype.mapMode=M.TrackBefore,li.prototype.point=!0;class hi extends si{constructor(t,e,i,n,r,o){super(e,i,r,t),this.block=n,this.isReplace=o,this.mapMode=n?e<=0?M.TrackBefore:M.TrackAfter:M.TrackDel}get type(){return this.startSide!=this.endSide?oi.WidgetRange:this.startSide<=0?oi.WidgetBefore:oi.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof hi&&function(t,e){return t==e||!!(t&&e&&t.compare(e))}(this.widget,t.widget)&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide}range(t,e=t){if(this.isReplace&&(t>e||t==e&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&e!=t)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(t,e)}}function ci(t,e=!1){let{inclusiveStart:i,inclusiveEnd:n}=t;return null==i&&(i=t.inclusive),null==n&&(n=t.inclusive),{start:null!=i?i:e,end:null!=n?n:e}}function ui(t,e,i,n=0){let r=i.length-1;r>=0&&i[r]+n>=t?i[r]=Math.max(i[r],e):i.push(t,e)}hi.prototype.point=!0;let di=class t extends Te{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,i,n,r,o,s){if(n){if(!(n instanceof t))return!1;this.dom||n.transferDOM(this)}return r&&this.setDeco(n?n.attrs:null),Pe(this,e,i,n?n.children.slice():[],o,s),!0}split(e){let i=new t;if(i.breakAfter=this.breakAfter,0==this.length)return i;let{i:n,off:r}=this.childPos(e);r&&(i.append(this.children[n].split(r),0),this.children[n].merge(r,this.children[n].length,null,!1,0,0),n++);for(let t=n;t0&&0==this.children[n-1].length;)this.children[--n].destroy();return this.children.length=n,this.markDirty(),this.length=e,i}transferDOM(t){this.dom&&(this.markDirty(),t.setDOM(this.dom),t.prevAttrs=void 0===this.prevAttrs?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(t){ei(this.attrs,t)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=t)}append(t,e){Ze(this,t,e)}addLineDeco(t){let e=t.spec.attributes,i=t.spec.class;e&&(this.attrs=Qe(e,this.attrs||{})),i&&(this.attrs=Qe({class:i},this.attrs||{}))}domAtPos(t){return Ke(this,t)}reuseDOM(t){"DIV"==t.nodeName&&(this.setDOM(t),this.flags|=6)}sync(t,e){var i;this.dom?4&this.flags&&(ke(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),void 0!==this.prevAttrs&&(ii(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(t,e);let n=this.dom.lastChild;for(;n&&Te.get(n)instanceof qe;)n=n.lastChild;if(!(n&&this.length&&("BR"==n.nodeName||0!=(null===(i=Te.get(n))||void 0===i?void 0:i.isEditable)||je.ios&&this.children.some((t=>t instanceof Ge))))){let t=document.createElement("BR");t.cmIgnore=!0,this.dom.appendChild(t)}}measureTextSize(){if(0==this.children.length||this.length>20)return null;let t,e=0;for(let i of this.children){if(!(i instanceof Ge)||/[^ -~]/.test(i.text))return null;let n=le(i.dom);if(1!=n.length)return null;e+=n[0].width,t=n[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(t,e){let i=Je(this,t,e);if(!this.children.length&&i&&this.parent){let{heightOracle:t}=this.parent.view.viewState,e=i.bottom-i.top;if(Math.abs(e-t.lineHeight)<2&&t.textHeight=i){if(o instanceof t)return o;if(s>i)break}r=s+o.breakAfter}return null}};class pi extends Te{constructor(t,e,i){super(),this.widget=t,this.length=e,this.deco=i,this.breakAfter=0,this.prevWidget=null}merge(t,e,i,n,r,o){return!(i&&(!(i instanceof pi&&this.widget.compare(i.widget))||t>0&&r<=0||e0)}}class fi extends ri{constructor(t){super(),this.height=t}toDOM(){let t=document.createElement("div");return t.className="cm-gap",this.updateDOM(t),t}eq(t){return t.height==this.height}updateDOM(t){return t.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class gi{constructor(t,e,i,n){this.doc=t,this.pos=e,this.end=i,this.disallowBlockEffectsFor=n,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=t.iter(),this.skip=e}posCovered(){if(0==this.content.length)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let t=this.content[this.content.length-1];return!(t.breakAfter||t instanceof pi&&t.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new di),this.atCursorPos=!0),this.curLine}flushBuffer(t=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(mi(new Xe(-1),t),t.length),this.pendingBuffer=0)}addBlockWidget(t){this.flushBuffer(),this.curLine=null,this.content.push(t)}finish(t){this.pendingBuffer&&t<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,this.posCovered()||t&&this.content.length&&this.content[this.content.length-1]instanceof pi||this.getLine()}buildText(t,e,i){for(;t>0;){if(this.textOff==this.text.length){let{value:e,lineBreak:i,done:n}=this.cursor.next(this.skip);if(this.skip=0,n)throw new Error("Ran out of text content when drawing inline views");if(i){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,t--;continue}this.text=e,this.textOff=0}let n=Math.min(this.text.length-this.textOff,t,512);this.flushBuffer(e.slice(e.length-i)),this.getLine().append(mi(new Ge(this.text.slice(this.textOff,this.textOff+n)),e),i),this.atCursorPos=!0,this.textOff+=n,t-=n,i=0}}span(t,e,i,n){this.buildText(e-t,i,n),this.pos=e,this.openStart<0&&(this.openStart=n)}point(t,e,i,n,r,o){if(this.disallowBlockEffectsFor[o]&&i instanceof hi){if(i.block)throw new RangeError("Block decorations may not be specified via plugins");if(e>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let s=e-t;if(i instanceof hi)if(i.block)i.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new pi(i.widget||vi.block,s,i));else{let o=Ye.create(i.widget||vi.inline,s,s?0:i.startSide),a=this.atCursorPos&&!o.isEditable&&r<=n.length&&(t0),l=!o.isEditable&&(tn.length||i.startSide<=0),h=this.getLine();2!=this.pendingBuffer||a||o.isEditable||(this.pendingBuffer=0),this.flushBuffer(n),a&&(h.append(mi(new Xe(1),n),r),r=n.length+Math.max(0,r-n.length)),h.append(mi(o,n),r),this.atCursorPos=l,this.pendingBuffer=l?tn.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=n.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(i);s&&(this.textOff+s<=this.text.length?this.textOff+=s:(this.skip+=s-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=e),this.openStart<0&&(this.openStart=r)}static build(t,e,i,n,r){let o=new gi(t,e,i,r);return o.openEnd=Lt.spans(n,e,i,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}}function mi(t,e){for(let i of e)t=new qe(i,[t],t.length);return t}class vi extends ri{constructor(t){super(),this.tag=t}eq(t){return t.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(t){return t.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}vi.inline=new vi("span"),vi.block=new vi("div");var yi=function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t}(yi||(yi={}));const bi=yi.LTR,wi=yi.RTL;function xi(t){let e=[];for(let i=0;i=e){if(s.level==i)return o;(r<0||(0!=n?n<0?s.frome:t[r].level>s.level))&&(r=o)}}if(r<0)throw new RangeError("Index out of range");return r}}function Ti(t,e){if(t.length!=e.length)return!1;for(let i=0;il&&s.push(new Di(l,f.from,d)),Ei(t,f.direction==bi!=!(d%2)?n+1:n,r,f.inner,f.from,f.to,s),l=f.to}p=f.to}else{if(p==i||(e?Ii[p]!=a:Ii[p]==a))break;p++}u?Oi(t,l,p,n+1,r,u,s):le;){let i=!0,c=!1;if(!h||l>o[h-1].to){let t=Ii[l-1];t!=a&&(i=!1,c=16==t)}let u=i||1!=a?null:[],d=i?n:n+1,p=l;t:for(;;)if(h&&p==o[h-1].to){if(c)break t;let f=o[--h];if(!i)for(let t=f.from,i=h;;){if(t==e)break t;if(!i||o[i-1].to!=t){if(Ii[t-1]==a)break t;break}t=o[--i].from}if(u)u.push(f);else{f.to=0;t-=3)if(Ai[t+1]==-i){let e=Ai[t+2],i=2&e?r:4&e?1&e?o:r:0;i&&(Ii[s]=Ii[Ai[t]]=i),a=t;break}}else{if(189==Ai.length)break;Ai[a++]=s,Ai[a++]=e,Ai[a++]=l}else if(2==(n=Ii[s])||1==n){let t=n==r;l=t?0:1;for(let e=a-3;e>=0;e-=3){let i=Ai[e+2];if(2&i)break;if(t)Ai[e+2]|=2;else{if(4&i)break;Ai[e+2]|=4}}}}}(t,r,o,n,a),function(t,e,i,n){for(let r=0,o=n;r<=i.length;r++){let s=r?i[r-1].to:t,a=rl;)e==o&&(e=i[--n].from,o=n?i[n-1].to:t),Ii[--e]=c;l=s}else o=s,l++}}}(r,o,n,a),Oi(t,r,o,e,i,n,s)}function Pi(t){return[new Di(0,t,0)]}let Li="";function Ri(t,e,i,n,r){var o;let s=n.head-t.from,a=Di.find(e,s,null!==(o=n.bidiLevel)&&void 0!==o?o:-1,n.assoc),l=e[a],h=l.side(r,i);if(s==h){let t=a+=r?1:-1;if(t<0||t>=e.length)return null;l=e[a=t],s=l.side(!r,i),h=l.side(r,i)}let c=_(t.text,s,l.forward(r,i));(cl.to)&&(c=h),Li=t.text.slice(Math.min(s,c),Math.max(s,c));let u=a==(r?e.length-1:0)?null:e[a+(r?1:-1)];return u&&c==h&&u.level+(r?0:1)t.some((t=>t))}),qi=F.define({combine:t=>t.some((t=>t))}),Yi=F.define();class Xi{constructor(t,e="nearest",i="nearest",n=5,r=5,o=!1){this.range=t,this.y=e,this.x=i,this.yMargin=n,this.xMargin=r,this.isSnapshot=o}map(t){return t.empty?this:new Xi(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(t){return this.range.to<=t.doc.length?this:new Xi(B.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const Ki=mt.define({map:(t,e)=>t.map(e)}),Zi=mt.define();function Ji(t,e,i){let n=t.facet(Fi);n.length?n[0](e):window.onerror?window.onerror(String(e),i,void 0,void 0,e):i?console.error(i+":",e):console.error(e)}const Qi=F.define({combine:t=>!t.length||t[0]});let tn=0;const en=F.define();class nn{constructor(t,e,i,n,r){this.id=t,this.create=e,this.domEventHandlers=i,this.domEventObservers=n,this.extension=r(this)}static define(t,e){const{eventHandlers:i,eventObservers:n,provide:r,decorations:o}=e||{};return new nn(tn++,t,i,n,(t=>{let e=[en.of(t)];return o&&e.push(an.of((e=>{let i=e.plugin(t);return i?o(i):si.none}))),r&&e.push(r(t)),e}))}static fromClass(t,e){return nn.define((e=>new t(e)),e)}}class rn{constructor(t){this.spec=t,this.mustUpdate=null,this.value=null}update(t){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(e){if(Ji(t.state,e,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch(t){}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(t)}catch(e){Ji(t.state,e,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(t){var e;if(null===(e=this.value)||void 0===e?void 0:e.destroy)try{this.value.destroy()}catch(e){Ji(t.state,e,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const on=F.define(),sn=F.define(),an=F.define(),ln=F.define(),hn=F.define(),cn=F.define();function un(t,e){let i=t.state.facet(cn);if(!i.length)return i;let n=i.map((e=>e instanceof Function?e(t):e)),r=[];return Lt.spans(n,e.from,e.to,{point(){},span(t,i,n,o){let s=t-e.from,a=i-e.from,l=r;for(let t=n.length-1;t>=0;t--,o--){let i,r=n[t].spec.bidiIsolate;if(null==r&&(r=Ni(e.text,s,a)),o>0&&l.length&&(i=l[l.length-1]).to==s&&i.direction==r)i.to=a,l=i.inner;else{let t={from:s,to:a,direction:r,inner:[]};l.push(t),l=t.inner}}}}),r}const dn=F.define();function pn(t){let e=0,i=0,n=0,r=0;for(let o of t.state.facet(dn)){let s=o(t);s&&(null!=s.left&&(e=Math.max(e,s.left)),null!=s.right&&(i=Math.max(i,s.right)),null!=s.top&&(n=Math.max(n,s.top)),null!=s.bottom&&(r=Math.max(r,s.bottom)))}return{left:e,right:i,top:n,bottom:r}}const fn=F.define();class gn{constructor(t,e,i,n){this.fromA=t,this.toA=e,this.fromB=i,this.toB=n}join(t){return new gn(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(t){let e=t.length,i=this;for(;e>0;e--){let n=t[e-1];if(!(n.fromA>i.toA)){if(n.toAh)break;r+=2}if(!a)return i;new gn(a.fromA,a.toA,a.fromB,a.toB).addToSet(i),o=a.toA,s=a.toB}}}class mn{constructor(t,e,i){this.view=t,this.state=e,this.transactions=i,this.flags=0,this.startState=t.state,this.changes=T.empty(this.startState.doc.length);for(let t of i)this.changes=this.changes.compose(t.changes);let n=[];this.changes.iterChangedRanges(((t,e,i,r)=>n.push(new gn(t,e,i,r)))),this.changedRanges=n}static create(t,e,i){return new mn(t,e,i)}get viewportChanged(){return(4&this.flags)>0}get heightChanged(){return(2&this.flags)>0}get geometryChanged(){return this.docChanged||(10&this.flags)>0}get focusChanged(){return(1&this.flags)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some((t=>t.selection))}get empty(){return 0==this.flags&&0==this.transactions.length}}class vn extends Te{get length(){return this.view.state.doc.length}constructor(t){super(),this.view=t,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=si.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(t.contentDOM),this.children=[new di],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new gn(0,0,0,t.state.doc.length)],0,null)}update(t){var e;let i=t.changedRanges;this.minWidth>0&&i.length&&(i.every((({fromA:t,toA:e})=>ethis.minWidthTo))?(this.minWidthFrom=t.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=t.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(t);let n=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&((null===(e=this.domChanged)||void 0===e?void 0:e.newSel)?n=this.domChanged.newSel.head:function(t,e){let i=!1;e&&t.iterChangedRanges(((t,n)=>{te.from&&(i=!0)}));return i}(t.changes,this.hasComposition)||t.selectionSet||(n=t.state.selection.main.head));let r=n>-1?function(t,e,i){let n=yn(t,i);if(!n)return null;let{node:r,from:o,to:s}=n,a=r.nodeValue;if(/[\n\r]/.test(a))return null;if(t.state.doc.sliceString(n.from,n.to)!=a)return null;let l=e.invertedDesc,h=new gn(l.mapPos(o),l.mapPos(s),o,s),c=[];for(let e=r.parentNode;;e=e.parentNode){let i=Te.get(e);if(i instanceof qe)c.push({node:e,deco:i.mark});else{if(i instanceof di||"DIV"==e.nodeName&&e.parentNode==t.contentDOM)return{range:h,text:r,marks:c,line:e};if(e==t.contentDOM)return null;c.push({node:e,deco:new ai({inclusive:!0,attributes:ni(e),tagName:e.tagName.toLowerCase()})})}}}(this.view,t.changes,n):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:e,to:n}=this.hasComposition;i=new gn(e,n,t.changes.mapPos(e,-1),t.changes.mapPos(n,1)).addToSet(i.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(je.ie||je.chrome)&&!r&&t&&t.state.doc.lines!=t.startState.doc.lines&&(this.forceSelection=!0);let o=function(t,e,i){let n=new bn;return Lt.compare(t,e,i,n),n.changes}(this.decorations,this.updateDeco(),t.changes);return i=gn.extendWithRanges(i,o),!!(7&this.flags||0!=i.length)&&(this.updateInner(i,t.startState.doc.length,r),t.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(t,e,i){this.view.viewState.mustMeasureContent=!0,this.updateChildren(t,e,i);let{observer:n}=this.view;n.ignore((()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let t=je.chrome||je.ios?{node:n.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,t),this.flags&=-8,t&&(t.written||n.selectionRange.focusNode!=t.node)&&(this.forceSelection=!0),this.dom.style.height=""})),this.markedForComposition.forEach((t=>t.flags&=-9));let r=[];if(this.view.viewport.from||this.view.viewport.to=0?n[t]:null;if(!e)break;let o,s,a,l,{fromA:h,toA:c,fromB:u,toB:d}=e;if(i&&i.range.fromBu){let t=gi.build(this.view.state.doc,u,i.range.fromB,this.decorations,this.dynamicDecorationMap),e=gi.build(this.view.state.doc,i.range.toB,d,this.decorations,this.dynamicDecorationMap);s=t.breakAtStart,a=t.openStart,l=e.openEnd;let n=this.compositionView(i);e.breakAtStart?n.breakAfter=1:e.content.length&&n.merge(n.length,n.length,e.content[0],!1,e.openStart,0)&&(n.breakAfter=e.content[0].breakAfter,e.content.shift()),t.content.length&&n.merge(0,0,t.content[t.content.length-1],!0,0,t.openEnd)&&t.content.pop(),o=t.content.concat(n).concat(e.content)}else({content:o,breakAtStart:s,openStart:a,openEnd:l}=gi.build(this.view.state.doc,u,d,this.decorations,this.dynamicDecorationMap));let{i:p,off:f}=r.findPos(c,1),{i:g,off:m}=r.findPos(h,-1);Ee(this,g,m,p,f,o,s,a,l)}i&&this.fixCompositionDOM(i)}updateEditContextFormatting(t){this.editContextFormatting=this.editContextFormatting.map(t.changes);for(let e of t.transactions)for(let t of e.effects)t.is(Zi)&&(this.editContextFormatting=t.value)}compositionView(t){let e=new Ge(t.text.nodeValue);e.flags|=8;for(let{deco:i}of t.marks)e=new qe(i,[e],e.length);let i=new di;return i.append(e,0),i}fixCompositionDOM(t){let e=(t,e)=>{e.flags|=8|(e.children.some((t=>7&t.flags))?1:0),this.markedForComposition.add(e);let i=Te.get(t);i&&i!=e&&(i.dom=null),e.setDOM(t)},i=this.childPos(t.range.fromB,1),n=this.children[i.i];e(t.line,n);for(let r=t.marks.length-1;r>=-1;r--)i=n.childPos(i.off,1),n=n.children[i.i],e(r>=0?t.marks[r].node:t.text,n)}updateSelection(t=!1,e=!1){!t&&this.view.observer.selectionRange.focusNode||this.view.observer.readSelectionRange();let i=this.view.root.activeElement,n=i==this.dom,r=!n&&!(this.view.state.facet(Qi)||this.dom.tabIndex>-1)&&ae(this.dom,this.view.observer.selectionRange)&&!(i&&this.dom.contains(i));if(!(n||e||r))return;let o=this.forceSelection;this.forceSelection=!1;let s=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(s.anchor)),l=s.empty?a:this.moveToLine(this.domAtPos(s.head));if(je.gecko&&s.empty&&!this.hasComposition&&(1==(h=a).node.nodeType&&h.node.firstChild&&(0==h.offset||"false"==h.node.childNodes[h.offset-1].contentEditable)&&(h.offset==h.node.childNodes.length||"false"==h.node.childNodes[h.offset].contentEditable))){let t=document.createTextNode("");this.view.observer.ignore((()=>a.node.insertBefore(t,a.node.childNodes[a.offset]||null))),a=l=new Me(t,0),o=!0}var h;let c=this.view.observer.selectionRange;!o&&c.focusNode&&(he(a.node,a.offset,c.anchorNode,c.anchorOffset)&&he(l.node,l.offset,c.focusNode,c.focusOffset)||this.suppressWidgetCursorChange(c,s))||(this.view.observer.ignore((()=>{je.android&&je.chrome&&this.dom.contains(c.focusNode)&&function(t,e){for(let i=t;i&&i!=e;i=i.assignedSlot||i.parentNode)if(1==i.nodeType&&"false"==i.contentEditable)return!0;return!1}(c.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let t=oe(this.view.root);if(t)if(s.empty){if(je.gecko){let t=(e=a.node,n=a.offset,1!=e.nodeType?0:(n&&"false"==e.childNodes[n-1].contentEditable?1:0)|(ns.head&&([a,l]=[l,a]),e.setEnd(l.node,l.offset),e.setStart(a.node,a.offset),t.removeAllRanges(),t.addRange(e)}else;var e,n;r&&this.view.root.activeElement==this.dom&&(this.dom.blur(),i&&i.focus())})),this.view.observer.setSelectionRange(a,l)),this.impreciseAnchor=a.precise?null:new Me(c.anchorNode,c.anchorOffset),this.impreciseHead=l.precise?null:new Me(c.focusNode,c.focusOffset)}suppressWidgetCursorChange(t,e){return this.hasComposition&&e.empty&&he(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)&&this.posFromDOM(t.focusNode,t.focusOffset)==e.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:t}=this,e=t.state.selection.main,i=oe(t.root),{anchorNode:n,anchorOffset:r}=t.observer.selectionRange;if(!(i&&e.empty&&e.assoc&&i.modify))return;let o=di.find(this,e.head);if(!o)return;let s=o.posAtStart;if(e.head==s||e.head==s+o.length)return;let a=this.coordsAt(e.head,-1),l=this.coordsAt(e.head,1);if(!a||!l||a.bottom>l.top)return;let h=this.domAtPos(e.head+e.assoc);i.collapse(h.node,h.offset),i.modify("move",e.assoc<0?"forward":"backward","lineboundary"),t.observer.readSelectionRange();let c=t.observer.selectionRange;t.docView.posFromDOM(c.anchorNode,c.anchorOffset)!=e.from&&i.collapse(n,r)}moveToLine(t){let e,i=this.dom;if(t.node!=i)return t;for(let n=t.offset;!e&&n=0;n--){let t=Te.get(i.childNodes[n]);t instanceof di&&(e=t.domAtPos(t.length))}return e?new Me(e.node,e.offset,!0):t}nearest(t){for(let e=t;e;){let t=Te.get(e);if(t&&t.rootView==this)return t;e=e.parentNode}return null}posFromDOM(t,e){let i=this.nearest(t);if(!i)throw new RangeError("Trying to find position for a DOM position outside of the document");return i.localPosFromDOM(t,e)+i.posAtStart}domAtPos(t){let{i:e,off:i}=this.childCursor().findPos(t,-1);for(;e=0;o--){let s=this.children[o],a=r-s.breakAfter,l=a-s.length;if(at||s.covers(1))&&(!i||s instanceof di&&!(i instanceof di&&e>=0)))i=s,n=l;else if(i&&l==t&&a==t&&s instanceof pi&&Math.abs(e)<2){if(s.deco.startSide<0)break;o&&(i=null)}r=l}return i?i.coordsAt(t-n,e):null}coordsForChar(t){let{i:e,off:i}=this.childPos(t,1),n=this.children[e];if(!(n instanceof di))return null;for(;n.children.length;){let{i:t,off:e}=n.childPos(i,1);for(;;t++){if(t==n.children.length)return null;if((n=n.children[t]).length)break}i=e}if(!(n instanceof Ge))return null;let r=_(n.text,i);if(r==i)return null;let o=xe(n.dom,i,r).getClientRects();for(let t=0;tMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,s=-1,a=this.view.textDirection==yi.LTR;for(let t=0,l=0;ln)break;if(t>=i){let i=h.dom.getBoundingClientRect();if(e.push(i.height),o){let e=h.dom.lastChild,n=e?le(e):[];if(n.length){let e=n[n.length-1],o=a?e.right-i.left:i.right-e.left;o>s&&(s=o,this.minWidth=r,this.minWidthFrom=t,this.minWidthTo=c)}}}t=c+h.breakAfter}return e}textDirectionAt(t){let{i:e}=this.childPos(t,1);return"rtl"==getComputedStyle(this.children[e].dom).direction?yi.RTL:yi.LTR}measureTextSize(){for(let t of this.children)if(t instanceof di){let e=t.measureTextSize();if(e)return e}let t,e,i,n=document.createElement("div");return n.className="cm-line",n.style.width="99999px",n.style.position="absolute",n.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore((()=>{this.dom.appendChild(n);let r=le(n.firstChild)[0];t=n.getBoundingClientRect().height,e=r?r.width/27:7,i=r?r.height:t,n.remove()})),{lineHeight:t,charWidth:e,textHeight:i}}childCursor(t=this.length){let e=this.children.length;return e&&(t-=this.children[--e].length),new Oe(this.children,t,e)}computeBlockGapDeco(){let t=[],e=this.view.viewState;for(let i=0,n=0;;n++){let r=n==e.viewports.length?null:e.viewports[n],o=r?r.from-1:this.length;if(o>i){let n=(e.lineBlockAt(o).bottom-e.lineBlockAt(i).top)/this.view.scaleY;t.push(si.replace({widget:new fi(n),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!r)break;i=r.to+1}return si.set(t)}updateDeco(){let t=1,e=this.view.state.facet(an).map((e=>(this.dynamicDecorationMap[t++]="function"==typeof e)?e(this.view):e)),i=!1,n=this.view.state.facet(ln).map(((t,e)=>{let n="function"==typeof t;return n&&(i=!0),n?t(this.view):t}));for(n.length&&(this.dynamicDecorationMap[t++]=i,e.push(Lt.join(n))),this.decorations=[this.editContextFormatting,...e,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];ti.anchor?-1:1);if(!n)return;!i.empty&&(e=this.coordsAt(i.anchor,i.anchor>i.head?-1:1))&&(n={left:Math.min(n.left,e.left),top:Math.min(n.top,e.top),right:Math.max(n.right,e.right),bottom:Math.max(n.bottom,e.bottom)});let r=pn(this.view),o={left:n.left-r.left,top:n.top-r.top,right:n.right+r.right,bottom:n.bottom+r.bottom},{offsetWidth:s,offsetHeight:a}=this.view.scrollDOM;!function(t,e,i,n,r,o,s,a){let l=t.ownerDocument,h=l.defaultView||window;for(let c=t,u=!1;c&&!u;)if(1==c.nodeType){let t,d=c==l.body,p=1,f=1;if(d)t=ge(h);else{if(/^(fixed|sticky)$/.test(getComputedStyle(c).position)&&(u=!0),c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let e=c.getBoundingClientRect();({scaleX:p,scaleY:f}=me(c,e)),t={left:e.left,right:e.left+c.clientWidth*p,top:e.top,bottom:e.top+c.clientHeight*f}}let g=0,m=0;if("nearest"==r)e.top0&&e.bottom>t.bottom+m&&(m=e.bottom-t.bottom+m+s)):e.bottom>t.bottom&&(m=e.bottom-t.bottom+s,i<0&&e.top-m0&&e.right>t.right+g&&(g=e.right-t.right+g+o)):e.right>t.right&&(g=e.right-t.right+o,i<0&&e.leftt?e.left-t:Math.max(0,t-e.right)}function xn(t,e){return e.top>t?e.top-t:Math.max(0,t-e.bottom)}function _n(t,e){return t.tope.top+1}function kn(t,e){return et.bottom?{top:t.top,left:t.left,right:t.right,bottom:e}:t}function An(t,e,i){let n,r,o,s,a,l,h,c,u=!1;for(let d=t.firstChild;d;d=d.nextSibling){let t=le(d);for(let p=0;pm||s==m&&o>g){n=d,r=f,o=g,s=m;let a=m?i0?p0)}0==g?i>f.bottom&&(!h||h.bottomf.top)&&(l=d,c=f):h&&_n(h,f)?h=Sn(h,f.bottom):c&&_n(c,f)&&(c=kn(c,f.top))}}if(h&&h.bottom>=i?(n=a,r=h):c&&c.top<=i&&(n=l,r=c),!n)return{node:t,offset:0};let d=Math.max(r.left,Math.min(r.right,e));return 3==n.nodeType?Cn(n,d,i):u&&"false"!=n.contentEditable?An(n,d,i):{node:t,offset:Array.prototype.indexOf.call(t.childNodes,n)+(e>=(r.left+r.right)/2?1:0)}}function Cn(t,e,i){let n=t.nodeValue.length,r=-1,o=1e9,s=0;for(let a=0;ai?h.top-i:i-h.bottom)-1;if(h.left-1<=e&&h.right+1>=e&&c=(h.left+h.right)/2,n=i;if(je.chrome||je.gecko){xe(t,a).getBoundingClientRect().left==h.right&&(n=!i)}if(c<=0)return{node:t,offset:a+(n?1:0)};r=a+(n?1:0),o=c}}}return{node:t,offset:r>-1?r:s>0?t.nodeValue.length:0}}function Mn(t,e,i,n=-1){var r,o;let s,a=t.contentDOM.getBoundingClientRect(),l=a.top+t.viewState.paddingTop,{docHeight:h}=t.viewState,{x:c,y:u}=e,d=u-l;if(d<0)return 0;if(d>h)return t.state.doc.length;for(let e=t.viewState.heightOracle.textHeight/2,r=!1;s=t.elementAtHeight(d),s.type!=oi.Text;)for(;d=n>0?s.bottom+e:s.top-e,!(d>=0&&d<=h);){if(r)return i?null:0;r=!0,n=-n}u=l+d;let p=s.from;if(pt.viewport.to)return t.viewport.to==t.state.doc.length?t.state.doc.length:i?null:Dn(t,a,s,c,u);let f=t.dom.ownerDocument,g=t.root.elementFromPoint?t.root:f,m=g.elementFromPoint(c,u);m&&!t.contentDOM.contains(m)&&(m=null),m||(c=Math.max(a.left+1,Math.min(a.right-1,c)),m=g.elementFromPoint(c,u),m&&!t.contentDOM.contains(m)&&(m=null));let v,y=-1;if(m&&0!=(null===(r=t.docView.nearest(m))||void 0===r?void 0:r.isEditable)){if(f.caretPositionFromPoint){let t=f.caretPositionFromPoint(c,u);t&&({offsetNode:v,offset:y}=t)}else if(f.caretRangeFromPoint){let e=f.caretRangeFromPoint(c,u);e&&(({startContainer:v,startOffset:y}=e),(!t.contentDOM.contains(v)||je.safari&&function(t,e,i){let n;if(3!=t.nodeType||e!=(n=t.nodeValue.length))return!1;for(let e=t.nextSibling;e;e=e.nextSibling)if(1!=e.nodeType||"BR"!=e.nodeName)return!1;return xe(t,n-1,n).getBoundingClientRect().left>i}(v,y,c)||je.chrome&&function(t,e,i){if(0!=e)return!1;for(let e=t;;){let t=e.parentNode;if(!t||1!=t.nodeType||t.firstChild!=e)return!1;if(t.classList.contains("cm-line"))break;e=t}let n=1==t.nodeType?t.getBoundingClientRect():xe(t,0,Math.max(t.nodeValue.length,1)).getBoundingClientRect();return i-n.left>5}(v,y,c))&&(v=void 0))}v&&(y=Math.min(pe(v),y))}if(!v||!t.docView.dom.contains(v)){let e=di.find(t.docView,p);if(!e)return d>s.top+s.height/2?s.to:s.from;({node:v,offset:y}=An(e.dom,c,u))}let b=t.docView.nearest(v);if(!b)return null;if(b.isWidget&&1==(null===(o=b.dom)||void 0===o?void 0:o.nodeType)){let t=b.dom.getBoundingClientRect();return e.y1.5*t.defaultLineHeight){let e=t.viewState.heightOracle.textHeight;o+=Math.floor((r-i.top-.5*(t.defaultLineHeight-e))/e)*t.viewState.heightOracle.lineLength}let s=t.state.sliceDoc(i.from,i.to);return i.from+function(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=_(t,n)}return!0===n?-1:t.length}(s,o,t.state.tabSize)}function Tn(t,e,i,n){let r=function(t,e){let i=t.lineBlockAt(e);if(Array.isArray(i.type))for(let t of i.type)if(t.to>e||t.to==e&&(t.to==i.to||t.type==oi.Text))return t;return i}(t,e.head),o=n&&r.type==oi.Text&&(t.lineWrapping||r.widgetLineBreaks)?t.coordsAtPos(e.assoc<0&&e.head>r.from?e.head-1:e.head):null;if(o){let e=t.dom.getBoundingClientRect(),n=t.textDirectionAt(r.from),s=t.posAtCoords({x:i==(n==yi.LTR)?e.right-1:e.left+1,y:(o.top+o.bottom)/2});if(null!=s)return B.cursor(s,i?-1:1)}return B.cursor(i?r.to:r.from,i?-1:1)}function In(t,e,i,n){let r=t.state.doc.lineAt(e.head),o=t.bidiSpans(r),s=t.textDirectionAt(r.from);for(let a=e,l=null;;){let e=Ri(r,o,s,a,i),h=Li;if(!e){if(r.number==(i?t.state.doc.lines:1))return a;h="\n",r=t.state.doc.line(r.number+(i?1:-1)),o=t.bidiSpans(r),e=t.visualLineSide(r,!i)}if(l){if(!l(h))return a}else{if(!n)return e;l=n(h)}a=e}}function On(t,e,i){for(;;){let n=0;for(let r of t)r.between(e-1,e+1,((t,r,o)=>{if(e>t&&ee(t))),i.from,e.head>i.from?-1:1);return n==i.from?i:B.cursor(n,nt)&&this.lineBreak(),n=r}return this.findPointBefore(i,e),this}readTextNode(t){let e=t.nodeValue;for(let i of this.points)i.node==t&&(i.pos=this.text.length+Math.min(i.offset,e.length));for(let i=0,n=this.lineSeparator?null:/\r\n?|\n/g;;){let r,o=-1,s=1;if(this.lineSeparator?(o=e.indexOf(this.lineSeparator,i),s=this.lineSeparator.length):(r=n.exec(e))&&(o=r.index,s=r[0].length),this.append(e.slice(i,o<0?e.length:o)),o<0)break;if(this.lineBreak(),s>1)for(let e of this.points)e.node==t&&e.pos>this.text.length&&(e.pos-=s-1);i=o+s}}readNode(t){if(t.cmIgnore)return;let e=Te.get(t),i=e&&e.overrideDOMText;if(null!=i){this.findPointInside(t,i.length);for(let t=i.iter();!t.next().done;)t.lineBreak?this.lineBreak():this.append(t.value)}else 3==t.nodeType?this.readTextNode(t):"BR"==t.nodeName?t.nextSibling&&this.lineBreak():1==t.nodeType&&this.readRange(t.firstChild,null)}findPointBefore(t,e){for(let i of this.points)i.node==t&&t.childNodes[i.offset]==e&&(i.pos=this.text.length)}findPointInside(t,e){for(let i of this.points)(3==t.nodeType?i.node==t:t.contains(i.node))&&(i.pos=this.text.length+(Rn(t,i.node,i.offset)?e:0))}}function Rn(t,e,i){for(;;){if(!e||i-1;let{impreciseHead:r,impreciseAnchor:o}=t.docView;if(t.state.readOnly&&e>-1)this.newSel=null;else if(e>-1&&(this.bounds=t.docView.domBoundsAround(e,i,0))){let e=r||o?[]:function(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:i,anchorOffset:n,focusNode:r,focusOffset:o}=t.observer.selectionRange;i&&(e.push(new Nn(i,n)),r==i&&o==n||e.push(new Nn(r,o)));return e}(t),i=new Ln(e,t.state);i.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=i.text,this.newSel=function(t,e){if(0==t.length)return null;let i=t[0].pos,n=2==t.length?t[1].pos:i;return i>-1&&n>-1?B.single(i+e,n+e):null}(e,this.bounds.from)}else{let e=t.observer.selectionRange,i=r&&r.node==e.focusNode&&r.offset==e.focusOffset||!se(t.contentDOM,e.focusNode)?t.state.selection.main.head:t.docView.posFromDOM(e.focusNode,e.focusOffset),n=o&&o.node==e.anchorNode&&o.offset==e.anchorOffset||!se(t.contentDOM,e.anchorNode)?t.state.selection.main.anchor:t.docView.posFromDOM(e.anchorNode,e.anchorOffset),s=t.viewport;if((je.ios||je.chrome)&&t.state.selection.main.empty&&i!=n&&(s.from>0||s.toDate.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:n,to:s}=e.bounds,a=r.from,l=null;(8===o||je.android&&e.text.length0&&a>0&&t.charCodeAt(s-1)==e.charCodeAt(a-1);)s--,a--;if("end"==n){i-=s+Math.max(0,o-Math.min(s,a))-o}if(s=s?o-i:0,a=o+(a-s),s=o}else if(a=a?o-i:0,s=o+(s-a),a=o}return{from:o,toA:s,toB:a}}(t.state.doc.sliceString(n,s,Pn),e.text,a-n,l);h&&(je.chrome&&13==o&&h.toB==h.from+2&&e.text.slice(h.from,h.toB)==Pn+Pn&&h.toB--,i={from:n+h.from,to:n+h.toA,insert:d.of(e.text.slice(h.from,h.toB).split(Pn))})}else n&&(!t.hasFocus&&t.state.facet(Qi)||n.main.eq(r))&&(n=null);if(!i&&!n)return!1;if(!i&&e.typeOver&&!r.empty&&n&&n.main.empty?i={from:r.from,to:r.to,insert:t.state.doc.slice(r.from,r.to)}:i&&i.from>=r.from&&i.to<=r.to&&(i.from!=r.from||i.to!=r.to)&&r.to-r.from-(i.to-i.from)<=4?i={from:r.from,to:r.to,insert:t.state.doc.slice(r.from,i.from).append(i.insert).append(t.state.doc.slice(i.to,r.to))}:(je.mac||je.android)&&i&&i.from==i.to&&i.from==r.head-1&&/^\. ?$/.test(i.insert.toString())&&"off"==t.contentDOM.getAttribute("autocorrect")?(n&&2==i.insert.length&&(n=B.single(n.main.anchor-1,n.main.head-1)),i={from:r.from,to:r.to,insert:d.of([" "])}):je.chrome&&i&&i.from==i.to&&i.from==r.head&&"\n "==i.insert.toString()&&t.lineWrapping&&(n&&(n=B.single(n.main.anchor-1,n.main.head-1)),i={from:r.from,to:r.to,insert:d.of([" "])}),i)return $n(t,i,n,o);if(n&&!n.main.eq(r)){let e=!1,i="select";return t.inputState.lastSelectionTime>Date.now()-50&&("select"==t.inputState.lastSelectionOrigin&&(e=!0),i=t.inputState.lastSelectionOrigin),t.dispatch({selection:n,scrollIntoView:e,userEvent:i}),!0}return!1}function $n(t,e,i,n=-1){if(je.ios&&t.inputState.flushIOSKey(e))return!0;let r=t.state.selection.main;if(je.android&&(e.to==r.to&&(e.from==r.from||e.from==r.from-1&&" "==t.state.sliceDoc(e.from,r.from))&&1==e.insert.length&&2==e.insert.lines&&_e(t.contentDOM,"Enter",13)||(e.from==r.from-1&&e.to==r.to&&0==e.insert.length||8==n&&e.insert.lengthr.head)&&_e(t.contentDOM,"Backspace",8)||e.from==r.from&&e.to==r.to+1&&0==e.insert.length&&_e(t.contentDOM,"Delete",46)))return!0;let o,s=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let a=()=>o||(o=function(t,e,i){let n,r=t.state,o=r.selection.main;if(e.from>=o.from&&e.to<=o.to&&e.to-e.from>=(o.to-o.from)/3&&(!i||i.main.empty&&i.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let i=o.frome.to?r.sliceDoc(e.to,o.to):"";n=r.replaceSelection(t.state.toText(i+e.insert.sliceString(0,void 0,t.state.lineBreak)+s))}else{let s=r.changes(e),a=i&&i.main.to<=s.newLength?i.main:void 0;if(r.selection.ranges.length>1&&t.inputState.composing>=0&&e.to<=o.to&&e.to>=o.to-10){let l,h=t.state.sliceDoc(e.from,e.to),c=i&&yn(t,i.main.head);if(c){let t=e.insert.length-(e.to-e.from);l={from:c.from,to:c.to-t}}else l=t.state.doc.lineAt(o.head);let u=o.to-e.to,d=o.to-o.from;n=r.changeByRange((i=>{if(i.from==o.from&&i.to==o.to)return{changes:s,range:a||i.map(s)};let n=i.to-u,c=n-h.length;if(i.to-i.from!=d||t.state.sliceDoc(c,n)!=h||i.to>=l.from&&i.from<=l.to)return{range:i};let p=r.changes({from:c,to:n,insert:e.insert}),f=i.to-o.to;return{changes:p,range:a?B.range(Math.max(0,a.anchor+f),Math.max(0,a.head+f)):i.map(p)}}))}else n={changes:s,selection:a&&r.selection.replaceRange(a)}}let s="input.type";(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,s+=".compose",t.inputState.compositionFirstChange&&(s+=".start",t.inputState.compositionFirstChange=!1));return r.update(n,{userEvent:s,scrollIntoView:!0})}(t,e,i));return t.state.facet(Hi).some((i=>i(t,e.from,e.to,s,a)))||t.dispatch(a()),!0}class Fn{setSelectionOrigin(t){this.lastSelectionOrigin=t,this.lastSelectionTime=Date.now()}constructor(t){this.view=t,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=t.hasFocus,je.safari&&t.contentDOM.addEventListener("input",(()=>null)),je.gecko&&function(t){pr.has(t)||(pr.add(t),t.addEventListener("copy",(()=>{})),t.addEventListener("cut",(()=>{})))}(t.contentDOM.ownerDocument)}handleEvent(t){(function(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let i,n=e.target;n!=t.contentDOM;n=n.parentNode)if(!n||11==n.nodeType||(i=Te.get(n))&&i.ignoreEvent(e))return!1;return!0})(this.view,t)&&!this.ignoreDuringComposition(t)&&("keydown"==t.type&&this.keydown(t)||this.runHandlers(t.type,t))}runHandlers(t,e){let i=this.handlers[t];if(i){for(let t of i.observers)t(this.view,e);for(let t of i.handlers){if(e.defaultPrevented)break;if(t(this.view,e)){e.preventDefault();break}}}}ensureHandlers(t){let e=Hn(t),i=this.handlers,n=this.view.contentDOM;for(let t in e)if("scroll"!=t){let r=!e[t].handlers.length,o=i[t];o&&r!=!o.handlers.length&&(n.removeEventListener(t,this.handleEvent),o=null),o||n.addEventListener(t,this.handleEvent,{passive:r})}for(let t in i)"scroll"==t||e[t]||n.removeEventListener(t,this.handleEvent);this.handlers=e}keydown(t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),9==t.keyCode&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&27!=t.keyCode&&jn.indexOf(t.keyCode)<0&&(this.tabFocusMode=-1),je.android&&je.chrome&&!t.synthetic&&(13==t.keyCode||8==t.keyCode))return this.view.observer.delayAndroidKey(t.key,t.keyCode),!0;let e;return!je.ios||t.synthetic||t.altKey||t.metaKey||!((e=Wn.find((e=>e.keyCode==t.keyCode)))&&!t.ctrlKey||Un.indexOf(t.key)>-1&&t.ctrlKey&&!t.shiftKey)?(229!=t.keyCode&&this.view.observer.forceFlush(),!1):(this.pendingIOSKey=e||t,setTimeout((()=>this.flushIOSKey()),250),!0)}flushIOSKey(t){let e=this.pendingIOSKey;return!!e&&(!("Enter"==e.key&&t&&t.from0||!!(je.safari&&!je.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100)&&(this.compositionPendingKey=!1,!0))}startMouseSelection(t){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=t}update(t){this.view.observer.update(t),this.mouseSelection&&this.mouseSelection.update(t),this.draggedContent&&t.docChanged&&(this.draggedContent=this.draggedContent.map(t.changes)),t.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function Vn(t,e){return(i,n)=>{try{return e.call(t,n,i)}catch(t){Ji(i.state,t)}}}function Hn(t){let e=Object.create(null);function i(t){return e[t]||(e[t]={observers:[],handlers:[]})}for(let e of t){let t=e.spec;if(t&&t.domEventHandlers)for(let n in t.domEventHandlers){let r=t.domEventHandlers[n];r&&i(n).handlers.push(Vn(e.value,r))}if(t&&t.domEventObservers)for(let n in t.domEventObservers){let r=t.domEventObservers[n];r&&i(n).observers.push(Vn(e.value,r))}}for(let t in Yn)i(t).handlers.push(Yn[t]);for(let t in Xn)i(t).observers.push(Xn[t]);return e}const Wn=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Un="dthko",jn=[16,17,18,20,91,92,224,225];function Gn(t){return.7*Math.max(0,t)+8}class qn{constructor(t,e,i,n){this.view=t,this.startEvent=e,this.style=i,this.mustSelect=n,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=e,this.scrollParents=function(t){let e,i,n=t.ownerDocument;for(let r=t.parentNode;r&&!(r==n.body||e&&i);)if(1==r.nodeType)!i&&r.scrollHeight>r.clientHeight&&(i=r),!e&&r.scrollWidth>r.clientWidth&&(e=r),r=r.assignedSlot||r.parentNode;else{if(11!=r.nodeType)break;r=r.host}return{x:e,y:i}}(t.contentDOM),this.atoms=t.state.facet(hn).map((e=>e(t)));let r=t.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=e.shiftKey,this.multiple=t.state.facet(Dt.allowMultipleSelections)&&function(t,e){let i=t.state.facet(Bi);return i.length?i[0](e):je.mac?e.metaKey:e.ctrlKey}(t,e),this.dragging=!(!function(t,e){let{main:i}=t.state.selection;if(i.empty)return!1;let n=oe(t.root);if(!n||0==n.rangeCount)return!0;let r=n.getRangeAt(0).getClientRects();for(let t=0;t=e.clientX&&i.top<=e.clientY&&i.bottom>=e.clientY)return!0}return!1}(t,e)||1!=ar(e))&&null}start(t){!1===this.dragging&&this.select(t)}move(t){if(0==t.buttons)return this.destroy();if(this.dragging||null==this.dragging&&function(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}(this.startEvent,t)<10)return;this.select(this.lastEvent=t);let e=0,i=0,n=0,r=0,o=this.view.win.innerWidth,s=this.view.win.innerHeight;this.scrollParents.x&&({left:n,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:r,bottom:s}=this.scrollParents.y.getBoundingClientRect());let a=pn(this.view);t.clientX-a.left<=n+6?e=-Gn(n-t.clientX):t.clientX+a.right>=o-6&&(e=Gn(t.clientX-o)),t.clientY-a.top<=r+6?i=-Gn(r-t.clientY):t.clientY+a.bottom>=s-6&&(i=Gn(t.clientY-s)),this.setScrollSpeed(e,i)}up(t){null==this.dragging&&this.select(this.lastEvent),this.dragging||t.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let t=this.view.contentDOM.ownerDocument;t.removeEventListener("mousemove",this.move),t.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(t,e){this.scrollSpeed={x:t,y:e},t||e?this.scrolling<0&&(this.scrolling=setInterval((()=>this.scroll()),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:t,y:e}=this.scrollSpeed;t&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=t,t=0),e&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=e,e=0),(t||e)&&this.view.win.scrollBy(t,e),!1===this.dragging&&this.select(this.lastEvent)}skipAtoms(t){let e=null;for(let i=0;it.isUserEvent("input.type")))?this.destroy():this.style.update(t)&&setTimeout((()=>this.select(this.lastEvent)),20)}}const Yn=Object.create(null),Xn=Object.create(null),Kn=je.ie&&je.ie_version<15||je.ios&&je.webkit_version<604;function Zn(t,e,i){for(let n of t.facet(e))i=n(i,t);return i}function Jn(t,e){e=Zn(t.state,Ui,e);let i,{state:n}=t,r=1,o=n.toText(e),s=o.lines==n.selection.ranges.length,a=null!=hr&&n.selection.ranges.every((t=>t.empty))&&hr==o.toString();if(a){let t=-1;i=n.changeByRange((i=>{let a=n.doc.lineAt(i.from);if(a.from==t)return{range:i};t=a.from;let l=n.toText((s?o.line(r++).text:e)+n.lineBreak);return{changes:{from:a.from,insert:l},range:B.cursor(i.from+l.length)}}))}else i=s?n.changeByRange((t=>{let e=o.line(r++);return{changes:{from:t.from,to:t.to,insert:e.text},range:B.cursor(t.from+e.length)}})):n.replaceSelection(o);t.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}function Qn(t,e,i,n){if(1==n)return B.cursor(e,i);if(2==n)return function(t,e,i=1){let n=t.charCategorizer(e),r=t.doc.lineAt(e),o=e-r.from;if(0==r.length)return B.cursor(e);0==o?i=1:o==r.length&&(i=-1);let s=o,a=o;i<0?s=_(r.text,o,!1):a=_(r.text,o);let l=n(r.text.slice(s,a));for(;s>0;){let t=_(r.text,s,!1);if(n(r.text.slice(t,s))!=l)break;s=t}for(;a{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft},Yn.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),27==e.keyCode&&0!=t.inputState.tabFocusMode&&(t.inputState.tabFocusMode=Date.now()+2e3),!1),Xn.touchstart=(t,e)=>{t.inputState.lastTouchTime=Date.now(),t.inputState.setSelectionOrigin("select.pointer")},Xn.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")},Yn.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let i=null;for(let n of t.state.facet($i))if(i=n(t,e),i)break;if(i||0!=e.button||(i=function(t,e){let i=ir(t,e),n=ar(e),r=t.state.selection;return{update(t){t.docChanged&&(i.pos=t.changes.mapPos(i.pos),r=r.map(t.changes))},get(e,o,s){let a,l=ir(t,e),h=Qn(t,l.pos,l.bias,n);if(i.pos!=l.pos&&!o){let e=Qn(t,i.pos,i.bias,n),r=Math.min(e.from,h.from),o=Math.max(e.to,h.to);h=r1&&(a=function(t,e){for(let i=0;i=e)return B.create(t.ranges.slice(0,i).concat(t.ranges.slice(i+1)),t.mainIndex==i?0:t.mainIndex-(t.mainIndex>i?1:0))}return null}(r,l.pos))?a:s?r.addRange(h):B.create([h])}}}(t,e)),i){let n=!t.hasFocus;t.inputState.startMouseSelection(new qn(t,e,i,n)),n&&t.observer.ignore((()=>{we(t.contentDOM);let e=t.root.activeElement;e&&!e.contains(t.contentDOM)&&e.blur()}));let r=t.inputState.mouseSelection;if(r)return r.start(e),!1===r.dragging}return!1};let tr=(t,e,i)=>e>=i.top&&e<=i.bottom&&t>=i.left&&t<=i.right;function er(t,e,i,n){let r=di.find(t.docView,e);if(!r)return 1;let o=e-r.posAtStart;if(0==o)return 1;if(o==r.length)return-1;let s=r.coordsAt(o,-1);if(s&&tr(i,n,s))return-1;let a=r.coordsAt(o,1);return a&&tr(i,n,a)?1:s&&s.bottom>=n?-1:1}function ir(t,e){let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:i,bias:er(t,i,e.clientX,e.clientY)}}const nr=je.ie&&je.ie_version<=11;let rr=null,or=0,sr=0;function ar(t){if(!nr)return t.detail;let e=rr,i=sr;return rr=t,sr=Date.now(),or=!e||i>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(or+1)%3:1}function lr(t,e,i,n){if(!(i=Zn(t.state,Ui,i)))return;let r=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:o}=t.inputState,s=n&&o&&function(t,e){let i=t.state.facet(zi);return i.length?i[0](e):je.mac?!e.altKey:!e.ctrlKey}(t,e)?{from:o.from,to:o.to}:null,a={from:r,insert:i},l=t.state.changes(s?[s,a]:a);t.focus(),t.dispatch({changes:l,selection:{anchor:l.mapPos(r,-1),head:l.mapPos(r,1)},userEvent:s?"move.drop":"input.drop"}),t.inputState.draggedContent=null}Yn.dragstart=(t,e)=>{let{selection:{main:i}}=t.state;if(e.target.draggable){let n=t.docView.nearest(e.target);if(n&&n.isWidget){let t=n.posAtStart,e=t+n.length;(t>=i.to||e<=i.from)&&(i=B.range(t,e))}}let{inputState:n}=t;return n.mouseSelection&&(n.mouseSelection.dragging=!0),n.draggedContent=i,e.dataTransfer&&(e.dataTransfer.setData("Text",Zn(t.state,ji,t.state.sliceDoc(i.from,i.to))),e.dataTransfer.effectAllowed="copyMove"),!1},Yn.dragend=t=>(t.inputState.draggedContent=null,!1),Yn.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let i=e.dataTransfer.files;if(i&&i.length){let n=Array(i.length),r=0,o=()=>{++r==i.length&&lr(t,e,n.filter((t=>null!=t)).join(t.state.lineBreak),!1)};for(let t=0;t{/[\x00-\x08\x0e-\x1f]{2}/.test(e.result)||(n[t]=e.result),o()},e.readAsText(i[t])}return!0}{let i=e.dataTransfer.getData("Text");if(i)return lr(t,e,i,!0),!0}return!1},Yn.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let i=Kn?null:e.clipboardData;return i?(Jn(t,i.getData("text/plain")||i.getData("text/uri-list")),!0):(function(t){let e=t.dom.parentNode;if(!e)return;let i=e.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.focus(),setTimeout((()=>{t.focus(),i.remove(),Jn(t,i.value)}),50)}(t),!1)};let hr=null;Yn.copy=Yn.cut=(t,e)=>{let{text:i,ranges:n,linewise:r}=function(t){let e=[],i=[],n=!1;for(let n of t.selection.ranges)n.empty||(e.push(t.sliceDoc(n.from,n.to)),i.push(n));if(!e.length){let r=-1;for(let{from:n}of t.selection.ranges){let o=t.doc.lineAt(n);o.number>r&&(e.push(o.text),i.push({from:o.from,to:Math.min(t.doc.length,o.to+1)})),r=o.number}n=!0}return{text:Zn(t,ji,e.join(t.lineBreak)),ranges:i,linewise:n}}(t.state);if(!i&&!r)return!1;hr=r?i:null,"cut"!=e.type||t.state.readOnly||t.dispatch({changes:n,scrollIntoView:!0,userEvent:"delete.cut"});let o=Kn?null:e.clipboardData;return o?(o.clearData(),o.setData("text/plain",i),!0):(function(t,e){let i=t.dom.parentNode;if(!i)return;let n=i.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.value=e,n.focus(),n.selectionEnd=e.length,n.selectionStart=0,setTimeout((()=>{n.remove(),t.focus()}),50)}(t,i),!1)};const cr=pt.define();function ur(t,e){let i=[];for(let n of t.facet(Wi)){let r=n(t,e);r&&i.push(r)}return i?t.update({effects:i,annotations:cr.of(!0)}):null}function dr(t){setTimeout((()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let i=ur(t.state,e);i?t.dispatch(i):t.update([])}}),10)}Xn.focus=t=>{t.inputState.lastFocusTime=Date.now(),t.scrollDOM.scrollTop||!t.inputState.lastScrollTop&&!t.inputState.lastScrollLeft||(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),dr(t)},Xn.blur=t=>{t.observer.clearSelectionRange(),dr(t)},Xn.compositionstart=Xn.compositionupdate=t=>{t.observer.editContext||(null==t.inputState.compositionFirstChange&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))},Xn.compositionend=t=>{t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,je.chrome&&je.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then((()=>t.observer.flush())):setTimeout((()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])}),50))},Xn.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()},Yn.beforeinput=(t,e)=>{var i,n;if("insertReplacementText"==e.inputType&&t.observer.editContext){let n=null===(i=e.dataTransfer)||void 0===i?void 0:i.getData("text/plain"),r=e.getTargetRanges();if(n&&r.length){let e=r[0],i=t.posAtDOM(e.startContainer,e.startOffset),o=t.posAtDOM(e.endContainer,e.endOffset);return $n(t,{from:i,to:o,insert:t.state.toText(n)},null),!0}}let r;if(je.chrome&&je.android&&(r=Wn.find((t=>t.inputType==e.inputType)))&&(t.observer.delayAndroidKey(r.key,r.keyCode),"Backspace"==r.key||"Delete"==r.key)){let e=(null===(n=window.visualViewport)||void 0===n?void 0:n.height)||0;setTimeout((()=>{var i;((null===(i=window.visualViewport)||void 0===i?void 0:i.height)||0)>e+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())}),100)}return je.ios&&"deleteContentForward"==e.inputType&&t.observer.flushSoon(),je.safari&&"insertText"==e.inputType&&t.inputState.composing>=0&&setTimeout((()=>Xn.compositionend(t,e)),20),!1};const pr=new Set;const fr=["pre-wrap","normal","pre-line","break-spaces"];let gr=!1;function mr(){gr=!1}class vr{constructor(t){this.lineWrapping=t,this.doc=d.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(t,e){let i=this.doc.lineAt(e).number-this.doc.lineAt(t).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((e-t-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(t){if(!this.lineWrapping)return this.lineHeight;return(1+Math.max(0,Math.ceil((t-this.lineLength)/(this.lineLength-5))))*this.lineHeight}setDoc(t){return this.doc=t,this}mustRefreshForWrapping(t){return fr.indexOf(t)>-1!=this.lineWrapping}mustRefreshForHeights(t){let e=!1;for(let i=0;i-1,a=Math.round(e)!=Math.round(this.lineHeight)||this.lineWrapping!=s;if(this.lineWrapping=s,this.lineHeight=e,this.charWidth=i,this.textHeight=n,this.lineLength=r,a){this.heightSamples={};for(let t=0;t0}set outdated(t){this.flags=(t?2:0)|-3&this.flags}setHeight(t){this.height!=t&&(Math.abs(this.height-t)>xr&&(gr=!0),this.height=t)}replace(t,e,i){return _r.of(i)}decomposeLeft(t,e){e.push(this)}decomposeRight(t,e){e.push(this)}applyChanges(t,e,i,n){let r=this,o=i.doc;for(let s=n.length-1;s>=0;s--){let{fromA:a,toA:l,fromB:h,toB:c}=n[s],u=r.lineAt(a,wr.ByPosNoHeight,i.setDoc(e),0,0),d=u.to>=l?u:r.lineAt(l,wr.ByPosNoHeight,i,0,0);for(c+=d.to-l,l=d.to;s>0&&u.from<=n[s-1].toA;)a=n[s-1].fromA,h=n[s-1].fromB,s--,a2*r){let r=t[e-1];r.break?t.splice(--e,1,r.left,null,r.right):t.splice(--e,1,r.left,r.right),i+=1+r.break,n-=r.size}else{if(!(r>2*n))break;{let e=t[i];e.break?t.splice(i,1,e.left,null,e.right):t.splice(i,1,e.left,e.right),i+=2+e.break,r-=e.size}}else if(n=r&&o(this.blockAt(0,i,n,r))}updateHeight(t,e=0,i=!1,n){return n&&n.from<=e&&n.more&&this.setHeight(n.heights[n.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Ar extends Sr{constructor(t,e){super(t,e,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(t,e,i,n){return new br(n,this.length,i,this.height,this.breaks)}replace(t,e,i){let n=i[0];return 1==i.length&&(n instanceof Ar||n instanceof Cr&&4&n.flags)&&Math.abs(this.length-n.length)<10?(n instanceof Cr?n=new Ar(n.length,this.height):n.height=this.height,this.outdated||(n.outdated=!1),n):_r.of(i)}updateHeight(t,e=0,i=!1,n){return n&&n.from<=e&&n.more?this.setHeight(n.heights[n.index++]):(i||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,t.heightForLine(this.length-this.collapsed))+this.breaks*t.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class Cr extends _r{constructor(t){super(t,0)}heightMetrics(t,e){let i,n=t.doc.lineAt(e).number,r=t.doc.lineAt(e+this.length).number,o=r-n+1,s=0;if(t.lineWrapping){let e=Math.min(this.height,t.lineHeight*o);i=e/o,this.length>o+1&&(s=(this.height-e)/(this.length-o-1))}else i=this.height/o;return{firstLine:n,lastLine:r,perLine:i,perChar:s}}blockAt(t,e,i,n){let{firstLine:r,lastLine:o,perLine:s,perChar:a}=this.heightMetrics(e,n);if(e.lineWrapping){let r=n+(t0){let t=i[i.length-1];t instanceof Cr?i[i.length-1]=new Cr(t.length+n):i.push(null,new Cr(n-1))}if(t>0){let e=i[0];e instanceof Cr?i[0]=new Cr(t+e.length):i.unshift(new Cr(t-1),null)}return _r.of(i)}decomposeLeft(t,e){e.push(new Cr(t-1),null)}decomposeRight(t,e){e.push(null,new Cr(this.length-t-1))}updateHeight(t,e=0,i=!1,n){let r=e+this.length;if(n&&n.from<=e+this.length&&n.more){let i=[],o=Math.max(e,n.from),s=-1;for(n.from>e&&i.push(new Cr(n.from-e-1).updateHeight(t,e));o<=r&&n.more;){let e=t.doc.lineAt(o).length;i.length&&i.push(null);let r=n.heights[n.index++];-1==s?s=r:Math.abs(r-s)>=xr&&(s=-2);let a=new Ar(e,r);a.outdated=!1,i.push(a),o+=e+1}o<=r&&i.push(null,new Cr(r-o).updateHeight(t,o));let a=_r.of(i);return(s<0||Math.abs(a.height-this.height)>=xr||Math.abs(s-this.heightMetrics(t,e).perLine)>=xr)&&(gr=!0),kr(this,a)}return(i||this.outdated)&&(this.setHeight(t.heightForGap(e,e+this.length)),this.outdated=!1),this}toString(){return`gap(${this.length})`}}class Mr extends _r{constructor(t,e,i){super(t.length+e+i.length,t.height+i.height,e|(t.outdated||i.outdated?2:0)),this.left=t,this.right=i,this.size=t.size+i.size}get break(){return 1&this.flags}blockAt(t,e,i,n){let r=i+this.left.height;return ts))return l;let h=e==wr.ByPosNoHeight?wr.ByPosNoHeight:wr.ByPos;return a?l.join(this.right.lineAt(s,h,i,o,s)):this.left.lineAt(s,h,i,n,r).join(l)}forEachLine(t,e,i,n,r,o){let s=n+this.left.height,a=r+this.left.length+this.break;if(this.break)t=a&&this.right.forEachLine(t,e,i,s,a,o);else{let l=this.lineAt(a,wr.ByPos,i,n,r);t=t&&l.from<=e&&o(l),e>l.to&&this.right.forEachLine(l.to+1,e,i,s,a,o)}}replace(t,e,i){let n=this.left.length+this.break;if(ethis.left.length)return this.balanced(this.left,this.right.replace(t-n,e-n,i));let r=[];t>0&&this.decomposeLeft(t,r);let o=r.length;for(let t of i)r.push(t);if(t>0&&Dr(r,o-1),e=i&&e.push(null)),t>i&&this.right.decomposeLeft(t-i,e)}decomposeRight(t,e){let i=this.left.length,n=i+this.break;if(t>=n)return this.right.decomposeRight(t-n,e);t2*e.size||e.size>2*t.size?_r.of(this.break?[t,null,e]:[t,e]):(this.left=kr(this.left,t),this.right=kr(this.right,e),this.setHeight(t.height+e.height),this.outdated=t.outdated||e.outdated,this.size=t.size+e.size,this.length=t.length+this.break+e.length,this)}updateHeight(t,e=0,i=!1,n){let{left:r,right:o}=this,s=e+r.length+this.break,a=null;return n&&n.from<=e+r.length&&n.more?a=r=r.updateHeight(t,e,i,n):r.updateHeight(t,e,i),n&&n.from<=s+o.length&&n.more?a=o=o.updateHeight(t,s,i,n):o.updateHeight(t,s,i),a?this.balanced(r,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function Dr(t,e){let i,n;null==t[e]&&(i=t[e-1])instanceof Cr&&(n=t[e+1])instanceof Cr&&t.splice(e-1,3,new Cr(i.length+1+n.length))}class Tr{constructor(t,e){this.pos=t,this.oracle=e,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(t,e){if(this.lineStart>-1){let t=Math.min(e,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof Ar?i.length+=t-this.pos:(t>this.pos||!this.isCovered)&&this.nodes.push(new Ar(t-this.pos,-1)),this.writtenTo=t,e>t&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=e}point(t,e,i){if(t=5)&&this.addLineDeco(n,r,o)}else e>t&&this.span(t,e);this.lineEnd>-1&&this.lineEnd-1)return;let{from:t,to:e}=this.oracle.doc.lineAt(this.pos);this.lineStart=t,this.lineEnd=e,this.writtenTot&&this.nodes.push(new Ar(this.pos-t,-1)),this.writtenTo=this.pos}blankContent(t,e){let i=new Cr(e-t);return this.oracle.doc.lineAt(t).to==e&&(i.flags|=4),i}ensureLine(){this.enterLine();let t=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(t instanceof Ar)return t;let e=new Ar(0,-1);return this.nodes.push(e),e}addBlock(t){this.enterLine();let e=t.deco;e&&e.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(t),this.writtenTo=this.pos=this.pos+t.length,e&&e.endSide>0&&(this.covering=t)}addLineDeco(t,e,i){let n=this.ensureLine();n.length+=i,n.collapsed+=i,n.widgetHeight=Math.max(n.widgetHeight,t),n.breaks+=e,this.writtenTo=this.pos=this.pos+i}finish(t){let e=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(this.lineStart>-1)||e instanceof Ar||this.isCovered?(this.writtenToi.clientHeight||i.scrollWidth>i.clientWidth)&&"visible"!=n.overflow){let n=i.getBoundingClientRect();o=Math.max(o,n.left),s=Math.min(s,n.right),a=Math.max(a,n.top),l=Math.min(e==t.parentNode?r.innerHeight:l,n.bottom)}e="absolute"==n.position||"fixed"==n.position?i.offsetParent:i.parentNode}else{if(11!=e.nodeType)break;e=e.host}return{left:o-i.left,right:Math.max(o,s)-i.left,top:a-(i.top+e),bottom:Math.max(a,l)-(i.top+e)}}function Er(t,e){let i=t.getBoundingClientRect();return{left:0,right:i.right-i.left,top:e,bottom:i.bottom-(i.top+e)}}class Pr{constructor(t,e,i,n){this.from=t,this.to=e,this.size=i,this.displaySize=n}static same(t,e){if(t.length!=e.length)return!1;for(let i=0;i"function"!=typeof t&&"cm-lineWrapping"==t.class));this.heightOracle=new vr(e),this.stateDeco=t.facet(an).filter((t=>"function"!=typeof t)),this.heightMap=_r.empty().applyChanges(this.stateDeco,d.empty,this.heightOracle.setDoc(t.doc),[new gn(0,0,0,t.doc.length)]);for(let t=0;t<2&&(this.viewport=this.getViewport(0,null),this.updateForViewport());t++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=si.set(this.lineGaps.map((t=>t.draw(this,!1)))),this.computeVisibleRanges()}updateForViewport(){let t=[this.viewport],{main:e}=this.state.selection;for(let i=0;i<=1;i++){let n=i?e.head:e.anchor;if(!t.some((({from:t,to:e})=>n>=t&&n<=e))){let{from:e,to:i}=this.lineBlockAt(n);t.push(new Nr(e,i))}}return this.viewports=t.sort(((t,e)=>t.from-e.from)),this.updateScaler()}updateScaler(){let t=this.scaler;return this.scaler=this.heightMap.height<=7e6?$r:new Fr(this.heightOracle,this.heightMap,this.viewports),t.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,(t=>{this.viewportLines.push(Vr(t,this.scaler))}))}update(t,e=null){this.state=t.state;let i=this.stateDeco;this.stateDeco=this.state.facet(an).filter((t=>"function"!=typeof t));let n=t.changedRanges,r=gn.extendWithRanges(n,function(t,e,i){let n=new Ir;return Lt.compare(t,e,i,n,0),n.changes}(i,this.stateDeco,t?t.changes:T.empty(this.state.doc.length))),o=this.heightMap.height,s=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);mr(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,t.startState.doc,this.heightOracle.setDoc(this.state.doc),r),(this.heightMap.height!=o||gr)&&(t.flags|=2),s?(this.scrollAnchorPos=t.changes.mapPos(s.from,-1),this.scrollAnchorHeight=s.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let a=r.length?this.mapViewport(this.viewport,t.changes):this.viewport;(e&&(e.range.heada.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,e));let l=a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,t.flags|=this.updateForViewport(),(l||!t.changes.empty||2&t.flags)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,t.changes))),t.flags|=this.computeVisibleRanges(),e&&(this.scrollTarget=e),!this.mustEnforceCursorAssoc&&t.selectionSet&&t.view.lineWrapping&&t.state.selection.main.empty&&t.state.selection.main.assoc&&!t.state.facet(qi)&&(this.mustEnforceCursorAssoc=!0)}measure(t){let e=t.contentDOM,i=window.getComputedStyle(e),n=this.heightOracle,r=i.whiteSpace;this.defaultTextDirection="rtl"==i.direction?yi.RTL:yi.LTR;let o=this.heightOracle.mustRefreshForWrapping(r),s=e.getBoundingClientRect(),a=o||this.mustMeasureContent||this.contentDOMHeight!=s.height;this.contentDOMHeight=s.height,this.mustMeasureContent=!1;let l=0,h=0;if(s.width&&s.height){let{scaleX:t,scaleY:i}=me(e,s);(t>.005&&Math.abs(this.scaleX-t)>.005||i>.005&&Math.abs(this.scaleY-i)>.005)&&(this.scaleX=t,this.scaleY=i,l|=8,o=a=!0)}let c=(parseInt(i.paddingTop)||0)*this.scaleY,u=(parseInt(i.paddingBottom)||0)*this.scaleY;this.paddingTop==c&&this.paddingBottom==u||(this.paddingTop=c,this.paddingBottom=u,l|=10),this.editorWidth!=t.scrollDOM.clientWidth&&(n.lineWrapping&&(a=!0),this.editorWidth=t.scrollDOM.clientWidth,l|=8);let p=t.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=p&&(this.scrollAnchorHeight=-1,this.scrollTop=p),this.scrolledToBottom=Se(t.scrollDOM);let f=(this.printing?Er:Or)(e,this.paddingTop),g=f.top-this.pixelViewport.top,m=f.bottom-this.pixelViewport.bottom;this.pixelViewport=f;let v=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(v!=this.inView&&(this.inView=v,v&&(a=!0)),!this.inView&&!this.scrollTarget)return 0;let y=s.width;if(this.contentDOMWidth==y&&this.editorHeight==t.scrollDOM.clientHeight||(this.contentDOMWidth=s.width,this.editorHeight=t.scrollDOM.clientHeight,l|=8),a){let e=t.docView.measureVisibleLineHeights(this.viewport);if(n.mustRefreshForHeights(e)&&(o=!0),o||n.lineWrapping&&Math.abs(y-this.contentDOMWidth)>n.charWidth){let{lineHeight:i,charWidth:s,textHeight:a}=t.docView.measureTextSize();o=i>0&&n.refresh(r,i,s,a,y/s,e),o&&(t.docView.minWidth=0,l|=8)}g>0&&m>0?h=Math.max(g,m):g<0&&m<0&&(h=Math.min(g,m)),mr();for(let i of this.viewports){let r=i.from==this.viewport.from?e:t.docView.measureVisibleLineHeights(i);this.heightMap=(o?_r.empty().applyChanges(this.stateDeco,d.empty,this.heightOracle,[new gn(0,0,0,t.state.doc.length)]):this.heightMap).updateHeight(n,0,o,new yr(i.from,r))}gr&&(l|=2)}let b=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return b&&(2&l&&(l|=this.updateScaler()),this.viewport=this.getViewport(h,this.scrollTarget),l|=this.updateForViewport()),(2&l||b)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,t)),l|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,t.docView.enforceCursorAssoc()),l}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(t,e){let i=.5-Math.max(-.5,Math.min(.5,t/1e3/2)),n=this.heightMap,r=this.heightOracle,{visibleTop:o,visibleBottom:s}=this,a=new Nr(n.lineAt(o-1e3*i,wr.ByHeight,r,0,0).from,n.lineAt(s+1e3*(1-i),wr.ByHeight,r,0,0).to);if(e){let{head:t}=e.range;if(ta.to){let i,o=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),s=n.lineAt(t,wr.ByPos,r,0,0);i="center"==e.y?(s.top+s.bottom)/2-o/2:"start"==e.y||"nearest"==e.y&&t=s+Math.max(10,Math.min(i,250)))&&n>o-2e3&&r>1,o=n<<1;if(this.defaultTextDirection!=yi.LTR&&!i)return[];let s=[],a=(n,o,l,h)=>{if(o-nn&&tt.from>=l.from&&t.to<=l.to&&Math.abs(t.from-n)t.frome))));if(!d){if(ot.from<=o&&t.to>=o))){let t=e.moveToLineBoundary(B.cursor(o),!1,!0).head;t>n&&(o=t)}let t=this.gapSize(l,n,o,h);d=new Pr(n,o,t,i||t<2e6?t:2e6)}s.push(d)},l=e=>{if(e.lengthr&&(n.push({from:r,to:t}),o+=t-r),r=e}},20),r2e6)for(let i of t)i.from>=e.from&&i.frome.from&&a(e.from,s,e,r),lt.draw(this,this.heightOracle.lineWrapping)))))}computeVisibleRanges(){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let e=[];Lt.spans(t,this.viewport.from,this.viewport.to,{span(t,i){e.push({from:t,to:i})},point(){}},20);let i=e.length!=this.visibleRanges.length||this.visibleRanges.some(((t,i)=>t.from!=e[i].from||t.to!=e[i].to));return this.visibleRanges=e,i?4:0}lineBlockAt(t){return t>=this.viewport.from&&t<=this.viewport.to&&this.viewportLines.find((e=>e.from<=t&&e.to>=t))||Vr(this.heightMap.lineAt(t,wr.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(t){return t>=this.viewportLines[0].top&&t<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find((e=>e.top<=t&&e.bottom>=t))||Vr(this.heightMap.lineAt(this.scaler.fromDOM(t),wr.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(t){let e=this.lineBlockAtHeight(t+8);return e.from>=this.viewport.from||this.viewportLines[0].top-t>200?e:this.viewportLines[0]}elementAtHeight(t){return Vr(this.heightMap.blockAt(this.scaler.fromDOM(t),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Nr{constructor(t,e){this.from=t,this.to=e}}function Br({total:t,ranges:e},i){if(i<=0)return e[0].from;if(i>=1)return e[e.length-1].to;let n=Math.floor(t*i);for(let t=0;;t++){let{from:i,to:r}=e[t],o=r-i;if(n<=o)return i+n;n-=o}}function zr(t,e){let i=0;for(let{from:n,to:r}of t.ranges){if(e<=r){i+=e-n;break}i+=r-n}return i/t.total}const $r={toDOM:t=>t,fromDOM:t=>t,scale:1,eq(t){return t==this}};class Fr{constructor(t,e,i){let n=0,r=0,o=0;this.viewports=i.map((({from:i,to:r})=>{let o=e.lineAt(i,wr.ByPos,t,0,0).top,s=e.lineAt(r,wr.ByPos,t,0,0).bottom;return n+=s-o,{from:i,to:r,top:o,bottom:s,domTop:0,domBottom:0}})),this.scale=(7e6-n)/(e.height-n);for(let t of this.viewports)t.domTop=o+(t.top-r)*this.scale,o=t.domBottom=t.domTop+(t.bottom-t.top),r=t.bottom}toDOM(t){for(let e=0,i=0,n=0;;e++){let r=ee.from==t.viewports[i].from&&e.to==t.viewports[i].to)))}}function Vr(t,e){if(1==e.scale)return t;let i=e.toDOM(t.top),n=e.toDOM(t.bottom);return new br(t.from,t.length,i,n-i,Array.isArray(t._content)?t._content.map((t=>Vr(t,e))):t._content)}const Hr=F.define({combine:t=>t.join(" ")}),Wr=F.define({combine:t=>t.indexOf(!0)>-1}),Ur=Kt.newName(),jr=Kt.newName(),Gr=Kt.newName(),qr={"&light":"."+jr,"&dark":"."+Gr};function Yr(t,e,i){return new Kt(e,{finish:e=>/&/.test(e)?e.replace(/&\w*/,(e=>{if("&"==e)return t;if(!i||!i[e])throw new RangeError(`Unsupported selector: ${e}`);return i[e]})):t+" "+e})}const Xr=Yr("."+Ur,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:'url(\'data:image/svg+xml,\')',backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},qr),Kr={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Zr=je.ie&&je.ie_version<=11;class Jr{constructor(t){this.view=t,this.active=!1,this.editContext=null,this.selectionRange=new ve,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=t.contentDOM,this.observer=new MutationObserver((e=>{for(let t of e)this.queue.push(t);(je.ie&&je.ie_version<=11||je.ios&&t.composing)&&e.some((t=>"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length))?this.flushSoon():this.flush()})),!window.EditContext||!1===t.constructor.EDIT_CONTEXT||je.chrome&&je.chrome_version<126||(this.editContext=new eo(t),t.state.facet(Qi)&&(t.contentDOM.editContext=this.editContext.editContext)),Zr&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),"function"==typeof ResizeObserver&&(this.resizeScroll=new ResizeObserver((()=>{var t;(null===(t=this.view.docView)||void 0===t?void 0:t.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))}),{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver((t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))}),{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(t){this.view.inputState.runHandlers("scroll",t),this.intersecting&&this.view.measure()}onScroll(t){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(t)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout((()=>{this.resizeTimeout=-1,this.view.requestMeasure()}),50))}onPrint(t){("change"!=t.type&&t.type||t.matches)&&(this.view.viewState.printing=!0,this.view.measure(),setTimeout((()=>{this.view.viewState.printing=!1,this.view.requestMeasure()}),500))}updateGaps(t){if(this.gapIntersection&&(t.length!=this.gaps.length||this.gaps.some(((e,i)=>e!=t[i])))){this.gapIntersection.disconnect();for(let e of t)this.gapIntersection.observe(e);this.gaps=t}}onSelectionChange(t){let e=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,n=this.selectionRange;if(i.state.facet(Qi)?i.root.activeElement!=this.dom:!ae(this.dom,n))return;let r=n.anchorNode&&i.docView.nearest(n.anchorNode);r&&r.ignoreEvent(t)?e||(this.selectionChanged=!1):(je.ie&&je.ie_version<=11||je.android&&je.chrome)&&!i.state.selection.main.empty&&n.focusNode&&he(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:t}=this,e=oe(t.root);if(!e)return!1;let i=je.safari&&11==t.root.nodeType&&t.root.activeElement==this.dom&&function(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return to(t,i)}let i=null;function n(t){t.preventDefault(),t.stopImmediatePropagation(),i=t.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",n,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",n,!0),i?to(t,i):null}(this.view,e)||e;if(!i||this.selectionRange.eq(i))return!1;let n=ae(this.dom,i);return n&&!this.selectionChanged&&t.inputState.lastFocusTime>Date.now()-200&&t.inputState.lastTouchTime{let t=this.delayedAndroidKey;if(t){this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=t.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&t.force&&_e(this.dom,t.key,t.keyCode)}};this.flushingAndroidKey=this.view.win.requestAnimationFrame(t)}this.delayedAndroidKey&&"Enter"!=t||(this.delayedAndroidKey={key:t,keyCode:e,force:this.lastChange{this.delayedFlush=-1,this.flush()})))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}processRecords(){let t=this.pendingRecords();t.length&&(this.queue=[]);let e=-1,i=-1,n=!1;for(let r of t){let t=this.readMutation(r);t&&(t.typeOver&&(n=!0),-1==e?({from:e,to:i}=t):(e=Math.min(t.from,e),i=Math.max(t.to,i)))}return{from:e,to:i,typeOver:n}}readChange(){let{from:t,to:e,typeOver:i}=this.processRecords(),n=this.selectionChanged&&ae(this.dom,this.selectionRange);if(t<0&&!n)return null;t>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let r=new Bn(this.view,t,e,i);return this.view.docView.domChanged={newSel:r.newSel?r.newSel.main:null},r}flush(t=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;t&&this.readSelectionRange();let e=this.readChange();if(!e)return this.view.requestMeasure(),!1;let i=this.view.state,n=zn(this.view,e);return this.view.state==i&&(e.domChanged||e.newSel&&!e.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),n}readMutation(t){let e=this.view.docView.nearest(t.target);if(!e||e.ignoreMutation(t))return null;if(e.markDirty("attributes"==t.type),"attributes"==t.type&&(e.flags|=4),"childList"==t.type){let i=Qr(e,t.previousSibling||t.target.previousSibling,-1),n=Qr(e,t.nextSibling||t.target.nextSibling,1);return{from:i?e.posAfter(i):e.posAtStart,to:n?e.posBefore(n):e.posAtEnd,typeOver:!1}}return"characterData"==t.type?{from:e.posAtStart,to:e.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}:null}setWindow(t){t!=this.win&&(this.removeWindowListeners(this.win),this.win=t,this.addWindowListeners(this.win))}addWindowListeners(t){t.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):t.addEventListener("beforeprint",this.onPrint),t.addEventListener("scroll",this.onScroll),t.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(t){t.removeEventListener("scroll",this.onScroll),t.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):t.removeEventListener("beforeprint",this.onPrint),t.document.removeEventListener("selectionchange",this.onSelectionChange)}update(t){this.editContext&&(this.editContext.update(t),t.startState.facet(Qi)!=t.state.facet(Qi)&&(t.view.contentDOM.editContext=t.state.facet(Qi)?this.editContext.editContext:null))}destroy(){var t,e,i;this.stop(),null===(t=this.intersection)||void 0===t||t.disconnect(),null===(e=this.gapIntersection)||void 0===e||e.disconnect(),null===(i=this.resizeScroll)||void 0===i||i.disconnect();for(let t of this.scrollTargets)t.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function Qr(t,e,i){for(;e;){let n=Te.get(e);if(n&&n.parent==t)return n;let r=e.parentNode;e=r!=t.dom?r:i>0?e.nextSibling:e.previousSibling}return null}function to(t,e){let i=e.startContainer,n=e.startOffset,r=e.endContainer,o=e.endOffset,s=t.docView.domAtPos(t.state.selection.main.anchor);return he(s.node,s.offset,r,o)&&([i,n,r,o]=[r,o,i,n]),{anchorNode:i,anchorOffset:n,focusNode:r,focusOffset:o}}class eo{constructor(t){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(t.state);let e=this.editContext=new window.EditContext({text:t.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,t.state.selection.main.anchor))),selectionEnd:this.toContextPos(t.state.selection.main.head)});this.handlers.textupdate=e=>{let{anchor:i}=t.state.selection.main,n=this.toEditorPos(e.updateRangeStart),r=this.toEditorPos(e.updateRangeEnd);t.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:e.updateRangeStart,editorBase:n,drifted:!1});let o={from:n,to:r,insert:d.of(e.text.split("\n"))};if(o.from==this.from&&ithis.to&&(o.to=i),o.from!=o.to||o.insert.length){if(this.pendingContextChange=o,!t.state.readOnly){let i=this.to-this.from+(o.to-o.from+o.insert.length);$n(t,o,B.single(this.toEditorPos(e.selectionStart,i),this.toEditorPos(e.selectionEnd,i)))}this.pendingContextChange&&(this.revertPending(t.state),this.setSelection(t.state))}},this.handlers.characterboundsupdate=i=>{let n=[],r=null;for(let e=this.toEditorPos(i.rangeStart),o=this.toEditorPos(i.rangeEnd);e{let i=[];for(let t of e.getTextFormats()){let e=t.underlineStyle,n=t.underlineThickness;if("None"!=e&&"None"!=n){let r=this.toEditorPos(t.rangeStart),o=this.toEditorPos(t.rangeEnd);if(r{t.inputState.composing<0&&(t.inputState.composing=0,t.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(t.inputState.composing=-1,t.inputState.compositionFirstChange=null,this.composing){let{drifted:e}=this.composing;this.composing=null,e&&this.reset(t.state)}};for(let t in this.handlers)e.addEventListener(t,this.handlers[t]);this.measureReq={read:t=>{this.editContext.updateControlBounds(t.contentDOM.getBoundingClientRect());let e=oe(t.root);e&&e.rangeCount&&this.editContext.updateSelectionBounds(e.getRangeAt(0).getBoundingClientRect())}}}applyEdits(t){let e=0,i=!1,n=this.pendingContextChange;return t.changes.iterChanges(((r,o,s,a,l)=>{if(i)return;let h=l.length-(o-r);if(n&&o>=n.to){if(n.from==r&&n.to==o&&n.insert.eq(l))return n=this.pendingContextChange=null,e+=h,void(this.to+=h);n=null,this.revertPending(t.state)}if(r+=e,(o+=e)<=this.from)this.from+=h,this.to+=h;else if(rthis.to||this.to-this.from+l.length>3e4)return void(i=!0);this.editContext.updateText(this.toContextPos(r),this.toContextPos(o),l.toString()),this.to+=h}e+=h})),n&&!i&&this.revertPending(t.state),!i}update(t){let e=this.pendingContextChange;this.composing&&(this.composing.drifted||t.transactions.some((t=>!t.isUserEvent("input.type")&&t.changes.touchesRange(this.from,this.to))))?(this.composing.drifted=!0,this.composing.editorBase=t.changes.mapPos(this.composing.editorBase)):this.applyEdits(t)&&this.rangeIsValid(t.state)?(t.docChanged||t.selectionSet||e)&&this.setSelection(t.state):(this.pendingContextChange=null,this.reset(t.state)),(t.geometryChanged||t.docChanged||t.selectionSet)&&t.view.requestMeasure(this.measureReq)}resetRange(t){let{head:e}=t.selection.main;this.from=Math.max(0,e-1e4),this.to=Math.min(t.doc.length,e+1e4)}reset(t){this.resetRange(t),this.editContext.updateText(0,this.editContext.text.length,t.doc.sliceString(this.from,this.to)),this.setSelection(t)}revertPending(t){let e=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(e.from),this.toContextPos(e.from+e.insert.length),t.doc.sliceString(e.from,e.to))}setSelection(t){let{main:e}=t.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,e.anchor))),n=this.toContextPos(e.head);this.editContext.selectionStart==i&&this.editContext.selectionEnd==n||this.editContext.updateSelection(i,n)}rangeIsValid(t){let{head:e}=t.selection.main;return!(this.from>0&&e-this.from<500||this.to3e4)}toEditorPos(t,e=this.to-this.from){t=Math.min(t,e);let i=this.composing;return i&&i.drifted?i.editorBase+(t-i.contextBase):t+this.from}toContextPos(t){let e=this.composing;return e&&e.drifted?e.contextBase+(t-e.editorBase):t-this.from}destroy(){for(let t in this.handlers)this.editContext.removeEventListener(t,this.handlers[t])}}class io{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(t={}){var e;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),t.parent&&t.parent.appendChild(this.dom);let{dispatch:i}=t;this.dispatchTransactions=t.dispatchTransactions||i&&(t=>t.forEach((t=>i(t,this))))||(t=>this.update(t)),this.dispatch=this.dispatch.bind(this),this._root=t.root||function(t){for(;t;){if(t&&(9==t.nodeType||11==t.nodeType&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}(t.parent)||document,this.viewState=new Rr(t.state||Dt.create(t)),t.scrollTo&&t.scrollTo.is(Ki)&&(this.viewState.scrollTarget=t.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(en).map((t=>new rn(t)));for(let t of this.plugins)t.update(this);this.observer=new Jr(this),this.inputState=new Fn(this),this.inputState.ensureHandlers(this.plugins),this.docView=new vn(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),(null===(e=document.fonts)||void 0===e?void 0:e.ready)&&document.fonts.ready.then((()=>this.requestMeasure()))}dispatch(...t){let e=1==t.length&&t[0]instanceof vt?t:1==t.length&&Array.isArray(t[0])?t[0]:[this.state.update(...t)];this.dispatchTransactions(e,this)}update(t){if(0!=this.updateState)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let e,i=!1,n=!1,r=this.state;for(let e of t){if(e.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=e.state}if(this.destroyed)return void(this.viewState.state=r);let o=this.hasFocus,s=0,a=null;t.some((t=>t.annotation(cr)))?(this.inputState.notifiedFocused=o,s=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=ur(r,o),a||(s=1));let l=this.observer.delayedAndroidKey,h=null;if(l?(this.observer.clearDelayedAndroidKey(),h=this.observer.readChange(),(h&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(h=null)):this.observer.clear(),r.facet(Dt.phrases)!=this.state.facet(Dt.phrases))return this.setState(r);e=mn.create(this,r,t),e.flags|=s;let c=this.viewState.scrollTarget;try{this.updateState=2;for(let e of t){if(c&&(c=c.map(e.changes)),e.scrollIntoView){let{main:t}=e.state.selection;c=new Xi(t.empty?t:B.cursor(t.head,t.head>t.anchor?-1:1))}for(let t of e.effects)t.is(Ki)&&(c=t.value.clip(this.state))}this.viewState.update(e,c),this.bidiCache=oo.update(this.bidiCache,e.changes),e.empty||(this.updatePlugins(e),this.inputState.update(e)),i=this.docView.update(e),this.state.facet(fn)!=this.styleModules&&this.mountStyles(),n=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(i,t.some((t=>t.isUserEvent("select.pointer"))))}finally{this.updateState=0}if(e.startState.facet(Hr)!=e.state.facet(Hr)&&(this.viewState.mustMeasureContent=!0),(i||n||c||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),i&&this.docViewUpdate(),!e.empty)for(let t of this.state.facet(Vi))try{t(e)}catch(t){Ji(this.state,t,"update listener")}(a||h)&&Promise.resolve().then((()=>{a&&this.state==a.startState&&this.dispatch(a),h&&!zn(this,h)&&l.force&&_e(this.contentDOM,l.key,l.keyCode)}))}setState(t){if(0!=this.updateState)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed)return void(this.viewState.state=t);this.updateState=2;let e=this.hasFocus;try{for(let t of this.plugins)t.destroy(this);this.viewState=new Rr(t),this.plugins=t.facet(en).map((t=>new rn(t))),this.pluginMap.clear();for(let t of this.plugins)t.update(this);this.docView.destroy(),this.docView=new vn(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}e&&this.focus(),this.requestMeasure()}updatePlugins(t){let e=t.startState.facet(en),i=t.state.facet(en);if(e!=i){let n=[];for(let r of i){let i=e.indexOf(r);if(i<0)n.push(new rn(r));else{let e=this.plugins[i];e.mustUpdate=t,n.push(e)}}for(let e of this.plugins)e.mustUpdate!=t&&e.destroy(this);this.plugins=n,this.pluginMap.clear()}else for(let e of this.plugins)e.mustUpdate=t;for(let t=0;t-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey)return this.measureScheduled=-1,void this.requestMeasure();this.measureScheduled=0,t&&this.observer.forceFlush();let e=null,i=this.scrollDOM,n=i.scrollTop*this.scaleY,{scrollAnchorPos:r,scrollAnchorHeight:o}=this.viewState;Math.abs(n-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let t=0;;t++){if(o<0)if(Se(i))r=-1,o=this.viewState.heightMap.height;else{let t=this.viewState.scrollAnchorAt(n);r=t.from,o=t.top}this.updateState=1;let s=this.viewState.measure(this);if(!s&&!this.measureRequests.length&&null==this.viewState.scrollTarget)break;if(t>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let a=[];4&s||([this.measureRequests,a]=[a,this.measureRequests]);let l=a.map((t=>{try{return t.read(this)}catch(t){return Ji(this.state,t),ro}})),h=mn.create(this,this.state,[]),c=!1;h.flags|=s,e?e.flags|=s:e=h,this.updateState=2,h.empty||(this.updatePlugins(h),this.inputState.update(h),this.updateAttrs(),c=this.docView.update(h),c&&this.docViewUpdate());for(let t=0;t1||t<-1){n+=t,i.scrollTop=n/this.scaleY,o=-1;continue}}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(e&&!e.empty)for(let t of this.state.facet(Vi))t(e)}get themeClasses(){return Ur+" "+(this.state.facet(Wr)?Gr:jr)+" "+this.state.facet(Hr)}updateAttrs(){let t=so(this,on,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),e={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Qi)?"true":"false",class:"cm-content",style:`${je.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(e["aria-readonly"]="true"),so(this,sn,e);let i=this.observer.ignore((()=>{let i=ii(this.contentDOM,this.contentAttrs,e),n=ii(this.dom,this.editorAttrs,t);return i||n}));return this.editorAttrs=t,this.contentAttrs=e,i}showAnnouncements(t){let e=!0;for(let i of t)for(let t of i.effects)if(t.is(io.announce)){e&&(this.announceDOM.textContent=""),e=!1,this.announceDOM.appendChild(document.createElement("div")).textContent=t.value}}mountStyles(){this.styleModules=this.state.facet(fn);let t=this.state.facet(io.cspNonce);Kt.mount(this.root,this.styleModules.concat(Xr).reverse(),t?{nonce:t}:void 0)}readMeasured(){if(2==this.updateState)throw new Error("Reading the editor layout isn't allowed during an update");0==this.updateState&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(t){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame((()=>this.measure()))),t){if(this.measureRequests.indexOf(t)>-1)return;if(null!=t.key)for(let e=0;ee.spec==t))||null),e&&e.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(t){return this.readMeasured(),this.viewState.elementAtHeight(t)}lineBlockAtHeight(t){return this.readMeasured(),this.viewState.lineBlockAtHeight(t)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(t){return this.viewState.lineBlockAt(t)}get contentHeight(){return this.viewState.contentHeight}moveByChar(t,e,i){return En(this,t,In(this,t,e,i))}moveByGroup(t,e){return En(this,t,In(this,t,e,(e=>function(t,e,i){let n=t.state.charCategorizer(e),r=n(i);return t=>{let e=n(t);return r==St.Space&&(r=e),r==e}}(this,t.head,e))))}visualLineSide(t,e){let i=this.bidiSpans(t),n=this.textDirectionAt(t.from),r=i[e?i.length-1:0];return B.cursor(r.side(e,n)+t.from,r.forward(!e,n)?1:-1)}moveToLineBoundary(t,e,i=!0){return Tn(this,t,e,i)}moveVertically(t,e,i){return En(this,t,function(t,e,i,n){let r=e.head,o=i?1:-1;if(r==(i?t.state.doc.length:0))return B.cursor(r,e.assoc);let s,a=e.goalColumn,l=t.contentDOM.getBoundingClientRect(),h=t.coordsAtPos(r,e.assoc||-1),c=t.documentTop;if(h)null==a&&(a=h.left-l.left),s=o<0?h.top:h.bottom;else{let e=t.viewState.lineBlockAt(r);null==a&&(a=Math.min(l.right-l.left,t.defaultCharacterWidth*(r-e.from))),s=(o<0?e.top:e.bottom)+c}let u=l.left+a,d=null!=n?n:t.viewState.heightOracle.textHeight>>1;for(let e=0;;e+=10){let i=s+(d+e)*o,n=Mn(t,{x:u,y:i},!1,o);if(il.bottom||(o<0?nr)){let e=t.docView.coordsForChar(n),r=!e||i0)}coordsForChar(t){return this.readMeasured(),this.docView.coordsForChar(t)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(t){return!this.state.facet(Gi)||tthis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(t))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(t){if(t.length>no)return Pi(t.length);let e,i=this.textDirectionAt(t.from);for(let n of this.bidiCache)if(n.from==t.from&&n.dir==i&&(n.fresh||Ti(n.isolates,e=un(this,t))))return n.order;e||(e=un(this,t));let n=function(t,e,i){if(!t)return[new Di(0,0,e==wi?1:0)];if(e==bi&&!i.length&&!Mi.test(t))return Pi(t.length);if(i.length)for(;t.length>Ii.length;)Ii[Ii.length]=256;let n=[],r=e==bi?0:1;return Ei(t,r,r,i,0,t.length,n),n}(t.text,i,e);return this.bidiCache.push(new oo(t.from,t.to,i,e,!0,n)),n}get hasFocus(){var t;return(this.dom.ownerDocument.hasFocus()||je.safari&&(null===(t=this.inputState)||void 0===t?void 0:t.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore((()=>{we(this.contentDOM),this.docView.updateSelection()}))}setRoot(t){this._root!=t&&(this._root=t,this.observer.setWindow((9==t.nodeType?t:t.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let t of this.plugins)t.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(t,e={}){return Ki.of(new Xi("number"==typeof t?B.cursor(t):t,e.y,e.x,e.yMargin,e.xMargin))}scrollSnapshot(){let{scrollTop:t,scrollLeft:e}=this.scrollDOM,i=this.viewState.scrollAnchorAt(t);return Ki.of(new Xi(B.cursor(i.from),"start","start",i.top-t,e,!0))}setTabFocusMode(t){null==t?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:"boolean"==typeof t?this.inputState.tabFocusMode=t?0:-1:0!=this.inputState.tabFocusMode&&(this.inputState.tabFocusMode=Date.now()+t)}static domEventHandlers(t){return nn.define((()=>({})),{eventHandlers:t})}static domEventObservers(t){return nn.define((()=>({})),{eventObservers:t})}static theme(t,e){let i=Kt.newName(),n=[Hr.of(i),fn.of(Yr(`.${i}`,t))];return e&&e.dark&&n.push(Wr.of(!0)),n}static baseTheme(t){return Q.lowest(fn.of(Yr("."+Ur,t,qr)))}static findFromDOM(t){var e;let i=t.querySelector(".cm-content"),n=i&&Te.get(i)||Te.get(t);return(null===(e=null==n?void 0:n.rootView)||void 0===e?void 0:e.view)||null}}io.styleModule=fn,io.inputHandler=Hi,io.clipboardInputFilter=Ui,io.clipboardOutputFilter=ji,io.scrollHandler=Yi,io.focusChangeEffect=Wi,io.perLineTextDirection=Gi,io.exceptionSink=Fi,io.updateListener=Vi,io.editable=Qi,io.mouseSelectionStyle=$i,io.dragMovesSelection=zi,io.clickAddsSelectionRange=Bi,io.decorations=an,io.outerDecorations=ln,io.atomicRanges=hn,io.bidiIsolatedRanges=cn,io.scrollMargins=dn,io.darkTheme=Wr,io.cspNonce=F.define({combine:t=>t.length?t[0]:""}),io.contentAttributes=sn,io.editorAttributes=on,io.lineWrapping=io.contentAttributes.of({class:"cm-lineWrapping"}),io.announce=mt.define();const no=4096,ro={};class oo{constructor(t,e,i,n,r,o){this.from=t,this.to=e,this.dir=i,this.isolates=n,this.fresh=r,this.order=o}static update(t,e){if(e.empty&&!t.some((t=>t.fresh)))return t;let i=[],n=t.length?t[t.length-1].dir:yi.LTR;for(let r=Math.max(0,t.length-10);r=0;r--){let e=n[r],o="function"==typeof e?e(t):e;o&&Qe(o,i)}return i}const ao=je.mac?"mac":je.windows?"win":je.linux?"linux":"key";function lo(t,e,i){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),!1!==i&&e.shiftKey&&(t="Shift-"+t),t}const ho=Q.default(io.domEventHandlers({keydown:(t,e)=>function(t,e,i,n){go=e;let r=function(t){var e=!(ee&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||ie&&t.shiftKey&&t.key&&1==t.key.length||"Unidentified"==t.key)&&t.key||(t.shiftKey?te:Qt)[t.keyCode]||t.key||"Unidentified";return"Esc"==e&&(e="Escape"),"Del"==e&&(e="Delete"),"Left"==e&&(e="ArrowLeft"),"Up"==e&&(e="ArrowUp"),"Right"==e&&(e="ArrowRight"),"Down"==e&&(e="ArrowDown"),e}(e),o=k(r,0),s=A(o)==r.length&&" "!=r,a="",l=!1,h=!1,c=!1;po&&po.view==i&&po.scope==n&&(a=po.prefix+" ",jn.indexOf(e.keyCode)<0&&(h=!0,po=null));let u,d,p=new Set,f=t=>{if(t){for(let e of t.run)if(!p.has(e)&&(p.add(e),e(i)))return t.stopPropagation&&(c=!0),!0;t.preventDefault&&(t.stopPropagation&&(c=!0),h=!0)}return!1},g=t[n];g&&(f(g[a+lo(r,e,!s)])?l=!0:s&&(e.altKey||e.metaKey||e.ctrlKey)&&!(je.windows&&e.ctrlKey&&e.altKey)&&(u=Qt[e.keyCode])&&u!=r?(f(g[a+lo(u,e,!0)])||e.shiftKey&&(d=te[e.keyCode])!=r&&d!=u&&f(g[a+lo(d,e,!1)]))&&(l=!0):s&&e.shiftKey&&f(g[a+lo(r,e,!0)])&&(l=!0),!l&&f(g._any)&&(l=!0));h&&(l=!0);l&&c&&e.stopPropagation();return go=null,l}(function(t){let e=t.facet(co),i=uo.get(e);i||uo.set(e,i=function(t,e=ao){let i=Object.create(null),n=Object.create(null),r=(t,e)=>{let i=n[t];if(null==i)n[t]=e;else if(i!=e)throw new Error("Key binding "+t+" is used both as a regular binding and as a multi-stroke prefix")},o=(t,n,o,s,a)=>{var l,h;let c=i[t]||(i[t]=Object.create(null)),u=n.split(/ (?!$)/).map((t=>function(t,e){const i=t.split(/-(?!$)/);let n,r,o,s,a=i[i.length-1];"Space"==a&&(a=" ");for(let t=0;t{let n=po={view:e,prefix:i,scope:t};return setTimeout((()=>{po==n&&(po=null)}),fo),!0}]})}let d=u.join(" ");r(d,!1);let p=c[d]||(c[d]={preventDefault:!1,stopPropagation:!1,run:(null===(h=null===(l=c._any)||void 0===l?void 0:l.run)||void 0===h?void 0:h.slice())||[]});o&&p.run.push(o),s&&(p.preventDefault=!0),a&&(p.stopPropagation=!0)};for(let n of t){let t=n.scope?n.scope.split(" "):["editor"];if(n.any)for(let e of t){let t=i[e]||(i[e]=Object.create(null));t._any||(t._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:r}=n;for(let e in t)t[e].run.push((t=>r(t,go)))}let r=n[e]||n.key;if(r)for(let e of t)o(e,r,n.run,n.preventDefault,n.stopPropagation),n.shift&&o(e,"Shift-"+r,n.shift,n.preventDefault,n.stopPropagation)}return i}(e.reduce(((t,e)=>t.concat(e)),[])));return i}(e.state),t,e,"editor")})),co=F.define({enables:ho}),uo=new WeakMap;let po=null;const fo=4e3;let go=null;const mo={".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"}},".cm-content":{"& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}};!(je.ios&&je.webkit&&je.webkit_version<534)&&(mo[".cm-line"].caretColor=mo[".cm-content"].caretColor="transparent !important");const vo=mt.define({map:(t,e)=>null==t?null:e.mapPos(t)}),yo=q.define({create:()=>null,update:(t,e)=>(null!=t&&(t=e.changes.mapPos(t)),e.effects.reduce(((t,e)=>e.is(vo)?e.value:t),t))}),bo=nn.fromClass(class{constructor(t){this.view=t,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(t){var e;let i=t.state.field(yo);null==i?null!=this.cursor&&(null===(e=this.cursor)||void 0===e||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(t.startState.field(yo)!=i||t.docChanged||t.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:t}=this,e=t.state.field(yo),i=null!=e&&t.coordsAtPos(e);if(!i)return null;let n=t.scrollDOM.getBoundingClientRect();return{left:i.left-n.left+t.scrollDOM.scrollLeft*t.scaleX,top:i.top-n.top+t.scrollDOM.scrollTop*t.scaleY,height:i.bottom-i.top}}drawCursor(t){if(this.cursor){let{scaleX:e,scaleY:i}=this.view;t?(this.cursor.style.left=t.left/e+"px",this.cursor.style.top=t.top/i+"px",this.cursor.style.height=t.height/i+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(t){this.view.state.field(yo)!=t&&this.view.dispatch({effects:vo.of(t)})}},{eventObservers:{dragover(t){this.setDropPos(this.view.posAtCoords({x:t.clientX,y:t.clientY}))},dragleave(t){t.target!=this.view.contentDOM&&this.view.contentDOM.contains(t.relatedTarget)||this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});const wo=si.line({class:"cm-activeLine"}),xo=nn.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=-1,i=[];for(let n of t.state.selection.ranges){let r=t.lineBlockAt(n.head);r.from>e&&(i.push(wo.range(r.from)),e=r.from)}return si.set(i)}},{decorations:t=>t.decorations});class _o extends ri{constructor(t){super(),this.content=t}toDOM(t){let e=document.createElement("span");return e.className="cm-placeholder",e.style.pointerEvents="none",e.appendChild("string"==typeof this.content?document.createTextNode(this.content):"function"==typeof this.content?this.content(t):this.content.cloneNode(!0)),"string"==typeof this.content?e.setAttribute("aria-label","placeholder "+this.content):e.setAttribute("aria-hidden","true"),e}coordsAt(t){let e=t.firstChild?le(t.firstChild):[];if(!e.length)return null;let i=window.getComputedStyle(t.parentNode),n=fe(e[0],"rtl"!=i.direction),r=parseInt(i.lineHeight);return n.bottom-n.top>1.5*r?{left:n.left,right:n.right,top:n.top,bottom:n.top+r}:n}ignoreEvent(){return!1}}function ko(t){return nn.fromClass(class{constructor(e){this.view=e,this.placeholder=t?si.set([si.widget({widget:new _o(t),side:1}).range(0)]):si.none}get decorations(){return this.view.state.doc.length?si.none:this.placeholder}},{decorations:t=>t.decorations})}const So="-10000px";class Ao{constructor(t,e,i,n){this.facet=e,this.createTooltipView=i,this.removeTooltipView=n,this.input=t.state.facet(e),this.tooltips=this.input.filter((t=>t));let r=null;this.tooltipViews=this.tooltips.map((t=>r=i(t,r)))}update(t,e){var i;let n=t.state.facet(this.facet),r=n.filter((t=>t));if(n===this.input){for(let e of this.tooltipViews)e.update&&e.update(t);return!1}let o=[],s=e?[]:null;for(let i=0;ie[i]=t)),e.length=s.length),this.input=n,this.tooltips=r,this.tooltipViews=o,!0}}function Co(t){let{win:e}=t;return{top:0,left:0,bottom:e.innerHeight,right:e.innerWidth}}const Mo=F.define({combine:t=>{var e,i,n;return{position:je.ios?"absolute":(null===(e=t.find((t=>t.position)))||void 0===e?void 0:e.position)||"fixed",parent:(null===(i=t.find((t=>t.parent)))||void 0===i?void 0:i.parent)||null,tooltipSpace:(null===(n=t.find((t=>t.tooltipSpace)))||void 0===n?void 0:n.tooltipSpace)||Co}}}),Do=new WeakMap,To=nn.fromClass(class{constructor(t){this.view=t,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=t.state.facet(Mo);this.position=e.position,this.parent=e.parent,this.classes=t.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver="function"==typeof ResizeObserver?new ResizeObserver((()=>this.measureSoon())):null,this.manager=new Ao(t,Eo,((t,e)=>this.createTooltip(t,e)),(t=>{this.resizeObserver&&this.resizeObserver.unobserve(t.dom),t.dom.remove()})),this.above=this.manager.tooltips.map((t=>!!t.above)),this.intersectionObserver="function"==typeof IntersectionObserver?new IntersectionObserver((t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()}),{threshold:[1]}):null,this.observeIntersection(),t.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let t of this.manager.tooltipViews)this.intersectionObserver.observe(t.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout((()=>{this.measureTimeout=-1,this.maybeMeasure()}),50))}update(t){t.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(t,this.above);e&&this.observeIntersection();let i=e||t.geometryChanged,n=t.state.facet(Mo);if(n.position!=this.position&&!this.madeAbsolute){this.position=n.position;for(let t of this.manager.tooltipViews)t.dom.style.position=this.position;i=!0}if(n.parent!=this.parent){this.parent&&this.container.remove(),this.parent=n.parent,this.createContainer();for(let t of this.manager.tooltipViews)this.container.appendChild(t.dom);i=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);i&&this.maybeMeasure()}createTooltip(t,e){let i=t.create(this.view),n=e?e.dom:null;if(i.dom.classList.add("cm-tooltip"),t.arrow&&!i.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let t=document.createElement("div");t.className="cm-tooltip-arrow",i.dom.appendChild(t)}return i.dom.style.position=this.position,i.dom.style.top=So,i.dom.style.left="0px",this.container.insertBefore(i.dom,n),i.mount&&i.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(i.dom),i}destroy(){var t,e,i;this.view.win.removeEventListener("resize",this.measureSoon);for(let e of this.manager.tooltipViews)e.dom.remove(),null===(t=e.destroy)||void 0===t||t.call(e);this.parent&&this.container.remove(),null===(e=this.resizeObserver)||void 0===e||e.disconnect(),null===(i=this.intersectionObserver)||void 0===i||i.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let t=1,e=1,i=!1;if("fixed"==this.position&&this.manager.tooltipViews.length){let{dom:t}=this.manager.tooltipViews[0];if(je.gecko)i=t.offsetParent!=this.container.ownerDocument.body;else if(t.style.top==So&&"0px"==t.style.left){let e=t.getBoundingClientRect();i=Math.abs(e.top+1e4)>1||Math.abs(e.left)>1}}if(i||"absolute"==this.position)if(this.parent){let i=this.parent.getBoundingClientRect();i.width&&i.height&&(t=i.width/this.parent.offsetWidth,e=i.height/this.parent.offsetHeight)}else({scaleX:t,scaleY:e}=this.view.viewState);let n=this.view.scrollDOM.getBoundingClientRect(),r=pn(this.view);return{visible:{left:n.left+r.left,top:n.top+r.top,right:n.right-r.right,bottom:n.bottom-r.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map(((t,e)=>{let i=this.manager.tooltipViews[e];return i.getCoords?i.getCoords(t.pos):this.view.coordsAtPos(t.pos)})),size:this.manager.tooltipViews.map((({dom:t})=>t.getBoundingClientRect())),space:this.view.state.facet(Mo).tooltipSpace(this.view),scaleX:t,scaleY:e,makeAbsolute:i}}writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let t of this.manager.tooltipViews)t.dom.style.position="absolute"}let{visible:i,space:n,scaleX:r,scaleY:o}=t,s=[];for(let a=0;a=Math.min(i.bottom,n.bottom)||u.rightMath.min(i.right,n.right)+.1)){c.style.top=So;continue}let p=l.arrow?h.dom.querySelector(".cm-tooltip-arrow"):null,f=p?7:0,g=d.right-d.left,m=null!==(e=Do.get(h))&&void 0!==e?e:d.bottom-d.top,v=h.offset||Oo,y=this.view.textDirection==yi.LTR,b=d.width>n.right-n.left?y?n.left:n.right-d.width:y?Math.max(n.left,Math.min(u.left-(p?14:0)+v.x,n.right-g)):Math.min(Math.max(n.left,u.left-g+(p?14:0)-v.x),n.right-g),w=this.above[a];!l.strictSide&&(w?u.top-m-f-v.yn.bottom)&&w==n.bottom-u.bottom>u.top-n.top&&(w=this.above[a]=!w);let x=(w?u.top-n.top:n.bottom-u.bottom)-f;if(xb&&t.top<_+m&&t.bottom>_&&(_=w?t.top-m-2-f:t.bottom+f+2);if("absolute"==this.position?(c.style.top=(_-t.parent.top)/o+"px",Io(c,(b-t.parent.left)/r)):(c.style.top=_/o+"px",Io(c,b/r)),p){let t=u.left+(y?v.x:-v.x)-(b+14-7);p.style.left=t/r+"px"}!0!==h.overlap&&s.push({left:b,top:_,right:k,bottom:_+m}),c.classList.toggle("cm-tooltip-above",w),c.classList.toggle("cm-tooltip-below",!w),h.positioned&&h.positioned(t.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let t of this.manager.tooltipViews)t.dom.style.top=So}},{eventObservers:{scroll(){this.maybeMeasure()}}});function Io(t,e){let i=parseInt(t.style.left,10);(isNaN(i)||Math.abs(e-i)>1)&&(t.style.left=e+"px")}const Oo={x:0,y:0},Eo=F.define({enables:[To,io.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}})]});function Po(t,e){let i=t.plugin(To);if(!i)return null;let n=i.manager.tooltips.indexOf(e);return n<0?null:i.manager.tooltipViews[n]}class Lo extends It{compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}eq(t){return!1}destroy(t){}}Lo.prototype.elementClass="",Lo.prototype.toDOM=void 0,Lo.prototype.mapMode=M.TrackBefore,Lo.prototype.startSide=Lo.prototype.endSide=-1,Lo.prototype.point=!0;const Ro=F.define(),No=F.define(),Bo=F.define(),zo=F.define({combine:t=>t.some((t=>t))});const $o=nn.fromClass(class{constructor(t){this.view=t,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(Bo).map((e=>new Wo(t,e)));for(let t of this.gutters)this.dom.appendChild(t.dom);this.fixed=!t.state.facet(zo),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}update(t){if(this.updateGutters(t)){let e=this.prevViewport,i=t.view.viewport,n=Math.min(e.to,i.to)-Math.max(e.from,i.from);this.syncGutters(n<.8*(i.to-i.from))}t.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px"),this.view.state.facet(zo)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&this.dom.remove();let i=Lt.iter(this.view.state.facet(Ro),this.view.viewport.from),n=[],r=this.gutters.map((t=>new Ho(t,this.view.viewport,-this.view.documentPadding.top)));for(let t of this.view.viewportLineBlocks)if(n.length&&(n=[]),Array.isArray(t.type)){let e=!0;for(let o of t.type)if(o.type==oi.Text&&e){Vo(i,n,o.from);for(let t of r)t.line(this.view,o,n);e=!1}else if(o.widget)for(let t of r)t.widget(this.view,o)}else if(t.type==oi.Text){Vo(i,n,t.from);for(let e of r)e.line(this.view,t,n)}else if(t.widget)for(let e of r)e.widget(this.view,t);for(let t of r)t.finish();t&&this.view.scrollDOM.insertBefore(this.dom,e)}updateGutters(t){let e=t.startState.facet(Bo),i=t.state.facet(Bo),n=t.docChanged||t.heightChanged||t.viewportChanged||!Lt.eq(t.startState.facet(Ro),t.state.facet(Ro),t.view.viewport.from,t.view.viewport.to);if(e==i)for(let e of this.gutters)e.update(t)&&(n=!0);else{n=!0;let r=[];for(let n of i){let i=e.indexOf(n);i<0?r.push(new Wo(this.view,n)):(this.gutters[i].update(t),r.push(this.gutters[i]))}for(let t of this.gutters)t.dom.remove(),r.indexOf(t)<0&&t.destroy();for(let t of r)this.dom.appendChild(t.dom);this.gutters=r}return n}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove()}},{provide:t=>io.scrollMargins.of((e=>{let i=e.plugin(t);return i&&0!=i.gutters.length&&i.fixed?e.textDirection==yi.LTR?{left:i.dom.offsetWidth*e.scaleX}:{right:i.dom.offsetWidth*e.scaleX}:null}))});function Fo(t){return Array.isArray(t)?t:[t]}function Vo(t,e,i){for(;t.value&&t.from<=i;)t.from==i&&e.push(t.value),t.next()}class Ho{constructor(t,e,i){this.gutter=t,this.height=i,this.i=0,this.cursor=Lt.iter(t.markers,e.from)}addElement(t,e,i){let{gutter:n}=this,r=(e.top-this.height)/t.scaleY,o=e.height/t.scaleY;if(this.i==n.elements.length){let e=new Uo(t,o,r,i);n.elements.push(e),n.dom.appendChild(e.dom)}else n.elements[this.i].update(t,o,r,i);this.height=e.bottom,this.i++}line(t,e,i){let n=[];Vo(this.cursor,n,e.from),i.length&&(n=n.concat(i));let r=this.gutter.config.lineMarker(t,e,n);r&&n.unshift(r);let o=this.gutter;(0!=n.length||o.config.renderEmptyElements)&&this.addElement(t,e,n)}widget(t,e){let i=this.gutter.config.widgetMarker(t,e.widget,e),n=i?[i]:null;for(let i of t.state.facet(No)){let r=i(t,e.widget,e);r&&(n||(n=[])).push(r)}n&&this.addElement(t,e,n)}finish(){let t=this.gutter;for(;t.elements.length>this.i;){let e=t.elements.pop();t.dom.removeChild(e.dom),e.destroy()}}}class Wo{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 i in e.domEventHandlers)this.dom.addEventListener(i,(n=>{let r,o=n.target;if(o!=this.dom&&this.dom.contains(o)){for(;o.parentNode!=this.dom;)o=o.parentNode;let t=o.getBoundingClientRect();r=(t.top+t.bottom)/2}else r=n.clientY;let s=t.lineBlockAtHeight(r-t.documentTop);e.domEventHandlers[i](t,s,n)&&n.preventDefault()}));this.markers=Fo(e.markers(t)),e.initialSpacer&&(this.spacer=new Uo(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=Fo(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])}let i=t.view.viewport;return!Lt.eq(this.markers,e,i.from,i.to)||!!this.config.lineMarkerChange&&this.config.lineMarkerChange(t)}destroy(){for(let t of this.elements)t.destroy()}}class Uo{constructor(t,e,i,n){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(t,e,i,n)}update(t,e,i,n){this.height!=e&&(this.height=e,this.dom.style.height=e+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),function(t,e){if(t.length!=e.length)return!1;for(let i=0;iTt(t,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(t,e){let i=Object.assign({},t);for(let t in e){let n=i[t],r=e[t];i[t]=n?(t,e,i)=>n(t,e,i)||r(t,e,i):r}return i}})});class Yo extends Lo{constructor(t){super(),this.number=t}eq(t){return this.number==t.number}toDOM(){return document.createTextNode(this.number)}}function Xo(t,e){return t.state.facet(qo).formatNumber(e,t.state)}const Ko=Bo.compute([qo],(t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers:t=>t.state.facet(jo),lineMarker:(t,e,i)=>i.some((t=>t.toDOM))?null:new Yo(Xo(t,t.state.doc.lineAt(e.from).number)),widgetMarker:(t,e,i)=>{for(let n of t.state.facet(Go)){let r=n(t,e,i);if(r)return r}return null},lineMarkerChange:t=>t.startState.facet(qo)!=t.state.facet(qo),initialSpacer:t=>new Yo(Xo(t,Jo(t.state.doc.lines))),updateSpacer(t,e){let i=Xo(e.view,Jo(e.view.state.doc.lines));return i==t.number?t:new Yo(i)},domEventHandlers:t.facet(qo).domEventHandlers})));function Zo(t={}){return[qo.of(t),[$o],Ko]}function Jo(t){let e=9;for(;e{let e=[],i=-1;for(let n of t.selection.ranges){let r=t.doc.lineAt(n.head).from;r>i&&(i=r,e.push(Qo.range(r)))}return Lt.of(e)}));const es=1024;let is=0;class ns{constructor(t,e){this.from=t,this.to=e}}class rs{constructor(t={}){this.id=is++,this.perNode=!!t.perNode,this.deserialize=t.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(t){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return"function"!=typeof t&&(t=as.match(t)),e=>{let i=t(e);return void 0===i?null:[this,i]}}}rs.closedBy=new rs({deserialize:t=>t.split(" ")}),rs.openedBy=new rs({deserialize:t=>t.split(" ")}),rs.group=new rs({deserialize:t=>t.split(" ")}),rs.isolate=new rs({deserialize:t=>{if(t&&"rtl"!=t&&"ltr"!=t&&"auto"!=t)throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}}),rs.contextHash=new rs({perNode:!0}),rs.lookAhead=new rs({perNode:!0}),rs.mounted=new rs({perNode:!0});class os{constructor(t,e,i){this.tree=t,this.overlay=e,this.parser=i}static get(t){return t&&t.props&&t.props[rs.mounted.id]}}const ss=Object.create(null);class as{constructor(t,e,i,n=0){this.name=t,this.props=e,this.id=i,this.flags=n}static define(t){let e=t.props&&t.props.length?Object.create(null):ss,i=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(null==t.name?8:0),n=new as(t.name||"",e,t.id,i);if(t.props)for(let i of t.props)if(Array.isArray(i)||(i=i(n)),i){if(i[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");e[i[0].id]=i[1]}return n}prop(t){return this.props[t.id]}get isTop(){return(1&this.flags)>0}get isSkipped(){return(2&this.flags)>0}get isError(){return(4&this.flags)>0}get isAnonymous(){return(8&this.flags)>0}is(t){if("string"==typeof t){if(this.name==t)return!0;let e=this.prop(rs.group);return!!e&&e.indexOf(t)>-1}return this.id==t}static match(t){let e=Object.create(null);for(let i in t)for(let n of i.split(" "))e[n]=t[i];return t=>{for(let i=t.prop(rs.group),n=-1;n<(i?i.length:0);n++){let r=e[n<0?t.name:i[n]];if(r)return r}}}}as.none=new as("",Object.create(null),0,8);const ls=new WeakMap,hs=new WeakMap;var cs;!function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays"}(cs||(cs={}));class us{constructor(t,e,i,n,r){if(this.type=t,this.children=e,this.positions=i,this.length=n,this.props=null,r&&r.length){this.props=Object.create(null);for(let[t,e]of r)this.props["number"==typeof t?t:t.id]=e}}toString(){let t=os.get(this);if(t&&!t.overlay)return t.tree.toString();let e="";for(let t of this.children){let i=t.toString();i&&(e&&(e+=","),e+=i)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(e.length?"("+e+")":""):e}cursor(t=0){return new Ss(this.topNode,t)}cursorAt(t,e=0,i=0){let n=ls.get(this)||this.topNode,r=new Ss(n);return r.moveTo(t,e),ls.set(this,r._tree),r}get topNode(){return new vs(this,0,0,null)}resolve(t,e=0){let i=gs(ls.get(this)||this.topNode,t,e,!1);return ls.set(this,i),i}resolveInner(t,e=0){let i=gs(hs.get(this)||this.topNode,t,e,!0);return hs.set(this,i),i}resolveStack(t,e=0){return function(t,e,i){let n=t.resolveInner(e,i),r=null;for(let t=n instanceof vs?n:n.context.parent;t;t=t.parent)if(t.index<0){let o=t.parent;(r||(r=[n])).push(o.resolve(e,i)),t=o}else{let o=os.get(t.tree);if(o&&o.overlay&&o.overlay[0].from<=e&&o.overlay[o.overlay.length-1].to>=e){let s=new vs(o.tree,o.overlay[0].from+t.from,-1,t);(r||(r=[n])).push(gs(s,e,i,!1))}}return r?_s(r):n}(this,t,e)}iterate(t){let{enter:e,leave:i,from:n=0,to:r=this.length}=t,o=t.mode||0,s=(o&cs.IncludeAnonymous)>0;for(let t=this.cursor(o|cs.IncludeAnonymous);;){let o=!1;if(t.from<=r&&t.to>=n&&(!s&&t.type.isAnonymous||!1!==e(t))){if(t.firstChild())continue;o=!0}for(;o&&i&&(s||!t.type.isAnonymous)&&i(t),!t.nextSibling();){if(!t.parent())return;o=!0}}}prop(t){return t.perNode?this.props?this.props[t.id]:void 0:this.type.prop(t)}get propValues(){let t=[];if(this.props)for(let e in this.props)t.push([+e,this.props[e]]);return t}balance(t={}){return this.children.length<=8?this:Ds(as.none,this.children,this.positions,0,this.children.length,0,this.length,((t,e,i)=>new us(this.type,t,e,i,this.propValues)),t.makeTree||((t,e,i)=>new us(as.none,t,e,i)))}static build(t){return function(t){var e;let{buffer:i,nodeSet:n,maxBufferLength:r=es,reused:o=[],minRepeatType:s=n.types.length}=t,a=Array.isArray(i)?new ds(i,i.length):i,l=n.types,h=0,c=0;function u(t,e,i,y,b,w){let{id:x,start:_,end:k,size:S}=a,A=c,C=h;for(;S<0;){if(a.next(),-1==S){let e=o[x];return i.push(e),void y.push(_-t)}if(-3==S)return void(h=x);if(-4==S)return void(c=x);throw new RangeError(`Unrecognized record size: ${S}`)}let M,D,T=l[x],I=_-t;if(k-_<=r&&(D=m(a.pos-e,b))){let e=new Uint16Array(D.size-D.skip),i=a.pos-D.size,r=e.length;for(;a.pos>i;)r=v(D.start,e,r);M=new ps(e,k-D.start,n),I=D.start-t}else{let t=a.pos-S;a.next();let e=[],i=[],n=x>=s?x:-1,o=0,l=k;for(;a.pos>t;)n>=0&&a.id==n&&a.size>=0?(a.end<=l-r&&(f(e,i,_,o,a.end,l,n,A,C),o=e.length,l=a.end),a.next()):w>2500?d(_,t,e,i):u(_,t,e,i,n,w+1);if(n>=0&&o>0&&o-1&&o>0){let t=p(T,C);M=Ds(T,e,i,0,e.length,0,k-_,t,t)}else M=g(T,e,i,k-_,A-k,C)}i.push(M),y.push(I)}function d(t,e,i,o){let s=[],l=0,h=-1;for(;a.pos>e;){let{id:t,start:e,end:i,size:n}=a;if(n>4)a.next();else{if(h>-1&&e=0;t-=3)e[i++]=s[t],e[i++]=s[t+1]-r,e[i++]=s[t+2]-r,e[i++]=i;i.push(new ps(e,s[2]-r,n)),o.push(r-t)}}function p(t,e){return(i,n,r)=>{let o,s,a=0,l=i.length-1;if(l>=0&&(o=i[l])instanceof us){if(!l&&o.type==t&&o.length==r)return o;(s=o.prop(rs.lookAhead))&&(a=n[l]+o.length+s)}return g(t,i,n,r,a,e)}}function f(t,e,i,r,o,s,a,l,h){let c=[],u=[];for(;t.length>r;)c.push(t.pop()),u.push(e.pop()+i-o);t.push(g(n.types[a],c,u,s-o,l-s,h)),e.push(o-i)}function g(t,e,i,n,r,o,s){if(o){let t=[rs.contextHash,o];s=s?[t].concat(s):[t]}if(r>25){let t=[rs.lookAhead,r];s=s?[t].concat(s):[t]}return new us(t,e,i,n,s)}function m(t,e){let i=a.fork(),n=0,o=0,l=0,h=i.end-r,c={size:0,start:0,skip:0};t:for(let r=i.pos-t;i.pos>r;){let t=i.size;if(i.id==e&&t>=0){c.size=n,c.start=o,c.skip=l,l+=4,n+=4,i.next();continue}let a=i.pos-t;if(t<0||a=s?4:0,d=i.start;for(i.next();i.pos>a;){if(i.size<0){if(-3!=i.size)break t;u+=4}else i.id>=s&&(u+=4);i.next()}o=d,n+=t,l+=u}return(e<0||n==t)&&(c.size=n,c.start=o,c.skip=l),c.size>4?c:void 0}function v(t,e,i){let{id:n,start:r,end:o,size:l}=a;if(a.next(),l>=0&&n4){let n=a.pos-(l-4);for(;a.pos>n;)i=v(t,e,i)}e[--i]=s,e[--i]=o-t,e[--i]=r-t,e[--i]=n}else-3==l?h=n:-4==l&&(c=n);return i}let y=[],b=[];for(;a.pos>0;)u(t.start||0,t.bufferStart||0,y,b,-1,0);let w=null!==(e=t.length)&&void 0!==e?e:y.length?b[0]+y[0].length:0;return new us(l[t.topID],y.reverse(),b.reverse(),w)}(t)}}us.empty=new us(as.none,[],[],0);class ds{constructor(t,e){this.buffer=t,this.index=e}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new ds(this.buffer,this.index)}}class ps{constructor(t,e,i){this.buffer=t,this.length=e,this.set=i}get type(){return as.none}toString(){let t=[];for(let e=0;e0));a=o[a+3]);return s}slice(t,e,i){let n=this.buffer,r=new Uint16Array(e-t),o=0;for(let s=t,a=0;s=e&&ie;case 1:return i<=e&&n>e;case 2:return n>e;case 4:return!0}}function gs(t,e,i,n){for(var r;t.from==t.to||(i<1?t.from>=e:t.from>e)||(i>-1?t.to<=e:t.to0?s.length:-1;t!=l;t+=e){let l=s[t],h=a[t]+o.from;if(fs(n,i,h,h+l.length))if(l instanceof ps){if(r&cs.ExcludeBuffers)continue;let s=l.findChild(0,l.buffer.length,e,i-h,n);if(s>-1)return new xs(new ws(o,l,t,h),null,s)}else if(r&cs.IncludeAnonymous||!l.type.isAnonymous||As(l)){let s;if(!(r&cs.IgnoreMounts)&&(s=os.get(l))&&!s.overlay)return new vs(s.tree,h,t,o);let a=new vs(l,h,t,o);return r&cs.IncludeAnonymous||!a.type.isAnonymous?a:a.nextChild(e<0?l.children.length-1:0,e,i,n)}}if(r&cs.IncludeAnonymous||!o.type.isAnonymous)return null;if(t=o.index>=0?o.index+e:e<0?-1:o._parent._tree.children.length,o=o._parent,!o)return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(t){return this.nextChild(0,1,t,2)}childBefore(t){return this.nextChild(this._tree.children.length-1,-1,t,-2)}enter(t,e,i=0){let n;if(!(i&cs.IgnoreOverlays)&&(n=os.get(this._tree))&&n.overlay){let i=t-this.from;for(let{from:t,to:r}of n.overlay)if((e>0?t<=i:t=i:r>i))return new vs(n.tree,n.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,e,i)}nextSignificantParent(){let t=this;for(;t.type.isAnonymous&&t._parent;)t=t._parent;return t}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function ys(t,e,i,n){let r=t.cursor(),o=[];if(!r.firstChild())return o;if(null!=i)for(let t=!1;!t;)if(t=r.type.is(i),!r.nextSibling())return o;for(;;){if(null!=n&&r.type.is(n))return o;if(r.type.is(e)&&o.push(r.node),!r.nextSibling())return null==n?o:[]}}function bs(t,e,i=e.length-1){for(let n=t;i>=0;n=n.parent){if(!n)return!1;if(!n.type.isAnonymous){if(e[i]&&e[i]!=n.name)return!1;i--}}return!0}class ws{constructor(t,e,i,n){this.parent=t,this.buffer=e,this.index=i,this.start=n}}class xs extends ms{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(t,e,i){super(),this.context=t,this._parent=e,this.index=i,this.type=t.buffer.set.types[t.buffer.buffer[i]]}child(t,e,i){let{buffer:n}=this.context,r=n.findChild(this.index+4,n.buffer[this.index+3],t,e-this.context.start,i);return r<0?null:new xs(this.context,this,r)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(t){return this.child(1,t,2)}childBefore(t){return this.child(-1,t,-2)}enter(t,e,i=0){if(i&cs.ExcludeBuffers)return null;let{buffer:n}=this.context,r=n.findChild(this.index+4,n.buffer[this.index+3],e>0?1:-1,t-this.context.start,e);return r<0?null:new xs(this.context,this,r)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(t){return this._parent?null:this.context.parent.nextChild(this.context.index+t,t,0,4)}get nextSibling(){let{buffer:t}=this.context,e=t.buffer[this.index+3];return e<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new xs(this.context,this._parent,e):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,e=this._parent?this._parent.index+4:0;return this.index==e?this.externalSibling(-1):new xs(this.context,this._parent,t.findChild(e,this.index,-1,0,4))}get tree(){return null}toTree(){let t=[],e=[],{buffer:i}=this.context,n=this.index+4,r=i.buffer[this.index+3];if(r>n){let o=i.buffer[this.index+1];t.push(i.slice(n,r,o)),e.push(0)}return new us(this.type,t,e,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function _s(t){if(!t.length)return null;let e=0,i=t[0];for(let n=1;ni.from||r.to0){if(this.index-1)for(let n=e+t,r=t<0?-1:i._tree.children.length;n!=r;n+=t){let t=i._tree.children[n];if(this.mode&cs.IncludeAnonymous||t instanceof ps||!t.type.isAnonymous||As(t))return!1}return!0}move(t,e){if(e&&this.enterChild(t,0,4))return!0;for(;;){if(this.sibling(t))return!0;if(this.atLastNode(t)||!this.parent())return!1}}next(t=!0){return this.move(1,t)}prev(t=!0){return this.move(-1,t)}moveTo(t,e=0){for(;(this.from==this.to||(e<1?this.from>=t:this.from>t)||(e>-1?this.to<=t:this.to=0;){for(let o=t;o;o=o._parent)if(o.index==n){if(n==this.index)return o;e=o,i=r+1;break t}n=this.stack[--r]}for(let t=i;t=0;r--){if(r<0)return bs(this._tree,t,n);let o=i[e.buffer[this.stack[r]]];if(!o.isAnonymous){if(t[n]&&t[n]!=o.name)return!1;n--}}return!0}}function As(t){return t.children.some((t=>t instanceof ps||!t.type.isAnonymous||As(t)))}const Cs=new WeakMap;function Ms(t,e){if(!t.isAnonymous||e instanceof ps||e.type!=t)return 1;let i=Cs.get(e);if(null==i){i=1;for(let n of e.children){if(n.type!=t||!(n instanceof us)){i=1;break}i+=Ms(t,n)}Cs.set(e,i)}return i}function Ds(t,e,i,n,r,o,s,a,l){let h=0;for(let i=n;i=c)break;f+=e}if(h==r+1){if(f>c){let t=i[r];e(t.children,t.positions,0,t.children.length,n[r]+a);continue}u.push(i[r])}else{let e=n[h-1]+i[h-1].length-p;u.push(Ds(t,i,n,r,h,p,e,null,l))}d.push(p+a-o)}}(e,i,n,r,0),(a||l)(u,d,s)}class Ts{constructor(t,e,i,n,r=!1,o=!1){this.from=t,this.to=e,this.tree=i,this.offset=n,this.open=(r?1:0)|(o?2:0)}get openStart(){return(1&this.open)>0}get openEnd(){return(2&this.open)>0}static addTree(t,e=[],i=!1){let n=[new Ts(0,t.length,t,0,!1,i)];for(let i of e)i.to>t.length&&n.push(i);return n}static applyChanges(t,e,i=128){if(!e.length)return t;let n=[],r=1,o=t.length?t[0]:null;for(let s=0,a=0,l=0;;s++){let h=s=i)for(;o&&o.from=e.from||c<=e.to||l){let t=Math.max(e.from,a)-l,i=Math.min(e.to,c)-l;e=t>=i?null:new Ts(t,i,e.tree,e.offset+l,s>0,!!h)}if(e&&n.push(e),o.to>c)break;o=rnew ns(t.from,t.to))):[new ns(0,0)]:[new ns(0,t.length)],this.createParse(t,e||[],i)}parse(t,e,i){let n=this.startParse(t,e,i);for(;;){let t=n.advance();if(t)return t}}}class Os{constructor(t){this.string=t}get length(){return this.string.length}chunk(t){return this.string.slice(t)}get lineChunks(){return!1}read(t,e){return this.string.slice(t,e)}}new rs({perNode:!0});let Es=0;class Ps{constructor(t,e,i,n){this.name=t,this.set=e,this.base=i,this.modified=n,this.id=Es++}toString(){let{name:t}=this;for(let e of this.modified)e.name&&(t=`${e.name}(${t})`);return t}static define(t,e){let i="string"==typeof t?t:"?";if(t instanceof Ps&&(e=t),null==e?void 0:e.base)throw new Error("Can not derive from a modified tag");let n=new Ps(i,[],null,[]);if(n.set.push(n),e)for(let t of e.set)n.set.push(t);return n}static defineModifier(t){let e=new Rs(t);return t=>t.modified.indexOf(e)>-1?t:Rs.get(t.base||t,t.modified.concat(e).sort(((t,e)=>t.id-e.id)))}}let Ls=0;class Rs{constructor(t){this.name=t,this.instances=[],this.id=Ls++}static get(t,e){if(!e.length)return t;let i=e[0].instances.find((i=>i.base==t&&function(t,e){return t.length==e.length&&t.every(((t,i)=>t==e[i]))}(e,i.modified)));if(i)return i;let n=[],r=new Ps(t.name,n,t,e);for(let t of e)t.instances.push(r);let o=function(t){let e=[[]];for(let i=0;ie.length-t.length))}(e);for(let e of t.set)if(!e.modified.length)for(let t of o)n.push(Rs.get(e,t));return r}}function Ns(t){let e=Object.create(null);for(let i in t){let n=t[i];Array.isArray(n)||(n=[n]);for(let t of i.split(" "))if(t){let i=[],r=2,o=t;for(let e=0;;){if("..."==o&&e>0&&e+3==t.length){r=1;break}let n=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(o);if(!n)throw new RangeError("Invalid path: "+t);if(i.push("*"==n[0]?"":'"'==n[0][0]?JSON.parse(n[0]):n[0]),e+=n[0].length,e==t.length)break;let s=t[e++];if(e==t.length&&"!"==s){r=0;break}if("/"!=s)throw new RangeError("Invalid path: "+t);o=t.slice(e)}let s=i.length-1,a=i[s];if(!a)throw new RangeError("Invalid path: "+t);let l=new zs(n,r,s>0?i.slice(0,s):null);e[a]=l.sort(e[a])}}return Bs.add(e)}const Bs=new rs;class zs{constructor(t,e,i,n){this.tags=t,this.mode=e,this.context=i,this.next=n}get opaque(){return 0==this.mode}get inherit(){return 1==this.mode}sort(t){return!t||t.depth{let e=r;for(let n of t)for(let t of n.set){let n=i[t.id];if(n){e=e?e+" "+n:n;break}}return e},scope:n}}function Fs(t,e,i,n=0,r=t.length){let o=new Vs(n,Array.isArray(e)?e:[e],i);o.highlightRange(t.cursor(),n,r,"",o.highlighters),o.flush(r)}zs.empty=new zs([],2,null);class Vs{constructor(t,e,i){this.at=t,this.highlighters=e,this.span=i,this.class=""}startSpan(t,e){e!=this.class&&(this.flush(t),t>this.at&&(this.at=t),this.class=e)}flush(t){t>this.at&&this.class&&this.span(this.at,t,this.class)}highlightRange(t,e,i,n,r){let{type:o,from:s,to:a}=t;if(s>=i||a<=e)return;o.isTop&&(r=this.highlighters.filter((t=>!t.scope||t.scope(o))));let l=n,h=function(t){let e=t.type.prop(Bs);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}(t)||zs.empty,c=function(t,e){let i=null;for(let n of t){let t=n.style(e);t&&(i=i?i+" "+t:t)}return i}(r,h.tags);if(c&&(l&&(l+=" "),l+=c,1==h.mode&&(n+=(n?" ":"")+c)),this.startSpan(Math.max(e,s),l),h.opaque)return;let u=t.tree&&t.tree.prop(rs.mounted);if(u&&u.overlay){let o=t.node.enter(u.overlay[0].from+s,1),h=this.highlighters.filter((t=>!t.scope||t.scope(u.tree.type))),c=t.firstChild();for(let d=0,p=s;;d++){let f=d=g)&&t.nextSibling()););if(!f||g>i)break;p=f.to+s,p>e&&(this.highlightRange(o.cursor(),Math.max(e,f.from+s),Math.min(i,p),"",h),this.startSpan(Math.min(i,p),l))}c&&t.parent()}else if(t.firstChild()){u&&(n="");do{if(!(t.to<=e)){if(t.from>=i)break;this.highlightRange(t,e,i,n,r),this.startSpan(Math.min(i,t.to),l)}}while(t.nextSibling());t.parent()}}}const Hs=Ps.define,Ws=Hs(),Us=Hs(),js=Hs(Us),Gs=Hs(Us),qs=Hs(),Ys=Hs(qs),Xs=Hs(qs),Ks=Hs(),Zs=Hs(Ks),Js=Hs(),Qs=Hs(),ta=Hs(),ea=Hs(ta),ia=Hs(),na={comment:Ws,lineComment:Hs(Ws),blockComment:Hs(Ws),docComment:Hs(Ws),name:Us,variableName:Hs(Us),typeName:js,tagName:Hs(js),propertyName:Gs,attributeName:Hs(Gs),className:Hs(Us),labelName:Hs(Us),namespace:Hs(Us),macroName:Hs(Us),literal:qs,string:Ys,docString:Hs(Ys),character:Hs(Ys),attributeValue:Hs(Ys),number:Xs,integer:Hs(Xs),float:Hs(Xs),bool:Hs(qs),regexp:Hs(qs),escape:Hs(qs),color:Hs(qs),url:Hs(qs),keyword:Js,self:Hs(Js),null:Hs(Js),atom:Hs(Js),unit:Hs(Js),modifier:Hs(Js),operatorKeyword:Hs(Js),controlKeyword:Hs(Js),definitionKeyword:Hs(Js),moduleKeyword:Hs(Js),operator:Qs,derefOperator:Hs(Qs),arithmeticOperator:Hs(Qs),logicOperator:Hs(Qs),bitwiseOperator:Hs(Qs),compareOperator:Hs(Qs),updateOperator:Hs(Qs),definitionOperator:Hs(Qs),typeOperator:Hs(Qs),controlOperator:Hs(Qs),punctuation:ta,separator:Hs(ta),bracket:ea,angleBracket:Hs(ea),squareBracket:Hs(ea),paren:Hs(ea),brace:Hs(ea),content:Ks,heading:Zs,heading1:Hs(Zs),heading2:Hs(Zs),heading3:Hs(Zs),heading4:Hs(Zs),heading5:Hs(Zs),heading6:Hs(Zs),contentSeparator:Hs(Ks),list:Hs(Ks),quote:Hs(Ks),emphasis:Hs(Ks),strong:Hs(Ks),link:Hs(Ks),monospace:Hs(Ks),strikethrough:Hs(Ks),inserted:Hs(),deleted:Hs(),changed:Hs(),invalid:Hs(),meta:ia,documentMeta:Hs(ia),annotation:Hs(ia),processingInstruction:Hs(ia),definition:Ps.defineModifier("definition"),constant:Ps.defineModifier("constant"),function:Ps.defineModifier("function"),standard:Ps.defineModifier("standard"),local:Ps.defineModifier("local"),special:Ps.defineModifier("special")};for(let t in na){let e=na[t];e instanceof Ps&&(e.name=t)}var ra;$s([{tag:na.link,class:"tok-link"},{tag:na.heading,class:"tok-heading"},{tag:na.emphasis,class:"tok-emphasis"},{tag:na.strong,class:"tok-strong"},{tag:na.keyword,class:"tok-keyword"},{tag:na.atom,class:"tok-atom"},{tag:na.bool,class:"tok-bool"},{tag:na.url,class:"tok-url"},{tag:na.labelName,class:"tok-labelName"},{tag:na.inserted,class:"tok-inserted"},{tag:na.deleted,class:"tok-deleted"},{tag:na.literal,class:"tok-literal"},{tag:na.string,class:"tok-string"},{tag:na.number,class:"tok-number"},{tag:[na.regexp,na.escape,na.special(na.string)],class:"tok-string2"},{tag:na.variableName,class:"tok-variableName"},{tag:na.local(na.variableName),class:"tok-variableName tok-local"},{tag:na.definition(na.variableName),class:"tok-variableName tok-definition"},{tag:na.special(na.variableName),class:"tok-variableName2"},{tag:na.definition(na.propertyName),class:"tok-propertyName tok-definition"},{tag:na.typeName,class:"tok-typeName"},{tag:na.namespace,class:"tok-namespace"},{tag:na.className,class:"tok-className"},{tag:na.macroName,class:"tok-macroName"},{tag:na.propertyName,class:"tok-propertyName"},{tag:na.operator,class:"tok-operator"},{tag:na.comment,class:"tok-comment"},{tag:na.meta,class:"tok-meta"},{tag:na.invalid,class:"tok-invalid"},{tag:na.punctuation,class:"tok-punctuation"}]);const oa=new rs,sa=new rs;class aa{constructor(t,e,i=[],n=""){this.data=t,this.name=n,Dt.prototype.hasOwnProperty("tree")||Object.defineProperty(Dt.prototype,"tree",{get(){return ha(this)}}),this.parser=e,this.extension=[ya.of(this),Dt.languageData.of(((t,e,i)=>{let n=la(t,e,i),r=n.type.prop(oa);if(!r)return[];let o=t.facet(r),s=n.type.prop(sa);if(s){let r=n.resolve(e-n.from,i);for(let e of s)if(e.test(r,t)){let i=t.facet(e.facet);return"replace"==e.type?i:i.concat(o)}}return o}))].concat(i)}isActiveAt(t,e,i=-1){return la(t,e,i).type.prop(oa)==this.data}findRegions(t){let e=t.facet(ya);if((null==e?void 0:e.data)==this.data)return[{from:0,to:t.doc.length}];if(!e||!e.allowsNesting)return[];let i=[],n=(t,e)=>{if(t.prop(oa)==this.data)return void i.push({from:e,to:e+t.length});let r=t.prop(rs.mounted);if(r){if(r.tree.prop(oa)==this.data){if(r.overlay)for(let t of r.overlay)i.push({from:t.from+e,to:t.to+e});else i.push({from:e,to:e+t.length});return}if(r.overlay){let t=i.length;if(n(r.tree,r.overlay[0].from+e),i.length>t)return}}for(let i=0;i=this.cursorPos?this.doc.sliceString(t,e):this.string.slice(t-i,e-i)}}let ua=null;class da{constructor(t,e,i=[],n,r,o,s,a){this.parser=t,this.state=e,this.fragments=i,this.tree=n,this.treeLen=r,this.viewport=o,this.skipped=s,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(t,e,i){return new da(t,e,[],us.empty,0,i,[],null)}startParse(){return this.parser.startParse(new ca(this.state.doc),this.fragments)}work(t,e){return null!=e&&e>=this.state.doc.length&&(e=void 0),this.tree!=us.empty&&this.isDone(null!=e?e:this.state.doc.length)?(this.takeTree(),!0):this.withContext((()=>{var i;if("number"==typeof t){let e=Date.now()+t;t=()=>Date.now()>e}for(this.parse||(this.parse=this.startParse()),null!=e&&(null==this.parse.stoppedAt||this.parse.stoppedAt>e)&&e=this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>t)&&this.parse.stopAt(t),this.withContext((()=>{for(;!(e=this.parse.advance()););})),this.treeLen=t,this.tree=e,this.fragments=this.withoutTempSkipped(Ts.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let e=ua;ua=this;try{return t()}finally{ua=e}}withoutTempSkipped(t){for(let e;e=this.tempSkipped.pop();)t=pa(t,e.from,e.to);return t}changes(t,e){let{fragments:i,tree:n,treeLen:r,viewport:o,skipped:s}=this;if(this.takeTree(),!t.empty){let e=[];if(t.iterChangedRanges(((t,i,n,r)=>e.push({fromA:t,toA:i,fromB:n,toB:r}))),i=Ts.applyChanges(i,e),n=us.empty,r=0,o={from:t.mapPos(o.from,-1),to:t.mapPos(o.to,1)},this.skipped.length){s=[];for(let e of this.skipped){let i=t.mapPos(e.from,1),n=t.mapPos(e.to,-1);it.from&&(this.fragments=pa(this.fragments,i,n),this.skipped.splice(e--,1))}return!(this.skipped.length>=e)&&(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(t,e){this.skipped.push({from:t,to:e})}static getSkippingParser(t){return new class extends Is{createParse(e,i,n){let r=n[0].from,o=n[n.length-1].to,s={parsedPos:r,advance(){let e=ua;if(e){for(let t of n)e.tempSkipped.push(t);t&&(e.scheduleOn=e.scheduleOn?Promise.all([e.scheduleOn,t]):t)}return this.parsedPos=o,new us(as.none,[],[],o-r)},stoppedAt:null,stopAt(){}};return s}}}isDone(t){t=Math.min(t,this.state.doc.length);let e=this.fragments;return this.treeLen>=t&&e.length&&0==e[0].from&&e[0].to>=t}static get(){return ua}}function pa(t,e,i){return Ts.applyChanges(t,[{fromA:e,toA:i,fromB:e,toB:i}])}class fa{constructor(t){this.context=t,this.tree=t.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let e=this.context.changes(t.changes,t.state),i=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),e.viewport.to);return e.work(20,i)||e.takeTree(),new fa(e)}static init(t){let e=Math.min(3e3,t.doc.length),i=da.create(t.facet(ya).parser,t,{from:0,to:e});return i.work(20,e)||i.takeTree(),new fa(i)}}aa.state=q.define({create:fa.init,update(t,e){for(let t of e.effects)if(t.is(aa.setState))return t.value;return e.startState.facet(ya)!=e.state.facet(ya)?fa.init(e.state):t.apply(e)}});let ga=t=>{let e=setTimeout((()=>t()),500);return()=>clearTimeout(e)};"undefined"!=typeof requestIdleCallback&&(ga=t=>{let e=-1,i=setTimeout((()=>{e=requestIdleCallback(t,{timeout:400})}),100);return()=>e<0?clearTimeout(i):cancelIdleCallback(e)});const ma="undefined"!=typeof navigator&&(null===(ra=navigator.scheduling)||void 0===ra?void 0:ra.isInputPending)?()=>navigator.scheduling.isInputPending():null,va=nn.fromClass(class{constructor(t){this.view=t,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(t){let e=this.view.state.field(aa.state).context;(e.updateViewport(t.view.viewport)||this.view.viewport.to>e.treeLen)&&this.scheduleWork(),(t.docChanged||t.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(e)}scheduleWork(){if(this.working)return;let{state:t}=this.view,e=t.field(aa.state);e.tree==e.context.tree&&e.context.isDone(t.doc.length)||(this.working=ga(this.work))}work(t){this.working=null;let e=Date.now();if(this.chunkEndn+1e3,a=r.context.work((()=>ma&&ma()||Date.now()>o),n+(s?0:1e5));this.chunkBudget-=Date.now()-e,(a||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:aa.setState.of(new fa(r.context))})),this.chunkBudget>0&&(!a||s)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(t){t.scheduleOn&&(this.workScheduled++,t.scheduleOn.then((()=>this.scheduleWork())).catch((t=>Ji(this.view.state,t))).then((()=>this.workScheduled--)),t.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),ya=F.define({combine:t=>t.length?t[0]:null,enables:t=>[aa.state,va,io.contentAttributes.compute([t],(e=>{let i=e.facet(t);return i&&i.name?{"data-language":i.name}:{}}))]}),ba=F.define(),wa=F.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some((t=>t!=e[0])))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function xa(t){let e=t.facet(wa);return 9==e.charCodeAt(0)?t.tabSize*e.length:e.length}function _a(t,e){let i="",n=t.tabSize,r=t.facet(wa)[0];if("\t"==r){for(;e>=n;)i+="\t",e-=n;r=" "}for(let t=0;t=e?function(t,e,i){let n=e.resolveStack(i),r=n.node.enterUnfinishedNodesBefore(i);if(r!=n.node){let t=[];for(let e=r;e!=n.node;e=e.parent)t.push(e);for(let e=t.length-1;e>=0;e--)n={node:t[e],next:n}}return Ca(n,t,i)}(t,i,e):null}class Sa{constructor(t,e={}){this.state=t,this.options=e,this.unit=xa(t)}lineAt(t,e=1){let i=this.state.doc.lineAt(t),{simulateBreak:n,simulateDoubleBreak:r}=this.options;return null!=n&&n>=i.from&&n<=i.to?r&&n==t?{text:"",from:t}:(e<0?n-1&&(r+=o-this.countColumn(i,i.search(/\S|$/))),r}countColumn(t,e=t.length){return Gt(t,this.state.tabSize,e)}lineIndent(t,e=1){let{text:i,from:n}=this.lineAt(t,e),r=this.options.overrideIndentation;if(r){let t=r(n);if(t>-1)return t}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Aa=new rs;function Ca(t,e,i){for(let n=t;n;n=n.next){let t=Ma(n.node);if(t)return t(Ta.create(e,i,n))}return 0}function Ma(t){let e=t.type.prop(Aa);if(e)return e;let i,n=t.firstChild;if(n&&(i=n.type.prop(rs.closedBy))){let e=t.lastChild,n=e&&i.indexOf(e.name)>-1;return t=>function(t,e,i,n,r){let o=t.textAfter.match(/^\s*/)[0].length,s=r==t.pos+o,a=function(t){let e=t.node,i=e.childAfter(e.from),n=e.lastChild;if(!i)return null;let r=t.options.simulateBreak,o=t.state.doc.lineAt(i.from),s=null==r||r<=o.from?o.to:Math.min(o.to,r);for(let t=i.to;;){let r=e.childAfter(t);if(!r||r==n)return null;if(!r.type.isSkipped){if(r.from>=s)return null;let t=/^ */.exec(o.text.slice(i.to-o.from))[0].length;return{from:i.from,to:i.to+t}}t=r.to}}(t);return a?s?t.column(a.from):t.column(a.to):t.baseIndent+(s?0:t.unit*i)}(t,0,1,0,n&&!function(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}(t)?e.from:void 0)}return null==t.parent?Da:null}function Da(){return 0}class Ta extends Sa{constructor(t,e,i){super(t.state,t.options),this.base=t,this.pos=e,this.context=i}get node(){return this.context.node}static create(t,e,i){return new Ta(t,e,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(t){let e=this.state.doc.lineAt(t.from);for(;;){let i=t.resolve(e.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(Ia(i,t))break;e=this.state.doc.lineAt(i.from)}return this.lineIndent(e.from)}continue(){return Ca(this.context.next,this.base,this.pos)}}function Ia(t,e){for(let i=e;i;i=i.parent)if(t==i)return!0;return!1}const Oa=F.define(),Ea=new rs;function Pa(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function La(t,e,i){for(let n of t.facet(Oa)){let r=n(t,e,i);if(r)return r}return function(t,e,i){let n=ha(t);if(n.lengthi)continue;if(r&&s.from=e&&n.to>i&&(r=n)}}return r}(t,e,i)}function Ra(t,e){let i=e.mapPos(t.from,1),n=e.mapPos(t.to,-1);return i>=n?void 0:{from:i,to:n}}const Na=mt.define({map:Ra}),Ba=mt.define({map:Ra});function za(t){let e=[];for(let{head:i}of t.state.selection.ranges)e.some((t=>t.from<=i&&t.to>=i))||e.push(t.lineBlockAt(i));return e}const $a=q.define({create:()=>si.none,update(t,e){t=t.map(e.changes);for(let i of e.effects)if(i.is(Na)&&!Va(t,i.value.from,i.value.to)){let{preparePlaceholder:n}=e.state.facet(Ga),r=n?si.replace({widget:new Xa(n(e.state,i.value))}):Ya;t=t.update({add:[r.range(i.value.from,i.value.to)]})}else i.is(Ba)&&(t=t.update({filter:(t,e)=>i.value.from!=t||i.value.to!=e,filterFrom:i.value.from,filterTo:i.value.to}));if(e.selection){let i=!1,{head:n}=e.selection.main;t.between(n,n,((t,e)=>{tn&&(i=!0)})),i&&(t=t.update({filterFrom:n,filterTo:n,filter:(t,e)=>e<=n||t>=n}))}return t},provide:t=>io.decorations.from(t),toJSON(t,e){let i=[];return t.between(0,e.doc.length,((t,e)=>{i.push(t,e)})),i},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let i=0;i{(!r||r.from>t)&&(r={from:t,to:e})})),r}function Va(t,e,i){let n=!1;return t.between(e,e,((t,r)=>{t==e&&r==i&&(n=!0)})),n}function Ha(t,e){return t.field($a,!1)?e:e.concat(mt.appendConfig.of([$a,Ka]))}function Wa(t,e,i=!0){let n=t.state.doc.lineAt(e.from).number,r=t.state.doc.lineAt(e.to).number;return io.announce.of(`${t.state.phrase(i?"Folded lines":"Unfolded lines")} ${n} ${t.state.phrase("to")} ${r}.`)}const Ua=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:t=>{for(let e of za(t)){let i=La(t.state,e.from,e.to);if(i)return t.dispatch({effects:Ha(t.state,[Na.of(i),Wa(t,i)])}),!0}return!1}},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:t=>{if(!t.state.field($a,!1))return!1;let e=[];for(let i of za(t)){let n=Fa(t.state,i.from,i.to);n&&e.push(Ba.of(n),Wa(t,n,!1))}return e.length&&t.dispatch({effects:e}),e.length>0}},{key:"Ctrl-Alt-[",run:t=>{let{state:e}=t,i=[];for(let n=0;n{let e=t.state.field($a,!1);if(!e||!e.size)return!1;let i=[];return e.between(0,t.state.doc.length,((t,e)=>{i.push(Ba.of({from:t,to:e}))})),t.dispatch({effects:i}),!0}}],ja={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},Ga=F.define({combine:t=>Tt(t,ja)});function qa(t,e){let{state:i}=t,n=i.facet(Ga),r=e=>{let i=t.lineBlockAt(t.posAtDOM(e.target)),n=Fa(t.state,i.from,i.to);n&&t.dispatch({effects:Ba.of(n)}),e.preventDefault()};if(n.placeholderDOM)return n.placeholderDOM(t,r,e);let o=document.createElement("span");return o.textContent=n.placeholderText,o.setAttribute("aria-label",i.phrase("folded code")),o.title=i.phrase("unfold"),o.className="cm-foldPlaceholder",o.onclick=r,o}const Ya=si.replace({widget:new class extends ri{toDOM(t){return qa(t,null)}}});class Xa extends ri{constructor(t){super(),this.value=t}eq(t){return this.value==t.value}toDOM(t){return qa(t,this.value)}}const Ka=io.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class Za{constructor(t,e){let i;function n(t){let e=Kt.newName();return(i||(i=Object.create(null)))["."+e]=t,e}this.specs=t;const r="string"==typeof e.all?e.all:e.all?n(e.all):void 0,o=e.scope;this.scope=o instanceof aa?t=>t.prop(oa)==o.data:o?t=>t==o:void 0,this.style=$s(t.map((t=>({tag:t.tag,class:t.class||n(Object.assign({},t,{tag:null}))}))),{all:r}).style,this.module=i?new Kt(i):null,this.themeType=e.themeType}static define(t,e){return new Za(t,e||{})}}const Ja=F.define(),Qa=F.define({combine:t=>t.length?[t[0]]:null});function tl(t){let e=t.facet(Ja);return e.length?e:t.facet(Qa)}function el(t,e){let i,n=[nl];return t instanceof Za&&(t.module&&n.push(io.styleModule.of(t.module)),i=t.themeType),(null==e?void 0:e.fallback)?n.push(Qa.of(t)):i?n.push(Ja.computeN([io.darkTheme],(e=>e.facet(io.darkTheme)==("dark"==i)?[t]:[]))):n.push(Ja.of(t)),n}class il{constructor(t){this.markCache=Object.create(null),this.tree=ha(t.state),this.decorations=this.buildDeco(t,tl(t.state)),this.decoratedTo=t.viewport.to}update(t){let e=ha(t.state),i=tl(t.state),n=i!=tl(t.startState),{viewport:r}=t.view,o=t.changes.mapPos(this.decoratedTo,1);e.length=r.to?(this.decorations=this.decorations.map(t.changes),this.decoratedTo=o):(e!=this.tree||t.viewportChanged||n)&&(this.tree=e,this.decorations=this.buildDeco(t.view,i),this.decoratedTo=r.to)}buildDeco(t,e){if(!e||!this.tree.length)return si.none;let i=new Rt;for(let{from:n,to:r}of t.visibleRanges)Fs(this.tree,e,((t,e,n)=>{i.add(t,e,this.markCache[n]||(this.markCache[n]=si.mark({class:n})))}),n,r);return i.finish()}}const nl=Q.high(nn.fromClass(il,{decorations:t=>t.decorations})),rl=Za.define([{tag:na.meta,color:"#404740"},{tag:na.link,textDecoration:"underline"},{tag:na.heading,textDecoration:"underline",fontWeight:"bold"},{tag:na.emphasis,fontStyle:"italic"},{tag:na.strong,fontWeight:"bold"},{tag:na.strikethrough,textDecoration:"line-through"},{tag:na.keyword,color:"#708"},{tag:[na.atom,na.bool,na.url,na.contentSeparator,na.labelName],color:"#219"},{tag:[na.literal,na.inserted],color:"#164"},{tag:[na.string,na.deleted],color:"#a11"},{tag:[na.regexp,na.escape,na.special(na.string)],color:"#e40"},{tag:na.definition(na.variableName),color:"#00f"},{tag:na.local(na.variableName),color:"#30a"},{tag:[na.typeName,na.namespace],color:"#085"},{tag:na.className,color:"#167"},{tag:[na.special(na.variableName),na.macroName],color:"#256"},{tag:na.definition(na.propertyName),color:"#00c"},{tag:na.comment,color:"#940"},{tag:na.invalid,color:"#f00"}]),ol=new rs;function sl(t,e,i){let n=t.prop(e<0?rs.openedBy:rs.closedBy);if(n)return n;if(1==t.name.length){let n=i.indexOf(t.name);if(n>-1&&n%2==(e<0?1:0))return[i[n+e]]}return null}function al(t){let e=t.type.prop(ol);return e?e(t.node):t}function ll(t,e,i,n={}){let r=n.maxScanDistance||1e4,o=n.brackets||"()[]{}",s=ha(t),a=s.resolveInner(e,i);for(let n=a;n;n=n.parent){let r=sl(n.type,i,o);if(r&&n.from0?e>=s.from&&es.from&&e<=s.to))return hl(t,e,i,n,s,r,o)}}return function(t,e,i,n,r,o,s){let a=i<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),l=s.indexOf(a);if(l<0||l%2==0!=i>0)return null;let h={from:i<0?e-1:e,to:i>0?e+1:e},c=t.doc.iterRange(e,i>0?t.doc.length:0),u=0;for(let t=0;!c.next().done&&t<=o;){let o=c.value;i<0&&(t+=o.length);let a=e+t*i;for(let t=i>0?0:o.length-1,e=i>0?o.length:-1;t!=e;t+=i){let e=s.indexOf(o[t]);if(!(e<0||n.resolveInner(a+t,1).type!=r))if(e%2==0==i>0)u++;else{if(1==u)return{start:h,end:{from:a+t,to:a+t+1},matched:e>>1==l>>1};u--}}i>0&&(t+=o.length)}return c.done?{start:h,matched:!1}:null}(t,e,i,s,a.type,r,o)}function hl(t,e,i,n,r,o,s){let a=n.parent,l={from:r.from,to:r.to},h=0,c=null==a?void 0:a.cursor();if(c&&(i<0?c.childBefore(n.from):c.childAfter(n.to)))do{if(i<0?c.to<=n.from:c.from>=n.to){if(0==h&&o.indexOf(c.type.name)>-1&&c.from-1||(dl.push(t),console.warn(e))}function ml(t,e){let i=[];for(let n of e.split(" ")){let e=[];for(let i of n.split(".")){let n=t[i]||na[i];n?"function"==typeof n?e.length?e=e.map(n):gl(i,`Modifier ${i} used at start of tag`):e.length?gl(i,`Tag ${i} used as modifier`):e=Array.isArray(n)?n:[n]:gl(i,`Unknown highlighting tag ${i}`)}for(let t of e)i.push(t)}if(!i.length)return 0;let n=e.replace(/ /g,"_"),r=n+" "+i.map((t=>t.id)),o=pl[r];if(o)return o.id;let s=pl[r]=as.define({id:ul.length,name:n,props:[Ns({[n]:i})]});return ul.push(s),s.id}yi.RTL,yi.LTR;class vl{constructor(t,e,i,n){this.state=t,this.pos=e,this.explicit=i,this.view=n,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(t){let e=ha(this.state).resolveInner(this.pos,-1);for(;e&&t.indexOf(e.name)<0;)e=e.parent;return e?{from:e.from,to:this.pos,text:this.state.sliceDoc(e.from,this.pos),type:e.type}:null}matchBefore(t){let e=this.state.doc.lineAt(this.pos),i=Math.max(e.from,this.pos-250),n=e.text.slice(i-e.from,this.pos-e.from),r=n.search(_l(t,!1));return r<0?null:{from:i+r,to:this.pos,text:n.slice(r)}}get aborted(){return null==this.abortListeners}addEventListener(t,e,i){"abort"==t&&this.abortListeners&&(this.abortListeners.push(e),i&&i.onDocChange&&(this.abortOnDocChange=!0))}}function yl(t){let e=Object.keys(t).join(""),i=/\w/.test(e);return i&&(e=e.replace(/\w/g,"")),`[${i?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function bl(t){let e=t.map((t=>"string"==typeof t?{label:t}:t)),[i,n]=e.every((t=>/^\w+$/.test(t.label)))?[/\w*$/,/\w+$/]:function(t){let e=Object.create(null),i=Object.create(null);for(let{label:n}of t){e[n[0]]=!0;for(let t=1;t{let r=t.matchBefore(n);return r||t.explicit?{from:r?r.from:t.pos,options:e,validFor:i}:null}}class wl{constructor(t,e,i,n){this.completion=t,this.source=e,this.match=i,this.score=n}}function xl(t){return t.selection.main.from}function _l(t,e){var i;let{source:n}=t,r=e&&"^"!=n[0],o="$"!=n[n.length-1];return r||o?new RegExp(`${r?"^":""}(?:${n})${o?"$":""}`,null!==(i=t.flags)&&void 0!==i?i:t.ignoreCase?"i":""):t}const kl=pt.define();const Sl=new WeakMap;function Al(t){if(!Array.isArray(t))return t;let e=Sl.get(t);return e||Sl.set(t,e=bl(t)),e}const Cl=mt.define(),Ml=mt.define();class Dl{constructor(t){this.pattern=t,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let e=0;e=48&&l<=57||l>=97&&l<=122?2:l>=65&&l<=90?1:0:(y=S(l))!=y.toLowerCase()?1:y!=y.toUpperCase()?2:0;(!n||1==b&&g||0==v&&0!=b)&&(e[c]==l||i[c]==l&&(u=!0)?o[c++]=n:o.length&&(m=!1)),v=b,n+=A(l)}return c==a&&0==o[0]&&m?this.result((u?-200:0)-100,o,t):d==a&&0==p?this.ret(-200-t.length+(f==t.length?0:-100),[0,f]):s>-1?this.ret(-700-t.length,[s,s+this.pattern.length]):d==a?this.ret(-900-t.length,[p,f]):c==a?this.result((u?-200:0)-100-700+(m?0:-1100),o,t):2==e.length?null:this.result((n[0]?-700:0)-200-1100,n,t)}result(t,e,i){let n=[],r=0;for(let t of e){let e=t+(this.astral?A(k(i,t)):1);r&&n[r-1]==t?n[r-1]=e:(n[r++]=t,n[r++]=e)}return this.ret(t-i.length,n)}}class Tl{constructor(t){this.pattern=t,this.matched=[],this.score=0,this.folded=t.toLowerCase()}match(t){if(t.lengthTt(t,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:El,filterStrict:!1,compareCompletions:(t,e)=>t.label.localeCompare(e.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(t,e)=>t&&e,closeOnBlur:(t,e)=>t&&e,icons:(t,e)=>t&&e,tooltipClass:(t,e)=>i=>Ol(t(i),e(i)),optionClass:(t,e)=>i=>Ol(t(i),e(i)),addToOptions:(t,e)=>t.concat(e),filterStrict:(t,e)=>t||e})});function Ol(t,e){return t?e?t+" "+e:t:e}function El(t,e,i,n,r,o){let s,a,l=t.textDirection==yi.RTL,h=l,c=!1,u="top",d=e.left-r.left,p=r.right-e.right,f=n.right-n.left,g=n.bottom-n.top;if(h&&d=g||t>e.top?s=i.bottom-e.top:(u="bottom",s=e.bottom-i.top)}return{style:`${u}: ${s/((e.bottom-e.top)/o.offsetHeight)}px; max-width: ${a/((e.right-e.left)/o.offsetWidth)}px`,class:"cm-completionInfo-"+(c?l?"left-narrow":"right-narrow":h?"left":"right")}}function Pl(t,e,i){if(t<=i)return{from:0,to:t};if(e<0&&(e=0),e<=t>>1){let t=Math.floor(e/i);return{from:t*i,to:(t+1)*i}}let n=Math.floor((t-e)/i);return{from:t-(n+1)*i,to:t-n*i}}class Ll{constructor(t,e,i){this.view=t,this.stateField=e,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:t=>this.placeInfo(t),key:this},this.space=null,this.currentClass="";let n=t.state.field(e),{options:r,selected:o}=n.open,s=t.state.facet(Il);this.optionContent=function(t){let e=t.addToOptions.slice();return t.icons&&e.push({render(t){let e=document.createElement("div");return e.classList.add("cm-completionIcon"),t.type&&e.classList.add(...t.type.split(/\s+/g).map((t=>"cm-completionIcon-"+t))),e.setAttribute("aria-hidden","true"),e},position:20}),e.push({render(t,e,i,n){let r=document.createElement("span");r.className="cm-completionLabel";let o=t.displayLabel||t.label,s=0;for(let t=0;ts&&r.appendChild(document.createTextNode(o.slice(s,e)));let a=r.appendChild(document.createElement("span"));a.appendChild(document.createTextNode(o.slice(e,i))),a.className="cm-completionMatchedText",s=i}return st.position-e.position)).map((t=>t.render))}(s),this.optionClass=s.optionClass,this.tooltipClass=s.tooltipClass,this.range=Pl(r.length,o,s.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(t.state),this.dom.addEventListener("mousedown",(i=>{let{options:n}=t.state.field(e).open;for(let e,r=i.target;r&&r!=this.dom;r=r.parentNode)if("LI"==r.nodeName&&(e=/-(\d+)$/.exec(r.id))&&+e[1]{let i=t.state.field(this.stateField,!1);i&&i.tooltip&&t.state.facet(Il).closeOnBlur&&e.relatedTarget!=t.contentDOM&&t.dispatch({effects:Ml.of(null)})})),this.showOptions(r,n.id)}mount(){this.updateSel()}showOptions(t,e){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t,e,this.range)),this.list.addEventListener("scroll",(()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)}))}update(t){var e;let i=t.state.field(this.stateField),n=t.startState.field(this.stateField);if(this.updateTooltipClass(t.state),i!=n){let{options:r,selected:o,disabled:s}=i.open;n.open&&n.open.options==r||(this.range=Pl(r.length,o,t.state.facet(Il).maxRenderedOptions),this.showOptions(r,i.id)),this.updateSel(),s!=(null===(e=n.open)||void 0===e?void 0:e.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!s)}}updateTooltipClass(t){let e=this.tooltipClass(t);if(e!=this.currentClass){for(let t of this.currentClass.split(" "))t&&this.dom.classList.remove(t);for(let t of e.split(" "))t&&this.dom.classList.add(t);this.currentClass=e}}positioned(t){this.space=t,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let t=this.view.state.field(this.stateField),e=t.open;if((e.selected>-1&&e.selected=this.range.to)&&(this.range=Pl(e.options.length,e.selected,this.view.state.facet(Il).maxRenderedOptions),this.showOptions(e.options,t.id)),this.updateSelectedOption(e.selected)){this.destroyInfo();let{completion:i}=e.options[e.selected],{info:n}=i;if(!n)return;let r="string"==typeof n?document.createTextNode(n):n(i);if(!r)return;"then"in r?r.then((e=>{e&&this.view.state.field(this.stateField,!1)==t&&this.addInfoPane(e,i)})).catch((t=>Ji(this.view.state,t,"completion info"))):this.addInfoPane(r,i)}}addInfoPane(t,e){this.destroyInfo();let i=this.info=document.createElement("div");if(i.className="cm-tooltip cm-completionInfo",null!=t.nodeType)i.appendChild(t),this.infoDestroy=null;else{let{dom:e,destroy:n}=t;i.appendChild(e),this.infoDestroy=n||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(t){let e=null;for(let i=this.list.firstChild,n=this.range.from;i;i=i.nextSibling,n++)"LI"==i.nodeName&&i.id?n==t?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),e=i):i.hasAttribute("aria-selected")&&i.removeAttribute("aria-selected"):n--;return e&&function(t,e){let i=t.getBoundingClientRect(),n=e.getBoundingClientRect(),r=i.height/t.offsetHeight;n.topi.bottom&&(t.scrollTop+=(n.bottom-i.bottom)/r)}(this.list,e),e}measureInfo(){let t=this.dom.querySelector("[aria-selected]");if(!t||!this.info)return null;let e=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),n=t.getBoundingClientRect(),r=this.space;if(!r){let t=this.dom.ownerDocument.defaultView||window;r={left:0,top:0,right:t.innerWidth,bottom:t.innerHeight}}return n.top>Math.min(r.bottom,e.bottom)-10||n.bottomi.from||0==i.from))if(r=t,"string"!=typeof l&&l.header)n.appendChild(l.header(l));else{n.appendChild(document.createElement("completion-section")).textContent=t}}const h=n.appendChild(document.createElement("li"));h.id=e+"-"+o,h.setAttribute("role","option");let c=this.optionClass(s);c&&(h.className=c);for(let t of this.optionContent){let e=t(s,this.view.state,this.view,a);e&&h.appendChild(e)}}return i.from&&n.classList.add("cm-completionListIncompleteTop"),i.tonew Ll(i,t,e)}function Nl(t){return 100*(t.boost||0)+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}class Bl{constructor(t,e,i,n,r,o){this.options=t,this.attrs=e,this.tooltip=i,this.timestamp=n,this.selected=r,this.disabled=o}setSelected(t,e){return t==this.selected||t>=this.options.length?this:new Bl(this.options,Vl(e,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,e,i,n,r,o){if(n&&!o&&t.some((t=>t.isPending)))return n.setDisabled();let s=function(t,e){let i=[],n=null,r=t=>{i.push(t);let{section:e}=t.completion;if(e){n||(n=[]);let t="string"==typeof e?e:e.name;n.some((e=>e.name==t))||n.push("string"==typeof e?{name:t}:e)}},o=e.facet(Il);for(let n of t)if(n.hasResult()){let t=n.result.getMatch;if(!1===n.result.filter)for(let e of n.result.options)r(new wl(e,n.source,t?t(e):[],1e9-i.length));else{let i,s=e.sliceDoc(n.from,n.to),a=o.filterStrict?new Tl(s):new Dl(s);for(let e of n.result.options)if(i=a.match(e.label)){let o=e.displayLabel?t?t(e,i.matched):[]:i.matched;r(new wl(e,n.source,o,i.score+(e.boost||0)))}}}if(n){let t=Object.create(null),e=0,r=(t,e)=>{var i,n;return(null!==(i=t.rank)&&void 0!==i?i:1e9)-(null!==(n=e.rank)&&void 0!==n?n:1e9)||(t.namee.score-t.score||l(t.completion,e.completion)))){let e=t.completion;!a||a.label!=e.label||a.detail!=e.detail||null!=a.type&&null!=e.type&&a.type!=e.type||a.apply!=e.apply||a.boost!=e.boost?s.push(t):Nl(t.completion)>Nl(a)&&(s[s.length-1]=t),a=t.completion}return s}(t,e);if(!s.length)return n&&t.some((t=>t.isPending))?n.setDisabled():null;let a=e.facet(Il).selectOnOpen?0:-1;if(n&&n.selected!=a&&-1!=n.selected){let t=n.options[n.selected].completion;for(let e=0;ee.hasResult()?Math.min(t,e.from):t),1e8),create:Kl,above:r.aboveCursor},n?n.timestamp:Date.now(),a,!1)}map(t){return new Bl(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:t.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}setDisabled(){return new Bl(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class zl{constructor(t,e,i){this.active=t,this.id=e,this.open=i}static start(){return new zl(Hl,"cm-ac-"+Math.floor(2e6*Math.random()).toString(36),null)}update(t){let{state:e}=t,i=e.facet(Il),n=(i.override||e.languageDataAt("autocomplete",xl(e)).map(Al)).map((e=>{let n=this.active.find((t=>t.source==e))||new Ul(e,this.active.some((t=>0!=t.state))?1:0);return n.update(t,i)}));n.length==this.active.length&&n.every(((t,e)=>t==this.active[e]))&&(n=this.active);let r=this.open,o=t.effects.some((t=>t.is(Gl)));r&&t.docChanged&&(r=r.map(t.changes)),t.selection||n.some((e=>e.hasResult()&&t.changes.touchesRange(e.from,e.to)))||!function(t,e){if(t==e)return!0;for(let i=0,n=0;;){for(;it.isPending))&&(r=null),!r&&n.every((t=>!t.isPending))&&n.some((t=>t.hasResult()))&&(n=n.map((t=>t.hasResult()?new Ul(t.source,0):t)));for(let e of t.effects)e.is(ql)&&(r=r&&r.setSelected(e.value,this.id));return n==this.active&&r==this.open?this:new zl(n,this.id,r)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?$l:Fl}}const $l={"aria-autocomplete":"list"},Fl={};function Vl(t,e){let i={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":t};return e>-1&&(i["aria-activedescendant"]=t+"-"+e),i}const Hl=[];function Wl(t,e){if(t.isUserEvent("input.complete")){let i=t.annotation(kl);if(i&&e.activateOnCompletion(i))return 12}let i=t.isUserEvent("input.type");return i&&e.activateOnTyping?5:i?1:t.isUserEvent("delete.backward")?2:t.selection?8:t.docChanged?16:0}class Ul{constructor(t,e,i=!1){this.source=t,this.state=e,this.explicit=i}hasResult(){return!1}get isPending(){return 1==this.state}update(t,e){let i=Wl(t,e),n=this;(8&i||16&i&&this.touches(t))&&(n=new Ul(n.source,0)),4&i&&0==n.state&&(n=new Ul(this.source,1)),n=n.updateFor(t,i);for(let e of t.effects)if(e.is(Cl))n=new Ul(n.source,1,e.value);else if(e.is(Ml))n=new Ul(n.source,0);else if(e.is(Gl))for(let t of e.value)t.source==n.source&&(n=t);return n}updateFor(t,e){return this.map(t.changes)}map(t){return this}touches(t){return t.changes.touchesRange(xl(t.state))}}class jl extends Ul{constructor(t,e,i,n,r,o){super(t,3,e),this.limit=i,this.result=n,this.from=r,this.to=o}hasResult(){return!0}updateFor(t,e){var i;if(!(3&e))return this.map(t.changes);let n=this.result;n.map&&!t.changes.empty&&(n=n.map(n,t.changes));let r=t.changes.mapPos(this.from),o=t.changes.mapPos(this.to,1),s=xl(t.state);if(s>o||!n||2&e&&(xl(t.startState)==this.from||st.map((t=>t.map(e)))}),ql=mt.define(),Yl=q.define({create:()=>zl.start(),update:(t,e)=>t.update(e),provide:t=>[Eo.from(t,(t=>t.tooltip)),io.contentAttributes.from(t,(t=>t.attrs))]});function Xl(t,e){const i=e.completion.apply||e.completion.label;let n=t.state.field(Yl).active.find((t=>t.source==e.source));return n instanceof jl&&("string"==typeof i?t.dispatch(Object.assign(Object.assign({},function(t,e,i,n){let{main:r}=t.selection,o=i-r.from,s=n-r.from;return Object.assign(Object.assign({},t.changeByRange((a=>{if(a!=r&&i!=n&&t.sliceDoc(a.from+o,a.from+s)!=t.sliceDoc(i,n))return{range:a};let l=t.toText(e);return{changes:{from:a.from+o,to:n==r.from?a.to:a.from+s,insert:l},range:B.cursor(a.from+o+l.length)}}))),{scrollIntoView:!0,userEvent:"input.complete"})}(t.state,i,n.from,n.to)),{annotations:kl.of(e.completion)})):i(t,e.completion,n.from,n.to),!0)}const Kl=Rl(Yl,Xl);function Zl(t,e="option"){return i=>{let n=i.state.field(Yl,!1);if(!n||!n.open||n.open.disabled||Date.now()-n.open.timestamp-1?n.open.selected+o*(t?1:-1):t?0:s-1;return a<0?a="page"==e?0:s-1:a>=s&&(a="page"==e?s-1:0),i.dispatch({effects:ql.of(a)}),!0}}const Jl=t=>{let e=t.state.field(Yl,!1);return!(t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp!!t.state.field(Yl,!1)&&(t.dispatch({effects:Cl.of(!0)}),!0);class th{constructor(t,e){this.active=t,this.context=e,this.time=Date.now(),this.updates=[],this.done=void 0}}const eh=nn.fromClass(class{constructor(t){this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of t.state.field(Yl).active)e.isPending&&this.startQuery(e)}update(t){let e=t.state.field(Yl),i=t.state.facet(Il);if(!t.selectionSet&&!t.docChanged&&t.startState.field(Yl)==e)return;let n=t.transactions.some((t=>{let e=Wl(t,i);return 8&e||(t.selection||t.docChanged)&&!(3&e)}));for(let e=0;e50&&Date.now()-i.time>1e3){for(let t of i.context.abortListeners)try{t()}catch(t){Ji(this.view.state,t)}i.context.abortListeners=null,this.running.splice(e--,1)}else i.updates.push(...t.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),t.transactions.some((t=>t.effects.some((t=>t.is(Cl)))))&&(this.pendingStart=!0);let r=this.pendingStart?50:i.activateOnTypingDelay;if(this.debounceUpdate=e.active.some((t=>t.isPending&&!this.running.some((e=>e.active.source==t.source))))?setTimeout((()=>this.startUpdate()),r):-1,0!=this.composing)for(let e of t.transactions)e.isUserEvent("input.type")?this.composing=2:2==this.composing&&e.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:t}=this.view,e=t.field(Yl);for(let t of e.active)t.isPending&&!this.running.some((e=>e.active.source==t.source))&&this.startQuery(t);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout((()=>this.accept()),this.view.state.facet(Il).updateSyncTime))}startQuery(t){let{state:e}=this.view,i=xl(e),n=new vl(e,i,t.explicit,this.view),r=new th(t,n);this.running.push(r),Promise.resolve(t.source(n)).then((t=>{r.context.aborted||(r.done=t||null,this.scheduleAccept())}),(t=>{this.view.dispatch({effects:Ml.of(null)}),Ji(this.view.state,t)}))}scheduleAccept(){this.running.every((t=>void 0!==t.done))?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout((()=>this.accept()),this.view.state.facet(Il).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],i=this.view.state.facet(Il),n=this.view.state.field(Yl);for(let r=0;rt.source==o.active.source));if(s&&s.isPending)if(null==o.done){let t=new Ul(o.active.source,0);for(let e of o.updates)t=t.update(e,i);t.isPending||e.push(t)}else this.startQuery(s)}(e.length||n.open&&n.open.disabled)&&this.view.dispatch({effects:Gl.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field(Yl,!1);if(e&&e.tooltip&&this.view.state.facet(Il).closeOnBlur){let i=e.open&&Po(this.view,e.open.tooltip);i&&i.dom.contains(t.relatedTarget)||setTimeout((()=>this.view.dispatch({effects:Ml.of(null)})),10)}},compositionstart(){this.composing=1},compositionend(){3==this.composing&&setTimeout((()=>this.view.dispatch({effects:Cl.of(!1)})),20),this.composing=0}}}),ih="object"==typeof navigator&&/Win/.test(navigator.platform),nh=Q.highest(io.domEventHandlers({keydown(t,e){let i=e.state.field(Yl,!1);if(!i||!i.open||i.open.disabled||i.open.selected<0||t.key.length>1||t.ctrlKey&&(!ih||!t.altKey)||t.metaKey)return!1;let n=i.open.options[i.open.selected],r=i.active.find((t=>t.source==n.source)),o=n.completion.commitCharacters||r.result.commitCharacters;return o&&o.indexOf(t.key)>-1&&Xl(e,n),!1}})),rh=io.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),oh={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},sh=new class extends It{};sh.startSide=1,sh.endSide=-1;const ah="()[]{}<>";function lh(t){for(let e=0;e<8;e+=2)if(ah.charCodeAt(e)==t)return ah.charAt(e+1);return S(t<128?t:t+1)}const hh=[{key:"Backspace",run:({state:t,dispatch:e})=>{if(t.readOnly)return!1;let i=function(t,e){return t.languageDataAt("closeBrackets",e)[0]||oh}(t,t.selection.main.head),n=i.brackets||oh.brackets,r=null,o=t.changeByRange((e=>{if(e.empty){let i=function(t,e){let i=t.sliceString(e-2,e);return A(k(i,0))==i.length?i:i.slice(1)}(t.doc,e.head);for(let r of n)if(r==i&&ch(t.doc,e.head)==lh(k(r,0)))return{changes:{from:e.head-r.length,to:e.head+r.length},range:B.cursor(e.head-r.length)}}return{range:r=e}}));return r||e(t.update(o,{scrollIntoView:!0,userEvent:"delete.backward"})),!r}}];function ch(t,e){let i=t.sliceString(e,e+2);return i.slice(0,A(k(i,0)))}function uh(t={}){return[nh,Yl,Il.of(t),eh,ph,rh]}const dh=[{key:"Ctrl-Space",run:Ql},{mac:"Alt-`",run:Ql},{key:"Escape",run:t=>{let e=t.state.field(Yl,!1);return!(!e||!e.active.some((t=>0!=t.state)))&&(t.dispatch({effects:Ml.of(null)}),!0)}},{key:"ArrowDown",run:Zl(!0)},{key:"ArrowUp",run:Zl(!1)},{key:"PageDown",run:Zl(!0,"page")},{key:"PageUp",run:Zl(!1,"page")},{key:"Enter",run:Jl}],ph=Q.highest(co.computeN([Il],(t=>t.facet(Il).defaultKeymap?[dh]:[])));function fh(t,e){return({state:i,dispatch:n})=>{if(i.readOnly)return!1;let r=t(e,i);return!!r&&(n(i.update(r)),!0)}}const gh=fh(xh,0),mh=fh(wh,0),vh=fh(((t,e)=>wh(t,e,function(t){let e=[];for(let i of t.selection.ranges){let n=t.doc.lineAt(i.from),r=i.to<=n.to?n:t.doc.lineAt(i.to);r.from>n.from&&r.from==i.to&&(r=i.to==n.to+1?n:t.doc.lineAt(i.to-1));let o=e.length-1;o>=0&&e[o].to>n.from?e[o].to=r.to:e.push({from:n.from+/^\s*/.exec(n.text)[0].length,to:r.to})}return e}(e))),0);function yh(t,e){let i=t.languageDataAt("commentTokens",e);return i.length?i[0]:{}}const bh=50;function wh(t,e,i=e.selection.ranges){let n=i.map((t=>yh(e,t.from).block));if(!n.every((t=>t)))return null;let r=i.map(((t,i)=>function(t,{open:e,close:i},n,r){let o,s,a=t.sliceDoc(n-bh,n),l=t.sliceDoc(r,r+bh),h=/\s*$/.exec(a)[0].length,c=/^\s*/.exec(l)[0].length,u=a.length-h;if(a.slice(u-e.length,u)==e&&l.slice(c,c+i.length)==i)return{open:{pos:n-h,margin:h&&1},close:{pos:r+c,margin:c&&1}};r-n<=2*bh?o=s=t.sliceDoc(n,r):(o=t.sliceDoc(n,n+bh),s=t.sliceDoc(r-bh,r));let d=/^\s*/.exec(o)[0].length,p=/\s*$/.exec(s)[0].length,f=s.length-p-i.length;return o.slice(d,d+e.length)==e&&s.slice(f,f+i.length)==i?{open:{pos:n+d+e.length,margin:/\s/.test(o.charAt(d+e.length))?1:0},close:{pos:r-p-i.length,margin:/\s/.test(s.charAt(f-1))?1:0}}:null}(e,n[i],t.from,t.to)));if(2!=t&&!r.every((t=>t)))return{changes:e.changes(i.map(((t,e)=>r[e]?[]:[{from:t.from,insert:n[e].open+" "},{from:t.to,insert:" "+n[e].close}])))};if(1!=t&&r.some((t=>t))){let t=[];for(let e,i=0;ir&&(t==o||o>l.from)){r=l.from;let t=/^\s*/.exec(l.text)[0].length,e=t==l.length,i=l.text.slice(t,t+a.length)==a?t:-1;tt.comment<0&&(!t.empty||t.single)))){let t=[];for(let{line:e,token:i,indent:r,empty:o,single:s}of n)!s&&o||t.push({from:e.from+r,insert:i+" "});let i=e.changes(t);return{changes:i,selection:e.selection.map(i,1)}}if(1!=t&&n.some((t=>t.comment>=0))){let t=[];for(let{line:e,comment:i,token:r}of n)if(i>=0){let n=e.from+i,o=n+r.length;" "==e.text[o-e.from]&&o++,t.push({from:n,to:o})}return{changes:t}}return null}const _h=pt.define(),kh=pt.define(),Sh=F.define(),Ah=F.define({combine:t=>Tt(t,{minDepth:100,newGroupDelay:500,joinToEvent:(t,e)=>e},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,e)=>(i,n)=>t(i,n)||e(i,n)})}),Ch=q.define({create:()=>Wh.empty,update(t,e){let i=e.state.facet(Ah),n=e.annotation(_h);if(n){let r=Ph.fromTransaction(e,n.selection),o=n.side,s=0==o?t.undone:t.done;return s=r?Lh(s,s.length,i.minDepth,r):zh(s,e.startState.selection),new Wh(0==o?n.rest:s,0==o?s:n.rest)}let r=e.annotation(kh);if("full"!=r&&"before"!=r||(t=t.isolate()),!1===e.annotation(vt.addToHistory))return e.changes.empty?t:t.addMapping(e.changes.desc);let o=Ph.fromTransaction(e),s=e.annotation(vt.time),a=e.annotation(vt.userEvent);return o?t=t.addChanges(o,s,a,i,e):e.selection&&(t=t.addSelection(e.startState.selection,s,a,i.newGroupDelay)),"full"!=r&&"after"!=r||(t=t.isolate()),t},toJSON:t=>({done:t.done.map((t=>t.toJSON())),undone:t.undone.map((t=>t.toJSON()))}),fromJSON:t=>new Wh(t.done.map(Ph.fromJSON),t.undone.map(Ph.fromJSON))});function Mh(t={}){return[Ch,Ah.of(t),io.domEventHandlers({beforeinput(t,e){let i="historyUndo"==t.inputType?Th:"historyRedo"==t.inputType?Ih:null;return!!i&&(t.preventDefault(),i(e))}})]}function Dh(t,e){return function({state:i,dispatch:n}){if(!e&&i.readOnly)return!1;let r=i.field(Ch,!1);if(!r)return!1;let o=r.pop(t,i,e);return!!o&&(n(o),!0)}}const Th=Dh(0,!1),Ih=Dh(1,!1),Oh=Dh(0,!0),Eh=Dh(1,!0);class Ph{constructor(t,e,i,n,r){this.changes=t,this.effects=e,this.mapped=i,this.startSelection=n,this.selectionsAfter=r}setSelAfter(t){return new Ph(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,e,i;return{changes:null===(t=this.changes)||void 0===t?void 0:t.toJSON(),mapped:null===(e=this.mapped)||void 0===e?void 0:e.toJSON(),startSelection:null===(i=this.startSelection)||void 0===i?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map((t=>t.toJSON()))}}static fromJSON(t){return new Ph(t.changes&&T.fromJSON(t.changes),[],t.mapped&&D.fromJSON(t.mapped),t.startSelection&&B.fromJSON(t.startSelection),t.selectionsAfter.map(B.fromJSON))}static fromTransaction(t,e){let i=Nh;for(let e of t.startState.facet(Sh)){let n=e(t);n.length&&(i=i.concat(n))}return!i.length&&t.changes.empty?null:new Ph(t.changes.invert(t.startState.doc),i,void 0,e||t.startState.selection,Nh)}static selection(t){return new Ph(void 0,Nh,void 0,void 0,t)}}function Lh(t,e,i,n){let r=e+1>i+20?e-i-1:0,o=t.slice(r,e);return o.push(n),o}function Rh(t,e){return t.length?e.length?t.concat(e):t:e}const Nh=[],Bh=200;function zh(t,e){if(t.length){let i=t[t.length-1],n=i.selectionsAfter.slice(Math.max(0,i.selectionsAfter.length-Bh));return n.length&&n[n.length-1].eq(e)?t:(n.push(e),Lh(t,t.length-1,1e9,i.setSelAfter(n)))}return[Ph.selection([e])]}function $h(t){let e=t[t.length-1],i=t.slice();return i[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),i}function Fh(t,e){if(!t.length)return t;let i=t.length,n=Nh;for(;i;){let r=Vh(t[i-1],e,n);if(r.changes&&!r.changes.empty||r.effects.length){let e=t.slice(0,i);return e[i-1]=r,e}e=r.mapped,i--,n=r.selectionsAfter}return n.length?[Ph.selection(n)]:Nh}function Vh(t,e,i){let n=Rh(t.selectionsAfter.length?t.selectionsAfter.map((t=>t.map(e))):Nh,i);if(!t.changes)return Ph.selection(n);let r=t.changes.map(e),o=e.mapDesc(t.changes,!0),s=t.mapped?t.mapped.composeDesc(o):o;return new Ph(r,mt.mapEffects(t.effects,e),s,t.startSelection.map(o),n)}const Hh=/^(input\.type|delete)($|\.)/;class Wh{constructor(t,e,i=0,n=void 0){this.done=t,this.undone=e,this.prevTime=i,this.prevUserEvent=n}isolate(){return this.prevTime?new Wh(this.done,this.undone):this}addChanges(t,e,i,n,r){let o=this.done,s=o[o.length-1];return o=s&&s.changes&&!s.changes.empty&&t.changes&&(!i||Hh.test(i))&&(!s.selectionsAfter.length&&e-this.prevTimei.push(t,e))),e.iterChangedRanges(((t,e,r,o)=>{for(let t=0;t=e&&r<=s&&(n=!0)}})),n}(s.changes,t.changes))||"input.type.compose"==i)?Lh(o,o.length-1,n.minDepth,new Ph(t.changes.compose(s.changes),Rh(mt.mapEffects(t.effects,s.changes),s.effects),s.mapped,s.startSelection,Nh)):Lh(o,o.length,n.minDepth,t),new Wh(o,Nh,e,i)}addSelection(t,e,i,n){let r=this.done.length?this.done[this.done.length-1].selectionsAfter:Nh;return r.length>0&&e-this.prevTimet.empty!=e.ranges[i].empty)).length}(r[r.length-1],t)?this:new Wh(zh(this.done,t),this.undone,e,i)}addMapping(t){return new Wh(Fh(this.done,t),Fh(this.undone,t),this.prevTime,this.prevUserEvent)}pop(t,e,i){let n=0==t?this.done:this.undone;if(0==n.length)return null;let r=n[n.length-1],o=r.selectionsAfter[0]||e.selection;if(i&&r.selectionsAfter.length)return e.update({selection:r.selectionsAfter[r.selectionsAfter.length-1],annotations:_h.of({side:t,rest:$h(n),selection:o}),userEvent:0==t?"select.undo":"select.redo",scrollIntoView:!0});if(r.changes){let i=1==n.length?Nh:n.slice(0,n.length-1);return r.mapped&&(i=Fh(i,r.mapped)),e.update({changes:r.changes,selection:r.startSelection,effects:r.effects,annotations:_h.of({side:t,rest:i,selection:o}),filter:!1,userEvent:0==t?"undo":"redo",scrollIntoView:!0})}return null}}Wh.empty=new Wh(Nh,Nh);const Uh=[{key:"Mod-z",run:Th,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:Ih,preventDefault:!0},{linux:"Ctrl-Shift-z",run:Ih,preventDefault:!0},{key:"Mod-u",run:Oh,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:Eh,preventDefault:!0}];function jh(t,e){return B.create(t.ranges.map(e),t.mainIndex)}function Gh(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function qh({state:t,dispatch:e},i){let n=jh(t.selection,i);return!n.eq(t.selection,!0)&&(e(Gh(t,n)),!0)}function Yh(t,e){return B.cursor(e?t.to:t.from)}function Xh(t,e){return qh(t,(i=>i.empty?t.moveByChar(i,e):Yh(i,e)))}function Kh(t){return t.textDirectionAt(t.state.selection.main.head)==yi.LTR}const Zh=t=>Xh(t,!Kh(t)),Jh=t=>Xh(t,Kh(t));function Qh(t,e){return qh(t,(i=>i.empty?t.moveByGroup(i,e):Yh(i,e)))}function tc(t,e,i){if(e.type.prop(i))return!0;let n=e.to-e.from;return n&&(n>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function ec(t,e,i){let n,r,o=ha(t).resolveInner(e.head),s=i?rs.closedBy:rs.openedBy;for(let n=e.head;;){let e=i?o.childAfter(n):o.childBefore(n);if(!e)break;tc(t,e,s)?o=e:n=i?e.to:e.from}return r=o.type.prop(s)&&(n=i?ll(t,o.from,1):ll(t,o.to,-1))&&n.matched?i?n.end.to:n.end.from:i?o.to:o.from,B.cursor(r,i?-1:1)}function ic(t,e){return qh(t,(i=>{if(!i.empty)return Yh(i,e);let n=t.moveVertically(i,e);return n.head!=i.head?n:t.moveToLineBoundary(i,e)}))}const nc=t=>ic(t,!1),rc=t=>ic(t,!0);function oc(t){let e,i=t.scrollDOM.clientHeighti.empty?t.moveVertically(i,e,n.height):Yh(i,e)));if(o.eq(r.selection))return!1;if(n.selfScroll){let e=t.coordsAtPos(r.selection.main.head),s=t.scrollDOM.getBoundingClientRect(),a=s.top+n.marginTop,l=s.bottom-n.marginBottom;e&&e.top>a&&e.bottomsc(t,!1),lc=t=>sc(t,!0);function hc(t,e,i){let n=t.lineBlockAt(e.head),r=t.moveToLineBoundary(e,i);if(r.head==e.head&&r.head!=(i?n.to:n.from)&&(r=t.moveToLineBoundary(e,i,!1)),!i&&r.head==n.from&&n.length){let i=/^\s*/.exec(t.state.sliceDoc(n.from,Math.min(n.from+100,n.to)))[0].length;i&&e.head!=n.from+i&&(r=B.cursor(n.from+i))}return r}function cc(t,e){let i=jh(t.state.selection,(t=>{let i=e(t);return B.range(t.anchor,i.head,i.goalColumn,i.bidiLevel||void 0)}));return!i.eq(t.state.selection)&&(t.dispatch(Gh(t.state,i)),!0)}function uc(t,e){return cc(t,(i=>t.moveByChar(i,e)))}const dc=t=>uc(t,!Kh(t)),pc=t=>uc(t,Kh(t));function fc(t,e){return cc(t,(i=>t.moveByGroup(i,e)))}function gc(t,e){return cc(t,(i=>t.moveVertically(i,e)))}const mc=t=>gc(t,!1),vc=t=>gc(t,!0);function yc(t,e){return cc(t,(i=>t.moveVertically(i,e,oc(t).height)))}const bc=t=>yc(t,!1),wc=t=>yc(t,!0),xc=({state:t,dispatch:e})=>(e(Gh(t,{anchor:0})),!0),_c=({state:t,dispatch:e})=>(e(Gh(t,{anchor:t.doc.length})),!0),kc=({state:t,dispatch:e})=>(e(Gh(t,{anchor:t.selection.main.anchor,head:0})),!0),Sc=({state:t,dispatch:e})=>(e(Gh(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0);function Ac(t,e){if(t.state.readOnly)return!1;let i="delete.selection",{state:n}=t,r=n.changeByRange((n=>{let{from:r,to:o}=n;if(r==o){let s=e(n);sr&&(i="delete.forward",s=Cc(t,s,!0)),r=Math.min(r,s),o=Math.max(o,s)}else r=Cc(t,r,!1),o=Cc(t,o,!0);return r==o?{range:n}:{changes:{from:r,to:o},range:B.cursor(r,re(t))))n.between(e,e,((t,n)=>{te&&(e=i?n:t)}));return e}const Mc=(t,e,i)=>Ac(t,(n=>{let r,o,s=n.from,{state:a}=t,l=a.doc.lineAt(s);if(i&&!e&&s>l.from&&sMc(t,!1,!0),Tc=t=>Mc(t,!0,!1),Ic=(t,e)=>Ac(t,(i=>{let n=i.head,{state:r}=t,o=r.doc.lineAt(n),s=r.charCategorizer(n);for(let t=null;;){if(n==(e?o.to:o.from)){n==i.head&&o.number!=(e?r.doc.lines:1)&&(n+=e?1:-1);break}let a=_(o.text,n-o.from,e)+o.from,l=o.text.slice(Math.min(n,a)-o.from,Math.max(n,a)-o.from),h=s(l);if(null!=t&&h!=t)break;" "==l&&n==i.head||(t=h),n=a}return n})),Oc=t=>Ic(t,!1);function Ec(t){let e=[],i=-1;for(let n of t.selection.ranges){let r=t.doc.lineAt(n.from),o=t.doc.lineAt(n.to);if(n.empty||n.to!=o.from||(o=t.doc.lineAt(n.to-1)),i>=r.number){let t=e[e.length-1];t.to=o.to,t.ranges.push(n)}else e.push({from:r.from,to:o.to,ranges:[n]});i=o.number+1}return e}function Pc(t,e,i){if(t.readOnly)return!1;let n=[],r=[];for(let e of Ec(t)){if(i?e.to==t.doc.length:0==e.from)continue;let o=t.doc.lineAt(i?e.to+1:e.from-1),s=o.length+1;if(i){n.push({from:e.to,to:o.to},{from:e.from,insert:o.text+t.lineBreak});for(let i of e.ranges)r.push(B.range(Math.min(t.doc.length,i.anchor+s),Math.min(t.doc.length,i.head+s)))}else{n.push({from:o.from,to:e.from},{from:e.to,insert:t.lineBreak+o.text});for(let t of e.ranges)r.push(B.range(t.anchor-s,t.head-s))}}return!!n.length&&(e(t.update({changes:n,scrollIntoView:!0,selection:B.create(r,t.selection.mainIndex),userEvent:"move.line"})),!0)}function Lc(t,e,i){if(t.readOnly)return!1;let n=[];for(let e of Ec(t))i?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,userEvent:"input.copyline"})),!0}const Rc=({state:t,dispatch:e})=>(e(t.update(t.replaceSelection(t.lineBreak),{scrollIntoView:!0,userEvent:"input"})),!0);const Nc=zc(!1),Bc=zc(!0);function zc(t){return({state:e,dispatch:i})=>{if(e.readOnly)return!1;let n=e.changeByRange((i=>{let{from:n,to:r}=i,o=e.doc.lineAt(n),s=!t&&n==r&&function(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let i,n=ha(t).resolveInner(e),r=n.childBefore(e),o=n.childAfter(e);return r&&o&&r.to<=e&&o.from>=e&&(i=r.type.prop(rs.closedBy))&&i.indexOf(o.name)>-1&&t.doc.lineAt(r.to).from==t.doc.lineAt(o.from).from&&!/\S/.test(t.sliceDoc(r.to,o.from))?{from:r.to,to:o.from}:null}(e,n);t&&(n=r=(r<=o.to?o:e.doc.lineAt(r)).to);let a=new Sa(e,{simulateBreak:n,simulateDoubleBreak:!!s}),l=ka(a,n);for(null==l&&(l=Gt(/^\s*/.exec(e.doc.lineAt(n).text)[0],e.tabSize));ro.from&&n{let r=[];for(let o=n.from;o<=n.to;){let s=t.doc.lineAt(o);s.number>i&&(n.empty||n.to>s.from)&&(e(s,r,n),i=s.number),o=s.to+1}let o=t.changes(r);return{changes:r,range:B.range(o.mapPos(n.anchor,1),o.mapPos(n.head,1))}}))}const Fc=({state:t,dispatch:e})=>!t.readOnly&&(e(t.update($c(t,((e,i)=>{i.push({from:e.from,insert:t.facet(wa)})})),{userEvent:"input.indent"})),!0),Vc=({state:t,dispatch:e})=>!t.readOnly&&(e(t.update($c(t,((e,i)=>{let n=/^\s*/.exec(e.text)[0];if(!n)return;let r=Gt(n,t.tabSize),o=0,s=_a(t,Math.max(0,r-xa(t)));for(;oQh(t,!Kh(t)),shift:t=>fc(t,!Kh(t)),preventDefault:!0},{mac:"Cmd-ArrowLeft",run:t=>qh(t,(e=>hc(t,e,!Kh(t)))),shift:t=>cc(t,(e=>hc(t,e,!Kh(t)))),preventDefault:!0},{key:"ArrowRight",run:Jh,shift:pc,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:t=>Qh(t,Kh(t)),shift:t=>fc(t,Kh(t)),preventDefault:!0},{mac:"Cmd-ArrowRight",run:t=>qh(t,(e=>hc(t,e,Kh(t)))),shift:t=>cc(t,(e=>hc(t,e,Kh(t)))),preventDefault:!0},{key:"ArrowUp",run:nc,shift:mc,preventDefault:!0},{mac:"Cmd-ArrowUp",run:xc,shift:kc},{mac:"Ctrl-ArrowUp",run:ac,shift:bc},{key:"ArrowDown",run:rc,shift:vc,preventDefault:!0},{mac:"Cmd-ArrowDown",run:_c,shift:Sc},{mac:"Ctrl-ArrowDown",run:lc,shift:wc},{key:"PageUp",run:ac,shift:bc},{key:"PageDown",run:lc,shift:wc},{key:"Home",run:t=>qh(t,(e=>hc(t,e,!1))),shift:t=>cc(t,(e=>hc(t,e,!1))),preventDefault:!0},{key:"Mod-Home",run:xc,shift:kc},{key:"End",run:t=>qh(t,(e=>hc(t,e,!0))),shift:t=>cc(t,(e=>hc(t,e,!0))),preventDefault:!0},{key:"Mod-End",run:_c,shift:Sc},{key:"Enter",run:Nc,shift:Nc},{key:"Mod-a",run:({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0)},{key:"Backspace",run:Dc,shift:Dc},{key:"Delete",run:Tc},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Oc},{key:"Mod-Delete",mac:"Alt-Delete",run:t=>Ic(t,!0)},{mac:"Mod-Backspace",run:t=>Ac(t,(e=>{let i=t.moveToLineBoundary(e,!1).head;return e.head>i?i:Math.max(0,e.head-1)}))},{mac:"Mod-Delete",run:t=>Ac(t,(e=>{let i=t.moveToLineBoundary(e,!0).head;return e.headqh(t,(e=>B.cursor(t.lineBlockAt(e.head).from,1))),shift:t=>cc(t,(e=>B.cursor(t.lineBlockAt(e.head).from)))},{key:"Ctrl-e",run:t=>qh(t,(e=>B.cursor(t.lineBlockAt(e.head).to,-1))),shift:t=>cc(t,(e=>B.cursor(t.lineBlockAt(e.head).to)))},{key:"Ctrl-d",run:Tc},{key:"Ctrl-h",run:Dc},{key:"Ctrl-k",run:t=>Ac(t,(e=>{let i=t.lineBlockAt(e.head).to;return e.head{if(t.readOnly)return!1;let i=t.changeByRange((t=>({changes:{from:t.from,to:t.to,insert:d.of(["",""])},range:B.cursor(t.from)})));return e(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0}},{key:"Ctrl-t",run:({state:t,dispatch:e})=>{if(t.readOnly)return!1;let i=t.changeByRange((e=>{if(!e.empty||0==e.from||e.from==t.doc.length)return{range:e};let i=e.from,n=t.doc.lineAt(i),r=i==n.from?i-1:_(n.text,i-n.from,!1)+n.from,o=i==n.to?i+1:_(n.text,i-n.from,!0)+n.from;return{changes:{from:r,to:o,insert:t.doc.slice(i,o).append(t.doc.slice(r,i))},range:B.cursor(o)}}));return!i.changes.empty&&(e(t.update(i,{scrollIntoView:!0,userEvent:"move.character"})),!0)}},{key:"Ctrl-v",run:lc}].map((t=>({mac:t.key,run:t.run,shift:t.shift})))),Wc=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:t=>qh(t,(e=>ec(t.state,e,!Kh(t)))),shift:t=>cc(t,(e=>ec(t.state,e,!Kh(t))))},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:t=>qh(t,(e=>ec(t.state,e,Kh(t)))),shift:t=>cc(t,(e=>ec(t.state,e,Kh(t))))},{key:"Alt-ArrowUp",run:({state:t,dispatch:e})=>Pc(t,e,!1)},{key:"Shift-Alt-ArrowUp",run:({state:t,dispatch:e})=>Lc(t,e,!1)},{key:"Alt-ArrowDown",run:({state:t,dispatch:e})=>Pc(t,e,!0)},{key:"Shift-Alt-ArrowDown",run:({state:t,dispatch:e})=>Lc(t,e,!0)},{key:"Escape",run:({state:t,dispatch:e})=>{let i=t.selection,n=null;return i.ranges.length>1?n=B.create([i.main]):i.main.empty||(n=B.create([B.cursor(i.main.head)])),!!n&&(e(Gh(t,n)),!0)}},{key:"Mod-Enter",run:Bc},{key:"Alt-l",mac:"Ctrl-l",run:({state:t,dispatch:e})=>{let i=Ec(t).map((({from:e,to:i})=>B.range(e,Math.min(i+1,t.doc.length))));return e(t.update({selection:B.create(i),userEvent:"select"})),!0}},{key:"Mod-i",run:({state:t,dispatch:e})=>{let i=jh(t.selection,(e=>{let i=ha(t),n=i.resolveStack(e.from,1);if(e.empty){let t=i.resolveStack(e.from,-1);t.node.from>=n.node.from&&t.node.to<=n.node.to&&(n=t)}for(let t=n;t;t=t.next){let{node:i}=t;if((i.from=e.to||i.to>e.to&&i.from<=e.from)&&t.next)return B.range(i.to,i.from)}return e}));return!i.eq(t.selection)&&(e(Gh(t,i)),!0)},preventDefault:!0},{key:"Mod-[",run:Vc},{key:"Mod-]",run:Fc},{key:"Mod-Alt-\\",run:({state:t,dispatch:e})=>{if(t.readOnly)return!1;let i=Object.create(null),n=new Sa(t,{overrideIndentation:t=>{let e=i[t];return null==e?-1:e}}),r=$c(t,((e,r,o)=>{let s=ka(n,e.from);if(null==s)return;/\S/.test(e.text)||(s=0);let a=/^\s*/.exec(e.text)[0],l=_a(t,s);(a!=l||o.from{if(t.state.readOnly)return!1;let{state:e}=t,i=e.changes(Ec(e).map((({from:t,to:i})=>(t>0?t--:i{let i;if(t.lineWrapping){let n=t.lineBlockAt(e.head),r=t.coordsAtPos(e.head,e.assoc||1);r&&(i=n.bottom+t.documentTop-r.bottom+t.defaultLineHeight/2)}return t.moveVertically(e,!0,i)})).map(i);return t.dispatch({changes:i,selection:n,scrollIntoView:!0,userEvent:"delete.line"}),!0}},{key:"Shift-Mod-\\",run:({state:t,dispatch:e})=>function(t,e){let i=!1,n=jh(t.selection,(e=>{let n=ll(t,e.head,-1)||ll(t,e.head,1)||e.head>0&&ll(t,e.head-1,1)||e.head{let{state:e}=t,i=e.doc.lineAt(e.selection.main.from),n=yh(t.state,i.from);return n.line?gh(t):!!n.block&&vh(t)}},{key:"Alt-A",run:mh},{key:"Ctrl-m",mac:"Shift-Alt-m",run:t=>(t.setTabFocusMode(),!0)}].concat(Hc),Uc=globalThis,jc=Uc.ShadowRoot&&(void 0===Uc.ShadyCSS||Uc.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Gc=Symbol(),qc=new WeakMap;let Yc=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==Gc)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(jc&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=qc.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&qc.set(e,t))}return t}toString(){return this.cssText}};const Xc=(t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,i,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[n+1]),t[0]);return new Yc(i,t,Gc)},Kc=jc?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new Yc("string"==typeof t?t:t+"",void 0,Gc))(e)})(t):t +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */,{is:Zc,defineProperty:Jc,getOwnPropertyDescriptor:Qc,getOwnPropertyNames:tu,getOwnPropertySymbols:eu,getPrototypeOf:iu}=Object,nu=globalThis,ru=nu.trustedTypes,ou=ru?ru.emptyScript:"",su=nu.reactiveElementPolyfillSupport,au=(t,e)=>t,lu={toAttribute(t,e){switch(e){case Boolean:t=t?ou:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},hu=(t,e)=>!Zc(t,e),cu={attribute:!0,type:String,converter:lu,reflect:!1,hasChanged:hu};Symbol.metadata??=Symbol("metadata"),nu.litPropertyMetadata??=new WeakMap;let uu=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=cu){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),n=this.getPropertyDescriptor(t,i,e);void 0!==n&&Jc(this.prototype,t,n)}}static getPropertyDescriptor(t,e,i){const{get:n,set:r}=Qc(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get(){return n?.call(this)},set(e){const o=n?.call(this);r.call(this,e),this.requestUpdate(t,o,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??cu}static _$Ei(){if(this.hasOwnProperty(au("elementProperties")))return;const t=iu(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(au("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(au("properties"))){const t=this.properties,e=[...tu(t),...eu(t)];for(const i of e)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const i=this._$Eu(t,e);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(Kc(t))}else void 0!==t&&e.push(Kc(t));return e}static _$Eu(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{if(jc)t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const i of e){const e=document.createElement("style"),n=Uc.litNonce;void 0!==n&&e.setAttribute("nonce",n),e.textContent=i.cssText,t.appendChild(e)}})(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EC(t,e){const i=this.constructor.elementProperties.get(t),n=this.constructor._$Eu(t,i);if(void 0!==n&&!0===i.reflect){const r=(void 0!==i.converter?.toAttribute?i.converter:lu).toAttribute(e,i.type);this._$Em=t,null==r?this.removeAttribute(n):this.setAttribute(n,r),this._$Em=null}}_$AK(t,e){const i=this.constructor,n=i._$Eh.get(t);if(void 0!==n&&this._$Em!==n){const t=i.getPropertyOptions(n),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:lu;this._$Em=n,this[n]=r.fromAttribute(e,t.type),this._$Em=null}}requestUpdate(t,e,i){if(void 0!==t){if(i??=this.constructor.getPropertyOptions(t),!(i.hasChanged??hu)(this[t],e))return;this.P(t,e,i)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(t,e,i){this._$AL.has(t)||this._$AL.set(t,e),!0===i.reflect&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,i]of t)!0!==i.wrapped||this._$AL.has(e)||void 0===this[e]||this.P(e,this[e],i)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(e)):this._$EU()}catch(e){throw t=!1,this._$EU(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach((t=>this._$EC(t,this[t]))),this._$EU()}updated(t){}firstUpdated(t){}};uu.elementStyles=[],uu.shadowRootOptions={mode:"open"},uu[au("elementProperties")]=new Map,uu[au("finalized")]=new Map,su?.({ReactiveElement:uu}),(nu.reactiveElementVersions??=[]).push("2.0.4"); +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +const du=globalThis,pu=du.trustedTypes,fu=pu?pu.createPolicy("lit-html",{createHTML:t=>t}):void 0,gu="$lit$",mu=`lit$${Math.random().toFixed(9).slice(2)}$`,vu="?"+mu,yu=`<${vu}>`,bu=document,wu=()=>bu.createComment(""),xu=t=>null===t||"object"!=typeof t&&"function"!=typeof t,_u=Array.isArray,ku=t=>_u(t)||"function"==typeof t?.[Symbol.iterator],Su="[ \t\n\f\r]",Au=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Cu=/-->/g,Mu=/>/g,Du=RegExp(`>|${Su}(?:([^\\s"'>=/]+)(${Su}*=${Su}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),Tu=/'/g,Iu=/"/g,Ou=/^(?:script|style|textarea|title)$/i,Eu=t=>(e,...i)=>({_$litType$:t,strings:e,values:i}),Pu=Eu(1),Lu=Eu(2),Ru=Symbol.for("lit-noChange"),Nu=Symbol.for("lit-nothing"),Bu=new WeakMap,zu=bu.createTreeWalker(bu,129);function $u(t,e){if(!_u(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==fu?fu.createHTML(e):e}const Fu=(t,e)=>{const i=t.length-1,n=[];let r,o=2===e?"":3===e?"":"",s=Au;for(let e=0;e"===l[0]?(s=r??Au,h=-1):void 0===l[1]?h=-2:(h=s.lastIndex-l[2].length,a=l[1],s=void 0===l[3]?Du:'"'===l[3]?Iu:Tu):s===Iu||s===Tu?s=Du:s===Cu||s===Mu?s=Au:(s=Du,r=void 0);const u=s===Du&&t[e+1].startsWith("/>")?" ":"";o+=s===Au?i+yu:h>=0?(n.push(a),i.slice(0,h)+gu+i.slice(h)+mu+u):i+mu+(-2===h?e:u)}return[$u(t,o+(t[i]||"")+(2===e?"":3===e?"":"")),n]};class Vu{constructor({strings:t,_$litType$:e},i){let n;this.parts=[];let r=0,o=0;const s=t.length-1,a=this.parts,[l,h]=Fu(t,e);if(this.el=Vu.createElement(l,i),zu.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(n=zu.nextNode())&&a.length0){n.textContent=pu?pu.emptyScript:"";for(let i=0;i2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=Nu}_$AI(t,e=this,i,n){const r=this.strings;let o=!1;if(void 0===r)t=Hu(this,t,e,0),o=!xu(t)||t!==this._$AH&&t!==Ru,o&&(this._$AH=t);else{const n=t;let s,a;for(t=r[0],s=0;s{const n=i?.renderBefore??e;let r=n._$litPart$;if(void 0===r){const t=i?.renderBefore??null;n._$litPart$=r=new Uu(e.insertBefore(wu(),t),t,void 0,i??{})}return r._$AI(t),r})(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Ru}};Ju._$litElement$=!0,Ju.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:Ju});const Qu=globalThis.litElementPolyfillSupport;Qu?.({LitElement:Ju}),(globalThis.litElementVersions??=[]).push("4.1.1"); +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +const td=t=>(e,i)=>{void 0!==i?i.addInitializer((()=>{customElements.define(t,e)})):customElements.define(t,e)} +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */,ed={attribute:!0,type:String,converter:lu,reflect:!1,hasChanged:hu},id=(t=ed,e,i)=>{const{kind:n,metadata:r}=i;let o=globalThis.litPropertyMetadata.get(r);if(void 0===o&&globalThis.litPropertyMetadata.set(r,o=new Map),o.set(i.name,t),"accessor"===n){const{name:n}=i;return{set(i){const r=e.get.call(this);e.set.call(this,i),this.requestUpdate(n,r,t)},init(e){return void 0!==e&&this.P(n,void 0,t),e}}}if("setter"===n){const{name:n}=i;return function(i){const r=this[n];e.call(this,i),this.requestUpdate(n,r,t)}}throw Error("Unsupported decorator location: "+n)};function nd(t){return(e,i)=>"object"==typeof i?id(t,e,i):((t,e,i)=>{const n=e.hasOwnProperty(i);return e.constructor.createProperty(i,n?{...t,wrapped:!0}:t),n?Object.getOwnPropertyDescriptor(e,i):void 0})(t,e,i) +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */}function rd(t){return nd({...t,state:!0,attribute:!1})} +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +function od(t,e){return(e,i,n)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Reflect.decorate&&"object"!=typeof e&&Object.defineProperty(t,e,i),i))(e,i,{get(){return(e=>e.renderRoot?.querySelector(t)??null)(this)}})} +/** + * @license + * Copyright 2020 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const{I:sd}=Ku,ad=()=>document.createComment(""),ld=(t,e,i)=>{const n=t._$AA.parentNode,r=void 0===e?t._$AB:e._$AA;if(void 0===i){const e=n.insertBefore(ad(),r),o=n.insertBefore(ad(),r);i=new sd(e,o,t,t.options)}else{const e=i._$AB.nextSibling,o=i._$AM,s=o!==t;if(s){let e;i._$AQ?.(t),i._$AM=t,void 0!==i._$AP&&(e=t._$AU)!==o._$AU&&i._$AP(e)}if(e!==r||s){let t=i._$AA;for(;t!==e;){const e=t.nextSibling;n.insertBefore(t,r),t=e}}}return i},hd=(t,e,i=t)=>(t._$AI(e,i),t),cd={},ud=t=>{t._$AP?.(!1,!0);let e=t._$AA;const i=t._$AB.nextSibling;for(;e!==i;){const t=e.nextSibling;e.remove(),e=t}},dd=1,pd=2,fd=t=>(...e)=>({_$litDirective$:t,values:e}); +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */let gd=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}; +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const md=(t,e)=>{const i=t._$AN;if(void 0===i)return!1;for(const t of i)t._$AO?.(e,!1),md(t,e);return!0},vd=t=>{let e,i;do{if(void 0===(e=t._$AM))break;i=e._$AN,i.delete(t),t=e}while(0===i?.size)},yd=t=>{for(let e;e=t._$AM;t=e){let i=e._$AN;if(void 0===i)e._$AN=i=new Set;else if(i.has(t))break;i.add(t),xd(e)}};function bd(t){void 0!==this._$AN?(vd(this),this._$AM=t,yd(this)):this._$AM=t}function wd(t,e=!1,i=0){const n=this._$AH,r=this._$AN;if(void 0!==r&&0!==r.size)if(e)if(Array.isArray(n))for(let t=i;t{t.type==pd&&(t._$AP??=wd,t._$AQ??=bd)};class _d extends gd{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,i){super._$AT(t,e,i),yd(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(md(this,t),vd(this))}setValue(t){if((t=>void 0===t.strings)(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}} +/** + * @license + * Copyright 2020 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const kd=()=>new Sd;class Sd{}const Ad=new WeakMap,Cd=fd(class extends _d{render(t){return Nu}update(t,[e]){const i=e!==this.Y;return i&&void 0!==this.Y&&this.rt(void 0),(i||this.lt!==this.ct)&&(this.Y=e,this.ht=t.options?.host,this.rt(this.ct=t.element)),Nu}rt(t){if(this.isConnected||(t=void 0),"function"==typeof this.Y){const e=this.ht??globalThis;let i=Ad.get(e);void 0===i&&(i=new WeakMap,Ad.set(e,i)),void 0!==i.get(this.Y)&&this.Y.call(this.ht,void 0),i.set(this.Y,t),void 0!==t&&this.Y.call(this.ht,t)}else this.Y.value=t}get lt(){return"function"==typeof this.Y?Ad.get(this.ht??globalThis)?.get(this.Y):this.Y?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});function Md(t,e){const i=Za.define(t),n={"&":{},".cm-gutters":{paddingRight:"10px",paddingLeft:"5px"},".cm-activeLineGutter":{},".cm-activeLine":{},".cm-focused":{outline:"none"}};e.foreground&&(n["&"].color=e.foreground),e.lineHighlight&&(n[".cm-activeLine"].background=e.lineHighlight),e.selection&&(n["&.cm-focused .cm-selectionBackground, & .cm-line::selection, & .cm-selectionLayer .cm-selectionBackground, .cm-content ::selection"]={background:e.selection+" !important"}),e.selectionMatch&&(n["& .cm-selectionMatch"]={backgroundColor:e.selectionMatch}),e.gutterBackground&&(n[".cm-gutters"].backgroundColor=e.gutterBackground),e.gutterForeground&&(n[".cm-gutters"].color=e.gutterForeground),e.gutterBorder&&(n[".cm-gutters"].borderRightColor=e.gutterBorder),e.gutterActiveForeground&&(n[".cm-activeLineGutter"].color=e.gutterActiveForeground,n[".cm-activeLineGutter"].backgroundColor=e.gutterActiveBackground??n[".cm-activeLineGutter"].backgroundColor);return[io.theme(n,{dark:"dark"===e.theme}),el(i)]}function Dd(t,e){return"invasion"===e?function(t){return"light"===t?Md([{tag:[na.keyword,na.typeName,na.standard(na.name)],color:"#7f00ff"},{tag:[na.string],color:"#228b22"},{tag:[na.number],color:"#0000ff"},{tag:[na.operator,na.operatorKeyword],color:"#24292e"},{tag:[na.lineComment,na.blockComment,na.comment],color:"#a3a3a3"},{tag:[na.null,na.bool],color:"#7f00ff"}],{theme:t,foreground:"#000000",selection:"#ccc",lineHighlight:"#eee",gutterForeground:"#737373",gutterBackground:"#FAFAFA",gutterActiveForeground:"#000",gutterBorder:"transparent"}):Md([{tag:[na.keyword,na.typeName,na.standard(na.name)],color:"#bd93f9"},{tag:[na.string],color:"#50fa7b"},{tag:[na.number],color:"#8be9fd"},{tag:[na.operator,na.operatorKeyword],color:"#f6f8fa"},{tag:[na.lineComment,na.blockComment,na.comment],color:"#525252"},{tag:[na.null,na.bool],color:"#bd93f9"}],{theme:t,foreground:"#f8f8f2",selection:"#333",lineHighlight:"#151515",gutterForeground:"#737373",gutterBackground:"#0A0A0A",gutterActiveForeground:"#fff",gutterBorder:"transparent"})}(t):"freedom"===e?function(t){return"light"===t?Md([{tag:[na.keyword,na.typeName,na.standard(na.name)],color:"#1d4ed8"},{tag:[na.string],color:"black"},{tag:[na.number],color:"#0000ff"},{tag:[na.operator,na.operatorKeyword],color:"#e11d48"},{tag:[na.lineComment,na.blockComment,na.comment],color:"#a3a3a3"},{tag:[na.null,na.bool],color:"normal"}],{theme:t,foreground:"#000000",selection:"#ccc",lineHighlight:"#eee",gutterForeground:"#737373",gutterBackground:"#FAFAFA",gutterActiveForeground:"#000",gutterBorder:"transparent"}):Md([{tag:[na.keyword,na.typeName,na.standard(na.name)],color:"#60a5fa"},{tag:[na.string],color:"normal"},{tag:[na.number],color:"#60a5fa"},{tag:[na.operator,na.operatorKeyword],color:"#fb7185"},{tag:[na.lineComment,na.blockComment,na.comment],color:"#737373"},{tag:[na.null,na.bool],color:"normal"}],{theme:t,foreground:"white",selection:"#333",lineHighlight:"#151515",gutterForeground:"#737373",gutterBackground:"#0A0A0A",gutterActiveForeground:"#fff",gutterBorder:"transparent"})}(t):"logandust"===e?function(t){return"light"===t?Md([{tag:[na.keyword,na.typeName,na.standard(na.name)],color:"#737373"},{tag:[na.string],color:"#737373"},{tag:[na.number],color:"indigo"},{tag:[na.operator,na.operatorKeyword],color:"indigo"},{tag:[na.lineComment,na.blockComment,na.comment],color:"#737373"},{tag:[na.null,na.bool],color:"#111111"}],{theme:t,foreground:"#111111",selection:"#ccc",lineHighlight:"#eee",gutterForeground:"#737373",gutterBackground:"transparent",gutterActiveForeground:"#000",gutterActiveBackground:"transparent",gutterBorder:"transparent"}):Md([{tag:[na.keyword,na.typeName,na.standard(na.name)],color:"white"},{tag:[na.string],color:"#9ca3af"},{tag:[na.number],color:"#8be9fd"},{tag:[na.operator,na.operatorKeyword],color:"white"},{tag:[na.lineComment,na.blockComment,na.comment],color:"#737373"},{tag:[na.null,na.bool],color:"white"}],{theme:t,foreground:"#9ca3af",selection:"#333",lineHighlight:"#151515",gutterForeground:"#737373",gutterBackground:"transparent",gutterActiveForeground:"#fff",gutterActiveBackground:"transparent",gutterBorder:"transparent"})}(t):function(t){return"light"===t?Md([{tag:[na.keyword,na.typeName,na.standard(na.name)],color:"#737373"},{tag:[na.string],color:"#737373"},{tag:[na.number],color:"indigo"},{tag:[na.operator,na.operatorKeyword],color:"indigo"},{tag:[na.lineComment,na.blockComment,na.comment],color:"#737373"},{tag:[na.null,na.bool],color:"#111111"}],{theme:t,foreground:"#111111",selection:"#ccc",lineHighlight:"#eee",gutterForeground:"#737373",gutterBackground:"#FAFAFA",gutterActiveForeground:"#000",gutterBorder:"transparent"}):Md([{tag:[na.keyword,na.typeName,na.standard(na.name)],color:"white"},{tag:[na.string],color:"#9ca3af"},{tag:[na.number],color:"#8be9fd"},{tag:[na.operator,na.operatorKeyword],color:"white"},{tag:[na.lineComment,na.blockComment,na.comment],color:"#737373"},{tag:[na.null,na.bool],color:"white"}],{theme:t,foreground:"#9ca3af",selection:"#333",lineHighlight:"#151515",gutterForeground:"#737373",gutterBackground:"#0A0A0A",gutterActiveForeground:"#fff",gutterBorder:"transparent"})}(t)}var Td=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s};t.AstraEditor=class extends Ju{constructor(){if(super(),this.extensions=[],this.containerRef=kd(),this.previousValue="",this.color="light",this.wrap=!1,this.theme="moondust",this.placeholder="",this.value="",this.readonly=!1,this.styleSheets=[],!document.getElementById("codemirror-custom-font")){const t=document.head||document.getElementsByTagName("head")[0],e=document.createElement("style");e.id="codemirror-custom-font",t.appendChild(e),e.innerHTML="\n @font-face {\n font-family: 'outerbase-icon';\n font-weight: normal;\n font-style: normal;\n font-display: block;\n src: url(data:@file/octet-stream;base64,d09GRgABAAAAAAVQAAsAAAAABQQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABPUy8yAAABCAAAAGAAAABgDxEM4WNtYXAAAAFoAAAAVAAAAFT/9AFKZ2FzcAAAAbwAAAAIAAAACAAAABBnbHlmAAABxAAAAUAAAAFAAL6X5WhlYWQAAAMEAAAANgAAADYogzvlaGhlYQAAAzwAAAAkAAAAJAdiA8dobXR4AAADYAAAABgAAAAYDgAAAGxvY2EAAAN4AAAADgAAAA4AyAB0bWF4cAAAA4gAAAAgAAAAIAANADJuYW1lAAADqAAAAYYAAAGGmUoJ+3Bvc3QAAAUwAAAAIAAAACAAAwAAAAMDVQGQAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAQAAAAGIDwP/AAEADwABAAAAAAQAAAAAAAAAAAAAAIAAAAAAAAwAAAAMAAAAcAAEAAwAAABwAAwABAAAAHAAEADgAAAAKAAgAAgACAAEAIABi//3//wAAAAAAIABh//3//wAB/+P/owADAAEAAAAAAAAAAAAAAAEAAf//AA8AAQAA/8AAAAPAAAIAADc5AQAAAAABAAD/wAAAA8AAAgAANzkBAAAAAAEAAP/AAAADwAACAAA3OQEAAAAABAAA/8ADQAPAABMAFwArAC8AAAEjIgYVMREUFjMxMzI2NTERNCYjESMRMyUjIgYVMREUFjMxMzI2NTERNCYjESMRMwGgoBslJRugGyUlG6CgAWCgGyUlG6AbJSUboKADQCUb/YAbJSUbAoAbJf1AAoBAJRv9gBslJRsCgBsl/UACgAAABgAA/8ADoAPAABMAFwAbAB8AIwAnAAABISIGFTERFBYzMSEyNjUxETQmIwEzFSM3IRUhARUhNREzFSMpATUhA4D9AA0TJRsCwBslEw39IKCg4AHg/iAB4P1AoKACwP4gAeADABMN/eAbJSUbAiANE/8AgICAAUCAgP6AgIAAAAABAAAAAAAAbqA4a18PPPUACwQAAAAAAOLie7QAAAAA4uJ7tAAA/8ADoAPAAAAACAACAAAAAAAAAAEAAAPA/8AAAAQAAAAAAAOgAAEAAAAAAAAAAAAAAAAAAAAGBAAAAAAAAAAAAAAAAgAAAAQAAAAEAAAAAAAAAAAKABQAHgBgAKAAAAABAAAABgAwAAYAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAADgCuAAEAAAAAAAEABwAAAAEAAAAAAAIABwBgAAEAAAAAAAMABwA2AAEAAAAAAAQABwB1AAEAAAAAAAUACwAVAAEAAAAAAAYABwBLAAEAAAAAAAoAGgCKAAMAAQQJAAEADgAHAAMAAQQJAAIADgBnAAMAAQQJAAMADgA9AAMAAQQJAAQADgB8AAMAAQQJAAUAFgAgAAMAAQQJAAYADgBSAAMAAQQJAAoANACkaWNvbW9vbgBpAGMAbwBtAG8AbwBuVmVyc2lvbiAxLjAAVgBlAHIAcwBpAG8AbgAgADEALgAwaWNvbW9vbgBpAGMAbwBtAG8AbwBuaWNvbW9vbgBpAGMAbwBtAG8AbwBuUmVndWxhcgBSAGUAZwB1AGwAYQByaWNvbW9vbgBpAGMAbwBtAG8AbwBuRm9udCBnZW5lcmF0ZWQgYnkgSWNvTW9vbi4ARgBvAG4AdAAgAGcAZQBuAGUAcgBhAHQAZQBkACAAYgB5ACAASQBjAG8ATQBvAG8AbgAuAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==) format('woff2');\n } \n "}}firstUpdated(t){super.firstUpdated(t),this.extensions=[{name:"basic-setup",ext:[Zo(),ts,Mh(),[yo,bo],Dt.transactionFilter.of((t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let i=t.newDoc,{head:n}=t.newSelection.main,r=i.lineAt(n);if(n>r.from+200)return t;let o=i.sliceString(r.from,n);if(!e.some((t=>t.test(o))))return t;let{state:s}=t,a=-1,l=[];for(let{head:t}of s.selection.ranges){let e=s.doc.lineAt(t);if(e.from==a)continue;a=e.from;let i=ka(s,e.from);if(null==i)continue;let n=/^\s*/.exec(e.text)[0],r=_a(s,i);n!=r&&l.push({from:e.from,to:e.from+n.length,insert:r})}return l.length?[t,{changes:l,sequential:!0}]:t})),el(rl,{fallback:!0}),uh(),xo,wa.of(" "),co.of([{key:"Tab",preventDefault:!0,run:t=>("active"===function(t){let e=t.field(Yl,!1);return e&&e.active.some((t=>t.isPending))?"pending":e&&e.active.some((t=>0!=t.state))?"active":null}(t.state)?Jl(t):Fc(t),!0),shift:Vc},{key:"Shift-Enter",preventDefault:!0,run:Rc},{key:"Ctrl-Space",mac:"Cmd-i",preventDefault:!0,run:Ql},...hh,...Wc,...Uh,...Ua])],comp:new et},{name:"placeholder",ext:ko(this.placeholder),comp:new et},{name:"readonly",ext:Dt.readOnly.of(this.readonly),comp:new et},{name:"theme",ext:Dd("dark"===this.color?"dark":"light",this.theme),comp:new et},{name:"onchange",ext:io.updateListener.of((t=>{if(t.docChanged){const e=t.state.doc.toString();this.value=e,this.previousValue=e,this.dispatchEvent(new CustomEvent("change",{detail:e}))}})),comp:new et},...this.extensions];const e=new io({doc:this.value,extensions:this.getExtensions(),parent:this.containerRef.value,root:this.shadowRoot});this.editor=e}updated(t){super.updated(t),t.has("color")&&("dark"===this.color?this.containerRef?.value?.classList.add("dark"):this.containerRef?.value?.classList.remove("dark"),this.dispatchEvent(new Event("color-changed")),this.updateExtension("theme",Dd("dark"===this.color?"dark":"light",this.theme))),t.has("theme")&&this.updateExtension("theme",Dd("dark"===this.color?"dark":"light",this.theme)),t.has("wrap")&&(this.wrap?this.updateExtension("line-wrap",io.lineWrapping):this.removeExtension("line-wrap")),t.has("placeholder")&&this.updateExtension("placeholder",ko(this.placeholder)),t.has("value")&&this.editor&&this.value!==this.previousValue&&(this.previousValue=this.value,this.editor.dispatch({changes:{from:0,to:this.editor.state.doc.length,insert:this.value}})),t.has("readonly")&&this.updateExtension("readonly",Dt.readOnly.of(this.readonly))}render(){return Pu` + ${this.styleSheets.map((({styles:t})=>Pu``))} +
+ `}getExtensions(){return[io.theme({"&":{height:"100%"},"& .cm-line":{borderLeft:"3px solid transparent",paddingLeft:"10px"},"&.cm-scroller":{height:"100% !important"},"&.cm-focused":{outline:"none !important"}}),...this.extensions.map((t=>t.comp.of(t.ext)))]}registerKeymap(t,e){this.updateExtension("custom-keybinding-"+t,Q.highest(co.of([e])))}getLanguage(){if(this.editor)return this.editor.state.facet(ya)}getEditorView(){return this.editor}updateExtension(t,e){const i=this.extensions.find((({name:e})=>t===e));if(i)i.ext=e,this.editor&&this.editor.dispatch({effects:[i.comp.reconfigure(e)]});else{const i={name:t,comp:new et,ext:e};this.extensions.push(i),this.editor&&this.editor.dispatch({effects:[mt.appendConfig.of(i.comp.of(e))]})}}removeExtension(t){const e=this.extensions.findIndex((e=>e.name===t));e>=0&&(this.extensions.splice(e,1),this.editor&&this.editor.dispatch({effects:mt.reconfigure.of(this.getExtensions())}))}addStyle(t,e){this.styleSheets=[...this.styleSheets,{name:t,styles:e}]}removeStyle(t){this.styleSheets=this.styleSheets.filter((e=>e.name!==t))}},t.AstraEditor.styles=Xc` + @keyframes spin { + from { + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } + } + + .spin { + animation-name: spin; + animation-duration: 1000ms; + animation-iteration-count: infinite; + animation-timing-function: linear; + } + + .cm-tooltip-autocomplete ul::-webkit-scrollbar, + .cm-scroller::-webkit-scrollbar { + width: 6px; + height: 6px; + } + + .cm-scroller::-webkit-scrollbar-thumb { + border-radius: 5px; + } + + .cm-tooltip-autocomplete ul::-webkit-scrollbar-thumb, + .cm-scroller::-webkit-scrollbar-thumb { + background: rgba(0, 0, 0, 0.3); + } + + .dark .cm-tooltip-autocomplete ul::-webkit-scrollbar-thumb, + .dark .cm-scroller::-webkit-scrollbar-thumb { + background: rgba(255, 255, 255, 0.3); + } + + .cm-tooltip-autocomplete > ul > li { + display: flex; + } + + .cm-tooltip-autocomplete > ul > li > .cm-completionIcon { + width: 1em !important; + display: flex; + align-self: center; + justify-content: center; + } + + .cm-tooltip-autocomplete .cm-completionLabel { + flex-grow: 1; + } + + .cm-tooltip-autocomplete .cm-completionDetail { + padding-left: 15px; + } + + .cm-completionIcon-property::after { + content: '\\61' !important; + font-family: 'outerbase-icon' !important; + } + + .cm-completionIcon-type::after { + content: '\\62' !important; + font-family: 'outerbase-icon' !important; + } + + .cm-completionIcon-function::after, + .cm-completionIcon-method::after, + .cm-completionIcon-variable::after, + .cm-completionIcon-namespace::after, + .cm-completionIcon-interface::after { + content: '⚡' !important; + } + `,Td([nd()],t.AstraEditor.prototype,"color",void 0),Td([nd({type:Boolean})],t.AstraEditor.prototype,"wrap",void 0),Td([nd()],t.AstraEditor.prototype,"theme",void 0),Td([nd()],t.AstraEditor.prototype,"placeholder",void 0),Td([nd()],t.AstraEditor.prototype,"value",void 0),Td([nd({type:Boolean})],t.AstraEditor.prototype,"readonly",void 0),Td([rd()],t.AstraEditor.prototype,"styleSheets",void 0),t.AstraEditor=Td([td("astra-editor")],t.AstraEditor);var Id,Od,Ed,Pd=Xc` + :host { + font-size: var(--astra-font-size, 14px); + + --astra-font-family: 'Inter', sans-serif; + --astra-accent: var(--astra-neutral-400, lime); + + --astra-neutral-50: #fafafa; + --astra-neutral-100: #f5f5f5; + --astra-neutral-200: #e5e5e5; + --astra-neutral-300: #d4d4d4; + --astra-neutral-400: #a3a3a3; + --astra-neutral-500: #737373; + --astra-neutral-600: #525252; + --astra-neutral-700: #404040; + --astra-neutral-800: #262626; + --astra-neutral-900: #171717; + --astra-neutral-950: #0a0a0a; + + --astra-red-400: #f87171; + --astra-red-600: #dc2626; + --astra-red-700: #b91c1c; + --astra-red-800: #991b1b; + --astra-red-900: #7f1d1d; + } +`,Ld=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s};!function(t){t.primary="primary",t.secondary="secondary",t.transparent="transparent"}(Id||(Id={})),function(t){t.base="base",t.small="small",t.compact="compact"}(Od||(Od={})),function(t){t.default="default",t.square="square",t.circle="circle"}(Ed||(Ed={}));let Rd=class extends Ju{constructor(){super(),this.disabled=!1,this.size=Od.base,this.shape=Ed.default,this.variant=Id.primary,this.onKeyDown=this.onKeyDown.bind(this)}onKeyDown(t){const{code:e}=t;this.disabled||"Space"!==e&&"Enter"!==e||(t.preventDefault(),this.click())}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this.onKeyDown)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",this.onKeyDown)}render(){return Pu` + + `}};Rd.styles=[Pd,Xc` + /* Base button styles */ + button { + display: flex; + gap: 8px; + align-items: center; + justify-content: center; + cursor: pointer; + border: none; + font-weight: 500; + font-family: var(--astra-font-family); + line-height: 20px; + border-radius: 6px; + user-select: none; + -webkit-user-select: none; + outline: none; /* Avoid default focus styles */ + } + + /* Enhanced focus styles for keyboard navigation */ + button:focus-visible { + box-shadow: 0 0 0 3px var(--astra-accent, lime); /* Custom focus indicator */ + } + + /* Handling active and disabled states */ + button:active { + opacity: 0.75; + } + + button[disabled] { + opacity: 0.4; + cursor: default; + } + + /* Styling for button shapes */ + .shape-default { + padding: 8px 10px; + font-size: 14px; + } + + .shape-square { + padding: 0 !important; + } + + .shape-circle { + padding: 0 !important; + border-radius: 50%; + overflow: hidden; + } + + .size-base.shape-square, + .size-base.shape-circle { + width: 40px; + height: 40px; + } + + .size-small.shape-square, + .size-small.shape-circle { + width: 36px; + height: 36px; + } + + .size-compact.shape-square, + .size-compact.shape-circle { + width: 32px; + height: 32px; + } + + /* Styling for button sizes */ + .size-base { + padding: 10px 16px; + font-size: 14px; + } + + .size-small { + padding: 8px 12px; + font-size: 14px; + } + + .size-compact { + padding: 8px 10px; + font-size: 12px; + line-height: 16px; + } + + /* Variant styling for buttons */ + .variant-primary { + background: var(--astra-neutral-700); + color: white; + } + + .variant-secondary { + background: var(--astra-neutral-100); + color: var(--astra-neutral-900); + } + + .variant-transparent { + background: transparent; + color: var(--astra-neutral-900); + } + + .variant-destructive { + background: var(--astra-red-600); + color: white !important; + } + + button:not([disabled]) { + .variant-primary:hover { + background: var(--astra-neutral-900); + } + + .variant-secondary:hover { + background: var(--astra-neutral-200); + } + + .variant-destructive:hover { + background: var(--astra-red-700); + } + } + + /* Media queries for dark mode adaptations */ + @media (prefers-color-scheme: dark) { + button[disabled] { + opacity: 0.4; + cursor: default; + } + + .variant-primary { + background: var(--astra-neutral-200); + color: black; + } + + button:not([disabled]) { + .variant-primary:hover { + background: white; + } + + .variant-secondary:hover { + background: var(--astra-neutral-700); + } + + .variant-transparent:hover { + background: var(--astra-neutral-800); + } + } + + .variant-secondary { + background: var(--astra-neutral-800); + color: var(--astra-neutral-200); + } + + .variant-transparent { + background: transparent; + color: var(--astra-neutral-200); + } + + .variant-destructive { + background: var(--astra-red-900); + } + + .variant-destructive:hover { + background: var(--astra-red-800); + } + } + `],Ld([nd({type:Boolean,reflect:!0})],Rd.prototype,"disabled",void 0),Ld([nd({type:String})],Rd.prototype,"size",void 0),Ld([nd({type:String})],Rd.prototype,"shape",void 0),Ld([nd({type:String})],Rd.prototype,"variant",void 0),Rd=Ld([td("astra-button")],Rd);var Nd=Rd,Bd=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s};const zd=["Su","Mo","Tu","We","Th","Fr","Sa"];let $d=class extends Ju{constructor(){super(...arguments),this.singleMonthView=!1,this.startDate=null,this.endDate=null,this.viewingMonth=new Date,this.hoveringDate=null}getMonthName(t,e=0){const i=new Date(t);return i.setMonth(i.getMonth()+e),i.toLocaleString("default",{month:"long"})}getDateYear(t,e=0){const i=new Date(t);return i.setMonth(i.getMonth()+e),i.getFullYear()}getMonthsStartingDay(t,e=0){const i=new Date(t);return i.setDate(1),i.setMonth(i.getMonth()+e),i.getDay()}getNumberOfDaysInMonth(t,e=0){const i=new Date(t);return i.setDate(1),i.setMonth(i.getMonth()+e+1),i.setDate(0),i.getDate()}adjustMonth(t){this.viewingMonth=new Date(this.viewingMonth.setMonth(this.viewingMonth.getMonth()+t))}getDateFromIndex(t,e,i){const n=this.getMonthsStartingDay(t,e);if(ithis.getNumberOfDaysInMonth(t,e)+n-1){const r=new Date(t);return r.setMonth(r.getMonth()+e+1),r.setDate(i-this.getNumberOfDaysInMonth(t,e)-n+1),r}{const r=new Date(t);return r.setMonth(r.getMonth()+e),r.setDate(i-n+1),r}}isDateEqual(t,e){return!(!t||!e)&&t.toDateString()===e.toDateString()}handleDateClick(t){this.singleMonthView?(this.startDate=t,this.endDate=null,this.dispatchEvent(new CustomEvent("date-selected",{detail:{date:t},bubbles:!0,composed:!0}))):(!this.startDate||tthis.startDate&&(this.hoveringDate=t)}resetDates(){this.startDate=null,this.endDate=null}render(){return Pu` +
+
+
+
+ + +
this.setViewingMonth(t.target.textContent||"")}> + ${this.getMonthName(this.viewingMonth)} ${this.getDateYear(this.viewingMonth)} +
+ + ${this.singleMonthView?Pu``:Pu`
`} +
+
${zd.map((t=>Pu`
${t}
`))}
+
+ ${Array.from({length:42}).map(((t,e)=>{const i=this.getDateFromIndex(this.viewingMonth,0,e),n=this.getDateMode(i,e);return Pu` +
this.handleDateClick(i)} @mouseover=${()=>this.handleDateHover(i)}> + ${i.getDate()} +
+ `}))} +
+
+ ${this.singleMonthView?"":Pu` +
+
+
+
this.setViewingMonth(t.target.textContent||"",-1)}> + ${this.getMonthName(this.viewingMonth,1)} ${this.getDateYear(this.viewingMonth,1)} +
+ +
+
${zd.map((t=>Pu`
${t}
`))}
+
+ ${Array.from({length:42}).map(((t,e)=>{const i=this.getDateFromIndex(this.viewingMonth,1,e),n=this.getDateMode(i,e,1);return Pu` +
this.handleDateClick(i)} + @mouseover=${()=>this.handleDateHover(i)} + > + ${i.getDate()} +
+ `}))} +
+
+ `} +
+ + ${this.singleMonthView?"":Pu` + +
+ `} + + `}getDateMode(t,e,i=0){const n=this.getMonthsStartingDay(this.viewingMonth,i),r=this.getNumberOfDaysInMonth(this.viewingMonth,i);return e=r+n?"out-of-range":this.isDateEqual(t,this.startDate)?this.singleMonthView?"selected-start-node selected-end-node":"selected-start-node":this.isDateEqual(t,this.endDate)?"selected-end-node":!this.singleMonthView&&this.startDate&&t>=this.startDate&&this.endDate&&t<=this.endDate||!this.singleMonthView&&this.startDate&&!this.endDate&&this.hoveringDate&&t<=this.hoveringDate&&t>this.startDate?"selected":"enabled"}setViewingMonth(t,e=0){const i=new Date(t);i.setMonth(i.getMonth()+e),this.viewingMonth=i}};$d.styles=Xc` + .top-section { + display: flex; + flex-direction: row; + gap: 0.625rem; /* gap-2.5 */ + } + + .date-range-picker { + font-family: 'Inter', sans-serif; + font-size: 12px; + display: inline-block; + flex-direction: column; + gap: 0.625rem; /* gap-2.5 */ + border-radius: 0.75rem; /* rounded-xl */ + background-color: #f5f5f5; /* bg-neutral-100 */ + padding: 1rem; /* p-4 */ + color: #1a1a1a; /* dark:bg-neutral-900 */ + user-select: none; /* select-none */ + max-width: 400px; + } + + .month-header > button { + cursor: pointer; + border-radius: 0.25rem; /* rounded */ + background-color: rgba(209, 213, 219, 0.85); /* bg-neutral-300/85 */ + padding: 0.375rem; /* p-1.5 */ + transition: background-color 0.2s; + width: 28px; + height: 28px; + } + + .month-header > button:hover { + background-color: #d1d5db; /* hover:bg-neutral-300 */ + } + + @media (prefers-color-scheme: dark) { + .month-header > button { + background-color: rgba(55, 65, 81, 0.85); /* dark:bg-neutral-700/85 */ + } + + .month-header > button:hover { + background-color: #374151; /* hover:dark:bg-neutral-700 */ + } + } + + .month-container { + display: flex; + flex-direction: column; + gap: 1rem; /* gap-4 */ + position: relative; /* relative */ + width: 194px; /* w-[196px] */ + } + + .month-header { + display: flex; + justify-content: space-between; + align-items: center; + } + + .month-header button { + cursor: pointer; /* cursor-pointer */ + border-radius: 0.25rem; /* rounded */ + background-color: rgba(209, 213, 219, 0.85); /* bg-neutral-300/85 */ + padding: 0.375rem; /* p-1.5 */ + transition: background-color 0.2s; + border: none; + } + + .month-header button:hover { + background-color: #d1d5db; /* hover:bg-neutral-300 */ + } + + .month-header div[contenteditable] { + padding: 0.375rem; /* py-1.5 */ + text-align: center; /* text-center */ + font-size: 12px; /* text-sm */ + font-weight: 600; /* font-semibold */ + border-radius: 0.375rem; /* rounded-md */ + color: #111827; /* text-neutral-900 */ + transition: background-color 0.2s; + } + + .month-header div[contenteditable]:hover { + background-color: rgba(209, 213, 219, 0.1); /* hover:dark:bg-neutral-300/10 */ + } + + .days-of-week { + display: grid; + grid-template-columns: repeat(7, minmax(0, 1fr)); /* grid-cols-7 */ + gap: 0.25rem; /* gap-1 */ + } + + .days-of-week div { + text-align: center; /* text-center */ + font-size: 12px; /* text-sm */ + color: #6b7280; /* text-neutral-500 */ + } + + .days { + display: grid; + grid-template-columns: repeat(7, minmax(0, 1fr)); /* grid-cols-7 */ + gap: 0.125rem; /* gap-y-0.5 */ + } + + .day-cell { + height: 26px; /* h-[26px] */ + width: 1.75rem; /* w-7 */ + text-align: center; /* text-center */ + font-size: 12px; /* text-sm */ + line-height: 26px; /* leading-[26px] */ + cursor: pointer; /* cursor-pointer */ + transition: + background-color 0.05s, + color 0.05s; /* transition-all duration-[50] */ + } + + .day-cell.out-of-range { + background-color: transparent; /* bg-transparent */ + color: #d1d5db; /* !text-neutral-300 */ + } + + .day-cell.enabled:hover { + background-color: #d1d5db; /* hover:bg-neutral-300 */ + color: #111827; /* text-neutral-900 */ + } + + .day-cell.selected-start-node { + background-color: #0a0a0a; /* !bg-neutral-950 */ + border-top-left-radius: 5px; /* rounded-tl-[5px] */ + border-bottom-left-radius: 5px; /* rounded-bl-[5px] */ + color: #e5e7eb; /* !text-neutral-200 */ + } + + .day-cell.selected-end-node { + background-color: #0a0a0a; /* !bg-neutral-950 */ + border-top-right-radius: 5px; /* rounded-tr-[5px] */ + border-bottom-right-radius: 5px; /* rounded-br-[5px] */ + color: #e5e7eb; /* !text-neutral-200 */ + } + + .day-cell.selected { + background-color: #d1d5db; /* bg-neutral-300 */ + color: #111827; /* text-neutral-900 */ + } + + .day-cell.selected-out-of-range { + background-color: #e5e7eb; /* bg-neutral-200 */ + color: #d1d5db; /* !text-neutral-300 */ + } + + .footer { + display: flex; + align-items: center; + gap: 0.5rem; /* gap-2 */ + font-size: 12px; /* text-sm */ + color: #374151; /* text-neutral-700 */ + } + + .footer span { + flex: 1; /* flex-1 */ + } + + .footer button { + cursor: pointer; /* cursor-pointer */ + font-weight: 600; /* font-semibold */ + text-decoration: underline; /* underline */ + text-underline-offset: 2px; /* underline-offset-2 */ + color: #111827; /* text-neutral-800 */ + transition: color 0.2s; + background: transparent; + border: none; + } + + .footer button:hover { + color: #1f2937; /* dark:text-neutral-200 */ + } + `,Bd([nd({type:Boolean,attribute:"single-month-view"})],$d.prototype,"singleMonthView",void 0),Bd([rd()],$d.prototype,"startDate",void 0),Bd([rd()],$d.prototype,"endDate",void 0),Bd([rd()],$d.prototype,"viewingMonth",void 0),Bd([rd()],$d.prototype,"hoveringDate",void 0),$d=Bd([td("astra-calendar")],$d);var Fd,Vd=$d,Hd=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s};!function(t){t.base="base",t.small="small",t.compact="compact"}(Fd||(Fd={}));let Wd=class extends Ju{constructor(){super(...arguments),this.size=Fd.base}render(){return Pu` +
+ +
+ `}};Wd.styles=[Pd,Xc` + section { + display: flex; + flex-direction: column; + gap: 8px; + font-weight: 500; + font-family: var(--astra-font-family); + color: black; + background: var(--astra-neutral-100); + border: 1px solid var(--astra-neutral-200); + border-radius: 6px; + } + + .size-base { + padding: 12px; + gap: 8px; + } + + .size-small { + padding: 8px; + gap: 4px; + } + + .size-compact { + padding: 4px; + gap: 2px; + } + + @media (prefers-color-scheme: dark) { + div { + background: var(--astra-neutral-900); + border: 1px solid var(--astra-neutral-800); + color: white; + } + } + `],Hd([nd({type:String})],Wd.prototype,"size",void 0),Wd=Hd([td("astra-card")],Wd);var Ud,jd,Gd,qd,Yd,Xd,Kd=Wd;class Zd extends Event{constructor(t){super(t,{bubbles:!0,composed:!0})}}class Jd extends Zd{constructor(t){super("cell-updated"),this.detail=t}}class Qd extends Zd{constructor(t){super("cell-blurred"),this.detail=t}}class tp extends Zd{constructor(t,{data:e,name:i}){super(t),this.name=i,this.data=e}}class ep extends Zd{constructor(t,e){super(t),this.plugin=e}}class ip extends tp{constructor(t){super("column-added",t)}}class np extends tp{constructor(t){super("column-renamed",t)}}class rp extends tp{constructor(t){super("column-removed",t)}}class op extends tp{constructor(t){super("column-hidden",t)}}class sp extends ep{constructor(t,e){super("column-plugin-activated",e),this.column=t}}class ap extends Zd{constructor(t,e){super("column-plugin-deactivated"),this.column=t,this.installation=e}}class lp extends tp{constructor(t){super("column-updated",t)}}class hp extends tp{constructor(t){super("column-pinned",t)}}class cp extends Zd{constructor(t,e){super(t),this.rows=e}}class up extends cp{constructor(t){super("row-added",[t])}}class dp extends cp{constructor(t){super("row-removed",t)}}class pp extends cp{constructor(t){super("row-selected",t)}}class fp extends Zd{constructor(t){super("menu-selection"),this.value=t}}class gp extends Zd{constructor(t){super("resize-start"),this.name=t}}class mp extends Zd{constructor(t,e){super("resize-end"),this.name=t,this.delta=e}}class vp extends Zd{constructor(t,e){super("resize"),this.name=t,this.delta=e}}class yp extends Zd{constructor(){super("toggle-check")}}!function(t){t.horizontal="horizontal",t.vertical="vertical",t.both="both"}(Ud||(Ud={})),function(t){t[t.created=0]="created",t[t.updated=1]="updated",t[t.deleted=2]="deleted"}(jd||(jd={})),function(t){t.REAL="REAL",t.INTEGER="INTEGER",t.INT="INT",t.TEXT="TEXT",t.JSON="JSON",t.SMALLINT="SMALLINT",t.BIGINT="BIGINT",t.DECIMAL="DECIMAL",t.NUMERIC="NUMERIC",t.DOUBLE_PRECISION="DOUBLE PRECISION",t.SERIAL="SERIAL",t.BIGSERIAL="BIGSERIAL",t.MONEY="MONEY",t.CHAR="CHAR",t.VARCHAR="VARCHAR",t.BYTEA="BYTEA",t.TIMESTAMP="TIMESTAMP",t.TIMESTAMP_WITH_TIME_ZONE="TIMESTAMP WITH TIME ZONE",t.DATE="DATE",t.DATETIME="DATETIME",t.TIME="TIME",t.TIME_WITH_TIME_ZONE="TIME WITH TIME ZONE",t.INTERVAL="INTERVAL",t.BOOLEAN="BOOLEAN",t.ENUM="ENUM",t.POINT="POINT",t.LINE="LINE",t.LSEG="LSEG",t.BOX="BOX",t.PATH="PATH",t.POLYGON="POLYGON",t.CIRCLE="CIRCLE",t.CIDR="CIDR",t.INET="INET",t.MACADDR="MACADDR",t.MACADDR8="MACADDR8",t.JSONB="JSONB",t.UUID="UUID",t.XML="XML",t.TSVECTOR="TSVECTOR",t.TSQUERY="TSQUERY",t.VARYING="CHARACTER VARYING"}(Gd||(Gd={})),function(t){t.onEdit="onedit",t.onStopEdit="onstopedit",t.onCancelEdit="oncanceledit",t.onSave="onsave",t.updateCell="updatecell",t.updateRow="updaterow",t.createRow="createrow",t.deleteRow="deleterow",t.getNextPage="getnextpage",t.getPreviousPage="getpreviouspage",t.configurePlugin="configure_plugin",t.installPlugin="install_plugin",t.ephemeralPluginInstall="ephemeral_install_plugin",t.uninstallPlugin="uninstall_plugin",t.sortColumn="sort_column",t.hideColumn="hide_column",t.deleteColumn="delete_column",t.createColumn="create_column",t.updateColumn="update_column",t.createIndex="create_index",t.updateIndex="update_index",t.deleteIndex="delete_index",t.pageNext="page_next",t.cellValue="cellvalue"}(qd||(qd={})),function(t){t.ForeignKey="FOREIGN KEY",t.PrimaryKey="PRIMARY KEY"}(Yd||(Yd={})),function(t){t.enum="enum",t.sql="sql",t.search="search"}(Xd||(Xd={}));const bp={neonPunk:{background:"linear-gradient(145deg, #1e0338 0%, #4a0d67 100%)",colors:{light:["#ff2e6e","#8c54ff"],dark:["#ff2e6e","#8c54ff"]}},cyberGlow:{background:"linear-gradient(145deg, #16213e 0%, #1a1a2e 100%)",colors:{light:["#ffa726","#ff5722"],dark:["#ffa726","#ff5722"]}},neoTokyo:{background:"linear-gradient(145deg, #2d0a31 0%, #440a44 100%)",colors:{light:["#ff71ce","#01cdfe"],dark:["#ff71ce","#01cdfe"]}},synthwave:{background:"linear-gradient(145deg, #2b1055 0%, #7597de 100%)",colors:{light:["#ff2a6d","#05d9e8"],dark:["#ff2a6d","#05d9e8"]}},vaporwave:{background:"linear-gradient(145deg, #391f5e 0%, #6b3fa0 100%)",colors:{light:["#ff71ce","#b967ff"],dark:["#ff71ce","#b967ff"]}},iridium:{background:"linear-gradient(145deg, #0b4f3b 0%, #69b765 100%)",colors:{light:["#87E9C0","#B9D975","#C9D69B"],dark:["#87E9C0","#B9D975","#C9D69B"]}},celestial:{background:"linear-gradient(145deg, #004b6b 0%, #1de2ff 100%)",colors:{light:["#D1FFFF","#93FDFF","#1A9EF5"],dark:["#D1FFFF","#93FDFF","#1A9EF5"]}},cobalt:{background:"linear-gradient(145deg, #2b256e 0%, #6b82ff 100%)",colors:{light:["#5956E2","#A99AFF","#82DBFF"],dark:["#5956E2","#A99AFF","#82DBFF"]}},afterburn:{background:"linear-gradient(145deg, #731d39 0%, #e47096 100%)",colors:{light:["#E75F98","#FFA285","#CCB8F2"],dark:["#E75F98","#FFA285","#CCB8F2"]}},mercury:{background:"linear-gradient(145deg, #262626 0%, #a3a3a3 100%)",colors:{light:["#0a0a0a","#a3a3a3","#525252","#262626","#e5e5e5"],dark:["#fafafa","#525252","#a3a3a3","#e5e5e5","#262626"]}}},wp=Xc` /* THIS FILE IS GENERATED; DO NOT EDIT. */ /* this file yields the Tailwind classes that are used in the codebase */ + +*, ::before, ::after { + --tw-border-spacing-x: 0; + --tw-border-spacing-y: 0; + --tw-translate-x: 0; + --tw-translate-y: 0; + --tw-rotate: 0; + --tw-skew-x: 0; + --tw-skew-y: 0; + --tw-scale-x: 1; + --tw-scale-y: 1; + --tw-pan-x: ; + --tw-pan-y: ; + --tw-pinch-zoom: ; + --tw-scroll-snap-strictness: proximity; + --tw-gradient-from-position: ; + --tw-gradient-via-position: ; + --tw-gradient-to-position: ; + --tw-ordinal: ; + --tw-slashed-zero: ; + --tw-numeric-figure: ; + --tw-numeric-spacing: ; + --tw-numeric-fraction: ; + --tw-ring-inset: ; + --tw-ring-offset-width: 0px; + --tw-ring-offset-color: #fff; + --tw-ring-color: rgb(59 130 246 / 0.5); + --tw-ring-offset-shadow: 0 0 #0000; + --tw-ring-shadow: 0 0 #0000; + --tw-shadow: 0 0 #0000; + --tw-shadow-colored: 0 0 #0000; + --tw-blur: ; + --tw-brightness: ; + --tw-contrast: ; + --tw-grayscale: ; + --tw-hue-rotate: ; + --tw-invert: ; + --tw-saturate: ; + --tw-sepia: ; + --tw-drop-shadow: ; + --tw-backdrop-blur: ; + --tw-backdrop-brightness: ; + --tw-backdrop-contrast: ; + --tw-backdrop-grayscale: ; + --tw-backdrop-hue-rotate: ; + --tw-backdrop-invert: ; + --tw-backdrop-opacity: ; + --tw-backdrop-saturate: ; + --tw-backdrop-sepia: ; + --tw-contain-size: ; + --tw-contain-layout: ; + --tw-contain-paint: ; + --tw-contain-style: ; +} + +::backdrop { + --tw-border-spacing-x: 0; + --tw-border-spacing-y: 0; + --tw-translate-x: 0; + --tw-translate-y: 0; + --tw-rotate: 0; + --tw-skew-x: 0; + --tw-skew-y: 0; + --tw-scale-x: 1; + --tw-scale-y: 1; + --tw-pan-x: ; + --tw-pan-y: ; + --tw-pinch-zoom: ; + --tw-scroll-snap-strictness: proximity; + --tw-gradient-from-position: ; + --tw-gradient-via-position: ; + --tw-gradient-to-position: ; + --tw-ordinal: ; + --tw-slashed-zero: ; + --tw-numeric-figure: ; + --tw-numeric-spacing: ; + --tw-numeric-fraction: ; + --tw-ring-inset: ; + --tw-ring-offset-width: 0px; + --tw-ring-offset-color: #fff; + --tw-ring-color: rgb(59 130 246 / 0.5); + --tw-ring-offset-shadow: 0 0 #0000; + --tw-ring-shadow: 0 0 #0000; + --tw-shadow: 0 0 #0000; + --tw-shadow-colored: 0 0 #0000; + --tw-blur: ; + --tw-brightness: ; + --tw-contrast: ; + --tw-grayscale: ; + --tw-hue-rotate: ; + --tw-invert: ; + --tw-saturate: ; + --tw-sepia: ; + --tw-drop-shadow: ; + --tw-backdrop-blur: ; + --tw-backdrop-brightness: ; + --tw-backdrop-contrast: ; + --tw-backdrop-grayscale: ; + --tw-backdrop-hue-rotate: ; + --tw-backdrop-invert: ; + --tw-backdrop-opacity: ; + --tw-backdrop-saturate: ; + --tw-backdrop-sepia: ; + --tw-contain-size: ; + --tw-contain-layout: ; + --tw-contain-paint: ; + --tw-contain-style: ; +} + +/* ! tailwindcss v3.4.16 | MIT License | https://tailwindcss.com */ + +/* +1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4) +2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116) +*/ + +*, +::before, +::after { + box-sizing: border-box; + /* 1 */ + border-width: 0; + /* 2 */ + border-style: solid; + /* 2 */ + border-color: #e5e7eb; + /* 2 */ +} + +::before, +::after { + --tw-content: ''; +} + +/* +1. Use a consistent sensible line-height in all browsers. +2. Prevent adjustments of font size after orientation changes in iOS. +3. Use a more readable tab size. +4. Use the user's configured sans font-family by default. +5. Use the user's configured sans font-feature-settings by default. +6. Use the user's configured sans font-variation-settings by default. +7. Disable tap highlights on iOS +*/ + +html, +:host { + line-height: 1.5; + /* 1 */ + -webkit-text-size-adjust: 100%; + /* 2 */ + -moz-tab-size: 4; + /* 3 */ + -o-tab-size: 4; + tab-size: 4; + /* 3 */ + font-family: Inter, Helvetica, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; + /* 4 */ + font-feature-settings: normal; + /* 5 */ + font-variation-settings: normal; + /* 6 */ + -webkit-tap-highlight-color: transparent; + /* 7 */ +} + +/* +1. Remove the margin in all browsers. +2. Inherit line-height from html so users can set them as a class directly on the html element. +*/ + +body { + margin: 0; + /* 1 */ + line-height: inherit; + /* 2 */ +} + +/* +1. Add the correct height in Firefox. +2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655) +3. Ensure horizontal rules are visible by default. +*/ + +hr { + height: 0; + /* 1 */ + color: inherit; + /* 2 */ + border-top-width: 1px; + /* 3 */ +} + +/* +Add the correct text decoration in Chrome, Edge, and Safari. +*/ + +abbr:where([title]) { + -webkit-text-decoration: underline dotted; + text-decoration: underline dotted; +} + +/* +Remove the default font size and weight for headings. +*/ + +h1, +h2, +h3, +h4, +h5, +h6 { + font-size: inherit; + font-weight: inherit; +} + +/* +Reset links to optimize for opt-in styling instead of opt-out. +*/ + +a { + color: inherit; + text-decoration: inherit; +} + +/* +Add the correct font weight in Edge and Safari. +*/ + +b, +strong { + font-weight: bolder; +} + +/* +1. Use the user's configured mono font-family by default. +2. Use the user's configured mono font-feature-settings by default. +3. Use the user's configured mono font-variation-settings by default. +4. Correct the odd em font sizing in all browsers. +*/ + +code, +kbd, +samp, +pre { + font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; + /* 1 */ + font-feature-settings: normal; + /* 2 */ + font-variation-settings: normal; + /* 3 */ + font-size: 1em; + /* 4 */ +} + +/* +Add the correct font size in all browsers. +*/ + +small { + font-size: 80%; +} + +/* +Prevent sub and sup elements from affecting the line height in all browsers. +*/ + +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sub { + bottom: -0.25em; +} + +sup { + top: -0.5em; +} + +/* +1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297) +2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016) +3. Remove gaps between table borders by default. +*/ + +table { + text-indent: 0; + /* 1 */ + border-color: inherit; + /* 2 */ + border-collapse: collapse; + /* 3 */ +} + +/* +1. Change the font styles in all browsers. +2. Remove the margin in Firefox and Safari. +3. Remove default padding in all browsers. +*/ + +button, +input, +optgroup, +select, +textarea { + font-family: inherit; + /* 1 */ + font-feature-settings: inherit; + /* 1 */ + font-variation-settings: inherit; + /* 1 */ + font-size: 100%; + /* 1 */ + font-weight: inherit; + /* 1 */ + line-height: inherit; + /* 1 */ + letter-spacing: inherit; + /* 1 */ + color: inherit; + /* 1 */ + margin: 0; + /* 2 */ + padding: 0; + /* 3 */ +} + +/* +Remove the inheritance of text transform in Edge and Firefox. +*/ + +button, +select { + text-transform: none; +} + +/* +1. Correct the inability to style clickable types in iOS and Safari. +2. Remove default button styles. +*/ + +button, +input:where([type='button']), +input:where([type='reset']), +input:where([type='submit']) { + -webkit-appearance: button; + /* 1 */ + background-color: transparent; + /* 2 */ + background-image: none; + /* 2 */ +} + +/* +Use the modern Firefox focus style for all focusable elements. +*/ + +:-moz-focusring { + outline: auto; +} + +/* +Remove the additional :invalid styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737) +*/ + +:-moz-ui-invalid { + box-shadow: none; +} + +/* +Add the correct vertical alignment in Chrome and Firefox. +*/ + +progress { + vertical-align: baseline; +} + +/* +Correct the cursor style of increment and decrement buttons in Safari. +*/ + +::-webkit-inner-spin-button, +::-webkit-outer-spin-button { + height: auto; +} + +/* +1. Correct the odd appearance in Chrome and Safari. +2. Correct the outline style in Safari. +*/ + +[type='search'] { + -webkit-appearance: textfield; + /* 1 */ + outline-offset: -2px; + /* 2 */ +} + +/* +Remove the inner padding in Chrome and Safari on macOS. +*/ + +::-webkit-search-decoration { + -webkit-appearance: none; +} + +/* +1. Correct the inability to style clickable types in iOS and Safari. +2. Change font properties to inherit in Safari. +*/ + +::-webkit-file-upload-button { + -webkit-appearance: button; + /* 1 */ + font: inherit; + /* 2 */ +} + +/* +Add the correct display in Chrome and Safari. +*/ + +summary { + display: list-item; +} + +/* +Removes the default spacing and border for appropriate elements. +*/ + +blockquote, +dl, +dd, +h1, +h2, +h3, +h4, +h5, +h6, +hr, +figure, +p, +pre { + margin: 0; +} + +fieldset { + margin: 0; + padding: 0; +} + +legend { + padding: 0; +} + +ol, +ul, +menu { + list-style: none; + margin: 0; + padding: 0; +} + +/* +Reset default styling for dialogs. +*/ + +dialog { + padding: 0; +} + +/* +Prevent resizing textareas horizontally by default. +*/ + +textarea { + resize: vertical; +} + +/* +1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300) +2. Set the default placeholder color to the user's configured gray 400 color. +*/ + +input::-moz-placeholder, textarea::-moz-placeholder { + opacity: 1; + /* 1 */ + color: #9ca3af; + /* 2 */ +} + +input::placeholder, +textarea::placeholder { + opacity: 1; + /* 1 */ + color: #9ca3af; + /* 2 */ +} + +/* +Set the default cursor for buttons. +*/ + +button, +[role="button"] { + cursor: pointer; +} + +/* +Make sure disabled buttons don't get the pointer cursor. +*/ + +:disabled { + cursor: default; +} + +/* +1. Make replaced elements display: block by default. (https://github.com/mozdevs/cssremedy/issues/14) +2. Add vertical-align: middle to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210) + This can trigger a poorly considered lint error in some tools but is included by design. +*/ + +img, +svg, +video, +canvas, +audio, +iframe, +embed, +object { + display: block; + /* 1 */ + vertical-align: middle; + /* 2 */ +} + +/* +Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14) +*/ + +img, +video { + max-width: 100%; + height: auto; +} + +/* Make elements with the HTML hidden attribute stay hidden by default */ + +[hidden]:where(:not([hidden="until-found"])) { + display: none; +} + +.pointer-events-none { + pointer-events: none; +} + +.visible { + visibility: visible; +} + +.invisible { + visibility: hidden; +} + +.collapse { + visibility: collapse; +} + +.static { + position: static; +} + +.fixed { + position: fixed; +} + +.absolute { + position: absolute; +} + +.relative { + position: relative; +} + +.sticky { + position: sticky; +} + +.-right-\\[7px\\] { + right: -7px; +} + +.bottom-0 { + bottom: 0px; +} + +.left-0 { + left: 0px; +} + +.left-\\[100\\%\\] { + left: 100%; +} + +.right-0 { + right: 0px; +} + +.right-1 { + right: 0.25rem; +} + +.top-0 { + top: 0px; +} + +.top-8 { + top: 2rem; +} + +.top-\\[36px\\] { + top: 36px; +} + +.z-0 { + z-index: 0; +} + +.z-10 { + z-index: 10; +} + +.z-50 { + z-index: 50; +} + +.z-\\[1000\\] { + z-index: 1000; +} + +.z-\\[19\\] { + z-index: 19; +} + +.z-\\[1\\] { + z-index: 1; +} + +.z-\\[2\\] { + z-index: 2; +} + +.m-0\\.5 { + margin: 0.125rem; +} + +.m-1 { + margin: 0.25rem; +} + +.m-0 { + margin: 0px; +} + +.mx-auto { + margin-left: auto; + margin-right: auto; +} + +.my-1 { + margin-top: 0.25rem; + margin-bottom: 0.25rem; +} + +.mb-2 { + margin-bottom: 0.5rem; +} + +.mb-4 { + margin-bottom: 1rem; +} + +.ml-1 { + margin-left: 0.25rem; +} + +.ml-12 { + margin-left: 3rem; +} + +.ml-\\[1px\\] { + margin-left: 1px; +} + +.mt-4 { + margin-top: 1rem; +} + +.mt-8 { + margin-top: 2rem; +} + +.line-clamp-1 { + overflow: hidden; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 1; +} + +.block { + display: block; +} + +.inline-block { + display: inline-block; +} + +.flex { + display: flex; +} + +.table { + display: table; +} + +.table-cell { + display: table-cell; +} + +.table-header-group { + display: table-header-group; +} + +.table-row-group { + display: table-row-group; +} + +.grid { + display: grid; +} + +.contents { + display: contents; +} + +.hidden { + display: none; +} + +.h-1\\.5 { + height: 0.375rem; +} + +.h-1\\/3 { + height: 33.333333%; +} + +.h-10 { + height: 2.5rem; +} + +.h-12 { + height: 3rem; +} + +.h-4 { + height: 1rem; +} + +.h-8 { + height: 2rem; +} + +.h-\\[26px\\] { + height: 26px; +} + +.h-\\[34px\\] { + height: 34px; +} + +.h-full { + height: 100%; +} + +.h-screen { + height: 100vh; +} + +.h-1 { + height: 0.25rem; +} + +.h-fit { + height: -moz-fit-content; + height: fit-content; +} + +.w-1\\.5 { + width: 0.375rem; +} + +.w-32 { + width: 8rem; +} + +.w-4 { + width: 1rem; +} + +.w-40 { + width: 10rem; +} + +.w-48 { + width: 12rem; +} + +.w-64 { + width: 16rem; +} + +.w-7 { + width: 1.75rem; +} + +.w-72 { + width: 18rem; +} + +.w-8 { + width: 2rem; +} + +.w-\\[120px\\] { + width: 120px; +} + +.w-\\[196px\\] { + width: 196px; +} + +.w-\\[1px\\] { + width: 1px; +} + +.w-full { + width: 100%; +} + +.w-1 { + width: 0.25rem; +} + +.min-w-\\[256px\\] { + min-width: 256px; +} + +.min-w-fit { + min-width: -moz-fit-content; + min-width: fit-content; +} + +.max-w-3xl { + max-width: 48rem; +} + +.max-w-64 { + max-width: 16rem; +} + +.flex-1 { + flex: 1 1 0%; +} + +.flex-auto { + flex: 1 1 auto; +} + +.flex-none { + flex: none; +} + +.flex-grow { + flex-grow: 1; +} + +.border-collapse { + border-collapse: collapse; +} + +.transform { + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); +} + +.cursor-auto { + cursor: auto; +} + +.cursor-col-resize { + cursor: col-resize; +} + +.cursor-default { + cursor: default; +} + +.cursor-not-allowed { + cursor: not-allowed; +} + +.cursor-pointer { + cursor: pointer; +} + +.cursor-text { + cursor: text; +} + +.select-none { + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; +} + +.resize-none { + resize: none; +} + +.resize { + resize: both; +} + +.grid-cols-1 { + grid-template-columns: repeat(1, minmax(0, 1fr)); +} + +.grid-cols-2 { + grid-template-columns: repeat(2, minmax(0, 1fr)); +} + +.grid-cols-7 { + grid-template-columns: repeat(7, minmax(0, 1fr)); +} + +.flex-row { + flex-direction: row; +} + +.flex-col { + flex-direction: column; +} + +.items-start { + align-items: flex-start; +} + +.items-center { + align-items: center; +} + +.justify-end { + justify-content: flex-end; +} + +.justify-center { + justify-content: center; +} + +.justify-between { + justify-content: space-between; +} + +.gap-1 { + gap: 0.25rem; +} + +.gap-10 { + gap: 2.5rem; +} + +.gap-2 { + gap: 0.5rem; +} + +.gap-2\\.5 { + gap: 0.625rem; +} + +.gap-3\\.5 { + gap: 0.875rem; +} + +.gap-4 { + gap: 1rem; +} + +.gap-8 { + gap: 2rem; +} + +.gap-3 { + gap: 0.75rem; +} + +.gap-y-0\\.5 { + row-gap: 0.125rem; +} + +.gap-y-0 { + row-gap: 0px; +} + +.space-y-2 > :not([hidden]) ~ :not([hidden]) { + --tw-space-y-reverse: 0; + margin-top: calc(0.5rem * calc(1 - var(--tw-space-y-reverse))); + margin-bottom: calc(0.5rem * var(--tw-space-y-reverse)); +} + +.self-start { + align-self: flex-start; +} + +.overflow-hidden { + overflow: hidden; +} + +.overflow-clip { + overflow: clip; +} + +.overflow-scroll { + overflow: scroll; +} + +.overflow-y-auto { + overflow-y: auto; +} + +.overflow-x-hidden { + overflow-x: hidden; +} + +.overflow-y-scroll { + overflow-y: scroll; +} + +.overscroll-contain { + overscroll-behavior: contain; +} + +.truncate { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.text-ellipsis { + text-overflow: ellipsis; +} + +.whitespace-nowrap { + white-space: nowrap; +} + +.whitespace-pre { + white-space: pre; +} + +.whitespace-break-spaces { + white-space: break-spaces; +} + +.text-wrap { + text-wrap: wrap; +} + +.rounded { + border-radius: 0.25rem; +} + +.rounded-lg { + border-radius: 0.5rem; +} + +.rounded-md { + border-radius: 0.375rem; +} + +.rounded-sm { + border-radius: 0.125rem; +} + +.rounded-xl { + border-radius: 0.75rem; +} + +.rounded-bl-\\[5px\\] { + border-bottom-left-radius: 5px; +} + +.rounded-br-\\[5px\\] { + border-bottom-right-radius: 5px; +} + +.rounded-tl-\\[5px\\] { + border-top-left-radius: 5px; +} + +.rounded-tr-\\[5px\\] { + border-top-right-radius: 5px; +} + +.border { + border-width: 1px; +} + +.border-4 { + border-width: 4px; +} + +.border-b { + border-bottom-width: 1px; +} + +.border-l { + border-left-width: 1px; +} + +.border-r { + border-right-width: 1px; +} + +.border-t { + border-top-width: 1px; +} + +.border-\\[\\#d4d4d4\\] { + --tw-border-opacity: 1; + border-color: rgb(212 212 212 / var(--tw-border-opacity, 1)); +} + +.border-neutral-200 { + --tw-border-opacity: 1; + border-color: rgb(229 229 229 / var(--tw-border-opacity, 1)); +} + +.border-neutral-300 { + --tw-border-opacity: 1; + border-color: rgb(212 212 212 / var(--tw-border-opacity, 1)); +} + +.border-neutral-400 { + --tw-border-opacity: 1; + border-color: rgb(163 163 163 / var(--tw-border-opacity, 1)); +} + +.border-neutral-500 { + --tw-border-opacity: 1; + border-color: rgb(115 115 115 / var(--tw-border-opacity, 1)); +} + +.border-neutral-600 { + --tw-border-opacity: 1; + border-color: rgb(82 82 82 / var(--tw-border-opacity, 1)); +} + +.border-neutral-800 { + --tw-border-opacity: 1; + border-color: rgb(38 38 38 / var(--tw-border-opacity, 1)); +} + +.border-theme-table-border { + border-color: var(--astra-table-border-color, #e5e7eb); +} + +.border-theme-table-border-dark { + border-color: var(--astra-table-border-color-dark, rgb(52,52,56)); +} + +.border-transparent { + border-color: transparent; +} + +.border-white { + --tw-border-opacity: 1; + border-color: rgb(255 255 255 / var(--tw-border-opacity, 1)); +} + +.border-zinc-500 { + --tw-border-opacity: 1; + border-color: rgb(113 113 122 / var(--tw-border-opacity, 1)); +} + +.border-opacity-5 { + --tw-border-opacity: 0.05; +} + +.\\!bg-neutral-950 { + --tw-bg-opacity: 1 !important; + background-color: rgb(10 10 10 / var(--tw-bg-opacity, 1)) !important; +} + +.bg-\\[\\#141b21\\] { + --tw-bg-opacity: 1; + background-color: rgb(20 27 33 / var(--tw-bg-opacity, 1)); +} + +.bg-black { + --tw-bg-opacity: 1; + background-color: rgb(0 0 0 / var(--tw-bg-opacity, 1)); +} + +.bg-blue-50 { + --tw-bg-opacity: 1; + background-color: rgb(239 246 255 / var(--tw-bg-opacity, 1)); +} + +.bg-green-400 { + --tw-bg-opacity: 1; + background-color: rgb(74 222 128 / var(--tw-bg-opacity, 1)); +} + +.bg-neutral-100 { + --tw-bg-opacity: 1; + background-color: rgb(245 245 245 / var(--tw-bg-opacity, 1)); +} + +.bg-neutral-200 { + --tw-bg-opacity: 1; + background-color: rgb(229 229 229 / var(--tw-bg-opacity, 1)); +} + +.bg-neutral-200\\/60 { + background-color: rgb(229 229 229 / 0.6); +} + +.bg-neutral-300 { + --tw-bg-opacity: 1; + background-color: rgb(212 212 212 / var(--tw-bg-opacity, 1)); +} + +.bg-neutral-300\\/30 { + background-color: rgb(212 212 212 / 0.3); +} + +.bg-neutral-300\\/85 { + background-color: rgb(212 212 212 / 0.85); +} + +.bg-neutral-50 { + --tw-bg-opacity: 1; + background-color: rgb(250 250 250 / var(--tw-bg-opacity, 1)); +} + +.bg-neutral-500\\/10 { + background-color: rgb(115 115 115 / 0.1); +} + +.bg-neutral-500\\/30 { + background-color: rgb(115 115 115 / 0.3); +} + +.bg-neutral-600 { + --tw-bg-opacity: 1; + background-color: rgb(82 82 82 / var(--tw-bg-opacity, 1)); +} + +.bg-neutral-900 { + --tw-bg-opacity: 1; + background-color: rgb(23 23 23 / var(--tw-bg-opacity, 1)); +} + +.bg-neutral-950 { + --tw-bg-opacity: 1; + background-color: rgb(10 10 10 / var(--tw-bg-opacity, 1)); +} + +.bg-red-100 { + --tw-bg-opacity: 1; + background-color: rgb(254 226 226 / var(--tw-bg-opacity, 1)); +} + +.bg-theme-menu-background-color { + background-color: var(--astra-menu-background-color, #fff); +} + +.bg-theme-menu-background-color-active { + background-color: var(--astra-menu-background-color-active, #000); +} + +.bg-theme-menu-background-color-active-dark { + background-color: var(--astra-menu-background-color-active-dark, #fff); +} + +.bg-theme-menu-toggle-color-active { + background-color: var(--astra-toggle-color-active, #f5f5f5); +} + +.bg-theme-menu-toggle-color-active-dark { + background-color: var(--astra-toggle-color-active-dark, #404040); +} + +.bg-theme-menu-toggle-color-hover { + background-color: var(--astra-toggle-color-hover, #fafafa); +} + +.bg-theme-menu-toggle-color-hover-dark { + background-color: var(--astra-toggle-color-hover-dark, #262626); +} + +.bg-theme-table { + background-color: var(--astra-table-background-color, rgba(255,255,255, 1)); +} + +.bg-theme-table-border { + background-color: var(--astra-table-border-color, #e5e7eb); +} + +.bg-theme-table-cell-dirty { + background-color: var(--astra-cell-dirty-background-color, rgb(253 230 138)); +} + +.bg-theme-table-cell-dirty-dark { + background-color: var(--astra-cell-dirty-background-color, rgba(234, 179, 8, .6)); +} + +.bg-theme-table-cell-mutating-background { + background-color: var(--astra-cell-mutating-background-color, rgb(239 246 255)); +} + +.bg-theme-table-column { + background-color: var(--astra-table-column-header-background-color, rgba(255,255,255,1)); +} + +.bg-theme-table-column-dark { + background-color: var(--astra-table-column-header-background-color-dark, rgba(0,0,0,1)); +} + +.bg-theme-table-row { + background-color: var(--astra-table-row-background-color, rgba(255,255,255, 1)); +} + +.bg-theme-table-row-dark { + background-color: var(--astra-table-row-background-color-dark, rgba(0, 0, 0, 1)); +} + +.bg-theme-table-row-hover-dark { + background-color: var(--astra-table-row-hover-background-color-dark, rgb(30,30,30)); +} + +.bg-theme-table-row-new { + background-color: var(--astra-table-row-new-background-color, #DDF0DF); +} + +.bg-theme-table-row-new-dark { + background-color: var(--astra-table-row-new-background-color-dark, #14532D); +} + +.bg-theme-table-row-selected { + background-color: var(--astra-table-row-selected-background-color, rgba(245, 245, 245, 1)); +} + +.bg-theme-table-row-selected-dark { + background-color: var(--astra-table-row-selected-background-color-dark, rgb(23, 23, 23)); +} + +.bg-transparent { + background-color: transparent; +} + +.bg-white { + --tw-bg-opacity: 1; + background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1)); +} + +.bg-white\\/40 { + background-color: rgb(255 255 255 / 0.4); +} + +.bg-zinc-200\\/60 { + background-color: rgb(228 228 231 / 0.6); +} + +.bg-blue-400 { + --tw-bg-opacity: 1; + background-color: rgb(96 165 250 / var(--tw-bg-opacity, 1)); +} + +.bg-blue-500 { + --tw-bg-opacity: 1; + background-color: rgb(59 130 246 / var(--tw-bg-opacity, 1)); +} + +.bg-neutral-500 { + --tw-bg-opacity: 1; + background-color: rgb(115 115 115 / var(--tw-bg-opacity, 1)); +} + +.bg-neutral-700 { + --tw-bg-opacity: 1; + background-color: rgb(64 64 64 / var(--tw-bg-opacity, 1)); +} + +.bg-red-500 { + --tw-bg-opacity: 1; + background-color: rgb(239 68 68 / var(--tw-bg-opacity, 1)); +} + +.bg-zinc-200 { + --tw-bg-opacity: 1; + background-color: rgb(228 228 231 / var(--tw-bg-opacity, 1)); +} + +.bg-opacity-5 { + --tw-bg-opacity: 0.05; +} + +.p-0\\.5 { + padding: 0.125rem; +} + +.p-1\\.5 { + padding: 0.375rem; +} + +.p-10 { + padding: 2.5rem; +} + +.p-2 { + padding: 0.5rem; +} + +.p-2\\.5 { + padding: 0.625rem; +} + +.p-3\\.5 { + padding: 0.875rem; +} + +.p-4 { + padding: 1rem; +} + +.p-40 { + padding: 10rem; +} + +.p-5 { + padding: 1.25rem; +} + +.p-0 { + padding: 0px; +} + +.p-1 { + padding: 0.25rem; +} + +.p-3 { + padding: 0.75rem; +} + +.px-2 { + padding-left: 0.5rem; + padding-right: 0.5rem; +} + +.px-3 { + padding-left: 0.75rem; + padding-right: 0.75rem; +} + +.px-5 { + padding-left: 1.25rem; + padding-right: 1.25rem; +} + +.px-cell-padding-x { + padding-left: var(--astra-cell-padding-x, 12px); + padding-right: var(--astra-cell-padding-x, 12px); +} + +.py-1\\.5 { + padding-top: 0.375rem; + padding-bottom: 0.375rem; +} + +.py-2 { + padding-top: 0.5rem; + padding-bottom: 0.5rem; +} + +.py-cell-padding-y { + padding-top: var(--astra-cell-padding-y, 8px); + padding-bottom: var(--astra-cell-padding-y, 8px); +} + +.py-1 { + padding-top: 0.25rem; + padding-bottom: 0.25rem; +} + +.pl-7 { + padding-left: 1.75rem; +} + +.pr-2 { + padding-right: 0.5rem; +} + +.pt-12 { + padding-top: 3rem; +} + +.pt-20 { + padding-top: 5rem; +} + +.pt-\\[3px\\] { + padding-top: 3px; +} + +.text-center { + text-align: center; +} + +.text-right { + text-align: right; +} + +.align-middle { + vertical-align: middle; +} + +.font-mono { + font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; +} + +.font-table { + font-family: var(--astra-font-family, Inter), sans-serif; +} + +.text-4xl { + font-size: 2.25rem; + line-height: 2.5rem; +} + +.text-\\[8px\\] { + font-size: 8px; +} + +.text-sm { + font-size: 12px; + line-height: 18px; +} + +.text-xl { + font-size: 20px; + line-height: 28px; +} + +.text-xs { + font-size: 0.75rem; + line-height: 1rem; +} + +.font-bold { + font-weight: 700; +} + +.font-medium { + font-weight: 500; +} + +.font-semibold { + font-weight: 600; +} + +.capitalize { + text-transform: capitalize; +} + +.italic { + font-style: italic; +} + +.leading-\\[26px\\] { + line-height: 26px; +} + +.leading-\\[9\\.6px\\] { + line-height: 9.6px; +} + +.leading-none { + line-height: 1; +} + +.\\!text-neutral-200 { + --tw-text-opacity: 1 !important; + color: rgb(229 229 229 / var(--tw-text-opacity, 1)) !important; +} + +.\\!text-neutral-300 { + --tw-text-opacity: 1 !important; + color: rgb(212 212 212 / var(--tw-text-opacity, 1)) !important; +} + +.text-black { + --tw-text-opacity: 1; + color: rgb(0 0 0 / var(--tw-text-opacity, 1)); +} + +.text-neutral-400 { + --tw-text-opacity: 1; + color: rgb(163 163 163 / var(--tw-text-opacity, 1)); +} + +.text-neutral-50 { + --tw-text-opacity: 1; + color: rgb(250 250 250 / var(--tw-text-opacity, 1)); +} + +.text-neutral-500 { + --tw-text-opacity: 1; + color: rgb(115 115 115 / var(--tw-text-opacity, 1)); +} + +.text-neutral-600 { + --tw-text-opacity: 1; + color: rgb(82 82 82 / var(--tw-text-opacity, 1)); +} + +.text-neutral-700 { + --tw-text-opacity: 1; + color: rgb(64 64 64 / var(--tw-text-opacity, 1)); +} + +.text-neutral-800 { + --tw-text-opacity: 1; + color: rgb(38 38 38 / var(--tw-text-opacity, 1)); +} + +.text-neutral-900 { + --tw-text-opacity: 1; + color: rgb(23 23 23 / var(--tw-text-opacity, 1)); +} + +.text-neutral-950 { + --tw-text-opacity: 1; + color: rgb(10 10 10 / var(--tw-text-opacity, 1)); +} + +.text-red-500 { + --tw-text-opacity: 1; + color: rgb(239 68 68 / var(--tw-text-opacity, 1)); +} + +.text-theme-menu-content-color { + color: var(--astra-menu-content-color, #000); +} + +.text-theme-menu-content-color-active { + color: var(--astra-menu-content-color-active, #fff); +} + +.text-theme-menu-content-color-active-dark { + color: var(--astra-menu-content-color-active-dark, #000); +} + +.text-theme-secondary-content { + color: var(--astra-secondary-content-color, rgb(42, 42, 42)); +} + +.text-theme-sidebar-header-content { + color: var(--astra-header-content-color, #000000); +} + +.text-theme-sidebar-li-active { + color: var(--astra-sidebar-li-active-content-color, rgb(59 130 246)); +} + +.text-theme-sidebar-li-content { + color: var(--astra-sidebar-li-content-color, #000000); +} + +.text-theme-sidebar-li-content-dark { + color: var(--astra-sidebar-li-content-color-dark, #ffffff); +} + +.text-theme-sidebar-subheader-content { + color: var(--astra-sidebar-subheader-content-color, #eeeee); +} + +.text-theme-table-cell-mutating-content { + color: var(--astra-cell-mutating-content-color, rgb(0,0,0)); +} + +.text-theme-table-column-content { + color: var(--astra-table-column-header-content-color, #000000); +} + +.text-theme-table-column-content-dark { + color: var(--astra-table-column-header-content-color-dark, #ffffff); +} + +.text-theme-table-content { + color: var(--astra-table-content-color, #000000); +} + +.text-theme-table-content-dark { + color: var(--astra-table-content-color-dark, #ffffff); +} + +.text-transparent { + color: transparent; +} + +.text-white { + --tw-text-opacity: 1; + color: rgb(255 255 255 / var(--tw-text-opacity, 1)); +} + +.text-zinc-600 { + --tw-text-opacity: 1; + color: rgb(82 82 91 / var(--tw-text-opacity, 1)); +} + +.text-red-400 { + --tw-text-opacity: 1; + color: rgb(248 113 113 / var(--tw-text-opacity, 1)); +} + +.underline { + text-decoration-line: underline; +} + +.underline-offset-2 { + text-underline-offset: 2px; +} + +.antialiased { + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.placeholder-neutral-400::-moz-placeholder { + --tw-placeholder-opacity: 1; + color: rgb(163 163 163 / var(--tw-placeholder-opacity, 1)); +} + +.placeholder-neutral-400::placeholder { + --tw-placeholder-opacity: 1; + color: rgb(163 163 163 / var(--tw-placeholder-opacity, 1)); +} + +.placeholder-neutral-600::-moz-placeholder { + --tw-placeholder-opacity: 1; + color: rgb(82 82 82 / var(--tw-placeholder-opacity, 1)); +} + +.placeholder-neutral-600::placeholder { + --tw-placeholder-opacity: 1; + color: rgb(82 82 82 / var(--tw-placeholder-opacity, 1)); +} + +.caret-current { + caret-color: currentColor; +} + +.caret-transparent { + caret-color: transparent; +} + +.opacity-0 { + opacity: 0; +} + +.opacity-100 { + opacity: 1; +} + +.opacity-60 { + opacity: 0.6; +} + +.shadow { + --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1); + --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color); + box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); +} + +.shadow-\\[0_2px_8px_rgba\\(0\\2c 0\\2c 0\\2c 0\\.1\\)\\] { + --tw-shadow: 0 2px 8px rgba(0,0,0,0.1); + --tw-shadow-colored: 0 2px 8px var(--tw-shadow-color); + box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); +} + +.shadow-lg { + --tw-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); + --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color); + box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); +} + +.shadow-black\\/5 { + --tw-shadow-color: rgb(0 0 0 / 0.05); + --tw-shadow: var(--tw-shadow-colored); +} + +.shadow-black { + --tw-shadow-color: #000; + --tw-shadow: var(--tw-shadow-colored); +} + +.outline-none { + outline: 2px solid transparent; + outline-offset: 2px; +} + +.outline { + outline-style: solid; +} + +.blur { + --tw-blur: blur(8px); + filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); +} + +.drop-shadow { + --tw-drop-shadow: drop-shadow(0 1px 2px rgb(0 0 0 / 0.1)) drop-shadow(0 1px 1px rgb(0 0 0 / 0.06)); + filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); +} + +.grayscale { + --tw-grayscale: grayscale(100%); + filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); +} + +.filter { + filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); +} + +.backdrop-blur-astra-menu { + --tw-backdrop-blur: blur(var(--astra-table-menu-backdrop-blur, 4px)); + -webkit-backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia); + backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia); +} + +.backdrop-blur-astra-table { + --tw-backdrop-blur: blur(var(--astra-table-backdrop-blur, 4px)); + -webkit-backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia); + backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia); +} + +.backdrop-blur-lg { + --tw-backdrop-blur: blur(16px); + -webkit-backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia); + backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia); +} + +.backdrop-blur-sm { + --tw-backdrop-blur: blur(4px); + -webkit-backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia); + backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia); +} + +.backdrop-filter { + -webkit-backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia); + backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia); +} + +.transition { + transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter; + transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter; + transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter; + transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); + transition-duration: 150ms; +} + +.transition-all { + transition-property: all; + transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); + transition-duration: 150ms; +} + +.transition-colors { + transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; + transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); + transition-duration: 150ms; +} + +.transition-opacity { + transition-property: opacity; + transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); + transition-duration: 150ms; +} + +.duration-200 { + transition-duration: 200ms; +} + +.duration-300 { + transition-duration: 300ms; +} + +.duration-\\[50\\] { + transition-duration: 50; +} + +.ease-out { + transition-timing-function: cubic-bezier(0, 0, 0.2, 1); +} + +.container { + width: 100%; +} + +@media (min-width: 640px) { + .container { + max-width: 640px; + } +} + +@media (min-width: 768px) { + .container { + max-width: 768px; + } +} + +@media (min-width: 1024px) { + .container { + max-width: 1024px; + } +} + +@media (min-width: 1280px) { + .container { + max-width: 1280px; + } +} + +@media (min-width: 1536px) { + .container { + max-width: 1536px; + } +} + +.first\\:rounded-t-sm:first-child { + border-top-left-radius: 0.125rem; + border-top-right-radius: 0.125rem; +} + +.first\\:border-l:first-child { + border-left-width: 1px; +} + +.last\\:rounded-b-sm:last-child { + border-bottom-right-radius: 0.125rem; + border-bottom-left-radius: 0.125rem; +} + +.hover\\:bg-neutral-100:hover { + --tw-bg-opacity: 1; + background-color: rgb(245 245 245 / var(--tw-bg-opacity, 1)); +} + +.hover\\:bg-neutral-200:hover { + --tw-bg-opacity: 1; + background-color: rgb(229 229 229 / var(--tw-bg-opacity, 1)); +} + +.hover\\:bg-neutral-300:hover { + --tw-bg-opacity: 1; + background-color: rgb(212 212 212 / var(--tw-bg-opacity, 1)); +} + +.hover\\:bg-neutral-800:hover { + --tw-bg-opacity: 1; + background-color: rgb(38 38 38 / var(--tw-bg-opacity, 1)); +} + +.hover\\:bg-red-50:hover { + --tw-bg-opacity: 1; + background-color: rgb(254 242 242 / var(--tw-bg-opacity, 1)); +} + +.hover\\:bg-theme-menu-background-color-active:hover { + background-color: var(--astra-menu-background-color-active, #000); +} + +.hover\\:bg-theme-menu-toggle-color-hover:hover { + background-color: var(--astra-toggle-color-hover, #fafafa); +} + +.hover\\:bg-theme-menu-toggle-color-hover-dark:hover { + background-color: var(--astra-toggle-color-hover-dark, #262626); +} + +.hover\\:bg-theme-sidebar-li-hover:hover { + background-color: var(--astra-hover-sidebar-li-background-color, rgba(0,0,0,0.03)); +} + +.hover\\:bg-theme-table-row-hover:hover { + background-color: var(--astra-table-row-hover-background-color, rgba(0,0,0,0.03)); +} + +.hover\\:bg-theme-table-row-selected-hover:hover { + background-color: var(--astra-table-row-selected-hover-background-color, rgba(229, 229, 229, 1)); +} + +.hover\\:bg-white:hover { + --tw-bg-opacity: 1; + background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1)); +} + +.hover\\:text-black:hover { + --tw-text-opacity: 1; + color: rgb(0 0 0 / var(--tw-text-opacity, 1)); +} + +.hover\\:text-neutral-900:hover { + --tw-text-opacity: 1; + color: rgb(23 23 23 / var(--tw-text-opacity, 1)); +} + +.hover\\:text-red-600:hover { + --tw-text-opacity: 1; + color: rgb(220 38 38 / var(--tw-text-opacity, 1)); +} + +.hover\\:text-theme-menu-content-color-active:hover { + color: var(--astra-menu-content-color-active, #fff); +} + +.hover\\:underline:hover { + text-decoration-line: underline; +} + +.focus\\:z-\\[1\\]:focus { + z-index: 1; +} + +.focus\\:rounded-\\[4px\\]:focus { + border-radius: 4px; +} + +.focus\\:rounded-md:focus { + border-radius: 0.375rem; +} + +.focus\\:bg-neutral-200:focus { + --tw-bg-opacity: 1; + background-color: rgb(229 229 229 / var(--tw-bg-opacity, 1)); +} + +.focus\\:shadow-ringlet:focus { + --tw-shadow: 0px 0px 0px 3px #d4d4d4;; + --tw-shadow-colored: 0px 0px 0px 3px var(--tw-shadow-color); + box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); +} + +.focus\\:outline-none:focus { + outline: 2px solid transparent; + outline-offset: 2px; +} + +.focus\\:ring-1:focus { + --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); + --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color); + box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000); +} + +.focus\\:ring-2:focus { + --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); + --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color); + box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000); +} + +.focus\\:ring-black:focus { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(0 0 0 / var(--tw-ring-opacity, 1)); +} + +.focus\\:ring-blue-300:focus { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(147 197 253 / var(--tw-ring-opacity, 1)); +} + +.focus\\:ring-neutral-500:focus { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(115 115 115 / var(--tw-ring-opacity, 1)); +} + +.focus\\:ring-neutral-950:focus { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(10 10 10 / var(--tw-ring-opacity, 1)); +} + +.focus-visible\\:ring:focus-visible { + --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); + --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color); + box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000); +} + +.focus-visible\\:ring-blue-600:focus-visible { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(37 99 235 / var(--tw-ring-opacity, 1)); +} + +.active\\:border-neutral-200:active { + --tw-border-opacity: 1; + border-color: rgb(229 229 229 / var(--tw-border-opacity, 1)); +} + +.active\\:bg-neutral-300:active { + --tw-bg-opacity: 1; + background-color: rgb(212 212 212 / var(--tw-bg-opacity, 1)); +} + +.active\\:bg-theme-menu-toggle-color-active:active { + background-color: var(--astra-toggle-color-active, #f5f5f5); +} + +.active\\:bg-theme-menu-toggle-color-active-dark:active { + background-color: var(--astra-toggle-color-active-dark, #404040); +} + +.disabled\\:bg-neutral-400:disabled { + --tw-bg-opacity: 1; + background-color: rgb(163 163 163 / var(--tw-bg-opacity, 1)); +} + +.group\\/actions:hover .group-hover\\/actions\\:block { + display: block; +} + +.group:hover .group-hover\\:flex { + display: flex; +} + +.group:hover .group-hover\\:w-1 { + width: 0.25rem; +} + +.group:hover .group-hover\\:bg-blue-400 { + --tw-bg-opacity: 1; + background-color: rgb(96 165 250 / var(--tw-bg-opacity, 1)); +} + +.group:active .group-active\\:w-1 { + width: 0.25rem; +} + +.group:active .group-active\\:bg-blue-500 { + --tw-bg-opacity: 1; + background-color: rgb(59 130 246 / var(--tw-bg-opacity, 1)); +} + +.dark\\:border-\\[\\#404040\\]:is(.dark *) { + --tw-border-opacity: 1; + border-color: rgb(64 64 64 / var(--tw-border-opacity, 1)); +} + +.dark\\:border-neutral-600:is(.dark *) { + --tw-border-opacity: 1; + border-color: rgb(82 82 82 / var(--tw-border-opacity, 1)); +} + +.dark\\:border-neutral-700:is(.dark *) { + --tw-border-opacity: 1; + border-color: rgb(64 64 64 / var(--tw-border-opacity, 1)); +} + +.dark\\:border-neutral-800:is(.dark *) { + --tw-border-opacity: 1; + border-color: rgb(38 38 38 / var(--tw-border-opacity, 1)); +} + +.dark\\:border-theme-table-border-dark:is(.dark *) { + border-color: var(--astra-table-border-color-dark, rgb(52,52,56)); +} + +.dark\\:bg-black:is(.dark *) { + --tw-bg-opacity: 1; + background-color: rgb(0 0 0 / var(--tw-bg-opacity, 1)); +} + +.dark\\:bg-blue-950:is(.dark *) { + --tw-bg-opacity: 1; + background-color: rgb(23 37 84 / var(--tw-bg-opacity, 1)); +} + +.dark\\:bg-neutral-50:is(.dark *) { + --tw-bg-opacity: 1; + background-color: rgb(250 250 250 / var(--tw-bg-opacity, 1)); +} + +.dark\\:bg-neutral-500\\/30:is(.dark *) { + background-color: rgb(115 115 115 / 0.3); +} + +.dark\\:bg-neutral-700\\/50:is(.dark *) { + background-color: rgb(64 64 64 / 0.5); +} + +.dark\\:bg-neutral-700\\/85:is(.dark *) { + background-color: rgb(64 64 64 / 0.85); +} + +.dark\\:bg-neutral-900:is(.dark *) { + --tw-bg-opacity: 1; + background-color: rgb(23 23 23 / var(--tw-bg-opacity, 1)); +} + +.dark\\:bg-neutral-950:is(.dark *) { + --tw-bg-opacity: 1; + background-color: rgb(10 10 10 / var(--tw-bg-opacity, 1)); +} + +.dark\\:bg-theme-menu-background-color-active-dark:is(.dark *) { + background-color: var(--astra-menu-background-color-active-dark, #fff); +} + +.dark\\:bg-theme-menu-background-color-dark:is(.dark *) { + background-color: var(--astra-menu-background-color-dark, #000); +} + +.dark\\:bg-theme-sidebar-li-hover-dark:is(.dark *) { + background-color: var(--astra-hover-sidebar-li-background-color-dark, rgba(255,255,255,0.03)); +} + +.dark\\:bg-theme-table-border-dark:is(.dark *) { + background-color: var(--astra-table-border-color-dark, rgb(52,52,56)); +} + +.dark\\:bg-theme-table-cell-dirty-dark:is(.dark *) { + background-color: var(--astra-cell-dirty-background-color, rgba(234, 179, 8, .6)); +} + +.dark\\:bg-theme-table-cell-mutating-background-dark:is(.dark *) { + background-color: var(--astra-cell-mutating-background-color-dark, rgb(23 37 84)); +} + +.dark\\:bg-theme-table-column-dark:is(.dark *) { + background-color: var(--astra-table-column-header-background-color-dark, rgba(0,0,0,1)); +} + +.dark\\:bg-theme-table-dark:is(.dark *) { + background-color: var(--astra-table-background-color-dark, rgba(0, 0, 0, 1)); +} + +.dark\\:bg-theme-table-row-dark:is(.dark *) { + background-color: var(--astra-table-row-background-color-dark, rgba(0, 0, 0, 1)); +} + +.dark\\:bg-theme-table-row-new-dark:is(.dark *) { + background-color: var(--astra-table-row-new-background-color-dark, #14532D); +} + +.dark\\:bg-theme-table-row-selected-dark:is(.dark *) { + background-color: var(--astra-table-row-selected-background-color-dark, rgb(23, 23, 23)); +} + +.dark\\:bg-white:is(.dark *) { + --tw-bg-opacity: 1; + background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1)); +} + +.dark\\:text-black:is(.dark *) { + --tw-text-opacity: 1; + color: rgb(0 0 0 / var(--tw-text-opacity, 1)); +} + +.dark\\:text-neutral-100:is(.dark *) { + --tw-text-opacity: 1; + color: rgb(245 245 245 / var(--tw-text-opacity, 1)); +} + +.dark\\:text-neutral-200:is(.dark *) { + --tw-text-opacity: 1; + color: rgb(229 229 229 / var(--tw-text-opacity, 1)); +} + +.dark\\:text-neutral-400:is(.dark *) { + --tw-text-opacity: 1; + color: rgb(163 163 163 / var(--tw-text-opacity, 1)); +} + +.dark\\:text-neutral-50:is(.dark *) { + --tw-text-opacity: 1; + color: rgb(250 250 250 / var(--tw-text-opacity, 1)); +} + +.dark\\:text-neutral-950:is(.dark *) { + --tw-text-opacity: 1; + color: rgb(10 10 10 / var(--tw-text-opacity, 1)); +} + +.dark\\:text-red-400\\/90:is(.dark *) { + color: rgb(248 113 113 / 0.9); +} + +.dark\\:text-theme-menu-content-color-active-dark:is(.dark *) { + color: var(--astra-menu-content-color-active-dark, #000); +} + +.dark\\:text-theme-menu-content-color-dark:is(.dark *) { + color: var(--astra-menu-content-color-dark, #fff); +} + +.dark\\:text-theme-secondary-content-dark:is(.dark *) { + color: var(--astra-secondary-content-color, rgb(213, 213, 213)); +} + +.dark\\:text-theme-sidebar-li-content-dark:is(.dark *) { + color: var(--astra-sidebar-li-content-color-dark, #ffffff); +} + +.dark\\:text-theme-sidebar-subheader-content-dark:is(.dark *) { + color: var(--astra-sidebar-subheader-content-color-dark, #eeeeee); +} + +.dark\\:text-theme-table-cell-mutating-content:is(.dark *) { + color: var(--astra-cell-mutating-content-color, rgb(0,0,0)); +} + +.dark\\:text-theme-table-cell-mutating-content-dark:is(.dark *) { + color: var(--astra-cell-mutating-content-color-dark, rgb(255,255,255)); +} + +.dark\\:text-theme-table-column-content-dark:is(.dark *) { + color: var(--astra-table-column-header-content-color-dark, #ffffff); +} + +.dark\\:text-theme-table-content-dark:is(.dark *) { + color: var(--astra-table-content-color-dark, #ffffff); +} + +.dark\\:text-white:is(.dark *) { + --tw-text-opacity: 1; + color: rgb(255 255 255 / var(--tw-text-opacity, 1)); +} + +.dark\\:text-white\\/50:is(.dark *) { + color: rgb(255 255 255 / 0.5); +} + +.dark\\:placeholder-neutral-400:is(.dark *)::-moz-placeholder { + --tw-placeholder-opacity: 1; + color: rgb(163 163 163 / var(--tw-placeholder-opacity, 1)); +} + +.dark\\:placeholder-neutral-400:is(.dark *)::placeholder { + --tw-placeholder-opacity: 1; + color: rgb(163 163 163 / var(--tw-placeholder-opacity, 1)); +} + +.dark\\:placeholder-neutral-600:is(.dark *)::-moz-placeholder { + --tw-placeholder-opacity: 1; + color: rgb(82 82 82 / var(--tw-placeholder-opacity, 1)); +} + +.dark\\:placeholder-neutral-600:is(.dark *)::placeholder { + --tw-placeholder-opacity: 1; + color: rgb(82 82 82 / var(--tw-placeholder-opacity, 1)); +} + +.dark\\:shadow-\\[0_2px_8px_rgb\\(0\\2c 0\\2c 0\\)\\]:is(.dark *) { + --tw-shadow: 0 2px 8px rgb(0,0,0); + --tw-shadow-colored: 0 2px 8px var(--tw-shadow-color); + box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); +} + +.dark\\:hover\\:bg-neutral-700:hover:is(.dark *) { + --tw-bg-opacity: 1; + background-color: rgb(64 64 64 / var(--tw-bg-opacity, 1)); +} + +.dark\\:hover\\:bg-neutral-800:hover:is(.dark *) { + --tw-bg-opacity: 1; + background-color: rgb(38 38 38 / var(--tw-bg-opacity, 1)); +} + +.dark\\:hover\\:bg-neutral-900:hover:is(.dark *) { + --tw-bg-opacity: 1; + background-color: rgb(23 23 23 / var(--tw-bg-opacity, 1)); +} + +.dark\\:hover\\:bg-red-500\\/10:hover:is(.dark *) { + background-color: rgb(239 68 68 / 0.1); +} + +.dark\\:hover\\:bg-theme-menu-background-color-active-dark:hover:is(.dark *) { + background-color: var(--astra-menu-background-color-active-dark, #fff); +} + +.dark\\:hover\\:bg-theme-table-row-hover-dark:hover:is(.dark *) { + background-color: var(--astra-table-row-hover-background-color-dark, rgb(30,30,30)); +} + +.hover\\:dark\\:bg-neutral-200:is(.dark *):hover { + --tw-bg-opacity: 1; + background-color: rgb(229 229 229 / var(--tw-bg-opacity, 1)); +} + +.hover\\:dark\\:bg-neutral-300\\/10:is(.dark *):hover { + background-color: rgb(212 212 212 / 0.1); +} + +.hover\\:dark\\:bg-neutral-700:is(.dark *):hover { + --tw-bg-opacity: 1; + background-color: rgb(64 64 64 / var(--tw-bg-opacity, 1)); +} + +.dark\\:hover\\:text-neutral-200:hover:is(.dark *) { + --tw-text-opacity: 1; + color: rgb(229 229 229 / var(--tw-text-opacity, 1)); +} + +.dark\\:hover\\:text-red-400:hover:is(.dark *) { + --tw-text-opacity: 1; + color: rgb(248 113 113 / var(--tw-text-opacity, 1)); +} + +.dark\\:hover\\:text-theme-menu-content-color-active-dark:hover:is(.dark *) { + color: var(--astra-menu-content-color-active-dark, #000); +} + +.focus\\:dark\\:border-neutral-300:is(.dark *):focus { + --tw-border-opacity: 1; + border-color: rgb(212 212 212 / var(--tw-border-opacity, 1)); +} + +.dark\\:focus\\:bg-neutral-800:focus:is(.dark *) { + --tw-bg-opacity: 1; + background-color: rgb(38 38 38 / var(--tw-bg-opacity, 1)); +} + +.dark\\:focus\\:shadow-ringlet-dark:focus:is(.dark *) { + --tw-shadow: 0px 0px 0px 3px #525252;; + --tw-shadow-colored: 0px 0px 0px 3px var(--tw-shadow-color); + box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); +} + +.dark\\:focus\\:ring-blue-700:focus:is(.dark *) { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(29 78 216 / var(--tw-ring-opacity, 1)); +} + +.dark\\:focus\\:ring-neutral-300:focus:is(.dark *) { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(212 212 212 / var(--tw-ring-opacity, 1)); +} + +.dark\\:focus\\:ring-neutral-50:focus:is(.dark *) { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(250 250 250 / var(--tw-ring-opacity, 1)); +} + +.dark\\:active\\:border-neutral-800:active:is(.dark *) { + --tw-border-opacity: 1; + border-color: rgb(38 38 38 / var(--tw-border-opacity, 1)); +} + +.dark\\:active\\:bg-neutral-700:active:is(.dark *) { + --tw-bg-opacity: 1; + background-color: rgb(64 64 64 / var(--tw-bg-opacity, 1)); +} + +.disabled\\:dark\\:bg-neutral-600:is(.dark *):disabled { + --tw-bg-opacity: 1; + background-color: rgb(82 82 82 / var(--tw-bg-opacity, 1)); +} + +.group:hover .dark\\:group-hover\\:bg-blue-900:is(.dark *) { + --tw-bg-opacity: 1; + background-color: rgb(30 58 138 / var(--tw-bg-opacity, 1)); +} + +.group:active .dark\\:group-active\\:bg-blue-800:is(.dark *) { + --tw-bg-opacity: 1; + background-color: rgb(30 64 175 / var(--tw-bg-opacity, 1)); +} + `;var xp=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s};class _p extends Ju{constructor(){super(...arguments),this.theme="light",this._class=this.theme}classMap(){return{dark:"dark"==this.theme}}willUpdate(t){var e;super.willUpdate(t),this._class=(e=this.classMap(),Object.entries(e).map((([t,e])=>!!e&&t)).filter(Boolean).join(" "))}render(){return Pu``}}_p.styles=[wp],xp([nd({attribute:"theme",type:String})],_p.prototype,"theme",void 0),xp([nd({reflect:!0,attribute:"class",type:String})],_p.prototype,"_class",void 0); +/*! ***************************************************************************** + Copyright (c) Microsoft Corporation. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + ***************************************************************************** */ +var kp=function(t,e){return kp=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},kp(t,e)};function Sp(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}kp(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var Ap="12px sans-serif";var Cp,Mp,Dp=function(t){var e={};if("undefined"==typeof JSON)return e;for(var i=0;i=0)o=r*t.length;else for(var s=0;s18);s&&(i.weChat=!0);e.svgSupported="undefined"!=typeof SVGRect,e.touchEventsSupported="ontouchstart"in window&&!i.ie&&!i.edge,e.pointerEventsSupported="onpointerdown"in window&&(i.edge||i.ie&&+i.version>=11),e.domSupported="undefined"!=typeof document;var a=document.documentElement.style;e.transform3dSupported=(i.ie&&"transition"in a||i.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in a)&&!("OTransition"in a),e.transformSupported=e.transform3dSupported||i.ie&&+i.version>=9}(navigator.userAgent,Nf);var Bf="___EC__COMPONENT__CONTAINER___",zf="___EC__EXTENDED_CLASS___";function $f(t){var e={main:"",sub:""};if(t){var i=t.split(".");e.main=i[0]||"",e.sub=i[1]||""}return e}function Ff(t,e){t.$constructor=t,t.extend=function(t){var e,i,n=this;return sf(i=n)&&/^class\s/.test(Function.prototype.toString.call(i))?e=function(t){function e(){return t.apply(this,arguments)||this}return Sp(e,t),e}(n):(e=function(){(t.$constructor||n).apply(this,arguments)},function(t,e){var i=t.prototype;function n(){}for(var r in n.prototype=e.prototype,t.prototype=new n,i)i.hasOwnProperty(r)&&(t.prototype[r]=i[r]);t.prototype.constructor=t,t.superClass=e}(e,this)),Gp(e.prototype,t),e[zf]=!0,e.extend=this.extend,e.superCall=Wf,e.superApply=Uf,e.superClass=n,e}}function Vf(t,e){t.extend=e.extend}var Hf=Math.round(10*Math.random());function Wf(t,e){for(var i=[],n=2;n=0||r&&Yp(r,a)<0)){var l=i.getShallow(a,e);null!=l&&(o[t[s][0]]=l)}}return o}}var qf=Gf([["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]]),Yf=function(){function t(){}return t.prototype.getAreaStyle=function(t,e){return qf(this,t,e)},t}(),Xf=function(t){this.value=t},Kf=function(){function t(){this._len=0}return t.prototype.insert=function(t){var e=new Xf(t);return this.insertEntry(e),e},t.prototype.insertEntry=function(t){this.head?(this.tail.next=t,t.prev=this.tail,t.next=null,this.tail=t):this.head=this.tail=t,this._len++},t.prototype.remove=function(t){var e=t.prev,i=t.next;e?e.next=i:this.head=i,i?i.prev=e:this.tail=e,t.next=t.prev=null,this._len--},t.prototype.len=function(){return this._len},t.prototype.clear=function(){this.head=this.tail=null,this._len=0},t}(),Zf=function(){function t(t){this._list=new Kf,this._maxSize=10,this._map={},this._maxSize=t}return t.prototype.put=function(t,e){var i=this._list,n=this._map,r=null;if(null==n[t]){var o=i.len(),s=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var a=i.head;i.remove(a),delete n[a.key],r=a.value,this._lastRemovedEntry=a}s?s.value=e:s=new Xf(e),s.key=t,i.insertEntry(s),n[t]=s}return r},t.prototype.get=function(t){var e=this._map[t],i=this._list;if(null!=e)return e!==i.tail&&(i.remove(e),i.insertEntry(e)),e.value},t.prototype.clear=function(){this._list.clear(),this._map={}},t.prototype.len=function(){return this._list.len()},t}(),Jf=new Zf(50);function Qf(t){if("string"==typeof t){var e=Jf.get(t);return e&&e.image}return t}function tg(t,e,i,n,r){if(t){if("string"==typeof t){if(e&&e.__zrImageSrc===t||!i)return e;var o=Jf.get(t),s={hostEl:i,cb:n,cbPayload:r};return o?!ig(e=o.image)&&o.pending.push(s):((e=Tp.loadImage(t,eg,eg)).__zrImageSrc=t,Jf.put(t,e.__cachedImgObj={image:e,pending:[s]})),e}return t}return e}function eg(){var t=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var e=0;ef&&(f=b,gf&&(f=w,v=i.x&&t<=i.x+i.width&&e>=i.y&&e<=i.y+i.height},t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.copy=function(e){t.copy(this,e)},t.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},t.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},t.prototype.isZero=function(){return 0===this.width||0===this.height},t.create=function(e){return new t(e.x,e.y,e.width,e.height)},t.copy=function(t,e){t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height},t.applyTransform=function(e,i,n){if(n){if(n[1]<1e-5&&n[1]>-1e-5&&n[2]<1e-5&&n[2]>-1e-5){var r=n[0],o=n[3],s=n[4],a=n[5];return e.x=i.x*r+s,e.y=i.y*o+a,e.width=i.width*r,e.height=i.height*o,e.width<0&&(e.x+=e.width,e.width=-e.width),void(e.height<0&&(e.y+=e.height,e.height=-e.height))}ug.x=pg.x=i.x,ug.y=fg.y=i.y,dg.x=fg.x=i.x+i.width,dg.y=pg.y=i.y+i.height,ug.transform(n),fg.transform(n),dg.transform(n),pg.transform(n),e.x=hg(ug.x,dg.x,pg.x,fg.x),e.y=hg(ug.y,dg.y,pg.y,fg.y);var l=cg(ug.x,dg.x,pg.x,fg.x),h=cg(ug.y,dg.y,pg.y,fg.y);e.width=l-e.x,e.height=h-e.y}else e!==i&&t.copy(e,i)},t}(),yg={};function bg(t,e){var i=yg[e=e||Ap];i||(i=yg[e]=new Zf(500));var n=i.get(t);return null==n&&(n=Tp.measureText(t,e).width,i.put(t,n)),n}function wg(t,e,i,n){var r=bg(t,e),o=Sg(e),s=_g(0,r,i),a=kg(0,o,n);return new vg(s,a,r,o)}function xg(t,e,i,n){var r=((t||"")+"").split("\n");if(1===r.length)return wg(r[0],e,i,n);for(var o=new vg(0,0,0,0),s=0;s=0?parseFloat(t)/100*e:parseFloat(t):t}function Cg(t,e,i){var n=e.position||"inside",r=null!=e.distance?e.distance:5,o=i.height,s=i.width,a=o/2,l=i.x,h=i.y,c="left",u="top";if(n instanceof Array)l+=Ag(n[0],i.width),h+=Ag(n[1],i.height),c=null,u=null;else switch(n){case"left":l-=r,h+=a,c="right",u="middle";break;case"right":l+=r+s,h+=a,u="middle";break;case"top":l+=s/2,h-=r,c="center",u="bottom";break;case"bottom":l+=s/2,h+=o+r,c="center";break;case"inside":l+=s/2,h+=a,c="center",u="middle";break;case"insideLeft":l+=r,h+=a,u="middle";break;case"insideRight":l+=s-r,h+=a,c="right",u="middle";break;case"insideTop":l+=s/2,h+=r,c="center";break;case"insideBottom":l+=s/2,h+=o-r,c="center",u="bottom";break;case"insideTopLeft":l+=r,h+=r;break;case"insideTopRight":l+=s-r,h+=r,c="right";break;case"insideBottomLeft":l+=r,h+=o-r,u="bottom";break;case"insideBottomRight":l+=s-r,h+=o-r,c="right",u="bottom"}return(t=t||{}).x=l,t.y=h,t.align=c,t.verticalAlign=u,t}var Mg=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g;function Dg(t,e,i,n,r){if(!e)return"";var o=(t+"").split("\n");r=Tg(e,i,n,r);for(var s=0,a=o.length;s=s;l++)a-=s;var h=bg(i,e);return h>a&&(i="",h=0),a=t-h,r.ellipsis=i,r.ellipsisWidth=h,r.contentWidth=a,r.containerWidth=t,r}function Ig(t,e){var i=e.containerWidth,n=e.font,r=e.contentWidth;if(!i)return"";var o=bg(t,n);if(o<=i)return t;for(var s=0;;s++){if(o<=r||s>=e.maxIterations){t+=e.ellipsis;break}var a=0===s?Og(t,r,e.ascCharWidth,e.cnCharWidth):o>0?Math.floor(t.length*r/o):0;o=bg(t=t.substr(0,a),n)}return""===t&&(t=e.placeholder),t}function Og(t,e,i,n){for(var r=0,o=0,s=t.length;o0&&f+n.accumWidth>n.width&&(o=e.split("\n"),u=!0),n.accumWidth=f}else{var g=zg(e,c,n.width,n.breakAll,n.accumWidth);n.accumWidth=g.accumWidth+p,s=g.linesWidths,o=g.lines}}else o=e.split("\n");for(var m=0;m=32&&e<=591||e>=880&&e<=4351||e>=4608&&e<=5119||e>=7680&&e<=8303}(t)||!!Ng[t]}function zg(t,e,i,n,r){for(var o=[],s=[],a="",l="",h=0,c=0,u=0;ui:r+c+p>i)?c?(a||l)&&(f?(a||(a=l,l="",c=h=0),o.push(a),s.push(c-h),l+=d,a="",c=h+=p):(l&&(a+=l,l="",h=0),o.push(a),s.push(c),a=d,c=p)):f?(o.push(l),s.push(h),l=d,h=p):(o.push(d),s.push(p)):(c+=p,f?(l+=d,h+=p):(l&&(a+=l,l="",h=0),a+=d))}else l&&(a+=l,c+=h),o.push(a),s.push(c),a="",l="",h=0,c=0}return o.length||a||(a=t,l="",h=0),l&&(a+=l),a&&(o.push(a),s.push(c)),1===o.length&&(c+=r),{accumWidth:c,lines:o,linesWidths:s}}function $g(t,e){return null==t&&(t=0),null==e&&(e=0),[t,e]}function Fg(t){return[t[0],t[1]]}function Vg(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t}function Hg(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t}function Wg(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t}function Ug(t,e){var i=function(t){return Math.sqrt(function(t){return t[0]*t[0]+t[1]*t[1]}(t))}(e);return 0===i?(t[0]=0,t[1]=0):(t[0]=e[0]/i,t[1]=e[1]/i),t}function jg(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}var Gg=jg;var qg=function(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])};function Yg(t,e,i,n){return t[0]=e[0]+n*(i[0]-e[0]),t[1]=e[1]+n*(i[1]-e[1]),t}function Xg(t,e,i){var n=e[0],r=e[1];return t[0]=i[0]*n+i[2]*r+i[4],t[1]=i[1]*n+i[3]*r+i[5],t}function Kg(t,e,i){return t[0]=Math.min(e[0],i[0]),t[1]=Math.min(e[1],i[1]),t}function Zg(t,e,i){return t[0]=Math.max(e[0],i[0]),t[1]=Math.max(e[1],i[1]),t}var Jg=ng,Qg=5e-5;function tm(t){return t>Qg||t<-5e-5}var em=[],im=[],nm=[1,0,0,1,0,0],rm=Math.abs,om=function(){function t(){}return t.prototype.getLocalTransform=function(e){return t.getLocalTransform(this,e)},t.prototype.setPosition=function(t){this.x=t[0],this.y=t[1]},t.prototype.setScale=function(t){this.scaleX=t[0],this.scaleY=t[1]},t.prototype.setSkew=function(t){this.skewX=t[0],this.skewY=t[1]},t.prototype.setOrigin=function(t){this.originX=t[0],this.originY=t[1]},t.prototype.needLocalTransform=function(){return tm(this.rotation)||tm(this.x)||tm(this.y)||tm(this.scaleX-1)||tm(this.scaleY-1)||tm(this.skewX)||tm(this.skewY)},t.prototype.updateTransform=function(){var t=this.parent&&this.parent.transform,e=this.needLocalTransform(),i=this.transform;e||t?(i=i||[1,0,0,1,0,0],e?this.getLocalTransform(i):Jg(i),t&&(e?rg(i,t,i):function(t,e){t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5]}(i,t)),this.transform=i,this._resolveGlobalScaleRatio(i)):i&&(Jg(i),this.invTransform=null)},t.prototype._resolveGlobalScaleRatio=function(t){var e=this.globalScaleRatio;if(null!=e&&1!==e){this.getGlobalScale(em);var i=em[0]<0?-1:1,n=em[1]<0?-1:1,r=((em[0]-i)*e+i)/em[0]||0,o=((em[1]-n)*e+n)/em[1]||0;t[0]*=r,t[1]*=r,t[2]*=o,t[3]*=o}this.invTransform=this.invTransform||[1,0,0,1,0,0],ag(this.invTransform,t)},t.prototype.getComputedTransform=function(){for(var t=this,e=[];t;)e.push(t),t=t.parent;for(;t=e.pop();)t.updateTransform();return this.transform},t.prototype.setLocalTransform=function(t){if(t){var e=t[0]*t[0]+t[1]*t[1],i=t[2]*t[2]+t[3]*t[3],n=Math.atan2(t[1],t[0]),r=Math.PI/2+n-Math.atan2(t[3],t[2]);i=Math.sqrt(i)*Math.cos(r),e=Math.sqrt(e),this.skewX=r,this.skewY=0,this.rotation=-n,this.x=+t[4],this.y=+t[5],this.scaleX=e,this.scaleY=i,this.originX=0,this.originY=0}},t.prototype.decomposeTransform=function(){if(this.transform){var t=this.parent,e=this.transform;t&&t.transform&&(t.invTransform=t.invTransform||[1,0,0,1,0,0],rg(im,t.invTransform,e),e=im);var i=this.originX,n=this.originY;(i||n)&&(nm[4]=i,nm[5]=n,rg(im,e,nm),im[4]-=i,im[5]-=n,e=im),this.setLocalTransform(e)}},t.prototype.getGlobalScale=function(t){var e=this.transform;return t=t||[],e?(t[0]=Math.sqrt(e[0]*e[0]+e[1]*e[1]),t[1]=Math.sqrt(e[2]*e[2]+e[3]*e[3]),e[0]<0&&(t[0]=-t[0]),e[3]<0&&(t[1]=-t[1]),t):(t[0]=1,t[1]=1,t)},t.prototype.transformCoordToLocal=function(t,e){var i=[t,e],n=this.invTransform;return n&&Xg(i,i,n),i},t.prototype.transformCoordToGlobal=function(t,e){var i=[t,e],n=this.transform;return n&&Xg(i,i,n),i},t.prototype.getLineScale=function(){var t=this.transform;return t&&rm(t[0]-1)>1e-10&&rm(t[3]-1)>1e-10?Math.sqrt(rm(t[0]*t[3]-t[2]*t[1])):1},t.prototype.copyTransform=function(t){!function(t,e){for(var i=0;i-1e-8&&tcm||t<-1e-8}function bm(t,e,i,n,r){var o=1-r;return o*o*(o*t+3*r*e)+r*r*(r*n+3*o*i)}function wm(t,e,i,n,r){var o=1-r;return 3*(((e-t)*o+2*(i-e)*r)*o+(n-i)*r*r)}function xm(t,e,i,n,r,o){var s=n+3*(e-i)-t,a=3*(i-2*e+t),l=3*(e-t),h=t-r,c=a*a-3*s*l,u=a*l-9*s*h,d=l*l-3*a*h,p=0;if(vm(c)&&vm(u)){if(vm(a))o[0]=0;else(S=-l/a)>=0&&S<=1&&(o[p++]=S)}else{var f=u*u-4*c*d;if(vm(f)){var g=u/c,m=-g/2;(S=-a/s+g)>=0&&S<=1&&(o[p++]=S),m>=0&&m<=1&&(o[p++]=m)}else if(f>0){var v=hm(f),y=c*a+1.5*s*(-u+v),b=c*a+1.5*s*(-u-v);(S=(-a-((y=y<0?-lm(-y,pm):lm(y,pm))+(b=b<0?-lm(-b,pm):lm(b,pm))))/(3*s))>=0&&S<=1&&(o[p++]=S)}else{var w=(2*c*a-3*s*u)/(2*hm(c*c*c)),x=Math.acos(w)/3,_=hm(c),k=Math.cos(x),S=(-a-2*_*k)/(3*s),A=(m=(-a+_*(k+dm*Math.sin(x)))/(3*s),(-a+_*(k-dm*Math.sin(x)))/(3*s));S>=0&&S<=1&&(o[p++]=S),m>=0&&m<=1&&(o[p++]=m),A>=0&&A<=1&&(o[p++]=A)}}return p}function _m(t,e,i,n,r){var o=6*i-12*e+6*t,s=9*e+3*n-3*t-9*i,a=3*e-3*t,l=0;if(vm(s)){if(ym(o))(c=-a/o)>=0&&c<=1&&(r[l++]=c)}else{var h=o*o-4*s*a;if(vm(h))r[0]=-o/(2*s);else if(h>0){var c,u=hm(h),d=(-o-u)/(2*s);(c=(-o+u)/(2*s))>=0&&c<=1&&(r[l++]=c),d>=0&&d<=1&&(r[l++]=d)}}return l}function km(t,e,i,n,r,o){var s=(e-t)*r+t,a=(i-e)*r+e,l=(n-i)*r+i,h=(a-s)*r+s,c=(l-a)*r+a,u=(c-h)*r+h;o[0]=t,o[1]=s,o[2]=h,o[3]=u,o[4]=u,o[5]=c,o[6]=l,o[7]=n}function Sm(t,e,i,n,r,o,s,a,l){for(var h=t,c=e,u=0,d=1/l,p=1;p<=l;p++){var f=p*d,g=bm(t,i,r,s,f),m=bm(e,n,o,a,f),v=g-h,y=m-c;u+=Math.sqrt(v*v+y*y),h=g,c=m}return u}function Am(t,e,i,n){var r=1-n;return r*(r*t+2*n*e)+n*n*i}function Cm(t,e,i,n){return 2*((1-n)*(e-t)+n*(i-e))}function Mm(t,e,i){var n=t+i-2*e;return 0===n?.5:(t-e)/n}function Dm(t,e,i,n,r){var o=(e-t)*n+t,s=(i-e)*n+e,a=(s-o)*n+o;r[0]=t,r[1]=o,r[2]=a,r[3]=a,r[4]=s,r[5]=i}function Tm(t,e,i,n,r,o,s){for(var a=t,l=e,h=0,c=1/s,u=1;u<=s;u++){var d=u*c,p=Am(t,i,r,d),f=Am(e,n,o,d),g=p-a,m=f-l;h+=Math.sqrt(g*g+m*m),a=p,l=f}return h}var Im=/cubic-bezier\(([0-9,\.e ]+)\)/;function Om(t){var e=t&&Im.exec(t);if(e){var i=e[1].split(","),n=+_f(i[0]),r=+_f(i[1]),o=+_f(i[2]),s=+_f(i[3]);if(isNaN(n+r+o+s))return;var a=[];return function(t){return t<=0?0:t>=1?1:xm(0,n,o,1,t,a)&&bm(0,r,s,1,a[0])}}}var Em=function(){function t(t){this._inited=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=t.life||1e3,this._delay=t.delay||0,this.loop=t.loop||!1,this.onframe=t.onframe||Pf,this.ondestroy=t.ondestroy||Pf,this.onrestart=t.onrestart||Pf,t.easing&&this.setEasing(t.easing)}return t.prototype.step=function(t,e){if(this._inited||(this._startTime=t+this._delay,this._inited=!0),!this._paused){var i=this._life,n=t-this._startTime-this._pausedTime,r=n/i;r<0&&(r=0),r=Math.min(r,1);var o=this.easingFunc,s=o?o(r):r;if(this.onframe(s),1===r){if(!this.loop)return!0;var a=n%i;this._startTime=t-a,this._pausedTime=0,this.onrestart()}return!1}this._pausedTime+=e},t.prototype.pause=function(){this._paused=!0},t.prototype.resume=function(){this._paused=!1},t.prototype.setEasing=function(t){this.easing=t,this.easingFunc=sf(t)?t:am[t]||Om(t)},t}(),Pm={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function Lm(t){return(t=Math.round(t))<0?0:t>255?255:t}function Rm(t){return t<0?0:t>1?1:t}function Nm(t){var e=t;return e.length&&"%"===e.charAt(e.length-1)?Lm(parseFloat(e)/100*255):Lm(parseInt(e,10))}function Bm(t){var e=t;return e.length&&"%"===e.charAt(e.length-1)?Rm(parseFloat(e)/100):Rm(parseFloat(e))}function zm(t,e,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}function $m(t,e,i){return t+(e-t)*i}function Fm(t,e,i,n,r){return t[0]=e,t[1]=i,t[2]=n,t[3]=r,t}function Vm(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}var Hm=new Zf(20),Wm=null;function Um(t,e){Wm&&Vm(Wm,e),Wm=Hm.put(t,Wm||e.slice())}function jm(t,e){if(t){e=e||[];var i=Hm.get(t);if(i)return Vm(e,i);var n=(t+="").replace(/ /g,"").toLowerCase();if(n in Pm)return Vm(e,Pm[n]),Um(t,e),e;var r,o=n.length;if("#"===n.charAt(0))return 4===o||5===o?(r=parseInt(n.slice(1,4),16))>=0&&r<=4095?(Fm(e,(3840&r)>>4|(3840&r)>>8,240&r|(240&r)>>4,15&r|(15&r)<<4,5===o?parseInt(n.slice(4),16)/15:1),Um(t,e),e):void Fm(e,0,0,0,1):7===o||9===o?(r=parseInt(n.slice(1,7),16))>=0&&r<=16777215?(Fm(e,(16711680&r)>>16,(65280&r)>>8,255&r,9===o?parseInt(n.slice(7),16)/255:1),Um(t,e),e):void Fm(e,0,0,0,1):void 0;var s=n.indexOf("("),a=n.indexOf(")");if(-1!==s&&a+1===o){var l=n.substr(0,s),h=n.substr(s+1,a-(s+1)).split(","),c=1;switch(l){case"rgba":if(4!==h.length)return 3===h.length?Fm(e,+h[0],+h[1],+h[2],1):Fm(e,0,0,0,1);c=Bm(h.pop());case"rgb":return h.length>=3?(Fm(e,Nm(h[0]),Nm(h[1]),Nm(h[2]),3===h.length?c:Bm(h[3])),Um(t,e),e):void Fm(e,0,0,0,1);case"hsla":return 4!==h.length?void Fm(e,0,0,0,1):(h[3]=Bm(h[3]),Gm(h,e),Um(t,e),e);case"hsl":return 3!==h.length?void Fm(e,0,0,0,1):(Gm(h,e),Um(t,e),e);default:return}}Fm(e,0,0,0,1)}}function Gm(t,e){var i=(parseFloat(t[0])%360+360)%360/360,n=Bm(t[1]),r=Bm(t[2]),o=r<=.5?r*(n+1):r+n-r*n,s=2*r-o;return Fm(e=e||[],Lm(255*zm(s,o,i+1/3)),Lm(255*zm(s,o,i)),Lm(255*zm(s,o,i-1/3)),1),4===t.length&&(e[3]=t[3]),e}function qm(t,e){var i=jm(t);if(i){for(var n=0;n<3;n++)i[n]=i[n]*(1-e)|0,i[n]>255?i[n]=255:i[n]<0&&(i[n]=0);return Ym(i,4===i.length?"rgba":"rgb")}}function Ym(t,e){if(t&&t.length){var i=t[0]+","+t[1]+","+t[2];return"rgba"!==e&&"hsva"!==e&&"hsla"!==e||(i+=","+t[3]),e+"("+i+")"}}function Xm(t,e){var i=jm(t);return i?(.299*i[0]+.587*i[1]+.114*i[2])*i[3]/255+(1-i[3])*e:0}var Km=new Zf(100);function Zm(t){if(af(t)){var e=Km.get(t);return e||(e=qm(t,-.1),Km.put(t,e)),e}if(ff(t)){var i=Gp({},t);return i.colorStops=Jp(t.colorStops,(function(t){return{offset:t.offset,color:qm(t.color,-.1)}})),i}return t}Nf.hasGlobalWindow&&sf(window.btoa);var Jm=Array.prototype.slice;function Qm(t,e,i){return(e-t)*i+t}function tv(t,e,i,n){for(var r=e.length,o=0;on?e:t,o=Math.min(i,n),s=r[o-1]||{color:[0,0,0,0],offset:0},a=o;as)n.length=s;else for(var a=o;a=1},t.prototype.getAdditiveTrack=function(){return this._additiveTrack},t.prototype.addKeyframe=function(t,e,i){this._needsSort=!0;var n=this.keyframes,r=n.length,o=!1,s=6,a=e;if(Kp(e)){var l=function(t){return Kp(t&&t[0])?2:1}(e);s=l,(1===l&&!hf(e[0])||2===l&&!hf(e[0][0]))&&(o=!0)}else if(hf(e)&&!gf(e))s=0;else if(af(e))if(isNaN(+e)){var h=jm(e);h&&(a=h,s=3)}else s=0;else if(ff(e)){var c=Gp({},a);c.colorStops=Jp(e.colorStops,(function(t){return{offset:t.offset,color:jm(t.color)}})),"linear"===e.type?s=4:function(t){return"radial"===t.type}(e)&&(s=5),a=c}0===r?this.valType=s:s===this.valType&&6!==s||(o=!0),this.discrete=this.discrete||o;var u={time:t,value:a,rawValue:e,percent:0};return i&&(u.easing=i,u.easingFunc=sf(i)?i:am[i]||Om(i)),n.push(u),u},t.prototype.prepare=function(t,e){var i=this.keyframes;this._needsSort&&i.sort((function(t,e){return t.time-e.time}));for(var n=this.valType,r=i.length,o=i[r-1],s=this.discrete,a=lv(n),l=av(n),h=0;h=0&&!(l[i].percent<=e);i--);i=p(i,h-2)}else{for(i=d;ie);i++);i=p(i-1,h-2)}r=l[i+1],n=l[i]}if(n&&r){this._lastFr=i,this._lastFrP=e;var f=r.percent-n.percent,g=0===f?1:p((e-n.percent)/f,1);r.easingFunc&&(g=r.easingFunc(g));var m=o?this._additiveValue:u?hv:t[c];if(!lv(a)&&!u||m||(m=this._additiveValue=[]),this.discrete)t[c]=g<1?n.rawValue:r.rawValue;else if(lv(a))1===a?tv(m,n[s],r[s],g):function(t,e,i,n){for(var r=e.length,o=r&&e[0].length,s=0;s0&&a.addKeyframe(0,ov(l),n),this._trackKeys.push(s)}a.addKeyframe(t,ov(e[s]),n)}return this._maxTime=Math.max(this._maxTime,t),this},t.prototype.pause=function(){this._clip.pause(),this._paused=!0},t.prototype.resume=function(){this._clip.resume(),this._paused=!1},t.prototype.isPaused=function(){return!!this._paused},t.prototype.duration=function(t){return this._maxTime=t,this._force=!0,this},t.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var t=this._doneCbs;if(t)for(var e=t.length,i=0;i0)){this._started=1;for(var e=this,i=[],n=this._maxTime||0,r=0;r1){var s=o.pop();r.addKeyframe(s.time,t[n]),r.prepare(this._maxTime,r.getAdditiveTrack())}}}},t}(),dv=function(){function t(t){t&&(this._$eventProcessor=t)}return t.prototype.on=function(t,e,i,n){this._$handlers||(this._$handlers={});var r=this._$handlers;if("function"==typeof e&&(n=i,i=e,e=null),!i||!t)return this;var o=this._$eventProcessor;null!=e&&o&&o.normalizeQuery&&(e=o.normalizeQuery(e)),r[t]||(r[t]=[]);for(var s=0;s=0:i.inside,g=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={}),m=void 0,v=void 0,y=void 0;f&&this.canBeInsideText()?(m=i.insideFill,v=i.insideStroke,null!=m&&"auto"!==m||(m=this.getInsideTextFill()),null!=v&&"auto"!==v||(v=this.getInsideTextStroke(m),y=!0)):(m=i.outsideFill,v=i.outsideStroke,null!=m&&"auto"!==m||(m=this.getOutsideFill()),null!=v&&"auto"!==v||(v=this.getOutsideStroke(m),y=!0)),(m=m||"#000")===g.fill&&v===g.stroke&&y===g.autoStroke&&o===g.align&&s===g.verticalAlign||(a=!0,g.fill=m,g.stroke=v,g.autoStroke=y,g.align=o,g.verticalAlign=s,e.setDefaultTextStyle(g)),e.__dirty|=1,a&&e.dirtyStyle(!0)}},t.prototype.canBeInsideText=function(){return!0},t.prototype.getInsideTextFill=function(){return"#fff"},t.prototype.getInsideTextStroke=function(t){return"#000"},t.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?mv:gv},t.prototype.getOutsideStroke=function(t){var e=this.__zr&&this.__zr.getBackgroundColor(),i="string"==typeof e&&jm(e);i||(i=[255,255,255,1]);for(var n=i[3],r=this.__zr.isDarkMode(),o=0;o<3;o++)i[o]=i[o]*n+(r?0:255)*(1-n);return i[3]=1,Ym(i,"rgba")},t.prototype.traverse=function(t,e){},t.prototype.attrKV=function(t,e){"textConfig"===t?this.setTextConfig(e):"textContent"===t?this.setTextContent(e):"clipPath"===t?this.setClipPath(e):"extra"===t?(this.extra=this.extra||{},Gp(this.extra,e)):this[t]=e},t.prototype.hide=function(){this.ignore=!0,this.markRedraw()},t.prototype.show=function(){this.ignore=!1,this.markRedraw()},t.prototype.attr=function(t,e){if("string"==typeof t)this.attrKV(t,e);else if(cf(t))for(var i=ef(t),n=0;n0},t.prototype.getState=function(t){return this.states[t]},t.prototype.ensureState=function(t){var e=this.states;return e[t]||(e[t]={}),e[t]},t.prototype.clearStates=function(t){this.useState(vv,!1,t)},t.prototype.useState=function(t,e,i,n){var r=t===vv;if(this.hasState()||!r){var o=this.currentStates,s=this.stateTransition;if(!(Yp(o,t)>=0)||!e&&1!==o.length){var a;if(this.stateProxy&&!r&&(a=this.stateProxy(t)),a||(a=this.states&&this.states[t]),a||r){r||this.saveCurrentToNormalState(a);var l=!!(a&&a.hoverLayer||n);l&&this._toggleHoverLayerFlag(!0),this._applyStateObj(t,a,this._normalState,e,!i&&!this.__inHover&&s&&s.duration>0,s);var h=this._textContent,c=this._textGuide;return h&&h.useState(t,e,i,l),c&&c.useState(t,e,i,l),r?(this.currentStates=[],this._normalState={}):e?this.currentStates.push(t):this.currentStates=[t],this._updateAnimationTargets(),this.markRedraw(),!l&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=-2),a}Wp("State "+t+" not exists.")}}},t.prototype.useStates=function(t,e,i){if(t.length){var n=[],r=this.currentStates,o=t.length,s=o===r.length;if(s)for(var a=0;a0,p);var f=this._textContent,g=this._textGuide;f&&f.useStates(t,e,u),g&&g.useStates(t,e,u),this._updateAnimationTargets(),this.currentStates=t.slice(),this.markRedraw(),!u&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=-2)}else this.clearStates()},t.prototype.isSilent=function(){for(var t=this.silent,e=this.parent;!t&&e;){if(e.silent){t=!0;break}e=e.parent}return t},t.prototype._updateAnimationTargets=function(){for(var t=0;t=0){var i=this.currentStates.slice();i.splice(e,1),this.useStates(i)}},t.prototype.replaceState=function(t,e,i){var n=this.currentStates.slice(),r=Yp(n,t),o=Yp(n,e)>=0;r>=0?o?n.splice(r,1):n[r]=e:i&&!o&&n.push(e),this.useStates(n)},t.prototype.toggleState=function(t,e){e?this.useState(t,!0):this.removeState(t)},t.prototype._mergeStates=function(t){for(var e,i={},n=0;n=0&&e.splice(i,1)})),this.animators.push(t),i&&i.animation.addAnimator(t),i&&i.wakeUp()},t.prototype.updateDuringAnimation=function(t){this.markRedraw()},t.prototype.stopAnimation=function(t,e){for(var i=this.animators,n=i.length,r=[],o=0;o0&&i.during&&o[0].during((function(t,e){i.during(e)}));for(var d=0;d0||r.force&&!s.length){var _,k=void 0,S=void 0,A=void 0;if(a){S={},d&&(k={});for(w=0;w1e-4)return a[0]=t-i,a[1]=e-n,l[0]=t+i,void(l[1]=e+n);if(Fv[0]=zv(r)*i+t,Fv[1]=Bv(r)*n+e,Vv[0]=zv(o)*i+t,Vv[1]=Bv(o)*n+e,h(a,Fv,Vv),c(l,Fv,Vv),(r%=$v)<0&&(r+=$v),(o%=$v)<0&&(o+=$v),r>o&&!s?o+=$v:rr&&(Hv[0]=zv(p)*i+t,Hv[1]=Bv(p)*n+e,h(a,Hv,a),c(l,Hv,l))}var Xv={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},Kv=[],Zv=[],Jv=[],Qv=[],ty=[],ey=[],iy=Math.min,ny=Math.max,ry=Math.cos,oy=Math.sin,sy=Math.abs,ay=Math.PI,ly=2*ay,hy="undefined"!=typeof Float32Array,cy=[];function uy(t){return Math.round(t/ay*1e8)/1e8%2*ay}function dy(t,e){var i=uy(t[0]);i<0&&(i+=ly);var n=i-t[0],r=t[1];r+=n,!e&&r-i>=ly?r=i+ly:e&&i-r>=ly?r=i-ly:!e&&i>r?r=i+(ly-uy(i-r)):e&&i0&&(this._ux=sy(i/fv/t)||0,this._uy=sy(i/fv/e)||0)},t.prototype.setDPR=function(t){this.dpr=t},t.prototype.setContext=function(t){this._ctx=t},t.prototype.getContext=function(){return this._ctx},t.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},t.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},t.prototype.moveTo=function(t,e){return this._drawPendingPt(),this.addData(Xv.M,t,e),this._ctx&&this._ctx.moveTo(t,e),this._x0=t,this._y0=e,this._xi=t,this._yi=e,this},t.prototype.lineTo=function(t,e){var i=sy(t-this._xi),n=sy(e-this._yi),r=i>this._ux||n>this._uy;if(this.addData(Xv.L,t,e),this._ctx&&r&&this._ctx.lineTo(t,e),r)this._xi=t,this._yi=e,this._pendingPtDist=0;else{var o=i*i+n*n;o>this._pendingPtDist&&(this._pendingPtX=t,this._pendingPtY=e,this._pendingPtDist=o)}return this},t.prototype.bezierCurveTo=function(t,e,i,n,r,o){return this._drawPendingPt(),this.addData(Xv.C,t,e,i,n,r,o),this._ctx&&this._ctx.bezierCurveTo(t,e,i,n,r,o),this._xi=r,this._yi=o,this},t.prototype.quadraticCurveTo=function(t,e,i,n){return this._drawPendingPt(),this.addData(Xv.Q,t,e,i,n),this._ctx&&this._ctx.quadraticCurveTo(t,e,i,n),this._xi=i,this._yi=n,this},t.prototype.arc=function(t,e,i,n,r,o){this._drawPendingPt(),cy[0]=n,cy[1]=r,dy(cy,o),n=cy[0];var s=(r=cy[1])-n;return this.addData(Xv.A,t,e,i,i,n,s,0,o?0:1),this._ctx&&this._ctx.arc(t,e,i,n,r,o),this._xi=ry(r)*i+t,this._yi=oy(r)*i+e,this},t.prototype.arcTo=function(t,e,i,n,r){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(t,e,i,n,r),this},t.prototype.rect=function(t,e,i,n){return this._drawPendingPt(),this._ctx&&this._ctx.rect(t,e,i,n),this.addData(Xv.R,t,e,i,n),this},t.prototype.closePath=function(){this._drawPendingPt(),this.addData(Xv.Z);var t=this._ctx,e=this._x0,i=this._y0;return t&&t.closePath(),this._xi=e,this._yi=i,this},t.prototype.fill=function(t){t&&t.fill(),this.toStatic()},t.prototype.stroke=function(t){t&&t.stroke(),this.toStatic()},t.prototype.len=function(){return this._len},t.prototype.setData=function(t){var e=t.length;this.data&&this.data.length===e||!hy||(this.data=new Float32Array(e));for(var i=0;ih.length&&(this._expandData(),h=this.data);for(var c=0;c0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},t.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var t=[],e=0;e11&&(this.data=new Float32Array(t)))}},t.prototype.getBoundingRect=function(){Jv[0]=Jv[1]=ty[0]=ty[1]=Number.MAX_VALUE,Qv[0]=Qv[1]=ey[0]=ey[1]=-Number.MAX_VALUE;var t,e=this.data,i=0,n=0,r=0,o=0;for(t=0;ti||sy(m)>n||u===e-1)&&(f=Math.sqrt(T*T+m*m),r=g,o=b);break;case Xv.C:var v=t[u++],y=t[u++],b=(g=t[u++],t[u++]),w=t[u++],x=t[u++];f=Sm(r,o,v,y,g,b,w,x,10),r=w,o=x;break;case Xv.Q:f=Tm(r,o,v=t[u++],y=t[u++],g=t[u++],b=t[u++],10),r=g,o=b;break;case Xv.A:var _=t[u++],k=t[u++],S=t[u++],A=t[u++],C=t[u++],M=t[u++],D=M+C;u+=1,p&&(s=ry(C)*S+_,a=oy(C)*A+k),f=ny(S,A)*iy(ly,Math.abs(M)),r=ry(D)*S+_,o=oy(D)*A+k;break;case Xv.R:s=r=t[u++],a=o=t[u++],f=2*t[u++]+2*t[u++];break;case Xv.Z:var T=s-r;m=a-o;f=Math.sqrt(T*T+m*m),r=s,o=a}f>=0&&(l[c++]=f,h+=f)}return this._pathLen=h,h},t.prototype.rebuildPath=function(t,e){var i,n,r,o,s,a,l,h,c,u,d=this.data,p=this._ux,f=this._uy,g=this._len,m=e<1,v=0,y=0,b=0;if(!m||(this._pathSegLen||this._calculateLength(),l=this._pathSegLen,h=e*this._pathLen))t:for(var w=0;w0&&(t.lineTo(c,u),b=0),x){case Xv.M:i=r=d[w++],n=o=d[w++],t.moveTo(r,o);break;case Xv.L:s=d[w++],a=d[w++];var k=sy(s-r),S=sy(a-o);if(k>p||S>f){if(m){if(v+(Y=l[y++])>h){var A=(h-v)/Y;t.lineTo(r*(1-A)+s*A,o*(1-A)+a*A);break t}v+=Y}t.lineTo(s,a),r=s,o=a,b=0}else{var C=k*k+S*S;C>b&&(c=s,u=a,b=C)}break;case Xv.C:var M=d[w++],D=d[w++],T=d[w++],I=d[w++],O=d[w++],E=d[w++];if(m){if(v+(Y=l[y++])>h){km(r,M,T,O,A=(h-v)/Y,Kv),km(o,D,I,E,A,Zv),t.bezierCurveTo(Kv[1],Zv[1],Kv[2],Zv[2],Kv[3],Zv[3]);break t}v+=Y}t.bezierCurveTo(M,D,T,I,O,E),r=O,o=E;break;case Xv.Q:M=d[w++],D=d[w++],T=d[w++],I=d[w++];if(m){if(v+(Y=l[y++])>h){Dm(r,M,T,A=(h-v)/Y,Kv),Dm(o,D,I,A,Zv),t.quadraticCurveTo(Kv[1],Zv[1],Kv[2],Zv[2]);break t}v+=Y}t.quadraticCurveTo(M,D,T,I),r=T,o=I;break;case Xv.A:var P=d[w++],L=d[w++],R=d[w++],N=d[w++],B=d[w++],z=d[w++],$=d[w++],F=!d[w++],V=R>N?R:N,H=sy(R-N)>.001,W=B+z,U=!1;if(m)v+(Y=l[y++])>h&&(W=B+z*(h-v)/Y,U=!0),v+=Y;if(H&&t.ellipse?t.ellipse(P,L,R,N,$,B,W,F):t.arc(P,L,V,B,W,F),U)break t;_&&(i=ry(B)*R+P,n=oy(B)*N+L),r=ry(W)*R+P,o=oy(W)*N+L;break;case Xv.R:i=r=d[w],n=o=d[w+1],s=d[w++],a=d[w++];var j=d[w++],G=d[w++];if(m){if(v+(Y=l[y++])>h){var q=h-v;t.moveTo(s,a),t.lineTo(s+iy(q,j),a),(q-=j)>0&&t.lineTo(s+j,a+iy(q,G)),(q-=G)>0&&t.lineTo(s+ny(j-q,0),a+G),(q-=j)>0&&t.lineTo(s,a+ny(G-q,0));break t}v+=Y}t.rect(s,a,j,G);break;case Xv.Z:if(m){var Y;if(v+(Y=l[y++])>h){A=(h-v)/Y;t.lineTo(r*(1-A)+i*A,o*(1-A)+n*A);break t}v+=Y}t.closePath(),r=i,o=n}}},t.prototype.clone=function(){var e=new t,i=this.data;return e.data=i.slice?i.slice():Array.prototype.slice.call(i),e._len=this._len,e},t.CMD=Xv,t.initDefaultProps=function(){var e=t.prototype;e._saveData=!0,e._ux=0,e._uy=0,e._pendingPtDist=0,e._version=0}(),t}();function fy(t,e,i,n,r,o,s){if(0===r)return!1;var a=r,l=0;if(s>e+a&&s>n+a||st+a&&o>i+a||oe+u&&c>n+u&&c>o+u&&c>a+u||ct+u&&h>i+u&&h>r+u&&h>s+u||h=0&&pe+h&&l>n+h&&l>o+h||lt+h&&a>i+h&&a>r+h||a=0&&gi||c+hr&&(r+=by);var d=Math.atan2(l,a);return d<0&&(d+=by),d>=n&&d<=r||d+by>=n&&d+by<=r}function xy(t,e,i,n,r,o){if(o>e&&o>n||or?a:0}var _y=py.CMD,ky=2*Math.PI;var Sy=[-1,-1,-1],Ay=[-1,-1];function Cy(t,e,i,n,r,o,s,a,l,h){if(h>e&&h>n&&h>o&&h>a||h1&&(c=void 0,c=Ay[0],Ay[0]=Ay[1],Ay[1]=c),f=bm(e,n,o,a,Ay[0]),p>1&&(g=bm(e,n,o,a,Ay[1]))),2===p?ve&&a>n&&a>o||a=0&&c<=1&&(r[l++]=c);else{var h=s*s-4*o*a;if(vm(h))(c=-s/(2*o))>=0&&c<=1&&(r[l++]=c);else if(h>0){var c,u=hm(h),d=(-s-u)/(2*o);(c=(-s+u)/(2*o))>=0&&c<=1&&(r[l++]=c),d>=0&&d<=1&&(r[l++]=d)}}return l}(e,n,o,a,Sy);if(0===l)return 0;var h=Mm(e,n,o);if(h>=0&&h<=1){for(var c=0,u=Am(e,n,o,h),d=0;di||a<-i)return 0;var l=Math.sqrt(i*i-a*a);Sy[0]=-l,Sy[1]=l;var h=Math.abs(n-r);if(h<1e-4)return 0;if(h>=ky-1e-4){n=0,r=ky;var c=o?1:-1;return s>=Sy[0]+t&&s<=Sy[1]+t?c:0}if(n>r){var u=n;n=r,r=u}n<0&&(n+=ky,r+=ky);for(var d=0,p=0;p<2;p++){var f=Sy[p];if(f+t>s){var g=Math.atan2(a,f);c=o?1:-1;g<0&&(g=ky+g),(g>=n&&g<=r||g+ky>=n&&g+ky<=r)&&(g>Math.PI/2&&g<1.5*Math.PI&&(c=-c),d+=c)}}return d}function Ty(t,e,i,n,r){for(var o,s,a=t.data,l=t.len(),h=0,c=0,u=0,d=0,p=0,f=0;f1&&(i||(h+=xy(c,u,d,p,n,r))),m&&(d=c=a[f],p=u=a[f+1]),g){case _y.M:c=d=a[f++],u=p=a[f++];break;case _y.L:if(i){if(fy(c,u,a[f],a[f+1],e,n,r))return!0}else h+=xy(c,u,a[f],a[f+1],n,r)||0;c=a[f++],u=a[f++];break;case _y.C:if(i){if(gy(c,u,a[f++],a[f++],a[f++],a[f++],a[f],a[f+1],e,n,r))return!0}else h+=Cy(c,u,a[f++],a[f++],a[f++],a[f++],a[f],a[f+1],n,r)||0;c=a[f++],u=a[f++];break;case _y.Q:if(i){if(my(c,u,a[f++],a[f++],a[f],a[f+1],e,n,r))return!0}else h+=My(c,u,a[f++],a[f++],a[f],a[f+1],n,r)||0;c=a[f++],u=a[f++];break;case _y.A:var v=a[f++],y=a[f++],b=a[f++],w=a[f++],x=a[f++],_=a[f++];f+=1;var k=!!(1-a[f++]);o=Math.cos(x)*b+v,s=Math.sin(x)*w+y,m?(d=o,p=s):h+=xy(c,u,o,s,n,r);var S=(n-v)*w/b+v;if(i){if(wy(v,y,w,x,x+_,k,e,S,r))return!0}else h+=Dy(v,y,w,x,x+_,k,S,r);c=Math.cos(x+_)*b+v,u=Math.sin(x+_)*w+y;break;case _y.R:if(d=c=a[f++],p=u=a[f++],o=d+a[f++],s=p+a[f++],i){if(fy(d,p,o,p,e,n,r)||fy(o,p,o,s,e,n,r)||fy(o,s,d,s,e,n,r)||fy(d,s,d,p,e,n,r))return!0}else h+=xy(o,p,o,s,n,r),h+=xy(d,s,d,p,n,r);break;case _y.Z:if(i){if(fy(c,u,d,p,e,n,r))return!0}else h+=xy(c,u,d,p,n,r);c=d,u=p}}return i||function(t,e){return Math.abs(t-e)<1e-4}(u,p)||(h+=xy(c,u,d,p,n,r)||0),0!==h}var Iy=qp({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},Dv),Oy={style:qp({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},Tv.style)},Ey=sm.concat(["invisible","culling","z","z2","zlevel","parent"]),Py=function(t){function e(e){return t.call(this,e)||this}var i;return Sp(e,t),e.prototype.update=function(){var i=this;t.prototype.update.call(this);var n=this.style;if(n.decal){var r=this._decalEl=this._decalEl||new e;r.buildPath===e.prototype.buildPath&&(r.buildPath=function(t){i.buildPath(t,i.shape)}),r.silent=!0;var o=r.style;for(var s in n)o[s]!==n[s]&&(o[s]=n[s]);o.fill=n.fill?n.decal:null,o.decal=null,o.shadowColor=null,n.strokeFirst&&(o.stroke=null);for(var a=0;a.5?gv:e>.2?"#eee":mv}if(t)return mv}return gv},e.prototype.getInsideTextStroke=function(t){var e=this.style.fill;if(af(e)){var i=this.__zr;if(!(!i||!i.isDarkMode())===Xm(t,0)<.4)return e}},e.prototype.buildPath=function(t,e,i){},e.prototype.pathUpdated=function(){this.__dirty&=-5},e.prototype.getUpdatedPathProxy=function(t){return!this.path&&this.createPathProxy(),this.path.beginPath(),this.buildPath(this.path,this.shape,t),this.path},e.prototype.createPathProxy=function(){this.path=new py(!1)},e.prototype.hasStroke=function(){var t=this.style,e=t.stroke;return!(null==e||"none"===e||!(t.lineWidth>0))},e.prototype.hasFill=function(){var t=this.style.fill;return null!=t&&"none"!==t},e.prototype.getBoundingRect=function(){var t=this._rect,e=this.style,i=!t;if(i){var n=!1;this.path||(n=!0,this.createPathProxy());var r=this.path;(n||4&this.__dirty)&&(r.beginPath(),this.buildPath(r,this.shape,!1),this.pathUpdated()),t=r.getBoundingRect()}if(this._rect=t,this.hasStroke()&&this.path&&this.path.len()>0){var o=this._rectStroke||(this._rectStroke=t.clone());if(this.__dirty||i){o.copy(t);var s=e.strokeNoScale?this.getLineScale():1,a=e.lineWidth;if(!this.hasFill()){var l=this.strokeContainThreshold;a=Math.max(a,null==l?4:l)}s>1e-10&&(o.width+=a/s,o.height+=a/s,o.x-=a/s/2,o.y-=a/s/2)}return o}return t},e.prototype.contain=function(t,e){var i=this.transformCoordToLocal(t,e),n=this.getBoundingRect(),r=this.style;if(t=i[0],e=i[1],n.contain(t,e)){var o=this.path;if(this.hasStroke()){var s=r.lineWidth,a=r.strokeNoScale?this.getLineScale():1;if(a>1e-10&&(this.hasFill()||(s=Math.max(s,this.strokeContainThreshold)),function(t,e,i,n){return Ty(t,e,!0,i,n)}(o,s/a,t,e)))return!0}if(this.hasFill())return function(t,e,i){return Ty(t,0,!1,e,i)}(o,t,e)}return!1},e.prototype.dirtyShape=function(){this.__dirty|=4,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},e.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},e.prototype.animateShape=function(t){return this.animate("shape",t)},e.prototype.updateDuringAnimation=function(t){"style"===t?this.dirtyStyle():"shape"===t?this.dirtyShape():this.markRedraw()},e.prototype.attrKV=function(e,i){"shape"===e?this.setShape(i):t.prototype.attrKV.call(this,e,i)},e.prototype.setShape=function(t,e){var i=this.shape;return i||(i=this.shape={}),"string"==typeof t?i[t]=e:Gp(i,t),this.dirtyShape(),this},e.prototype.shapeChanged=function(){return!!(4&this.__dirty)},e.prototype.createStyle=function(t){return If(Iy,t)},e.prototype._innerSaveToNormal=function(e){t.prototype._innerSaveToNormal.call(this,e);var i=this._normalState;e.shape&&!i.shape&&(i.shape=Gp({},this.shape))},e.prototype._applyStateObj=function(e,i,n,r,o,s){t.prototype._applyStateObj.call(this,e,i,n,r,o,s);var a,l=!(i&&r);if(i&&i.shape?o?r?a=i.shape:(a=Gp({},n.shape),Gp(a,i.shape)):(a=Gp({},r?this.shape:n.shape),Gp(a,i.shape)):l&&(a=n.shape),a)if(o){this.shape=Gp({},this.shape);for(var h={},c=ef(a),u=0;u0},e.prototype.hasFill=function(){var t=this.style.fill;return null!=t&&"none"!==t},e.prototype.createStyle=function(t){return If(Ly,t)},e.prototype.setBoundingRect=function(t){this._rect=t},e.prototype.getBoundingRect=function(){var t=this.style;if(!this._rect){var e=t.text;null!=e?e+="":e="";var i=xg(e,t.font,t.textAlign,t.textBaseline);if(i.x+=t.x||0,i.y+=t.y||0,this.hasStroke()){var n=t.lineWidth;i.x-=n/2,i.y-=n/2,i.width+=n,i.height+=n}this._rect=i}return this._rect},e.initDefaultProps=void(e.prototype.dirtyRectTolerance=10),e}(Ev);Ry.prototype.type="tspan";var Ny=qp({x:0,y:0},Dv),By={style:qp({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},Tv.style)};var zy=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Sp(e,t),e.prototype.createStyle=function(t){return If(Ny,t)},e.prototype._getSize=function(t){var e=this.style,i=e[t];if(null!=i)return i;var n,r=(n=e.image)&&"string"!=typeof n&&n.width&&n.height?e.image:this.__image;if(!r)return 0;var o="width"===t?"height":"width",s=e[o];return null==s?r[t]:r[t]/r[o]*s},e.prototype.getWidth=function(){return this._getSize("width")},e.prototype.getHeight=function(){return this._getSize("height")},e.prototype.getAnimationStyleProps=function(){return By},e.prototype.getBoundingRect=function(){var t=this.style;return this._rect||(this._rect=new vg(t.x||0,t.y||0,this.getWidth(),this.getHeight())),this._rect},e}(Ev);zy.prototype.type="image";var $y=Math.round;function Fy(t,e,i){if(e){var n=e.x1,r=e.x2,o=e.y1,s=e.y2;t.x1=n,t.x2=r,t.y1=o,t.y2=s;var a=i&&i.lineWidth;return a?($y(2*n)===$y(2*r)&&(t.x1=t.x2=Hy(n,a,!0)),$y(2*o)===$y(2*s)&&(t.y1=t.y2=Hy(o,a,!0)),t):t}}function Vy(t,e,i){if(e){var n=e.x,r=e.y,o=e.width,s=e.height;t.x=n,t.y=r,t.width=o,t.height=s;var a=i&&i.lineWidth;return a?(t.x=Hy(n,a,!0),t.y=Hy(r,a,!0),t.width=Math.max(Hy(n+o,a,!1)-t.x,0===o?0:1),t.height=Math.max(Hy(r+s,a,!1)-t.y,0===s?0:1),t):t}}function Hy(t,e,i){if(!e)return t;var n=$y(2*t);return(n+$y(e))%2==0?n/2:(n+(i?1:-1))/2}var Wy=function(){this.x=0,this.y=0,this.width=0,this.height=0},Uy={},jy=function(t){function e(e){return t.call(this,e)||this}return Sp(e,t),e.prototype.getDefaultShape=function(){return new Wy},e.prototype.buildPath=function(t,e){var i,n,r,o;if(this.subPixelOptimize){var s=Vy(Uy,e,this.style);i=s.x,n=s.y,r=s.width,o=s.height,s.r=e.r,e=s}else i=e.x,n=e.y,r=e.width,o=e.height;e.r?function(t,e){var i,n,r,o,s,a=e.x,l=e.y,h=e.width,c=e.height,u=e.r;h<0&&(a+=h,h=-h),c<0&&(l+=c,c=-c),"number"==typeof u?i=n=r=o=u:u instanceof Array?1===u.length?i=n=r=o=u[0]:2===u.length?(i=r=u[0],n=o=u[1]):3===u.length?(i=u[0],n=o=u[1],r=u[2]):(i=u[0],n=u[1],r=u[2],o=u[3]):i=n=r=o=0,i+n>h&&(i*=h/(s=i+n),n*=h/s),r+o>h&&(r*=h/(s=r+o),o*=h/s),n+r>c&&(n*=c/(s=n+r),r*=c/s),i+o>c&&(i*=c/(s=i+o),o*=c/s),t.moveTo(a+i,l),t.lineTo(a+h-n,l),0!==n&&t.arc(a+h-n,l+n,n,-Math.PI/2,0),t.lineTo(a+h,l+c-r),0!==r&&t.arc(a+h-r,l+c-r,r,0,Math.PI/2),t.lineTo(a+o,l+c),0!==o&&t.arc(a+o,l+c-o,o,Math.PI/2,Math.PI),t.lineTo(a,l+i),0!==i&&t.arc(a+i,l+i,i,Math.PI,1.5*Math.PI)}(t,e):t.rect(i,n,r,o)},e.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},e}(Py);jy.prototype.type="rect";var Gy={fill:"#000"},qy={style:qp({fill:!0,stroke:!0,fillOpacity:!0,strokeOpacity:!0,lineWidth:!0,fontSize:!0,lineHeight:!0,width:!0,height:!0,textShadowColor:!0,textShadowBlur:!0,textShadowOffsetX:!0,textShadowOffsetY:!0,backgroundColor:!0,padding:!0,borderColor:!0,borderWidth:!0,borderRadius:!0},Tv.style)},Yy=function(t){function e(e){var i=t.call(this)||this;return i.type="text",i._children=[],i._defaultStyle=Gy,i.attr(e),i}return Sp(e,t),e.prototype.childrenRef=function(){return this._children},e.prototype.update=function(){t.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var e=0;ep&&c){var f=Math.floor(p/l);i=i.slice(0,f)}if(t&&s&&null!=u)for(var g=Tg(u,o,e.ellipsis,{minChar:e.truncateMinChar,placeholder:e.placeholder}),m=0;m0,A=null!=t.width&&("truncate"===t.overflow||"break"===t.overflow||"breakAll"===t.overflow),C=n.calculatedLineHeight,M=0;Ml&&Rg(i,t.substring(l,h),e,a),Rg(i,n[2],e,a,n[1]),l=Mg.lastIndex}lo){x>0?(y.tokens=y.tokens.slice(0,x),m(y,w,b),i.lines=i.lines.slice(0,v+1)):i.lines=i.lines.slice(0,v);break t}var M=_.width,D=null==M||"auto"===M;if("string"==typeof M&&"%"===M.charAt(M.length-1))E.percentWidth=M,c.push(E),E.contentWidth=bg(E.text,A);else{if(D){var T=_.backgroundColor,I=T&&T.image;I&&ig(I=Qf(I))&&(E.width=Math.max(E.width,I.width*C/I.height))}var O=f&&null!=r?r-w:null;null!=O&&O=0&&"right"===(M=b[C]).align;)this._placeToken(M,t,x,f,A,"right",m),_-=M.width,A-=M.width,C--;for(S+=(i-(S-p)-(g-A)-_)/2;k<=C;)M=b[k],this._placeToken(M,t,x,f,S+M.width/2,"center",m),S+=M.width,k++;f+=x}},e.prototype._placeToken=function(t,e,i,n,r,o,s){var a=e.rich[t.styleName]||{};a.text=t.text;var l=t.verticalAlign,h=n+i/2;"top"===l?h=n+t.height/2:"bottom"===l&&(h=n+i-t.height/2),!t.isLineHolder&&ob(a)&&this._renderBackground(a,e,"right"===o?r-t.width:"center"===o?r-t.width/2:r,h-t.height/2,t.width,t.height);var c=!!a.backgroundColor,u=t.textPadding;u&&(r=nb(r,o,u),h-=t.height/2-u[0]-t.innerHeight/2);var d=this._getOrCreateChild(Ry),p=d.createStyle();d.useStyle(p);var f=this._defaultStyle,g=!1,m=0,v=ib("fill"in a?a.fill:"fill"in e?e.fill:(g=!0,f.fill)),y=eb("stroke"in a?a.stroke:"stroke"in e?e.stroke:c||s||f.autoStroke&&!g?null:(m=2,f.stroke)),b=a.textShadowBlur>0||e.textShadowBlur>0;p.text=t.text,p.x=r,p.y=h,b&&(p.shadowBlur=a.textShadowBlur||e.textShadowBlur||0,p.shadowColor=a.textShadowColor||e.textShadowColor||"transparent",p.shadowOffsetX=a.textShadowOffsetX||e.textShadowOffsetX||0,p.shadowOffsetY=a.textShadowOffsetY||e.textShadowOffsetY||0),p.textAlign=o,p.textBaseline="middle",p.font=t.font||Ap,p.opacity=yf(a.opacity,e.opacity,1),Qy(p,a),y&&(p.lineWidth=yf(a.lineWidth,e.lineWidth,m),p.lineDash=vf(a.lineDash,e.lineDash),p.lineDashOffset=e.lineDashOffset||0,p.stroke=y),v&&(p.fill=v);var w=t.contentWidth,x=t.contentHeight;d.setBoundingRect(new vg(_g(p.x,w,p.textAlign),kg(p.y,x,p.textBaseline),w,x))},e.prototype._renderBackground=function(t,e,i,n,r,o){var s,a,l,h=t.backgroundColor,c=t.borderWidth,u=t.borderColor,d=h&&h.image,p=h&&!d,f=t.borderRadius,g=this;if(p||t.lineHeight||c&&u){(s=this._getOrCreateChild(jy)).useStyle(s.createStyle()),s.style.fill=null;var m=s.shape;m.x=i,m.y=n,m.width=r,m.height=o,m.r=f,s.dirtyShape()}if(p)(l=s.style).fill=h||null,l.fillOpacity=vf(t.fillOpacity,1);else if(d){(a=this._getOrCreateChild(zy)).onload=function(){g.dirtyStyle()};var v=a.style;v.image=h.image,v.x=i,v.y=n,v.width=r,v.height=o}c&&u&&((l=s.style).lineWidth=c,l.stroke=u,l.strokeOpacity=vf(t.strokeOpacity,1),l.lineDash=t.borderDash,l.lineDashOffset=t.borderDashOffset||0,s.strokeContainThreshold=0,s.hasFill()&&s.hasStroke()&&(l.strokeFirst=!0,l.lineWidth*=2));var y=(s||a).style;y.shadowBlur=t.shadowBlur||0,y.shadowColor=t.shadowColor||"transparent",y.shadowOffsetX=t.shadowOffsetX||0,y.shadowOffsetY=t.shadowOffsetY||0,y.opacity=yf(t.opacity,e.opacity,1)},e.makeFont=function(t){var e="";return function(t){return null!=t.fontSize||t.fontFamily||t.fontWeight}(t)&&(e=[t.fontStyle,t.fontWeight,Jy(t.fontSize),t.fontFamily||"sans-serif"].join(" ")),e&&_f(e)||t.textFont||t.font},e}(Ev),Xy={left:!0,right:1,center:1},Ky={top:1,bottom:1,middle:1},Zy=["fontStyle","fontWeight","fontSize","fontFamily"];function Jy(t){return"string"!=typeof t||-1===t.indexOf("px")&&-1===t.indexOf("rem")&&-1===t.indexOf("em")?isNaN(+t)?"12px":t+"px":t}function Qy(t,e){for(var i=0;i0){if(t<=r)return s;if(t>=o)return a}else{if(t>=r)return s;if(t<=o)return a}else{if(t===r)return s;if(t===o)return a}return(t-r)/l*h+s}function lb(t,e){switch(t){case"center":case"middle":t="50%";break;case"left":case"top":t="0%";break;case"right":case"bottom":t="100%"}return af(t)?(i=t,i.replace(/^\s+|\s+$/g,"")).match(/%$/)?parseFloat(t)/100*e:parseFloat(t):null==t?NaN:+t;var i}function hb(t,e,i){return null==e&&(e=10),e=Math.min(Math.max(0,e),20),t=(+t).toFixed(e),i?t:+t}function cb(t){if(t=+t,isNaN(t))return 0;if(t>1e-14)for(var e=1,i=0;i<15;i++,e*=10)if(Math.round(t*e)/e===t)return i;return function(t){var e=t.toString().toLowerCase(),i=e.indexOf("e"),n=i>0?+e.slice(i+1):0,r=i>0?i:e.length,o=e.indexOf("."),s=o<0?0:r-1-o;return Math.max(0,s-n)}(t)}function ub(t,e){var i=Math.max(cb(t),cb(e)),n=t+e;return i>20?n:hb(n,i)}function db(t){var e=2*Math.PI;return(t%e+e)%e}function pb(t){return t>-1e-4&&t=10&&e++,e}function vb(t,e){var i=mb(t),n=Math.pow(10,i),r=t/n;return t=(r<1.5?1:r<2.5?2:r<4?3:r<7?5:10)*n,i>=-20?+t.toFixed(i<0?-i:0):t}function yb(t){var e=parseFloat(t);return e==t&&(0!==e||!af(t)||t.indexOf("x")<=0)?e:NaN}function bb(){return Math.round(9*Math.random())}function wb(t,e){return 0===e?t:wb(e,t%e)}function xb(t,e){return null==t?e:null==e?t:t*e/wb(t,e)}function _b(t){throw new Error(t)}function kb(t,e,i){return(e-t)*i+t}var Sb="series\0";function Ab(t){return t instanceof Array?t:null==t?[]:[t]}function Cb(t,e,i){if(t){t[e]=t[e]||{},t.emphasis=t.emphasis||{},t.emphasis[e]=t.emphasis[e]||{};for(var n=0,r=i.length;n=0,o=!1;if(t instanceof Py){var s=qb(t),a=r&&s.selectFill||s.normalFill,l=r&&s.selectStroke||s.normalStroke;if(iw(a)||iw(l)){var h=(n=n||{}).style||{};"inherit"===h.fill?(o=!0,n=Gp({},n),(h=Gp({},h)).fill=a):!iw(h.fill)&&iw(a)?(o=!0,n=Gp({},n),(h=Gp({},h)).fill=Zm(a)):!iw(h.stroke)&&iw(l)&&(o||(n=Gp({},n),h=Gp({},h)),h.stroke=Zm(l)),n.style=h}}if(n&&null==n.z2){o||(n=Gp({},n));var c=t.z2EmphasisLift;n.z2=t.z2+(null!=c?c:10)}return n}(this,0,e,i);if("blur"===t)return function(t,e,i){var n=Yp(t.currentStates,e)>=0,r=t.style.opacity,o=n?null:function(t,e,i,n){for(var r=t.style,o={},s=0;s0){var o={dataIndex:r,seriesIndex:t.seriesIndex};null!=n&&(o.dataType=n),e.push(o)}}))})),e}function Tw(t,e,i){Lw(t,!0),uw(t,fw),function(t,e,i){var n=Ub(t);null!=e?(n.focus=e,n.blurScope=i):n.focus&&(n.focus=null)}(t,e,i)}function Iw(t,e,i,n){n?function(t){Lw(t,!1)}(t):Tw(t,e,i)}var Ow=["emphasis","blur","select"],Ew={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function Pw(t,e,i,n){i=i||"itemStyle";for(var r=0;r1&&(s*=Hw(f),a*=Hw(f));var g=(r===o?-1:1)*Hw((s*s*(a*a)-s*s*(p*p)-a*a*(d*d))/(s*s*(p*p)+a*a*(d*d)))||0,m=g*s*p/a,v=g*-a*d/s,y=(t+i)/2+Uw(u)*m-Ww(u)*v,b=(e+n)/2+Ww(u)*m+Uw(u)*v,w=Yw([1,0],[(d-m)/s,(p-v)/a]),x=[(d-m)/s,(p-v)/a],_=[(-1*d-m)/s,(-1*p-v)/a],k=Yw(x,_);if(qw(x,_)<=-1&&(k=jw),qw(x,_)>=1&&(k=0),k<0){var S=Math.round(k/jw*1e6)/1e6;k=2*jw+S%2*jw}c.addData(h,y,b,s,a,w,k,u,o)}var Kw=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/gi,Zw=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;var Jw=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Sp(e,t),e.prototype.applyTransform=function(t){},e}(Py);function Qw(t){return null!=t.setData}function tx(t,e){var i=function(t){var e=new py;if(!t)return e;var i,n=0,r=0,o=n,s=r,a=py.CMD,l=t.match(Kw);if(!l)return e;for(var h=0;h=0&&(i.splice(n,0,t),this._doAdd(t))}return this},e.prototype.replace=function(t,e){var i=Yp(this._children,t);return i>=0&&this.replaceAt(e,i),this},e.prototype.replaceAt=function(t,e){var i=this._children,n=i[e];if(t&&t!==this&&t.parent!==this&&t!==n){i[e]=t,n.parent=null;var r=this.__zr;r&&n.removeSelfFromZr(r),this._doAdd(t)}return this},e.prototype._doAdd=function(t){t.parent&&t.parent.remove(t),t.parent=this;var e=this.__zr;e&&e!==t.__zr&&t.addSelfToZr(e),e&&e.refresh()},e.prototype.remove=function(t){var e=this.__zr,i=this._children,n=Yp(i,t);return n<0||(i.splice(n,1),t.parent=null,e&&t.removeSelfFromZr(e),e&&e.refresh()),this},e.prototype.removeAll=function(){for(var t=this._children,e=this.__zr,i=0;iI*I+O*O&&(S=C,A=M),{cx:S,cy:A,x0:-c,y0:-u,x1:S*(r/x-1),y1:A*(r/x-1)}}function yx(t,e){var i,n=fx(e.r,0),r=fx(e.r0||0,0),o=n>0;if(o||r>0){if(o||(n=r,r=0),r>n){var s=n;n=r,r=s}var a=e.startAngle,l=e.endAngle;if(!isNaN(a)&&!isNaN(l)){var h=e.cx,c=e.cy,u=!!e.clockwise,d=dx(l-a),p=d>ax&&d%ax;if(p>mx&&(d=p),n>mx)if(d>ax-mx)t.moveTo(h+n*hx(a),c+n*lx(a)),t.arc(h,c,n,a,l,!u),r>mx&&(t.moveTo(h+r*hx(l),c+r*lx(l)),t.arc(h,c,r,l,a,u));else{var f=void 0,g=void 0,m=void 0,v=void 0,y=void 0,b=void 0,w=void 0,x=void 0,_=void 0,k=void 0,S=void 0,A=void 0,C=void 0,M=void 0,D=void 0,T=void 0,I=n*hx(a),O=n*lx(a),E=r*hx(l),P=r*lx(l),L=d>mx;if(L){var R=e.cornerRadius;R&&(i=function(t){var e;if(of(t)){var i=t.length;if(!i)return t;e=1===i?[t[0],t[0],0,0]:2===i?[t[0],t[0],t[1],t[1]]:3===i?t.concat(t[2]):t}else e=[t,t,t,t];return e}(R),f=i[0],g=i[1],m=i[2],v=i[3]);var N=dx(n-r)/2;if(y=gx(N,m),b=gx(N,v),w=gx(N,f),x=gx(N,g),S=_=fx(y,b),A=k=fx(w,x),(_>mx||k>mx)&&(C=n*hx(l),M=n*lx(l),D=r*hx(a),T=r*lx(a),dmx){var U=gx(m,S),j=gx(v,S),G=vx(D,T,I,O,n,U,u),q=vx(C,M,E,P,n,j,u);t.moveTo(h+G.cx+G.x0,c+G.cy+G.y0),S<_&&U===j?t.arc(h+G.cx,c+G.cy,S,ux(G.y0,G.x0),ux(q.y0,q.x0),!u):(U>0&&t.arc(h+G.cx,c+G.cy,U,ux(G.y0,G.x0),ux(G.y1,G.x1),!u),t.arc(h,c,n,ux(G.cy+G.y1,G.cx+G.x1),ux(q.cy+q.y1,q.cx+q.x1),!u),j>0&&t.arc(h+q.cx,c+q.cy,j,ux(q.y1,q.x1),ux(q.y0,q.x0),!u))}else t.moveTo(h+I,c+O),t.arc(h,c,n,a,l,!u);else t.moveTo(h+I,c+O);if(r>mx&&L)if(A>mx){U=gx(f,A),G=vx(E,P,C,M,r,-(j=gx(g,A)),u),q=vx(I,O,D,T,r,-U,u);t.lineTo(h+G.cx+G.x0,c+G.cy+G.y0),A0&&t.arc(h+G.cx,c+G.cy,j,ux(G.y0,G.x0),ux(G.y1,G.x1),!u),t.arc(h,c,r,ux(G.cy+G.y1,G.cx+G.x1),ux(q.cy+q.y1,q.cx+q.x1),u),U>0&&t.arc(h+q.cx,c+q.cy,U,ux(q.y1,q.x1),ux(q.y0,q.x0),!u))}else t.lineTo(h+E,c+P),t.arc(h,c,r,l,a,u);else t.lineTo(h+E,c+P)}else t.moveTo(h,c);t.closePath()}}}var bx=function(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0,this.cornerRadius=0},xx=function(t){function e(e){return t.call(this,e)||this}return Sp(e,t),e.prototype.getDefaultShape=function(){return new bx},e.prototype.buildPath=function(t,e){yx(t,e)},e.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},e}(Py);xx.prototype.type="sector";var _x=function(){this.cx=0,this.cy=0,this.r=0,this.r0=0},kx=function(t){function e(e){return t.call(this,e)||this}return Sp(e,t),e.prototype.getDefaultShape=function(){return new _x},e.prototype.buildPath=function(t,e){var i=e.cx,n=e.cy,r=2*Math.PI;t.moveTo(i+e.r,n),t.arc(i,n,e.r,0,r,!1),t.moveTo(i+e.r0,n),t.arc(i,n,e.r0,0,r,!0)},e}(Py);function Sx(t,e,i){var n=e.smooth,r=e.points;if(r&&r.length>=2){if(n){var o=function(t,e,i,n){var r,o,s,a,l=[],h=[],c=[],u=[];if(n){s=[1/0,1/0],a=[-1/0,-1/0];for(var d=0,p=t.length;dWx[1]){if(s=!1,r)return s;var h=Math.abs(Wx[0]-Hx[1]),c=Math.abs(Hx[0]-Wx[1]);Math.min(h,c)>n.len()&&(h0){var u={duration:c.duration,delay:c.delay||0,easing:c.easing,done:o,force:!!o||!!s,setToFinal:!h,scope:t,during:s};l?e.animateFrom(i,u):e.animateTo(i,u)}else e.stopAnimation(),!l&&e.attr(i),s&&s(1),o&&o()}function Zx(t,e,i,n,r,o){Kx("update",t,e,i,n,r,o)}function Jx(t,e,i,n,r,o){Kx("enter",t,e,i,n,r,o)}function Qx(t){if(!t.__zr)return!0;for(var e=0;e=-1e-6)return!1;var f=t-r,g=e-o,m=x_(f,g,h,c)/p;if(m<0||m>1)return!1;var v=x_(f,g,u,d)/p;return!(v<0||v>1)}function x_(t,e,i,n){return t*n-i*e}function __(t){var e=t.itemTooltipOption,i=t.componentModel,n=t.itemName,r=af(e)?{formatter:e}:e,o=i.mainType,s=i.componentIndex,a={componentType:o,name:n,$vars:["name"]};a[o+"Index"]=s;var l=t.formatterParamsExtra;l&&Zp(ef(l),(function(t){Ef(a,t)||(a[t]=l[t],a.$vars.push(t))}));var h=Ub(t.el);h.componentMainType=o,h.componentIndex=s,h.tooltipConfig={name:n,option:qp({content:n,encodeHTMLContent:!0,formatterParams:a},r)}}function k_(t,e){var i;t.isGroup&&(i=e(t)),i||t.traverse(e)}function S_(t,e){if(t)if(of(t))for(var i=0;i=i&&o>=r)return{x:i,y:r,width:n-i,height:o-r}},createIcon:b_,extendPath:function(t,e){return a_(t,e)},extendShape:function(t){return Py.extend(t)},getShapeClass:function(t){if(s_.hasOwnProperty(t))return s_[t]},getTransform:function(t,e){for(var i=ng([]);t&&t!==e;)rg(i,t.getLocalTransform(),i),t=t.parent;return i},groupTransition:y_,initProps:Jx,isElementRemoved:Qx,lineLineIntersect:w_,linePolygonIntersect:function(t,e,i,n,r){for(var o=0,s=r[r.length-1];oMath.abs(o[1])?o[0]>0?"right":"left":o[1]>0?"bottom":"top"},traverseElements:S_,updateProps:Zx}),C_={};function M_(t,e,i){var n,r=t.labelFetcher,o=t.labelDataIndex,s=t.labelDimIndex,a=e.normal;r&&(n=r.getFormattedLabel(o,"normal",null,s,a&&a.get("formatter"),null!=i?{interpolatedValue:i}:null)),null==n&&(n=sf(t.defaultText)?t.defaultText(o,t,i):t.defaultText);for(var l={normal:n},h=0;h1){var h=a.shift();1===a.length&&(i[s]=a[0]),this._update&&this._update(h,o)}else 1===l?(i[s]=null,this._update&&this._update(a,o)):this._remove&&this._remove(o)}this._performRestAdd(r,i)},t.prototype._executeMultiple=function(){var t=this._old,e=this._new,i={},n={},r=[],o=[];this._initIndexMap(t,i,r,"_oldKeyGetter"),this._initIndexMap(e,n,o,"_newKeyGetter");for(var s=0;s1&&1===u)this._updateManyToOne&&this._updateManyToOne(h,l),n[a]=null;else if(1===c&&u>1)this._updateOneToMany&&this._updateOneToMany(h,l),n[a]=null;else if(1===c&&1===u)this._update&&this._update(h,l),n[a]=null;else if(c>1&&u>1)this._updateManyToMany&&this._updateManyToMany(h,l),n[a]=null;else if(c>1)for(var d=0;d1)for(var s=0;sh&&(h=p)}a[0]=l,a[1]=h}},n=function(){return this._data?this._data.length/this._dimSize:0};function r(t){for(var e=0;ee},gte:function(t,e){return t>=e}},Xk=function(){function t(t,e){if(!hf(e)){_b("")}this._opFn=Yk[t],this._rvalFloat=yb(e)}return t.prototype.evaluate=function(t){return hf(t)?this._opFn(t,this._rvalFloat):this._opFn(yb(t),this._rvalFloat)},t}(),Kk=function(){function t(t,e){var i="desc"===t;this._resultLT=i?1:-1,null==e&&(e=i?"min":"max"),this._incomparable="min"===e?-1/0:1/0}return t.prototype.evaluate=function(t,e){var i=hf(t)?t:yb(t),n=hf(e)?e:yb(e),r=isNaN(i),o=isNaN(n);if(r&&(i=this._incomparable),o&&(n=this._incomparable),r&&o){var s=af(t),a=af(e);s&&(i=a?t:0),a&&(n=s?e:0)}return in?-this._resultLT:0},t}(),Zk=function(){function t(t,e){this._rval=e,this._isEQ=t,this._rvalTypeof=typeof e,this._rvalFloat=yb(e)}return t.prototype.evaluate=function(t){var e=t===this._rval;if(!e){var i=typeof t;i===this._rvalTypeof||"number"!==i&&"number"!==this._rvalTypeof||(e=yb(t)===this._rvalFloat)}return this._isEQ?e:!e},t}();function Jk(t,e){return"eq"===t||"ne"===t?new Zk("eq"===t,e):Ef(Yk,t)?new Xk(t,e):null}var Qk,tS="undefined",eS=typeof Uint32Array===tS?Array:Uint32Array,iS=typeof Uint16Array===tS?Array:Uint16Array,nS=typeof Int32Array===tS?Array:Int32Array,rS=typeof Float64Array===tS?Array:Float64Array,oS={float:rS,int:nS,ordinal:Array,number:Array,time:rS};function sS(t){return t>65535?eS:iS}function aS(t,e,i,n,r){var o=oS[i||"float"];if(r){var s=t[e],a=s&&s.length;if(a!==n){for(var l=new o(n),h=0;hg[1]&&(g[1]=f)}return this._rawCount=this._count=a,{start:s,end:a}},t.prototype._initDataFromProvider=function(t,e,i){for(var n=this._provider,r=this._chunks,o=this._dimensions,s=o.length,a=this._rawExtent,l=Jp(o,(function(t){return t.property})),h=0;hm[1]&&(m[1]=g)}}!n.persistent&&n.clean&&n.clean(),this._rawCount=this._count=e,this._extent=[]},t.prototype.count=function(){return this._count},t.prototype.get=function(t,e){if(!(e>=0&&e=0&&e=this._rawCount||t<0)return-1;if(!this._indices)return t;var e=this._indices,i=e[t];if(null!=i&&it))return o;r=o-1}}return-1},t.prototype.indicesOfNearest=function(t,e,i){var n=this._chunks[t],r=[];if(!n)return r;null==i&&(i=1/0);for(var o=1/0,s=-1,a=0,l=0,h=this.count();l=0&&s<0)&&(o=u,s=c,a=0),c===s&&(r[a++]=l))}return r.length=a,r},t.prototype.getIndices=function(){var t,e=this._indices;if(e){var i=e.constructor,n=this._count;if(i===Array){t=new i(n);for(var r=0;r=h&&b<=c||isNaN(b))&&(s[a++]=p),p++}d=!0}else if(2===r){f=u[n[0]];var m=u[n[1]],v=t[n[1]][0],y=t[n[1]][1];for(g=0;g=h&&b<=c||isNaN(b))&&(w>=v&&w<=y||isNaN(w))&&(s[a++]=p),p++}d=!0}}if(!d)if(1===r)for(g=0;g=h&&b<=c||isNaN(b))&&(s[a++]=x)}else for(g=0;gt[S][1])&&(_=!1)}_&&(s[a++]=e.getRawIndex(g))}return am[1]&&(m[1]=g)}}}},t.prototype.lttbDownSample=function(t,e){var i,n,r,o=this.clone([t],!0),s=o._chunks[t],a=this.count(),l=0,h=Math.floor(1/e),c=this.getRawIndex(0),u=new(sS(this._rawCount))(Math.min(2*(Math.ceil(a/h)+2),a));u[l++]=c;for(var d=1;di&&(i=n,r=A)}S>0&&Sh-p&&(a=h-p,s.length=a);for(var f=0;fc[1]&&(c[1]=m),u[d++]=v}return r._count=d,r._indices=u,r._updateGetRawIdx(),r},t.prototype.each=function(t,e){if(this._count)for(var i=t.length,n=this._chunks,r=0,o=this.count();rs&&(s=l)}return n=[o,s],this._extent[t]=n,n},t.prototype.getRawDataItem=function(t){var e=this.getRawIndex(t);if(this._provider.persistent)return this._provider.getItem(e);for(var i=[],n=this._chunks,r=0;r=0?this._indices[t]:-1},t.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},t.internalField=function(){function t(t,e,i,n){return jk(t[n],this._dimensions[n])}Qk={arrayRows:t,objectRows:function(t,e,i,n){return jk(t[e],this._dimensions[n])},keyedColumns:t,original:function(t,e,i,n){var r=t&&(null==t.value?t:t.value);return jk(r instanceof Array?r[n]:r,this._dimensions[n])},typedArray:function(t,e,i,n){return t[n]}}}(),t}(),hS=Bb(),cS={float:"f",int:"i",ordinal:"o",number:"n",time:"t"},uS=function(){function t(t){this.dimensions=t.dimensions,this._dimOmitted=t.dimensionOmitted,this.source=t.source,this._fullDimCount=t.fullDimensionCount,this._updateDimOmitted(t.dimensionOmitted)}return t.prototype.isDimensionOmitted=function(){return this._dimOmitted},t.prototype._updateDimOmitted=function(t){this._dimOmitted=t,t&&(this._dimNameMap||(this._dimNameMap=fS(this.source)))},t.prototype.getSourceDimensionIndex=function(t){return vf(this._dimNameMap.get(t),-1)},t.prototype.getSourceDimension=function(t){var e=this.source.dimensionsDefine;if(e)return e[t]},t.prototype.makeStoreSchema=function(){for(var t=this._fullDimCount,e=Tk(this.source),i=!gS(t),n="",r=[],o=0,s=0;o30}var mS,vS,yS,bS,wS,xS,_S,kS=cf,SS=Jp,AS="undefined"==typeof Int32Array?Array:Int32Array,CS=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],MS=["_approximateExtent"],DS=function(){function t(t,e){var i;this.type="list",this._dimOmitted=!1,this._nameList=[],this._idList=[],this._visual={},this._layout={},this._itemVisuals=[],this._itemLayouts=[],this._graphicEls=[],this._approximateExtent={},this._calculationInfo={},this.hasItemOption=!1,this.TRANSFERABLE_METHODS=["cloneShallow","downSample","lttbDownSample","map"],this.CHANGABLE_METHODS=["filterSelf","selectRange"],this.DOWNSAMPLE_METHODS=["downSample","lttbDownSample"];var n=!1;dS(t)?(i=t.dimensions,this._dimOmitted=t.isDimensionOmitted(),this._schema=t):(n=!0,i=t),i=i||["x","y"];for(var r={},o=[],s={},a=!1,l={},h=0;h=e)){var i=this._store.getProvider();this._updateOrdinalMeta();var n=this._nameList,r=this._idList;if(i.getSource().sourceFormat===tk&&!i.pure)for(var o=[],s=t;s0},t.prototype.ensureUniqueItemVisual=function(t,e){var i=this._itemVisuals,n=i[t];n||(n=i[t]={});var r=n[e];return null==r&&(of(r=this.getVisual(e))?r=r.slice():kS(r)&&(r=Gp({},r)),n[e]=r),r},t.prototype.setItemVisual=function(t,e,i){var n=this._itemVisuals[t]||{};this._itemVisuals[t]=n,kS(e)?Gp(n,e):n[e]=i},t.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},t.prototype.setLayout=function(t,e){kS(t)?Gp(this._layout,t):this._layout[t]=e},t.prototype.getLayout=function(t){return this._layout[t]},t.prototype.getItemLayout=function(t){return this._itemLayouts[t]},t.prototype.setItemLayout=function(t,e,i){this._itemLayouts[t]=i?Gp(this._itemLayouts[t]||{},e):e},t.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},t.prototype.setItemGraphicEl=function(t,e){!function(t,e,i,n){if(n){var r=Ub(n);r.dataIndex=i,r.dataType=e,r.seriesIndex=t,r.ssrType="chart","group"===n.type&&n.traverse((function(n){var r=Ub(n);r.seriesIndex=t,r.dataIndex=i,r.dataType=e,r.ssrType="chart"}))}}(this.hostModel&&this.hostModel.seriesIndex,this.dataType,t,e),this._graphicEls[t]=e},t.prototype.getItemGraphicEl=function(t){return this._graphicEls[t]},t.prototype.eachItemGraphicEl=function(t,e){Zp(this._graphicEls,(function(i,n){i&&t&&t.call(e,i,n)}))},t.prototype.cloneShallow=function(e){return e||(e=new t(this._schema?this._schema:SS(this.dimensions,this._getDimInfo,this),this.hostModel)),wS(e,this),e._store=this._store,e},t.prototype.wrapMethod=function(t,e){var i=this[t];sf(i)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(t),this[t]=function(){var t=i.apply(this,arguments);return e.apply(this,[t].concat(bf(arguments)))})},t.internalField=(mS=function(t){var e=t._invertedIndicesMap;Zp(e,(function(i,n){var r=t._dimInfos[n],o=r.ordinalMeta,s=t._store;if(o){i=e[n]=new AS(o.categories.length);for(var a=0;a1&&(a+="__ec__"+h),n[e]=a}})),t}();function TS(t,e){kk(t)||(t=Ak(t));var i=(e=e||{}).coordDimensions||[],n=e.dimensionsDefine||t.dimensionsDefine||[],r=Tf(),o=[],s=function(t,e,i,n){var r=Math.max(t.dimensionsDetectedCount||1,e.length,i.length,n||0);return Zp(e,(function(t){var e;cf(t)&&(e=t.dimsDef)&&(r=Math.max(r,e.length))})),r}(t,i,n,e.dimensionsCount),a=e.canOmitUnusedDimensions&&gS(s),l=n===t.dimensionsDefine,h=l?fS(t):pS(n),c=e.encodeDefine;!c&&e.encodeDefaulter&&(c=e.encodeDefaulter(t,s));for(var u=Tf(c),d=new nS(s),p=0;p0&&(n.name=r+(o-1)),o++,e.set(r,o)}}(o),new uS({source:t,dimensions:o,fullDimensionCount:s,dimensionOmitted:a})}function IS(t,e,i){if(i||e.hasKey(t)){for(var n=0;e.hasKey(t+n);)n++;t+=n}return e.set(t,!0),t}var OS={},ES=function(){function t(){this._coordinateSystems=[]}return t.prototype.create=function(t,e){var i=[];Zp(OS,(function(n,r){var o=n.create(t,e);i=i.concat(o||[])})),this._coordinateSystems=i},t.prototype.update=function(t,e){Zp(this._coordinateSystems,(function(i){i.update&&i.update(t,e)}))},t.prototype.getCoordinateSystems=function(){return this._coordinateSystems.slice()},t.register=function(t,e){OS[t]=e},t.get=function(t){return OS[t]},t}(),PS=function(t){this.coordSysDims=[],this.axisMap=Tf(),this.categoryAxisMap=Tf(),this.coordSysName=t};var LS={cartesian2d:function(t,e,i,n){var r=t.getReferringComponents("xAxis",Vb).models[0],o=t.getReferringComponents("yAxis",Vb).models[0];e.coordSysDims=["x","y"],i.set("x",r),i.set("y",o),RS(r)&&(n.set("x",r),e.firstCategoryDimIndex=0),RS(o)&&(n.set("y",o),null==e.firstCategoryDimIndex&&(e.firstCategoryDimIndex=1))},singleAxis:function(t,e,i,n){var r=t.getReferringComponents("singleAxis",Vb).models[0];e.coordSysDims=["single"],i.set("single",r),RS(r)&&(n.set("single",r),e.firstCategoryDimIndex=0)},polar:function(t,e,i,n){var r=t.getReferringComponents("polar",Vb).models[0],o=r.findAxisModel("radiusAxis"),s=r.findAxisModel("angleAxis");e.coordSysDims=["radius","angle"],i.set("radius",o),i.set("angle",s),RS(o)&&(n.set("radius",o),e.firstCategoryDimIndex=0),RS(s)&&(n.set("angle",s),null==e.firstCategoryDimIndex&&(e.firstCategoryDimIndex=1))},geo:function(t,e,i,n){e.coordSysDims=["lng","lat"]},parallel:function(t,e,i,n){var r=t.ecModel,o=r.getComponent("parallel",t.get("parallelIndex")),s=e.coordSysDims=o.dimensions.slice();Zp(o.parallelAxisIndex,(function(t,o){var a=r.getComponent("parallelAxis",t),l=s[o];i.set(l,a),RS(a)&&(n.set(l,a),null==e.firstCategoryDimIndex&&(e.firstCategoryDimIndex=o))}))}};function RS(t){return"category"===t.get("type")}function NS(t,e,i){var n,r,o,s=(i=i||{}).byIndex,a=i.stackedCoordDimension;!function(t){return!dS(t.schema)}(e)?(r=e.schema,n=r.dimensions,o=e.store):n=e;var l,h,c,u,d=!(!t||!t.get("stack"));if(Zp(n,(function(t,e){af(t)&&(n[e]=t={name:t}),d&&!t.isExtraCoord&&(s||l||!t.ordinalMeta||(l=t),h||"ordinal"===t.type||"time"===t.type||a&&a!==t.coordDim||(h=t))})),!h||s||l||(s=!0),h){c="__\0ecstackresult_"+t.id,u="__\0ecstackedover_"+t.id,l&&(l.createInvertedIndices=!0);var p=h.coordDim,f=h.type,g=0;Zp(n,(function(t){t.coordDim===p&&g++}));var m={name:c,coordDim:p,coordDimIndex:g,type:f,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:n.length},v={name:u,coordDim:u,coordDimIndex:g+1,type:f,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:n.length+1};r?(o&&(m.storeDimIndex=o.ensureCalculationDimension(u,f),v.storeDimIndex=o.ensureCalculationDimension(c,f)),r.appendCalculationDimension(m),r.appendCalculationDimension(v)):(n.push(m),n.push(v))}return{stackedDimension:h&&h.name,stackedByDimension:l&&l.name,isStackedByIndex:s,stackedOverDimension:u,stackResultDimension:c}}function BS(t,e){return!!e&&e===t.getCalculationInfo("stackedDimension")}function zS(t,e,i){i=i||{};var n,r,o=e.getSourceManager();r=(n=o.getSource()).sourceFormat===tk;var s=function(t){var e=t.get("coordinateSystem"),i=new PS(e),n=LS[e];if(n)return n(t,i,i.axisMap,i.categoryAxisMap),i}(e),a=function(t,e){var i,n=t.get("coordinateSystem"),r=ES.get(n);return e&&e.coordSysDims&&(i=Jp(e.coordSysDims,(function(t){var i={name:t},n=e.axisMap.get(t);if(n){var r=n.get("type");i.type=function(t){return"category"===t?"ordinal":"time"===t?"time":"float"}(r)}return i}))),i||(i=r&&(r.getDimensionsInfo?r.getDimensionsInfo():r.dimensions.slice())||["x","y"]),i}(e,s),l=i.useEncodeDefaulter,h=sf(l)?l:l?rf(dk,a,e):null,c=TS(n,{coordDimensions:a,generateCoord:i.generateCoord,encodeDefine:e.getEncode(),encodeDefaulter:h,canOmitUnusedDimensions:!r}),u=function(t,e,i){var n,r;return i&&Zp(t,(function(t,o){var s=t.coordDim,a=i.categoryAxisMap.get(s);a&&(null==n&&(n=o),t.ordinalMeta=a.getOrdinalMeta(),e&&(t.createInvertedIndices=!0)),null!=t.otherDims.itemName&&(r=!0)})),r||null==n||(t[n].otherDims.itemName=0),n}(c.dimensions,i.createInvertedIndices,s),d=r?null:o.getSharedDataStore(c),p=NS(e,{schema:c,store:d}),f=new DS(c,e);f.setCalculationInfo(p);var g=null!=u&&function(t){if(t.sourceFormat===tk){var e=function(t){var e=0;for(;e>1)%2;s.style.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",n[a]+":0",r[l]+":0",n[1-a]+":auto",r[1-l]+":auto",""].join("!important;"),t.appendChild(s),i.push(s)}return i}(e,o),a=function(t,e,i){for(var n=i?"invTrans":"trans",r=e[n],o=e.srcCoords,s=[],a=[],l=!0,h=0;h<4;h++){var c=t[h].getBoundingClientRect(),u=2*h,d=c.left,p=c.top;s.push(d,p),l=l&&o&&d===o[u]&&p===o[u+1],a.push(t[h].offsetLeft,t[h].offsetTop)}return l&&r?r:(e.srcCoords=s,e[n]=i?US(a,s):US(s,a))}(s,o,r);if(a)return a(t,i,n),!0}return!1}function YS(t){return"CANVAS"===t.nodeName.toUpperCase()}var XS=/([&<>"'])/g,KS={"&":"&","<":"<",">":">",'"':""","'":"'"};function ZS(t){return null==t?"":(t+"").replace(XS,(function(t,e){return KS[e]}))}var JS="ZH",QS="EN",tA=QS,eA={},iA={},nA=Nf.domSupported&&(document.documentElement.lang||navigator.language||navigator.browserLanguage||tA).toUpperCase().indexOf(JS)>-1?JS:tA;function rA(t,e){t=t.toUpperCase(),iA[t]=new X_(e),eA[t]=e}rA(QS,{time:{month:["January","February","March","April","May","June","July","August","September","October","November","December"],monthAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayOfWeekAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},legend:{selector:{all:"All",inverse:"Inv"}},toolbox:{brush:{title:{rect:"Box Select",polygon:"Lasso Select",lineX:"Horizontally Select",lineY:"Vertically Select",keep:"Keep Selections",clear:"Clear Selections"}},dataView:{title:"Data View",lang:["Data View","Close","Refresh"]},dataZoom:{title:{zoom:"Zoom",back:"Zoom Reset"}},magicType:{title:{line:"Switch to Line Chart",bar:"Switch to Bar Chart",stack:"Stack",tiled:"Tile"}},restore:{title:"Restore"},saveAsImage:{title:"Save as Image",lang:["Right Click to Save Image"]}},series:{typeNames:{pie:"Pie chart",bar:"Bar chart",line:"Line chart",scatter:"Scatter plot",effectScatter:"Ripple scatter plot",radar:"Radar chart",tree:"Tree",treemap:"Treemap",boxplot:"Boxplot",candlestick:"Candlestick",k:"K line chart",heatmap:"Heat map",map:"Map",parallel:"Parallel coordinate map",lines:"Line graph",graph:"Relationship graph",sankey:"Sankey diagram",funnel:"Funnel chart",gauge:"Gauge",pictorialBar:"Pictorial bar",themeRiver:"Theme River Map",sunburst:"Sunburst",custom:"Custom chart",chart:"Chart"}},aria:{general:{withTitle:'This is a chart about "{title}"',withoutTitle:"This is a chart"},series:{single:{prefix:"",withName:" with type {seriesType} named {seriesName}.",withoutName:" with type {seriesType}."},multiple:{prefix:". It consists of {seriesCount} series count.",withName:" The {seriesId} series is a {seriesType} representing {seriesName}.",withoutName:" The {seriesId} series is a {seriesType}.",separator:{middle:"",end:""}}},data:{allData:"The data is as follows: ",partialData:"The first {displayCnt} items are: ",withName:"the data for {name} is {value}",withoutName:"{value}",separator:{middle:", ",end:". "}}}}),rA(JS,{time:{month:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthAbbr:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dayOfWeek:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayOfWeekAbbr:["日","一","二","三","四","五","六"]},legend:{selector:{all:"全选",inverse:"反选"}},toolbox:{brush:{title:{rect:"矩形选择",polygon:"圈选",lineX:"横向选择",lineY:"纵向选择",keep:"保持选择",clear:"清除选择"}},dataView:{title:"数据视图",lang:["数据视图","关闭","刷新"]},dataZoom:{title:{zoom:"区域缩放",back:"区域缩放还原"}},magicType:{title:{line:"切换为折线图",bar:"切换为柱状图",stack:"切换为堆叠",tiled:"切换为平铺"}},restore:{title:"还原"},saveAsImage:{title:"保存为图片",lang:["右键另存为图片"]}},series:{typeNames:{pie:"饼图",bar:"柱状图",line:"折线图",scatter:"散点图",effectScatter:"涟漪散点图",radar:"雷达图",tree:"树图",treemap:"矩形树图",boxplot:"箱型图",candlestick:"K线图",k:"K线图",heatmap:"热力图",map:"地图",parallel:"平行坐标图",lines:"线图",graph:"关系图",sankey:"桑基图",funnel:"漏斗图",gauge:"仪表盘图",pictorialBar:"象形柱图",themeRiver:"主题河流图",sunburst:"旭日图",custom:"自定义图表",chart:"图表"}},aria:{general:{withTitle:"这是一个关于“{title}”的图表。",withoutTitle:"这是一个图表,"},series:{single:{prefix:"",withName:"图表类型是{seriesType},表示{seriesName}。",withoutName:"图表类型是{seriesType}。"},multiple:{prefix:"它由{seriesCount}个图表系列组成。",withName:"第{seriesId}个系列是一个表示{seriesName}的{seriesType},",withoutName:"第{seriesId}个系列是一个{seriesType},",separator:{middle:";",end:"。"}}},data:{allData:"其数据是——",partialData:"其中,前{displayCnt}项是——",withName:"{name}的数据是{value}",withoutName:"{value}",separator:{middle:",",end:""}}}});var oA=1e3,sA=6e4,aA=36e5,lA=864e5,hA=31536e6,cA={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}",none:"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}"},uA="{yyyy}-{MM}-{dd}",dA={year:"{yyyy}",month:"{yyyy}-{MM}",day:uA,hour:uA+" "+cA.hour,minute:uA+" "+cA.minute,second:uA+" "+cA.second,millisecond:cA.none},pA=["year","month","day","hour","minute","second","millisecond"],fA=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function gA(t,e){return"0000".substr(0,e-(t+="").length)+t}function mA(t){switch(t){case"half-year":case"quarter":return"month";case"week":case"half-week":return"day";case"half-day":case"quarter-day":return"hour";default:return t}}function vA(t){return t===mA(t)}function yA(t,e,i,n){var r=gb(t),o=r[xA(i)](),s=r[_A(i)]()+1,a=Math.floor((s-1)/3)+1,l=r[kA(i)](),h=r["get"+(i?"UTC":"")+"Day"](),c=r[SA(i)](),u=(c-1)%12+1,d=r[AA(i)](),p=r[CA(i)](),f=r[MA(i)](),g=c>=12?"pm":"am",m=g.toUpperCase(),v=n instanceof X_?n:function(t){return iA[t]}(n||nA)||iA[tA],y=v.getModel("time"),b=y.get("month"),w=y.get("monthAbbr"),x=y.get("dayOfWeek"),_=y.get("dayOfWeekAbbr");return(e||"").replace(/{a}/g,g+"").replace(/{A}/g,m+"").replace(/{yyyy}/g,o+"").replace(/{yy}/g,gA(o%100+"",2)).replace(/{Q}/g,a+"").replace(/{MMMM}/g,b[s-1]).replace(/{MMM}/g,w[s-1]).replace(/{MM}/g,gA(s,2)).replace(/{M}/g,s+"").replace(/{dd}/g,gA(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,x[h]).replace(/{ee}/g,_[h]).replace(/{e}/g,h+"").replace(/{HH}/g,gA(c,2)).replace(/{H}/g,c+"").replace(/{hh}/g,gA(u+"",2)).replace(/{h}/g,u+"").replace(/{mm}/g,gA(d,2)).replace(/{m}/g,d+"").replace(/{ss}/g,gA(p,2)).replace(/{s}/g,p+"").replace(/{SSS}/g,gA(f,3)).replace(/{S}/g,f+"")}function bA(t,e){var i=gb(t),n=i[_A(e)]()+1,r=i[kA(e)](),o=i[SA(e)](),s=i[AA(e)](),a=i[CA(e)](),l=0===i[MA(e)](),h=l&&0===a,c=h&&0===s,u=c&&0===o,d=u&&1===r;return d&&1===n?"year":d?"month":u?"day":c?"hour":h?"minute":l?"second":"millisecond"}function wA(t,e,i){var n=hf(t)?gb(t):t;switch(e=e||bA(t,i)){case"year":return n[xA(i)]();case"half-year":return n[_A(i)]()>=6?1:0;case"quarter":return Math.floor((n[_A(i)]()+1)/4);case"month":return n[_A(i)]();case"day":return n[kA(i)]();case"half-day":return n[SA(i)]()/24;case"hour":return n[SA(i)]();case"minute":return n[AA(i)]();case"second":return n[CA(i)]();case"millisecond":return n[MA(i)]()}}function xA(t){return t?"getUTCFullYear":"getFullYear"}function _A(t){return t?"getUTCMonth":"getMonth"}function kA(t){return t?"getUTCDate":"getDate"}function SA(t){return t?"getUTCHours":"getHours"}function AA(t){return t?"getUTCMinutes":"getMinutes"}function CA(t){return t?"getUTCSeconds":"getSeconds"}function MA(t){return t?"getUTCMilliseconds":"getMilliseconds"}function DA(t){return t?"setUTCFullYear":"setFullYear"}function TA(t){return t?"setUTCMonth":"setMonth"}function IA(t){return t?"setUTCDate":"setDate"}function OA(t){return t?"setUTCHours":"setHours"}function EA(t){return t?"setUTCMinutes":"setMinutes"}function PA(t){return t?"setUTCSeconds":"setSeconds"}function LA(t){return t?"setUTCMilliseconds":"setMilliseconds"}function RA(t){if(isNaN(yb(t)))return af(t)?t:"-";var e=(t+"").split(".");return e[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(e.length>1?"."+e[1]:"")}function NA(t,e){return t=(t||"").toLowerCase().replace(/-(.)/g,(function(t,e){return e.toUpperCase()})),e&&t&&(t=t.charAt(0).toUpperCase()+t.slice(1)),t}var BA=wf;function zA(t,e,i){function n(t){return t&&_f(t)?t:"-"}function r(t){return!(null==t||isNaN(t)||!isFinite(t))}var o="time"===e,s=t instanceof Date;if(o||s){var a=o?gb(t):t;if(!isNaN(+a))return yA(a,"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}",i);if(s)return"-"}if("ordinal"===e)return lf(t)?n(t):hf(t)&&r(t)?t+"":"-";var l=yb(t);return r(l)?RA(l):lf(t)?n(t):"boolean"==typeof t?t+"":"-"}var $A=["a","b","c","d","e","f","g"],FA=function(t,e){return"{"+t+(null==e?"":e)+"}"};function VA(t,e,i){of(e)||(e=[e]);var n=e.length;if(!n)return"";for(var r=e[0].$vars||[],o=0;on||l.newline?(o=0,c=g,s+=a+i,a=d.height):a=Math.max(a,d.height)}else{var m=d.height+(f?-f.y+d.y:0);(u=s+m)>r||l.newline?(o+=a+i,s=0,u=m,a=d.width):a=Math.max(a,d.width)}l.newline||(l.x=o,l.y=s,l.markRedraw(),"horizontal"===t?o=c+i:s=u+i)}))}var YA=qA;function XA(t,e,i){i=BA(i||0);var n=e.width,r=e.height,o=lb(t.left,n),s=lb(t.top,r),a=lb(t.right,n),l=lb(t.bottom,r),h=lb(t.width,n),c=lb(t.height,r),u=i[2]+i[0],d=i[1]+i[3],p=t.aspect;switch(isNaN(h)&&(h=n-a-d-o),isNaN(c)&&(c=r-l-u-s),null!=p&&(isNaN(h)&&isNaN(c)&&(p>n/r?h=.8*n:c=.8*r),isNaN(h)&&(h=p*c),isNaN(c)&&(c=h/p)),isNaN(o)&&(o=n-a-h-d),isNaN(s)&&(s=r-l-c-u),t.left||t.right){case"center":o=n/2-h/2-i[3];break;case"right":o=n-h-d}switch(t.top||t.bottom){case"middle":case"center":s=r/2-c/2-i[0];break;case"bottom":s=r-c-u}o=o||0,s=s||0,isNaN(h)&&(h=n-d-o-(a||0)),isNaN(c)&&(c=r-u-s-(l||0));var f=new vg(o+i[3],s+i[0],h,c);return f.margin=i,f}function KA(t){var e=t.layoutMode||t.constructor.layoutMode;return cf(e)?e:e?{type:e}:null}function ZA(t,e,i){var n=i&&i.ignoreSize;!of(n)&&(n=[n,n]);var r=s(GA[0],0),o=s(GA[1],1);function s(i,r){var o={},s=0,h={},c=0;if(UA(i,(function(e){h[e]=t[e]})),UA(i,(function(t){a(e,t)&&(o[t]=h[t]=e[t]),l(o,t)&&s++,l(h,t)&&c++})),n[r])return l(e,i[1])?h[i[2]]=null:l(e,i[2])&&(h[i[1]]=null),h;if(2!==c&&s){if(s>=2)return o;for(var u=0;u=0;s--)o=jp(o,i[s],!0);e.defaultOption=o}return e.defaultOption},e.prototype.getReferringComponents=function(t,e){var i=t+"Index",n=t+"Id";return Hb(this.ecModel,t,{index:this.get(i,!0),id:this.get(n,!0)},e)},e.prototype.getBoxLayoutParams=function(){var t=this;return{left:t.get("left"),top:t.get("top"),right:t.get("right"),bottom:t.get("bottom"),width:t.get("width"),height:t.get("height")}},e.prototype.getZLevelKey=function(){return""},e.prototype.setZLevel=function(t){this.option.zlevel=t},e.protoInitialize=function(){var t=e.prototype;t.type="component",t.id="",t.name="",t.mainType="",t.subType="",t.componentIndex=0}(),e}(X_);Vf(tC,X_),jf(tC),function(t){var e={};t.registerSubTypeDefaulter=function(t,i){var n=$f(t);e[n.main]=i},t.determineSubType=function(i,n){var r=n.type;if(!r){var o=$f(i).main;t.hasSubTypes(i)&&e[o]&&(r=e[o](n))}return r}}(tC),function(t,e){function i(t,e){return t[e]||(t[e]={predecessor:[],successor:[]}),t[e]}t.topologicalTravel=function(t,n,r,o){if(t.length){var s=function(t){var n={},r=[];return Zp(t,(function(o){var s=i(n,o),a=function(t,e){var i=[];return Zp(t,(function(t){Yp(e,t)>=0&&i.push(t)})),i}(s.originalDeps=e(o),t);s.entryCount=a.length,0===s.entryCount&&r.push(o),Zp(a,(function(t){Yp(s.predecessor,t)<0&&s.predecessor.push(t);var e=i(n,t);Yp(e.successor,t)<0&&e.successor.push(o)}))})),{graph:n,noEntryList:r}}(n),a=s.graph,l=s.noEntryList,h={};for(Zp(t,(function(t){h[t]=!0}));l.length;){var c=l.pop(),u=a[c],d=!!h[c];d&&(r.call(o,c,u.originalDeps.slice()),delete h[c]),Zp(u.successor,d?f:p)}Zp(h,(function(){throw new Error("")}))}function p(t){a[t].entryCount--,0===a[t].entryCount&&l.push(t)}function f(t){h[t]=!0,p(t)}}}(tC,(function(t){var e=[];Zp(tC.getClassesByMainType(t),(function(t){e=e.concat(t.dependencies||t.prototype.dependencies||[])})),e=Jp(e,(function(t){return $f(t).main})),"dataset"!==t&&Yp(e,"dataset")<=0&&e.unshift("dataset");return e}));var eC=Bb();Bb();var iC=function(){function t(){}return t.prototype.getColorFromPalette=function(t,e,i){var n=Ab(this.get("color",!0)),r=this.get("colorLayer",!0);return function(t,e,i,n,r,o,s){o=o||t;var a=e(o),l=a.paletteIdx||0,h=a.paletteNameMap=a.paletteNameMap||{};if(h.hasOwnProperty(r))return h[r];var c=null!=s&&n?function(t,e){for(var i=t.length,n=0;ne)return t[n];return t[i-1]}(n,s):i;if(c=c||i,!c||!c.length)return;var u=c[l];r&&(h[r]=u);return a.paletteIdx=(l+1)%c.length,u}(this,eC,n,r,t,e,i)},t.prototype.clearColorPalette=function(){!function(t,e){e(t).paletteIdx=0,e(t).paletteNameMap={}}(this,eC)},t}();var nC=/\{@(.+?)\}/g,rC=function(){function t(){}return t.prototype.getDataParams=function(t,e){var i=this.getData(e),n=this.getRawValue(t,e),r=i.getRawIndex(t),o=i.getName(t),s=i.getRawDataItem(t),a=i.getItemVisual(t,"style"),l=a&&a[i.getItemVisual(t,"drawType")||"fill"],h=a&&a.stroke,c=this.mainType,u="series"===c,d=i.userOutput&&i.userOutput.get();return{componentType:c,componentSubType:this.subType,componentIndex:this.componentIndex,seriesType:u?this.subType:null,seriesIndex:this.seriesIndex,seriesId:u?this.id:null,seriesName:u?this.name:null,name:o,dataIndex:r,data:s,dataType:e,value:n,color:l,borderColor:h,dimensionNames:d?d.fullDimensions:null,encode:d?d.encode:null,$vars:["seriesName","name","value"]}},t.prototype.getFormattedLabel=function(t,e,i,n,r,o){e=e||"normal";var s=this.getData(i),a=this.getDataParams(t,i);(o&&(a.value=o.interpolatedValue),null!=n&&of(a.value)&&(a.value=a.value[n]),r)||(r=s.getItemModel(t).get("normal"===e?["label","formatter"]:[e,"label","formatter"]));return sf(r)?(a.status=e,a.dimensionIndex=n,r(a)):af(r)?VA(r,a).replace(nC,(function(e,i){var n=i.length,r=i;"["===r.charAt(0)&&"]"===r.charAt(n-1)&&(r=+r.slice(1,n-1));var a=Vk(s,t,r);if(o&&of(o.interpolatedValue)){var l=s.getDimensionIndex(r);l>=0&&(a=o.interpolatedValue[l])}return null!=a?a+"":""})):void 0},t.prototype.getRawValue=function(t,e){return Vk(this.getData(e),t)},t.prototype.formatTooltip=function(t,e,i){},t}();function oC(t){var e,i;return cf(t)?t.type&&(i=t):e=t,{text:e,frag:i}}function sC(t){return new aC(t)}var aC=function(){function t(t){t=t||{},this._reset=t.reset,this._plan=t.plan,this._count=t.count,this._onDirty=t.onDirty,this._dirty=!0}return t.prototype.perform=function(t){var e,i=this._upstream,n=t&&t.skip;if(this._dirty&&i){var r=this.context;r.data=r.outputData=i.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this),this._plan&&!n&&(e=this._plan(this.context));var o,s=c(this._modBy),a=this._modDataCount||0,l=c(t&&t.modBy),h=t&&t.modDataCount||0;function c(t){return!(t>=1)&&(t=1),t}s===l&&a===h||(e="reset"),(this._dirty||"reset"===e)&&(this._dirty=!1,o=this._doReset(n)),this._modBy=l,this._modDataCount=h;var u=t&&t.step;if(this._dueEnd=i?i._outputDueEnd:this._count?this._count(this.context):1/0,this._progress){var d=this._dueIndex,p=Math.min(null!=u?this._dueIndex+u:1/0,this._dueEnd);if(!n&&(o||d1&&n>0?a:s}};return o;function s(){return e=t?null:o9e10&&(this._versionSignBase=0)},t.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},t.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},t.prototype._createSource=function(){this._setLocalSource([],[]);var t,e,i=this._sourceHost,n=this._getUpstreamSourceManagers(),r=!!n.length;if(bC(i)){var o=i,s=void 0,a=void 0,l=void 0;if(r){var h=n[0];h.prepareSource(),s=(l=h.getSource()).data,a=l.sourceFormat,e=[h._getVersionSign()]}else a=df(s=o.get("data",!0))?rk:tk,e=[];var c=this._getSourceMetaRawOption()||{},u=l&&l.metaRawOption||{},d=vf(c.seriesLayoutBy,u.seriesLayoutBy)||null,p=vf(c.sourceHeader,u.sourceHeader),f=vf(c.dimensions,u.dimensions);t=d!==u.seriesLayoutBy||!!p!=!!u.sourceHeader||f?[Sk(s,{seriesLayoutBy:d,sourceHeader:p,dimensions:f},a)]:[]}else{var g=i;if(r){var m=this._applyTransform(n);t=m.sourceList,e=m.upstreamSignList}else{t=[Sk(g.get("source",!0),this._getSourceMetaRawOption(),null)],e=[]}}this._setLocalSource(t,e)},t.prototype._applyTransform=function(t){var e,i=this._sourceHost,n=i.get("transform",!0),r=i.get("fromTransformResult",!0);if(null!=r){1!==t.length&&wC("")}var o,s=[],a=[];return Zp(t,(function(t){t.prepareSource();var e=t.getSource(r||0);null==r||e||wC(""),s.push(e),a.push(t._getVersionSign())})),n?e=function(t,e){var i=Ab(t),n=i.length;n||_b("");for(var r=0,o=n;r1||i>0&&!t.noHeader;return Zp(t.blocks,(function(t){var i=DC(t);i>=e&&(e=i+ +(n&&(!i||CC(t)&&!t.noHeader)))})),e}return 0}function TC(t,e,i,n){var r,o=e.noHeader,s=(r=DC(e),{html:kC[r],richText:SC[r]}),a=[],l=e.blocks||[];xf(!l||of(l)),l=l||[];var h=t.orderMode;if(e.sortBlocks&&h){l=l.slice();var c={valueAsc:"asc",valueDesc:"desc"};if(Ef(c,h)){var u=new Kk(c[h],null);l.sort((function(t,e){return u.evaluate(t.sortParam,e.sortParam)}))}else"seriesDesc"===h&&l.reverse()}Zp(l,(function(i,r){var o=e.valueFormatter,l=MC(i)(o?Gp(Gp({},t),{valueFormatter:o}):t,i,r>0?s.html:0,n);null!=l&&a.push(l)}));var d="richText"===t.renderMode?a.join(s.richText):EC(a.join(""),o?i:s.html);if(o)return d;var p=zA(e.header,"ordinal",t.useUTC),f=_C(n,t.renderMode).nameStyle;return"richText"===t.renderMode?PC(t,p,f)+s.richText+d:EC('
'+ZS(p)+"
"+d,i)}function IC(t,e,i,n){var r=t.renderMode,o=e.noName,s=e.noValue,a=!e.markerType,l=e.name,h=t.useUTC,c=e.valueFormatter||t.valueFormatter||function(t){return Jp(t=of(t)?t:[t],(function(t,e){return zA(t,of(p)?p[e]:p,h)}))};if(!o||!s){var u=a?"":t.markupStyleCreator.makeTooltipMarker(e.markerType,e.markerColor||"#333",r),d=o?"":zA(l,"ordinal",h),p=e.valueType,f=s?[]:c(e.value,e.dataIndex),g=!a||!o,m=!a&&o,v=_C(n,r),y=v.nameStyle,b=v.valueStyle;return"richText"===r?(a?"":u)+(o?"":PC(t,d,y))+(s?"":function(t,e,i,n,r){var o=[r],s=n?10:20;return i&&o.push({padding:[0,0,0,s],align:"right"}),t.markupStyleCreator.wrapRichTextStyle(of(e)?e.join(" "):e,o)}(t,f,g,m,b)):EC((a?"":u)+(o?"":function(t,e,i){return''+ZS(t)+""}(d,!a,y))+(s?"":function(t,e,i,n){var r=i?"10px":"20px",o=e?"float:right;margin-left:"+r:"";return t=of(t)?t:[t],''+Jp(t,(function(t){return ZS(t)})).join("  ")+""}(f,g,m,b)),i)}}function OC(t,e,i,n,r,o){if(t)return MC(t)({useUTC:r,renderMode:i,orderMode:n,markupStyleCreator:e,valueFormatter:t.valueFormatter},t,0,o)}function EC(t,e){return'
'+t+'
'}function PC(t,e,i){return t.markupStyleCreator.wrapRichTextStyle(e,i)}function LC(t,e){return HA(t.getData().getItemVisual(e,"style")[t.visualDrawType])}function RC(t,e){var i=t.get("padding");return null!=i?i:"richText"===e?[8,10]:10}var NC=function(){function t(){this.richTextStyles={},this._nextStyleNameId=bb()}return t.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},t.prototype.makeTooltipMarker=function(t,e,i){var n="richText"===i?this._generateStyleName():null,r=function(t,e){var i=af(t)?{color:t,extraCssText:e}:t||{},n=i.color,r=i.type;e=i.extraCssText;var o=i.renderMode||"html";return n?"html"===o?"subItem"===r?'':'':{renderMode:o,content:"{"+(i.markerId||"markerX")+"|} ",style:"subItem"===r?{width:4,height:4,borderRadius:2,backgroundColor:n}:{width:10,height:10,borderRadius:5,backgroundColor:n}}:""}({color:e,type:t,renderMode:i,markerId:n});return af(r)?r:(this.richTextStyles[n]=r.style,r.content)},t.prototype.wrapRichTextStyle=function(t,e){var i={};of(e)?Zp(e,(function(t){return Gp(i,t)})):Gp(i,e);var n=this._generateStyleName();return this.richTextStyles[n]=i,"{"+n+"|"+t+"}"},t}();function BC(t){var e,i,n,r,o=t.series,s=t.dataIndex,a=t.multipleSeries,l=o.getData(),h=l.mapDimensionsAll("defaultedTooltip"),c=h.length,u=o.getRawValue(s),d=of(u),p=LC(o,s);if(c>1||d&&!c){var f=function(t,e,i,n,r){var o=e.getData(),s=Qp(t,(function(t,e,i){var n=o.getDimensionInfo(i);return t||n&&!1!==n.tooltip&&null!=n.displayName}),!1),a=[],l=[],h=[];function c(t,e){var i=o.getDimensionInfo(e);i&&!1!==i.otherDims.tooltip&&(s?h.push(AC("nameValue",{markerType:"subItem",markerColor:r,name:i.displayName,value:t,valueType:i.type})):(a.push(t),l.push(i.type)))}return n.length?Zp(n,(function(t){c(Vk(o,i,t),t)})):Zp(t,c),{inlineValues:a,inlineValueTypes:l,blocks:h}}(u,o,s,h,p);e=f.inlineValues,i=f.inlineValueTypes,n=f.blocks,r=f.inlineValues[0]}else if(c){var g=l.getDimensionInfo(h[0]);r=e=Vk(l,s,h[0]),i=g.type}else r=e=d?u[0]:u;var m=Lb(o),v=m&&o.name||"",y=l.getName(s),b=a?v:y;return AC("section",{header:v,noHeader:a||!m,sortParam:r,blocks:[AC("nameValue",{markerType:"item",markerColor:p,name:b,noName:!_f(b),value:e,valueType:i,dataIndex:s})].concat(n||[])})}var zC=Bb();function $C(t,e){return t.getName(e)||t.getId(e)}var FC=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._selectedDataIndicesMap={},e}return Sp(e,t),e.prototype.init=function(t,e,i){this.seriesIndex=this.componentIndex,this.dataTask=sC({count:HC,reset:WC}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(t,i),(zC(this).sourceManager=new vC(this)).prepareSource();var n=this.getInitialData(t,i);jC(n,this),this.dataTask.context.data=n,zC(this).dataBeforeProcessed=n,VC(this),this._initSelectedMapFromData(n)},e.prototype.mergeDefaultAndTheme=function(t,e){var i=KA(this),n=i?JA(t):{},r=this.subType;tC.hasClass(r)&&(r+="Series"),jp(t,e.getTheme().get(this.subType)),jp(t,this.getDefaultOption()),Cb(t,"label",["show"]),this.fillDataTextStyle(t.data),i&&ZA(t,n,i)},e.prototype.mergeOption=function(t,e){t=jp(this.option,t,!0),this.fillDataTextStyle(t.data);var i=KA(this);i&&ZA(this.option,t,i);var n=zC(this).sourceManager;n.dirty(),n.prepareSource();var r=this.getInitialData(t,e);jC(r,this),this.dataTask.dirty(),this.dataTask.context.data=r,zC(this).dataBeforeProcessed=r,VC(this),this._initSelectedMapFromData(r)},e.prototype.fillDataTextStyle=function(t){if(t&&!df(t))for(var e=["show"],i=0;ithis.getShallow("animationThreshold")&&(e=!1),!!e},e.prototype.restoreData=function(){this.dataTask.dirty()},e.prototype.getColorFromPalette=function(t,e,i){var n=this.ecModel,r=iC.prototype.getColorFromPalette.call(this,t,e,i);return r||(r=n.getColorFromPalette(t,e,i)),r},e.prototype.coordDimToDataDim=function(t){return this.getRawData().mapDimensionsAll(t)},e.prototype.getProgressive=function(){return this.get("progressive")},e.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},e.prototype.select=function(t,e){this._innerSelect(this.getData(e),t)},e.prototype.unselect=function(t,e){var i=this.option.selectedMap;if(i){var n=this.option.selectedMode,r=this.getData(e);if("series"===n||"all"===i)return this.option.selectedMap={},void(this._selectedDataIndicesMap={});for(var o=0;o=0&&i.push(r)}return i},e.prototype.isSelected=function(t,e){var i=this.option.selectedMap;if(!i)return!1;var n=this.getData(e);return("all"===i||i[$C(n,t)])&&!n.getItemModel(t).get(["select","disabled"])},e.prototype.isUniversalTransitionEnabled=function(){if(this.__universalTransitionEnabled)return!0;var t=this.option.universalTransition;return!!t&&(!0===t||t&&t.enabled)},e.prototype._innerSelect=function(t,e){var i,n,r=this.option,o=r.selectedMode,s=e.length;if(o&&s)if("series"===o)r.selectedMap="all";else if("multiple"===o){cf(r.selectedMap)||(r.selectedMap={});for(var a=r.selectedMap,l=0;l0&&this._innerSelect(t,e)}},e.registerClass=function(t){return tC.registerClass(t)},e.protoInitialize=function(){var t=e.prototype;t.type="series.__base__",t.seriesIndex=0,t.ignoreStyleOnData=!1,t.hasSymbolVisual=!1,t.defaultSymbol="circle",t.visualStyleAccessPath="itemStyle",t.visualDrawType="fill"}(),e}(tC);function VC(t){var e=t.name;Lb(t)||(t.name=function(t){var e=t.getRawData(),i=e.mapDimensionsAll("seriesName"),n=[];return Zp(i,(function(t){var i=e.getDimensionInfo(t);i.displayName&&n.push(i.displayName)})),n.join(" ")}(t)||e)}function HC(t){return t.model.getRawData().count()}function WC(t){var e=t.model;return e.setData(e.getRawData().cloneShallow()),UC}function UC(t,e){e.outputData&&t.end>e.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function jC(t,e){Zp(function(t,e){for(var i=new t.constructor(t.length+e.length),n=0;n-1&&(a.style.stroke=a.style.fill,a.style.fill="#fff",a.style.lineWidth=2),e},e.type="series.line",e.dependencies=["grid","polar"],e.defaultOption={z:3,coordinateSystem:"cartesian2d",legendHoverLink:!0,clip:!0,label:{position:"top"},endLabel:{show:!1,valueAnimation:!0,distance:8},lineStyle:{width:2,type:"solid"},emphasis:{scale:!0},step:!1,smooth:!1,smoothMonotone:null,symbol:"emptyCircle",symbolSize:4,symbolRotate:null,showSymbol:!0,showAllSymbol:"auto",connectNulls:!1,sampling:"none",animationEasing:"linear",progressive:0,hoverLayerThreshold:1/0,universalTransition:{divideShape:"clone"},triggerLineEvent:!1},e}(FC);function sM(t,e){var i=t.mapDimensionsAll("defaultedLabel"),n=i.length;if(1===n){var r=Vk(t,e,i[0]);return null!=r?r+"":null}if(n){for(var o=[],s=0;s=0&&n.push(e[o])}return n.join(" ")}var lM=function(t){function e(e,i,n,r){var o=t.call(this)||this;return o.updateData(e,i,n,r),o}return Sp(e,t),e.prototype._createSymbol=function(t,e,i,n,r){this.removeAll();var o=iM(t,-1,-1,2,2,null,r);o.attr({z2:100,culling:!0,scaleX:n[0]/2,scaleY:n[1]/2}),o.drift=hM,this._symbolType=t,this.add(o)},e.prototype.stopSymbolAnimation=function(t){this.childAt(0).stopAnimation(null,t)},e.prototype.getSymbolType=function(){return this._symbolType},e.prototype.getSymbolPath=function(){return this.childAt(0)},e.prototype.highlight=function(){vw(this.childAt(0))},e.prototype.downplay=function(){yw(this.childAt(0))},e.prototype.setZ=function(t,e){var i=this.childAt(0);i.zlevel=t,i.z=e},e.prototype.setDraggable=function(t,e){var i=this.childAt(0);i.draggable=t,i.cursor=!e&&t?"move":i.cursor},e.prototype.updateData=function(t,i,n,r){this.silent=!1;var o=t.getItemVisual(i,"symbol")||"circle",s=t.hostModel,a=e.getSymbolSize(t,i),l=o!==this._symbolType,h=r&&r.disableAnimation;if(l){var c=t.getItemVisual(i,"symbolKeepAspect");this._createSymbol(o,t,i,a,c)}else{(d=this.childAt(0)).silent=!1;var u={scaleX:a[0]/2,scaleY:a[1]/2};h?d.attr(u):Zx(d,u,s,i),n_(d)}if(this._updateCommon(t,i,a,n,r),l){var d=this.childAt(0);if(!h){u={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:d.style.opacity}};d.scaleX=d.scaleY=0,d.style.opacity=0,Jx(d,u,s,i)}}h&&this.childAt(0).stopAnimation("leave")},e.prototype._updateCommon=function(t,e,i,n,r){var o,s,a,l,h,c,u,d,p,f=this.childAt(0),g=t.hostModel;if(n&&(o=n.emphasisItemStyle,s=n.blurItemStyle,a=n.selectItemStyle,l=n.focus,h=n.blurScope,u=n.labelStatesModels,d=n.hoverScale,p=n.cursorStyle,c=n.emphasisDisabled),!n||t.hasItemOption){var m=n&&n.itemModel?n.itemModel:t.getItemModel(e),v=m.getModel("emphasis");o=v.getModel("itemStyle").getItemStyle(),a=m.getModel(["select","itemStyle"]).getItemStyle(),s=m.getModel(["blur","itemStyle"]).getItemStyle(),l=v.get("focus"),h=v.get("blurScope"),c=v.get("disabled"),u=T_(m),d=v.getShallow("scale"),p=m.getShallow("cursor")}var y=t.getItemVisual(e,"symbolRotate");f.attr("rotation",(y||0)*Math.PI/180||0);var b=rM(t.getItemVisual(e,"symbolOffset"),i);b&&(f.x=b[0],f.y=b[1]),p&&f.attr("cursor",p);var w=t.getItemVisual(e,"style"),x=w.fill;if(f instanceof zy){var _=f.style;f.useStyle(Gp({image:_.image,x:_.x,y:_.y,width:_.width,height:_.height},w))}else f.__isEmptyBrush?f.useStyle(Gp({},w)):f.useStyle(w),f.style.decal=null,f.setColor(x,r&&r.symbolInnerColor),f.style.strokeNoScale=!0;var k=t.getItemVisual(e,"liftZ"),S=this._z2;null!=k?null==S&&(this._z2=f.z2,f.z2+=k):null!=S&&(f.z2=S,this._z2=null);var A=r&&r.useNameLabel;D_(f,u,{labelFetcher:g,labelDataIndex:e,defaultText:function(e){return A?t.getName(e):sM(t,e)},inheritColor:x,defaultOpacity:w.opacity}),this._sizeX=i[0]/2,this._sizeY=i[1]/2;var C=f.ensureState("emphasis");C.style=o,f.ensureState("select").style=a,f.ensureState("blur").style=s;var M=null==d||!0===d?Math.max(1.1,3/this._sizeY):isFinite(d)&&d>0?+d:1;C.scaleX=this._sizeX*M,C.scaleY=this._sizeY*M,this.setSymbolScale(1),Iw(this,l,h,c)},e.prototype.setSymbolScale=function(t){this.scaleX=this.scaleY=t},e.prototype.fadeOut=function(t,e,i){var n=this.childAt(0),r=Ub(this).dataIndex,o=i&&i.animation;if(this.silent=n.silent=!0,i&&i.fadeLabel){var s=n.getTextContent();s&&t_(s,{style:{opacity:0}},e,{dataIndex:r,removeOpt:o,cb:function(){n.removeTextContent()}})}else n.removeTextContent();t_(n,{style:{opacity:0},scaleX:0,scaleY:0},e,{dataIndex:r,cb:t,removeOpt:o})},e.getSymbolSize=function(t,e){return nM(t.getItemVisual(e,"symbolSize"))},e}(ex);function hM(t,e){this.parent.drift(t,e)}function cM(t,e,i,n){return e&&!isNaN(e[0])&&!isNaN(e[1])&&!(n.isIgnore&&n.isIgnore(i))&&!(n.clipShape&&!n.clipShape.contain(e[0],e[1]))&&"none"!==t.getItemVisual(i,"symbol")}function uM(t){return null==t||cf(t)||(t={isIgnore:t}),t||{}}function dM(t){var e=t.hostModel,i=e.getModel("emphasis");return{emphasisItemStyle:i.getModel("itemStyle").getItemStyle(),blurItemStyle:e.getModel(["blur","itemStyle"]).getItemStyle(),selectItemStyle:e.getModel(["select","itemStyle"]).getItemStyle(),focus:i.get("focus"),blurScope:i.get("blurScope"),emphasisDisabled:i.get("disabled"),hoverScale:i.get("scale"),labelStatesModels:T_(e),cursorStyle:e.get("cursor")}}var pM=function(){function t(t){this.group=new ex,this._SymbolCtor=t||lM}return t.prototype.updateData=function(t,e){this._progressiveEls=null,e=uM(e);var i=this.group,n=t.hostModel,r=this._data,o=this._SymbolCtor,s=e.disableAnimation,a=dM(t),l={disableAnimation:s},h=e.getSymbolPoint||function(e){return t.getItemLayout(e)};r||i.removeAll(),t.diff(r).add((function(n){var r=h(n);if(cM(t,r,n,e)){var s=new o(t,n,a,l);s.setPosition(r),t.setItemGraphicEl(n,s),i.add(s)}})).update((function(c,u){var d=r.getItemGraphicEl(u),p=h(c);if(cM(t,p,c,e)){var f=t.getItemVisual(c,"symbol")||"circle",g=d&&d.getSymbolType&&d.getSymbolType();if(!d||g&&g!==f)i.remove(d),(d=new o(t,c,a,l)).setPosition(p);else{d.updateData(t,c,a,l);var m={x:p[0],y:p[1]};s?d.attr(m):Zx(d,m,n)}i.add(d),t.setItemGraphicEl(c,d)}else i.remove(d)})).remove((function(t){var e=r.getItemGraphicEl(t);e&&e.fadeOut((function(){i.remove(e)}),n)})).execute(),this._getSymbolPoint=h,this._data=t},t.prototype.updateLayout=function(){var t=this,e=this._data;e&&e.eachItemGraphicEl((function(e,i){var n=t._getSymbolPoint(i);e.setPosition(n),e.markRedraw()}))},t.prototype.incrementalPrepareUpdate=function(t){this._seriesScope=dM(t),this._data=null,this.group.removeAll()},t.prototype.incrementalUpdate=function(t,e,i){function n(t){t.isGroup||(t.incremental=!0,t.ensureState("emphasis").hoverLayer=!0)}this._progressiveEls=[],i=uM(i);for(var r=t.start;r0?i=n[0]:n[1]<0&&(i=n[1]);return i}(r,i),s=n.dim,a=r.dim,l=e.mapDimension(a),h=e.mapDimension(s),c="x"===a||"radius"===a?1:0,u=Jp(t.dimensions,(function(t){return e.mapDimension(t)})),d=!1,p=e.getCalculationInfo("stackResultDimension");return BS(e,u[0])&&(d=!0,u[0]=p),BS(e,u[1])&&(d=!0,u[1]=p),{dataDimsForPoint:u,valueStart:o,valueAxisDim:a,baseAxisDim:s,stacked:!!d,valueDim:l,baseDim:h,baseDataOffset:c,stackedOverDimension:e.getCalculationInfo("stackedOverDimension")}}function gM(t,e,i,n){var r=NaN;t.stacked&&(r=i.get(i.getCalculationInfo("stackedOverDimension"),n)),isNaN(r)&&(r=t.valueStart);var o=t.baseDataOffset,s=[];return s[o]=i.get(t.baseDim,n),s[1-o]=r,e.dataToPoint(s)}var mM="undefined"!=typeof Float32Array,vM=mM?Float32Array:Array;function yM(t){return of(t)?mM?new Float32Array(t):t:new vM(t)}var bM=Math.min,wM=Math.max;function xM(t,e){return isNaN(t)||isNaN(e)}function _M(t,e,i,n,r,o,s,a,l){for(var h,c,u,d,p,f,g=i,m=0;m=r||g<0)break;if(xM(v,y)){if(l){g+=o;continue}break}if(g===i)t[o>0?"moveTo":"lineTo"](v,y),u=v,d=y;else{var b=v-h,w=y-c;if(b*b+w*w<.5){g+=o;continue}if(s>0){for(var x=g+o,_=e[2*x],k=e[2*x+1];_===v&&k===y&&m=n||xM(_,k))p=v,f=y;else{C=_-h,M=k-c;var I=v-h,O=_-v,E=y-c,P=k-y,L=void 0,R=void 0;if("x"===a){var N=C>0?1:-1;p=v-N*(L=Math.abs(I))*s,f=y,D=v+N*(R=Math.abs(O))*s,T=y}else if("y"===a){var B=M>0?1:-1;p=v,f=y-B*(L=Math.abs(E))*s,D=v,T=y+B*(R=Math.abs(P))*s}else L=Math.sqrt(I*I+E*E),p=v-C*s*(1-(A=(R=Math.sqrt(O*O+P*P))/(R+L))),f=y-M*s*(1-A),T=y+M*s*A,D=bM(D=v+C*s*A,wM(_,v)),T=bM(T,wM(k,y)),D=wM(D,bM(_,v)),f=y-(M=(T=wM(T,bM(k,y)))-y)*L/R,p=bM(p=v-(C=D-v)*L/R,wM(h,v)),f=bM(f,wM(c,y)),D=v+(C=v-(p=wM(p,bM(h,v))))*R/L,T=y+(M=y-(f=wM(f,bM(c,y))))*R/L}t.bezierCurveTo(u,d,p,f,v,y),u=D,d=T}else t.lineTo(v,y)}h=v,c=y,g+=o}return m}var kM=function(){this.smooth=0,this.smoothConstraint=!0},SM=function(t){function e(e){var i=t.call(this,e)||this;return i.type="ec-polyline",i}return Sp(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new kM},e.prototype.buildPath=function(t,e){var i=e.points,n=0,r=i.length/2;if(e.connectNulls){for(;r>0&&xM(i[2*r-2],i[2*r-1]);r--);for(;n=0){var m=s?(c-n)*g+n:(h-i)*g+i;return s?[t,m]:[m,t]}i=h,n=c;break;case o.C:h=r[l++],c=r[l++],u=r[l++],d=r[l++],p=r[l++],f=r[l++];var v=s?xm(i,h,u,p,t,a):xm(n,c,d,f,t,a);if(v>0)for(var y=0;y=0){m=s?bm(n,c,d,f,b):bm(i,h,u,p,b);return s?[t,m]:[m,t]}}i=p,n=f}}},e}(Py),AM=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Sp(e,t),e}(kM),CM=function(t){function e(e){var i=t.call(this,e)||this;return i.type="ec-polygon",i}return Sp(e,t),e.prototype.getDefaultShape=function(){return new AM},e.prototype.buildPath=function(t,e){var i=e.points,n=e.stackedOnPoints,r=0,o=i.length/2,s=e.smoothMonotone;if(e.connectNulls){for(;o>0&&xM(i[2*o-2],i[2*o-1]);o--);for(;r=0&&t<=1){var n=t*(e.length-1),r=Math.floor(n),o=Math.ceil(n),s=jm(e[r]),a=jm(e[o]),l=n-r,h=Ym([Lm($m(s[0],a[0],l)),Lm($m(s[1],a[1],l)),Lm($m(s[2],a[2],l)),Rm($m(s[3],a[3],l))],"rgba");return i?{color:h,leftIndex:r,rightIndex:o,value:n}:h}}((i-n)/(e.coord-n),[t.color,e.color])}}for(var a=0;ae){n?r.push(s(n,l,e)):i&&r.push(s(i,l,0),s(i,l,e));break}i&&(r.push(s(i,l,0)),i=null),r.push(l),n=l}}return r}function jM(t,e,i){var n=t.get("showAllSymbol"),r="auto"===n;if(!n||r){var o=i.getAxesByScale("ordinal")[0];if(o&&(!r||!function(t,e){var i=t.getExtent(),n=Math.abs(i[1]-i[0])/t.scale.count();isNaN(n)&&(n=0);for(var r=e.count(),o=Math.max(1,Math.round(r/5)),s=0;sn)return!1;return!0}(o,e))){var s=e.mapDimension(o.dim),a={};return Zp(o.getViewLabels(),(function(t){var e=o.scale.getRawOrdinalNumber(t.tickValue);a[e]=1})),function(t){return!a.hasOwnProperty(e.get(s,t))}}}}function GM(t,e){return isNaN(t)||isNaN(e)}function qM(t,e){return[t[2*e],t[2*e+1]]}function YM(t){if(t.get(["endLabel","show"]))return!0;for(var e=0;e=0;s--){var a=t.getDimensionInfo(n[s].dimension);if("x"===(r=a&&a.coordDim)||"y"===r){o=n[s];break}}if(o){var l=e.getAxis(r),h=Jp(o.stops,(function(t){return{coord:l.toGlobalCoord(l.dataToCoord(t.value)),color:t.color}})),c=h.length,u=o.outerColors.slice();c&&h[0].coord>h[c-1].coord&&(h.reverse(),u.reverse());var d=UM(h,"x"===r?i.getWidth():i.getHeight()),p=d.length;if(!p&&c)return h[0].coord<0?u[1]?u[1]:h[c-1].color:u[0]?u[0]:h[0].color;var f=d[0].coord-10,g=d[p-1].coord+10,m=g-f;if(m<.001)return"transparent";Zp(d,(function(t){t.offset=(t.coord-f)/m})),d.push({offset:p?d[p-1].offset:.5,color:u[1]||"transparent"}),d.unshift({offset:p?d[0].offset:.5,color:u[0]||"transparent"});var v=new Fx(0,0,0,0,d,!0);return v[r]=f,v[r+"2"]=g,v}}}(s,r,i)||s.getVisual("style")[s.getVisual("drawType")];if(p&&u.type===r.type&&C===this._step){v&&!f?f=this._newPolygon(h,w):f&&!v&&(g.remove(f),f=this._polygon=null),c||this._initOrUpdateEndLabel(t,r,HA(M));var D=g.getClipPath();if(D)Jx(D,{shape:XM(this,r,!1,t).shape},t);else g.setClipPath(XM(this,r,!0,t));x&&d.updateData(s,{isIgnore:k,clipShape:A,disableAnimation:!0,getSymbolPoint:function(t){return[h[2*t],h[2*t+1]]}}),$M(this._stackedOnPoints,w)&&$M(this._points,h)||(m?this._doUpdateAnimation(s,w,r,i,C,y,_):(C&&(h=WM(h,r,C,_),w&&(w=WM(w,r,C,_))),p.setShape({points:h}),f&&f.setShape({points:h,stackedOnPoints:w})))}else x&&d.updateData(s,{isIgnore:k,clipShape:A,disableAnimation:!0,getSymbolPoint:function(t){return[h[2*t],h[2*t+1]]}}),m&&this._initSymbolLabelAnimation(s,r,A),C&&(h=WM(h,r,C,_),w&&(w=WM(w,r,C,_))),p=this._newPolyline(h),v?f=this._newPolygon(h,w):f&&(g.remove(f),f=this._polygon=null),c||this._initOrUpdateEndLabel(t,r,HA(M)),g.setClipPath(XM(this,r,!0,t));var T=t.getModel("emphasis"),I=T.get("focus"),O=T.get("blurScope"),E=T.get("disabled");(p.useStyle(qp(a.getLineStyle(),{fill:"none",stroke:M,lineJoin:"bevel"})),Pw(p,t,"lineStyle"),p.style.lineWidth>0&&"bolder"===t.get(["emphasis","lineStyle","width"]))&&(p.getState("emphasis").style.lineWidth=+p.style.lineWidth+1);Ub(p).seriesIndex=t.seriesIndex,Iw(p,I,O,E);var P=HM(t.get("smooth")),L=t.get("smoothMonotone");if(p.setShape({smooth:P,smoothMonotone:L,connectNulls:_}),f){var R=s.getCalculationInfo("stackedOnSeries"),N=0;f.useStyle(qp(l.getAreaStyle(),{fill:M,opacity:.7,lineJoin:"bevel",decal:s.getVisual("style").decal})),R&&(N=HM(R.get("smooth"))),f.setShape({smooth:P,stackedOnSmooth:N,smoothMonotone:L,connectNulls:_}),Pw(f,t,"areaStyle"),Ub(f).seriesIndex=t.seriesIndex,Iw(f,I,O,E)}var B=function(t){n._changePolyState(t)};s.eachItemGraphicEl((function(t){t&&(t.onHoverStateChange=B)})),this._polyline.onHoverStateChange=B,this._data=s,this._coordSys=r,this._stackedOnPoints=w,this._points=h,this._step=C,this._valueOrigin=y,t.get("triggerLineEvent")&&(this.packEventData(t,p),f&&this.packEventData(t,f))},e.prototype.packEventData=function(t,e){Ub(e).eventData={componentType:"series",componentSubType:"line",componentIndex:t.componentIndex,seriesIndex:t.seriesIndex,seriesName:t.name,seriesType:"line"}},e.prototype.highlight=function(t,e,i,n){var r=t.getData(),o=Nb(r,n);if(this._changePolyState("emphasis"),!(o instanceof Array)&&null!=o&&o>=0){var s=r.getLayout("points"),a=r.getItemGraphicEl(o);if(!a){var l=s[2*o],h=s[2*o+1];if(isNaN(l)||isNaN(h))return;if(this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(l,h))return;var c=t.get("zlevel")||0,u=t.get("z")||0;(a=new lM(r,o)).x=l,a.y=h,a.setZ(c,u);var d=a.getSymbolPath().getTextContent();d&&(d.zlevel=c,d.z=u,d.z2=this._polyline.z2+1),a.__temp=!0,r.setItemGraphicEl(o,a),a.stopSymbolAnimation(!0),this.group.add(a)}a.highlight()}else IM.prototype.highlight.call(this,t,e,i,n)},e.prototype.downplay=function(t,e,i,n){var r=t.getData(),o=Nb(r,n);if(this._changePolyState("normal"),null!=o&&o>=0){var s=r.getItemGraphicEl(o);s&&(s.__temp?(r.setItemGraphicEl(o,null),this.group.remove(s)):s.downplay())}else IM.prototype.downplay.call(this,t,e,i,n)},e.prototype._changePolyState=function(t){var e=this._polygon;dw(this._polyline,t),e&&dw(e,t)},e.prototype._newPolyline=function(t){var e=this._polyline;return e&&this._lineGroup.remove(e),e=new SM({shape:{points:t},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(e),this._polyline=e,e},e.prototype._newPolygon=function(t,e){var i=this._polygon;return i&&this._lineGroup.remove(i),i=new CM({shape:{points:t,stackedOnPoints:e},segmentIgnoreThreshold:2}),this._lineGroup.add(i),this._polygon=i,i},e.prototype._initSymbolLabelAnimation=function(t,e,i){var n,r,o=e.getBaseAxis(),s=o.inverse;"cartesian2d"===e.type?(n=o.isHorizontal(),r=!1):"polar"===e.type&&(n="angle"===o.dim,r=!0);var a=t.hostModel,l=a.get("animationDuration");sf(l)&&(l=l(null));var h=a.get("animationDelay")||0,c=sf(h)?h(null):h;t.eachItemGraphicEl((function(t,o){var a=t;if(a){var u=[t.x,t.y],d=void 0,p=void 0,f=void 0;if(i)if(r){var g=i,m=e.pointToCoord(u);n?(d=g.startAngle,p=g.endAngle,f=-m[1]/180*Math.PI):(d=g.r0,p=g.r,f=m[0])}else{var v=i;n?(d=v.x,p=v.x+v.width,f=t.x):(d=v.y+v.height,p=v.y,f=t.y)}var y=p===d?0:(f-d)/(p-d);s&&(y=1-y);var b=sf(h)?h(o):l*y+c,w=a.getSymbolPath(),x=w.getTextContent();a.attr({scaleX:0,scaleY:0}),a.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:b}),x&&x.animateFrom({style:{opacity:0}},{duration:300,delay:b}),w.disableLabelAnimation=!0}}))},e.prototype._initOrUpdateEndLabel=function(t,e,i){var n=t.getModel("endLabel");if(YM(t)){var r=t.getData(),o=this._polyline,s=r.getLayout("points");if(!s)return o.removeTextContent(),void(this._endLabel=null);var a=this._endLabel;a||((a=this._endLabel=new Yy({z2:200})).ignoreClip=!0,o.setTextContent(this._endLabel),o.disableLabelAnimation=!0);var l=function(t){for(var e=t.length/2;e>0&&GM(t[2*e-2],t[2*e-1]);e--);return e-1}(s);l>=0&&(D_(o,T_(t,"endLabel"),{inheritColor:i,labelFetcher:t,labelDataIndex:l,defaultText:function(t,e,i){return null!=i?aM(r,i):sM(r,t)},enableTextSetter:!0},function(t,e){var i=e.getBaseAxis(),n=i.isHorizontal(),r=i.inverse,o=n?r?"right":"left":"center",s=n?"middle":r?"top":"bottom";return{normal:{align:t.get("align")||o,verticalAlign:t.get("verticalAlign")||s}}}(n,e)),o.textConfig.position=null)}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},e.prototype._endLabelOnDuring=function(t,e,i,n,r,o,s){var a=this._endLabel,l=this._polyline;if(a){t<1&&null==n.originalX&&(n.originalX=a.x,n.originalY=a.y);var h=i.getLayout("points"),c=i.hostModel,u=c.get("connectNulls"),d=o.get("precision"),p=o.get("distance")||0,f=s.getBaseAxis(),g=f.isHorizontal(),m=f.inverse,v=e.shape,y=m?g?v.x:v.y+v.height:g?v.x+v.width:v.y,b=(g?p:0)*(m?-1:1),w=(g?0:-p)*(m?-1:1),x=g?"x":"y",_=function(t,e,i){for(var n,r,o=t.length/2,s="x"===i?0:1,a=0,l=-1,h=0;h=e||n>=e&&r<=e){l=h;break}a=h,n=r}else n=r;return{range:[a,l],t:(e-n)/(r-n)}}(h,y,x),k=_.range,S=k[1]-k[0],A=void 0;if(S>=1){if(S>1&&!u){var C=qM(h,k[0]);a.attr({x:C[0]+b,y:C[1]+w}),r&&(A=c.getRawValue(k[0]))}else{(C=l.getPointOn(y,x))&&a.attr({x:C[0]+b,y:C[1]+w});var M=c.getRawValue(k[0]),D=c.getRawValue(k[1]);r&&(A=function(t,e,i,n,r){var o=null==e||"auto"===e;if(null==n)return n;if(hf(n))return hb(f=kb(i||0,n,r),o?Math.max(cb(i||0),cb(n)):e);if(af(n))return r<1?i:n;for(var s=[],a=i,l=n,h=Math.max(a?a.length:0,l.length),c=0;c0?k[0]:0;C=qM(h,T);r&&(A=c.getRawValue(T)),a.attr({x:C[0]+b,y:C[1]+w})}if(r){var I=N_(a);"function"==typeof I.setLabelText&&I.setLabelText(A)}}},e.prototype._doUpdateAnimation=function(t,e,i,n,r,o,s){var a=this._polyline,l=this._polygon,h=t.hostModel,c=function(t,e,i,n,r,o,s){for(var a=function(t,e){var i=[];return e.diff(t).add((function(t){i.push({cmd:"+",idx:t})})).update((function(t,e){i.push({cmd:"=",idx:e,idx1:t})})).remove((function(t){i.push({cmd:"-",idx:t})})).execute(),i}(t,e),l=[],h=[],c=[],u=[],d=[],p=[],f=[],g=fM(r,e,s),m=t.getLayout("points")||[],v=e.getLayout("points")||[],y=0;y3e3||l&&VM(d,f)>3e3)return a.stopAnimation(),a.setShape({points:p}),void(l&&(l.stopAnimation(),l.setShape({points:p,stackedOnPoints:f})));a.shape.__points=c.current,a.shape.points=u;var g={shape:{points:p}};c.current!==u&&(g.shape.__points=c.next),a.stopAnimation(),Zx(a,g,h),l&&(l.setShape({points:u,stackedOnPoints:d}),l.stopAnimation(),Zx(l,{shape:{stackedOnPoints:f}},h),a.shape.points!==l.shape.points&&(l.shape.points=a.shape.points));for(var m=[],v=c.status,y=0;ye&&(e=t[i]);return isFinite(e)?e:NaN},min:function(t){for(var e=1/0,i=0;ie&&(e=o,i=r)}return isFinite(i)?i:NaN},nearest:function(t){return t[0]}},QM=function(t){return Math.round(t.length/2)};function tD(t){return{seriesType:t,reset:function(t,e,i){var n=t.getData(),r=t.get("sampling"),o=t.coordinateSystem,s=n.count();if(s>10&&"cartesian2d"===o.type&&r){var a=o.getBaseAxis(),l=o.getOtherAxis(a),h=a.getExtent(),c=i.getDevicePixelRatio(),u=Math.abs(h[1]-h[0])*(c||1),d=Math.round(s/u);if(isFinite(d)&&d>1){"lttb"===r&&t.setData(n.lttbDownSample(n.mapDimension(l.dim),1/d));var p=void 0;af(r)?p=JM[r]:sf(r)&&(p=r),p&&t.setData(n.downSample(n.mapDimension(l.dim),1/d,p,QM))}}}}}function eD(t){return t.get("stack")||"__ec_stack_"+t.seriesIndex}function iD(t){return t.dim+t.index}function nD(t,e){var i=[];return e.eachSeriesByType(t,(function(t){sD(t)&&i.push(t)})),i}function rD(t){var e=function(t){var e={};Zp(t,(function(t){var i=t.coordinateSystem.getBaseAxis();if("time"===i.type||"value"===i.type)for(var n=t.getData(),r=i.dim+"_"+i.index,o=n.getDimensionIndex(n.mapDimension(i.dim)),s=n.getStore(),a=0,l=s.count();a0&&(o=null===o?a:Math.min(o,a))}i[n]=o}}return i}(t),i=[];return Zp(t,(function(t){var n,r=t.coordinateSystem.getBaseAxis(),o=r.getExtent();if("category"===r.type)n=r.getBandWidth();else if("value"===r.type||"time"===r.type){var s=r.dim+"_"+r.index,a=e[s],l=Math.abs(o[1]-o[0]),h=r.scale.getExtent(),c=Math.abs(h[1]-h[0]);n=a?l/c*a:l}else{var u=t.getData();n=Math.abs(o[1]-o[0])/u.count()}var d=lb(t.get("barWidth"),n),p=lb(t.get("barMaxWidth"),n),f=lb(t.get("barMinWidth")||(aD(t)?.5:1),n),g=t.get("barGap"),m=t.get("barCategoryGap");i.push({bandWidth:n,barWidth:d,barMaxWidth:p,barMinWidth:f,barGap:g,barCategoryGap:m,axisKey:iD(r),stackId:eD(t)})})),function(t){var e={};Zp(t,(function(t,i){var n=t.axisKey,r=t.bandWidth,o=e[n]||{bandWidth:r,remainedWidth:r,autoWidthCount:0,categoryGap:null,gap:"20%",stacks:{}},s=o.stacks;e[n]=o;var a=t.stackId;s[a]||o.autoWidthCount++,s[a]=s[a]||{width:0,maxWidth:0};var l=t.barWidth;l&&!s[a].width&&(s[a].width=l,l=Math.min(o.remainedWidth,l),o.remainedWidth-=l);var h=t.barMaxWidth;h&&(s[a].maxWidth=h);var c=t.barMinWidth;c&&(s[a].minWidth=c);var u=t.barGap;null!=u&&(o.gap=u);var d=t.barCategoryGap;null!=d&&(o.categoryGap=d)}));var i={};return Zp(e,(function(t,e){i[e]={};var n=t.stacks,r=t.bandWidth,o=t.categoryGap;if(null==o){var s=ef(n).length;o=Math.max(35-4*s,15)+"%"}var a=lb(o,r),l=lb(t.gap,1),h=t.remainedWidth,c=t.autoWidthCount,u=(h-a)/(c+(c-1)*l);u=Math.max(u,0),Zp(n,(function(t){var e=t.maxWidth,i=t.minWidth;if(t.width){n=t.width;e&&(n=Math.min(n,e)),i&&(n=Math.max(n,i)),t.width=n,h-=n+l*n,c--}else{var n=u;e&&en&&(n=i),n!==u&&(t.width=n,h-=n+l*n,c--)}})),u=(h-a)/(c+(c-1)*l),u=Math.max(u,0);var d,p=0;Zp(n,(function(t,e){t.width||(t.width=u),d=t,p+=t.width*(1+l)})),d&&(p-=d.width*l);var f=-p/2;Zp(n,(function(t,n){i[e][n]=i[e][n]||{bandWidth:r,offset:f,width:t.width},f+=t.width*(1+l)}))})),i}(i)}function oD(t,e){var i=nD(t,e),n=rD(i);Zp(i,(function(t){var e=t.getData(),i=t.coordinateSystem.getBaseAxis(),r=eD(t),o=n[iD(i)][r],s=o.offset,a=o.width;e.setLayout({bandWidth:o.bandWidth,offset:s,size:a})}))}function sD(t){return t.coordinateSystem&&"cartesian2d"===t.coordinateSystem.type}function aD(t){return t.pipelineContext&&t.pipelineContext.large}var lD=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return Sp(e,t),e.prototype.getInitialData=function(t,e){return zS(0,this,{useEncodeDefaulter:!0})},e.prototype.getMarkerPosition=function(t,e,i){var n=this.coordinateSystem;if(n&&n.clampData){var r=n.clampData(t),o=n.dataToPoint(r);if(i)Zp(n.getAxes(),(function(t,i){if("category"===t.type&&null!=e){var n=t.getTicksCoords(),s=t.getTickModel().get("alignWithLabel"),a=r[i],l="x1"===e[i]||"y1"===e[i];if(l&&!s&&(a+=1),n.length<2)return;if(2===n.length)return void(o[i]=t.toGlobalCoord(t.getExtent()[l?1:0]));for(var h=void 0,c=void 0,u=1,d=0;da){c=(p+h)/2;break}1===d&&(u=f-n[0].tickValue)}null==c&&(h?h&&(c=n[n.length-1].coord):c=n[0].coord),o[i]=t.toGlobalCoord(c)}}));else{var s=this.getData(),a=s.getLayout("offset"),l=s.getLayout("size"),h=n.getBaseAxis().isHorizontal()?0:1;o[h]+=a+l/2}return o}return[NaN,NaN]},e.type="series.__base_bar__",e.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod"},e}(FC);FC.registerClass(lD);var hD=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return Sp(e,t),e.prototype.getInitialData=function(){return zS(0,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get("realtimeSort",!0)||null})},e.prototype.getProgressive=function(){return!!this.get("large")&&this.get("progressive")},e.prototype.getProgressiveThreshold=function(){var t=this.get("progressiveThreshold"),e=this.get("largeThreshold");return e>t&&(t=e),t},e.prototype.brushSelector=function(t,e,i){return i.rect(e.getItemLayout(t))},e.type="series.bar",e.dependencies=["grid","polar"],e.defaultOption=VS(lD.defaultOption,{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)",borderColor:null,borderWidth:0,borderType:"solid",borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:"#212121"}},realtimeSort:!1}),e}(lD),cD="\0__throttleOriginMethod",uD="\0__throttleRate",dD="\0__throttleType";function pD(t,e,i){var n,r,o,s,a,l=0,h=0,c=null;function u(){h=(new Date).getTime(),c=null,t.apply(o,s||[])}e=e||0;var d=function(){for(var t=[],d=0;d=0?u():c=setTimeout(u,-r),l=n};return d.clear=function(){c&&(clearTimeout(c),c=null)},d.debounceNextCall=function(t){a=t},d}function fD(t,e,i,n){var r=t[e];if(r){var o=r[cD]||r,s=r[dD];if(r[uD]!==i||s!==n){if(null==i||!n)return t[e]=o;(r=t[e]=pD(o,i,"debounce"===n))[cD]=o,r[dD]=n,r[uD]=i}return r}}function gD(t,e){var i=t[e];i&&i[cD]&&(i.clear&&i.clear(),t[e]=i[cD])}var mD=function(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0},vD=function(t){function e(e){var i=t.call(this,e)||this;return i.type="sausage",i}return Sp(e,t),e.prototype.getDefaultShape=function(){return new mD},e.prototype.buildPath=function(t,e){var i=e.cx,n=e.cy,r=Math.max(e.r0||0,0),o=Math.max(e.r,0),s=.5*(o-r),a=r+s,l=e.startAngle,h=e.endAngle,c=e.clockwise,u=2*Math.PI,d=c?h-lo)return!0;o=h}return!1},e.prototype._isOrderDifferentInView=function(t,e){for(var i=e.scale,n=i.getExtent(),r=Math.max(0,n[0]),o=Math.min(n[1],i.getOrdinalMeta().categories.length-1);r<=o;++r)if(t.ordinalNumbers[r]!==i.getRawOrdinalNumber(r))return!0},e.prototype._updateSortWithinSameData=function(t,e,i,n){if(this._isOrderChangedWithinSameData(t,e,i)){var r=this._dataSort(t,i,e);this._isOrderDifferentInView(r,i)&&(this._removeOnRenderedListener(n),n.dispatchAction({type:"changeAxisOrder",componentType:i.dim+"Axis",axisId:i.index,sortInfo:r}))}},e.prototype._dispatchInitSort=function(t,e,i){var n=e.baseAxis,r=this._dataSort(t,n,(function(i){return t.get(t.mapDimension(e.otherAxis.dim),i)}));i.dispatchAction({type:"changeAxisOrder",componentType:n.dim+"Axis",isInitSort:!0,axisId:n.index,sortInfo:r})},e.prototype.remove=function(t,e){this._clear(this._model),this._removeOnRenderedListener(e)},e.prototype.dispose=function(t,e){this._removeOnRenderedListener(e)},e.prototype._removeOnRenderedListener=function(t){this._onRendered&&(t.getZr().off("rendered",this._onRendered),this._onRendered=null)},e.prototype._clear=function(t){var e=this.group,i=this._data;t&&t.isAnimationEnabled()&&i&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],i.eachItemGraphicEl((function(e){i_(e,t,Ub(e).dataIndex)}))):e.removeAll(),this._data=null,this._isFirstFrame=!0},e.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},e.type="bar",e}(IM),SD={cartesian2d:function(t,e){var i=e.width<0?-1:1,n=e.height<0?-1:1;i<0&&(e.x+=e.width,e.width=-e.width),n<0&&(e.y+=e.height,e.height=-e.height);var r=t.x+t.width,o=t.y+t.height,s=xD(e.x,t.x),a=_D(e.x+e.width,r),l=xD(e.y,t.y),h=_D(e.y+e.height,o),c=ar?a:s,e.y=u&&l>o?h:l,e.width=c?0:a-s,e.height=u?0:h-l,i<0&&(e.x+=e.width,e.width=-e.width),n<0&&(e.y+=e.height,e.height=-e.height),c||u},polar:function(t,e){var i=e.r0<=e.r?1:-1;if(i<0){var n=e.r;e.r=e.r0,e.r0=n}var r=_D(e.r,t.r),o=xD(e.r0,t.r0);e.r=r,e.r0=o;var s=r-o<0;if(i<0){n=e.r;e.r=e.r0,e.r0=n}return s}},AD={cartesian2d:function(t,e,i,n,r,o,s,a,l){var h=new jy({shape:Gp({},n),z2:1});(h.__dataIndex=i,h.name="item",o)&&(h.shape[r?"height":"width"]=0);return h},polar:function(t,e,i,n,r,o,s,a,l){var h=!r&&l?vD:xx,c=new h({shape:n,z2:1});c.name="item";var u,d,p=ED(r);if(c.calculateTextPosition=(u=p,d=({isRoundCap:h===vD}||{}).isRoundCap,function(t,e,i){var n=e.position;if(!n||n instanceof Array)return Cg(t,e,i);var r=u(n),o=null!=e.distance?e.distance:5,s=this.shape,a=s.cx,l=s.cy,h=s.r,c=s.r0,p=(h+c)/2,f=s.startAngle,g=s.endAngle,m=(f+g)/2,v=d?Math.abs(h-c)/2:0,y=Math.cos,b=Math.sin,w=a+h*y(f),x=l+h*b(f),_="left",k="top";switch(r){case"startArc":w=a+(c-o)*y(m),x=l+(c-o)*b(m),_="center",k="top";break;case"insideStartArc":w=a+(c+o)*y(m),x=l+(c+o)*b(m),_="center",k="bottom";break;case"startAngle":w=a+p*y(f)+yD(f,o+v,!1),x=l+p*b(f)+bD(f,o+v,!1),_="right",k="middle";break;case"insideStartAngle":w=a+p*y(f)+yD(f,-o+v,!1),x=l+p*b(f)+bD(f,-o+v,!1),_="left",k="middle";break;case"middle":w=a+p*y(m),x=l+p*b(m),_="center",k="middle";break;case"endArc":w=a+(h+o)*y(m),x=l+(h+o)*b(m),_="center",k="bottom";break;case"insideEndArc":w=a+(h-o)*y(m),x=l+(h-o)*b(m),_="center",k="top";break;case"endAngle":w=a+p*y(g)+yD(g,o+v,!0),x=l+p*b(g)+bD(g,o+v,!0),_="left",k="middle";break;case"insideEndAngle":w=a+p*y(g)+yD(g,-o+v,!0),x=l+p*b(g)+bD(g,-o+v,!0),_="right",k="middle";break;default:return Cg(t,e,i)}return(t=t||{}).x=w,t.y=x,t.align=_,t.verticalAlign=k,t}),o){var f=r?"r":"endAngle",g={};c.shape[f]=r?n.r0:n.startAngle,g[f]=n[f],(a?Zx:Jx)(c,{shape:g},o)}return c}};function CD(t,e,i,n,r,o,s,a){var l,h;o?(h={x:n.x,width:n.width},l={y:n.y,height:n.height}):(h={y:n.y,height:n.height},l={x:n.x,width:n.width}),a||(s?Zx:Jx)(i,{shape:l},e,r,null),(s?Zx:Jx)(i,{shape:h},e?t.baseAxis.model:null,r)}function MD(t,e){for(var i=0;i0?1:-1,s=n.height>0?1:-1;return{x:n.x+o*r/2,y:n.y+s*r/2,width:n.width-o*r,height:n.height-s*r}},polar:function(t,e,i){var n=t.getItemLayout(e);return{cx:n.cx,cy:n.cy,r0:n.r0,r:n.r,startAngle:n.startAngle,endAngle:n.endAngle,clockwise:n.clockwise}}};function ED(t){return function(t){var e=t?"Arc":"Angle";return function(t){switch(t){case"start":case"insideStart":case"end":case"insideEnd":return t+e;default:return t}}}(t)}function PD(t,e,i,n,r,o,s,a){var l=e.getItemVisual(i,"style");if(a){if(!o.get("roundCap")){var h=t.shape;Gp(h,wD(n.getModel("itemStyle"),h,!0)),t.setShape(h)}}else{var c=n.get(["itemStyle","borderRadius"])||0;t.setShape("r",c)}t.useStyle(l);var u=n.getShallow("cursor");u&&t.attr("cursor",u);var d=a?s?r.r>=r.r0?"endArc":"startArc":r.endAngle>=r.startAngle?"endAngle":"startAngle":s?r.height>=0?"bottom":"top":r.width>=0?"right":"left",p=T_(n);D_(t,p,{labelFetcher:o,labelDataIndex:i,defaultText:sM(o.getData(),i),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:d});var f=t.getTextContent();if(a&&f){var g=n.get(["label","position"]);t.textConfig.inside="middle"===g||null,function(t,e,i,n){if(hf(n))t.setTextConfig({rotation:n});else if(of(e))t.setTextConfig({rotation:0});else{var r,o=t.shape,s=o.clockwise?o.startAngle:o.endAngle,a=o.clockwise?o.endAngle:o.startAngle,l=(s+a)/2,h=i(e);switch(h){case"startArc":case"insideStartArc":case"middle":case"insideEndArc":case"endArc":r=l;break;case"startAngle":case"insideStartAngle":r=s;break;case"endAngle":case"insideEndAngle":r=a;break;default:return void t.setTextConfig({rotation:0})}var c=1.5*Math.PI-r;"middle"===h&&c>Math.PI/2&&c<1.5*Math.PI&&(c-=Math.PI),t.setTextConfig({rotation:c})}}(t,"outside"===g?d:g,ED(s),n.get(["label","rotate"]))}!function(t,e,i,n){if(t){var r=N_(t);r.prevValue=r.value,r.value=i;var o=e.normal;r.valueAnimation=o.get("valueAnimation"),r.valueAnimation&&(r.precision=o.get("precision"),r.defaultInterpolatedText=n,r.statesModels=e)}}(f,p,o.getRawValue(i),(function(t){return aM(e,t)}));var m=n.getModel(["emphasis"]);Iw(t,m.get("focus"),m.get("blurScope"),m.get("disabled")),Pw(t,n),function(t){return null!=t.startAngle&&null!=t.endAngle&&t.startAngle===t.endAngle}(r)&&(t.style.fill="none",t.style.stroke="none",Zp(t.states,(function(t){t.style&&(t.style.fill=t.style.stroke="none")})))}var LD=function(){},RD=function(t){function e(e){var i=t.call(this,e)||this;return i.type="largeBar",i}return Sp(e,t),e.prototype.getDefaultShape=function(){return new LD},e.prototype.buildPath=function(t,e){for(var i=e.points,n=this.baseDimIdx,r=1-this.baseDimIdx,o=[],s=[],a=this.barWidth,l=0;l=a[0]&&e<=a[0]+l[0]&&i>=a[1]&&i<=a[1]+l[1])return s[c]}return-1}(this,t.offsetX,t.offsetY);Ub(this).dataIndex=e>=0?e:null}),30,!1);function zD(t,e,i){if(zM(i,"cartesian2d")){var n=e,r=i.getArea();return{x:t?n.x:r.x,y:t?r.y:n.y,width:t?n.width:r.width,height:t?r.height:n.height}}var o=e;return{cx:(r=i.getArea()).cx,cy:r.cy,r0:t?r.r0:o.r0,r:t?r.r:o.r,startAngle:t?o.startAngle:0,endAngle:t?o.endAngle:2*Math.PI}}function $D(t,e,i,n,r){var o=t+e;i.isSilent(o)||n.eachComponent({mainType:"series",subType:"pie"},(function(t){for(var e=t.seriesIndex,n=t.option.selectedMap,s=r.selected,a=0;an?c=o=D+x*n/2:(o=D+k,c=r-k),e.setItemLayout(i,{angle:n,startAngle:o,endAngle:c,clockwise:v,cx:s,cy:a,r0:h,r:y?ab(t,w,[h,l]):l}),D=r}})),C0){e=e/180*Math.PI,YD.fromArray(t[0]),XD.fromArray(t[1]),KD.fromArray(t[2]),lg.sub(ZD,YD,XD),lg.sub(JD,KD,XD);var i=ZD.len(),n=JD.len();if(!(i<.001||n<.001)){ZD.scale(1/i),JD.scale(1/n);var r=ZD.dot(JD);if(Math.cos(e)1&&lg.copy(tT,KD),tT.toArray(t[1])}}}}function iT(t,e,i){if(i<=180&&i>0){i=i/180*Math.PI,YD.fromArray(t[0]),XD.fromArray(t[1]),KD.fromArray(t[2]),lg.sub(ZD,XD,YD),lg.sub(JD,KD,XD);var n=ZD.len(),r=JD.len();if(!(n<.001||r<.001))if(ZD.scale(1/n),JD.scale(1/r),ZD.dot(e)=s)lg.copy(tT,KD);else{tT.scaleAndAdd(JD,o/Math.tan(Math.PI/2-a));var l=KD.x!==XD.x?(tT.x-XD.x)/(KD.x-XD.x):(tT.y-XD.y)/(KD.y-XD.y);if(isNaN(l))return;l<0?lg.copy(tT,XD):l>1&&lg.copy(tT,KD)}tT.toArray(t[1])}}}function nT(t,e,i,n){var r="normal"===i,o=r?t:t.ensureState(i);o.ignore=e;var s=n.get("smooth");s&&!0===s&&(s=.3),o.shape=o.shape||{},s>0&&(o.shape.smooth=s);var a=n.getModel("lineStyle").getLineStyle();r?t.useStyle(a):o.style=a}function rT(t,e){var i=e.smooth,n=e.points;if(n)if(t.moveTo(n[0][0],n[0][1]),i>0&&n.length>=3){var r=Gg(n[0],n[1]),o=Gg(n[1],n[2]);if(!r||!o)return t.lineTo(n[1][0],n[1][1]),void t.lineTo(n[2][0],n[2][1]);var s=Math.min(r,o)*i,a=Yg([],n[1],n[0],s/r),l=Yg([],n[1],n[2],s/o),h=Yg([],a,l,.5);t.bezierCurveTo(a[0],a[1],a[0],a[1],h[0],h[1]),t.bezierCurveTo(l[0],l[1],l[0],l[1],n[2][0],n[2][1])}else for(var c=1;c0&&o&&w(-c/s,0,s);var f,g,m=t[0],v=t[s-1];return y(),f<0&&x(-f,.8),g<0&&x(g,.8),y(),b(f,g,1),b(g,f,-1),y(),f<0&&_(-f),g<0&&_(g),h}function y(){f=m.rect[e]-n,g=r-v.rect[e]-v.rect[i]}function b(t,e,i){if(t<0){var n=Math.min(e,-t);if(n>0){w(n*i,0,s);var r=n+t;r<0&&x(-r*i,1)}else x(-t*i,1)}}function w(i,n,r){0!==i&&(h=!0);for(var o=n;o0)for(l=0;l0;l--)w(-o[l-1]*u,l,s)}}function _(t){var e=t<0?-1:1;t=Math.abs(t);for(var i=Math.ceil(t/(s-1)),n=0;n0?w(i,0,n+1):w(-i,s-n-1,s),(t-=i)<=0)return}}(t,"y","height",e,i,n)}var lT=Math.PI/180;function hT(t,e,i,n,r,o,s,a,l,h){if(!(t.length<2)){for(var c=t.length,u=0;ui?s:o,c=Math.abs(l.label.y-i);if(c>=h.maxY){var u=l.label.x-e-l.len2*r,d=n+l.len,f=Math.abs(u)t.unconstrainedWidth?null:p:null;n.setStyle("width",f)}var g=n.getBoundingRect();o.width=g.width;var m=(n.style.margin||0)+2.1;o.height=g.height+m,o.y-=(o.height-u)/2}}}function uT(t){return"center"===t.position}function dT(t){var e,i,n=t.getData(),r=[],o=!1,s=(t.get("minShowLabelAngle")||0)*lT,a=n.getLayout("viewRect"),l=n.getLayout("r"),h=a.width,c=a.x,u=a.y,d=a.height;function p(t){t.ignore=!0}n.each((function(t){var a=n.getItemGraphicEl(t),u=a.shape,d=a.getTextContent(),f=a.getTextGuideLine(),g=n.getItemModel(t),m=g.getModel("label"),v=m.get("position")||g.get(["emphasis","label","position"]),y=m.get("distanceToLabelLine"),b=m.get("alignTo"),w=lb(m.get("edgeDistance"),h),x=m.get("bleedMargin"),_=g.getModel("labelLine"),k=_.get("length");k=lb(k,h);var S=_.get("length2");if(S=lb(S,h),Math.abs(u.endAngle-u.startAngle)0?"right":"left":I>0?"left":"right"}var z=Math.PI,$=0,F=m.get("rotate");if(hf(F))$=F*(z/180);else if("center"===v)$=0;else if("radial"===F||!0===F){$=I<0?-T+z:-T}else if("tangential"===F&&"outside"!==v&&"outer"!==v){var V=Math.atan2(I,O);V<0&&(V=2*z+V),O>0&&(V=z+V),$=V-z}if(o=!!$,d.x=A,d.y=C,d.rotation=$,d.setStyle({verticalAlign:"middle"}),E){d.setStyle({align:D});var H=d.states.select;H&&(H.x+=d.x,H.y+=d.y)}else{var W=d.getBoundingRect().clone();W.applyTransform(d.getComputedTransform());var U=(d.style.margin||0)+2.1;W.y-=U/2,W.height+=U,r.push({label:d,labelLine:f,position:v,len:k,len2:S,minTurnAngle:_.get("minTurnAngle"),maxSurfaceAngle:_.get("maxSurfaceAngle"),surfaceNormal:new lg(I,O),linePoints:M,textAlign:D,labelDistance:y,labelAlignTo:b,edgeDistance:w,bleedMargin:x,rect:W,unconstrainedWidth:W.width,labelStyleWidth:d.style.width})}a.setTextConfig({inside:E})}})),!o&&t.get("avoidLabelOverlap")&&function(t,e,i,n,r,o,s,a){for(var l=[],h=[],c=Number.MAX_VALUE,u=-Number.MAX_VALUE,d=0;d0){for(var l=o.getItemLayout(0),h=1;isNaN(l&&l.startAngle)&&h=i.r0}},e.type="pie",e}(IM);function gT(t,e,i){e=of(e)&&{coordDimensions:e}||Gp({encodeDefine:t.getEncode()},e);var n=t.getSource(),r=TS(n,e).dimensions,o=new DS(r,t);return o.initData(n,i),o}var mT=function(){function t(t,e){this._getDataWithEncodedVisual=t,this._getRawData=e}return t.prototype.getAllNames=function(){var t=this._getRawData();return t.mapArray(t.getName)},t.prototype.containName=function(t){return this._getRawData().indexOfName(t)>=0},t.prototype.indexOfName=function(t){return this._getDataWithEncodedVisual().indexOfName(t)},t.prototype.getItemVisual=function(t,e){return this._getDataWithEncodedVisual().getItemVisual(t,e)},t}(),vT=Bb(),yT=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Sp(e,t),e.prototype.init=function(e){t.prototype.init.apply(this,arguments),this.legendVisualProvider=new mT(nf(this.getData,this),nf(this.getRawData,this)),this._defaultLabelLine(e)},e.prototype.mergeOption=function(){t.prototype.mergeOption.apply(this,arguments)},e.prototype.getInitialData=function(){return gT(this,{coordDimensions:["value"],encodeDefaulter:rf(pk,this)})},e.prototype.getDataParams=function(e){var i=this.getData(),n=vT(i),r=n.seats;if(!r){var o=[];i.each(i.mapDimension("value"),(function(t){o.push(t)})),r=n.seats=function(t,e){var i=Qp(t,(function(t,e){return t+(isNaN(e)?0:e)}),0);if(0===i)return[];for(var n=Math.pow(10,e),r=Jp(t,(function(t){return(isNaN(t)?0:t)/i*n*100})),o=100*n,s=Jp(r,(function(t){return Math.floor(t)})),a=Qp(s,(function(t,e){return t+e}),0),l=Jp(r,(function(t,e){return t-s[e]}));ah&&(h=l[u],c=u);++s[c],l[c]=0,++a}return Jp(s,(function(t){return t/n}))}(o,i.hostModel.get("percentPrecision"))}var s=t.prototype.getDataParams.call(this,e);return s.percent=r[e]||0,s.$vars.push("percent"),s},e.prototype._defaultLabelLine=function(t){Cb(t,"labelLine",["show"]);var e=t.labelLine,i=t.emphasis.labelLine;e.show=e.show&&t.label.show,i.show=i.show&&t.emphasis.label.show},e.type="series.pie",e.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,endAngle:"auto",padAngle:0,minAngle:0,minShowLabelAngle:0,selectedOffset:10,percentPrecision:2,stillShowZeroSum:!0,left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:0,show:!0,overflow:"truncate",position:"outer",alignTo:"none",edgeDistance:"25%",bleedMargin:10,distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:15,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1,borderJoin:"round"},showEmptyCircle:!0,emptyCircleStyle:{color:"lightgray",opacity:1},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:"expansion",animationDuration:1e3,animationTypeUpdate:"transition",animationEasingUpdate:"cubicInOut",animationDurationUpdate:500,animationEasing:"cubicInOut"},e}(FC);var bT=function(t,e){this.target=t,this.topTarget=e&&e.topTarget},wT=function(){function t(t){this.handler=t,t.on("mousedown",this._dragStart,this),t.on("mousemove",this._drag,this),t.on("mouseup",this._dragEnd,this)}return t.prototype._dragStart=function(t){for(var e=t.target;e&&!e.draggable;)e=e.parent||e.__hostTarget;e&&(this._draggingTarget=e,e.dragging=!0,this._x=t.offsetX,this._y=t.offsetY,this.handler.dispatchToElement(new bT(e,t),"dragstart",t.event))},t.prototype._drag=function(t){var e=this._draggingTarget;if(e){var i=t.offsetX,n=t.offsetY,r=i-this._x,o=n-this._y;this._x=i,this._y=n,e.drift(r,o,t),this.handler.dispatchToElement(new bT(e,t),"drag",t.event);var s=this.handler.findHover(i,n,e).target,a=this._dropTarget;this._dropTarget=s,e!==s&&(a&&s!==a&&this.handler.dispatchToElement(new bT(a,t),"dragleave",t.event),s&&s!==a&&this.handler.dispatchToElement(new bT(s,t),"dragenter",t.event))}},t.prototype._dragEnd=function(t){var e=this._draggingTarget;e&&(e.dragging=!1),this.handler.dispatchToElement(new bT(e,t),"dragend",t.event),this._dropTarget&&this.handler.dispatchToElement(new bT(this._dropTarget,t),"drop",t.event),this._draggingTarget=null,this._dropTarget=null},t}(),xT=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,_T=[],kT=Nf.browser.firefox&&+Nf.browser.version.split(".")[0]<39;function ST(t,e,i,n){return i=i||{},n?AT(t,e,i):kT&&null!=e.layerX&&e.layerX!==e.offsetX?(i.zrX=e.layerX,i.zrY=e.layerY):null!=e.offsetX?(i.zrX=e.offsetX,i.zrY=e.offsetY):AT(t,e,i),i}function AT(t,e,i){if(Nf.domSupported&&t.getBoundingClientRect){var n=e.clientX,r=e.clientY;if(YS(t)){var o=t.getBoundingClientRect();return i.zrX=n-o.left,void(i.zrY=r-o.top)}if(qS(_T,t,n,r))return i.zrX=_T[0],void(i.zrY=_T[1])}i.zrX=i.zrY=0}function CT(t){return t||window.event}function MT(t,e,i){if(null!=(e=CT(e)).zrX)return e;var n=e.type;if(n&&n.indexOf("touch")>=0){var r="touchend"!==n?e.targetTouches[0]:e.changedTouches[0];r&&ST(t,r,e,i)}else{ST(t,e,e,i);var o=function(t){var e=t.wheelDelta;if(e)return e;var i=t.deltaX,n=t.deltaY;if(null==i||null==n)return e;return 3*(0!==n?Math.abs(n):Math.abs(i))*(n>0?-1:n<0?1:i>0?-1:1)}(e);e.zrDelta=o?o/120:-(e.detail||0)/3}var s=e.button;return null==e.which&&void 0!==s&&xT.test(e.type)&&(e.which=1&s?1:2&s?3:4&s?2:0),e}function DT(t,e,i,n){t.removeEventListener(e,i,n)}var TT=function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0},IT=function(){function t(){this._track=[]}return t.prototype.recognize=function(t,e,i){return this._doTrack(t,e,i),this._recognize(t)},t.prototype.clear=function(){return this._track.length=0,this},t.prototype._doTrack=function(t,e,i){var n=t.touches;if(n){for(var r={points:[],touches:[],target:e,event:t},o=0,s=n.length;o1&&r&&r.length>1){var s=OT(r)/OT(o);!isFinite(s)&&(s=1),e.pinchScale=s;var a=[((n=r)[0][0]+n[1][0])/2,(n[0][1]+n[1][1])/2];return e.pinchX=a[0],e.pinchY=a[1],{type:"pinch",target:t[0].target,event:e}}}}},PT="silent";function LT(){TT(this.event)}var RT=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.handler=null,e}return Sp(e,t),e.prototype.dispose=function(){},e.prototype.setCursor=function(){},e}(dv),NT=function(t,e){this.x=t,this.y=e},BT=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],zT=new vg(0,0,0,0),$T=function(t){function e(e,i,n,r,o){var s=t.call(this)||this;return s._hovered=new NT(0,0),s.storage=e,s.painter=i,s.painterRoot=r,s._pointerSize=o,n=n||new RT,s.proxy=null,s.setHandlerProxy(n),s._draggingMgr=new wT(s),s}return Sp(e,t),e.prototype.setHandlerProxy=function(t){this.proxy&&this.proxy.dispose(),t&&(Zp(BT,(function(e){t.on&&t.on(e,this[e],this)}),this),t.handler=this),this.proxy=t},e.prototype.mousemove=function(t){var e=t.zrX,i=t.zrY,n=HT(this,e,i),r=this._hovered,o=r.target;o&&!o.__zr&&(o=(r=this.findHover(r.x,r.y)).target);var s=this._hovered=n?new NT(e,i):this.findHover(e,i),a=s.target,l=this.proxy;l.setCursor&&l.setCursor(a?a.cursor:"default"),o&&a!==o&&this.dispatchToElement(r,"mouseout",t),this.dispatchToElement(s,"mousemove",t),a&&a!==o&&this.dispatchToElement(s,"mouseover",t)},e.prototype.mouseout=function(t){var e=t.zrEventControl;"only_globalout"!==e&&this.dispatchToElement(this._hovered,"mouseout",t),"no_globalout"!==e&&this.trigger("globalout",{type:"globalout",event:t})},e.prototype.resize=function(){this._hovered=new NT(0,0)},e.prototype.dispatch=function(t,e){var i=this[t];i&&i.call(this,e)},e.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},e.prototype.setCursorStyle=function(t){var e=this.proxy;e.setCursor&&e.setCursor(t)},e.prototype.dispatchToElement=function(t,e,i){var n=(t=t||{}).target;if(!n||!n.silent){for(var r="on"+e,o=function(t,e,i){return{type:t,event:i,target:e.target,topTarget:e.topTarget,cancelBubble:!1,offsetX:i.zrX,offsetY:i.zrY,gestureEvent:i.gestureEvent,pinchX:i.pinchX,pinchY:i.pinchY,pinchScale:i.pinchScale,wheelDelta:i.zrDelta,zrByTouch:i.zrByTouch,which:i.which,stop:LT}}(e,t,i);n&&(n[r]&&(o.cancelBubble=!!n[r].call(n,o)),n.trigger(e,o),n=n.__hostTarget?n.__hostTarget:n.parent,!o.cancelBubble););o.cancelBubble||(this.trigger(e,o),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer((function(t){"function"==typeof t[r]&&t[r].call(t,o),t.trigger&&t.trigger(e,o)})))}},e.prototype.findHover=function(t,e,i){var n=this.storage.getDisplayList(),r=new NT(t,e);if(VT(n,r,t,e,i),this._pointerSize&&!r.target){for(var o=[],s=this._pointerSize,a=s/2,l=new vg(t-a,e-a,s,s),h=n.length-1;h>=0;h--){var c=n[h];c===i||c.ignore||c.ignoreCoarsePointer||c.parent&&c.parent.ignoreCoarsePointer||(zT.copy(c.getBoundingRect()),c.transform&&zT.applyTransform(c.transform),zT.intersect(l)&&o.push(c))}if(o.length)for(var u=Math.PI/12,d=2*Math.PI,p=0;p=0;o--){var s=t[o],a=void 0;if(s!==r&&!s.ignore&&(a=FT(s,i,n))&&(!e.topTarget&&(e.topTarget=s),a!==PT)){e.target=s;break}}}function HT(t,e,i){var n=t.painter;return e<0||e>n.getWidth()||i<0||i>n.getHeight()}Zp(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],(function(t){$T.prototype[t]=function(e){var i,n,r=e.zrX,o=e.zrY,s=HT(this,r,o);if("mouseup"===t&&s||(n=(i=this.findHover(r,o)).target),"mousedown"===t)this._downEl=n,this._downPoint=[e.zrX,e.zrY],this._upEl=n;else if("mouseup"===t)this._upEl=n;else if("click"===t){if(this._downEl!==this._upEl||!this._downPoint||Gg(this._downPoint,[e.zrX,e.zrY])>4)return;this._downPoint=null}this.dispatchToElement(i,t,e)}}));function WT(t,e,i,n){var r=e+1;if(r===i)return 1;if(n(t[r++],t[e])<0){for(;r=0;)r++;return r-e}function UT(t,e,i,n,r){for(n===e&&n++;n>>1])<0?l=o:a=o+1;var h=n-a;switch(h){case 3:t[a+3]=t[a+2];case 2:t[a+2]=t[a+1];case 1:t[a+1]=t[a];break;default:for(;h>0;)t[a+h]=t[a+h-1],h--}t[a]=s}}function jT(t,e,i,n,r,o){var s=0,a=0,l=1;if(o(t,e[i+r])>0){for(a=n-r;l0;)s=l,(l=1+(l<<1))<=0&&(l=a);l>a&&(l=a),s+=r,l+=r}else{for(a=r+1;la&&(l=a);var h=s;s=r-l,l=r-h}for(s++;s>>1);o(t,e[i+c])>0?s=c+1:l=c}return l}function GT(t,e,i,n,r,o){var s=0,a=0,l=1;if(o(t,e[i+r])<0){for(a=r+1;la&&(l=a);var h=s;s=r-l,l=r-h}else{for(a=n-r;l=0;)s=l,(l=1+(l<<1))<=0&&(l=a);l>a&&(l=a),s+=r,l+=r}for(s++;s>>1);o(t,e[i+c])<0?l=c:s=c+1}return l}function qT(t,e){var i,n,r=7,o=0,s=[];function a(a){var l=i[a],h=n[a],c=i[a+1],u=n[a+1];n[a]=h+u,a===o-3&&(i[a+1]=i[a+2],n[a+1]=n[a+2]),o--;var d=GT(t[c],t,l,h,0,e);l+=d,0!==(h-=d)&&0!==(u=jT(t[l+h-1],t,c,u,u-1,e))&&(h<=u?function(i,n,o,a){var l=0;for(l=0;l=7||p>=7);if(f)break;g<0&&(g=0),g+=2}if((r=g)<1&&(r=1),1===n){for(l=0;l=0;l--)t[p+l]=t[d+l];return void(t[u]=s[c])}var f=r;for(;;){var g=0,m=0,v=!1;do{if(e(s[c],t[h])<0){if(t[u--]=t[h--],g++,m=0,0==--n){v=!0;break}}else if(t[u--]=s[c--],m++,g=0,1==--a){v=!0;break}}while((g|m)=0;l--)t[p+l]=t[d+l];if(0===n){v=!0;break}}if(t[u--]=s[c--],1==--a){v=!0;break}if(0!==(m=a-jT(t[h],s,0,a,a-1,e))){for(a-=m,p=(u-=m)+1,d=(c-=m)+1,l=0;l=7||m>=7);if(v)break;f<0&&(f=0),f+=2}(r=f)<1&&(r=1);if(1===a){for(p=(u-=n)+1,d=(h-=n)+1,l=n-1;l>=0;l--)t[p+l]=t[d+l];t[u]=s[c]}else{if(0===a)throw new Error;for(d=u-(a-1),l=0;l1;){var t=o-2;if(t>=1&&n[t-1]<=n[t]+n[t+1]||t>=2&&n[t-2]<=n[t]+n[t-1])n[t-1]n[t+1])break;a(t)}},forceMergeRuns:function(){for(;o>1;){var t=o-2;t>0&&n[t-1]=32;)e|=1&t,t>>=1;return t+e}(r);do{if((o=WT(t,i,n,e))a&&(l=a),UT(t,i,i+l,i+o,e),o=l}s.pushRun(i,o),s.mergeRuns(),r-=o,i+=o}while(0!==r);s.forceMergeRuns()}}}var XT=!1;function KT(){XT||(XT=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function ZT(t,e){return t.zlevel===e.zlevel?t.z===e.z?t.z2-e.z2:t.z-e.z:t.zlevel-e.zlevel}var JT,QT=function(){function t(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=ZT}return t.prototype.traverse=function(t,e){for(var i=0;i0&&(h.__clipPaths=[]),isNaN(h.z)&&(KT(),h.z=0),isNaN(h.z2)&&(KT(),h.z2=0),isNaN(h.zlevel)&&(KT(),h.zlevel=0),this._displayList[this._displayListLen++]=h}var c=t.getDecalElement&&t.getDecalElement();c&&this._updateAndAddDisplayable(c,e,i);var u=t.getTextGuideLine();u&&this._updateAndAddDisplayable(u,e,i);var d=t.getTextContent();d&&this._updateAndAddDisplayable(d,e,i)}},t.prototype.addRoot=function(t){t.__zr&&t.__zr.storage===this||this._roots.push(t)},t.prototype.delRoot=function(t){if(t instanceof Array)for(var e=0,i=t.length;e=0&&this._roots.splice(n,1)}},t.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},t.prototype.getRoots=function(){return this._roots},t.prototype.dispose=function(){this._displayList=null,this._roots=null},t}();function tI(){return(new Date).getTime()}JT=Nf.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(t){return setTimeout(t,16)};var eI,iI,nI,rI=function(t){function e(e){var i=t.call(this)||this;return i._running=!1,i._time=0,i._pausedTime=0,i._pauseStart=0,i._paused=!1,e=e||{},i.stage=e.stage||{},i}return Sp(e,t),e.prototype.addClip=function(t){t.animation&&this.removeClip(t),this._head?(this._tail.next=t,t.prev=this._tail,t.next=null,this._tail=t):this._head=this._tail=t,t.animation=this},e.prototype.addAnimator=function(t){t.animation=this;var e=t.getClip();e&&this.addClip(e)},e.prototype.removeClip=function(t){if(t.animation){var e=t.prev,i=t.next;e?e.next=i:this._head=i,i?i.prev=e:this._tail=e,t.next=t.prev=t.animation=null}},e.prototype.removeAnimator=function(t){var e=t.getClip();e&&this.removeClip(e),t.animation=null},e.prototype.update=function(t){for(var e=tI()-this._pausedTime,i=e-this._time,n=this._head;n;){var r=n.next;n.step(e,i)?(n.ondestroy(),this.removeClip(n),n=r):n=r}this._time=e,t||(this.trigger("frame",i),this.stage.update&&this.stage.update())},e.prototype._startLoop=function(){var t=this;this._running=!0,JT((function e(){t._running&&(JT(e),!t._paused&&t.update())}))},e.prototype.start=function(){this._running||(this._time=tI(),this._pausedTime=0,this._startLoop())},e.prototype.stop=function(){this._running=!1},e.prototype.pause=function(){this._paused||(this._pauseStart=tI(),this._paused=!0)},e.prototype.resume=function(){this._paused&&(this._pausedTime+=tI()-this._pauseStart,this._paused=!1)},e.prototype.clear=function(){for(var t=this._head;t;){var e=t.next;t.prev=t.next=t.animation=null,t=e}this._head=this._tail=null},e.prototype.isFinished=function(){return null==this._head},e.prototype.animate=function(t,e){e=e||{},this.start();var i=new uv(t,e.loop);return this.addAnimator(i),i},e}(dv),oI=Nf.domSupported,sI=(iI={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},nI=Jp(eI=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],(function(t){var e=t.replace("mouse","pointer");return iI.hasOwnProperty(e)?e:t})),{mouse:eI,touch:["touchstart","touchend","touchmove"],pointer:nI}),aI=["mousemove","mouseup"],lI=["pointermove","pointerup"],hI=!1;function cI(t){var e=t.pointerType;return"pen"===e||"touch"===e}function uI(t){t&&(t.zrByTouch=!0)}function dI(t,e){for(var i=e,n=!1;i&&9!==i.nodeType&&!(n=i.domBelongToZr||i!==e&&i===t.painterRoot);)i=i.parentNode;return n}var pI=function(t,e){this.stopPropagation=Pf,this.stopImmediatePropagation=Pf,this.preventDefault=Pf,this.type=e.type,this.target=this.currentTarget=t.dom,this.pointerType=e.pointerType,this.clientX=e.clientX,this.clientY=e.clientY},fI={mousedown:function(t){t=MT(this.dom,t),this.__mayPointerCapture=[t.zrX,t.zrY],this.trigger("mousedown",t)},mousemove:function(t){t=MT(this.dom,t);var e=this.__mayPointerCapture;!e||t.zrX===e[0]&&t.zrY===e[1]||this.__togglePointerCapture(!0),this.trigger("mousemove",t)},mouseup:function(t){t=MT(this.dom,t),this.__togglePointerCapture(!1),this.trigger("mouseup",t)},mouseout:function(t){dI(this,(t=MT(this.dom,t)).toElement||t.relatedTarget)||(this.__pointerCapturing&&(t.zrEventControl="no_globalout"),this.trigger("mouseout",t))},wheel:function(t){hI=!0,t=MT(this.dom,t),this.trigger("mousewheel",t)},mousewheel:function(t){hI||(t=MT(this.dom,t),this.trigger("mousewheel",t))},touchstart:function(t){uI(t=MT(this.dom,t)),this.__lastTouchMoment=new Date,this.handler.processGesture(t,"start"),fI.mousemove.call(this,t),fI.mousedown.call(this,t)},touchmove:function(t){uI(t=MT(this.dom,t)),this.handler.processGesture(t,"change"),fI.mousemove.call(this,t)},touchend:function(t){uI(t=MT(this.dom,t)),this.handler.processGesture(t,"end"),fI.mouseup.call(this,t),+new Date-+this.__lastTouchMoment<300&&fI.click.call(this,t)},pointerdown:function(t){fI.mousedown.call(this,t)},pointermove:function(t){cI(t)||fI.mousemove.call(this,t)},pointerup:function(t){fI.mouseup.call(this,t)},pointerout:function(t){cI(t)||fI.mouseout.call(this,t)}};Zp(["click","dblclick","contextmenu"],(function(t){fI[t]=function(e){e=MT(this.dom,e),this.trigger(t,e)}}));var gI={pointermove:function(t){cI(t)||gI.mousemove.call(this,t)},pointerup:function(t){gI.mouseup.call(this,t)},mousemove:function(t){this.trigger("mousemove",t)},mouseup:function(t){var e=this.__pointerCapturing;this.__togglePointerCapture(!1),this.trigger("mouseup",t),e&&(t.zrEventControl="only_globalout",this.trigger("mouseout",t))}};function mI(t,e){var i=e.domHandlers;Nf.pointerEventsSupported?Zp(sI.pointer,(function(n){yI(e,n,(function(e){i[n].call(t,e)}))})):(Nf.touchEventsSupported&&Zp(sI.touch,(function(n){yI(e,n,(function(r){i[n].call(t,r),function(t){t.touching=!0,null!=t.touchTimer&&(clearTimeout(t.touchTimer),t.touchTimer=null),t.touchTimer=setTimeout((function(){t.touching=!1,t.touchTimer=null}),700)}(e)}))})),Zp(sI.mouse,(function(n){yI(e,n,(function(r){r=CT(r),e.touching||i[n].call(t,r)}))})))}function vI(t,e){function i(i){yI(e,i,(function(n){n=CT(n),dI(t,n.target)||(n=function(t,e){return MT(t.dom,new pI(t,e),!0)}(t,n),e.domHandlers[i].call(t,n))}),{capture:!0})}Nf.pointerEventsSupported?Zp(lI,i):Nf.touchEventsSupported||Zp(aI,i)}function yI(t,e,i,n){t.mounted[e]=i,t.listenerOpts[e]=n,function(t,e,i,n){t.addEventListener(e,i,n)}(t.domTarget,e,i,n)}function bI(t){var e=t.mounted;for(var i in e)e.hasOwnProperty(i)&&DT(t.domTarget,i,e[i],t.listenerOpts[i]);t.mounted={}}var wI=function(t,e){this.mounted={},this.listenerOpts={},this.touching=!1,this.domTarget=t,this.domHandlers=e},xI=function(t){function e(e,i){var n=t.call(this)||this;return n.__pointerCapturing=!1,n.dom=e,n.painterRoot=i,n._localHandlerScope=new wI(e,fI),oI&&(n._globalHandlerScope=new wI(document,gI)),mI(n,n._localHandlerScope),n}return Sp(e,t),e.prototype.dispose=function(){bI(this._localHandlerScope),oI&&bI(this._globalHandlerScope)},e.prototype.setCursor=function(t){this.dom.style&&(this.dom.style.cursor=t||"default")},e.prototype.__togglePointerCapture=function(t){if(this.__mayPointerCapture=null,oI&&+this.__pointerCapturing^+t){this.__pointerCapturing=t;var e=this._globalHandlerScope;t?vI(this,e):bI(e)}},e}(dv),_I={},kI={};var SI=function(){function t(t,e,i){var n=this;this._sleepAfterStill=10,this._stillFrameAccum=0,this._needsRefresh=!0,this._needsRefreshHover=!0,this._darkMode=!1,i=i||{},this.dom=e,this.id=t;var r=new QT,o=i.renderer||"canvas";_I[o]||(o=ef(_I)[0]),i.useDirtyRect=null!=i.useDirtyRect&&i.useDirtyRect;var s=new _I[o](e,r,i,t),a=i.ssr||s.ssrOnly;this.storage=r,this.painter=s;var l,h=Nf.node||Nf.worker||a?null:new xI(s.getViewportRoot(),s.root),c=i.useCoarsePointer;(null==c||"auto"===c?Nf.touchEventsSupported:!!c)&&(l=vf(i.pointerSize,44)),this.handler=new $T(r,s,h,s.root,l),this.animation=new rI({stage:{update:a?null:function(){return n._flush(!0)}}}),a||this.animation.start()}return t.prototype.add=function(t){!this._disposed&&t&&(this.storage.addRoot(t),t.addSelfToZr(this),this.refresh())},t.prototype.remove=function(t){!this._disposed&&t&&(this.storage.delRoot(t),t.removeSelfFromZr(this),this.refresh())},t.prototype.configLayer=function(t,e){this._disposed||(this.painter.configLayer&&this.painter.configLayer(t,e),this.refresh())},t.prototype.setBackgroundColor=function(t){this._disposed||(this.painter.setBackgroundColor&&this.painter.setBackgroundColor(t),this.refresh(),this._backgroundColor=t,this._darkMode=function(t){if(!t)return!1;if("string"==typeof t)return Xm(t,1)<.4;if(t.colorStops){for(var e=t.colorStops,i=0,n=e.length,r=0;r0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},t.prototype.setSleepAfterStill=function(t){this._sleepAfterStill=t},t.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},t.prototype.refreshHover=function(){this._needsRefreshHover=!0},t.prototype.refreshHoverImmediately=function(){this._disposed||(this._needsRefreshHover=!1,this.painter.refreshHover&&"canvas"===this.painter.getType()&&this.painter.refreshHover())},t.prototype.resize=function(t){this._disposed||(t=t||{},this.painter.resize(t.width,t.height),this.handler.resize())},t.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},t.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},t.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},t.prototype.setCursorStyle=function(t){this._disposed||this.handler.setCursorStyle(t)},t.prototype.findHover=function(t,e){if(!this._disposed)return this.handler.findHover(t,e)},t.prototype.on=function(t,e,i){return this._disposed||this.handler.on(t,e,i),this},t.prototype.off=function(t,e){this._disposed||this.handler.off(t,e)},t.prototype.trigger=function(t,e){this._disposed||this.handler.trigger(t,e)},t.prototype.clear=function(){if(!this._disposed){for(var t=this.storage.getRoots(),e=0;e=0;s--)n[s]&&!Rb(n[s])?o=!0:(n[s]=null,!o&&r--);n.length=r,t[i]=n}})),delete t[PI],t},e.prototype.getTheme=function(){return this._theme},e.prototype.getLocaleModel=function(){return this._locale},e.prototype.setUpdatePayload=function(t){this._payload=t},e.prototype.getUpdatePayload=function(){return this._payload},e.prototype.getComponent=function(t,e){var i=this._componentsMap.get(t);if(i){var n=i[e||0];if(n)return n;if(null==e)for(var r=0;r=e:"max"===i?t<=e:t===e})(n[s],t,o)||(r=!1)}})),r}var WI=Zp,UI=cf,jI=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function GI(t){var e=t&&t.itemStyle;if(e)for(var i=0,n=jI.length;i=0;g--){var m=t[g];if(a||(d=m.data.rawIndexOf(m.stackedByDimension,u)),d>=0){var v=m.data.getByRawIndex(m.stackResultDimension,d);if("all"===l||"positive"===l&&v>0||"negative"===l&&v<0||"samesign"===l&&p>=0&&v>0||"samesign"===l&&p<=0&&v<0){p=ub(p,v),f=v;break}}}return n[0]=p,n[1]=f,n}))}))}var cO=function(){function t(){this.group=new ex,this.uid=FS("viewComponent")}return t.prototype.init=function(t,e){},t.prototype.render=function(t,e,i,n){},t.prototype.dispose=function(t,e){},t.prototype.updateView=function(t,e,i,n){},t.prototype.updateLayout=function(t,e,i,n){},t.prototype.updateVisual=function(t,e,i,n){},t.prototype.toggleBlurSeries=function(t,e,i){},t.prototype.eachRendered=function(t){var e=this.group;e&&e.traverse(t)},t}();Ff(cO),jf(cO);var uO=Bb(),dO={itemStyle:Gf(G_,!0),lineStyle:Gf(W_,!0)},pO={lineStyle:"stroke",itemStyle:"fill"};function fO(t,e){var i=t.visualStyleMapper||dO[e];return i||(console.warn("Unknown style type '"+e+"'."),dO.itemStyle)}function gO(t,e){var i=t.visualDrawType||pO[e];return i||(console.warn("Unknown style type '"+e+"'."),"fill")}var mO={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var i=t.getData(),n=t.visualStyleAccessPath||"itemStyle",r=t.getModel(n),o=fO(t,n)(r),s=r.getShallow("decal");s&&(i.setVisual("decal",s),s.dirty=!0);var a=gO(t,n),l=o[a],h=sf(l)?l:null,c="auto"===o.fill||"auto"===o.stroke;if(!o[a]||h||c){var u=t.getColorFromPalette(t.name,null,e.getSeriesCount());o[a]||(o[a]=u,i.setVisual("colorFromPalette",!0)),o.fill="auto"===o.fill||sf(o.fill)?u:o.fill,o.stroke="auto"===o.stroke||sf(o.stroke)?u:o.stroke}if(i.setVisual("style",o),i.setVisual("drawType",a),!e.isSeriesFiltered(t)&&h)return i.setVisual("colorFromPalette",!1),{dataEach:function(e,i){var n=t.getDataParams(i),r=Gp({},o);r[a]=h(n),e.setItemVisual(i,"style",r)}}}},vO=new X_,yO={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){if(!t.ignoreStyleOnData&&!e.isSeriesFiltered(t)){var i=t.getData(),n=t.visualStyleAccessPath||"itemStyle",r=fO(t,n),o=i.getVisual("drawType");return{dataEach:i.hasItemOption?function(t,e){var i=t.getRawDataItem(e);if(i&&i[n]){vO.option=i[n];var s=r(vO);Gp(t.ensureUniqueItemVisual(e,"style"),s),vO.option.decal&&(t.setItemVisual(e,"decal",vO.option.decal),vO.option.decal.dirty=!0),o in s&&t.setItemVisual(e,"colorFromPalette",!1)}}:null}}}},bO={performRawSeries:!0,overallReset:function(t){var e=Tf();t.eachSeries((function(t){var i=t.getColorBy();if(!t.isColorBySeries()){var n=t.type+"-"+i,r=e.get(n);r||(r={},e.set(n,r)),uO(t).scope=r}})),t.eachSeries((function(e){if(!e.isColorBySeries()&&!t.isSeriesFiltered(e)){var i=e.getRawData(),n={},r=e.getData(),o=uO(e).scope,s=e.visualStyleAccessPath||"itemStyle",a=gO(e,s);r.each((function(t){var e=r.getRawIndex(t);n[e]=t})),i.each((function(t){var s=n[t];if(r.getItemVisual(s,"colorFromPalette")){var l=r.ensureUniqueItemVisual(s,"style"),h=i.getName(t)||t+"",c=i.count();l[a]=e.getColorFromPalette(h,o,c)}}))}}))}},wO=Math.PI;var xO=function(){function t(t,e,i,n){this._stageTaskMap=Tf(),this.ecInstance=t,this.api=e,i=this._dataProcessorHandlers=i.slice(),n=this._visualHandlers=n.slice(),this._allHandlers=i.concat(n)}return t.prototype.restoreData=function(t,e){t.restoreData(e),this._stageTaskMap.each((function(t){var e=t.overallTask;e&&e.dirty()}))},t.prototype.getPerformArgs=function(t,e){if(t.__pipeline){var i=this._pipelineMap.get(t.__pipeline.id),n=i.context,r=!e&&i.progressiveEnabled&&(!n||n.progressiveRender)&&t.__idxInPipeline>i.blockIndex?i.step:null,o=n&&n.modDataCount;return{step:r,modBy:null!=o?Math.ceil(o/r):null,modDataCount:o}}},t.prototype.getPipeline=function(t){return this._pipelineMap.get(t)},t.prototype.updateStreamModes=function(t,e){var i=this._pipelineMap.get(t.uid),n=t.getData().count(),r=i.progressiveEnabled&&e.incrementalPrepareRender&&n>=i.threshold,o=t.get("large")&&n>=t.get("largeThreshold"),s="mod"===t.get("progressiveChunkMode")?n:null;t.pipelineContext=i.context={progressiveRender:r,modDataCount:s,large:o}},t.prototype.restorePipelines=function(t){var e=this,i=e._pipelineMap=Tf();t.eachSeries((function(t){var n=t.getProgressive(),r=t.uid;i.set(r,{id:r,head:null,tail:null,threshold:t.getProgressiveThreshold(),progressiveEnabled:n&&!(t.preventIncremental&&t.preventIncremental()),blockIndex:-1,step:Math.round(n||700),count:0}),e._pipe(t,t.dataTask)}))},t.prototype.prepareStageTasks=function(){var t=this._stageTaskMap,e=this.api.getModel(),i=this.api;Zp(this._allHandlers,(function(n){var r=t.get(n.uid)||t.set(n.uid,{});xf(!(n.reset&&n.overallReset),""),n.reset&&this._createSeriesStageTask(n,r,e,i),n.overallReset&&this._createOverallStageTask(n,r,e,i)}),this)},t.prototype.prepareView=function(t,e,i,n){var r=t.renderTask,o=r.context;o.model=e,o.ecModel=i,o.api=n,r.__block=!t.incrementalPrepareRender,this._pipe(e,r)},t.prototype.performDataProcessorTasks=function(t,e){this._performStageTasks(this._dataProcessorHandlers,t,e,{block:!0})},t.prototype.performVisualTasks=function(t,e,i){this._performStageTasks(this._visualHandlers,t,e,i)},t.prototype._performStageTasks=function(t,e,i,n){n=n||{};var r=!1,o=this;function s(t,e){return t.setDirty&&(!t.dirtyMap||t.dirtyMap.get(e.__pipeline.id))}Zp(t,(function(t,a){if(!n.visualType||n.visualType===t.visualType){var l=o._stageTaskMap.get(t.uid),h=l.seriesTaskMap,c=l.overallTask;if(c){var u,d=c.agentStubMap;d.each((function(t){s(n,t)&&(t.dirty(),u=!0)})),u&&c.dirty(),o.updatePayload(c,i);var p=o.getPerformArgs(c,n.block);d.each((function(t){t.perform(p)})),c.perform(p)&&(r=!0)}else h&&h.each((function(a,l){s(n,a)&&a.dirty();var h=o.getPerformArgs(a,n.block);h.skip=!t.performRawSeries&&e.isSeriesFiltered(a.context.model),o.updatePayload(a,i),a.perform(h)&&(r=!0)}))}})),this.unfinished=r||this.unfinished},t.prototype.performSeriesTasks=function(t){var e;t.eachSeries((function(t){e=t.dataTask.perform()||e})),this.unfinished=e||this.unfinished},t.prototype.plan=function(){this._pipelineMap.each((function(t){var e=t.tail;do{if(e.__block){t.blockIndex=e.__idxInPipeline;break}e=e.getUpstream()}while(e)}))},t.prototype.updatePayload=function(t,e){"remain"!==e&&(t.context.payload=e)},t.prototype._createSeriesStageTask=function(t,e,i,n){var r=this,o=e.seriesTaskMap,s=e.seriesTaskMap=Tf(),a=t.seriesType,l=t.getTargetSeries;function h(e){var a=e.uid,l=s.set(a,o&&o.get(a)||sC({plan:CO,reset:MO,count:IO}));l.context={model:e,ecModel:i,api:n,useClearVisual:t.isVisual&&!t.isLayout,plan:t.plan,reset:t.reset,scheduler:r},r._pipe(e,l)}t.createOnAllSeries?i.eachRawSeries(h):a?i.eachRawSeriesByType(a,h):l&&l(i,n).each(h)},t.prototype._createOverallStageTask=function(t,e,i,n){var r=this,o=e.overallTask=e.overallTask||sC({reset:_O});o.context={ecModel:i,api:n,overallReset:t.overallReset,scheduler:r};var s=o.agentStubMap,a=o.agentStubMap=Tf(),l=t.seriesType,h=t.getTargetSeries,c=!0,u=!1;function d(t){var e=t.uid,i=a.set(e,s&&s.get(e)||(u=!0,sC({reset:kO,onDirty:AO})));i.context={model:t,overallProgress:c},i.agent=o,i.__block=c,r._pipe(t,i)}xf(!t.createOnAllSeries,""),l?i.eachRawSeriesByType(l,d):h?h(i,n).each(d):(c=!1,Zp(i.getSeries(),d)),u&&o.dirty()},t.prototype._pipe=function(t,e){var i=t.uid,n=this._pipelineMap.get(i);!n.head&&(n.head=e),n.tail&&n.tail.pipe(e),n.tail=e,e.__idxInPipeline=n.count++,e.__pipeline=n},t.wrapStageHandler=function(t,e){return sf(t)&&(t={overallReset:t,seriesType:OO(t)}),t.uid=FS("stageHandler"),e&&(t.visualType=e),t},t}();function _O(t){t.overallReset(t.ecModel,t.api,t.payload)}function kO(t){return t.overallProgress&&SO}function SO(){this.agent.dirty(),this.getDownstream().dirty()}function AO(){this.agent&&this.agent.dirty()}function CO(t){return t.plan?t.plan(t.model,t.ecModel,t.api,t.payload):null}function MO(t){t.useClearVisual&&t.data.clearAllVisual();var e=t.resetDefines=Ab(t.reset(t.model,t.ecModel,t.api,t.payload));return e.length>1?Jp(e,(function(t,e){return TO(e)})):DO}var DO=TO(0);function TO(t){return function(e,i){var n=i.data,r=i.resetDefines[t];if(r&&r.dataEach)for(var o=e.start;o0&&c===r.length-h.length){var u=r.slice(0,c);"data"!==u&&(e.mainType=u,e[h.toLowerCase()]=t,a=!0)}}s.hasOwnProperty(r)&&(i[r]=t,a=!0),a||(n[r]=t)}))}return{cptQuery:e,dataQuery:i,otherQuery:n}},t.prototype.filter=function(t,e){var i=this.eventInfo;if(!i)return!0;var n=i.targetEl,r=i.packedEvent,o=i.model,s=i.view;if(!o||!s)return!0;var a=e.cptQuery,l=e.dataQuery;return h(a,o,"mainType")&&h(a,o,"subType")&&h(a,o,"index","componentIndex")&&h(a,o,"name")&&h(a,o,"id")&&h(l,r,"name")&&h(l,r,"dataIndex")&&h(l,r,"dataType")&&(!s.filterForExposedEvent||s.filterForExposedEvent(t,e.otherQuery,n,r));function h(t,e,i,n){return null==t[i]||e[n||i]===t[i]}},t.prototype.afterTrigger=function(){this.eventInfo=null},t}(),UO=["symbol","symbolSize","symbolRotate","symbolOffset"],jO=UO.concat(["symbolKeepAspect"]),GO={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var i=t.getData();if(t.legendIcon&&i.setVisual("legendIcon",t.legendIcon),t.hasSymbolVisual){for(var n={},r={},o=!1,s=0;s=0&&JO(l)?l:.5,t.createRadialGradient(s,a,0,s,a,l)}(t,e,i):function(t,e,i){var n=null==e.x?0:e.x,r=null==e.x2?1:e.x2,o=null==e.y?0:e.y,s=null==e.y2?0:e.y2;return e.global||(n=n*i.width+i.x,r=r*i.width+i.x,o=o*i.height+i.y,s=s*i.height+i.y),n=JO(n)?n:0,r=JO(r)?r:1,o=JO(o)?o:0,s=JO(s)?s:0,t.createLinearGradient(n,o,r,s)}(t,e,i),r=e.colorStops,o=0;o0&&(e=n.lineDash,i=n.lineWidth,e&&"solid"!==e&&i>0?"dashed"===e?[4*i,2*i]:"dotted"===e?[i]:hf(e)?[e]:of(e)?e:null:null),o=n.lineDashOffset;if(r){var s=n.strokeNoScale&&t.getLineScale?t.getLineScale():1;s&&1!==s&&(r=Jp(r,(function(t){return t/s})),o/=s)}return[r,o]}var nE=new py(!0);function rE(t){var e=t.stroke;return!(null==e||"none"===e||!(t.lineWidth>0))}function oE(t){return"string"==typeof t&&"none"!==t}function sE(t){var e=t.fill;return null!=e&&"none"!==e}function aE(t,e){if(null!=e.fillOpacity&&1!==e.fillOpacity){var i=t.globalAlpha;t.globalAlpha=e.fillOpacity*e.opacity,t.fill(),t.globalAlpha=i}else t.fill()}function lE(t,e){if(null!=e.strokeOpacity&&1!==e.strokeOpacity){var i=t.globalAlpha;t.globalAlpha=e.strokeOpacity*e.opacity,t.stroke(),t.globalAlpha=i}else t.stroke()}function hE(t,e,i){var n=tg(e.image,e.__image,i);if(ig(n)){var r=t.createPattern(n,e.repeat||"repeat");if("function"==typeof DOMMatrix&&r&&r.setTransform){var o=new DOMMatrix;o.translateSelf(e.x||0,e.y||0),o.rotateSelf(0,0,(e.rotation||0)*Lf),o.scaleSelf(e.scaleX||1,e.scaleY||1),r.setTransform(o)}return r}}var cE=["shadowBlur","shadowOffsetX","shadowOffsetY"],uE=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function dE(t,e,i,n,r){var o=!1;if(!n&&e===(i=i||{}))return!1;if(n||e.opacity!==i.opacity){gE(t,r),o=!0;var s=Math.max(Math.min(e.opacity,1),0);t.globalAlpha=isNaN(s)?Dv.opacity:s}(n||e.blend!==i.blend)&&(o||(gE(t,r),o=!0),t.globalCompositeOperation=e.blend||Dv.blend);for(var a=0;a0&&t.unfinished);t.unfinished||this._zr.flush()}}},e.prototype.getDom=function(){return this._dom},e.prototype.getId=function(){return this.id},e.prototype.getZr=function(){return this._zr},e.prototype.isSSR=function(){return this._ssr},e.prototype.setOption=function(t,e,i){if(!this[OE])if(this._disposed)this.id;else{var n,r,o;if(cf(e)&&(i=e.lazyUpdate,n=e.silent,r=e.replaceMerge,o=e.transition,e=e.notMerge),this[OE]=!0,!this._model||e){var s=new VI(this._api),a=this._theme,l=this._model=new LI;l.scheduler=this._scheduler,l.ssr=this._ssr,l.init(null,null,null,a,this._locale,s)}this._model.setOption(t,{replaceMerge:r},uP);var h={seriesTransition:o,optionChanged:!0};if(i)this[EE]={silent:n,updateParams:h},this[OE]=!1,this.getZr().wakeUp();else{try{$E(this),HE.update.call(this,null,h)}catch(t){throw this[EE]=null,this[OE]=!1,t}this._ssr||this._zr.flush(),this[EE]=null,this[OE]=!1,GE.call(this,n),qE.call(this,n)}}},e.prototype.setTheme=function(){},e.prototype.getModel=function(){return this._model},e.prototype.getOption=function(){return this._model&&this._model.getOption()},e.prototype.getWidth=function(){return this._zr.getWidth()},e.prototype.getHeight=function(){return this._zr.getHeight()},e.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||Nf.hasGlobalWindow&&window.devicePixelRatio||1},e.prototype.getRenderedCanvas=function(t){return this.renderToCanvas(t)},e.prototype.renderToCanvas=function(t){return t=t||{},this._zr.painter.getRenderedCanvas({backgroundColor:t.backgroundColor||this._model.get("backgroundColor"),pixelRatio:t.pixelRatio||this.getDevicePixelRatio()})},e.prototype.renderToSVGString=function(t){return t=t||{},this._zr.painter.renderToString({useViewBox:t.useViewBox})},e.prototype.getSvgDataURL=function(){if(Nf.svgSupported){var t=this._zr;return Zp(t.storage.getDisplayList(),(function(t){t.stopAnimation(null,!0)})),t.painter.toDataURL()}},e.prototype.getDataURL=function(t){if(!this._disposed){var e=(t=t||{}).excludeComponents,i=this._model,n=[],r=this;Zp(e,(function(t){i.eachComponent({mainType:t},(function(t){var e=r._componentsMap[t.__viewId];e.group.ignore||(n.push(e),e.group.ignore=!0)}))}));var o="svg"===this._zr.painter.getType()?this.getSvgDataURL():this.renderToCanvas(t).toDataURL("image/"+(t&&t.type||"png"));return Zp(n,(function(t){t.group.ignore=!1})),o}this.id},e.prototype.getConnectedDataURL=function(t){if(!this._disposed){var e="svg"===t.type,i=this.group,n=Math.min,r=Math.max,o=1/0;if(mP[i]){var s=o,a=o,l=-1/0,h=-1/0,c=[],u=t&&t.pixelRatio||this.getDevicePixelRatio();Zp(gP,(function(o,u){if(o.group===i){var d=e?o.getZr().painter.getSvgDom().innerHTML:o.renderToCanvas(Up(t)),p=o.getDom().getBoundingClientRect();s=n(p.left,s),a=n(p.top,a),l=r(p.right,l),h=r(p.bottom,h),c.push({dom:d,left:p.left,top:p.top})}}));var d=(l*=u)-(s*=u),p=(h*=u)-(a*=u),f=Tp.createCanvas(),g=AI(f,{renderer:e?"svg":"canvas"});if(g.resize({width:d,height:p}),e){var m="";return Zp(c,(function(t){var e=t.left-s,i=t.top-a;m+=''+t.dom+""})),g.painter.getSvgRoot().innerHTML=m,t.connectedBackgroundColor&&g.painter.setBackgroundColor(t.connectedBackgroundColor),g.refreshImmediately(),g.painter.toDataURL()}return t.connectedBackgroundColor&&g.add(new jy({shape:{x:0,y:0,width:d,height:p},style:{fill:t.connectedBackgroundColor}})),Zp(c,(function(t){var e=new zy({style:{x:t.left*u-s,y:t.top*u-a,image:t.dom}});g.add(e)})),g.refreshImmediately(),f.toDataURL("image/"+(t&&t.type||"png"))}return this.getDataURL(t)}this.id},e.prototype.convertToPixel=function(t,e){return WE(this,"convertToPixel",t,e)},e.prototype.convertFromPixel=function(t,e){return WE(this,"convertFromPixel",t,e)},e.prototype.containPixel=function(t,e){var i;if(!this._disposed)return Zp($b(this._model,t),(function(t,n){n.indexOf("Models")>=0&&Zp(t,(function(t){var r=t.coordinateSystem;if(r&&r.containPoint)i=i||!!r.containPoint(e);else if("seriesModels"===n){var o=this._chartsMap[t.__viewId];o&&o.containPoint&&(i=i||o.containPoint(e,t))}}),this)}),this),!!i;this.id},e.prototype.getVisual=function(t,e){var i=$b(this._model,t,{defaultMainType:"series"}),n=i.seriesModel.getData(),r=i.hasOwnProperty("dataIndexInside")?i.dataIndexInside:i.hasOwnProperty("dataIndex")?n.indexOfRawIndex(i.dataIndex):null;return null!=r?function(t,e,i){switch(i){case"color":return t.getItemVisual(e,"style")[t.getVisual("drawType")];case"opacity":return t.getItemVisual(e,"style").opacity;case"symbol":case"symbolSize":case"liftZ":return t.getItemVisual(e,i)}}(n,r,e):function(t,e){switch(e){case"color":return t.getVisual("style")[t.getVisual("drawType")];case"opacity":return t.getVisual("style").opacity;case"symbol":case"symbolSize":case"liftZ":return t.getVisual(e)}}(n,e)},e.prototype.getViewOfComponentModel=function(t){return this._componentsMap[t.__viewId]},e.prototype.getViewOfSeriesModel=function(t){return this._chartsMap[t.__viewId]},e.prototype._initEvents=function(){var t,e,i,n=this;Zp(aP,(function(t){var e=function(e){var i,r=n.getModel(),o=e.target;if("globalout"===t?i={}:o&&YO(o,(function(t){var e=Ub(t);if(e&&null!=e.dataIndex){var n=e.dataModel||r.getSeriesByIndex(e.seriesIndex);return i=n&&n.getDataParams(e.dataIndex,e.dataType,o)||{},!0}if(e.eventData)return i=Gp({},e.eventData),!0}),!0),i){var s=i.componentType,a=i.componentIndex;"markLine"!==s&&"markPoint"!==s&&"markArea"!==s||(s="series",a=i.seriesIndex);var l=s&&null!=a&&r.getComponent(s,a),h=l&&n["series"===l.mainType?"_chartsMap":"_componentsMap"][l.__viewId];i.event=e,i.type=t,n._$eventProcessor.eventInfo={targetEl:o,packedEvent:i,model:l,view:h},n.trigger(t,i)}};e.zrEventfulCallAtLast=!0,n._zr.on(t,e,n)})),Zp(hP,(function(t,e){n._messageCenter.on(e,(function(t){this.trigger(e,t)}),n)})),Zp(["selectchanged"],(function(t){n._messageCenter.on(t,(function(e){this.trigger(t,e)}),n)})),t=this._messageCenter,e=this,i=this._api,t.on("selectchanged",(function(t){var n=i.getModel();t.isFromClick?($D("map","selectchanged",e,n,t),$D("pie","selectchanged",e,n,t)):"select"===t.fromAction?($D("map","selected",e,n,t),$D("pie","selected",e,n,t)):"unselect"===t.fromAction&&($D("map","unselected",e,n,t),$D("pie","unselected",e,n,t))}))},e.prototype.isDisposed=function(){return this._disposed},e.prototype.clear=function(){this._disposed?this.id:this.setOption({series:[]},!0)},e.prototype.dispose=function(){if(this._disposed)this.id;else{this._disposed=!0,this.getDom()&&Wb(this.getDom(),yP,"");var t=this,e=t._api,i=t._model;Zp(t._componentsViews,(function(t){t.dispose(i,e)})),Zp(t._chartsViews,(function(t){t.dispose(i,e)})),t._zr.dispose(),t._dom=t._model=t._chartsMap=t._componentsMap=t._chartsViews=t._componentsViews=t._scheduler=t._api=t._zr=t._throttledZrFlush=t._theme=t._coordSysMgr=t._messageCenter=null,delete gP[t.id]}},e.prototype.resize=function(t){if(!this[OE])if(this._disposed)this.id;else{this._zr.resize(t);var e=this._model;if(this._loadingFX&&this._loadingFX.resize(),e){var i=e.resetOption("media"),n=t&&t.silent;this[EE]&&(null==n&&(n=this[EE].silent),i=!0,this[EE]=null),this[OE]=!0;try{i&&$E(this),HE.update.call(this,{type:"resize",animation:Gp({duration:0},t&&t.animation)})}catch(t){throw this[OE]=!1,t}this[OE]=!1,GE.call(this,n),qE.call(this,n)}}},e.prototype.showLoading=function(t,e){if(this._disposed)this.id;else if(cf(t)&&(e=t,t=""),t=t||"default",this.hideLoading(),fP[t]){var i=fP[t](this._api,e),n=this._zr;this._loadingFX=i,n.add(i)}},e.prototype.hideLoading=function(){this._disposed?this.id:(this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null)},e.prototype.makeActionFromEvent=function(t){var e=Gp({},t);return e.type=hP[t.type],e},e.prototype.dispatchAction=function(t,e){if(this._disposed)this.id;else if(cf(e)||(e={silent:!!e}),lP[t.type]&&this._model)if(this[OE])this._pendingActions.push(t);else{var i=e.silent;jE.call(this,t,i);var n=e.flush;n?this._zr.flush():!1!==n&&Nf.browser.weChat&&this._throttledZrFlush(),GE.call(this,i),qE.call(this,i)}},e.prototype.updateLabelLayout=function(){CE.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},e.prototype.appendData=function(t){if(this._disposed)this.id;else{var e=t.seriesIndex;this.getModel().getSeriesByIndex(e).appendData(t),this._scheduler.unfinished=!0,this.getZr().wakeUp()}},e.internalField=function(){function t(t){t.clearColorPalette(),t.eachSeries((function(t){t.clearColorPalette()}))}function e(t){for(var e=[],i=t.currentStates,n=0;n0?{duration:o,delay:n.get("delay"),easing:n.get("easing")}:null;i.eachRendered((function(t){if(t.states&&t.states.emphasis){if(Qx(t))return;if(t instanceof Py&&function(t){var e=qb(t);e.normalFill=t.style.fill,e.normalStroke=t.style.stroke;var i=t.states.select||{};e.selectFill=i.style&&i.style.fill||null,e.selectStroke=i.style&&i.style.stroke||null}(t),t.__dirty){var i=t.prevStates;i&&t.useStates(i)}if(r){t.stateTransition=s;var n=t.getTextContent(),o=t.getTextGuideLine();n&&(n.stateTransition=s),o&&(o.stateTransition=s)}t.__dirty&&e(t)}}))}$E=function(t){var e=t._scheduler;e.restorePipelines(t._model),e.prepareStageTasks(),FE(t,!0),FE(t,!1),e.plan()},FE=function(t,e){for(var i=t._model,n=t._scheduler,r=e?t._componentsViews:t._chartsViews,o=e?t._componentsMap:t._chartsMap,s=t._zr,a=t._api,l=0;le.get("hoverLayerThreshold")&&!Nf.node&&!Nf.worker&&e.eachSeries((function(e){if(!e.preventUsingHoverLayer){var i=t._chartsMap[e.__viewId];i.__alive&&i.eachRendered((function(t){t.states.emphasis&&(t.states.emphasis.hoverLayer=!0)}))}}))}(t,e),CE.trigger("series:afterupdate",e,n,a)},eP=function(t){t[PE]=!0,t.getZr().wakeUp()},iP=function(t){t[PE]&&(t.getZr().storage.traverse((function(t){Qx(t)||e(t)})),t[PE]=!1)},QE=function(t){return new(function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Sp(i,e),i.prototype.getCoordinateSystems=function(){return t._coordSysMgr.getCoordinateSystems()},i.prototype.getComponentByElement=function(e){for(;e;){var i=e.__ecComponentInfo;if(null!=i)return t._model.getComponent(i.mainType,i.index);e=e.parent}},i.prototype.enterEmphasis=function(e,i){vw(e,i),eP(t)},i.prototype.leaveEmphasis=function(e,i){yw(e,i),eP(t)},i.prototype.enterBlur=function(e){!function(t){uw(t,sw)}(e),eP(t)},i.prototype.leaveBlur=function(e){bw(e),eP(t)},i.prototype.enterSelect=function(e){ww(e),eP(t)},i.prototype.leaveSelect=function(e){xw(e),eP(t)},i.prototype.getModel=function(){return t.getModel()},i.prototype.getViewOfComponentModel=function(e){return t.getViewOfComponentModel(e)},i.prototype.getViewOfSeriesModel=function(e){return t.getViewOfSeriesModel(e)},i}($I))(t)},tP=function(t){function e(t,e){for(var i=0;i=0)){CP.push(i);var o=xO.wrapStageHandler(i,r);o.__prio=e,o.__raw=i,t.push(o)}}function DP(t,e){fP[t]=e}var TP=function(t){var e=(t=Up(t)).type;e||_b("");var i=e.split(":");2!==i.length&&_b("");var n=!1;"echarts"===i[0]&&(e=i[1],n=!0),t.__isBuiltIn=n,fC.set(e,t)};AP(DE,mO),AP(TE,yO),AP(TE,bO),AP(DE,GO),AP(TE,qO),AP(7e3,(function(t,e){t.eachRawSeries((function(i){if(!t.isSeriesFiltered(i)){var n=i.getData();n.hasItemVisual()&&n.each((function(t){var i=n.getItemVisual(t,"decal");i&&(n.ensureUniqueItemVisual(t,"style").decal=_E(i,e))}));var r=n.getVisual("decal");if(r)n.getVisual("style").decal=_E(r,e)}}))})),xP(lO),_P(900,(function(t){var e=Tf();t.eachSeries((function(t){var i=t.get("stack");if(i){var n=e.get(i)||e.set(i,[]),r=t.getData(),o={stackResultDimension:r.getCalculationInfo("stackResultDimension"),stackedOverDimension:r.getCalculationInfo("stackedOverDimension"),stackedDimension:r.getCalculationInfo("stackedDimension"),stackedByDimension:r.getCalculationInfo("stackedByDimension"),isStackedByIndex:r.getCalculationInfo("isStackedByIndex"),data:r,seriesModel:t};if(!o.stackedDimension||!o.isStackedByIndex&&!o.stackedByDimension)return;n.length&&r.setCalculationInfo("stackedOnSeries",n[n.length-1].seriesModel),n.push(o)}})),e.each(hO)})),DP("default",(function(t,e){qp(e=e||{},{text:"loading",textColor:"#000",fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255, 255, 255, 0.8)",showSpinner:!0,color:"#5470c6",spinnerRadius:10,lineWidth:5,zlevel:0});var i=new ex,n=new jy({style:{fill:e.maskColor},zlevel:e.zlevel,z:1e4});i.add(n);var r,o=new Yy({style:{text:e.text,fill:e.textColor,fontSize:e.fontSize,fontWeight:e.fontWeight,fontStyle:e.fontStyle,fontFamily:e.fontFamily},zlevel:e.zlevel,z:10001}),s=new jy({style:{fill:"none"},textContent:o,textConfig:{position:"right",distance:10},zlevel:e.zlevel,z:10001});return i.add(s),e.showSpinner&&((r=new Bx({shape:{startAngle:-wO/2,endAngle:-wO/2+.1,r:e.spinnerRadius},style:{stroke:e.color,lineCap:"round",lineWidth:e.lineWidth},zlevel:e.zlevel,z:10001})).animateShape(!0).when(1e3,{endAngle:3*wO/2}).start("circularInOut"),r.animateShape(!0).when(1e3,{startAngle:3*wO/2}).delay(300).start("circularInOut"),i.add(r)),i.resize=function(){var i=o.getBoundingRect().width,a=e.showSpinner?e.spinnerRadius:0,l=(t.getWidth()-2*a-(e.showSpinner&&i?10:0)-i)/2-(e.showSpinner&&i?0:5+i/2)+(e.showSpinner?0:i/2)+(i?0:a),h=t.getHeight()/2;e.showSpinner&&r.setShape({cx:l,cy:h}),s.setShape({x:l-a,y:h-a,width:2*a,height:2*a}),n.setShape({x:0,y:0,width:t.getWidth(),height:t.getHeight()})},i.resize(),i})),SP({type:Zb,event:Zb,update:Zb},Pf),SP({type:Jb,event:Jb,update:Jb},Pf),SP({type:Qb,event:Qb,update:Qb},Pf),SP({type:tw,event:tw,update:tw},Pf),SP({type:ew,event:ew,update:ew},Pf),wP("light",BO),wP("dark",HO);var IP=[],OP={registerPreprocessor:xP,registerProcessor:_P,registerPostInit:function(t){kP("afterinit",t)},registerPostUpdate:function(t){kP("afterupdate",t)},registerUpdateLifecycle:kP,registerAction:SP,registerCoordinateSystem:function(t,e){ES.register(t,e)},registerLayout:function(t,e){MP(dP,t,e,1e3,"layout")},registerVisual:AP,registerTransform:TP,registerLoading:DP,registerMap:function(t,e,i){var n=function(t){return ME[t]}("registerMap");n&&n(t,e,i)},registerImpl:function(t,e){ME[t]=e},PRIORITY:IE,ComponentModel:tC,ComponentView:cO,SeriesModel:FC,ChartView:IM,registerComponentModel:function(t){tC.registerClass(t)},registerComponentView:function(t){cO.registerClass(t)},registerSeriesModel:function(t){FC.registerClass(t)},registerChartView:function(t){IM.registerClass(t)},registerSubTypeDefaulter:function(t,e){tC.registerSubTypeDefaulter(t,e)},registerPainter:function(t,e){!function(t,e){_I[t]=e}(t,e)}};function EP(t){of(t)?Zp(t,(function(t){EP(t)})):Yp(IP,t)>=0||(IP.push(t),sf(t)&&(t={install:t}),t.install(OP))}var PP=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i.hasSymbolVisual=!0,i}return Sp(e,t),e.prototype.getInitialData=function(t,e){return zS(0,this,{useEncodeDefaulter:!0})},e.prototype.getProgressive=function(){var t=this.option.progressive;return null==t?this.option.large?5e3:this.get("progressive"):t},e.prototype.getProgressiveThreshold=function(){var t=this.option.progressiveThreshold;return null==t?this.option.large?1e4:this.get("progressiveThreshold"):t},e.prototype.brushSelector=function(t,e,i){return i.point(e.getItemLayout(t))},e.prototype.getZLevelKey=function(){return this.getData().count()>this.getProgressiveThreshold()?this.id:""},e.type="series.scatter",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},emphasis:{scale:!0},clip:!0,select:{itemStyle:{borderColor:"#212121"}},universalTransition:{divideShape:"clone"}},e}(FC),LP=function(){},RP=function(t){function e(e){var i=t.call(this,e)||this;return i._off=0,i.hoverDataIdx=-1,i}return Sp(e,t),e.prototype.getDefaultShape=function(){return new LP},e.prototype.reset=function(){this.notClear=!1,this._off=0},e.prototype.buildPath=function(t,e){var i,n=e.points,r=e.size,o=this.symbolProxy,s=o.shape,a=t.getContext?t.getContext():t,l=a&&r[0]<4,h=this.softClipShape;if(l)this._ctx=a;else{for(this._ctx=null,i=this._off;i=0;a--){var l=2*a,h=n[l]-o/2,c=n[l+1]-s/2;if(t>=h&&e>=c&&t<=h+o&&e<=c+s)return a}return-1},e.prototype.contain=function(t,e){var i=this.transformCoordToLocal(t,e),n=this.getBoundingRect();return t=i[0],e=i[1],n.contain(t,e)?(this.hoverDataIdx=this.findDataIndex(t,e))>=0:(this.hoverDataIdx=-1,!1)},e.prototype.getBoundingRect=function(){var t=this._rect;if(!t){for(var e=this.shape,i=e.points,n=e.size,r=n[0],o=n[1],s=1/0,a=1/0,l=-1/0,h=-1/0,c=0;c=0&&(l.dataIndex=i+(t.startIndex||0))}))},t.prototype.remove=function(){this._clear()},t.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},t}(),BP=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return Sp(e,t),e.prototype.render=function(t,e,i){var n=t.getData();this._updateSymbolDraw(n,t).updateData(n,{clipShape:this._getClipShape(t)}),this._finished=!0},e.prototype.incrementalPrepareRender=function(t,e,i){var n=t.getData();this._updateSymbolDraw(n,t).incrementalPrepareUpdate(n),this._finished=!1},e.prototype.incrementalRender=function(t,e,i){this._symbolDraw.incrementalUpdate(t,e.getData(),{clipShape:this._getClipShape(e)}),this._finished=t.end===e.getData().count()},e.prototype.updateTransform=function(t,e,i){var n=t.getData();if(this.group.dirty(),!this._finished||n.count()>1e4)return{update:!0};var r=ZM("").reset(t,e,i);r.progress&&r.progress({start:0,end:n.count(),count:n.count()},n),this._symbolDraw.updateLayout(n)},e.prototype.eachRendered=function(t){this._symbolDraw&&this._symbolDraw.eachRendered(t)},e.prototype._getClipShape=function(t){if(t.get("clip",!0)){var e=t.coordinateSystem;return e&&e.getArea&&e.getArea(.1)}},e.prototype._updateSymbolDraw=function(t,e){var i=this._symbolDraw,n=e.pipelineContext.large;return i&&n===this._isLargeDraw||(i&&i.remove(),i=this._symbolDraw=n?new NP:new pM,this._isLargeDraw=n,this.group.removeAll()),this.group.add(i.group),i},e.prototype.remove=function(t,e){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},e.prototype.dispose=function(){},e.type="scatter",e}(IM),zP=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Sp(e,t),e.type="grid",e.dependencies=["xAxis","yAxis"],e.layoutMode="box",e.defaultOption={show:!1,z:0,left:"10%",top:60,right:"10%",bottom:70,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},e}(tC),$P=function(){function t(){}return t.prototype.getNeedCrossZero=function(){return!this.option.scale},t.prototype.getCoordSysModel=function(){},t}(),FP=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Sp(e,t),e.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",Vb).models[0]},e.type="cartesian2dAxis",e}(tC);Xp(FP,$P);var VP={show:!0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,onZeroAxisIndex:null,lineStyle:{color:"#6E7079",width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15]},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12},splitLine:{show:!0,lineStyle:{color:["#E0E6F1"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},HP=jp({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},VP),WP=jp({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:"#F4F7FD",width:1}}},VP),UP={category:HP,value:WP,time:jp({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},WP),log:qp({logBase:10},WP)},jP=0,GP=function(){function t(t){this.categories=t.categories||[],this._needCollect=t.needCollect,this._deduplication=t.deduplication,this.uid=++jP}return t.createByAxisModel=function(e){var i=e.option,n=i.data,r=n&&Jp(n,qP);return new t({categories:r,needCollect:!r,deduplication:!1!==i.dedplication})},t.prototype.getOrdinal=function(t){return this._getOrCreateMap().get(t)},t.prototype.parseAndCollect=function(t){var e,i=this._needCollect;if(!af(t)&&!i)return t;if(i&&!this._deduplication)return e=this.categories.length,this.categories[e]=t,e;var n=this._getOrCreateMap();return null==(e=n.get(t))&&(i?(e=this.categories.length,this.categories[e]=t,n.set(t,e)):e=NaN),e},t.prototype._getOrCreateMap=function(){return this._map||(this._map=Tf(this.categories))},t}();function qP(t){return cf(t)&&null!=t.value?t.value:t+""}var YP={value:1,category:1,time:1,log:1};function XP(t,e,i,n){Zp(YP,(function(r,o){var s=jp(jp({},UP[o],!0),n,!0),a=function(t){function i(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e+"Axis."+o,i}return Sp(i,t),i.prototype.mergeDefaultAndTheme=function(t,e){var i=KA(this),n=i?JA(t):{};jp(t,e.getTheme().get(o+"Axis")),jp(t,this.getDefaultOption()),t.type=KP(t),i&&ZA(t,n,i)},i.prototype.optionUpdated=function(){"category"===this.option.type&&(this.__ordinalMeta=GP.createByAxisModel(this))},i.prototype.getCategories=function(t){var e=this.option;if("category"===e.type)return t?e.data:this.__ordinalMeta.categories},i.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},i.type=e+"Axis."+o,i.defaultOption=s,i}(i);t.registerComponentModel(a)})),t.registerSubTypeDefaulter(e+"Axis",KP)}function KP(t){return t.type||(t.data?"category":"value")}var ZP=function(){function t(t){this._setting=t||{},this._extent=[1/0,-1/0]}return t.prototype.getSetting=function(t){return this._setting[t]},t.prototype.unionExtent=function(t){var e=this._extent;t[0]e[1]&&(e[1]=t[1])},t.prototype.unionExtentFromData=function(t,e){this.unionExtent(t.getApproximateExtent(e))},t.prototype.getExtent=function(){return this._extent.slice()},t.prototype.setExtent=function(t,e){var i=this._extent;isNaN(t)||(i[0]=t),isNaN(e)||(i[1]=e)},t.prototype.isInExtentRange=function(t){return this._extent[0]<=t&&this._extent[1]>=t},t.prototype.isBlank=function(){return this._isBlank},t.prototype.setBlank=function(t){this._isBlank=t},t}();function JP(t){return"interval"===t.type||"log"===t.type}function QP(t,e,i,n){var r={},o=t[1]-t[0],s=r.interval=vb(o/e);null!=i&&sn&&(s=r.interval=n);var a=r.intervalPrecision=eL(s);return function(t,e){!isFinite(t[0])&&(t[0]=e[0]),!isFinite(t[1])&&(t[1]=e[1]),iL(t,0,e),iL(t,1,e),t[0]>t[1]&&(t[0]=t[1])}(r.niceTickExtent=[hb(Math.ceil(t[0]/s)*s,a),hb(Math.floor(t[1]/s)*s,a)],t),r}function tL(t){var e=Math.pow(10,mb(t)),i=t/e;return i?2===i?i=3:3===i?i=5:i*=2:i=1,hb(i*e)}function eL(t){return cb(t)+2}function iL(t,e,i){t[e]=Math.max(Math.min(t[e],i[1]),i[0])}function nL(t,e){return t>=e[0]&&t<=e[1]}function rL(t,e){return e[1]===e[0]?.5:(t-e[0])/(e[1]-e[0])}function oL(t,e){return t*(e[1]-e[0])+e[0]}jf(ZP);var sL=function(t){function e(e){var i=t.call(this,e)||this;i.type="ordinal";var n=i.getSetting("ordinalMeta");return n||(n=new GP({})),of(n)&&(n=new GP({categories:Jp(n,(function(t){return cf(t)?t.value:t}))})),i._ordinalMeta=n,i._extent=i.getSetting("extent")||[0,n.categories.length-1],i}return Sp(e,t),e.prototype.parse=function(t){return null==t?NaN:af(t)?this._ordinalMeta.getOrdinal(t):Math.round(t)},e.prototype.contain=function(t){return nL(t=this.parse(t),this._extent)&&null!=this._ordinalMeta.categories[t]},e.prototype.normalize=function(t){return rL(t=this._getTickNumber(this.parse(t)),this._extent)},e.prototype.scale=function(t){return t=Math.round(oL(t,this._extent)),this.getRawOrdinalNumber(t)},e.prototype.getTicks=function(){for(var t=[],e=this._extent,i=e[0];i<=e[1];)t.push({value:i}),i++;return t},e.prototype.getMinorTicks=function(t){},e.prototype.setSortInfo=function(t){if(null!=t){for(var e=t.ordinalNumbers,i=this._ordinalNumbersByTick=[],n=this._ticksByOrdinalNumber=[],r=0,o=this._ordinalMeta.categories.length,s=Math.min(o,e.length);r=0&&t=0&&t=t},e.prototype.getOrdinalMeta=function(){return this._ordinalMeta},e.prototype.calcNiceTicks=function(){},e.prototype.calcNiceExtent=function(){},e.type="ordinal",e}(ZP);ZP.registerClass(sL);var aL=hb,lL=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="interval",e._interval=0,e._intervalPrecision=2,e}return Sp(e,t),e.prototype.parse=function(t){return t},e.prototype.contain=function(t){return nL(t,this._extent)},e.prototype.normalize=function(t){return rL(t,this._extent)},e.prototype.scale=function(t){return oL(t,this._extent)},e.prototype.setExtent=function(t,e){var i=this._extent;isNaN(t)||(i[0]=parseFloat(t)),isNaN(e)||(i[1]=parseFloat(e))},e.prototype.unionExtent=function(t){var e=this._extent;t[0]e[1]&&(e[1]=t[1]),this.setExtent(e[0],e[1])},e.prototype.getInterval=function(){return this._interval},e.prototype.setInterval=function(t){this._interval=t,this._niceExtent=this._extent.slice(),this._intervalPrecision=eL(t)},e.prototype.getTicks=function(t){var e=this._interval,i=this._extent,n=this._niceExtent,r=this._intervalPrecision,o=[];if(!e)return o;i[0]1e4)return[];var a=o.length?o[o.length-1].value:n[1];return i[1]>a&&(t?o.push({value:aL(a+e,r)}):o.push({value:i[1]})),o},e.prototype.getMinorTicks=function(t){for(var e=this.getTicks(!0),i=[],n=this.getExtent(),r=1;rn[0]&&c0)for(var a=0;a=0;--a)if(l[h]){o=l[h];break}o=o||s.none}if(of(o)){var c=null==t.level?0:t.level>=0?t.level:o.length+t.level;o=o[c=Math.min(c,o.length-1)]}}return yA(new Date(t.value),o,r,n)}(t,e,i,this.getSetting("locale"),n)},e.prototype.getTicks=function(){var t=this._interval,e=this._extent,i=[];if(!t)return i;i.push({value:e[0],level:0});var n=this.getSetting("useUTC"),r=function(t,e,i,n){var r=1e4,o=fA,s=0;function a(t,e,i,r,o,s,a){for(var l=new Date(e),h=e,c=l[r]();h1&&0===h&&o.unshift({value:o[0].value-d})}}for(h=0;h=n[0]&&v<=n[1]&&u++)}var y=(n[1]-n[0])/e;if(u>1.5*y&&d>y/1.5)break;if(h.push(g),u>y||t===o[p])break}c=[]}}var b=tf(Jp(h,(function(t){return tf(t,(function(t){return t.value>=n[0]&&t.value<=n[1]&&!t.notAdd}))})),(function(t){return t.length>0})),w=[],x=b.length-1;for(p=0;pi&&(this._approxInterval=i);var o=cL.length,s=Math.min(function(t,e,i,n){for(;i>>1;t[r][1]16?16:t>7.5?7:t>3.5?4:t>1.5?2:1}function dL(t){return(t/=2592e6)>6?6:t>3?3:t>2?2:1}function pL(t){return(t/=aA)>12?12:t>6?6:t>3.5?4:t>2?2:1}function fL(t,e){return(t/=e?sA:oA)>30?30:t>20?20:t>15?15:t>10?10:t>5?5:t>2?2:1}function gL(t){return vb(t)}function mL(t,e,i){var n=new Date(t);switch(mA(e)){case"year":case"month":n[TA(i)](0);case"day":n[IA(i)](1);case"hour":n[OA(i)](0);case"minute":n[EA(i)](0);case"second":n[PA(i)](0),n[LA(i)](0)}return n.getTime()}ZP.registerClass(hL);var vL=ZP.prototype,yL=lL.prototype,bL=hb,wL=Math.floor,xL=Math.ceil,_L=Math.pow,kL=Math.log,SL=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="log",e.base=10,e._originalScale=new lL,e._interval=0,e}return Sp(e,t),e.prototype.getTicks=function(t){var e=this._originalScale,i=this._extent,n=e.getExtent();return Jp(yL.getTicks.call(this,t),(function(t){var e=t.value,r=hb(_L(this.base,e));return r=e===i[0]&&this._fixMin?CL(r,n[0]):r,{value:r=e===i[1]&&this._fixMax?CL(r,n[1]):r}}),this)},e.prototype.setExtent=function(t,e){var i=kL(this.base);t=kL(Math.max(0,t))/i,e=kL(Math.max(0,e))/i,yL.setExtent.call(this,t,e)},e.prototype.getExtent=function(){var t=this.base,e=vL.getExtent.call(this);e[0]=_L(t,e[0]),e[1]=_L(t,e[1]);var i=this._originalScale.getExtent();return this._fixMin&&(e[0]=CL(e[0],i[0])),this._fixMax&&(e[1]=CL(e[1],i[1])),e},e.prototype.unionExtent=function(t){this._originalScale.unionExtent(t);var e=this.base;t[0]=kL(t[0])/kL(e),t[1]=kL(t[1])/kL(e),vL.unionExtent.call(this,t)},e.prototype.unionExtentFromData=function(t,e){this.unionExtent(t.getApproximateExtent(e))},e.prototype.calcNiceTicks=function(t){t=t||10;var e=this._extent,i=e[1]-e[0];if(!(i===1/0||i<=0)){var n,r=(n=i,Math.pow(10,mb(n)));for(t/i*r<=.5&&(r*=10);!isNaN(r)&&Math.abs(r)<1&&Math.abs(r)>0;)r*=10;var o=[hb(xL(e[0]/r)*r),hb(wL(e[1]/r)*r)];this._interval=r,this._niceExtent=o}},e.prototype.calcNiceExtent=function(t){yL.calcNiceExtent.call(this,t),this._fixMin=t.fixMin,this._fixMax=t.fixMax},e.prototype.parse=function(t){return t},e.prototype.contain=function(t){return nL(t=kL(t)/kL(this.base),this._extent)},e.prototype.normalize=function(t){return rL(t=kL(t)/kL(this.base),this._extent)},e.prototype.scale=function(t){return t=oL(t,this._extent),_L(this.base,t)},e.type="log",e}(ZP),AL=SL.prototype;function CL(t,e){return bL(t,cb(e))}AL.getMinorTicks=yL.getMinorTicks,AL.getLabel=yL.getLabel,ZP.registerClass(SL);var ML=function(){function t(t,e,i){this._prepareParams(t,e,i)}return t.prototype._prepareParams=function(t,e,i){i[1]0&&a>0&&!l&&(s=0),s<0&&a<0&&!h&&(a=0));var u=this._determinedMin,d=this._determinedMax;return null!=u&&(s=u,l=!0),null!=d&&(a=d,h=!0),{min:s,max:a,minFixed:l,maxFixed:h,isBlank:c}},t.prototype.modifyDataMinMax=function(t,e){this[TL[t]]=e},t.prototype.setDeterminedMinMax=function(t,e){this[DL[t]]=e},t.prototype.freeze=function(){this.frozen=!0},t}(),DL={min:"_determinedMin",max:"_determinedMax"},TL={min:"_dataMin",max:"_dataMax"};function IL(t,e){return null==e?null:gf(e)?NaN:t.parse(e)}function OL(t,e){var i=t.type,n=function(t,e,i){var n=t.rawExtentInfo;return n||(n=new ML(t,e,i),t.rawExtentInfo=n,n)}(t,e,t.getExtent()).calculate();t.setBlank(n.isBlank);var r=n.min,o=n.max,s=e.ecModel;if(s&&"time"===i){var a=nD("bar",s),l=!1;if(Zp(a,(function(t){l=l||t.getBaseAxis()===e.axis})),l){var h=rD(a),c=function(t,e,i,n){var r=i.axis.getExtent(),o=r[1]-r[0],s=function(t,e,i){if(t&&e){var n=t[iD(e)];return null!=n&&null!=i?n[eD(i)]:n}}(n,i.axis);if(void 0===s)return{min:t,max:e};var a=1/0;Zp(s,(function(t){a=Math.min(t.offset,a)}));var l=-1/0;Zp(s,(function(t){l=Math.max(t.offset+t.width,l)})),a=Math.abs(a),l=Math.abs(l);var h=a+l,c=e-t,u=c/(1-(a+l)/o)-c;return e+=u*(l/h),t-=u*(a/h),{min:t,max:e}}(r,o,e,h);r=c.min,o=c.max}}return{extent:[r,o],fixMin:n.minFixed,fixMax:n.maxFixed}}function EL(t,e){var i=e,n=OL(t,i),r=n.extent,o=i.get("splitNumber");t instanceof SL&&(t.base=i.get("logBase"));var s=t.type,a=i.get("interval"),l="interval"===s||"time"===s;t.setExtent(r[0],r[1]),t.calcNiceExtent({splitNumber:o,fixMin:n.fixMin,fixMax:n.fixMax,minInterval:l?i.get("minInterval"):null,maxInterval:l?i.get("maxInterval"):null}),null!=a&&t.setInterval&&t.setInterval(a)}function PL(t){var e,i,n=t.getLabelModel().get("formatter"),r="category"===t.type?t.scale.getExtent()[0]:null;return"time"===t.scale.type?(i=n,function(e,n){return t.scale.getFormattedLabel(e,n,i)}):af(n)?function(e){return function(i){var n=t.scale.getLabel(i);return e.replace("{value}",null!=n?n:"")}}(n):sf(n)?(e=n,function(i,n){return null!=r&&(n=i.value-r),e(LL(t,i),n,null!=i.level?{level:i.level}:null)}):function(e){return t.scale.getLabel(e)}}function LL(t,e){return"category"===t.type?t.scale.getLabel(e):e.value}function RL(t,e){var i=e*Math.PI/180,n=t.width,r=t.height,o=n*Math.abs(Math.cos(i))+Math.abs(r*Math.sin(i)),s=n*Math.abs(Math.sin(i))+Math.abs(r*Math.cos(i));return new vg(t.x,t.y,o,s)}function NL(t){var e=t.get("interval");return null==e?"auto":e}function BL(t){return"category"===t.type&&0===NL(t.getLabelModel())}function zL(t,e){var i={};return Zp(t.mapDimensionsAll(e),(function(e){i[function(t,e){return BS(t,e)?t.getCalculationInfo("stackResultDimension"):e}(t,e)]=!0})),ef(i)}var $L=function(){function t(t){this.type="cartesian",this._dimList=[],this._axes={},this.name=t||""}return t.prototype.getAxis=function(t){return this._axes[t]},t.prototype.getAxes=function(){return Jp(this._dimList,(function(t){return this._axes[t]}),this)},t.prototype.getAxesByScale=function(t){return t=t.toLowerCase(),tf(this.getAxes(),(function(e){return e.scale.type===t}))},t.prototype.addAxis=function(t){var e=t.dim;this._axes[e]=t,this._dimList.push(e)},t}(),FL=["x","y"];function VL(t){return"interval"===t.type||"time"===t.type}var HL=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="cartesian2d",e.dimensions=FL,e}return Sp(e,t),e.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var t=this.getAxis("x").scale,e=this.getAxis("y").scale;if(VL(t)&&VL(e)){var i=t.getExtent(),n=e.getExtent(),r=this.dataToPoint([i[0],n[0]]),o=this.dataToPoint([i[1],n[1]]),s=i[1]-i[0],a=n[1]-n[0];if(s&&a){var l=(o[0]-r[0])/s,h=(o[1]-r[1])/a,c=r[0]-i[0]*l,u=r[1]-n[0]*h,d=this._transform=[l,0,0,h,c,u];this._invTransform=ag([],d)}}},e.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},e.prototype.containPoint=function(t){var e=this.getAxis("x"),i=this.getAxis("y");return e.contain(e.toLocalCoord(t[0]))&&i.contain(i.toLocalCoord(t[1]))},e.prototype.containData=function(t){return this.getAxis("x").containData(t[0])&&this.getAxis("y").containData(t[1])},e.prototype.containZone=function(t,e){var i=this.dataToPoint(t),n=this.dataToPoint(e),r=this.getArea(),o=new vg(i[0],i[1],n[0]-i[0],n[1]-i[1]);return r.intersect(o)},e.prototype.dataToPoint=function(t,e,i){i=i||[];var n=t[0],r=t[1];if(this._transform&&null!=n&&isFinite(n)&&null!=r&&isFinite(r))return Xg(i,t,this._transform);var o=this.getAxis("x"),s=this.getAxis("y");return i[0]=o.toGlobalCoord(o.dataToCoord(n,e)),i[1]=s.toGlobalCoord(s.dataToCoord(r,e)),i},e.prototype.clampData=function(t,e){var i=this.getAxis("x").scale,n=this.getAxis("y").scale,r=i.getExtent(),o=n.getExtent(),s=i.parse(t[0]),a=n.parse(t[1]);return(e=e||[])[0]=Math.min(Math.max(Math.min(r[0],r[1]),s),Math.max(r[0],r[1])),e[1]=Math.min(Math.max(Math.min(o[0],o[1]),a),Math.max(o[0],o[1])),e},e.prototype.pointToData=function(t,e){var i=[];if(this._invTransform)return Xg(i,t,this._invTransform);var n=this.getAxis("x"),r=this.getAxis("y");return i[0]=n.coordToData(n.toLocalCoord(t[0]),e),i[1]=r.coordToData(r.toLocalCoord(t[1]),e),i},e.prototype.getOtherAxis=function(t){return this.getAxis("x"===t.dim?"y":"x")},e.prototype.getArea=function(t){t=t||0;var e=this.getAxis("x").getGlobalExtent(),i=this.getAxis("y").getGlobalExtent(),n=Math.min(e[0],e[1])-t,r=Math.min(i[0],i[1])-t,o=Math.max(e[0],e[1])-n+t,s=Math.max(i[0],i[1])-r+t;return new vg(n,r,o,s)},e}($L),WL=Bb();function UL(t,e){var i=Jp(e,(function(e){return t.scale.parse(e)}));return"time"===t.type&&i.length>0&&(i.sort(),i.unshift(i[0]),i.push(i[i.length-1])),i}function jL(t){var e=t.getLabelModel().get("customValues");if(e){var i=PL(t);return{labels:UL(t,e).map((function(e){var n={value:e};return{formattedLabel:i(n),rawLabel:t.scale.getLabel(n),tickValue:e}}))}}return"category"===t.type?function(t){var e=t.getLabelModel(),i=qL(t,e);return!e.get("show")||t.scale.isBlank()?{labels:[],labelCategoryInterval:i.labelCategoryInterval}:i}(t):function(t){var e=t.scale.getTicks(),i=PL(t);return{labels:Jp(e,(function(e,n){return{level:e.level,formattedLabel:i(e,n),rawLabel:t.scale.getLabel(e),tickValue:e.value}}))}}(t)}function GL(t,e){var i=t.getTickModel().get("customValues");return i?{ticks:UL(t,i)}:"category"===t.type?function(t,e){var i,n,r=YL(t,"ticks"),o=NL(e),s=XL(r,o);if(s)return s;e.get("show")&&!t.scale.isBlank()||(i=[]);if(sf(o))i=JL(t,o,!0);else if("auto"===o){var a=qL(t,t.getLabelModel());n=a.labelCategoryInterval,i=Jp(a.labels,(function(t){return t.tickValue}))}else i=ZL(t,n=o,!0);return KL(r,o,{ticks:i,tickCategoryInterval:n})}(t,e):{ticks:Jp(t.scale.getTicks(),(function(t){return t.value}))}}function qL(t,e){var i,n,r=YL(t,"labels"),o=NL(e),s=XL(r,o);return s||(sf(o)?i=JL(t,o):(n="auto"===o?function(t){var e=WL(t).autoInterval;return null!=e?e:WL(t).autoInterval=t.calculateCategoryInterval()}(t):o,i=ZL(t,n)),KL(r,o,{labels:i,labelCategoryInterval:n}))}function YL(t,e){return WL(t)[e]||(WL(t)[e]=[])}function XL(t,e){for(var i=0;i1&&c/l>2&&(h=Math.round(Math.ceil(h/l)*l));var u=BL(t),d=s.get("showMinLabel")||u,p=s.get("showMaxLabel")||u;d&&h!==o[0]&&g(o[0]);for(var f=h;f<=o[1];f+=l)g(f);function g(t){var e={value:t};a.push(i?t:{formattedLabel:n(e),rawLabel:r.getLabel(e),tickValue:t})}return p&&f-l!==o[1]&&g(o[1]),a}function JL(t,e,i){var n=t.scale,r=PL(t),o=[];return Zp(n.getTicks(),(function(t){var s=n.getLabel(t),a=t.value;e(t.value,s)&&o.push(i?a:{formattedLabel:r(t),rawLabel:s,tickValue:a})})),o}var QL=[0,1],tR=function(){function t(t,e,i){this.onBand=!1,this.inverse=!1,this.dim=t,this.scale=e,this._extent=i||[0,0]}return t.prototype.contain=function(t){var e=this._extent,i=Math.min(e[0],e[1]),n=Math.max(e[0],e[1]);return t>=i&&t<=n},t.prototype.containData=function(t){return this.scale.contain(t)},t.prototype.getExtent=function(){return this._extent.slice()},t.prototype.getPixelPrecision=function(t){return function(t,e){var i=Math.log,n=Math.LN10,r=Math.floor(i(t[1]-t[0])/n),o=Math.round(i(Math.abs(e[1]-e[0]))/n),s=Math.min(Math.max(-r+o,0),20);return isFinite(s)?s:20}(t||this.scale.getExtent(),this._extent)},t.prototype.setExtent=function(t,e){var i=this._extent;i[0]=t,i[1]=e},t.prototype.dataToCoord=function(t,e){var i=this._extent,n=this.scale;return t=n.normalize(t),this.onBand&&"ordinal"===n.type&&eR(i=i.slice(),n.count()),ab(t,QL,i,e)},t.prototype.coordToData=function(t,e){var i=this._extent,n=this.scale;this.onBand&&"ordinal"===n.type&&eR(i=i.slice(),n.count());var r=ab(t,i,QL,e);return this.scale.scale(r)},t.prototype.pointToData=function(t,e){},t.prototype.getTicksCoords=function(t){var e=(t=t||{}).tickModel||this.getTickModel(),i=Jp(GL(this,e).ticks,(function(t){return{coord:this.dataToCoord("ordinal"===this.scale.type?this.scale.getRawOrdinalNumber(t):t),tickValue:t}}),this);return function(t,e,i,n){var r=e.length;if(!t.onBand||i||!r)return;var o,s,a=t.getExtent();if(1===r)e[0].coord=a[0],o=e[1]={coord:a[1]};else{var l=e[r-1].tickValue-e[0].tickValue,h=(e[r-1].coord-e[0].coord)/l;Zp(e,(function(t){t.coord-=h/2})),s=1+t.scale.getExtent()[1]-e[r-1].tickValue,o={coord:e[r-1].coord+h*s},e.push(o)}var c=a[0]>a[1];u(e[0].coord,a[0])&&(n?e[0].coord=a[0]:e.shift());n&&u(a[0],e[0].coord)&&e.unshift({coord:a[0]});u(a[1],o.coord)&&(n?o.coord=a[1]:e.pop());n&&u(o.coord,a[1])&&e.push({coord:a[1]});function u(t,e){return t=hb(t),e=hb(e),c?t>e:t0&&t<100||(t=5),Jp(this.scale.getMinorTicks(t),(function(t){return Jp(t,(function(t){return{coord:this.dataToCoord(t),tickValue:t}}),this)}),this)},t.prototype.getViewLabels=function(){return jL(this).labels},t.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},t.prototype.getTickModel=function(){return this.model.getModel("axisTick")},t.prototype.getBandWidth=function(){var t=this._extent,e=this.scale.getExtent(),i=e[1]-e[0]+(this.onBand?1:0);0===i&&(i=1);var n=Math.abs(t[1]-t[0]);return Math.abs(n)/i},t.prototype.calculateCategoryInterval=function(){return function(t){var e=function(t){var e=t.getLabelModel();return{axisRotate:t.getRotate?t.getRotate():t.isHorizontal&&!t.isHorizontal()?90:0,labelRotate:e.get("rotate")||0,font:e.getFont()}}(t),i=PL(t),n=(e.axisRotate-e.labelRotate)/180*Math.PI,r=t.scale,o=r.getExtent(),s=r.count();if(o[1]-o[0]<1)return 0;var a=1;s>40&&(a=Math.max(1,Math.floor(s/40)));for(var l=o[0],h=t.dataToCoord(l+1)-t.dataToCoord(l),c=Math.abs(h*Math.cos(n)),u=Math.abs(h*Math.sin(n)),d=0,p=0;l<=o[1];l+=a){var f,g,m=xg(i({value:l}),e.font,"center","top");f=1.3*m.width,g=1.3*m.height,d=Math.max(d,f,7),p=Math.max(p,g,7)}var v=d/c,y=p/u;isNaN(v)&&(v=1/0),isNaN(y)&&(y=1/0);var b=Math.max(0,Math.floor(Math.min(v,y))),w=WL(t.model),x=t.getExtent(),_=w.lastAutoInterval,k=w.lastTickCount;return null!=_&&null!=k&&Math.abs(_-b)<=1&&Math.abs(k-s)<=1&&_>b&&w.axisExtent0===x[0]&&w.axisExtent1===x[1]?b=_:(w.lastTickCount=s,w.lastAutoInterval=b,w.axisExtent0=x[0],w.axisExtent1=x[1]),b}(this)},t}();function eR(t,e){var i=(t[1]-t[0])/e/2;t[0]+=i,t[1]-=i}var iR=function(t){function e(e,i,n,r,o){var s=t.call(this,e,i,n)||this;return s.index=0,s.type=r||"value",s.position=o||"bottom",s}return Sp(e,t),e.prototype.isHorizontal=function(){var t=this.position;return"top"===t||"bottom"===t},e.prototype.getGlobalExtent=function(t){var e=this.getExtent();return e[0]=this.toGlobalCoord(e[0]),e[1]=this.toGlobalCoord(e[1]),t&&e[0]>e[1]&&e.reverse(),e},e.prototype.pointToData=function(t,e){return this.coordToData(this.toLocalCoord(t["x"===this.dim?0:1]),e)},e.prototype.setCategorySortInfo=function(t){if("category"!==this.type)return!1;this.model.option.categorySortInfo=t,this.scale.setSortInfo(t)},e}(tR);function nR(t,e,i){i=i||{};var n=t.coordinateSystem,r=e.axis,o={},s=r.getAxesOnZeroOf()[0],a=r.position,l=s?"onZero":a,h=r.dim,c=n.getRect(),u=[c.x,c.x+c.width,c.y,c.y+c.height],d={left:0,right:1,top:0,bottom:1,onZero:2},p=e.get("offset")||0,f="x"===h?[u[2]-p,u[3]+p]:[u[0]-p,u[1]+p];if(s){var g=s.toGlobalCoord(s.dataToCoord(0));f[d.onZero]=Math.max(Math.min(g,f[1]),f[0])}o.position=["y"===h?f[d[l]]:u[0],"x"===h?f[d[l]]:u[3]],o.rotation=Math.PI/2*("x"===h?0:1);o.labelDirection=o.tickDirection=o.nameDirection={top:-1,bottom:1,left:-1,right:1}[a],o.labelOffset=s?f[d[a]]-f[d.onZero]:0,e.get(["axisTick","inside"])&&(o.tickDirection=-o.tickDirection),mf(i.labelInside,e.get(["axisLabel","inside"]))&&(o.labelDirection=-o.labelDirection);var m=e.get(["axisLabel","rotate"]);return o.labelRotate="top"===l?-m:m,o.z2=1,o}function rR(t){return"cartesian2d"===t.get("coordinateSystem")}function oR(t){var e={xAxisModel:null,yAxisModel:null};return Zp(e,(function(i,n){var r=n.replace(/Model$/,""),o=t.getReferringComponents(r,Vb).models[0];e[n]=o})),e}var sR=Math.log;function aR(t,e,i){var n=lL.prototype,r=n.getTicks.call(i),o=n.getTicks.call(i,!0),s=r.length-1,a=n.getInterval.call(i),l=OL(t,e),h=l.extent,c=l.fixMin,u=l.fixMax;if("log"===t.type){var d=sR(t.base);h=[sR(h[0])/d,sR(h[1])/d]}t.setExtent(h[0],h[1]),t.calcNiceExtent({splitNumber:s,fixMin:c,fixMax:u});var p=n.getExtent.call(t);c&&(h[0]=p[0]),u&&(h[1]=p[1]);var f=n.getInterval.call(t),g=h[0],m=h[1];if(c&&u)f=(m-g)/s;else if(c)for(m=h[0]+f*s;mh[0]&&isFinite(g)&&isFinite(h[0]);)f=tL(f),g=h[1]-f*s;else{t.getTicks().length-1>s&&(f=tL(f));var v=f*s;(g=hb((m=Math.ceil(h[1]/f)*f)-v))<0&&h[0]>=0?(g=0,m=hb(v)):m>0&&h[1]<=0&&(m=0,g=-hb(v))}var y=(r[0].value-o[0].value)/a,b=(r[s].value-o[s].value)/a;n.setExtent.call(t,g+f*y,m+f*b),n.setInterval.call(t,f),(y||b)&&n.setNiceExtent.call(t,g+f,m-f)}var lR=function(){function t(t,e,i){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=FL,this._initCartesian(t,e,i),this.model=t}return t.prototype.getRect=function(){return this._rect},t.prototype.update=function(t,e){var i=this._axesMap;function n(t){var e,i=ef(t),n=i.length;if(n){for(var r=[],o=n-1;o>=0;o--){var s=t[+i[o]],a=s.model,l=s.scale;JP(l)&&a.get("alignTicks")&&null==a.get("interval")?r.push(s):(EL(l,a),JP(l)&&(e=s))}r.length&&(e||EL((e=r.pop()).scale,e.model),Zp(r,(function(t){aR(t.scale,t.model,e.scale)})))}}this._updateScale(t,this.model),n(i.x),n(i.y);var r={};Zp(i.x,(function(t){cR(i,"y",t,r)})),Zp(i.y,(function(t){cR(i,"x",t,r)})),this.resize(this.model,e)},t.prototype.resize=function(t,e,i){var n=t.getBoxLayoutParams(),r=!i&&t.get("containLabel"),o=XA(n,{width:e.getWidth(),height:e.getHeight()});this._rect=o;var s=this._axesList;function a(){Zp(s,(function(t){var e=t.isHorizontal(),i=e?[0,o.width]:[0,o.height],n=t.inverse?1:0;t.setExtent(i[n],i[1-n]),function(t,e){var i=t.getExtent(),n=i[0]+i[1];t.toGlobalCoord="x"===t.dim?function(t){return t+e}:function(t){return n-t+e},t.toLocalCoord="x"===t.dim?function(t){return t-e}:function(t){return n-t+e}}(t,e?o.x:o.y)}))}a(),r&&(Zp(s,(function(t){if(!t.model.get(["axisLabel","inside"])){var e=function(t){var e=t.model,i=t.scale;if(e.get(["axisLabel","show"])&&!i.isBlank()){var n,r,o=i.getExtent();r=i instanceof sL?i.count():(n=i.getTicks()).length;var s,a=t.getLabelModel(),l=PL(t),h=1;r>40&&(h=Math.ceil(r/40));for(var c=0;c0&&n>0||i<0&&n<0)}(t)}var dR=Math.PI,pR=function(){function t(t,e){this.group=new ex,this.opt=e,this.axisModel=t,qp(e,{labelOffset:0,nameDirection:1,tickDirection:1,labelDirection:1,silent:!0,handleAutoShown:function(){return!0}});var i=new ex({x:e.position[0],y:e.position[1],rotation:e.rotation});i.updateTransform(),this._transformGroup=i}return t.prototype.hasBuilder=function(t){return!!fR[t]},t.prototype.add=function(t){fR[t](this.opt,this.axisModel,this.group,this._transformGroup)},t.prototype.getGroup=function(){return this.group},t.innerTextLayout=function(t,e,i){var n,r,o=db(e-t);return pb(o)?(r=i>0?"top":"bottom",n="center"):pb(o-dR)?(r=i>0?"bottom":"top",n="center"):(r="middle",n=o>0&&o0?"right":"left":i>0?"left":"right"),{rotation:o,textAlign:n,textVerticalAlign:r}},t.makeAxisEventDataBase=function(t){var e={componentType:t.mainType,componentIndex:t.componentIndex};return e[t.mainType+"Index"]=t.componentIndex,e},t.isLabelSilent=function(t){var e=t.get("tooltip");return t.get("silent")||!(t.get("triggerEvent")||e&&e.show)},t}(),fR={axisLine:function(t,e,i,n){var r=e.get(["axisLine","show"]);if("auto"===r&&t.handleAutoShown&&(r=t.handleAutoShown("axisLine")),r){var o=e.axis.getExtent(),s=n.transform,a=[o[0],0],l=[o[1],0],h=a[0]>l[0];s&&(Xg(a,a,s),Xg(l,l,s));var c=Gp({lineCap:"round"},e.getModel(["axisLine","lineStyle"]).getLineStyle()),u=new Ox({shape:{x1:a[0],y1:a[1],x2:l[0],y2:l[1]},style:c,strokeContainThreshold:t.strokeContainThreshold||5,silent:!0,z2:1});f_(u.shape,u.style.lineWidth),u.anid="line",i.add(u);var d=e.get(["axisLine","symbol"]);if(null!=d){var p=e.get(["axisLine","symbolSize"]);af(d)&&(d=[d,d]),(af(p)||hf(p))&&(p=[p,p]);var f=rM(e.get(["axisLine","symbolOffset"])||0,p),g=p[0],m=p[1];Zp([{rotate:t.rotation+Math.PI/2,offset:f[0],r:0},{rotate:t.rotation-Math.PI/2,offset:f[1],r:Math.sqrt((a[0]-l[0])*(a[0]-l[0])+(a[1]-l[1])*(a[1]-l[1]))}],(function(e,n){if("none"!==d[n]&&null!=d[n]){var r=iM(d[n],-g/2,-m/2,g,m,c.stroke,!0),o=e.r+e.offset,s=h?l:a;r.attr({rotation:e.rotate,x:s[0]+o*Math.cos(t.rotation),y:s[1]-o*Math.sin(t.rotation),silent:!0,z2:11}),i.add(r)}}))}}},axisTickLabel:function(t,e,i,n){var r=function(t,e,i,n){var r=i.axis,o=i.getModel("axisTick"),s=o.get("show");"auto"===s&&n.handleAutoShown&&(s=n.handleAutoShown("axisTick"));if(!s||r.scale.isBlank())return;for(var a=o.getModel("lineStyle"),l=n.tickDirection*o.get("length"),h=yR(r.getTicksCoords(),e.transform,l,qp(a.getLineStyle(),{stroke:i.get(["axisLine","lineStyle","color"])}),"ticks"),c=0;cu[1]?-1:1,p=["start"===a?u[0]-d*c:"end"===a?u[1]+d*c:(u[0]+u[1])/2,vR(a)?t.labelOffset+l*c:0],f=e.get("nameRotate");null!=f&&(f=f*dR/180),vR(a)?o=pR.innerTextLayout(t.rotation,null!=f?f:t.rotation,l):(o=function(t,e,i,n){var r,o,s=db(i-t),a=n[0]>n[1],l="start"===e&&!a||"start"!==e&&a;pb(s-dR/2)?(o=l?"bottom":"top",r="center"):pb(s-1.5*dR)?(o=l?"top":"bottom",r="center"):(o="middle",r=s<1.5*dR&&s>dR/2?l?"left":"right":l?"right":"left");return{rotation:s,textAlign:r,textVerticalAlign:o}}(t.rotation,a,f||0,u),null!=(s=t.axisNameAvailableWidth)&&(s=Math.abs(s/Math.sin(o.rotation)),!isFinite(s)&&(s=null)));var g=h.getFont(),m=e.get("nameTruncate",!0)||{},v=m.ellipsis,y=mf(t.nameTruncateMaxWidth,m.maxWidth,s),b=new Yy({x:p[0],y:p[1],rotation:o.rotation,silent:pR.isLabelSilent(e),style:I_(h,{text:r,font:g,overflow:"truncate",width:y,ellipsis:v,fill:h.getTextColor()||e.get(["axisLine","lineStyle","color"]),align:h.get("align")||o.textAlign,verticalAlign:h.get("verticalAlign")||o.textVerticalAlign}),z2:1});if(__({el:b,componentModel:e,itemName:r}),b.__fullText=r,b.anid="name",e.get("triggerEvent")){var w=pR.makeAxisEventDataBase(e);w.targetType="axisName",w.name=r,Ub(b).eventData=w}n.add(b),b.updateTransform(),i.add(b),b.decomposeTransform()}}};function gR(t){t&&(t.ignore=!0)}function mR(t,e){var i=t&&t.getBoundingRect().clone(),n=e&&e.getBoundingRect().clone();if(i&&n){var r=ng([]);return sg(r,r,-t.rotation),i.applyTransform(rg([],r,t.getLocalTransform())),n.applyTransform(rg([],r,e.getLocalTransform())),i.intersect(n)}}function vR(t){return"middle"===t||"center"===t}function yR(t,e,i,n,r){for(var o=[],s=[],a=[],l=0;l=0||t===e}function xR(t){var e=(t.ecModel.getComponent("axisPointer")||{}).coordSysAxesInfo;return e&&e.axesInfo[kR(t)]}function _R(t){return!!t.get(["handle","show"])}function kR(t){return t.type+"||"+t.id}var SR={},AR=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return Sp(e,t),e.prototype.render=function(e,i,n,r){this.axisPointerClass&&function(t){var e=xR(t);if(e){var i=e.axisPointerModel,n=e.axis.scale,r=i.option,o=i.get("status"),s=i.get("value");null!=s&&(s=n.parse(s));var a=_R(i);null==o&&(r.status=a?"show":"hide");var l=n.getExtent().slice();l[0]>l[1]&&l.reverse(),(null==s||s>l[1])&&(s=l[1]),s0&&!u.min?u.min=0:null!=u.min&&u.min<0&&!u.max&&(u.max=0);var d=s;null!=u.color&&(d=qp({color:u.color},s));var p=jp(Up(u),{boundaryGap:t,splitNumber:e,scale:i,axisLine:n,axisTick:r,axisLabel:o,name:u.text,showName:a,nameLocation:"end",nameGap:h,nameTextStyle:d,triggerEvent:c},!1);if(af(l)){var f=p.name;p.name=l.replace("{value}",null!=f?f:"")}else sf(l)&&(p.name=l(p.name,p));var g=new X_(p,null,this.ecModel);return Xp(g,$P.prototype),g.mainType="radar",g.componentIndex=this.componentIndex,g}),this);this._indicatorModels=u},e.prototype.getIndicatorModels=function(){return this._indicatorModels},e.type="radar",e.defaultOption={z:0,center:["50%","50%"],radius:"75%",startAngle:90,axisName:{show:!0},boundaryGap:[0,0],splitNumber:5,axisNameGap:15,scale:!1,shape:"polygon",axisLine:jp({lineStyle:{color:"#bbb"}},HR.axisLine),axisLabel:WR(HR.axisLabel,!1),axisTick:WR(HR.axisTick,!1),splitLine:WR(HR.splitLine,!0),splitArea:WR(HR.splitArea,!0),indicator:[]},e}(tC),jR=["axisLine","axisTickLabel","axisName"],GR=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return Sp(e,t),e.prototype.render=function(t,e,i){this.group.removeAll(),this._buildAxes(t),this._buildSplitLineAndArea(t)},e.prototype._buildAxes=function(t){var e=t.coordinateSystem;Zp(Jp(e.getIndicatorAxes(),(function(t){var i=t.model.get("showName")?t.name:"";return new pR(t.model,{axisName:i,position:[e.cx,e.cy],rotation:t.angle,labelDirection:-1,tickDirection:-1,nameDirection:1})})),(function(t){Zp(jR,t.add,t),this.group.add(t.getGroup())}),this)},e.prototype._buildSplitLineAndArea=function(t){var e=t.coordinateSystem,i=e.getIndicatorAxes();if(i.length){var n=t.get("shape"),r=t.getModel("splitLine"),o=t.getModel("splitArea"),s=r.getModel("lineStyle"),a=o.getModel("areaStyle"),l=r.get("show"),h=o.get("show"),c=s.get("color"),u=a.get("color"),d=of(c)?c:[c],p=of(u)?u:[u],f=[],g=[];if("circle"===n)for(var m=i[0].getTicksCoords(),v=e.cx,y=e.cy,b=0;b0){var A=o(v)?a:l;v>0&&(v=v*k+_),b[w++]=A[S],b[w++]=A[S+1],b[w++]=A[S+2],b[w++]=A[S+3]*v*256}else w+=4}return u.putImageData(y,0,0),c},t.prototype._getBrush=function(){var t=this._brushCanvas||(this._brushCanvas=Tp.createCanvas()),e=this.pointSize+this.blurSize,i=2*e;t.width=i,t.height=i;var n=t.getContext("2d");return n.clearRect(0,0,i,i),n.shadowOffsetX=i,n.shadowBlur=this.blurSize,n.shadowColor="#000",n.beginPath(),n.arc(-e,e,this.pointSize,0,2*Math.PI,!0),n.closePath(),n.fill(),t},t.prototype._getGradient=function(t,e){for(var i=this._gradientPixels,n=i[e]||(i[e]=new Uint8ClampedArray(1024)),r=[0,0,0,0],o=0,s=0;s<256;s++)t[e](s/255,!0,r),n[o++]=r[0],n[o++]=r[1],n[o++]=r[2],n[o++]=r[3];return n},t}();function iN(t){var e=t.dimensions;return"lng"===e[0]&&"lat"===e[1]}var nN=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return Sp(e,t),e.prototype.render=function(t,e,i){var n;e.eachComponent("visualMap",(function(e){e.eachTargetSeries((function(i){i===t&&(n=e)}))})),this._progressiveEls=null,this.group.removeAll();var r=t.coordinateSystem;"cartesian2d"===r.type||"calendar"===r.type?this._renderOnCartesianAndCalendar(t,i,0,t.getData().count()):iN(r)&&this._renderOnGeo(r,t,n,i)},e.prototype.incrementalPrepareRender=function(t,e,i){this.group.removeAll()},e.prototype.incrementalRender=function(t,e,i,n){var r=e.coordinateSystem;r&&(iN(r)?this.render(e,i,n):(this._progressiveEls=[],this._renderOnCartesianAndCalendar(e,n,t.start,t.end,!0)))},e.prototype.eachRendered=function(t){S_(this._progressiveEls||this.group,t)},e.prototype._renderOnCartesianAndCalendar=function(t,e,i,n,r){var o,s,a,l,h=t.coordinateSystem,c=zM(h,"cartesian2d");if(c){var u=h.getAxis("x"),d=h.getAxis("y");o=u.getBandWidth()+.5,s=d.getBandWidth()+.5,a=u.scale.getExtent(),l=d.scale.getExtent()}for(var p=this.group,f=t.getData(),g=t.getModel(["emphasis","itemStyle"]).getItemStyle(),m=t.getModel(["blur","itemStyle"]).getItemStyle(),v=t.getModel(["select","itemStyle"]).getItemStyle(),y=t.get(["itemStyle","borderRadius"]),b=T_(t),w=t.getModel("emphasis"),x=w.get("focus"),_=w.get("blurScope"),k=w.get("disabled"),S=c?[f.mapDimension("x"),f.mapDimension("y"),f.mapDimension("value")]:[f.mapDimension("time"),f.mapDimension("value")],A=i;Aa[1]||Tl[1])continue;var I=h.dataToPoint([D,T]);C=new jy({shape:{x:I[0]-o/2,y:I[1]-s/2,width:o,height:s},style:M})}else{if(isNaN(f.get(S[1],A)))continue;C=new jy({z2:1,shape:h.dataToRect([f.get(S[0],A)]).contentShape,style:M})}if(f.hasItemOption){var O=f.getItemModel(A),E=O.getModel("emphasis");g=E.getModel("itemStyle").getItemStyle(),m=O.getModel(["blur","itemStyle"]).getItemStyle(),v=O.getModel(["select","itemStyle"]).getItemStyle(),y=O.get(["itemStyle","borderRadius"]),x=E.get("focus"),_=E.get("blurScope"),k=E.get("disabled"),b=T_(O)}C.shape.r=y;var P=t.getRawValue(A),L="-";P&&null!=P[2]&&(L=P[2]+""),D_(C,b,{labelFetcher:t,labelDataIndex:A,defaultOpacity:M.opacity,defaultText:L}),C.ensureState("emphasis").style=g,C.ensureState("blur").style=m,C.ensureState("select").style=v,Iw(C,x,_,k),C.incremental=r,r&&(C.states.emphasis.hoverLayer=!0),p.add(C),f.setItemGraphicEl(A,C),this._progressiveEls&&this._progressiveEls.push(C)}},e.prototype._renderOnGeo=function(t,e,i,n){var r=i.targetVisuals.inRange,o=i.targetVisuals.outOfRange,s=e.getData(),a=this._hmLayer||this._hmLayer||new eN;a.blurSize=e.get("blurSize"),a.pointSize=e.get("pointSize"),a.minOpacity=e.get("minOpacity"),a.maxOpacity=e.get("maxOpacity");var l=t.getViewRect().clone(),h=t.getRoamTransform();l.applyTransform(h);var c=Math.max(l.x,0),u=Math.max(l.y,0),d=Math.min(l.width+l.x,n.getWidth()),p=Math.min(l.height+l.y,n.getHeight()),f=d-c,g=p-u,m=[s.mapDimension("lng"),s.mapDimension("lat"),s.mapDimension("value")],v=s.mapArray(m,(function(e,i,n){var r=t.dataToPoint([e,i]);return r[0]-=c,r[1]-=u,r.push(n),r})),y=i.getExtent(),b="visualMap.continuous"===i.type?function(t,e){var i=t[1]-t[0];return e=[(e[0]-t[0])/i,(e[1]-t[0])/i],function(t){return t>=e[0]&&t<=e[1]}}(y,i.option.range):function(t,e,i){var n=t[1]-t[0],r=(e=Jp(e,(function(e){return{interval:[(e.interval[0]-t[0])/n,(e.interval[1]-t[0])/n]}}))).length,o=0;return function(t){var n;for(n=o;n=0;n--){var s;if((s=e[n].interval)[0]<=t&&t<=s[1]){o=n;break}}return n>=0&&ns)return!0;if(o){var a=xR(t).seriesDataCount,l=n.getExtent();return Math.abs(l[0]-l[1])/a>s}return!1}return!0===i},t.prototype.makeElOption=function(t,e,i,n,r){},t.prototype.createPointerEl=function(t,e,i,n){var r=e.pointer;if(r){var o=oN(t).pointerEl=new A_[r.type](sN(e.pointer));t.add(o)}},t.prototype.createLabelEl=function(t,e,i,n){if(e.label){var r=oN(t).labelEl=new Yy(sN(e.label));t.add(r),uN(r,n)}},t.prototype.updatePointerEl=function(t,e,i){var n=oN(t).pointerEl;n&&e.pointer&&(n.setStyle(e.pointer.style),i(n,{shape:e.pointer.shape}))},t.prototype.updateLabelEl=function(t,e,i,n){var r=oN(t).labelEl;r&&(r.setStyle(e.label.style),i(r,{x:e.label.x,y:e.label.y}),uN(r,n))},t.prototype._renderHandle=function(t){if(!this._dragging&&this.updateHandleTransform){var e,i=this._axisPointerModel,n=this._api.getZr(),r=this._handle,o=i.getModel("handle"),s=i.get("status");if(!o.get("show")||!s||"hide"===s)return r&&n.remove(r),void(this._handle=null);this._handle||(e=!0,r=this._handle=b_(o.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(t){TT(t.event)},onmousedown:aN(this._onHandleDragMove,this,0,0),drift:aN(this._onHandleDragMove,this),ondragend:aN(this._onHandleDragEnd,this)}),n.add(r)),pN(r,i,!1),r.setStyle(o.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var a=o.get("size");of(a)||(a=[a,a]),r.scaleX=a[0]/2,r.scaleY=a[1]/2,fD(this,"_doDispatchAxisPointer",o.get("throttle")||0,"fixRate"),this._moveHandleToValue(t,e)}},t.prototype._moveHandleToValue=function(t,e){hN(this._axisPointerModel,!e&&this._moveAnimation,this._handle,dN(this.getHandleTransform(t,this._axisModel,this._axisPointerModel)))},t.prototype._onHandleDragMove=function(t,e){var i=this._handle;if(i){this._dragging=!0;var n=this.updateHandleTransform(dN(i),[t,e],this._axisModel,this._axisPointerModel);this._payloadInfo=n,i.stopAnimation(),i.attr(dN(n)),oN(i).lastProp=null,this._doDispatchAxisPointer()}},t.prototype._doDispatchAxisPointer=function(){if(this._handle){var t=this._payloadInfo,e=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:t.cursorPoint[0],y:t.cursorPoint[1],tooltipOption:t.tooltipOption,axesInfo:[{axisDim:e.axis.dim,axisIndex:e.componentIndex}]})}},t.prototype._onHandleDragEnd=function(){if(this._dragging=!1,this._handle){var t=this._axisPointerModel.get("value");this._moveHandleToValue(t),this._api.dispatchAction({type:"hideTip"})}},t.prototype.clear=function(t){this._lastValue=null,this._lastStatus=null;var e=t.getZr(),i=this._group,n=this._handle;e&&i&&(this._lastGraphicKey=null,i&&e.remove(i),n&&e.remove(n),this._group=null,this._handle=null,this._payloadInfo=null),gD(this,"_doDispatchAxisPointer")},t.prototype.doClear=function(){},t.prototype.buildLabel=function(t,e,i){return{x:t[i=i||0],y:t[1-i],width:e[i],height:e[1-i]}},t}();function hN(t,e,i,n){cN(oN(i).lastProp,n)||(oN(i).lastProp=n,e?Zx(i,n,t):(i.stopAnimation(),i.attr(n)))}function cN(t,e){if(cf(t)&&cf(e)){var i=!0;return Zp(e,(function(e,n){i=i&&cN(t[n],e)})),!!i}return t===e}function uN(t,e){t[e.get(["label","show"])?"show":"hide"]()}function dN(t){return{x:t.x||0,y:t.y||0,rotation:t.rotation||0}}function pN(t,e,i){var n=e.get("z"),r=e.get("zlevel");t&&t.traverse((function(t){"group"!==t.type&&(null!=n&&(t.z=n),null!=r&&(t.zlevel=r),t.silent=i)}))}function fN(t,e,i,n,r){var o=gN(i.get("value"),e.axis,e.ecModel,i.get("seriesDataIndices"),{precision:i.get(["label","precision"]),formatter:i.get(["label","formatter"])}),s=i.getModel("label"),a=BA(s.get("padding")||0),l=s.getFont(),h=xg(o,l),c=r.position,u=h.width+a[1]+a[3],d=h.height+a[0]+a[2],p=r.align;"right"===p&&(c[0]-=u),"center"===p&&(c[0]-=u/2);var f=r.verticalAlign;"bottom"===f&&(c[1]-=d),"middle"===f&&(c[1]-=d/2),function(t,e,i,n){var r=n.getWidth(),o=n.getHeight();t[0]=Math.min(t[0]+e,r)-e,t[1]=Math.min(t[1]+i,o)-i,t[0]=Math.max(t[0],0),t[1]=Math.max(t[1],0)}(c,u,d,n);var g=s.get("backgroundColor");g&&"auto"!==g||(g=e.get(["axisLine","lineStyle","color"])),t.label={x:c[0],y:c[1],style:I_(s,{text:o,font:l,fill:s.getTextColor(),padding:a,backgroundColor:g}),z2:10}}function gN(t,e,i,n,r){t=e.scale.parse(t);var o=e.scale.getLabel({value:t},{precision:r.precision}),s=r.formatter;if(s){var a={value:LL(e,{value:t}),axisDimension:e.dim,axisIndex:e.index,seriesData:[]};Zp(n,(function(t){var e=i.getSeriesByIndex(t.seriesIndex),n=t.dataIndexInside,r=e&&e.getDataParams(n);r&&a.seriesData.push(r)})),af(s)?o=s.replace("{value}",o):sf(s)&&(o=s(a))}return o}function mN(t,e,i){var n=[1,0,0,1,0,0];return sg(n,n,i.rotation),og(n,n,i.position),m_([t.dataToCoord(e),(i.labelOffset||0)+(i.labelDirection||1)*(i.labelMargin||0)],n)}var vN=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Sp(e,t),e.prototype.makeElOption=function(t,e,i,n,r){var o=i.axis,s=o.grid,a=n.get("type"),l=yN(s,o).getOtherAxis(o).getGlobalExtent(),h=o.toGlobalCoord(o.dataToCoord(e,!0));if(a&&"none"!==a){var c=function(t){var e,i=t.get("type"),n=t.getModel(i+"Style");return"line"===i?(e=n.getLineStyle()).fill=null:"shadow"===i&&((e=n.getAreaStyle()).stroke=null),e}(n),u=bN[a](o,h,l);u.style=c,t.graphicKey=u.type,t.pointer=u}!function(t,e,i,n,r,o){var s=pR.innerTextLayout(i.rotation,0,i.labelDirection);i.labelMargin=r.get(["label","margin"]),fN(e,n,r,o,{position:mN(n.axis,t,i),align:s.textAlign,verticalAlign:s.textVerticalAlign})}(e,t,nR(s.model,i),i,n,r)},e.prototype.getHandleTransform=function(t,e,i){var n=nR(e.axis.grid.model,e,{labelInside:!1});n.labelMargin=i.get(["handle","margin"]);var r=mN(e.axis,t,n);return{x:r[0],y:r[1],rotation:n.rotation+(n.labelDirection<0?Math.PI:0)}},e.prototype.updateHandleTransform=function(t,e,i,n){var r=i.axis,o=r.grid,s=r.getGlobalExtent(!0),a=yN(o,r).getOtherAxis(r).getGlobalExtent(),l="x"===r.dim?0:1,h=[t.x,t.y];h[l]+=e[l],h[l]=Math.min(s[1],h[l]),h[l]=Math.max(s[0],h[l]);var c=(a[1]+a[0])/2,u=[c,c];u[l]=h[l];return{x:h[0],y:h[1],rotation:t.rotation,cursorPoint:u,tooltipOption:[{verticalAlign:"middle"},{align:"center"}][l]}},e}(lN);function yN(t,e){var i={};return i[e.dim+"AxisIndex"]=e.index,t.getCartesian(i)}var bN={line:function(t,e,i){var n,r,o;return{type:"Line",subPixelOptimize:!0,shape:(n=[e,i[0]],r=[e,i[1]],o=wN(t),{x1:n[o=o||0],y1:n[1-o],x2:r[o],y2:r[1-o]})}},shadow:function(t,e,i){var n,r,o,s=Math.max(1,t.getBandWidth()),a=i[1]-i[0];return{type:"Rect",shape:(n=[e-s/2,i[0]],r=[s,a],o=wN(t),{x:n[o=o||0],y:n[1-o],width:r[o],height:r[1-o]})}}};function wN(t){return"x"===t.dim?0:1}var xN=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return Sp(e,t),e.type="axisPointer",e.defaultOption={show:"auto",z:50,type:"line",snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:"#B9BEC9",width:1,type:"dashed"},shadowStyle:{color:"rgba(210,219,238,0.2)"},label:{show:!0,formatter:null,precision:"auto",margin:3,color:"#fff",padding:[5,7,5,7],backgroundColor:"auto",borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,icon:"M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",size:45,margin:50,color:"#333",shadowBlur:3,shadowColor:"#aaa",shadowOffsetX:0,shadowOffsetY:2,throttle:40}},e}(tC),_N=Bb(),kN=Zp;function SN(t,e,i){if(!Nf.node){var n=e.getZr();_N(n).records||(_N(n).records={}),function(t,e){if(_N(t).initialized)return;function i(i,n){t.on(i,(function(i){var r=function(t){var e={showTip:[],hideTip:[]},i=function(n){var r=e[n.type];r?r.push(n):(n.dispatchAction=i,t.dispatchAction(n))};return{dispatchAction:i,pendings:e}}(e);kN(_N(t).records,(function(t){t&&n(t,i,r.dispatchAction)})),function(t,e){var i,n=t.showTip.length,r=t.hideTip.length;n?i=t.showTip[n-1]:r&&(i=t.hideTip[r-1]);i&&(i.dispatchAction=null,e.dispatchAction(i))}(r.pendings,e)}))}_N(t).initialized=!0,i("click",rf(CN,"click")),i("mousemove",rf(CN,"mousemove")),i("globalout",AN)}(n,e),(_N(n).records[t]||(_N(n).records[t]={})).handler=i}}function AN(t,e,i){t.handler("leave",null,i)}function CN(t,e,i,n){e.handler(t,i,n)}function MN(t,e){if(!Nf.node){var i=e.getZr();(_N(i).records||{})[t]&&(_N(i).records[t]=null)}}var DN=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return Sp(e,t),e.prototype.render=function(t,e,i){var n=e.getComponent("tooltip"),r=t.get("triggerOn")||n&&n.get("triggerOn")||"mousemove|click";SN("axisPointer",i,(function(t,e,i){"none"!==r&&("leave"===t||r.indexOf(t)>=0)&&i({type:"updateAxisPointer",currTrigger:t,x:e&&e.offsetX,y:e&&e.offsetY})}))},e.prototype.remove=function(t,e){MN("axisPointer",e)},e.prototype.dispose=function(t,e){MN("axisPointer",e)},e.type="axisPointer",e}(cO);function TN(t,e){var i,n=[],r=t.seriesIndex;if(null==r||!(i=e.getSeriesByIndex(r)))return{point:[]};var o=i.getData(),s=Nb(o,t);if(null==s||s<0||of(s))return{point:[]};var a=o.getItemGraphicEl(s),l=i.coordinateSystem;if(i.getTooltipPosition)n=i.getTooltipPosition(s)||[];else if(l&&l.dataToPoint)if(t.isStacked){var h=l.getBaseAxis(),c=l.getOtherAxis(h).dim,u=h.dim,d="x"===c||"radius"===c?1:0,p=o.mapDimension(u),f=[];f[d]=o.get(p,s),f[1-d]=o.get(o.getCalculationInfo("stackResultDimension"),s),n=l.dataToPoint(f)||[]}else n=l.dataToPoint(o.getValues(Jp(l.dimensions,(function(t){return o.mapDimension(t)})),s))||[];else if(a){var g=a.getBoundingRect().clone();g.applyTransform(a.transform),n=[g.x+g.width/2,g.y+g.height/2]}return{point:n,el:a}}var IN=Bb();function ON(t,e,i){var n=t.currTrigger,r=[t.x,t.y],o=t,s=t.dispatchAction||nf(i.dispatchAction,i),a=e.getComponent("axisPointer").coordSysAxesInfo;if(a){NN(r)&&(r=TN({seriesIndex:o.seriesIndex,dataIndex:o.dataIndex},e).point);var l=NN(r),h=o.axesInfo,c=a.axesInfo,u="leave"===n||NN(r),d={},p={},f={list:[],map:{}},g={showPointer:rf(PN,p),showTooltip:rf(LN,f)};Zp(a.coordSysMap,(function(t,e){var i=l||t.containPoint(r);Zp(a.coordSysAxesInfo[e],(function(t,e){var n=t.axis,o=function(t,e){for(var i=0;i<(t||[]).length;i++){var n=t[i];if(e.axis.dim===n.axisDim&&e.axis.model.componentIndex===n.axisIndex)return n}}(h,t);if(!u&&i&&(!h||o)){var s=o&&o.value;null!=s||l||(s=n.pointToData(r)),null!=s&&EN(t,s,g,!1,d)}}))}));var m={};return Zp(c,(function(t,e){var i=t.linkGroup;i&&!p[e]&&Zp(i.axesInfo,(function(e,n){var r=p[n];if(e!==t&&r){var o=r.value;i.mapper&&(o=t.axis.scale.parse(i.mapper(o,RN(e),RN(t)))),m[t.key]=o}}))})),Zp(m,(function(t,e){EN(c[e],t,g,!0,d)})),function(t,e,i){var n=i.axesInfo=[];Zp(e,(function(e,i){var r=e.axisPointerModel.option,o=t[i];o?(!e.useHandle&&(r.status="show"),r.value=o.value,r.seriesDataIndices=(o.payloadBatch||[]).slice()):!e.useHandle&&(r.status="hide"),"show"===r.status&&n.push({axisDim:e.axis.dim,axisIndex:e.axis.model.componentIndex,value:r.value})}))}(p,c,d),function(t,e,i,n){if(NN(e)||!t.list.length)return void n({type:"hideTip"});var r=((t.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};n({type:"showTip",escapeConnect:!0,x:e[0],y:e[1],tooltipOption:i.tooltipOption,position:i.position,dataIndexInside:r.dataIndexInside,dataIndex:r.dataIndex,seriesIndex:r.seriesIndex,dataByCoordSys:t.list})}(f,r,t,s),function(t,e,i){var n=i.getZr(),r="axisPointerLastHighlights",o=IN(n)[r]||{},s=IN(n)[r]={};Zp(t,(function(t,e){var i=t.axisPointerModel.option;"show"===i.status&&t.triggerEmphasis&&Zp(i.seriesDataIndices,(function(t){var e=t.seriesIndex+" | "+t.dataIndex;s[e]=t}))}));var a=[],l=[];Zp(o,(function(t,e){!s[e]&&l.push(t)})),Zp(s,(function(t,e){!o[e]&&a.push(t)})),l.length&&i.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),a.length&&i.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:a})}(c,0,i),d}}function EN(t,e,i,n,r){var o=t.axis;if(!o.scale.isBlank()&&o.containData(e))if(t.involveSeries){var s=function(t,e){var i=e.axis,n=i.dim,r=t,o=[],s=Number.MAX_VALUE,a=-1;return Zp(e.seriesModels,(function(e,l){var h,c,u=e.getData().mapDimensionsAll(n);if(e.getAxisTooltipData){var d=e.getAxisTooltipData(u,t,i);c=d.dataIndices,h=d.nestestValue}else{if(!(c=e.getData().indicesOfNearest(u[0],t,"category"===i.type?.5:null)).length)return;h=e.getData().get(u[0],c[0])}if(null!=h&&isFinite(h)){var p=t-h,f=Math.abs(p);f<=s&&((f=0&&a<0)&&(s=f,a=p,r=h,o.length=0),Zp(c,(function(t){o.push({seriesIndex:e.seriesIndex,dataIndexInside:t,dataIndex:e.getData().getRawIndex(t)})})))}})),{payloadBatch:o,snapToValue:r}}(e,t),a=s.payloadBatch,l=s.snapToValue;a[0]&&null==r.seriesIndex&&Gp(r,a[0]),!n&&t.snap&&o.containData(l)&&null!=l&&(e=l),i.showPointer(t,e,a),i.showTooltip(t,s,l)}else i.showPointer(t,e)}function PN(t,e,i,n){t[e.key]={value:i,payloadBatch:n}}function LN(t,e,i,n){var r=i.payloadBatch,o=e.axis,s=o.model,a=e.axisPointerModel;if(e.triggerTooltip&&r.length){var l=e.coordSys.model,h=kR(l),c=t.map[h];c||(c=t.map[h]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},t.list.push(c)),c.dataByAxis.push({axisDim:o.dim,axisIndex:s.componentIndex,axisType:s.type,axisId:s.id,value:n,valueLabelOpt:{precision:a.get(["label","precision"]),formatter:a.get(["label","formatter"])},seriesDataIndices:r.slice()})}}function RN(t){var e=t.axis.model,i={},n=i.axisDim=t.axis.dim;return i.axisIndex=i[n+"AxisIndex"]=e.componentIndex,i.axisName=i[n+"AxisName"]=e.name,i.axisId=i[n+"AxisId"]=e.id,i}function NN(t){return!t||null==t[0]||isNaN(t[0])||null==t[1]||isNaN(t[1])}function BN(t){AR.registerAxisPointerClass("CartesianAxisPointer",vN),t.registerComponentModel(xN),t.registerComponentView(DN),t.registerPreprocessor((function(t){if(t){(!t.axisPointer||0===t.axisPointer.length)&&(t.axisPointer={});var e=t.axisPointer.link;e&&!of(e)&&(t.axisPointer.link=[e])}})),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,(function(t,e){t.getComponent("axisPointer").coordSysAxesInfo=bR(t,e)})),t.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},ON)}var zN=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return Sp(e,t),e.type="tooltip",e.dependencies=["axisPointer"],e.defaultOption={z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",renderMode:"auto",confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"#fff",shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#666",fontSize:14}},e}(tC);function $N(t){var e=t.get("confine");return null!=e?!!e:"richText"===t.get("renderMode")}function FN(t){if(Nf.domSupported)for(var e=document.documentElement.style,i=0,n=t.length;i-1?(h+="top:50%",c+="translateY(-50%) rotate("+(s="left"===a?-225:-45)+"deg)"):(h+="left:50%",c+="translateX(-50%) rotate("+(s="top"===a?225:45)+"deg)");var u=s*Math.PI/180,d=l+r,p=d*Math.abs(Math.cos(u))+d*Math.abs(Math.sin(u)),f=e+" solid "+r+"px;";return'
'}(i,n,r)),af(t))o.innerHTML=t+s;else if(t){o.innerHTML="",of(t)||(t=[t]);for(var a=0;a=0?this._tryShow(i,n):"leave"===e&&this._hide(n))}),this))},e.prototype._keepShow=function(){var t=this._tooltipModel,e=this._ecModel,i=this._api,n=t.get("triggerOn");if(null!=this._lastX&&null!=this._lastY&&"none"!==n&&"click"!==n){var r=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout((function(){!i.isDisposed()&&r.manuallyShowTip(t,e,i,{x:r._lastX,y:r._lastY,dataByCoordSys:r._lastDataByCoordSys})}))}},e.prototype.manuallyShowTip=function(t,e,i,n){if(n.from!==this.uid&&!Nf.node&&i.getDom()){var r=nB(n,i);this._ticket="";var o=n.dataByCoordSys,s=function(t,e,i){var n=Fb(t).queryOptionMap,r=n.keys()[0];if(!r||"series"===r)return;var o=Hb(e,r,n.get(r),{useDefault:!1,enableAll:!1,enableNone:!1}),s=o.models[0];if(!s)return;var a,l=i.getViewOfComponentModel(s);if(l.group.traverse((function(e){var i=Ub(e).tooltipConfig;if(i&&i.name===t.name)return a=e,!0})),a)return{componentMainType:r,componentIndex:s.componentIndex,el:a}}(n,e,i);if(s){var a=s.el.getBoundingRect().clone();a.applyTransform(s.el.transform),this._tryShow({offsetX:a.x+a.width/2,offsetY:a.y+a.height/2,target:s.el,position:n.position,positionDefault:"bottom"},r)}else if(n.tooltip&&null!=n.x&&null!=n.y){var l=tB;l.x=n.x,l.y=n.y,l.update(),Ub(l).tooltipConfig={name:null,option:n.tooltip},this._tryShow({offsetX:n.x,offsetY:n.y,target:l},r)}else if(o)this._tryShow({offsetX:n.x,offsetY:n.y,position:n.position,dataByCoordSys:o,tooltipOption:n.tooltipOption},r);else if(null!=n.seriesIndex){if(this._manuallyAxisShowTip(t,e,i,n))return;var h=TN(n,e),c=h.point[0],u=h.point[1];null!=c&&null!=u&&this._tryShow({offsetX:c,offsetY:u,target:h.el,position:n.position,positionDefault:"bottom"},r)}else null!=n.x&&null!=n.y&&(i.dispatchAction({type:"updateAxisPointer",x:n.x,y:n.y}),this._tryShow({offsetX:n.x,offsetY:n.y,position:n.position,target:i.getZr().findHover(n.x,n.y).target},r))}},e.prototype.manuallyHideTip=function(t,e,i,n){var r=this._tooltipContent;this._tooltipModel&&r.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,n.from!==this.uid&&this._hide(nB(n,i))},e.prototype._manuallyAxisShowTip=function(t,e,i,n){var r=n.seriesIndex,o=n.dataIndex,s=e.getComponent("axisPointer").coordSysAxesInfo;if(null!=r&&null!=o&&null!=s){var a=e.getSeriesByIndex(r);if(a)if("axis"===iB([a.getData().getItemModel(o),a,(a.coordinateSystem||{}).model],this._tooltipModel).get("trigger"))return i.dispatchAction({type:"updateAxisPointer",seriesIndex:r,dataIndex:o,position:n.position}),!0}},e.prototype._tryShow=function(t,e){var i=t.target;if(this._tooltipModel){this._lastX=t.offsetX,this._lastY=t.offsetY;var n=t.dataByCoordSys;if(n&&n.length)this._showAxisTooltip(n,t);else if(i){var r,o;if("legend"===Ub(i).ssrType)return;this._lastDataByCoordSys=null,YO(i,(function(t){return null!=Ub(t).dataIndex?(r=t,!0):null!=Ub(t).tooltipConfig?(o=t,!0):void 0}),!0),r?this._showSeriesItemTooltip(t,r,e):o?this._showComponentItemTooltip(t,o,e):this._hide(e)}else this._lastDataByCoordSys=null,this._hide(e)}},e.prototype._showOrMove=function(t,e){var i=t.get("showDelay");e=nf(e,this),clearTimeout(this._showTimout),i>0?this._showTimout=setTimeout(e,i):e()},e.prototype._showAxisTooltip=function(t,e){var i=this._ecModel,n=this._tooltipModel,r=[e.offsetX,e.offsetY],o=iB([e.tooltipOption],n),s=this._renderMode,a=[],l=AC("section",{blocks:[],noHeader:!0}),h=[],c=new NC;Zp(t,(function(t){Zp(t.dataByAxis,(function(t){var e=i.getComponent(t.axisDim+"Axis",t.axisIndex),r=t.value;if(e&&null!=r){var o=gN(r,e.axis,i,t.seriesDataIndices,t.valueLabelOpt),u=AC("section",{header:o,noHeader:!_f(o),sortBlocks:!0,blocks:[]});l.blocks.push(u),Zp(t.seriesDataIndices,(function(l){var d=i.getSeriesByIndex(l.seriesIndex),p=l.dataIndexInside,f=d.getDataParams(p);if(!(f.dataIndex<0)){f.axisDim=t.axisDim,f.axisIndex=t.axisIndex,f.axisType=t.axisType,f.axisId=t.axisId,f.axisValue=LL(e.axis,{value:r}),f.axisValueLabel=o,f.marker=c.makeTooltipMarker("item",HA(f.color),s);var g=oC(d.formatTooltip(p,!0,null)),m=g.frag;if(m){var v=iB([d],n).get("valueFormatter");u.blocks.push(v?Gp({valueFormatter:v},m):m)}g.text&&h.push(g.text),a.push(f)}}))}}))})),l.blocks.reverse(),h.reverse();var u=e.position,d=o.get("order"),p=OC(l,c,s,d,i.get("useUTC"),o.get("textStyle"));p&&h.unshift(p);var f="richText"===s?"\n\n":"
",g=h.join(f);this._showOrMove(o,(function(){this._updateContentNotChangedOnAxis(t,a)?this._updatePosition(o,u,r[0],r[1],this._tooltipContent,a):this._showTooltipContent(o,g,a,Math.random()+"",r[0],r[1],u,null,c)}))},e.prototype._showSeriesItemTooltip=function(t,e,i){var n=this._ecModel,r=Ub(e),o=r.seriesIndex,s=n.getSeriesByIndex(o),a=r.dataModel||s,l=r.dataIndex,h=r.dataType,c=a.getData(h),u=this._renderMode,d=t.positionDefault,p=iB([c.getItemModel(l),a,s&&(s.coordinateSystem||{}).model],this._tooltipModel,d?{position:d}:null),f=p.get("trigger");if(null==f||"item"===f){var g=a.getDataParams(l,h),m=new NC;g.marker=m.makeTooltipMarker("item",HA(g.color),u);var v=oC(a.formatTooltip(l,!1,h)),y=p.get("order"),b=p.get("valueFormatter"),w=v.frag,x=w?OC(b?Gp({valueFormatter:b},w):w,m,u,y,n.get("useUTC"),p.get("textStyle")):v.text,_="item_"+a.name+"_"+l;this._showOrMove(p,(function(){this._showTooltipContent(p,x,g,_,t.offsetX,t.offsetY,t.position,t.target,m)})),i({type:"showTip",dataIndexInside:l,dataIndex:c.getRawIndex(l),seriesIndex:o,from:this.uid})}},e.prototype._showComponentItemTooltip=function(t,e,i){var n="html"===this._renderMode,r=Ub(e),o=r.tooltipConfig.option||{},s=o.encodeHTMLContent;if(af(o)){o={content:o,formatter:o},s=!0}s&&n&&o.content&&((o=Up(o)).content=ZS(o.content));var a=[o],l=this._ecModel.getComponent(r.componentMainType,r.componentIndex);l&&a.push(l),a.push({formatter:o.content});var h=t.positionDefault,c=iB(a,this._tooltipModel,h?{position:h}:null),u=c.get("content"),d=Math.random()+"",p=new NC;this._showOrMove(c,(function(){var i=Up(c.get("formatterParams")||{});this._showTooltipContent(c,u,i,d,t.offsetX,t.offsetY,t.position,e,p)})),i({type:"showTip",from:this.uid})},e.prototype._showTooltipContent=function(t,e,i,n,r,o,s,a,l){if(this._ticket="",t.get("showContent")&&t.get("show")){var h=this._tooltipContent;h.setEnterable(t.get("enterable"));var c=t.get("formatter");s=s||t.get("position");var u=e,d=this._getNearestPoint([r,o],i,t.get("trigger"),t.get("borderColor")).color;if(c)if(af(c)){var p=t.ecModel.get("useUTC"),f=of(i)?i[0]:i;u=c,f&&f.axisType&&f.axisType.indexOf("time")>=0&&(u=yA(f.axisValue,u,p)),u=VA(u,i,!0)}else if(sf(c)){var g=nf((function(e,n){e===this._ticket&&(h.setContent(n,l,t,d,s),this._updatePosition(t,s,r,o,h,i,a))}),this);this._ticket=n,u=c(i,n,g)}else u=c;h.setContent(u,l,t,d,s),h.show(t,d),this._updatePosition(t,s,r,o,h,i,a)}},e.prototype._getNearestPoint=function(t,e,i,n){return"axis"===i||of(e)?{color:n||("html"===this._renderMode?"#fff":"none")}:of(e)?void 0:{color:n||e.color||e.borderColor}},e.prototype._updatePosition=function(t,e,i,n,r,o,s){var a=this._api.getWidth(),l=this._api.getHeight();e=e||t.get("position");var h=r.getSize(),c=t.get("align"),u=t.get("verticalAlign"),d=s&&s.getBoundingRect().clone();if(s&&d.applyTransform(s.transform),sf(e)&&(e=e([i,n],o,r.el,d,{viewSize:[a,l],contentSize:h.slice()})),of(e))i=lb(e[0],a),n=lb(e[1],l);else if(cf(e)){var p=e;p.width=h[0],p.height=h[1];var f=XA(p,{width:a,height:l});i=f.x,n=f.y,c=null,u=null}else if(af(e)&&s){var g=function(t,e,i,n){var r=i[0],o=i[1],s=Math.ceil(Math.SQRT2*n)+8,a=0,l=0,h=e.width,c=e.height;switch(t){case"inside":a=e.x+h/2-r/2,l=e.y+c/2-o/2;break;case"top":a=e.x+h/2-r/2,l=e.y-o-s;break;case"bottom":a=e.x+h/2-r/2,l=e.y+c+s;break;case"left":a=e.x-r-s,l=e.y+c/2-o/2;break;case"right":a=e.x+h+s,l=e.y+c/2-o/2}return[a,l]}(e,d,h,t.get("borderWidth"));i=g[0],n=g[1]}else{g=function(t,e,i,n,r,o,s){var a=i.getSize(),l=a[0],h=a[1];null!=o&&(t+l+o+2>n?t-=l+o:t+=o);null!=s&&(e+h+s>r?e-=h+s:e+=s);return[t,e]}(i,n,r,a,l,c?null:20,u?null:20);i=g[0],n=g[1]}if(c&&(i-=rB(c)?h[0]/2:"right"===c?h[0]:0),u&&(n-=rB(u)?h[1]/2:"bottom"===u?h[1]:0),$N(t)){g=function(t,e,i,n,r){var o=i.getSize(),s=o[0],a=o[1];return t=Math.min(t+s,n)-s,e=Math.min(e+a,r)-a,t=Math.max(t,0),e=Math.max(e,0),[t,e]}(i,n,r,a,l);i=g[0],n=g[1]}r.moveTo(i,n)},e.prototype._updateContentNotChangedOnAxis=function(t,e){var i=this._lastDataByCoordSys,n=this._cbParamsList,r=!!i&&i.length===t.length;return r&&Zp(i,(function(i,o){var s=i.dataByAxis||[],a=(t[o]||{}).dataByAxis||[];(r=r&&s.length===a.length)&&Zp(s,(function(t,i){var o=a[i]||{},s=t.seriesDataIndices||[],l=o.seriesDataIndices||[];(r=r&&t.value===o.value&&t.axisType===o.axisType&&t.axisId===o.axisId&&s.length===l.length)&&Zp(s,(function(t,e){var i=l[e];r=r&&t.seriesIndex===i.seriesIndex&&t.dataIndex===i.dataIndex})),n&&Zp(t.seriesDataIndices,(function(t){var i=t.seriesIndex,o=e[i],s=n[i];o&&s&&s.data!==o.data&&(r=!1)}))}))})),this._lastDataByCoordSys=t,this._cbParamsList=e,!!r},e.prototype._hide=function(t){this._lastDataByCoordSys=null,t({type:"hideTip",from:this.uid})},e.prototype.dispose=function(t,e){!Nf.node&&e.getDom()&&(gD(this,"_updatePosition"),this._tooltipContent.dispose(),MN("itemTooltip",e))},e.type="tooltip",e}(cO);function iB(t,e,i){var n,r=e.ecModel;i?(n=new X_(i,r,r),n=new X_(e.option,n,r)):n=e;for(var o=t.length-1;o>=0;o--){var s=t[o];s&&(s instanceof X_&&(s=s.get("tooltip",!0)),af(s)&&(s={formatter:s}),s&&(n=new X_(s,n,r)))}return n}function nB(t,e){return t.dispatchAction||nf(e.dispatchAction,e)}function rB(t){return"center"===t||"middle"===t}var oB=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i.layoutMode={type:"box",ignoreSize:!0},i}return Sp(e,t),e.type="title",e.defaultOption={z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:0,top:0,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:"#464646"},subtextStyle:{fontSize:12,color:"#6E7079"}},e}(tC),sB=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return Sp(e,t),e.prototype.render=function(t,e,i){if(this.group.removeAll(),t.get("show")){var n=this.group,r=t.getModel("textStyle"),o=t.getModel("subtextStyle"),s=t.get("textAlign"),a=vf(t.get("textBaseline"),t.get("textVerticalAlign")),l=new Yy({style:I_(r,{text:t.get("text"),fill:r.getTextColor()},{disableBox:!0}),z2:10}),h=l.getBoundingRect(),c=t.get("subtext"),u=new Yy({style:I_(o,{text:c,fill:o.getTextColor(),y:h.height+t.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),d=t.get("link"),p=t.get("sublink"),f=t.get("triggerEvent",!0);l.silent=!d&&!f,u.silent=!p&&!f,d&&l.on("click",(function(){WA(d,"_"+t.get("target"))})),p&&u.on("click",(function(){WA(p,"_"+t.get("subtarget"))})),Ub(l).eventData=Ub(u).eventData=f?{componentType:"title",componentIndex:t.componentIndex}:null,n.add(l),c&&n.add(u);var g=n.getBoundingRect(),m=t.getBoxLayoutParams();m.width=g.width,m.height=g.height;var v=XA(m,{width:i.getWidth(),height:i.getHeight()},t.get("padding"));s||("middle"===(s=t.get("left")||t.get("right"))&&(s="center"),"right"===s?v.x+=v.width:"center"===s&&(v.x+=v.width/2)),a||("center"===(a=t.get("top")||t.get("bottom"))&&(a="middle"),"bottom"===a?v.y+=v.height:"middle"===a&&(v.y+=v.height/2),a=a||"top"),n.x=v.x,n.y=v.y,n.markRedraw();var y={align:s,verticalAlign:a};l.setStyle(y),u.setStyle(y),g=n.getBoundingRect();var b=v.margin,w=t.getItemStyle(["color","opacity"]);w.fill=t.get("backgroundColor");var x=new jy({shape:{x:g.x-b[3],y:g.y-b[0],width:g.width+b[1]+b[3],height:g.height+b[0]+b[2],r:t.get("borderRadius")},style:w,subPixelOptimize:!0,silent:!0});n.add(x)}},e.type="title",e}(cO);var aB=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i.layoutMode={type:"box",ignoreSize:!0},i}return Sp(e,t),e.prototype.init=function(t,e,i){this.mergeDefaultAndTheme(t,i),t.selected=t.selected||{},this._updateSelector(t)},e.prototype.mergeOption=function(e,i){t.prototype.mergeOption.call(this,e,i),this._updateSelector(e)},e.prototype._updateSelector=function(t){var e=t.selector,i=this.ecModel;!0===e&&(e=t.selector=["all","inverse"]),of(e)&&Zp(e,(function(t,n){af(t)&&(t={type:t}),e[n]=jp(t,function(t,e){return"all"===e?{type:"all",title:t.getLocaleModel().get(["legend","selector","all"])}:"inverse"===e?{type:"inverse",title:t.getLocaleModel().get(["legend","selector","inverse"])}:void 0}(i,t.type))}))},e.prototype.optionUpdated=function(){this._updateData(this.ecModel);var t=this._data;if(t[0]&&"single"===this.get("selectedMode")){for(var e=!1,i=0;i=0},e.prototype.getOrient=function(){return"vertical"===this.get("orient")?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},e.type="legend.plain",e.dependencies=["series"],e.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",inactiveBorderWidth:"auto",itemStyle:{color:"inherit",opacity:"inherit",borderColor:"inherit",borderWidth:"auto",borderCap:"inherit",borderJoin:"inherit",borderDashOffset:"inherit",borderMiterLimit:"inherit"},lineStyle:{width:"auto",color:"inherit",inactiveColor:"#ccc",inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:"#333"},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:"#666",borderWidth:1,borderColor:"#666"},emphasis:{selectorLabel:{show:!0,color:"#eee",backgroundColor:"#666"}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1}},e}(tC),lB=rf,hB=Zp,cB=ex,uB=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i.newlineDisabled=!1,i}return Sp(e,t),e.prototype.init=function(){this.group.add(this._contentGroup=new cB),this.group.add(this._selectorGroup=new cB),this._isFirstRender=!0},e.prototype.getContentGroup=function(){return this._contentGroup},e.prototype.getSelectorGroup=function(){return this._selectorGroup},e.prototype.render=function(t,e,i){var n=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),t.get("show",!0)){var r=t.get("align"),o=t.get("orient");r&&"auto"!==r||(r="right"===t.get("left")&&"vertical"===o?"right":"left");var s=t.get("selector",!0),a=t.get("selectorPosition",!0);!s||a&&"auto"!==a||(a="horizontal"===o?"end":"start"),this.renderInner(r,t,e,i,s,o,a);var l=t.getBoxLayoutParams(),h={width:i.getWidth(),height:i.getHeight()},c=t.get("padding"),u=XA(l,h,c),d=this.layoutInner(t,r,u,n,s,a),p=XA(qp({width:d.width,height:d.height},l),h,c);this.group.x=p.x-d.x,this.group.y=p.y-d.y,this.group.markRedraw(),this.group.add(this._backgroundEl=function(t,e){var i=BA(e.get("padding")),n=e.getItemStyle(["color","opacity"]);return n.fill=e.get("backgroundColor"),new jy({shape:{x:t.x-i[3],y:t.y-i[0],width:t.width+i[1]+i[3],height:t.height+i[0]+i[2],r:e.get("borderRadius")},style:n,silent:!0,z2:-1})}(d,t))}},e.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},e.prototype.renderInner=function(t,e,i,n,r,o,s){var a=this.getContentGroup(),l=Tf(),h=e.get("selectedMode"),c=[];i.eachRawSeries((function(t){!t.get("legendHoverLink")&&c.push(t.id)})),hB(e.getData(),(function(r,o){var s=r.get("name");if(!this.newlineDisabled&&(""===s||"\n"===s)){var u=new cB;return u.newline=!0,void a.add(u)}var d=i.getSeriesByName(s)[0];if(!l.get(s))if(d){var p=d.getData(),f=p.getVisual("legendLineStyle")||{},g=p.getVisual("legendIcon"),m=p.getVisual("style"),v=this._createItem(d,s,o,r,e,t,f,m,g,h,n);v.on("click",lB(dB,s,null,n,c)).on("mouseover",lB(fB,d.name,null,n,c)).on("mouseout",lB(gB,d.name,null,n,c)),i.ssr&&v.eachChild((function(t){var e=Ub(t);e.seriesIndex=d.seriesIndex,e.dataIndex=o,e.ssrType="legend"})),l.set(s,!0)}else i.eachRawSeries((function(a){if(!l.get(s)&&a.legendVisualProvider){var u=a.legendVisualProvider;if(!u.containName(s))return;var d=u.indexOfName(s),p=u.getItemVisual(d,"style"),f=u.getItemVisual(d,"legendIcon"),g=jm(p.fill);g&&0===g[3]&&(g[3]=.2,p=Gp(Gp({},p),{fill:Ym(g,"rgba")}));var m=this._createItem(a,s,o,r,e,t,{},p,f,h,n);m.on("click",lB(dB,null,s,n,c)).on("mouseover",lB(fB,null,s,n,c)).on("mouseout",lB(gB,null,s,n,c)),i.ssr&&m.eachChild((function(t){var e=Ub(t);e.seriesIndex=a.seriesIndex,e.dataIndex=o,e.ssrType="legend"})),l.set(s,!0)}}),this)}),this),r&&this._createSelector(r,e,n,o,s)},e.prototype._createSelector=function(t,e,i,n,r){var o=this.getSelectorGroup();hB(t,(function(t){var n=t.type,r=new Yy({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){i.dispatchAction({type:"all"===n?"legendAllSelect":"legendInverseSelect"})}});o.add(r),D_(r,{normal:e.getModel("selectorLabel"),emphasis:e.getModel(["emphasis","selectorLabel"])},{defaultText:t.title}),Tw(r)}))},e.prototype._createItem=function(t,e,i,n,r,o,s,a,l,h,c){var u=t.visualDrawType,d=r.get("itemWidth"),p=r.get("itemHeight"),f=r.isSelected(e),g=n.get("symbolRotate"),m=n.get("symbolKeepAspect"),v=n.get("icon"),y=function(t,e,i,n,r,o,s){function a(t,e){"auto"===t.lineWidth&&(t.lineWidth=e.lineWidth>0?2:0),hB(t,(function(i,n){"inherit"===t[n]&&(t[n]=e[n])}))}var l=e.getModel("itemStyle"),h=l.getItemStyle(),c=0===t.lastIndexOf("empty",0)?"fill":"stroke",u=l.getShallow("decal");h.decal=u&&"inherit"!==u?_E(u,s):n.decal,"inherit"===h.fill&&(h.fill=n[r]);"inherit"===h.stroke&&(h.stroke=n[c]);"inherit"===h.opacity&&(h.opacity=("fill"===r?n:i).opacity);a(h,n);var d=e.getModel("lineStyle"),p=d.getLineStyle();if(a(p,i),"auto"===h.fill&&(h.fill=n.fill),"auto"===h.stroke&&(h.stroke=n.fill),"auto"===p.stroke&&(p.stroke=n.fill),!o){var f=e.get("inactiveBorderWidth"),g=h[c];h.lineWidth="auto"===f?n.lineWidth>0&&g?2:0:h.lineWidth,h.fill=e.get("inactiveColor"),h.stroke=e.get("inactiveBorderColor"),p.stroke=d.get("inactiveColor"),p.lineWidth=d.get("inactiveWidth")}return{itemStyle:h,lineStyle:p}}(l=v||l||"roundRect",n,s,a,u,f,c),b=new cB,w=n.getModel("textStyle");if(!sf(t.getLegendIcon)||v&&"inherit"!==v){var x="inherit"===v&&t.getData().getVisual("symbol")?"inherit"===g?t.getData().getVisual("symbolRotate"):g:0;b.add(function(t){var e=t.icon||"roundRect",i=iM(e,0,0,t.itemWidth,t.itemHeight,t.itemStyle.fill,t.symbolKeepAspect);i.setStyle(t.itemStyle),i.rotation=(t.iconRotate||0)*Math.PI/180,i.setOrigin([t.itemWidth/2,t.itemHeight/2]),e.indexOf("empty")>-1&&(i.style.stroke=i.style.fill,i.style.fill="#fff",i.style.lineWidth=2);return i}({itemWidth:d,itemHeight:p,icon:l,iconRotate:x,itemStyle:y.itemStyle,lineStyle:y.lineStyle,symbolKeepAspect:m}))}else b.add(t.getLegendIcon({itemWidth:d,itemHeight:p,icon:l,iconRotate:g,itemStyle:y.itemStyle,lineStyle:y.lineStyle,symbolKeepAspect:m}));var _="left"===o?d+5:-5,k=o,S=r.get("formatter"),A=e;af(S)&&S?A=S.replace("{name}",null!=e?e:""):sf(S)&&(A=S(e));var C=f?w.getTextColor():n.get("inactiveColor");b.add(new Yy({style:I_(w,{text:A,x:_,y:p/2,fill:C,align:k,verticalAlign:"middle"},{inheritColor:C})}));var M=new jy({shape:b.getBoundingRect(),style:{fill:"transparent"}}),D=n.getModel("tooltip");return D.get("show")&&__({el:M,componentModel:r,itemName:e,itemTooltipOption:D.option}),b.add(M),b.eachChild((function(t){t.silent=!0})),M.silent=!h,this.getContentGroup().add(b),Tw(b),b.__legendDataIndex=i,b},e.prototype.layoutInner=function(t,e,i,n,r,o){var s=this.getContentGroup(),a=this.getSelectorGroup();YA(t.get("orient"),s,t.get("itemGap"),i.width,i.height);var l=s.getBoundingRect(),h=[-l.x,-l.y];if(a.markRedraw(),s.markRedraw(),r){YA("horizontal",a,t.get("selectorItemGap",!0));var c=a.getBoundingRect(),u=[-c.x,-c.y],d=t.get("selectorButtonGap",!0),p=t.getOrient().index,f=0===p?"width":"height",g=0===p?"height":"width",m=0===p?"y":"x";"end"===o?u[p]+=l[f]+d:h[p]+=c[f]+d,u[1-p]+=l[g]/2-c[g]/2,a.x=u[0],a.y=u[1],s.x=h[0],s.y=h[1];var v={x:0,y:0};return v[f]=l[f]+d+c[f],v[g]=Math.max(l[g],c[g]),v[m]=Math.min(0,c[m]+u[1-p]),v}return s.x=h[0],s.y=h[1],this.group.getBoundingRect()},e.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},e.type="legend.plain",e}(cO);function dB(t,e,i,n){gB(t,e,i,n),i.dispatchAction({type:"legendToggleSelect",name:null!=t?t:e}),fB(t,e,i,n)}function pB(t){for(var e,i=t.getZr().storage.getDisplayList(),n=0,r=i.length;ni[r],f=[-u.x,-u.y];e||(f[n]=l[a]);var g=[0,0],m=[-d.x,-d.y],v=vf(t.get("pageButtonGap",!0),t.get("itemGap",!0));p&&("end"===t.get("pageButtonPosition",!0)?m[n]+=i[r]-d[r]:g[n]+=d[r]+v);m[1-n]+=u[o]/2-d[o]/2,l.setPosition(f),h.setPosition(g),c.setPosition(m);var y={x:0,y:0};if(y[r]=p?i[r]:u[r],y[o]=Math.max(u[o],d[o]),y[s]=Math.min(0,d[s]+m[1-n]),h.__rectSize=i[r],p){var b={x:0,y:0};b[r]=Math.max(i[r]-d[r]-v,0),b[o]=y[o],h.setClipPath(new jy({shape:b})),h.__rectSize=b[r]}else c.eachChild((function(t){t.attr({invisible:!0,silent:!0})}));var w=this._getPageInfo(t);return null!=w.pageIndex&&Zx(l,{x:w.contentPosition[0],y:w.contentPosition[1]},p?t:null),this._updatePageInfoView(t,w),y},e.prototype._pageGo=function(t,e,i){var n=this._getPageInfo(e)[t];null!=n&&i.dispatchAction({type:"legendScroll",scrollDataIndex:n,legendId:e.id})},e.prototype._updatePageInfoView=function(t,e){var i=this._controllerGroup;Zp(["pagePrev","pageNext"],(function(n){var r=null!=e[n+"DataIndex"],o=i.childOfName(n);o&&(o.setStyle("fill",r?t.get("pageIconColor",!0):t.get("pageIconInactiveColor",!0)),o.cursor=r?"pointer":"default")}));var n=i.childOfName("pageText"),r=t.get("pageFormatter"),o=e.pageIndex,s=null!=o?o+1:0,a=e.pageCount;n&&r&&n.setStyle("text",af(r)?r.replace("{current}",null==s?"":s+"").replace("{total}",null==a?"":a+""):r({current:s,total:a}))},e.prototype._getPageInfo=function(t){var e=t.get("scrollDataIndex",!0),i=this.getContentGroup(),n=this._containerGroup.__rectSize,r=t.getOrient().index,o=_B[r],s=kB[r],a=this._findTargetItemIndex(e),l=i.children(),h=l[a],c=l.length,u=c?1:0,d={contentPosition:[i.x,i.y],pageCount:u,pageIndex:u-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!h)return d;var p=y(h);d.contentPosition[r]=-p.s;for(var f=a+1,g=p,m=p,v=null;f<=c;++f)(!(v=y(l[f]))&&m.e>g.s+n||v&&!b(v,g.s))&&(g=m.i>g.i?m:v)&&(null==d.pageNextDataIndex&&(d.pageNextDataIndex=g.i),++d.pageCount),m=v;for(f=a-1,g=p,m=p,v=null;f>=-1;--f)(v=y(l[f]))&&b(m,v.s)||!(g.i=e&&t.s<=e+n}},e.prototype._findTargetItemIndex=function(t){return this._showController?(this.getContentGroup().eachChild((function(n,r){var o=n.__legendDataIndex;null==i&&null!=o&&(i=r),o===t&&(e=r)})),null!=e?e:i):0;var e,i},e.type="legend.scroll",e}(uB);function AB(t){EP(yB),t.registerComponentModel(bB),t.registerComponentView(SB),function(t){t.registerAction("legendScroll","legendscroll",(function(t,e){var i=t.scrollDataIndex;null!=i&&e.eachComponent({mainType:"legend",subType:"scroll",query:t},(function(t){t.setScrollDataIndex(i)}))}))}(t)}var CB={value:"eq","<":"lt","<=":"lte",">":"gt",">=":"gte","=":"eq","!=":"ne","<>":"ne"},MB=function(){function t(t){var e;if(null==(this._condVal=af(t)?new RegExp(t):(e=t,"[object RegExp]"===Ep.call(e)?t:null))){_b("")}}return t.prototype.evaluate=function(t){var e=typeof t;return af(e)?this._condVal.test(t):!!hf(e)&&this._condVal.test(t+"")},t}(),DB=function(){function t(){}return t.prototype.evaluate=function(){return this.value},t}(),TB=function(){function t(){}return t.prototype.evaluate=function(){for(var t=this.children,e=0;e=s)}}for(var c=this.__startIndex;c15)break}i.prevElClipPaths&&u.restore()};if(p)if(0===p.length)a=l.__endIndex;else for(var w=d.dpr,x=0;x0&&t>n[0]){for(a=0;at);a++);s=i[n[a]]}if(n.splice(a+1,0,t),i[t]=e,!e.virtual)if(s){var l=s.dom;l.nextSibling?o.insertBefore(e.dom,l.nextSibling):o.appendChild(e.dom)}else o.firstChild?o.insertBefore(e.dom,o.firstChild):o.appendChild(e.dom);e.painter||(e.painter=this)}},t.prototype.eachLayer=function(t,e){for(var i=this._zlevelList,n=0;n0?jB:0),this._needsManuallyCompositing),h.__builtin__||Wp("ZLevel "+l+" has been used by unkown layer "+h.id),h!==o&&(h.__used=!0,h.__startIndex!==r&&(h.__dirty=!0),h.__startIndex=r,h.incremental?h.__drawIndex=-1:h.__drawIndex=r,e(r),o=h),1&a.__dirty&&!a.__inHover&&(h.__dirty=!0,h.incremental&&h.__drawIndex<0&&(h.__drawIndex=r))}e(r),this.eachBuiltinLayer((function(t,e){!t.__used&&t.getElementCount()>0&&(t.__dirty=!0,t.__startIndex=t.__endIndex=t.__drawIndex=0),t.__dirty&&t.__drawIndex<0&&(t.__drawIndex=t.__startIndex)}))},t.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},t.prototype._clearLayer=function(t){t.clear()},t.prototype.setBackgroundColor=function(t){this._backgroundColor=t,Zp(this._layers,(function(t){t.setUnpainted()}))},t.prototype.configLayer=function(t,e){if(e){var i=this._layerConfig;i[t]?jp(i[t],e,!0):i[t]=e;for(var n=0;n=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s};EP([function(t){t.registerPainter("canvas",GB)},function(t){t.registerChartView(kD),t.registerSeriesModel(hD),t.registerLayout(t.PRIORITY.VISUAL.LAYOUT,rf(oD,"bar")),t.registerLayout(t.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,function(t){return{seriesType:t,plan:MM(),reset:function(t){if(sD(t)){var e=t.getData(),i=t.coordinateSystem,n=i.getBaseAxis(),r=i.getOtherAxis(n),o=e.getDimensionIndex(e.mapDimension(r.dim)),s=e.getDimensionIndex(e.mapDimension(n.dim)),a=t.get("showBackground",!0),l=e.mapDimension(r.dim),h=e.getCalculationInfo("stackResultDimension"),c=BS(e,l)&&!!e.getCalculationInfo("stackedOnSeries"),u=r.isHorizontal(),d=function(t,e){var i=e.model.get("startValue");return i||(i=0),e.toGlobalCoord(e.dataToCoord("log"===e.type?i>0?i:1:i))}(0,r),p=aD(t),f=t.get("barMinHeight")||0,g=h&&e.getDimensionIndex(h),m=e.getLayout("size"),v=e.getLayout("offset");return{progress:function(t,e){for(var n,r=t.count,l=p&&yM(3*r),h=p&&a&&yM(3*r),y=p&&yM(r),b=i.master.getRect(),w=u?b.width:b.height,x=e.getStore(),_=0;null!=(n=t.next());){var k=x.get(c?g:o,n),S=x.get(s,n),A=d,C=void 0;c&&(C=+k-x.get(o,n));var M=void 0,D=void 0,T=void 0,I=void 0;if(u){var O=i.dataToPoint([k,S]);c&&(A=i.dataToPoint([C,S])[0]),M=A,D=O[1]+v,T=O[0]-A,I=m,Math.abs(T)`}renderTable(){const t=this.data?.layers?.[0]?.result?.[0],e=t?{columns:Object.keys(t).map((t=>({name:t})))}:void 0;return Pu`
+ +
`}initializeChart(){this.chartDiv&&(this.chartInstance&&this.chartInstance.dispose(),this.chartInstance=bP(this.chartDiv,void 0,{renderer:"canvas"}),this.chartInstance.setOption(this.getChartOptions()))}labelFormatter(t){return"string"!=typeof t?String(t):t.length>16?t.substring(0,13).trim()+"...":t}getChartOptions(){const t=this.getColorValues(),e=(this.data?.layers?.[0]?.result??[]).map((t=>this.columns.reduce(((e,i)=>(e[i]=t[i],e)),{}))),i=(this.chartHeight??0)>150,n="dark"===this.theme?"#FFFFFF08":"#00000010",r="dark"===this.theme?"#FFFFFF15":"#00000020",o=!(!this.columns[0]||!e.some((t=>KB(t[this.columns[0]])))),s=!(!this.columns[1]||!e.some((t=>KB(t[this.columns[1]]))));if("radar"===this.type)return{radar:{shape:"polygon",indicator:this.columns.map((t=>({name:t})))},series:this.columns.map(((i,n)=>({type:"radar",data:[{value:e.map((t=>Number(t[i]))),name:i,itemStyle:{color:this.yAxisColors?.[i]||t[n%t.length]}}]}))),tooltip:{trigger:"item",borderColor:n}};const a={dataset:{dimensions:this.columns,source:e},tooltip:{trigger:"scatter"===this.type?"item":"axis",borderColor:n},legend:{show:!this.omitLegend&&i,data:this.columns.slice(1),textStyle:{color:this.getTextColor()},top:8,orient:"horizontal",type:"scroll"},grid:{left:"0",right:"6",bottom:this.xAxisLabel&&i?"23":"0",top:this.yAxisLabel&&i?"26":"8",containLabel:!0},xAxis:{show:!this.hideXAxisLabel,type:"bar"===this.type?"value":o?"time":"category",name:i?this.xAxisLabel:"",nameLocation:"middle",nameGap:30,nameTextStyle:{color:this.getTextColor()},axisLine:{show:!1,lineStyle:{color:r}},axisLabel:{formatter:o?void 0:this.labelFormatter,color:this.getTextColor(),hideOverlap:!0,rotate:this.xAxisLabelDisplay,align:"center"},splitLine:{show:!1,lineStyle:{color:n}},min:this.minX,max:this.maxX},yAxis:{type:"bar"===this.type?o?"time":"category":s?"time":"value",name:i?this.yAxisLabel:"",show:"hidden"!==this.yAxisLabelDisplay,position:"hidden"!==this.yAxisLabelDisplay&&this.yAxisLabelDisplay||void 0,nameTextStyle:{color:this.getTextColor(),align:"left",padding:[0,0,0,0]},axisLine:{show:!1,lineStyle:{color:r}},axisLabel:{formatter:o?void 0:this.labelFormatter,color:this.getTextColor(),align:"right",inside:!1},axisTick:{inside:!1},splitLine:{show:!0,lineStyle:{color:n}},min:this.minY,max:this.maxY}};return this.addSeries(a)}getColorValues(){const t=this.colorTheme??"mercury",e=bp[t];if(!e)throw new Error(`Theme "${t}" does not exist`);return e.colors[this.theme]}applyTheme(){this.chartInstance&&(this.chartInstance.dispose(),this.initializeChart())}updateChartData(){const t=this.apiKey;t&&this.chartId&&JB.getChartData(t,this.chartId).then((async({response:t})=>{t.layers=t.params?.layers??[],t.layers[0].result=t.result?.items;const e=t.params?.options;this.type=t.type,this.data=t,this.keyX=e?.xAxisKey,this.xAxisLabel=e?.xAxisLabel??"",this.yAxisLabel=e?.yAxisLabel??"",this.hideXAxisLabel=!!e?.xAxisLabelHidden,this.yAxisLabelDisplay=e?.yAxisLabelHidden?"hidden":this.yAxisLabelDisplay,this.colorTheme=e?.theme,this.yAxisColors=e?.yAxisKeyColors,t.result?.items&&t.result.items.length>0&&(this.columns=Object.keys(t.result?.items?.[0])),this.initializeChart()}))}updateDataOptions(){this.type=this.data?.layers?.[0]?.type}setupResizeObserver(){this.resizeObserver=new ResizeObserver((t=>{for(const e of t)if(e.target===this.chartDiv){const{width:t,height:i}=e.contentRect;this.chartWidth=t,this.chartHeight=i,this.chartInstance&&(this.chartInstance.resize(),this.chartInstance.setOption(this.getChartOptions()))}})),this.chartDiv&&this.resizeObserver.observe(this.chartDiv)}transformResult(t){return{id:Math.random(),values:t,originalValues:t,isNew:!1,isDeleted:!1}}getTextColor(){return this.data?.options?.foreground??("dark"===this.theme?"#FFFFFF":"#000000")}addSeries(t){const e={...t};switch(this.type){case"column":e.series=this.constructSeries("bar",{animationDelay:t=>.8*t});break;case"line":e.series=this.constructSeries("line",{showSymbol:!1,animationDuration:1e3,animationEasing:"cubicOut"});break;case"scatter":e.series=this.constructSeries("scatter",{symbolSize:8,itemStyle:{borderWidth:2,borderColor:this.getTextColor(),color:"transparent"}});break;case"area":e.series=this.constructSeries("line",{areaStyle:{},smooth:!0});break;case"bar":e.series=this.constructSeries("bar",{animationDelay:t=>.8*t,barWidth:"40%",coordinateSystem:"cartesian2d"}),e.xAxis={...e.xAxis,splitLine:{...e.xAxis.splitLine,show:!0}};break;case"funnel":e.series=this.constructSeries("funnel",{left:"10%",top:26,bottom:0,width:"80%",minSize:"0%",maxSize:"100%",sort:"descending",label:{show:!0,position:"inside",formatter:"{b}: {c}",color:"#fff"},gap:2,itemStyle:{borderColor:"rgba(0, 0, 0, 0.2)",borderWidth:1},data:this.data?.layers?.[0]?.result?.map((t=>({name:t[this.columns[0]],value:t[this.columns[1]]}))),color:this.getColorValues()});break;case"pie":e.series=this.constructSeries("pie",{data:this.data?.layers?.[0]?.result?.map((t=>({name:t[this.columns[0]],value:t[this.columns[1]]})))??[],radius:["40%","70%"],center:["50%","50%"],avoidLabelOverlap:!0,itemStyle:{borderRadius:10,borderColor:"rgba(0, 0, 0, 0.2)",borderWidth:2},label:{show:!0!==this.data?.options?.xAxisLabelHidden,formatter:"{b}: {c} ({d}%)",color:"dark"===this.theme?"#fff":"#000",textBorderColor:"transparent"},color:this.getColorValues(),tooltip:{trigger:"item",borderColor:"dark"===this.theme?"#FFFFFF08":"#00000010"}})}return e}constructSeries(t,e={}){return this.columns.slice(1).map((i=>{const n={name:i,type:t,encode:"bar"===this.type?{x:i,y:this.columns[0]}:{x:this.columns[0],y:i},itemStyle:{color:this.yAxisColors?.[i]},symbol:"circle",...e};if(this.isValidSeriesOption(n))return n;throw new Error(`The series option is invalid for series type "${t}".`)}))}isValidSeriesOption(t){return t&&"object"==typeof t&&"string"==typeof t.name&&"string"==typeof t.type}renderAsText(){let t=this.data?.options?.text??"";return t=t.replace(/\*\*(.*?)\*\*/g,"$1"),t=t.replace(/__(.*?)__/g,"$1"),t=t.replace(/\*(.*?)\*/g,"$1"),t=t.replace(/_(.*?)_/g,"$1"),t=t.replace(/~~(.*?)~~/g,"$1"),t=t.replace(/ \n/g,"
"),Pu`
+ ${YB(t)} +
`}renderAsSingleValue(){const t=this.data?.layers?.[0]?.result?.[0];let e=t?t[this.keyX??""]:"";const i=this.data?.options?.format;if("percent"===i){e=`${parseFloat(`${e}`).toFixed(2)}%`}else if("number"===i){const t=parseFloat(`${e}`);e=`${Math.round(t).toLocaleString("en-US")}`}else if("decimal"===i){e=`${parseFloat(`${e}`).toFixed(2)}`}else if("date"===i){const t=new Date(`${e}`);if(!isNaN(t.getTime())){const i=t.getUTCFullYear();e=`${String(t.getUTCMonth()+1).padStart(2,"0")}/${String(t.getUTCDate()).padStart(2,"0")}/${i}`}}else if("time"===i){e=new Date(`${e}`).toLocaleTimeString("en-US")}else if("dollar"===i){e=`$${parseFloat(`${e}`).toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}else if("euro"===i){e=`€${parseFloat(`${e}`).toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}else if("pound"===i){e=`£${parseFloat(`${e}`).toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}else if("yen"===i){e=`¥${parseFloat(`${e}`).toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:0})}`}let n=1===this.sizeX&&1===this.sizeY?"font-size: 30px; line-height: 36px;":"font-size: 60px; line-height: 68px;";const r=this.data?.options?.foreground;return r&&(n+=` color: ${r};`),Pu`
+
${e}
+
`}};tz.styles=[..._p.styles,Xc` + * { + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + } + + .fade { + opacity: 0; + + @media (prefers-reduced-motion) { + opacity: 1; + animation: none; + } + } + + .gridDots { + background-image: radial-gradient(RGBA(255, 255, 255, 0.2) 1px, transparent 0); + background-size: 24px 24px; + background-position: 0px 0px; + } + + @keyframes fadeIn { + from { + opacity: 0; + } + to { + opacity: 0.5; + } + } + + @keyframes drawLine { + from { + opacity: 0; + stroke-dashoffset: 3600; + } + to { + opacity: 1; + stroke-dashoffset: 0; + } + } + + figure { + div { + span { + svg { + border-radius: 24px; + width: 20px; + overflow: hidden; + } + } + } + } + + g[aria-label='tip'] { + g { + path { + filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.05)); + } + } + } + + svg { + font-size: 12px; + + g[aria-label='line'] { + opacity: 0; + transition-property: stroke-width; + transition: 0.3s ease; + animation: 1.5s ease-out 0s drawLine forwards; + } + + [aria-label='y-axis tick label'], + [aria-label='y-axis tick'], + [aria-label='x-axis tick label'], + [aria-label='x-axis tick'] { + transition: 0.5s ease; + } + + g[aria-label='crosshair rule'] { + stroke-opacity: 0.3; + } + + &:hover { + [aria-label='area'] { + opacity: 0.5; + } + + [aria-label='y-axis tick label'], + [aria-label='y-axis tick'], + [aria-label='x-axis tick label'], + [aria-label='x-axis tick'] { + opacity: 0.5; + } + } + + [aria-label='line']:hover { + stroke-width: 4; + } + } + + @keyframes scaleIn { + from { + opacity: 0; + transform: scaleY(0.6) translateY(-20px); + } + to { + opacity: 1; + transform: scaleY(1) translateY(0px); + } + } + + .barY { + g[aria-label='bar'] { + rect { + transform-origin: bottom; + transform: scaleY(0.6) translateY(-20px); + opacity: 0; + animation: scaleIn 0.4s cubic-bezier(0.5, 0, 0, 1.1) forwards; + } + } + } + `],QB([nd({type:String,attribute:"api-key"})],tz.prototype,"apiKey",void 0),QB([nd({type:String,attribute:"chart-id"})],tz.prototype,"chartId",void 0),QB([nd({type:Object})],tz.prototype,"data",void 0),QB([nd({type:String})],tz.prototype,"type",void 0),QB([nd({type:String,attribute:"key-x"})],tz.prototype,"keyX",void 0),QB([nd({type:String,attribute:"key-y"})],tz.prototype,"keyY",void 0),QB([nd({type:String,attribute:"sort-order"})],tz.prototype,"sortOrder",void 0),QB([nd({type:String,attribute:"group-by"})],tz.prototype,"groupBy",void 0),QB([nd({type:Array})],tz.prototype,"columns",void 0),QB([nd({type:String})],tz.prototype,"title",void 0),QB([nd({type:String})],tz.prototype,"xAxisLabel",void 0),QB([nd({type:String})],tz.prototype,"yAxisLabel",void 0),QB([nd({type:Number})],tz.prototype,"xAxisLabelDisplay",void 0),QB([nd({type:String,attribute:"y-axis-label-display"})],tz.prototype,"yAxisLabelDisplay",void 0),QB([nd({type:Boolean,attribute:"hide-x-axis-label"})],tz.prototype,"hideXAxisLabel",void 0),QB([nd({type:String,attribute:"color-theme"})],tz.prototype,"colorTheme",void 0),QB([nd({type:Object,attribute:"y-axis-colors"})],tz.prototype,"yAxisColors",void 0),QB([nd({type:Boolean,attribute:"omit-legend"})],tz.prototype,"omitLegend",void 0),QB([nd({type:Number})],tz.prototype,"sizeX",void 0),QB([nd({type:Number})],tz.prototype,"sizeY",void 0),QB([nd({type:Number})],tz.prototype,"chartWidth",void 0),QB([nd({type:Number})],tz.prototype,"chartHeight",void 0),QB([nd({type:Number,attribute:"min-y"})],tz.prototype,"minY",void 0),QB([nd({type:Number,attribute:"max-y"})],tz.prototype,"maxY",void 0),QB([nd({type:Number,attribute:"min-x"})],tz.prototype,"minX",void 0),QB([nd({type:Number,attribute:"max-x"})],tz.prototype,"maxX",void 0),QB([od("#chart")],tz.prototype,"chartDiv",void 0),tz=JB=QB([td("astra-chart")],tz);var ez=tz; +/** + * @license + * Copyright 2018 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const iz=fd(class extends gd{constructor(t){if(super(t),t.type!==dd||"class"!==t.name||t.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((e=>t[e])).join(" ")+" "}update(t,[e]){if(void 0===this.st){this.st=new Set,void 0!==t.strings&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in e)e[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(e)}const i=t.element.classList;for(const t of this.st)t in e||(i.remove(t),this.st.delete(t));for(const t in e){const n=!!e[t];n===this.st.has(t)||this.nt?.has(t)||(n?(i.add(t),this.st.add(t)):(i.remove(t),this.st.delete(t)))}return Ru}});var nz=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s};let rz=class extends ez{constructor(){super(...arguments),this.showHighlights=!0}updated(t){if(super.updated(t),t.has("backgroundColor")||t.has("textColor")){const t=this.renderRoot.querySelector("#composed-chart");t&&(this.backgroundColor?t.style.setProperty("background-color",this.backgroundColor,"important"):t.style.removeProperty("background-color"),this.textColor?t.style.setProperty("color",this.textColor,"important"):t.style.removeProperty("color"))}}render(){const t=Pu` + + `,e=this.data?.layers?.[0];let i=0,n=0,r=0;if(e&&e?.result&&(e?.result?.forEach((t=>{const e=t[this.data?.options?.yAxisKeys?.[0]??""],n=Number(e??0);i+=n})),n=i/(e?.result?.length??0)),e&&e?.result){const t=Number(e?.result?.[0]?.[this.data?.options?.yAxisKeys?.[0]??""]??0),i=Number(e?.result?.[e?.result?.length-1]?.[this.data?.options?.yAxisKeys?.[0]??""]??0);r=(i-t)/t*100,r=Math.round(100*r)/100}const o=this.data?.highlights?.slice(0,1===this.sizeY&&4!==this.sizeX?2:4);let s=null;if(this.showHighlights&&o?.length){const t=1===this.sizeX||2===this.sizeX?"grid grid-cols-2 gap-8 w-full "+("single_value"===e?.type?"":"mb-2 mt-4"):"flex w-full items-center justify-between gap-8 "+("single_value"===e?.type?"":"mb-2 mt-4"),a=1===this.sizeX||2===this.sizeX?"grid-template: auto / auto auto;":"";s=Pu` +
+ ${o?.map((t=>Pu` +
+
+ ${t.replace("_"," ")} +
+ ${"total"===t?Pu`
+ ${i.toLocaleString("en",{useGrouping:!0})} +
`:null} + ${"average"===t?Pu`
+ ${n.toFixed(2)} +
`:null} + ${"percent_change"===t?Pu`
+ ${isNaN(r)?0:r}% +
`:null} +
+ `))} +
+ `}const a=(void 0===e?.result||0===e?.result?.length)&&"text"!==e?.type,l=a?null:super.render(),h=Pu`
+ ${a?Pu` + + + + + + + + + + `:Pu`${l}`} +
`;return Pu` +
+
+ ${"single_value"===e?.type?Pu`${t} ${h}`:Pu`
${t} ${s}
+ ${h}`} +
+
+ `}};rz.styles=[..._p.styles,Xc` + .space-mono-regular { + font-family: 'Space Mono', monospace; + font-weight: 400; + font-style: normal; + } + `],nz([nd({type:String})],rz.prototype,"header",void 0),nz([nd({type:String})],rz.prototype,"subheader",void 0),nz([nd({type:Boolean})],rz.prototype,"showHighlights",void 0),nz([nd({type:Number})],rz.prototype,"sizeX",void 0),nz([nd({type:Number})],rz.prototype,"sizeY",void 0),nz([nd({type:String})],rz.prototype,"backgroundColor",void 0),nz([nd({type:String})],rz.prototype,"textColor",void 0),rz=nz([td("astra-composed-chart")],rz);var oz=rz,sz=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s};let az=class extends Ju{constructor(){super(...arguments),this.placeholder="",this.value=""}onInput(t){this.value=t.target.value}render(){const t=this.label?Pu``:void 0;return Pu` +
+ + + ${t} + + + +
+ `}};az.styles=[Pd,Xc` + :host { + display: block; + } + + div { + display: flex; + gap: 8px; + border: 1px solid var(--astra-neutral-200); + border-radius: 6px; + overflow: hidden; // preserves border-radius from un-rounded children + align-items: center; + font-family: var(--astra-font-family); + } + + div:focus-within { + outline: 1px solid var(--astra-accent, lime); + outline-offset: -1px; // 0px draws it _outside_ of the border, where as this covers the border + } + + input { + flex: 1; + padding: 10px 12px; + color: var(--astra-neutral-900); + background: var(--astra-neutral-100); + border: none; + font-family: var(--astra-font-family); + font-size: 14px; + line-height: 20px; + } + + /* Removed outline:none; to preserve default focus indication */ + input::placeholder { + color: var(--astra-neutral-500); + opacity: 1; /* Firefox */ + } + + ::-ms-input-placeholder { + color: var(--astra-neutral-500); + } + + label { + position: absolute; + clip: rect(1px, 1px, 1px, 1px); + clip-path: inset(50%); + height: 1px; + width: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + border: 0; + } + + @media (prefers-color-scheme: dark) { + div { + border: 1px solid var(--astra-neutral-800); + } + + input { + color: var(--astra-neutral-100); + background: var(--astra-neutral-900); + } + } + `],sz([nd({type:String})],az.prototype,"placeholder",void 0),sz([nd({type:String})],az.prototype,"value",void 0),sz([nd({type:String})],az.prototype,"label",void 0),az=sz([td("astra-input")],az);var lz=az; +/** + * @license + * Copyright 2018 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const hz="important",cz=" !"+hz,uz=fd(class extends gd{constructor(t){if(super(t),t.type!==dd||"style"!==t.name||t.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce(((e,i)=>{const n=t[i];return null==n?e:e+`${i=i.includes("-")?i:i.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${n};`}),"")}update(t,[e]){const{style:i}=t.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(e)),this.render(e);for(const t of this.ft)null==e[t]&&(this.ft.delete(t),t.includes("-")?i.removeProperty(t):i[t]=null);for(const t in e){const n=e[t];if(null!=n){this.ft.add(t);const e="string"==typeof n&&n.endsWith(cz);t.includes("-")||e?i.setProperty(t,e?n.slice(0,-11):n,e?hz:""):i[t]=n}}return Ru}});var dz="object"==typeof global&&global&&global.Object===Object&&global,pz="object"==typeof self&&self&&self.Object===Object&&self,fz=dz||pz||Function("return this")(),gz=fz.Symbol,mz=Object.prototype,vz=mz.hasOwnProperty,yz=mz.toString,bz=gz?gz.toStringTag:void 0;var wz=Object.prototype.toString;var xz=gz?gz.toStringTag:void 0;function _z(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":xz&&xz in Object(t)?function(t){var e=vz.call(t,bz),i=t[bz];try{t[bz]=void 0;var n=!0}catch(t){}var r=yz.call(t);return n&&(e?t[bz]=i:delete t[bz]),r}(t):function(t){return wz.call(t)}(t)}function kz(t){return null!=t&&"object"==typeof t}var Sz=Array.isArray,Az=/\s/;var Cz=/^\s+/;function Mz(t){return t?t.slice(0,function(t){for(var e=t.length;e--&&Az.test(t.charAt(e)););return e}(t)+1).replace(Cz,""):t}function Dz(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}var Tz=/^[-+]0x[0-9a-f]+$/i,Iz=/^0b[01]+$/i,Oz=/^0o[0-7]+$/i,Ez=parseInt;function Pz(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||kz(t)&&"[object Symbol]"==_z(t)}(t))return NaN;if(Dz(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Dz(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Mz(t);var i=Iz.test(t);return i||Oz.test(t)?Ez(t.slice(2),i?2:8):Tz.test(t)?NaN:+t}function Lz(t){if(!Dz(t))return!1;var e=_z(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}var Rz,Nz=fz["__core-js_shared__"],Bz=(Rz=/[^.]+$/.exec(Nz&&Nz.keys&&Nz.keys.IE_PROTO||""))?"Symbol(src)_1."+Rz:"";var zz=Function.prototype.toString;function $z(t){if(null!=t){try{return zz.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var Fz=/^\[object .+?Constructor\]$/,Vz=Function.prototype,Hz=Object.prototype,Wz=Vz.toString,Uz=Hz.hasOwnProperty,jz=RegExp("^"+Wz.call(Uz).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Gz(t){return!(!Dz(t)||(e=t,Bz&&Bz in e))&&(Lz(t)?jz:Fz).test($z(t));var e}function qz(t,e){var i=function(t,e){return null==t?void 0:t[e]}(t,e);return Gz(i)?i:void 0}var Yz=qz(fz,"WeakMap"),Xz=/^(?:0|[1-9]\d*)$/;function Kz(t,e){var i=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==i||"symbol"!=i&&Xz.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=9007199254740991}var Qz=Object.prototype;function t$(t){return kz(t)&&"[object Arguments]"==_z(t)}var e$=Object.prototype,i$=e$.hasOwnProperty,n$=e$.propertyIsEnumerable,r$=t$(function(){return arguments}())?t$:function(t){return kz(t)&&i$.call(t,"callee")&&!n$.call(t,"callee")};var o$="object"==typeof t&&t&&!t.nodeType&&t,s$=o$&&"object"==typeof module&&module&&!module.nodeType&&module,a$=s$&&s$.exports===o$?fz.Buffer:void 0,l$=(a$?a$.isBuffer:void 0)||function(){return!1},h$={};h$["[object Float32Array]"]=h$["[object Float64Array]"]=h$["[object Int8Array]"]=h$["[object Int16Array]"]=h$["[object Int32Array]"]=h$["[object Uint8Array]"]=h$["[object Uint8ClampedArray]"]=h$["[object Uint16Array]"]=h$["[object Uint32Array]"]=!0,h$["[object Arguments]"]=h$["[object Array]"]=h$["[object ArrayBuffer]"]=h$["[object Boolean]"]=h$["[object DataView]"]=h$["[object Date]"]=h$["[object Error]"]=h$["[object Function]"]=h$["[object Map]"]=h$["[object Number]"]=h$["[object Object]"]=h$["[object RegExp]"]=h$["[object Set]"]=h$["[object String]"]=h$["[object WeakMap]"]=!1;var c$,u$="object"==typeof t&&t&&!t.nodeType&&t,d$=u$&&"object"==typeof module&&module&&!module.nodeType&&module,p$=d$&&d$.exports===u$&&dz.process,f$=function(){try{var t=d$&&d$.require&&d$.require("util").types;return t||p$&&p$.binding&&p$.binding("util")}catch(t){}}(),g$=f$&&f$.isTypedArray,m$=g$?(c$=g$,function(t){return c$(t)}):function(t){return kz(t)&&Jz(t.length)&&!!h$[_z(t)]},v$=Object.prototype.hasOwnProperty;function y$(t,e){var i=Sz(t),n=!i&&r$(t),r=!i&&!n&&l$(t),o=!i&&!n&&!r&&m$(t),s=i||n||r||o,a=s?function(t,e){for(var i=-1,n=Array(t);++i-1},T$.prototype.set=function(t,e){var i=this.__data__,n=M$(i,t);return n<0?(++this.size,i.push([t,e])):i[n][1]=e,this};var I$=qz(fz,"Map");function O$(t,e){var i,n,r=t.__data__;return("string"==(n=typeof(i=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==i:null===i)?r["string"==typeof e?"string":"hash"]:r.map}function E$(t){var e=-1,i=null==t?0:t.length;for(this.clear();++ea))return!1;var h=o.get(t),c=o.get(e);if(h&&c)return h==e&&c==t;var u=-1,d=!0,p=2&i?new Q$:void 0;for(o.set(t,e),o.set(e,t);++u=e||i<0||u&&t-h>=o}function g(){var t=pF();if(f(t))return m(t);a=setTimeout(g,function(t){var i=e-(t-l);return u?gF(i,o-(t-h)):i}(t))}function m(t){return a=void 0,d&&n?p(t):(n=r=void 0,s)}function v(){var t=pF(),i=f(t);if(n=arguments,r=this,l=t,i){if(void 0===a)return function(t){return h=t,a=setTimeout(g,e),c?p(t):s}(l);if(u)return clearTimeout(a),a=setTimeout(g,e),p(l)}return void 0===a&&(a=setTimeout(g,e)),s}return e=Pz(e)||0,Dz(i)&&(c=!!i.leading,o=(u="maxWait"in i)?fF(Pz(i.maxWait)||0,e):o,d="trailing"in i?!!i.trailing:d),v.cancel=function(){void 0!==a&&clearTimeout(a),h=0,n=l=r=a=void 0},v.flush=function(){return void 0===a?s:m(pF())},v}function vF(t,e){return dF(t,e)}var yF=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s};let bF=class extends _p{constructor(){super(),this.thresholdX=0,this.thresholdY=0,this.scroller=kd(),this.rightScrollZone=kd(),this.rightScrollHandle=kd(),this.bottomScrollZone=kd(),this.bottomScrollHandle=kd(),this.hasHoveringCursor=!1,this.axis=Ud.both,this.isDragging=!1,this.verticalScrollPosition=0,this.horizontalScrollPosition=0,this.verticalScrollSize=0,this.horizontalScrollSize=0,this.horizontalScrollProgress=0,this.verticalScrollProgress=0,this.startX=0,this.startY=0,this.scrollStartX=0,this.scrollStartY=0,this._onScroll=this._onScroll?mF(this._onScroll,10).bind(this):this._onScroll.bind(this),this.updateScrollerSizeAndPosition=this.updateScrollerSizeAndPosition.bind(this),this.onWheelVerticalScroller=this.onWheelVerticalScroller.bind(this),this.onWheelHorizontalScroller=this.onWheelHorizontalScroller.bind(this),this.onHorizontalScrollerHandleMouseDown=this.onHorizontalScrollerHandleMouseDown.bind(this),this.onVerticalScrollerHandleMouseDown=this.onVerticalScrollerHandleMouseDown.bind(this)}updateScrollerSizeAndPosition(t){if([Ud.both,Ud.vertical].includes(this.axis)){const t=this.scroller.value?.scrollTop??0,e=this.scroller.value?.scrollHeight??0,i=(this.scroller.value?.clientHeight??0)/e;this.verticalScrollSize=1===i?0:(this.scroller.value?.clientHeight??0)*i,this.verticalScrollProgress=t/e,this.verticalScrollPosition=this.verticalScrollProgress*(this.scroller.value?.clientHeight??0)}if([Ud.both,Ud.horizontal].includes(this.axis)){const t=this.scroller.value?.scrollWidth??0,e=this.scroller.value?.scrollLeft??0,i=(this.scroller.value?.clientWidth??0)/t,n=1===i?0:(this.scroller.value?.clientWidth??0)*i;this.horizontalScrollProgress=e/t,this.horizontalScrollSize=n,this.horizontalScrollPosition=this.horizontalScrollProgress*(this.scroller.value?.clientWidth??0)}}_onScroll(t){const e=this.previousScrollPositionY??0,i=this.previousScrollPositionX??0,n=this.scroller.value?.scrollTop??0,r=this.scroller.value?.scrollLeft??0,o=Math.abs(e-n),s=Math.abs(i-r);(o>this.thresholdY||s>this.thresholdX)&&(this.previousScrollPositionY=n,this.previousScrollPositionX=r,"function"==typeof this.onScroll&&this._debouncedOnScrollCallback?.())}onClickVerticalScroller(t){if(this.scroller.value){const e=(t.clientY-this.getBoundingClientRect().top)/this.scroller.value.clientHeight;this.scroller.value.scrollTop=e*(this.scroller.value.scrollHeight??0)-this.verticalScrollSize}}onClickHorizontalScroller(t){if(this.scroller.value){const e=(t.clientX-this.getBoundingClientRect().left)/this.scroller.value.clientWidth;this.scroller.value.scrollLeft=e*(this.scroller.value.scrollWidth??0)-this.horizontalScrollSize}}onWheelHorizontalScroller(t){this.scroller.value&&(this.scroller.value.scrollLeft+=t.deltaX)}onWheelVerticalScroller(t){this.scroller.value&&(this.scroller.value.scrollTop+=t.deltaY)}onHorizontalScrollerHandleMouseDown(t){t.preventDefault(),this.startX=t.pageX,this.scrollStartX=this.scroller.value?.scrollLeft??0;const e=t=>{const e=t.pageX-this.startX,i=this.scroller.value?.scrollWidth??0,n=(this.scroller.value?.clientWidth??0)/i;this.scroller.value&&(this.scroller.value.scrollLeft=this.scrollStartX+e/n)},i=t=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",i)};document.addEventListener("mouseup",i),document.addEventListener("mousemove",e)}preventDefault(t){t.preventDefault()}onVerticalScrollerHandleMouseDown(t){t.preventDefault(),this.startY=t.pageY,this.scrollStartY=this.scroller.value?.scrollTop??0;const e=t=>{t.preventDefault();const e=t.pageY-this.startY,i=this.scroller.value?.scrollHeight??0,n=(this.scroller.value?.clientHeight??0)/i;this.scroller.value&&(this.scroller.value.scrollTop=this.scrollStartY+e/n)},i=t=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",i)};document.addEventListener("mouseup",i),document.addEventListener("mousemove",e)}connectedCallback(){super.connectedCallback(),setTimeout((()=>{this.scroller.value?.addEventListener("scroll",this.updateScrollerSizeAndPosition,{passive:!0}),this.scroller.value?.addEventListener("scroll",this._onScroll,{passive:!0}),this.scroller.value?.addEventListener("scrollend",this._onScroll,{passive:!0}),this.rightScrollZone.value?.addEventListener("wheel",this.onWheelVerticalScroller,{passive:!0}),this.bottomScrollZone.value?.addEventListener("wheel",this.onWheelHorizontalScroller,{passive:!0}),this.bottomScrollHandle.value?.addEventListener("mousedown",this.onHorizontalScrollerHandleMouseDown),this.rightScrollHandle.value?.addEventListener("mousedown",this.onVerticalScrollerHandleMouseDown),this.rightScrollZone.value?.addEventListener("contextmenu",this.preventDefault),this.bottomScrollZone.value?.addEventListener("contextmenu",this.preventDefault),this.bottomScrollHandle.value?.addEventListener("contextmenu",this.preventDefault),this.rightScrollHandle.value?.addEventListener("contextmenu",this.preventDefault)}),0)}disconnectedCallback(){super.disconnectedCallback(),this.scroller.value?.removeEventListener("scroll",this.updateScrollerSizeAndPosition),this.scroller.value?.removeEventListener("scroll",this._onScroll),this.scroller.value?.removeEventListener("scrollend",this._onScroll),this.rightScrollZone.value?.removeEventListener("wheel",this.onWheelVerticalScroller),this.bottomScrollZone.value?.removeEventListener("wheel",this.onWheelHorizontalScroller),this.bottomScrollHandle.value?.removeEventListener("mousedown",this.onHorizontalScrollerHandleMouseDown),this.rightScrollHandle.value?.removeEventListener("mousedown",this.onVerticalScrollerHandleMouseDown),this.rightScrollZone.value?.removeEventListener("contextmenu",this.preventDefault),this.bottomScrollZone.value?.removeEventListener("contextmenu",this.preventDefault),this.bottomScrollHandle.value?.removeEventListener("contextmenu",this.preventDefault),this.rightScrollHandle.value?.removeEventListener("contextmenu",this.preventDefault)}willUpdate(t){super.willUpdate(t),t.has("theme")&&this.requestUpdate("class"),t.has("hasHoveringCursor")&&this.hasHoveringCursor&&this.updateScrollerSizeAndPosition(),t.has("onScroll")&&"function"==typeof this.onScroll&&(this._debouncedOnScrollCallback=mF(this.onScroll,10))}render(){const t="w-full rounded-md bg-neutral-200/60 dark:bg-neutral-700/50 hover:bg-neutral-300 dark:hover:bg-neutral-700 active:bg-neutral-300 dark:active:bg-neutral-700",e="z-50 absolute right-0 bottom-0 m-0.5 transition-opacity duration-300 "+(this.hasHoveringCursor?"opacity-100":"opacity-0"),i={transform:`translateY(${this.verticalScrollPosition}px)`,height:`${this.verticalScrollSize}px`},n={transform:`translateX(${this.horizontalScrollPosition}px)`,width:`${this.horizontalScrollSize}px`};let r="absolute bottom-0 left-0 right-0 top-0 bg-theme-table dark:bg-theme-table-dark h-fit";return this.axis===Ud.both&&(r+=" overflow-scroll"),this.axis===Ud.horizontal&&(r+=" overflow-scroll"),this.axis===Ud.vertical&&(r+=" overflow-y-scroll overflow-x-hidden"),Pu` +
{this.pendingMouseLeave=setTimeout((()=>{this.hasHoveringCursor=!1,delete this.pendingMouseLeave}),1e3)}} + @mouseenter=${()=>{this.hasHoveringCursor=!0,clearTimeout(this.pendingMouseLeave),delete this.pendingMouseLeave}} + class=${iz({dark:"dark"===this.theme})} + > +
+
+
+ +
+
+
+ +
+ +
+
`}};bF.styles=[..._p.styles,Xc` + /* Hide scrollbar for Chrome, Safari and Opera */ + ::-webkit-scrollbar { + display: none; /* for Chrome, Safari, and Opera */ + } + + /* Hide scrollbar for IE, Edge, and Firefox */ + :host { + -ms-overflow-style: none; /* for Internet Explorer and Edge */ + scrollbar-width: none; /* for Firefox */ + } + `],yF([nd()],bF.prototype,"onScroll",void 0),yF([nd({attribute:"threshold-x",type:Number})],bF.prototype,"thresholdX",void 0),yF([nd({attribute:"threshold-y",type:Number})],bF.prototype,"thresholdY",void 0),yF([nd()],bF.prototype,"scroller",void 0),yF([nd()],bF.prototype,"rightScrollZone",void 0),yF([nd()],bF.prototype,"rightScrollHandle",void 0),yF([nd()],bF.prototype,"bottomScrollZone",void 0),yF([nd()],bF.prototype,"bottomScrollHandle",void 0),yF([nd()],bF.prototype,"hasHoveringCursor",void 0),yF([nd()],bF.prototype,"axis",void 0),yF([rd()],bF.prototype,"isDragging",void 0),yF([rd()],bF.prototype,"verticalScrollPosition",void 0),yF([rd()],bF.prototype,"horizontalScrollPosition",void 0),yF([rd()],bF.prototype,"verticalScrollSize",void 0),yF([rd()],bF.prototype,"horizontalScrollSize",void 0),bF=yF([td("astra-scroll-area")],bF);var wF=bF; +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const xF=(t,e,i)=>{const n=new Map;for(let r=e;r<=i;r++)n.set(t[r],r);return n},_F=fd(class extends gd{constructor(t){if(super(t),t.type!==pd)throw Error("repeat() can only be used in text expressions")}dt(t,e,i){let n;void 0===i?i=e:void 0!==e&&(n=e);const r=[],o=[];let s=0;for(const e of t)r[s]=n?n(e,s):s,o[s]=i(e,s),s++;return{values:o,keys:r}}render(t,e,i){return this.dt(t,e,i).values}update(t,[e,i,n]){const r=(t=>t._$AH)(t),{values:o,keys:s}=this.dt(e,i,n);if(!Array.isArray(r))return this.ut=s,o;const a=this.ut??=[],l=[];let h,c,u=0,d=r.length-1,p=0,f=o.length-1;for(;u<=d&&p<=f;)if(null===r[u])u++;else if(null===r[d])d--;else if(a[u]===s[p])l[p]=hd(r[u],o[p]),u++,p++;else if(a[d]===s[f])l[f]=hd(r[d],o[f]),d--,f--;else if(a[u]===s[f])l[f]=hd(r[u],o[f]),ld(t,l[f+1],r[u]),u++,f--;else if(a[d]===s[p])l[p]=hd(r[d],o[p]),ld(t,r[u],r[d]),d--,p++;else if(void 0===h&&(h=xF(s,p,f),c=xF(a,u,d)),h.has(a[u]))if(h.has(a[d])){const e=c.get(s[p]),i=void 0!==e?r[e]:null;if(null===i){const e=ld(t,r[u]);hd(e,o[p]),l[p]=e}else l[p]=hd(i,o[p]),ld(t,r[u],i),r[e]=null;p++}else ud(r[d]),d--;else ud(r[u]),u++;for(;p<=f;){const e=ld(t,l[f+1]);hd(e,o[p]),l[p++]=e}for(;u<=d;){const t=r[u++];null!==t&&ud(t)}return this.ut=s,((t,e=cd)=>{t._$AH=e})(t,l),Ru}});var kF=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s};const SF=Pu``;let AF=class extends _p{shouldDisplayOptions(t){t?(this.optionsListElement.style.display="block",setTimeout(this.optionsListElement.focus.bind(this.optionsListElement),0)):this.optionsListElement.style.display="none",this.isOpen=t,this.ariaExpanded=t?"true":"false"}onClickOutside(t){"undefined"!=typeof document&&t.target!==this&&(this.shouldDisplayOptions(!1),document.removeEventListener("click",this.onClickOutside))}onClickInside(t){"undefined"!=typeof document&&(this.isOpen?document.removeEventListener("click",this.onClickOutside):document.addEventListener("click",this.onClickOutside),this.shouldDisplayOptions(!this.isOpen))}onKeyDown(t){const{code:e}=t;this.disabled||"Space"!==e&&"Enter"!==e||(t.preventDefault(),this.onClickInside())}renderOption(t){return Pu`
  • {this.value=t.value}} + > + ${t.label} +
  • `}connectedCallback(){super.connectedCallback(),this.onClickOutside=this.onClickOutside.bind(this),this.addEventListener("keydown",this.onKeyDown)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",this.onKeyDown)}willUpdate(t){super.willUpdate(t),t.has("value")&&(this.label=this.options.find((t=>t.value===this.value))?.label)}constructor(){super(),this.ariaExpanded="false",this.placeholder="",this.value="",this.label="",this.options=[],this.disabled=!1,this.isOpen=!1,this.onKeyDown=this.onKeyDown.bind(this)}render(){const t=this.value.length>0?this.label:this.placeholder;return Pu` +
    +
    +
    ${t}
    +
    ${SF}
    +
    + + +
    + `}};AF.styles=[..._p.styles,Pd,Xc` + #container { + display: flex; + gap: 8px; + position: relative; + cursor: pointer; + padding: 10px 12px; + border: 1px solid var(--astra-neutral-200); + border-radius: 6px; + background: white; + font-family: var(--astra-font-family); + user-select: none; + -webkit-user-select: none; + } + + #container:focus-within { + outline: 1px solid var(--astra-accent, lime); + outline-offset: -1px; // 0px draws it _outside_ of the border, where as this covers the border + } + + #options-list { + display: none; + position: absolute; + top: calc(100% + 6px); + left: 0; + width: 100%; + z-index: 3; + background: white; + border: 1px solid var(--astra-neutral-200); + border-radius: 6px; + } + + .option { + padding: 10px 12px; + cursor: pointer; + color: black; + } + + .option:hover { + background: var(--astra-neutral-200); + } + + li { + list-style-type: none; + white-space: nowrap; + } + + li, + .label-trigger { + text-overflow: ellipsis; + overflow: hidden; + } + + ul { + margin-block-start: 0px; + margin-block-end: 0px; + padding-inline-start: 0px; + } + + @media (prefers-color-scheme: dark) { + #container { + background: var(--astra-neutral-900); + border: 1px solid var(--astra-neutral-800); + color: white; + } + + #options-list { + background: var(--astra-neutral-900); + border: 1px solid var(--astra-neutral-800); + border-radius: 6px; + } + + .option { + color: white; + } + + .option:hover { + background: var(--astra-neutral-800); + } + } + `],kF([nd({attribute:"aria-expanded",reflect:!0})],AF.prototype,"ariaExpanded",void 0),kF([nd({attribute:"placeholder"})],AF.prototype,"placeholder",void 0),kF([nd({attribute:"value"})],AF.prototype,"value",void 0),kF([rd()],AF.prototype,"label",void 0),kF([nd({attribute:"options",type:Array})],AF.prototype,"options",void 0),kF([nd({attribute:"disabled",type:Boolean})],AF.prototype,"disabled",void 0),kF([rd()],AF.prototype,"isOpen",void 0),kF([od("#options-list")],AF.prototype,"optionsListElement",void 0),AF=kF([td("astra-select")],AF);var CF=AF; +/** + * @license + * Copyright 2018 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const MF=t=>t??Nu;var DF,TF=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s};let IF=DF=class extends Ju{constructor(){super(...arguments),this.checked=!1,this.theme="light",this.tabIndex=0,this._class="focus:shadow-ringlet dark:focus:shadow-ringlet-dark focus:rounded-md focus:ring-1 focus:ring-black dark:focus:ring-neutral-300 focus:outline-none"}toggleCheckbox(t){t.preventDefault(),this.checked=!this.checked,this.dispatchEvent(new yp)}onKeyDown(t){const{code:e}=t;"Enter"!==e&&"Space"!==e||this.toggleCheckbox(t)}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this.onKeyDown)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",this.onKeyDown)}render(){return Pu` +
    + ${this.checked?DF.checkedTemplate:DF.uncheckedTemplate} + +
    + `}};var OF;IF.styles=wp,IF.checkedTemplate=Pu`${OF=16,Pu` + + + `}`,IF.uncheckedTemplate=Pu``,TF([nd({type:Boolean})],IF.prototype,"checked",void 0),TF([nd({type:String})],IF.prototype,"theme",void 0),TF([nd({attribute:"class",type:String,reflect:!0})],IF.prototype,"_class",void 0),IF=DF=TF([td("check-box")],IF);for(var EF,PF=[],LF=0;LF<256;++LF)PF.push((LF+256).toString(16).slice(1));var RF=new Uint8Array(16);function NF(){if(!EF&&!(EF="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return EF(RF)}var BF={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function zF(t,e,i){if(BF.randomUUID&&!e&&!t)return BF.randomUUID();var n=(t=t||{}).random||(t.rng||NF)();return n[6]=15&n[6]|64,n[8]=63&n[8]|128,function(t,e=0){return(PF[t[e+0]]+PF[t[e+1]]+PF[t[e+2]]+PF[t[e+3]]+"-"+PF[t[e+4]]+PF[t[e+5]]+"-"+PF[t[e+6]]+PF[t[e+7]]+"-"+PF[t[e+8]]+PF[t[e+9]]+"-"+PF[t[e+10]]+PF[t[e+11]]+PF[t[e+12]]+PF[t[e+13]]+PF[t[e+14]]+PF[t[e+15]]).toLowerCase()}(n)}function $F(t){return t.composedPath().some((t=>{if(t instanceof HTMLElement&&(t.tagName.toLowerCase().includes("outerbase-plugin-editor")||t.tagName.toLowerCase().includes("astra-plugin-editor")))return!0}))}const FF=t=>Pu` + + + `;var VF=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s};let HF=class extends Ju{constructor(){super(),this.open=!1,this.anchorId=null,this.backdrop=!1,this.modal=!1,this.x=0,this.y=0,this.slotRef=kd(),this.onMouseMove=this.onMouseMove.bind(this)}connectedCallback(){super.connectedCallback(),window.addEventListener("mousemove",this.onMouseMove)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("mousemove",this.onMouseMove)}updated(t){super.updated(t),t.has("open")&&void 0!==t.get("open")&&(this.open?this.showWormhole():this.hideWormhole())}render(){return this.modal?Pu` + + + + `:Pu` +
    + +
    + `}showWormhole(){this.modal?this.wormhole.showModal():this.wormhole.showPopover(),this.adjustPosition()}hideWormhole(){this.modal?this.wormhole.close():this.wormhole.hidePopover()}onMouseMove(t){this.x=t.clientX,this.y=t.clientY}adjustPosition(){if(!this.wormhole)return;const t=this.wormhole.getBoundingClientRect(),e=window.innerWidth,i=window.innerHeight;let n,r;const o=this.findAnchor();o?({x:n,y:r}=this.calculateMenuPosition(o)):(n=this.atX??this.x,r=this.atY??this.y),n=Math.max(0,Math.min(n,e-t.width)),r=Math.max(0,Math.min(r,i-t.height)),this.wormhole.style.left=`${n}px`,this.wormhole.style.top=`${r}px`}findAnchor(){let t=this;for(;t&&t!==document;){if(t instanceof HTMLElement&&t.id===this.anchorId)return t;if(t.parentNode)t=t.parentNode;else{if(!(t instanceof ShadowRoot))break;t=t.host}}return null}calculateMenuPosition(t){if(!this.slotRef.value)return{x:0,y:0};const e=t.getBoundingClientRect(),i=this.slotRef.value.assignedElements();if(0===i.length)return{x:0,y:0};const n=i[0].getBoundingClientRect(),r=window.innerWidth,o=window.innerHeight,s=e.left,a=r-e.right,l=o-e.bottom,h=e.top;let c,u;return c=s>=n.width?e.right-n.width:a>=n.width?e.right:s>a?0:r-n.width,u=l>=n.height?e.bottom+4:h>=n.height?e.top-n.height-4:l>h?o-n.height:0,c=Math.max(0,Math.min(c,r-n.width)),u=Math.max(0,Math.min(u,o-n.height)),{x:c,y:u}}};HF.styles=Xc` + #wormhole { + margin: 0; + padding: 0; + background-color: unset; + border: 0; + overflow: visible; + } + + dialog::backdrop { + display: none; + } + + :host([backdrop]) dialog::backdrop { + display: block; + background-color: var(--astra-menu-backdrop-color, rgba(0, 0, 0, 0.2)); + backdrop-filter: blur(var(--astra-menu-backdrop-blur, 1px)); + -webkit-backdrop-filter: blur(var(--astra-menu-backdrop-blur, 1px)); + -moz-backdrop-filter: blur(var(--astra-menu-backdrop-blur, 1px)); + -o-backdrop-filter: blur(var(--astra-menu-backdrop-blur, 1px)); + -ms-backdrop-filter: blur(var(--astra-menu-backdrop-blur, 1px)); + } + `,VF([nd({type:Boolean})],HF.prototype,"open",void 0),VF([nd({type:Number})],HF.prototype,"atX",void 0),VF([nd({type:Number})],HF.prototype,"atY",void 0),VF([nd({type:String})],HF.prototype,"anchorId",void 0),VF([nd({type:Boolean,attribute:"backdrop"})],HF.prototype,"backdrop",void 0),VF([nd({type:Boolean,attribute:"modal"})],HF.prototype,"modal",void 0),VF([od("#wormhole")],HF.prototype,"wormhole",void 0),HF=VF([td("hans-wormhole")],HF);var WF=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s};let UF=class extends _p{constructor(){super(),this.scrollLeft=0,this.scrollTop=0,this.scrollWidth=0,this.scrollHeight=0,this.clientWidth=0,this.clientHeight=0,this.isScrolling=!1,this.scrollTimeout=null,this.resizeObserver=new ResizeObserver((()=>this.updateScrollInfo()))}firstUpdated(){this.resizeObserver.observe(this),this.resizeObserver.observe(this.contentWrapper),this.contentWrapper.addEventListener("scroll",this.handleScroll.bind(this),{passive:!0})}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver.unobserve(this),this.resizeObserver.unobserve(this.contentWrapper),this.contentWrapper.removeEventListener("scroll",this.handleScroll.bind(this))}handleScroll(){this.updateScrollInfo(),this.isScrolling=!0,this.requestUpdate(),this.scrollTimeout&&clearTimeout(this.scrollTimeout),this.scrollTimeout=window.setTimeout((()=>{this.isScrolling=!1,this.requestUpdate()}),1e3)}updateScrollInfo(){this.scrollLeft=this.contentWrapper.scrollLeft,this.scrollTop=this.contentWrapper.scrollTop,this.scrollWidth=this.contentWrapper.scrollWidth,this.scrollHeight=this.contentWrapper.scrollHeight,this.clientWidth=this.contentWrapper.clientWidth,this.clientHeight=this.contentWrapper.clientHeight,this.requestUpdate()}render(){const t=this.scrollWidth>this.clientWidth,e=this.scrollHeight>this.clientHeight,i=this.clientHeight-(t?8:0),n=this.clientWidth-(e?8:0),r=Math.max(i/this.scrollHeight*i,20),o=this.scrollTop/(this.scrollHeight-i)*(i-r),s=Math.max(n/this.scrollWidth*n,20),a=this.scrollLeft/(this.scrollWidth-n)*(n-s),l="bg-neutral-200/60 dark:bg-neutral-700/50 hover:bg-neutral-300 dark:hover:bg-neutral-700 active:bg-neutral-300 dark:active:bg-neutral-700",h=void 0!==this.maxHeight?{maxHeight:`${this.maxHeight}`}:{};return Pu` +
    + +
    + ${t?Pu` +
    +
    +
    + `:""} + ${e?Pu` +
    +
    +
    + `:""} + `}startDragging(t,e){t.preventDefault();const i=t.clientX,n=t.clientY,r=this.scrollLeft,o=this.scrollTop,s=t.target;s.classList.add("active");const a=t=>{if("x"===e){const e=(t.clientX-i)/this.clientWidth;this.contentWrapper.scrollLeft=r+e*this.scrollWidth}else{const e=(t.clientY-n)/this.clientHeight;this.contentWrapper.scrollTop=o+e*this.scrollHeight}},l=()=>{document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",l),s.classList.remove("active")};document.addEventListener("mousemove",a),document.addEventListener("mouseup",l)}};UF.styles=[..._p.styles,Xc` + :host { + display: block; + position: relative; + } + + .content-wrapper { + width: 100%; + height: 100%; + overflow: auto; + scrollbar-width: none; + -ms-overflow-style: none; + } + + .content-wrapper::-webkit-scrollbar { + display: none; + } + + .scrollbar { + position: absolute; + border-radius: 4px; + opacity: 0; + transition: opacity 0.3s; + } + + .scrollbar:hover, + .scrollbar.active { + opacity: 1; + } + + .scrollbar-x { + bottom: 0; + left: 0; + width: calc(100% - 8px); + height: 8px; + } + + .scrollbar-y { + top: 0; + right: 0; + width: 8px; + height: calc(100% - 8px); + } + + .scrollbar-thumb { + position: absolute; + border-radius: 4px; + transition: background-color 0.3s; + } + + .scrollbar-thumb-x { + height: 100%; + } + + .scrollbar-thumb-y { + width: 100%; + } + + .scrollbar-y { + top: 0; + right: 0; + width: 8px; + height: 100%; + } + `],WF([nd({type:Number})],UF.prototype,"scrollLeft",void 0),WF([nd({type:Number})],UF.prototype,"scrollTop",void 0),WF([nd({type:Number})],UF.prototype,"scrollWidth",void 0),WF([nd({type:Number})],UF.prototype,"scrollHeight",void 0),WF([nd({type:Number})],UF.prototype,"clientWidth",void 0),WF([nd({type:Number})],UF.prototype,"clientHeight",void 0),WF([nd({type:String,attribute:"max-height"})],UF.prototype,"maxHeight",void 0),WF([od(".content-wrapper")],UF.prototype,"contentWrapper",void 0),UF=WF([td("astra-scroll-block")],UF);var jF=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s};let GF=class extends _p{constructor(){super(),this.items=[],this.isOpen=!1,this.anchored=!0,this.nestedMenu=kd(),this.onOutsideClick=t=>{this.isOpen&&!this.contains(t.target)&&(this.isOpen=!1)},this.onMouseDown=t=>{t.composedPath().some((t=>t instanceof Node&&(this.contains(t)||t===this)))||(this.isOpen=!1)},this.onResize=this.onResize.bind(this),this.onOutsideClick=this.onOutsideClick.bind(this),this.onMenuSelection=this.onMenuSelection.bind(this),this.onKeyDown=this.onKeyDown.bind(this)}willUpdate(t){super.willUpdate(t),t.has("isOpen")&&void 0!==t.get("isOpen")&&(this.isOpen?this.setAttribute("aria-expanded",""):this.removeAttribute("aria-expanded")),t.has("isOpen")&&void 0!==t.get("isOpen")&&(this.isOpen?(window.addEventListener("click",this.onOutsideClick),window.addEventListener("mousedown",this.onMouseDown)):(window.removeEventListener("click",this.onOutsideClick),window.removeEventListener("mousedown",this.onMouseDown))),t.has("isOpen")&&void 0!==t.get("isOpen")&&(this.isOpen?window.addEventListener("resize",this.onResize):window.removeEventListener("resize",this.onResize)),t.has("isOpen")&&void 0!==t.get("isOpen")&&(this.isOpen?window.addEventListener("keydown",this.onKeyDown):window.removeEventListener("keydown",this.onKeyDown))}render(){const t=Pu``,e=Pu``;return this.anchored?Pu` + ${t} +
    + ${e} +
    + `:Pu` + ${t} + ${e} + `}toggleMenu(t){this.isOpen=!this.isOpen}onResize(){this.isOpen&&(this.isOpen=!1)}onMenuSelection(t){this.isOpen=!1}onKeyDown(t){"Escape"===t.key&&(this.isOpen=!1)}};GF.styles=[..._p.styles,Xc` + :host { + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + } + `],jF([nd({type:Array})],GF.prototype,"items",void 0),jF([nd({attribute:"open",type:Boolean})],GF.prototype,"isOpen",void 0),GF=jF([td("astra-menu")],GF);let qF=class extends _p{constructor(){super(...arguments),this.items=[],this.parentMenu=null,this.depth=0,this.isOpen=!1,this.scrollSubItems=!1,this.activeIndex=null}get isSubmenu(){return Boolean(this.parentMenu)}willUpdate(t){super.willUpdate(t),t.has("isOpen")&&(this.isOpen?this.setAttribute("aria-expanded",""):this.removeAttribute("aria-expanded")),t.has("isOpen")&&void 0!==t.get("isOpen")&&!1===this.isOpen&&(this.isSubmenu||this.dispatchEvent(new Event("closed")))}render(){const t=Pu``;return Pu` +
    + ${this.scrollSubItems?Pu`${t}`:t} +
    + `}focus(){this._focusItem(0)}_getSubmenuSide(t){if(!this.shadowRoot)return"right";const e=this.shadowRoot.querySelectorAll("li")[t];if(!e)return"right";const i=e.getBoundingClientRect();return window.innerWidth-i.right>=200?"right":"left"}_onClickMenuItem(t,e){t.stopPropagation(),e.subItems||this._onSelection(e)}_onSelection(t){const e=new fp(t);this.dispatchEvent(e)}_handleKeyDown(t){switch(t.stopPropagation(),t.key){case"ArrowDown":t.preventDefault(),this._focusNextItem(1);break;case"ArrowUp":t.preventDefault(),this._focusNextItem(-1);break;case"ArrowRight":t.preventDefault(),this._handleArrowRight();break;case"ArrowLeft":t.preventDefault(),this._handleArrowLeft();break;case"Enter":case" ":t.preventDefault(),this._selectActiveItem()}}_handleArrowRight(){if(null!==this.activeIndex){const t=this.shadowRoot?.querySelectorAll("li");if(t){const e=t[this.activeIndex].querySelector("astra-nested-menu");e&&(e.isOpen=!0,e.requestUpdate(),e.updateComplete.then((()=>e._focusItem(0))))}}}_handleArrowLeft(){this.isSubmenu&&this.parentMenu&&this._closeCurrentSubmenu()}_focusNextItem(t){const e=this.items.filter((t=>!t.separator)).length;let i=null!==this.activeIndex?this.activeIndex+t:0;i<0&&(i=e-1),i>=e&&(i=0),this._focusItem(i)}_focusItem(t){this.activeIndex=t;const e=this.shadowRoot?.querySelectorAll("li");if(e){e[t].focus()}}_closeCurrentSubmenu(){if(this.isSubmenu&&this.parentMenu){this.activeIndex=null,this.isOpen=!1,this.requestUpdate();const t=this.parentMenu.items.findIndex((t=>t.subItems===this.items));-1!==t&&this.parentMenu._focusItem(t)}}_selectActiveItem(){if(null!==this.activeIndex){const t=this.items[this.activeIndex];t.subItems&&this._handleArrowRight(),this._onSelection(t)}}};qF.styles=[..._p.styles,Xc` + li { + padding: 8px 16px; + margin: 0; + cursor: pointer; + position: relative; + white-space: nowrap; + + font-weight: 500; + font-size: 12px; + } + .submenu { + display: none; + position: absolute; + top: 0px; + } + .submenu.right { + left: 100%; + } + .submenu.left { + right: 100%; + } + li:hover > .submenu, + li:focus-within > .submenu { + display: block; + } + `],jF([nd({type:Array})],qF.prototype,"items",void 0),jF([nd({type:Object})],qF.prototype,"parentMenu",void 0),jF([nd({type:Number})],qF.prototype,"depth",void 0),jF([nd({type:Boolean,attribute:"open"})],qF.prototype,"isOpen",void 0),jF([nd({type:Boolean,attribute:"scroll"})],qF.prototype,"scrollSubItems",void 0),jF([rd()],qF.prototype,"activeIndex",void 0),qF=jF([td("astra-nested-menu")],qF);var YF=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s};let XF=class extends GF{constructor(){super(...arguments),this.anchored=!1}render(){return Pu` +
    + +
    + ${super.render()} + `}};XF=YF([td("astra-td-menu")],XF);var KF=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s};const ZF=["Int","Integer","SmallInt","BigInt","Decimal","Float","Real","Double Precision","TinyInt","MediumInt","Serial","BigSerial"].map((t=>t.toLowerCase())),JF=["Boolean","Bit"].map((t=>t.toLowerCase())),QF=["JSON","JSONB","ARRAY"].map((t=>t.toLowerCase()));class tV extends _p{constructor(){super(...arguments),this._didSetInitialValue=!1,this.constrainTypes=!1,this.position={column:"",row:""},this.readonly=!1,this.isInteractive=!1,this.outerBorder=!1,this.bottomBorder=!1,this.separateCells=!1,this.blank=!1,this.isEditing=!1,this.hasMenu=!1,this.isFirstColumn=!1,this.isLastColumn=!1,this.isLastRow=!1,this.isActive=!1,this.pinned=!1}static moveFocusToNextColumn(t){const e=t?.parentElement,i=Array.from(e?.children??[]).indexOf(t),n=e?e.nextElementSibling:null;if(n&&n.children.length>i){var r=n.children[i];r&&r.focus()}}static moveFocusToPreviousColumn(t){const e=t?.parentElement,i=Array.from(e?.children??[]).indexOf(t),n=e?e.previousElementSibling:null;if(n&&n.children.length>i){var r=n.children[i];r&&r.focus()}}static moveFocusToNextRow(t){t?.nextElementSibling?.focus()}static onKeyDown(t){const e=t.currentTarget;if("Escape"===t.code&&(t.stopPropagation(),t.preventDefault(),e.isEditing=!1,e.blur()),"Enter"===t.code&&e.isEditing&&t.target instanceof HTMLElement){const i=t.target;setTimeout((()=>{e.blur(),setTimeout((()=>{tV.moveFocusToNextRow(i)}),0)}))}if("Tab"===t.code&&t.target instanceof HTMLElement){const i=t.target;setTimeout((()=>{e.blur(),setTimeout((()=>{t.shiftKey?tV.moveFocusToPreviousColumn(i):tV.moveFocusToNextColumn(i)}),0)}))}"Enter"===t.code&&!e.isEditing&&e.readonly&&t.preventDefault(),"Enter"!==t.code||e.isEditing||e.readonly||t.target instanceof HTMLElement&&!e.isEditing&&(t.didCloseMenu||(e.isEditing=!0))}static convertToType(t,e){if(t&&"string"==typeof e){if(ZF.includes(t))return parseInt(e,10);if(QF.includes(t))return JSON.parse(e);if(JF.includes(t))return"true"===e.toLowerCase().trim();if(""===e)return null}return e}classMap(){return{"cursor-pointer":this.isInteractive&&!this.readonly,...super.classMap()}}get value(){return this._value}set value(t){const e=this._value;e!==t&&(this.constrainTypes?this._value=tV.convertToType(this.type,t)??t:this._value=t,this.requestUpdate("value",e),this._didSetInitialValue&&this.dispatchChangedEvent()),this._didSetInitialValue=!0}get originalValue(){return this._originalValue}set originalValue(t){const e=this._originalValue;this.constrainTypes?this._originalValue=tV.convertToType(this.type,t)??t:this._originalValue=t,this.requestUpdate("originalValue",e)}get dirty(){return!vF(this.value,this.originalValue)}get type(){return this._type}set type(t){this._type=t?.toLowerCase()}updated(t){if(super.updated(t),t.has("isEditing")&&this.isEditing){const t=this.shadowRoot?.querySelector("input");t&&t.select()}}willUpdate(t){super.willUpdate(t),this.constrainTypes&&t.has("type")&&(this.value=tV.convertToType(this.type,this.value)??this._value,this.originalValue=tV.convertToType(this.type,this.originalValue)??this.originalValue),t.has("width")&&this.width&&this.style&&(this.style.width=`${this.width}px`)}dispatchChangedEvent(){const t={position:this.position,previousValue:this.originalValue,value:this.value,label:this.label};this.dispatchEvent(new Jd(t))}dispatchBlurredEvent(){const t={position:this.position,previousValue:this.originalValue,value:this.value,label:this.label};this.dispatchEvent(new Qd(t))}onBlur(){this.isEditing=!1,this.dispatchBlurredEvent()}onChange(t){const{value:e}=t.target;this.value=""===e?null:e}}KF([nd({attribute:"constrain-types",type:Boolean})],tV.prototype,"constrainTypes",void 0),KF([nd({attribute:"value",type:String})],tV.prototype,"value",null),KF([nd({attribute:"original-value",type:String})],tV.prototype,"originalValue",null),KF([nd({type:String})],tV.prototype,"dirty",null),KF([nd({type:Object,attribute:"position"})],tV.prototype,"position",void 0),KF([nd({type:String})],tV.prototype,"label",void 0),KF([nd({attribute:"read-only",type:Boolean})],tV.prototype,"readonly",void 0),KF([nd({type:Number,attribute:"width"})],tV.prototype,"width",void 0),KF([nd({attribute:"interactive",type:Boolean})],tV.prototype,"isInteractive",void 0),KF([nd({attribute:"outer-border",type:Boolean})],tV.prototype,"outerBorder",void 0),KF([nd({attribute:"border-b",type:Boolean})],tV.prototype,"bottomBorder",void 0),KF([nd({type:Boolean,attribute:"separate-cells"})],tV.prototype,"separateCells",void 0),KF([nd({type:Boolean,attribute:"blank"})],tV.prototype,"blank",void 0),KF([nd({attribute:"type",type:String})],tV.prototype,"type",null),KF([nd({attribute:"is-editing",type:Boolean})],tV.prototype,"isEditing",void 0),KF([nd({attribute:"menu",type:Boolean})],tV.prototype,"hasMenu",void 0),KF([nd({attribute:"is-first-column",type:Boolean})],tV.prototype,"isFirstColumn",void 0),KF([nd({attribute:"is-last-column",type:Boolean})],tV.prototype,"isLastColumn",void 0),KF([nd({attribute:"is-last-row",type:Boolean})],tV.prototype,"isLastRow",void 0),KF([nd({attribute:"is-active",type:Boolean})],tV.prototype,"isActive",void 0),KF([nd({attribute:"pinned",type:Boolean})],tV.prototype,"pinned",void 0);var eV,iV=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s};const nV=[{label:"Insert Value",id:"insert-value",subItems:[{id:"null",label:"NULL",value:null,monospaced:!0},{id:"default",label:"DEFAULT",value:void 0,monospaced:!0},{separator:!0},{id:"timestamp",label:Date.now().toString(),suplabel:"Unix Timestamp",value:Date.now(),monospaced:!0},{separator:!0},{id:"uuid",label:zF(),suplabel:"UUID",value:zF(),monospaced:!0}]},{separator:!0},{label:"Edit",id:"edit"},{label:"Copy",id:"copy"},{label:"Paste",id:"paste"},{label:"Clear",id:"clear"}],rV=[{label:"Copy",id:"copy"}];let oV=eV=class extends tV{onContextMenu(t){if($F(t))return;this.isContentEditable=!1;const e=t.currentTarget.shadowRoot?.querySelector("astra-td-menu");e&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),this.menuIsOpen=!0)}static onDragOver(t){t.preventDefault()}static onDrop(t){t.preventDefault()}static onDoubleClick(t){const e=t.currentTarget;e.blank||e.isEditing||$F(t)||(e.isEditing=!0,setTimeout((()=>{const t=e.shadowRoot?.querySelector("input");t&&(t.focus(),e.readonly||t.setSelectionRange(t.value.length,t.value.length))}),0))}static copyValueToClipboard(t){return null==t?navigator.clipboard.writeText(""):"object"==typeof t?navigator.clipboard.writeText(JSON.stringify(t)):navigator.clipboard.writeText(t.toString())}static async onKeyDown(t){if(function(t){return t.composedPath().some((t=>{if(t instanceof HTMLElement&&(t.tagName.toLowerCase().includes("outerbase-plugin")||t.tagName.toLowerCase().includes("astra-plugin")))return!0}))}(t))return;const e=t.currentTarget,i=e.shadowRoot?.querySelector("astra-td-menu");if(i?.isOpen)return;if(tV.onKeyDown(t),e.isEditing)return;const{code:n}=t;let r=t.target;if(!(r instanceof HTMLElement))return;if("check-box"===r.tagName.toLowerCase()){const e=r.parentElement?.parentElement?.parentElement;return void("ArrowDown"===n?(t.preventDefault(),e?.nextElementSibling?.querySelector("check-box")?.focus()):"ArrowUp"===n?(t.preventDefault(),e?.previousElementSibling?.querySelector("check-box")?.focus()):"ArrowRight"===n&&(t.preventDefault(),r.parentElement?.parentElement?.nextElementSibling?.focus()))}const o=1===t.key.length&&(s=t.key,/^[a-zA-Z0-9 \.,]+$/.test(s));var s;const a=!t.metaKey,l=!(e.type&&QF.includes(e.type));if(o&&a&&l&&(t.preventDefault(),e.readonly||(e.isEditing=!0,e.value=t.key,setTimeout((()=>{const t=e.shadowRoot?.querySelector("input");t?.focus(),t?.setSelectionRange(t.value.length,t.value.length)}),0))),"ArrowDown"===n)return t.preventDefault(),void r?.nextElementSibling?.focus();if("ArrowUp"!==n){if("ArrowRight"===n){if(t.preventDefault(),t.target instanceof HTMLElement&&!e.isEditing)return void tV.moveFocusToNextColumn(t.target)}else if("ArrowLeft"===n&&(t.preventDefault(),t.target instanceof HTMLElement&&!e.isEditing))return void tV.moveFocusToPreviousColumn(t.target);return t.metaKey&&"KeyC"===n?(t.preventDefault(),eV.copyValueToClipboard(e.value)):e.readonly||"Backspace"!==n&&"Delete"!==n?void 0:(t.preventDefault(),void(e.value=null))}{t.preventDefault();const e=r?.previousElementSibling?.querySelector("check-box");e?e.focus():r?.previousElementSibling?.focus()}}onClick(t){this.isDisplayingPluginEditor||this.plugin||this.contentEditableWrapper.value?.focus()}onPaste(t){this.isDisplayingPluginEditor||this.plugin||(t.preventDefault(),this.value=t.clipboardData?.getData("text"))}classMap(){return{...super.classMap(),"relative focus:z-[1]":!0,"h-[34px] flex items-center justify-center":!0,"border-theme-table-border dark:border-theme-table-border-dark":!0,"backdrop-blur-sm":this.blank||this.pinned,"text-theme-table-content dark:text-theme-table-content-dark":!this.isEditing,"text-theme-table-cell-mutating-content dark:text-theme-table-cell-mutating-content":this.isEditing,"bg-theme-table-row-new dark:bg-theme-table-row-new-dark":this.rowIsNew,"bg-theme-table-row dark:bg-theme-table-row-dark":!this.rowIsNew&&!this.isActive&&(!this.dirty||this.hideDirt),"bg-theme-table-row-selected dark:bg-theme-table-row-selected-dark":!this.rowIsNew&&this.isActive&&(!this.dirty||this.hideDirt),"bg-theme-table-cell-dirty dark:bg-theme-table-cell-dirty-dark":!this.rowIsNew&&this.dirty&&!this.hideDirt,"hover:bg-theme-table-row-hover dark:hover:bg-theme-table-row-hover-dark":!this.dirty||this.hideDirt,"focus:shadow-ringlet dark:focus:shadow-ringlet-dark focus:rounded-[4px] focus:ring-1 focus:ring-black dark:focus:ring-neutral-300 focus:outline-none":!this.isEditing&&this.isInteractive,"border-r":this.resizable||this.separateCells&&this.isLastColumn&&this.outerBorder||this.separateCells&&!this.isLastColumn,"border-b":!this.isLastRow||this.isLastRow&&this.outerBorder||this.isLastRow&&this.bottomBorder}}constructor(){super(),this.pluginAttributes="",this.isRowSelector=!1,this.row=void 0,this.column=void 0,this.hideDirt=!1,this.isDisplayingPluginEditor=!1,this.isFirstRow=!1,this.resizable=!1,this.hasMenu=!1,this.rowIsNew=!1,this.pinned=!1,this.menuIsOpen=!1,this.isContentEditable=!0,this.options=nV,this.isHoveringCell=!1,this.contentEditableWrapper=kd(),this.handleMouseMove=t=>{const e=this.getBoundingClientRect(),i=t.clientX,n=t.clientY;(ie.right||ne.bottom)&&(this.isHoveringCell=!1,this.stopHoverCheck())},this.onDisplayEditor=this.onDisplayEditor.bind(this),this.onPluginChangeEvent=this.onPluginChangeEvent.bind(this),this.onMenuSelection=this.onMenuSelection.bind(this),this.onPaste=this.onPaste.bind(this),this.onClick=this.onClick.bind(this),this.onContextMenu=this.onContextMenu.bind(this)}onDisplayEditor(t){const e=t.composedPath().some((t=>t instanceof HTMLElement&&"plugin-editor"===t.id));e||(this.isDisplayingPluginEditor=!1)}onPluginChangeEvent({detail:{action:t,value:e}}){const i=t.toLowerCase();i===qd.onEdit?this.isDisplayingPluginEditor=!0:i===qd.onStopEdit?this.isDisplayingPluginEditor=!1:i===qd.onCancelEdit?(this.isDisplayingPluginEditor=!1,delete this._interstitialValue):i===qd.updateCell&&(this._interstitialValue=e,this.value=e)}async onMenuSelection(t){switch(t.value?.id){case"edit":return this.isEditing=!0;case"copy":return eV.copyValueToClipboard(this.value);case"paste":return this.value=await navigator.clipboard.readText(),void this.dispatchChangedEvent();case"clear":return this.value=null,void this.dispatchChangedEvent();case"null":case"default":default:return this.value=t.value.value,void this.dispatchChangedEvent();case"timestamp":return this.value=Date.now(),void this.dispatchChangedEvent();case"uuid":return this.value=zF(),void this.dispatchChangedEvent()}}connectedCallback(){super.connectedCallback(),this.addEventListener("contextmenu",this.onContextMenu),this.addEventListener("click",this.onClick),this.addEventListener("keydown",eV.onKeyDown),this.addEventListener("custom-change",this.onPluginChangeEvent),this.addEventListener("plugin-change",this.onPluginChangeEvent),this.isInteractive&&this.addEventListener("dblclick",eV.onDoubleClick),this.id="td"}disconnectedCallback(){super.disconnectedCallback(),this.stopHoverCheck(),this.removeEventListener("click",this.onClick),this.removeEventListener("contextmenu",this.onContextMenu),this.removeEventListener("keydown",eV.onKeyDown),this.removeEventListener("dblclick",eV.onDoubleClick),this.removeEventListener("plugin-change",this.onPluginChangeEvent),this.removeEventListener("custom-change",this.onPluginChangeEvent)}willUpdate(t){if(super.willUpdate(t),t.has("isDisplayingPluginEditor")){if("undefined"==typeof document)return;this.isDisplayingPluginEditor?setTimeout((()=>{document.addEventListener("click",this.onDisplayEditor)}),0):document.removeEventListener("click",this.onDisplayEditor)}!t.has("isDisplayingPluginEditor")&&this.isDisplayingPluginEditor||(t.has("isDisplayingPluginEditor")&&!this.isDisplayingPluginEditor&&this._interstitialValue&&(this.value=this._interstitialValue,delete this._interstitialValue),t.has("readonly")&&(this.readonly?this.options=rV:this.options=nV),(t.has("isFirstRow")||t.has("isFirstColumn"))&&(this.isFirstColumn&&this.isFirstRow?this.setAttribute("first-cell","true"):this.removeAttribute("first-cell")))}updated(t){super.updated(t),t.has("blank")&&(this.blank||(this.tabIndex=0))}render(){let t,e,i=null===this.value?null:"object"==typeof this.value?JSON.stringify(this.value):this.value,n=i,r=Nu;i&&"string"==typeof i&&(i=i.replace(/'/g,"'").replace(/"/g,""").replace(/`/g,"`"),n=i?.replace(/"/g,'"')?.replace(/'/g,"'"));const o=Pu`
    + ${null===n?"NULL":void 0===n?"DEFAULT":"string"==typeof n?n.replace(/\n/g," "):n} +
    `;if(this.plugin){const{config:n,tagName:s}=this.plugin,a=YB(`<${s} cellvalue='${i}' columnName='${this.column}' configuration='${n}' ${this.pluginAttributes}>`),l=s.replace("outerbase-plugin-cell","outerbase-plugin-cell-accessory");r=customElements.get(l)?YB(`<${l} ishoveringcell='${this.isHoveringCell}' cellvalue='${i}' columnName='${this.column}' configuration='${n}' ${this.pluginAttributes}>`):Nu,t=customElements.get(s)?Pu`${a}`:o,this.isDisplayingPluginEditor&&(e=YB(`<${s.replace("outerbase-plugin-cell","outerbase-plugin-editor").replace("astra-plugin-cell","astra-plugin-editor")} cellvalue='${i}' columnName='${this.column}' configuration='${n}' ${this.pluginAttributes}>`))}else t=o;const s="dark"===this.theme?"dark ":"",a=this.isEditing?Pu`
     
    `:Pu``,l=this.blank?Pu``:Pu``,h=this.dirty?[...this.options,{label:null!==this.originalValue&&"object"==typeof this.originalValue?"Revert":Pu`Revert to + + ${null===this.originalValue?"NULL":void 0===this.originalValue?"DEFAULT":this.originalValue} + `,value:this.originalValue,id:"reset"}]:this.options,c=Pu` + + ${e} + + `,u=Pu` +
    + ${t} + ${r} +
    + `,d=this.isEditing||this.blank?Nu:Pu`
    + ${this.hasMenu?Pu`{this.menuIsOpen=!1}} + @menu-selection=${this.onMenuSelection} + > + ${u} ${c} + `:Pu`${u} ${c}`} +
    `;return this.isEditing?a:this.blank?l:d}onPointerEnter(){this.isHoveringCell=!0,this.startHoverCheck()}onPointerLeave(){this.isHoveringCell=!1,this.stopHoverCheck()}startHoverCheck(){document.addEventListener("mousemove",this.handleMouseMove)}stopHoverCheck(){document.removeEventListener("mousemove",this.handleMouseMove)}};oV.styles=[...tV.styles,Xc` + .nbsp::after { + content: '.'; /* Non-breaking space */ + visibility: hidden; + } + + :host { + backdrop-filter: blur(var(--astra-table-backdrop-blur)); + -webkit-backdrop-filter: blur(var(--astra-table-backdrop-blur)); + -moz-backdrop-filter: blur(var(--astra-table-backdrop-blur)); + -o-backdrop-filter: blur(var(--astra-table-backdrop-blur)); + -ms-backdrop-filter: blur(var(--astra-table-backdrop-blur)); + + height: 100%; + width: 100%; + display: flex; + align-items: center; + justify-content: space-between; + } + `],iV([nd({attribute:"plugin-attributes",type:String})],oV.prototype,"pluginAttributes",void 0),iV([nd({type:Boolean,attribute:"odd"})],oV.prototype,"isOdd",void 0),iV([nd({type:Boolean,attribute:"row-selector"})],oV.prototype,"isRowSelector",void 0),iV([nd({attribute:"row",type:Number})],oV.prototype,"row",void 0),iV([nd({attribute:"column",type:String})],oV.prototype,"column",void 0),iV([nd({attribute:"hide-dirt",type:Boolean})],oV.prototype,"hideDirt",void 0),iV([nd({attribute:"plugin",type:Object})],oV.prototype,"plugin",void 0),iV([nd({attribute:"is-displaying-plugin-editor",type:Boolean})],oV.prototype,"isDisplayingPluginEditor",void 0),iV([nd({attribute:"is-first-row",type:Boolean})],oV.prototype,"isFirstRow",void 0),iV([nd({attribute:"resizable",type:Boolean})],oV.prototype,"resizable",void 0),iV([nd({attribute:"menu",type:Boolean})],oV.prototype,"hasMenu",void 0),iV([nd({attribute:"row-is-new",type:Boolean})],oV.prototype,"rowIsNew",void 0),iV([nd({attribute:"pinned",type:Boolean})],oV.prototype,"pinned",void 0),iV([rd()],oV.prototype,"menuIsOpen",void 0),iV([rd()],oV.prototype,"isContentEditable",void 0),iV([rd()],oV.prototype,"options",void 0),iV([rd()],oV.prototype,"isHoveringCell",void 0),oV=eV=iV([td("astra-td")],oV);const sV=t=>Pu` + + `;var aV=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s};let lV=class extends GF{render(){return Pu` +
    + +
    + ${sV(16)} +
    +
    + + ${super.render()} + `}};lV=aV([td("astra-th-menu")],lV);var hV=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s};let cV=class extends _p{onMouseDown(t){if(!this.column)throw new Error("`column` is unset; aborting");const e=this.column.value??this.column.originalValue??"";this.dispatchEvent(new gp(e));const i=t=>{if(!this.column)throw new Error("`column` is unset; aborting");if(!this.xPosition)throw new Error("`xPosition` is unset; aborting");if(!this.width)throw new Error("`width` is unset; aborting");this.dispatchEvent(new vp(e,t.clientX-this.xPosition))},n=t=>{if(document.removeEventListener("mouseup",n),document.removeEventListener("mousemove",i),!this.column)throw new Error("`column` is unset; aborting");this.dispatchEvent(new mp(e,this.xPosition?t.clientX-this.xPosition:0))};document.addEventListener("mousemove",i),document.addEventListener("mouseup",n),this.xPosition=t.clientX,this.width=parseInt(window.getComputedStyle(this.column).width,10)}connectedCallback(){super.connectedCallback(),this.addEventListener("mousedown",this.onMouseDown)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("mousedown",this.onMouseDown)}willUpdate(t){super.willUpdate(t),t.has("height")}render(){return Pu` +
    +
    +
    + `}};hV([nd({type:Number,attribute:"height"})],cV.prototype,"height",void 0),hV([nd({type:Object})],cV.prototype,"column",void 0),cV=hV([td("column-resizer")],cV);var uV=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s};let dV=class extends tV{constructor(){super(...arguments),this.readonly=!0,this.withResizer=!1,this.installedPlugins={},this.options=[],this._previousWidth=0,this._options=[],this._pluginOptions=[]}classMap(){return{...super.classMap(),"relative whitespace-nowrap":!0,"h-10 flex items-center justify-center":!0,"cursor-pointer":!0,"border-b border-theme-table-border dark:border-theme-table-border-dark":!0,"px-cell-padding-x align-middle":!this.blank,"whitespace-nowrap truncate":!0,"text-theme-table-column-content dark:text-theme-table-column-content-dark":!0,"bg-theme-table-column dark:bg-theme-table-column-dark":!this.dirty&&!this.isActive,"bg-theme-table-row-selected dark:bg-theme-table-row-selected-dark":!this.dirty&&this.isActive,"bg-theme-table-cell-dirty dark:bg-theme-table-cell-dirty-dark":this.dirty,"select-none":this.hasMenu,"border-r":!this.withResizer&&this.isLastColumn&&this.outerBorder||!this.withResizer&&this.separateCells&&!this.isLastColumn}}get value(){return this._value?.toString()}set value(t){const e=this._value;this._value=t,this.requestUpdate("value",e)}get originalValue(){return this._originalValue?.toString()}set originalValue(t){const e=this._originalValue;this._originalValue=t,this.requestUpdate("value",e)}dispatchChangedEvent(){"string"==typeof this.originalValue&&this.dispatchEvent(new np({name:this.originalValue,data:{name:this.value}}))}onMenuSelection(t){t.stopPropagation();let e=!1;const i=this.originalValue??this.value??"",n=this.plugins?.find((({tagName:e})=>t.value.value===e));if(n)return this.dispatchEvent(new sp(i,{...n,columnName:i}));if("uninstall-column-plugin"===t.value.value){const t=this.installedPlugins[i];if(!t)throw new Error(`Attempting to uninstall a non-existent plugin on ${i}`);this.dispatchEvent(new ap(i,t))}switch(t.value.value){case"hide":return this.hideColumn();case"rename":return this.isEditing=!0;case"delete":return this.removeColumn();case"reset":return this.dispatchEvent(new np({name:this.originalValue??"",data:{value:this.value}})),this.value=this.originalValue??"";case"pin":return void this.dispatchPinnedEvent(!0);default:e=!0}e&&this.dispatchEvent(new lp({name:this.originalValue??this.value??"",data:{action:t.value.value}}))}dispatchPinnedEvent(t){const e=this.originalValue??this.value;if(!e)throw new Error("Column has no value or original value to identify it");this.dispatchEvent(new hp({name:e,data:{previousValue:this.originalValue,value:this.value,pinned:t}}))}onContextMenu(t){const e=this.shadowRoot?.querySelector("astra-th-menu");e&&(t.preventDefault(),e.isOpen=!0)}onClick(t){const e=t.composedPath(),i=e.some((t=>"wormhole"===t.getAttribute?.("id"))),n=this.originalValue??this.value,r=!e.some((t=>"column-resizer"===t.tagName?.toLowerCase()));!i&&n&&r&&this.dispatchEvent(new lp({name:n,data:{action:"sort"}}))}removeColumn(){if(!this.originalValue)throw new Error("missing OG value");this.dispatchEvent(new rp({name:this.originalValue}))}hideColumn(){if(!this.originalValue)throw new Error("missing column name (i.e. this.originalValue)");this.dispatchEvent(new op({name:this.originalValue}))}connectedCallback(){super.connectedCallback(),this.addEventListener("contextmenu",this.onContextMenu),this.addEventListener("click",this.onClick)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("contextmenu",this.onContextMenu),this.removeEventListener("click",this.onClick)}willUpdate(t){super.willUpdate(t),t.has("plugins")&&(this._pluginOptions=this.plugins?.map((t=>({label:t.displayName,value:t.tagName})))??[]),t.has("readonly")&&(this.readonly?this.options=[{label:this.pinned?"Unpin Column":"Pin Column",value:"pin"},{label:"Sort A-Z",value:"sort:alphabetical:ascending"},{label:"Sort Z-A",value:"sort:alphabetical:descending"},{label:"Hide Column",value:"hide"},{label:"Delete Column",value:"delete",classes:"text-red-500 dark:text-red-400/90 hover:text-red-600 dark:hover:text-red-400 hover:bg-red-50 dark:hover:bg-red-500/10"}]:this.options=[{label:this.pinned?"Unpin Column":"Pin Column",value:"pin"},{label:"Sort A-Z",value:"sort:alphabetical:ascending"},{label:"Sort Z-A",value:"sort:alphabetical:descending"},{label:"Hide Column",value:"hide"},{label:"Rename Column",value:"rename"},{label:"Delete Column",value:"delete",classes:"text-red-500 dark:text-red-400/90 hover:text-red-600 dark:hover:text-red-400 hover:bg-red-50 dark:hover:bg-red-500/10"}]),(t.has("isFirstColumn")||t.has("isFirstColumn"))&&this.isFirstColumn&&this.setAttribute("first-cell","true")}render(){const t=this.originalValue??this.value??"",e=void 0!==this.installedPlugins?.[t]&&!this.installedPlugins?.[t]?.isDefaultPlugin,i=this.dirty?[...this.options,{label:Pu`Revert to ${this.originalValue}`,value:this.originalValue,id:"reset"}]:[...this.options];this._pluginOptions.length>0&&i.splice(3,0,e?{label:Pu`Remove Plugin `,value:"uninstall-column-plugin"}:{label:Pu`
    Plugins
    `,value:"plugins",subItems:this._pluginOptions,scrollSubItems:!0});const n={dark:"dark"==this.theme},r={dark:"dark"==this.theme,"flex-auto":!0,"text-sm":!0};if(this.blank)return Pu`
    `;{const t=this.isEditing?Pu``:this.hasMenu?Pu` + ${this.value} + `:Pu`${this.value}`;return this.withResizer?Pu` + + ${t} + {this._previousWidth=this.width??0}} + @resize=${({delta:t})=>{this.width=this._previousWidth+t}} + > + + `:Pu`
    ${t}
    `}}};uV([nd({attribute:"table-height",type:Number})],dV.prototype,"tableHeight",void 0),uV([nd({attribute:"with-resizer",type:Boolean})],dV.prototype,"withResizer",void 0),uV([nd({attribute:"plugins",type:Array})],dV.prototype,"plugins",void 0),uV([nd({attribute:"installed-plugins",type:Object})],dV.prototype,"installedPlugins",void 0),uV([nd({attribute:"options",type:Array})],dV.prototype,"options",void 0),uV([nd({attribute:"value",type:String})],dV.prototype,"value",null),uV([nd({attribute:"original-value",type:String})],dV.prototype,"originalValue",null),uV([rd()],dV.prototype,"_previousWidth",void 0),uV([rd()],dV.prototype,"_options",void 0),uV([rd()],dV.prototype,"_pluginOptions",void 0),dV=uV([td("astra-th")],dV);var pV=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s};let fV=class extends _p{set data(t){this.rows=t}get data(){return this.rows}updateVisibleColumnIndexesAndSpacers(){const t=this.scrollableEl?.value?.scroller?.value;if(!t||0===this.visibleColumns.length)return this.visibleColumnStartIndex=0,this.visibleColumnEndIndex=0,this.leftSpacerWidth=0,void(this.rightSpacerWidth=0);const e=t.scrollLeft,i=t.clientWidth;if(this.visibleColumnsWidth<=i)return this.visibleColumnStartIndex=0,this.visibleColumnEndIndex=this.visibleColumns.length,this.leftSpacerWidth=0,void(this.rightSpacerWidth=0);let n=0,r=0,o=0,s=!1,a=!1;for(let t=0;te&&(r=t,s=!0),n+=a,n>e+i-(this.selectableRows?42:0)-this.pinnedColumnsWidth){o=t;break}}0===o&&(o=this.visibleColumns.length);const l=Math.max(0,r-3);this.visibleColumnStartIndex!==l&&(a=!0,this.visibleColumnStartIndex=l);const h=Math.min(this.visibleColumns.length,o+3);this.visibleColumnEndIndex!==h&&(a=!0,this.visibleColumnEndIndex=h);let c=0;for(let t=0;t + {t.preventDefault()}} + @toggle-check=${()=>{this.rows.length===this.selectedRowUUIDs.size?(this.selectedRowUUIDs=new Set,this.allRowsSelected=!1):(this.selectedRowUUIDs=new Set(this.rows.map((({id:t})=>t))),this.allRowsSelected=!0),this._onRowSelection()}} + > + + `,this.pinnedColumns=[],this.pinnedColumnsWidth=0,this.rowHeightTimeoutId=null,this.fromIdToRowMap={},this._previousWidth=0,this.unpinnedTableSection=Nu,this.pinnedTableSection=Nu,this.updateTableView=this.updateTableView.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this._onResize=this._onResize?mF(this._onResize,50).bind(this):this._onResize.bind(this)}addNewRow(t){const e={id:t?.id??self.crypto.randomUUID(),values:t?.values??{},originalValues:t?.originalValues??{},isNew:t?.isNew??!0,isDeleted:!1};return this.rows.push(e),this.requestUpdate("rows"),this.dispatchEvent(new up(e)),e}addNewColumn(t){const e={is_nullable:!1,name:t,position:this.columns.length,model:"column",type:Gd.TEXT,unique:!1,primaryKey:!1,autoIncrement:!1,status:jd.created};this.columns=[...this.columns,e],this.rows=this.rows.map((e=>({...e,values:{...e.values,[t]:""}}))),this.dispatchEvent(new ip({name:t})),this.updateVisibleColumnIndexesAndSpacers()}toggleSelectedRow(t){const e=this.selectedRowUUIDs=new Set(this.selectedRowUUIDs);e.has(t)?e.delete(t):e.add(t),this._onRowSelection()}clearSelection(){this.selectedRowUUIDs=new Set,this.removedRowUUIDs=new Set,this.shadowRoot?.querySelectorAll(".row-select-checkbox").forEach((t=>{t.checked=!1,t.dispatchEvent(new Event("change"))}))}resetValues(){this.rows=this.rows.filter((({isNew:t})=>!t)).map((t=>({...t,values:{...t.originalValues},isDeleted:!1})))}deleteSelectedRows(){this.selectedRowUUIDs.forEach((t=>this.removedRowUUIDs.add(t)));const t=[];this.selectedRowUUIDs.forEach((e=>{const i=this.rows.find((({id:t})=>e===t));i&&t.push(i)})),this.dispatchEvent(new dp(t)),this.selectedRowUUIDs=new Set,this.requestUpdate("removedRowUUIDs")}resetParams(){this.clearSelection(),this.hiddenColumnNames=[]}_onColumnRemoved({name:t}){this.deletedColumnNames.push(t),this.requestUpdate("columns"),this.updateVisibleColumnIndexesAndSpacers()}_onColumnHidden({name:t}){this.hiddenColumnNames.push(t)}_onRowSelection(){const t=[];this.selectedRowUUIDs.forEach((e=>{const i=this.fromIdToRowMap[e];i&&t.push(i)})),this.dispatchEvent(new pp(t))}widthForColumnType(t,e=0){const i=this.visibleColumns.find((({name:e})=>t===e))?.type?.toUpperCase();return[Gd.BIGINT,Gd.DECIMAL,Gd.DECIMAL,Gd.DOUBLE_PRECISION,Gd.INTEGER,Gd.NUMERIC,Gd.REAL,Gd.SMALLINT,Gd.INT].includes(i)?150+e:[Gd.CHAR,Gd.TEXT,Gd.VARCHAR,Gd.VARYING].includes(i)?200+e:[Gd.TIME,Gd.DATE,Gd.TIMESTAMP].includes(i)?110+e:[Gd.TIME_WITH_TIME_ZONE,Gd.DATETIME,Gd.TIMESTAMP_WITH_TIME_ZONE].includes(i)||[Gd.JSON,Gd.JSONB].includes(i)?200+e:[Gd.UUID].includes(i)?300+e:200+e}onKeyDown(t){const e=t.composedPath()[0];if(!(e instanceof HTMLElement&&"INPUT"!==e.tagName&&"TEXTAREA"!==e.tagName))return;const{shiftKey:i,key:n}=t;if(i){if("C"===n){const t=`Column ${Date.now()}`,e=prompt("Choose a unique name for this column",t)||t;this.addNewColumn(e)}"R"===n&&this.addNewRow(),"D"===n&&this.deleteSelectedRows()}}_onColumnResizeStart({name:t}){this._previousWidth=this.columnWidthOffsets[t]??0}_onColumnResized(t){const{delta:e,name:i}=t;this.columnWidthOffsets={...this.columnWidthOffsets,[i]:this._previousWidth+e}}_onColumnPluginDeactivated({column:t}){this.installedPlugins&&(delete this.installedPlugins[t],this.requestUpdate("installedPlugins"))}_onResize(t){t.target!==this&&this.updateTableView()}setCssVariablesForPlugin(t){"undefined"!=typeof document&&("dark"==t?(document.documentElement.style.setProperty("--ob-background-color","#0A0A0A"),document.documentElement.style.setProperty("--ob-text-color","#FFFFFF"),document.documentElement.style.setProperty("--ob-border-color","#262626"),document.documentElement.style.setProperty("--ob-null-text-color","#959497")):(document.documentElement.style.setProperty("--ob-background-color","#FAFAFA"),document.documentElement.style.setProperty("--ob-text-color","#000000"),document.documentElement.style.setProperty("--ob-border-color","#E5E5E5"),document.documentElement.style.setProperty("--ob-null-text-color","#D0D0D0")),document.documentElement.style.setProperty("--ob-font-family",'"Inter", sans-serif'),document.documentElement.style.setProperty("--ob-cell-font-family",'"Inter", sans-serif'))}updateTableView(){this.virtualizedYScrollingIsDisabled?(this.visibleRowStartIndex=0,this.visibleRowEndIndex=this.oldRows.length):this.updateVisibleRowIndexes(),this.updateVisibleColumnIndexesAndSpacers()}updateVisibleRowIndexes(){const t=this.visibleRowStartIndex,e=this.visibleRowEndIndex,i=this.scrollableEl?.value?.scroller?.value?.scrollTop??0,n=this.oldRows,r=Math.max(Math.floor(i/this.rowHeight)-4,0),o=r+this.numberOfVisibleRows()+4,s=o{const t=e.offsetHeight;this.scrollableEl?.value?.removeChild(e),this.rowHeight!==t&&(this.rowHeight=t)}),0),setTimeout(this.updateTableView,0)}updated(t){super.updated(t);const e=t.has.bind(t);e("pinnedColumns")&&(this.pinnedColumnsWidth=this.pinnedColumns.reduce(((t,e)=>t+this.widthForColumnType(e.name,this.columnWidthOffsets[e.name])),0)),(e("pinnedColumns")||e("visibleColumns")||e("oldRows")||e("newRows")||e("selectableRows")||e("visibleColumnStartIndex")||e("visibleColumnEndIndex")||e("columnWidthOffsets")||e("renamedColumnNames")||e("installedPlugins")||e("columnOptions")||e("plugins")||e("theme")||e("isNonInteractive")||e("readonly")||e("hasColumnMenus")||e("staticWidths")||e("activeColumn")||e("outerBorder"))&&(this.pinnedTableSection=this._renderTable(this.pinnedColumns,!0)),(e("visibleColumns")||e("oldRows")||e("newRows")||e("selectableRows")||e("visibleColumnStartIndex")||e("visibleColumnEndIndex")||e("columnWidthOffsets")||e("renamedColumnNames")||e("installedPlugins")||e("columnOptions")||e("plugins")||e("theme")||e("isNonInteractive")||e("readonly")||e("hasColumnMenus")||e("staticWidths")||e("activeColumn")||e("outerBorder"))&&(this.unpinnedTableSection=this._renderTable(this.visibleColumns)),e("rows")&&(this.fromIdToRowMap={},this.newRows=[],this.oldRows=[],this.rows.forEach((t=>{!t.isNew||t.isDeleted||this.removedRowUUIDs.has(t.id)||this.newRows.push(t),t.isNew||t.isDeleted||this.removedRowUUIDs.has(t.id)||this.oldRows.push(t),this.fromIdToRowMap[t.id]=t})),this.updateTableView()),(e("columns")||e("hiddenColumnNames")||e("deletedColumnNames")||e("pinnedColumns"))&&(this.visibleColumns=this.columns.filter((({name:t,status:e})=>e!==jd.deleted&&-1===this.hiddenColumnNames.indexOf(t)&&-1===this.deletedColumnNames.indexOf(t)&&!this.pinnedColumns.find((e=>e.name===t)))),this.visibleColumnsWidth=this.visibleColumns.reduce(((t,e)=>t+this.widthForColumnType(e.name,this.columnWidthOffsets[e.name])),0))}willUpdate(t){var e,i,n;if(super.willUpdate(t),t.has("schema")&&this.schema&&(this.columns=this.schema.columns,this.columnTypes=(e=this.columns,i="name",n="type",e?.reduce(((t,e)=>({...t,[e[i]]:e[n]})),{})??[])),t.has("theme")&&this.setCssVariablesForPlugin(this.theme),t.has("selectedRowUUIDs")){if(0===this.rows.length)return;this.selectedRowUUIDs.size!==this.rows.length&&this.allRowsSelected?this.allRowsSelected=!1:this.selectedRowUUIDs.size!==this.rows.length||this.allRowsSelected||(this.allRowsSelected=!0),this.updateTableView()}(t.has("hiddenColumnNames")||t.has("schema")||t.has("rows"))&&setTimeout(this.updateTableView,0),t.has("pinnedColumns")&&this.updateTableView()}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this._onResize)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.onKeyDown),null!==this.rowHeightTimeoutId&&clearTimeout(this.rowHeightTimeoutId),window.removeEventListener("resize",this._onResize)}_renderTable(t,e=!1){const{visibleRowStartIndex:i,visibleRowEndIndex:n,visibleColumns:r,pinnedColumns:o,selectableRows:s,newRows:a,oldRows:l,_selectAllCheckbox:h,visibleColumnStartIndex:c,visibleColumnEndIndex:u,columnWidthOffsets:d,renamedColumnNames:p,columnOptions:f,plugins:g,installedPlugins:m,realInstalledPlugins:v,theme:y,isNonInteractive:b,readonly:w,hasColumnMenus:x,staticWidths:_,activeColumn:k,outerBorder:S,bottomBorder:A,selectedRowUUIDs:C,columnTypes:M,hasCellMenus:D}=this,T=s&&e?h:Nu,I=_F(t,(({name:t},e)=>t),(({name:i},n)=>!(nu)||e?Pu` + {const e=this.columns.find((e=>e.name===t.name)),i=e?o.indexOf(e):-1;i>-1?o.splice(i,1):e&&o.push(e),this.requestUpdate("pinnedColumns")}} + ?read-only=${this.readonly} + > + + `:Nu)),O=s?_F(this.newRows,(({id:t})=>t),(({id:t})=>Pu` + this.toggleSelectedRow(t)} theme=${y} /> + `)):Nu,E=s?Pu`
    + ${_F(this.oldRows,(({id:t})=>t),(({id:t},e)=>e>=i-4&&e + this.toggleSelectedRow(t)} + > + `:Nu))} +
    `:Nu,P=e?Nu:r.map((({name:i},n)=>{if(nu)return Nu;const r=n+c,o=g?.find((({pluginWorkspaceId:t})=>t===m?.[i]?.plugin_workspace_id)),s=g?.find((({id:t})=>t===m?.[i]?.plugin_installation_id)),l=o??s,h=v?.find((({plugin_workspace_id:t})=>l?.pluginWorkspaceId===t));return l&&h?.config&&(l.config=JSON.stringify(h?.config)),Pu`
    + ${_F(a,(({id:t})=>t),(({id:n,values:o,originalValues:s},a)=>Pu` + + + `))} +
    `})),L=e?Nu:t.map((({name:r},o)=>{if(ou)return Nu;const s=o+c,a=g?.find((({pluginWorkspaceId:t})=>t===m?.[r]?.plugin_workspace_id)),h=g?.find((({id:t})=>t===m?.[r]?.plugin_installation_id)),d=a??h,p=v?.find((({plugin_workspace_id:t})=>d?.pluginWorkspaceId===t));return d&&p?.config&&(d.config=JSON.stringify(p?.config)),Pu`
    + ${_F(l,(({id:t})=>t),(({id:o,values:a,originalValues:l},h)=>h>=i-4&&h + + `:Nu))} +
    `})),R=e?t.map((({name:r},o)=>{const s=o+c,a=g?.find((({pluginWorkspaceId:t})=>t===m?.[r]?.plugin_workspace_id)),h=g?.find((({id:t})=>t===m?.[r]?.plugin_installation_id)),u=a??h,d=v?.find((({plugin_workspace_id:t})=>u?.pluginWorkspaceId===t));return u&&d?.config&&(u.config=JSON.stringify(d?.config)),Pu`
    + ${_F(l,(({id:t})=>t),(({id:o,values:a,originalValues:l},h)=>h>=i-4&&h + + `:Nu))} +
    `})):Nu,N=e?t.map((({name:i},n)=>{const r=n+c,o=g?.find((({pluginWorkspaceId:t})=>t===m?.[i]?.plugin_workspace_id)),s=g?.find((({id:t})=>t===m?.[i]?.plugin_installation_id)),l=o??s,h=v?.find((({plugin_workspace_id:t})=>l?.pluginWorkspaceId===t));return l&&h?.config&&(l.config=JSON.stringify(h?.config)),Pu`
    + ${_F(a,(({id:t})=>t),(({id:n,values:o,originalValues:s},a)=>Pu` + + + `))} +
    `})):Nu;return Pu` +
    + +
    ${T} ${I}
    + + +
    + + + ${e?Pu`
    +
    + +
    + +
    ${O}
    + + + ${E} +
    +
    + +
    +
    ${N}
    +
    ${R}
    +
    +
    `:Nu} + + +
    ${P}
    +
    ${L}
    + + +
    +
    `}render(){const t=Pu`
    + +
    + + +
    + + + +
    + +
    +
    + ${_F(this.newRows,(({id:t})=>t),(({id:t},e)=>Pu` + + + `))} +
    +
    + + +
    +
    + ${_F(this.oldRows,(({id:t})=>t),(({id:t},e)=>e>=this.visibleRowStartIndex-4&&e + + `:Nu))} +
    +
    + +
    +
    `;return Pu` + + +
    + + ${this.pinnedTableSection} + + +
    + + + ${this.unpinnedTableSection} + + +
    + + + ${t} +
    +
    + `}};pV([nd({type:Boolean,attribute:"selectable-rows"})],fV.prototype,"selectableRows",void 0),pV([nd({attribute:"keyboard-shortcuts",type:Boolean})],fV.prototype,"keyboardShortcuts",void 0),pV([nd({attribute:"schema",type:Object})],fV.prototype,"schema",void 0),pV([nd({attribute:"data",type:Array})],fV.prototype,"data",null),pV([nd({attribute:"plugins",type:Array})],fV.prototype,"plugins",void 0),pV([nd({attribute:"installed-plugins",type:Array})],fV.prototype,"installedPlugins",void 0),pV([nd({attribute:"real-installed-plugins",type:Array})],fV.prototype,"realInstalledPlugins",void 0),pV([nd({attribute:"non-interactive",type:Boolean})],fV.prototype,"isNonInteractive",void 0),pV([nd({attribute:"static-widths",type:Boolean})],fV.prototype,"staticWidths",void 0),pV([nd({attribute:"auth-token",type:String})],fV.prototype,"authToken",void 0),pV([nd({attribute:"column-options",type:Array})],fV.prototype,"columnOptions",void 0),pV([nd({attribute:"outer-border",type:Boolean})],fV.prototype,"outerBorder",void 0),pV([nd({attribute:"border-b",type:Boolean})],fV.prototype,"bottomBorder",void 0),pV([nd({attribute:"hidden-columns",type:Array})],fV.prototype,"hiddenColumnNames",void 0),pV([nd({attribute:"deleted-columns",type:Array})],fV.prototype,"deletedColumnNames",void 0),pV([nd({attribute:"renamed-columns",type:Object})],fV.prototype,"renamedColumnNames",void 0),pV([nd({attribute:"plugin-attributes",type:String})],fV.prototype,"pluginAttributes",void 0),pV([nd({attribute:"read-only",type:Boolean})],fV.prototype,"readonly",void 0),pV([rd()],fV.prototype,"contentScrollsHorizontally",void 0),pV([nd({attribute:"column-width-offsets",type:Object})],fV.prototype,"columnWidthOffsets",void 0),pV([nd({attribute:"addable-columns",type:Boolean})],fV.prototype,"addableColumns",void 0),pV([nd({attribute:"active-column",type:String})],fV.prototype,"activeColumn",void 0),pV([nd({attribute:"blurry",type:Boolean})],fV.prototype,"blurry",void 0),pV([nd({attribute:"column-menus",type:Boolean})],fV.prototype,"hasColumnMenus",void 0),pV([nd({attribute:"cell-menus",type:Boolean})],fV.prototype,"hasCellMenus",void 0),pV([nd({attribute:"virtualized-y-scrolling-disabled",type:Boolean})],fV.prototype,"virtualizedYScrollingIsDisabled",void 0),pV([rd()],fV.prototype,"scrollableEl",void 0),pV([rd()],fV.prototype,"rows",void 0),pV([rd()],fV.prototype,"newRows",void 0),pV([rd()],fV.prototype,"oldRows",void 0),pV([rd()],fV.prototype,"allRowsSelected",void 0),pV([rd()],fV.prototype,"columns",void 0),pV([nd({type:Array})],fV.prototype,"visibleColumns",void 0),pV([rd()],fV.prototype,"selectedRowUUIDs",void 0),pV([rd()],fV.prototype,"removedRowUUIDs",void 0),pV([rd()],fV.prototype,"columnTypes",void 0),pV([rd()],fV.prototype,"rowHeight",void 0),pV([rd()],fV.prototype,"_height",void 0),pV([rd()],fV.prototype,"visibleRowEndIndex",void 0),pV([rd()],fV.prototype,"visibleRowStartIndex",void 0),pV([rd()],fV.prototype,"visibleColumnStartIndex",void 0),pV([rd()],fV.prototype,"visibleColumnEndIndex",void 0),pV([rd()],fV.prototype,"leftSpacerWidth",void 0),pV([rd()],fV.prototype,"rightSpacerWidth",void 0),pV([nd({attribute:"pinned-columns",type:Array})],fV.prototype,"pinnedColumns",void 0),pV([rd()],fV.prototype,"unpinnedTableSection",void 0),pV([rd()],fV.prototype,"pinnedTableSection",void 0),fV=pV([td("astra-table")],fV);var gV=fV;function mV(t,e){const i={};for(const n in t)t[n]!==e[n]&&(i[n]=t[n]);return i}function vV(t,e){return new Set([...Object.keys(t),...Object.keys(e)]).forEach((i=>{i in t||(t[i]=void 0),i in e||(e[i]=void 0)})),[t,e]}function yV(t,e=1){let i=JSON.stringify(t,null,e);const n=e>0?" ".repeat(e):"";return i=i.replace(/\n\s*/g,n),"{}"===i?"{ }":i}var bV=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s};let wV=class extends _p{constructor(){super(...arguments),this.label="",this.isOpen=!1}render(){return Pu`
    this.isOpen=!this.isOpen} + > + ${this.isOpen?sV(12):FF(12)} + ${this.isOpen?(t=>Pu` + + + +`)(12):(t=>Pu` + + + +`)(12)} + ${this.label} +
    + ${this.isOpen?Pu``:Nu}`}};bV([nd()],wV.prototype,"label",void 0),bV([nd({type:Boolean,attribute:"open"})],wV.prototype,"isOpen",void 0),wV=bV([td("outerbase-table-list-item")],wV);var xV=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s};let _V=class extends gV{constructor(){super(),this.showSidebar=!1,this.showEditor=!1,this.codeEditorValue="",this.offset=0,this.limit=50,this.total=0,this.hasSelectedRows=!1,this.hasChanges=!1,this.onCellUpdated=this.onCellUpdated.bind(this),this.onMenuSelection=this.onMenuSelection.bind(this),this.onRunQuery=this.onRunQuery.bind(this)}async fetchSchema(){if(!(this.apiKey&&this.baseId&&this.workspaceId))throw new Error("Fetching data requires an auth-token/api-key, base-id, and workspace id.");return(await(await fetch(`https://${ZB}/api/v1/workspace/${this.workspaceId}/base/${this.baseId}/schema`,{headers:{"content-type":"application/json","x-auth-token":this.apiKey}})).json()).response}async fetchData(){if(!this.apiKey)throw new Error("Fetching data requires an api-key");if(!this.fields)throw new Error("Missing fields");const t=await(await fetch(`https://${ZB}/api/v1/workspace/${this.workspaceId}/base/${this.baseId}/table/${this.schemaName}/${this.tableName}/rows`,{body:`{"fields":${JSON.stringify(this.fields)},"filters":[],"include_count":true,"limit":${this.limit},"offset":${this.offset},"order":[]}`,headers:{"content-type":"application/json","x-auth-token":this.apiKey},method:"POST"})).json(),e=[];return t.response.items.forEach((t=>{const i={};Object.entries(t).forEach((([t,e])=>{const n=t.toString();n&&e&&(i[n]="object"==typeof e?yV(e):e?.toString())})),e.push(i)})),{...t.response,items:e}}async fetchConnections(){if(!this.apiKey)throw new Error("Fetching data requires an api-key");const t=await(await fetch(`https://${ZB}/api/v1/workspace/${this.workspaceId}/connection`,{headers:{"content-type":"application/json","x-auth-token":this.apiKey},method:"GET"})).json();let e=t?.response?.items??[];if(this.baseId){if(!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/.test(this.baseId))throw new Error("attempted to fetch connection source with non-uuid for base; this endpoint only works with UUIDs?");e=e.filter((t=>t.base_id===this.baseId))}return e}async queryData(){if(!this.apiKey)throw new Error("Fetching data requires an api-key");if(!this.codeEditorValue)throw new Error("Missing SQL query");const t=await(await fetch(`https://${ZB}/api/v1/workspace/${this.workspaceId}/base/${this.baseId}/query/raw`,{body:JSON.stringify({query:this.codeEditorValue,options:{}}),headers:{"content-type":"application/json","x-auth-token":this.apiKey},method:"POST"})).json(),e=[];return t.response.items.forEach((t=>{const i={};Object.entries(t).forEach((([t,e])=>{const n=t.toString();n&&e&&(i[n]="object"==typeof e?yV(e):e?.toString())})),e.push(i)})),{...t.response,items:e}}detectChanges(){this.hasChanges=this.rows.some((t=>{if(t.isDeleted||t.isNew)return!0;const[e,i]=vV(t.originalValues,t.values);return!vF(e,i)}))||this.newRows.length>0}onAddRow(t){this.addNewRow()}async refreshData(t){const e=t??await this.fetchData();this.data=e.items.map((t=>({id:self.crypto.randomUUID(),values:{...t},originalValues:{...t},isNew:!1,isDeleted:!1}))),this.total=e.count,this.hasChanges=!1}async onRefresh(){const[t,e]=await Promise.all([this.refreshData(),this.fetchSchema()]);this.sourceSchema=e}onDeleteRows(t){const e=this.rows.filter((t=>this.selectedRowUUIDs.has(t.id)));e.forEach((t=>t.isDeleted=!0)),this.requestUpdate("rows"),this.clearSelection(),this.detectChanges()}async onSaveRows(){if(!(this.apiKey&&this.baseId&&this.workspaceId))throw new Error("Saving data requires an auth-token/api-key, base-id, and workspace id.");const t=[],e=[],i=[];this.rows.forEach((n=>{if(n.isNew&&!n.isDeleted)t.push(n);else if(n.isDeleted&&!n.isNew)e.push(n);else if(!n.isDeleted&&!n.isNew){const[t,e]=vV(n.originalValues,n.values);vF(t,e)||i.push(n)}}));const n=this.table?.constraints.find((({type:t})=>t?.toLowerCase().includes("primary")))?.column,r={create:t.map((t=>t.values)),update:i.map((t=>({where:n?{[n]:t.originalValues[n]}:t.originalValues,set:mV(t.values,t.originalValues)}))),remove:e.map((t=>n?{[n]:t.originalValues[n]}:t.originalValues))},o=await fetch(`https://${ZB}/api/v1/workspace/${this.workspaceId}/base/${this.baseId}/table/${this.schemaName}/${this.tableName}/rows`,{method:"PUT",body:JSON.stringify(r),headers:{"Content-Type":"application/json","x-auth-token":this.apiKey}});200===o.status?this.onRefresh():console.error(o)}onDiscardChanges(){this.resetValues(),this.hasChanges=!1}onClickNextPage(){this.offset+this.limit>this.total||(this.offset+=this.limit)}onClickPreviousPage(){this.offset<1||(this.offset-=this.limit)}onCellUpdated(t){const e=t,{column:i,row:n}=e.detail.position,r=this.rows.find((t=>t.id===n));if(!r)throw new Error(`Failed to find row with ID = ${n}`);r.values[i]=e.detail.value,this.hasChanges=this.hasChanges||r.values[i]!==r.originalValues[i]}onCellBlurred(t){this.detectChanges()}onRowAdded(t){this.hasChanges=!0}onMenuSelection(t){"reset"===t.value.value&&this.detectChanges()}async onRunQuery(t){const e=await this.queryData();e.count=e.items.length,this.refreshData(e);const i=Object.keys(e.items[0]??{}).map((t=>({name:t})));this.schema={columns:i},this.isNonInteractive=!0,this.readonly=!0,this.selectableRows=!1}async updated(t){super.updated(t);const e=t.has.bind(t);if(e("starlink")&&this.starlink){const t=new URLSearchParams(this.starlink.split("?")[1]);this.apiKey=t.get("auth_token")??void 0,this.baseId=t.get("base_id")??void 0,this.workspaceId=t.get("workspace_id")??void 0}if((e("tableName")||e("schemaName")&&this.tableName&&this.schemaName)&&(this.offset=0),(e("apiKey")||e("baseId")||e("workspaceId"))&&(this.sourceSchema=await this.fetchSchema(),this.schemaName||(this.sourceSchema.public?this.schemaName="public":this.schemaName=Object.keys(this.sourceSchema)?.[0]),!this.tableName)){const t=this.sourceSchema[this.schemaName];t&&t.length>0&&(this.tableName=t[0].name)}(e("apiKey")||e("baseId")||e("workspaceId")||e("schemaName")||e("tableName"))&&this.apiKey&&this.baseId&&this.workspaceId&&this.schemaName&&this.tableName&&this.sourceSchema&&(this.table=this.sourceSchema[this.schemaName]?.find((({name:t})=>t===this.tableName)),this.table&&(this.schema={columns:this.table.columns},this.fields=this.table.columns.map((({name:t})=>({field:t,alias:t}))))),!this.showEditor&&(e("apiKey")||e("baseId")||e("workspaceId")||e("fields")||e("offset"))&&this.apiKey&&this.baseId&&this.workspaceId&&this.fields&&this.refreshData(),this.hasSelectedRows=this.selectedRowUUIDs.size>0}connectedCallback(){super.connectedCallback(),this.addEventListener("cell-updated",this.onCellUpdated),this.addEventListener("cell-blurred",this.onCellBlurred),this.addEventListener("row-added",this.onRowAdded),this.addEventListener("menu-selection",this.onMenuSelection)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("cell-updated",this.onCellUpdated),this.removeEventListener("cell-blurred",this.onCellBlurred),this.removeEventListener("row-added",this.onRowAdded),this.removeEventListener("menu-selection",this.onMenuSelection)}onTableSelection(t,e){this.schemaName=t,this.tableName=e}renderSidebar(){const t=this.sourceSchema;if(!t)return null;const e=Object.entries(t);return Pu`
    +

    + Tables +

    +
    + +
      + + ${e.map((([t,e])=>Pu` + ${e?.sort(((t,e)=>t.name.localeCompare(e.name))).map((e=>Pu`
    • {(this.hasChanges&&confirm("Discard unsaved changes?")||!this.hasChanges)&&this.onTableSelection(t,e.name)}} + > + ${(t=>Pu` + + `)(14)} + ${e.name} +
    • `))} +
      `))} +
    +
    +
    +
    `}render(){const t=super.render(),e=Pu` +
    + {this.codeEditorValue=t}} + > + + + +
    + `,i=this.hasSelectedRows?Pu`Delete Rows`:null,n=this.hasChanges?Pu`Save`:null,r=this.hasChanges?Pu`Discard`:null,o={"w-8":!0,"h-8":!0,"rounded-md":!0,flex:!0,"items-center":!0,"justify-center":!0},s=this.offset>0,a=this.offset+this.limit + Viewing ${Math.min(this.offset+1,this.total)}-${Math.min(this.offset+this.limit,this.total)} of ${this.total} +
    + ${(t=>Pu` + + `)(16)} + ${this.total?this.offset/this.limit+1:1} + ${FF(16)} +
    + `,d=Pu` +
    + +
    + + {this.showEditor&&(this.previousTotal&&(this.total=this.previousTotal),this.previousData&&(this.data=this.previousData),this.previousSchema&&(this.schema=this.previousSchema),this.isNonInteractive=!1,this.readonly=!1,this.selectableRows=!0,delete this.previousTotal,delete this.previousData,delete this.previousSchema),this.showEditor||(this.previousTotal=this.total,this.previousData=this.data,this.previousSchema=this.schema,this.data=[],this.schema={columns:[]}),this.showEditor=!this.showEditor}} + > + ${this.showEditor?"Hide Editor":"Edit Query"} + + + + ${this.showEditor?Pu`Run`:Nu} + + + ${this.showEditor?Nu:Pu`
    ${this.tableName}
    + ${r} ${i} ${n} + Add Row + ${(t=>Lu` + + `)(16)}`} +
    + + + ${this.showEditor?e:Nu} +
    ${t}
    + + + ${u} +
    + `;return Pu` +
    + ${c} ${d} +
    + `}};_V.styles=[...gV.styles,Xc` + :host { + height: 100%; + } + `],xV([nd({attribute:"starlink",type:String})],_V.prototype,"starlink",void 0),xV([nd({attribute:"api-key",type:String})],_V.prototype,"apiKey",void 0),xV([nd({attribute:"workspace-id",type:String})],_V.prototype,"workspaceId",void 0),xV([nd({attribute:"base-id",type:String})],_V.prototype,"baseId",void 0),xV([nd({attribute:"schema-name",type:String})],_V.prototype,"schemaName",void 0),xV([nd({attribute:"table-name",type:String})],_V.prototype,"tableName",void 0),xV([nd({attribute:"side-bar",type:Boolean})],_V.prototype,"showSidebar",void 0),xV([nd({attribute:"show-editor",type:Boolean})],_V.prototype,"showEditor",void 0),xV([nd({attribute:"sql",type:Boolean})],_V.prototype,"codeEditorValue",void 0),xV([nd({type:Number})],_V.prototype,"offset",void 0),xV([nd({type:Number})],_V.prototype,"limit",void 0),xV([nd({type:Number})],_V.prototype,"total",void 0),xV([rd()],_V.prototype,"fields",void 0),xV([rd()],_V.prototype,"sourceSchema",void 0),xV([rd()],_V.prototype,"table",void 0),xV([rd()],_V.prototype,"hasSelectedRows",void 0),xV([rd()],_V.prototype,"hasChanges",void 0),_V=xV([td("outerbase-table")],_V);var kV,SV=_V,AV=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s};!function(t){t.unspecified="",t.label="label",t.h1="h1",t.h2="h2",t.h3="h3",t.h4="h4"}(kV||(kV={}));let CV=class extends Ju{constructor(){super(...arguments),this.variant=kV.unspecified}render(){return Pu``}};CV.styles=[Pd,Xc` + label { + display: block; + font-weight: 500; + font-family: var(--astra-font-family); + color: var(--astra-text-color, inherit); + opacity: 0.8; + cursor: text; + } + .label { + font-weight: 700; + font-size: 12px; + font-family: var(--astra-font-family); + opacity: 0.6; + } + .h1 { + opacity: 1; + font-size: 36px; + line-height: 40px; + font-weight: 600; + margin-bottom: 4px; + } + .h2 { + opacity: 1; + font-size: 24px; + line-height: 32px; + font-weight: 600; + margin-bottom: 4px; + } + .h3 { + opacity: 1; + font-size: 20px; + line-height: 28px; + font-weight: 600; + margin-bottom: 4px; + } + .h4 { + opacity: 1; + font-size: 16px; + line-height: 24px; + font-weight: 600; + margin-bottom: 4px; + } + @media (prefers-color-scheme: dark) { + label { + color: var(--astra-text-color, white); + } + } + `],AV([nd({type:String})],CV.prototype,"variant",void 0),CV=AV([td("astra-text")],CV);var MV=CV;return t.AstraButton=Nd,t.AstraCalendar=Vd,t.AstraCard=Kd,t.AstraComposedChart=oz,t.AstraInput=lz,t.AstraScrollArea=wF,t.AstraSelect=CF,t.AstraTable=gV,t.AstraText=MV,t.Chart=ez,t.OuterbaseTable=SV,t}({}); diff --git a/src/components/scroll-area.ts b/src/components/scroll-area.ts index cc1491e3..b20a8d62 100644 --- a/src/components/scroll-area.ts +++ b/src/components/scroll-area.ts @@ -266,7 +266,7 @@ export default class ScrollArea extends ClassifiedElement { transform: `translateX(${this.horizontalScrollPosition}px)`, width: `${this.horizontalScrollSize}px`, } - let scrollableClasses = `absolute bottom-0 left-0 right-0 top-0 bg-theme-table dark:bg-theme-table-dark` + let scrollableClasses = `absolute bottom-0 left-0 right-0 top-0 bg-theme-table dark:bg-theme-table-dark h-fit` if (this.axis === Axis.both) scrollableClasses += ' overflow-scroll' if (this.axis === Axis.horizontal) scrollableClasses += ' overflow-scroll' if (this.axis === Axis.vertical) scrollableClasses += ' overflow-y-scroll overflow-x-hidden' diff --git a/src/variables.ts b/src/variables.ts index 40d0aaf8..77453fa1 100644 --- a/src/variables.ts +++ b/src/variables.ts @@ -1 +1 @@ -export const OUTERBASE_API_DOMAIN = 'app.outerbase.com' +export const OUTERBASE_API_DOMAIN = 'app.dev.outerbase.com'