import{r as Gn,c as C,d as Zn,p as Wn,b as lt,t as Kn,z as Qn,e as ce,S as $t,E as Jn,F as jn,h as st,i as R,j as pt,o as ti,f as ei,m as ni,u as ii,k as ri,a as si,l as oi}from"./Frame-Cpo70DD7.js";import{L as ai,F as ui}from"./LayersPanel-BajTPlsd.js";function Se(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function pn(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function Et(){}var Ft=.7,Ut=1/Ft,mt="\\s*([+-]?\\d+)\\s*",St="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Q="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",li=/^#([0-9a-f]{3,8})$/,ci=new RegExp(`^rgb\\(${mt},${mt},${mt}\\)$`),hi=new RegExp(`^rgb\\(${Q},${Q},${Q}\\)$`),fi=new RegExp(`^rgba\\(${mt},${mt},${mt},${St}\\)$`),di=new RegExp(`^rgba\\(${Q},${Q},${Q},${St}\\)$`),pi=new RegExp(`^hsl\\(${St},${Q},${Q}\\)$`),gi=new RegExp(`^hsla\\(${St},${Q},${Q},${St}\\)$`),Be={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Se(Et,ht,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Le,formatHex:Le,formatHex8:mi,formatHsl:xi,formatRgb:qe,toString:qe});function Le(){return this.rgb().formatHex()}function mi(){return this.rgb().formatHex8()}function xi(){return gn(this).formatHsl()}function qe(){return this.rgb().formatRgb()}function ht(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=li.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?He(e):n===3?new H(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?Vt(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?Vt(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=ci.exec(t))?new H(e[1],e[2],e[3],1):(e=hi.exec(t))?new H(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=fi.exec(t))?Vt(e[1],e[2],e[3],e[4]):(e=di.exec(t))?Vt(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=pi.exec(t))?Ue(e[1],e[2]/100,e[3]/100,1):(e=gi.exec(t))?Ue(e[1],e[2]/100,e[3]/100,e[4]):Be.hasOwnProperty(t)?He(Be[t]):t==="transparent"?new H(NaN,NaN,NaN,0):null}function He(t){return new H(t>>16&255,t>>8&255,t&255,1)}function Vt(t,e,n,i){return i<=0&&(t=e=n=NaN),new H(t,e,n,i)}function yi(t){return t instanceof Et||(t=ht(t)),t?(t=t.rgb(),new H(t.r,t.g,t.b,t.opacity)):new H}function he(t,e,n,i){return arguments.length===1?yi(t):new H(t,e,n,i??1)}function H(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}Se(H,he,pn(Et,{brighter(t){return t=t==null?Ut:Math.pow(Ut,t),new H(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Ft:Math.pow(Ft,t),new H(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new H(ct(this.r),ct(this.g),ct(this.b),Yt(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Xe,formatHex:Xe,formatHex8:wi,formatRgb:Oe,toString:Oe}));function Xe(){return`#${ut(this.r)}${ut(this.g)}${ut(this.b)}`}function wi(){return`#${ut(this.r)}${ut(this.g)}${ut(this.b)}${ut((isNaN(this.opacity)?1:this.opacity)*255)}`}function Oe(){const t=Yt(this.opacity);return`${t===1?"rgb(":"rgba("}${ct(this.r)}, ${ct(this.g)}, ${ct(this.b)}${t===1?")":`, ${t})`}`}function Yt(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function ct(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function ut(t){return t=ct(t),(t<16?"0":"")+t.toString(16)}function Ue(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Z(t,e,n,i)}function gn(t){if(t instanceof Z)return new Z(t.h,t.s,t.l,t.opacity);if(t instanceof Et||(t=ht(t)),!t)return new Z;if(t instanceof Z)return t;t=t.rgb();var e=t.r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),s=Math.max(e,n,i),o=NaN,u=s-r,l=(s+r)/2;return u?(e===s?o=(n-i)/u+(n0&&l<1?0:o,new Z(o,u,l,t.opacity)}function _i(t,e,n,i){return arguments.length===1?gn(t):new Z(t,e,n,i??1)}function Z(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}Se(Z,_i,pn(Et,{brighter(t){return t=t==null?Ut:Math.pow(Ut,t),new Z(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Ft:Math.pow(Ft,t),new Z(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new H(se(t>=240?t-240:t+120,r,i),se(t,r,i),se(t<120?t+240:t-120,r,i),this.opacity)},clamp(){return new Z(Ye(this.h),Nt(this.s),Nt(this.l),Yt(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Yt(this.opacity);return`${t===1?"hsl(":"hsla("}${Ye(this.h)}, ${Nt(this.s)*100}%, ${Nt(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Ye(t){return t=(t||0)%360,t<0?t+360:t}function Nt(t){return Math.max(0,Math.min(1,t||0))}function se(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const Te=t=>()=>t;function vi(t,e){return function(n){return t+n*e}}function bi(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}function Mi(t){return(t=+t)==1?mn:function(e,n){return n-e?bi(e,n,t):Te(isNaN(e)?n:e)}}function mn(t,e){var n=e-t;return n?vi(t,n):Te(isNaN(t)?e:t)}const Gt=function t(e){var n=Mi(e);function i(r,s){var o=n((r=he(r)).r,(s=he(s)).r),u=n(r.g,s.g),l=n(r.b,s.b),a=mn(r.opacity,s.opacity);return function(c){return r.r=o(c),r.g=u(c),r.b=l(c),r.opacity=a(c),r+""}}return i.gamma=t,i}(1);function ki(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,i=e.slice(),r;return function(s){for(r=0;rn&&(s=e.slice(n,s),u[o]?u[o]+=s:u[++o]=s),(i=i[0])===(r=r[0])?u[o]?u[o]+=r:u[++o]=r:(u[++o]=null,l.push({i:o,x:G(i,r)})),n=oe.lastIndex;return n180?c+=360:c-a>180&&(a+=360),h.push({i:f.push(r(f)+"rotate(",null,i)-2,x:G(a,c)})):c&&f.push(r(f)+"rotate("+c+i)}function u(a,c,f,h){a!==c?h.push({i:f.push(r(f)+"skewX(",null,i)-2,x:G(a,c)}):c&&f.push(r(f)+"skewX("+c+i)}function l(a,c,f,h,d,g){if(a!==f||c!==h){var y=d.push(r(d)+"scale(",null,",",null,")");g.push({i:y-4,x:G(a,f)},{i:y-2,x:G(c,h)})}else(f!==1||h!==1)&&d.push(r(d)+"scale("+f+","+h+")")}return function(a,c){var f=[],h=[];return a=t(a),c=t(c),s(a.translateX,a.translateY,c.translateX,c.translateY,f,h),o(a.rotate,c.rotate,f,h),u(a.skewX,c.skewX,f,h),l(a.scaleX,a.scaleY,c.scaleX,c.scaleY,f,h),a=c=null,function(d){for(var g=-1,y=h.length,$;++g>3}if(o--,s===1||s===2)u+=e.readSVarint(),l+=e.readSVarint(),s===1&&(r&&i.push(r),r=[]),r&&r.push(new rt(u,l));else if(s===7)r&&r.push(r[0].clone());else throw new Error(`unknown command ${s}`)}return r&&i.push(r),i}bbox(){const e=this._pbf;e.pos=this._geometry;const n=e.readVarint()+e.pos;let i=1,r=0,s=0,o=0,u=1/0,l=-1/0,a=1/0,c=-1/0;for(;e.pos>3}if(r--,i===1||i===2)s+=e.readSVarint(),o+=e.readSVarint(),sl&&(l=s),oc&&(c=o);else if(i!==7)throw new Error(`unknown command ${i}`)}return[u,a,l,c]}toGeoJSON(e,n,i){const r=this.extent*Math.pow(2,i),s=this.extent*e,o=this.extent*n,u=this.loadGeometry();function l(h){return[(h.x+s)*360/r-180,360/Math.PI*Math.atan(Math.exp((1-(h.y+o)*2/r)*Math.PI))-90]}function a(h){return h.map(l)}let c;if(this.type===1){const h=[];for(const g of u)h.push(g[0]);const d=a(h);c=h.length===1?{type:"Point",coordinates:d[0]}:{type:"MultiPoint",coordinates:d}}else if(this.type===2){const h=u.map(a);c=h.length===1?{type:"LineString",coordinates:h[0]}:{type:"MultiLineString",coordinates:h}}else if(this.type===3){const h=Hi(u),d=[];for(const g of h)d.push(g.map(a));c=d.length===1?{type:"Polygon",coordinates:d[0]}:{type:"MultiPolygon",coordinates:d}}else throw new Error("unknown feature type");const f={type:"Feature",geometry:c,properties:this.properties};return this.id!=null&&(f.id=this.id),f}}_n.types=["Unknown","Point","LineString","Polygon"];function Li(t,e,n){t===1?e.id=n.readVarint():t===2?qi(n,e):t===3?e.type=n.readVarint():t===4&&(e._geometry=n.pos)}function qi(t,e){const n=t.readVarint()+t.pos;for(;t.pos=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];const n=this._pbf.readVarint()+this._pbf.pos;return new _n(this._pbf,n,this.extent,this._keys,this._values)}}function Ui(t,e,n){t===15?e.version=n.readVarint():t===1?e.name=n.readString():t===5?e.extent=n.readVarint():t===2?e._features.push(n.pos):t===3?e._keys.push(n.readString()):t===4&&e._values.push(Yi(n))}function Yi(t){let e=null;const n=t.readVarint()+t.pos;for(;t.pos>3;e=i===1?t.readString():i===2?t.readFloat():i===3?t.readDouble():i===4?t.readVarint64():i===5?t.readVarint():i===6?t.readSVarint():i===7?t.readBoolean():null}if(e==null)throw new Error("unknown feature value");return e}class Gi{constructor(e,n){this.layers=e.readFields(Zi,{},n)}}function Zi(t,e,n){if(t===3){const i=new Oi(n,n.readVarint()+n.pos);i.length&&(e[i.name]=i)}}function Wi(t){return t}var ae=1,Bt=2,pe=3,Pt=4,We=1e-6;function Ki(t){return"translate("+t+",0)"}function Qi(t){return"translate(0,"+t+")"}function Ji(t){return e=>+t(e)}function ji(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function tr(){return!this.__axis}function vn(t,e){var n=[],i=null,r=null,s=6,o=6,u=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,a=t===ae||t===Pt?-1:1,c=t===Pt||t===Bt?"x":"y",f=t===ae||t===pe?Ki:Qi;function h(d){var g=i??(e.ticks?e.ticks.apply(e,n):e.domain()),y=r??(e.tickFormat?e.tickFormat.apply(e,n):Wi),$=Math.max(s,0)+u,x=e.range(),b=+x[0]+l,T=+x[x.length-1]+l,V=(e.bandwidth?ji:Ji)(e.copy(),l),F=d.selection?d.selection():d,P=F.selectAll(".domain").data([null]),z=F.selectAll(".tick").data(g,e).order(),q=z.exit(),I=z.enter().append("g").attr("class","tick"),B=z.select("line"),v=z.select("text");P=P.merge(P.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),z=z.merge(I),B=B.merge(I.append("line").attr("stroke","currentColor").attr(c+"2",a*s)),v=v.merge(I.append("text").attr("fill","currentColor").attr(c,a*$).attr("dy",t===ae?"0em":t===pe?"0.71em":"0.32em")),d!==F&&(P=P.transition(d),z=z.transition(d),B=B.transition(d),v=v.transition(d),q=q.transition(d).attr("opacity",We).attr("transform",function(S){return isFinite(S=V(S))?f(S+l):this.getAttribute("transform")}),I.attr("opacity",We).attr("transform",function(S){var A=this.parentNode.__axis;return f((A&&isFinite(A=A(S))?A:V(S))+l)})),q.remove(),P.attr("d",t===Pt||t===Bt?o?"M"+a*o+","+b+"H"+l+"V"+T+"H"+a*o:"M"+l+","+b+"V"+T:o?"M"+b+","+a*o+"V"+l+"H"+T+"V"+a*o:"M"+b+","+l+"H"+T),z.attr("opacity",1).attr("transform",function(S){return f(V(S)+l)}),B.attr(c+"2",a*s),v.attr(c,a*$).text(y),F.filter(tr).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===Bt?"start":t===Pt?"end":"middle"),F.each(function(){this.__axis=V})}return h.scale=function(d){return arguments.length?(e=d,h):e},h.ticks=function(){return n=Array.from(arguments),h},h.tickArguments=function(d){return arguments.length?(n=d==null?[]:Array.from(d),h):n.slice()},h.tickValues=function(d){return arguments.length?(i=d==null?null:Array.from(d),h):i&&i.slice()},h.tickFormat=function(d){return arguments.length?(r=d,h):r},h.tickSize=function(d){return arguments.length?(s=o=+d,h):s},h.tickSizeInner=function(d){return arguments.length?(s=+d,h):s},h.tickSizeOuter=function(d){return arguments.length?(o=+d,h):o},h.tickPadding=function(d){return arguments.length?(u=+d,h):u},h.offset=function(d){return arguments.length?(l=+d,h):l},h}function er(t){return vn(Bt,t)}function nr(t){return vn(pe,t)}const ge=Math.PI,me=2*ge,at=1e-6,ir=me-at;function bn(t){this._+=t[0];for(let e=1,n=t.length;e=0))throw new Error(`invalid digits: ${t}`);if(e>15)return bn;const n=10**e;return function(i){this._+=i[0];for(let r=1,s=i.length;rat)if(!(Math.abs(f*l-a*c)>at)||!s)this._append`L${this._x1=e},${this._y1=n}`;else{let d=i-o,g=r-u,y=l*l+a*a,$=d*d+g*g,x=Math.sqrt(y),b=Math.sqrt(h),T=s*Math.tan((ge-Math.acos((y+h-$)/(2*x*b)))/2),V=T/b,F=T/x;Math.abs(V-1)>at&&this._append`L${e+V*c},${n+V*f}`,this._append`A${s},${s},0,0,${+(f*d>c*g)},${this._x1=e+F*l},${this._y1=n+F*a}`}}arc(e,n,i,r,s,o){if(e=+e,n=+n,i=+i,o=!!o,i<0)throw new Error(`negative radius: ${i}`);let u=i*Math.cos(r),l=i*Math.sin(r),a=e+u,c=n+l,f=1^o,h=o?r-s:s-r;this._x1===null?this._append`M${a},${c}`:(Math.abs(this._x1-a)>at||Math.abs(this._y1-c)>at)&&this._append`L${a},${c}`,i&&(h<0&&(h=h%me+me),h>ir?this._append`A${i},${i},0,1,${f},${e-u},${n-l}A${i},${i},0,1,${f},${this._x1=a},${this._y1=c}`:h>at&&this._append`A${i},${i},0,${+(h>=ge)},${f},${this._x1=e+i*Math.cos(s)},${this._y1=n+i*Math.sin(s)}`)}rect(e,n,i,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${i=+i}v${+r}h${-i}Z`}toString(){return this._}}function kn(){return new Mn}kn.prototype=Mn.prototype;function Lt(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function sr(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function $n(t){let e,n,i;t.length!==2?(e=Lt,n=(u,l)=>Lt(t(u),l),i=(u,l)=>t(u)-l):(e=t===Lt||t===sr?t:or,n=t,i=t);function r(u,l,a=0,c=u.length){if(a>>1;n(u[f],l)<0?a=f+1:c=f}while(a>>1;n(u[f],l)<=0?a=f+1:c=f}while(aa&&i(u[f-1],l)>-i(u[f],l)?f-1:f}return{left:r,center:o,right:s}}function or(){return 0}function ar(t){return t===null?NaN:+t}const ur=$n(Lt),lr=ur.right;$n(ar).center;const cr=Math.sqrt(50),hr=Math.sqrt(10),fr=Math.sqrt(2);function Zt(t,e,n){const i=(e-t)/Math.max(0,n),r=Math.floor(Math.log10(i)),s=i/Math.pow(10,r),o=s>=cr?10:s>=hr?5:s>=fr?2:1;let u,l,a;return r<0?(a=Math.pow(10,-r)/o,u=Math.round(t*a),l=Math.round(e*a),u/ae&&--l,a=-a):(a=Math.pow(10,r)*o,u=Math.round(t/a),l=Math.round(e/a),u*ae&&--l),l0))return[];if(t===e)return[t];const i=e=r))return[];const u=s-r+1,l=new Array(u);if(i)if(o<0)for(let a=0;ae&&(n=t,t=e,e=n),function(i){return Math.max(t,Math.min(e,i))}}function wr(t,e,n){var i=t[0],r=t[1],s=e[0],o=e[1];return r2?_r:wr,l=a=null,f}function f(h){return h==null||isNaN(h=+h)?s:(l||(l=u(t.map(i),e,n)))(i(o(h)))}return f.invert=function(h){return o(r((a||(a=u(e,t.map(i),G)))(h)))},f.domain=function(h){return arguments.length?(t=Array.from(h,xr),c()):t.slice()},f.range=function(h){return arguments.length?(e=Array.from(h),c()):e.slice()},f.rangeRound=function(h){return e=Array.from(h),n=Vi,c()},f.clamp=function(h){return arguments.length?(o=h?!0:gt,c()):o!==gt},f.interpolate=function(h){return arguments.length?(n=h,c()):n},f.unknown=function(h){return arguments.length?(s=h,f):s},function(h,d){return i=h,r=d,c()}}function Mr(){return br()(gt,gt)}function kr(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function Wt(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,i=t.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+t.slice(n+1)]}function xt(t){return t=Wt(Math.abs(t)),t?t[1]:NaN}function $r(t,e){return function(n,i){for(var r=n.length,s=[],o=0,u=t[0],l=0;r>0&&u>0&&(l+u+1>i&&(u=Math.max(1,i-l)),s.push(n.substring(r-=u,r+u)),!((l+=u+1)>i));)u=t[o=(o+1)%t.length];return s.reverse().join(e)}}function Fr(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var Sr=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Kt(t){if(!(e=Sr.exec(t)))throw new Error("invalid format: "+t);var e;return new Ae({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}Kt.prototype=Ae.prototype;function Ae(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}Ae.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Tr(t){t:for(var e=t.length,n=1,i=-1,r;n0&&(i=0);break}return i>0?t.slice(0,i)+t.slice(r+1):t}var Fn;function Er(t,e){var n=Wt(t,e);if(!n)return t+"";var i=n[0],r=n[1],s=r-(Fn=Math.max(-8,Math.min(8,Math.floor(r/3)))*3)+1,o=i.length;return s===o?i:s>o?i+new Array(s-o+1).join("0"):s>0?i.slice(0,s)+"."+i.slice(s):"0."+new Array(1-s).join("0")+Wt(t,Math.max(0,e+s-1))[0]}function Qe(t,e){var n=Wt(t,e);if(!n)return t+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}const Je={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:kr,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>Qe(t*100,e),r:Qe,s:Er,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function je(t){return t}var tn=Array.prototype.map,en=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Ar(t){var e=t.grouping===void 0||t.thousands===void 0?je:$r(tn.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",i=t.currency===void 0?"":t.currency[1]+"",r=t.decimal===void 0?".":t.decimal+"",s=t.numerals===void 0?je:Fr(tn.call(t.numerals,String)),o=t.percent===void 0?"%":t.percent+"",u=t.minus===void 0?"−":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function a(f){f=Kt(f);var h=f.fill,d=f.align,g=f.sign,y=f.symbol,$=f.zero,x=f.width,b=f.comma,T=f.precision,V=f.trim,F=f.type;F==="n"?(b=!0,F="g"):Je[F]||(T===void 0&&(T=12),V=!0,F="g"),($||h==="0"&&d==="=")&&($=!0,h="0",d="=");var P=y==="$"?n:y==="#"&&/[boxX]/.test(F)?"0"+F.toLowerCase():"",z=y==="$"?i:/[%p]/.test(F)?o:"",q=Je[F],I=/[defgprs%]/.test(F);T=T===void 0?6:/[gprs]/.test(F)?Math.max(1,Math.min(21,T)):Math.max(0,Math.min(20,T));function B(v){var S=P,A=z,p,w,m;if(F==="c")A=q(v)+A,v="";else{v=+v;var _=v<0||1/v<0;if(v=isNaN(v)?l:q(Math.abs(v),T),V&&(v=Tr(v)),_&&+v==0&&g!=="+"&&(_=!1),S=(_?g==="("?g:u:g==="-"||g==="("?"":g)+S,A=(F==="s"?en[8+Fn/3]:"")+A+(_&&g==="("?")":""),I){for(p=-1,w=v.length;++pm||m>57){A=(m===46?r+v.slice(p+1):v.slice(p))+A,v=v.slice(0,p);break}}}b&&!$&&(v=e(v,1/0));var k=S.length+v.length+A.length,M=k>1)+S+v+A+M.slice(k);break;default:v=M+S+v+A;break}return s(v)}return B.toString=function(){return f+""},B}function c(f,h){var d=a((f=Kt(f),f.type="f",f)),g=Math.max(-8,Math.min(8,Math.floor(xt(h)/3)))*3,y=Math.pow(10,-g),$=en[8+g/3];return function(x){return d(y*x)+$}}return{format:a,formatPrefix:c}}var Ct,Sn,Tn;Vr({thousands:",",grouping:[3],currency:["$",""]});function Vr(t){return Ct=Ar(t),Sn=Ct.format,Tn=Ct.formatPrefix,Ct}function Nr(t){return Math.max(0,-xt(Math.abs(t)))}function zr(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(xt(e)/3)))*3-xt(Math.abs(t)))}function Pr(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,xt(e)-xt(t))+1}function Cr(t,e,n,i){var r=pr(t,e,n),s;switch(i=Kt(i??",f"),i.type){case"s":{var o=Math.max(Math.abs(t),Math.abs(e));return i.precision==null&&!isNaN(s=zr(r,o))&&(i.precision=s),Tn(i,o)}case"":case"e":case"g":case"p":case"r":{i.precision==null&&!isNaN(s=Pr(r,Math.max(Math.abs(t),Math.abs(e))))&&(i.precision=s-(i.type==="e"));break}case"f":case"%":{i.precision==null&&!isNaN(s=Nr(r))&&(i.precision=s-(i.type==="%")*2);break}}return Sn(i)}function Ir(t){var e=t.domain;return t.ticks=function(n){var i=e();return dr(i[0],i[i.length-1],n??10)},t.tickFormat=function(n,i){var r=e();return Cr(r[0],r[r.length-1],n??10,i)},t.nice=function(n){n==null&&(n=10);var i=e(),r=0,s=i.length-1,o=i[r],u=i[s],l,a,c=10;for(u0;){if(a=xe(o,u,n),a===l)return i[r]=o,i[s]=u,e(i);if(a>0)o=Math.floor(o/a)*a,u=Math.ceil(u/a)*a;else if(a<0)o=Math.ceil(o*a)/a,u=Math.floor(u*a)/a;else break;l=a}return t},t}function we(){var t=Mr();return t.copy=function(){return vr(t,we())},gr.apply(t,arguments),Ir(t)}var _e="http://www.w3.org/1999/xhtml";const nn={svg:"http://www.w3.org/2000/svg",xhtml:_e,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ee(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),nn.hasOwnProperty(e)?{space:nn[e],local:t}:t}function Dr(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===_e&&e.documentElement.namespaceURI===_e?e.createElement(t):e.createElementNS(n,t)}}function Rr(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Ve(t){var e=ee(t);return(e.local?Rr:Dr)(e)}function Br(){}function Ne(t){return t==null?Br:function(){return this.querySelector(t)}}function Lr(t){typeof t!="function"&&(t=Ne(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r=T&&(T=b+1);!(F=$[T])&&++T=0;)(o=i[r])&&(s&&o.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(o,s),s=o);return this}function hs(t){t||(t=fs);function e(f,h){return f&&h?t(f.__data__,h.__data__):!f-!h}for(var n=this._groups,i=n.length,r=new Array(i),s=0;se?1:t>=e?0:NaN}function ds(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function ps(){return Array.from(this)}function gs(){for(var t=this._groups,e=0,n=t.length;e1?this.each((e==null?Fs:typeof e=="function"?Ts:Ss)(t,e,n??"")):yt(this.node(),t)}function yt(t,e){return t.style.getPropertyValue(e)||zn(t).getComputedStyle(t,null).getPropertyValue(e)}function As(t){return function(){delete this[t]}}function Vs(t,e){return function(){this[t]=e}}function Ns(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function zs(t,e){return arguments.length>1?this.each((e==null?As:typeof e=="function"?Ns:Vs)(t,e)):this.node()[t]}function Pn(t){return t.trim().split(/^|\s+/)}function ze(t){return t.classList||new Cn(t)}function Cn(t){this._node=t,this._names=Pn(t.getAttribute("class")||"")}Cn.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function In(t,e){for(var n=ze(t),i=-1,r=e.length;++i=0&&(n=e.slice(i+1),e=e.slice(0,i)),{type:e,name:n}})}function ao(t){return function(){var e=this.__on;if(e){for(var n=0,i=-1,r=e.length,s;n{}};function Pe(){for(var t=0,e=arguments.length,n={},i;t=0&&(i=n.slice(r+1),n=n.slice(0,r)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}qt.prototype=Pe.prototype={constructor:qt,on:function(t,e){var n=this._,i=wo(t+"",n),r,s=-1,o=i.length;if(arguments.length<2){for(;++s0)for(var n=new Array(r),i=0,r,s;i=0&&t._call.call(void 0,e),t=t._next;--wt}function sn(){ft=(jt=Tt.now())+ne,wt=Mt=0;try{ko()}finally{wt=0,Fo(),ft=0}}function $o(){var t=Tt.now(),e=t-jt;e>Ln&&(ne-=e,jt=t)}function Fo(){for(var t,e=Jt,n,i=1/0;e;)e._call?(i>e._time&&(i=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Jt=n);kt=t,Me(i)}function Me(t){if(!wt){Mt&&(Mt=clearTimeout(Mt));var e=t-ft;e>24?(t<1/0&&(Mt=setTimeout(sn,t-Tt.now()-ne)),_t&&(_t=clearInterval(_t))):(_t||(jt=Tt.now(),_t=setInterval($o,Ln)),wt=1,qn(sn))}}function on(t,e,n){var i=new te;return e=e==null?0:+e,i.restart(r=>{i.stop(),t(r+e)},e,n),i}var So=Pe("start","end","cancel","interrupt"),To=[],Xn=0,an=1,ke=2,Ht=3,un=4,$e=5,Xt=6;function ie(t,e,n,i,r,s){var o=t.__transition;if(!o)t.__transition={};else if(n in o)return;Eo(t,n,{name:e,index:i,group:r,on:So,tween:To,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Xn})}function Ie(t,e){var n=W(t,e);if(n.state>Xn)throw new Error("too late; already scheduled");return n}function J(t,e){var n=W(t,e);if(n.state>Ht)throw new Error("too late; already running");return n}function W(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Eo(t,e,n){var i=t.__transition,r;i[e]=n,n.timer=Hn(s,0,n.time);function s(a){n.state=an,n.timer.restart(o,n.delay,n.time),n.delay<=a&&o(a-n.delay)}function o(a){var c,f,h,d;if(n.state!==an)return l();for(c in i)if(d=i[c],d.name===n.name){if(d.state===Ht)return on(o);d.state===un?(d.state=Xt,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete i[c]):+cke&&i.state<$e,i.state=Xt,i.timer.stop(),i.on.call(r?"interrupt":"cancel",t,t.__data__,i.index,i.group),delete n[o]}s&&delete t.__transition}}function Ao(t){return this.each(function(){Ot(this,t)})}function Vo(t,e){var n,i;return function(){var r=J(this,t),s=r.tween;if(s!==n){i=n=s;for(var o=0,u=i.length;o=0&&(e=e.slice(0,n)),!e||e==="start"})}function sa(t,e,n){var i,r,s=ra(e)?Ie:J;return function(){var o=s(this,t),u=o.on;u!==i&&(r=(i=u).copy()).on(e,n),o.on=r}}function oa(t,e){var n=this._id;return arguments.length<2?W(this.node(),n).on.on(t):this.each(sa(n,t,e))}function aa(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function ua(){return this.on("end.remove",aa(this._id))}function la(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Ne(t));for(var i=this._groups,r=i.length,s=new Array(r),o=0;o()=>t;function Pa(t,{sourceEvent:e,target:n,transform:i,dispatch:r}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:r}})}function nt(t,e,n){this.k=t,this.x=e,this.y=n}nt.prototype={constructor:nt,scale:function(t){return t===1?this:new nt(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new nt(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Re=new nt(1,0,0);nt.prototype;function ue(t){t.stopImmediatePropagation()}function vt(t){t.preventDefault(),t.stopImmediatePropagation()}function Ca(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function Ia(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function ln(){return this.__zoom||Re}function Da(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function Ra(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ba(t,e,n){var i=t.invertX(e[0][0])-n[0][0],r=t.invertX(e[1][0])-n[1][0],s=t.invertY(e[0][1])-n[0][1],o=t.invertY(e[1][1])-n[1][1];return t.translate(r>i?(i+r)/2:Math.min(0,i)||Math.max(0,r),o>s?(s+o)/2:Math.min(0,s)||Math.max(0,o))}function La(){var t=Ca,e=Ia,n=Ba,i=Da,r=Ra,s=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],u=250,l=Bi,a=Pe("start","zoom","end"),c,f,h,d=500,g=150,y=0,$=10;function x(p){p.property("__zoom",ln).on("wheel.zoom",q,{passive:!1}).on("mousedown.zoom",I).on("dblclick.zoom",B).filter(r).on("touchstart.zoom",v).on("touchmove.zoom",S).on("touchend.zoom touchcancel.zoom",A).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}x.transform=function(p,w,m,_){var k=p.selection?p.selection():p;k.property("__zoom",ln),p!==k?F(p,w,m,_):k.interrupt().each(function(){P(this,arguments).event(_).start().zoom(null,typeof w=="function"?w.apply(this,arguments):w).end()})},x.scaleBy=function(p,w,m,_){x.scaleTo(p,function(){var k=this.__zoom.k,M=typeof w=="function"?w.apply(this,arguments):w;return k*M},m,_)},x.scaleTo=function(p,w,m,_){x.transform(p,function(){var k=e.apply(this,arguments),M=this.__zoom,E=m==null?V(k):typeof m=="function"?m.apply(this,arguments):m,N=M.invert(E),D=typeof w=="function"?w.apply(this,arguments):w;return n(T(b(M,D),E,N),k,o)},m,_)},x.translateBy=function(p,w,m,_){x.transform(p,function(){return n(this.__zoom.translate(typeof w=="function"?w.apply(this,arguments):w,typeof m=="function"?m.apply(this,arguments):m),e.apply(this,arguments),o)},null,_)},x.translateTo=function(p,w,m,_,k){x.transform(p,function(){var M=e.apply(this,arguments),E=this.__zoom,N=_==null?V(M):typeof _=="function"?_.apply(this,arguments):_;return n(Re.translate(N[0],N[1]).scale(E.k).translate(typeof w=="function"?-w.apply(this,arguments):-w,typeof m=="function"?-m.apply(this,arguments):-m),M,o)},_,k)};function b(p,w){return w=Math.max(s[0],Math.min(s[1],w)),w===p.k?p:new nt(w,p.x,p.y)}function T(p,w,m){var _=w[0]-m[0]*p.k,k=w[1]-m[1]*p.k;return _===p.x&&k===p.y?p:new nt(p.k,_,k)}function V(p){return[(+p[0][0]+ +p[1][0])/2,(+p[0][1]+ +p[1][1])/2]}function F(p,w,m,_){p.on("start.zoom",function(){P(this,arguments).event(_).start()}).on("interrupt.zoom end.zoom",function(){P(this,arguments).event(_).end()}).tween("zoom",function(){var k=this,M=arguments,E=P(k,M).event(_),N=e.apply(k,M),D=m==null?V(N):typeof m=="function"?m.apply(k,M):m,K=Math.max(N[1][0]-N[0][0],N[1][1]-N[0][1]),L=k.__zoom,U=typeof w=="function"?w.apply(k,M):w,j=l(L.invert(D).concat(K/L.k),U.invert(D).concat(K/U.k));return function(Y){if(Y===1)Y=U;else{var tt=j(Y),re=K/tt[2];Y=new nt(re,D[0]-tt[0]*re,D[1]-tt[1]*re)}E.zoom(null,Y)}})}function P(p,w,m){return!m&&p.__zooming||new z(p,w)}function z(p,w){this.that=p,this.args=w,this.active=0,this.sourceEvent=null,this.extent=e.apply(p,w),this.taps=0}z.prototype={event:function(p){return p&&(this.sourceEvent=p),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(p,w){return this.mouse&&p!=="mouse"&&(this.mouse[1]=w.invert(this.mouse[0])),this.touch0&&p!=="touch"&&(this.touch0[1]=w.invert(this.touch0[0])),this.touch1&&p!=="touch"&&(this.touch1[1]=w.invert(this.touch1[0])),this.that.__zoom=w,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(p){var w=O(this.that).datum();a.call(p,this.that,new Pa(p,{sourceEvent:this.sourceEvent,target:x,transform:this.that.__zoom,dispatch:a}),w)}};function q(p,...w){if(!t.apply(this,arguments))return;var m=P(this,w).event(p),_=this.__zoom,k=Math.max(s[0],Math.min(s[1],_.k*Math.pow(2,i.apply(this,arguments)))),M=ot(p);if(m.wheel)(m.mouse[0][0]!==M[0]||m.mouse[0][1]!==M[1])&&(m.mouse[1]=_.invert(m.mouse[0]=M)),clearTimeout(m.wheel);else{if(_.k===k)return;m.mouse=[M,_.invert(M)],Ot(this),m.start()}vt(p),m.wheel=setTimeout(E,g),m.zoom("mouse",n(T(b(_,k),m.mouse[0],m.mouse[1]),m.extent,o));function E(){m.wheel=null,m.end()}}function I(p,...w){if(h||!t.apply(this,arguments))return;var m=p.currentTarget,_=P(this,w,!0).event(p),k=O(p.view).on("mousemove.zoom",D,!0).on("mouseup.zoom",K,!0),M=ot(p,m),E=p.clientX,N=p.clientY;vo(p.view),ue(p),_.mouse=[M,this.__zoom.invert(M)],Ot(this),_.start();function D(L){if(vt(L),!_.moved){var U=L.clientX-E,j=L.clientY-N;_.moved=U*U+j*j>y}_.event(L).zoom("mouse",n(T(_.that.__zoom,_.mouse[0]=ot(L,m),_.mouse[1]),_.extent,o))}function K(L){k.on("mousemove.zoom mouseup.zoom",null),bo(L.view,_.moved),vt(L),_.event(L).end()}}function B(p,...w){if(t.apply(this,arguments)){var m=this.__zoom,_=ot(p.changedTouches?p.changedTouches[0]:p,this),k=m.invert(_),M=m.k*(p.shiftKey?.5:2),E=n(T(b(m,M),_,k),e.apply(this,w),o);vt(p),u>0?O(this).transition().duration(u).call(F,E,_,p):O(this).call(x.transform,E,_,p)}}function v(p,...w){if(t.apply(this,arguments)){var m=p.touches,_=m.length,k=P(this,w,p.changedTouches.length===_).event(p),M,E,N,D;for(ue(p),E=0;E<_;++E)N=m[E],D=ot(N,this),D=[D,this.__zoom.invert(D),N.identifier],k.touch0?!k.touch1&&k.touch0[2]!==D[2]&&(k.touch1=D,k.taps=0):(k.touch0=D,M=!0,k.taps=1+!!c);c&&(c=clearTimeout(c)),M&&(k.taps<2&&(f=D[0],c=setTimeout(function(){c=null},d)),Ot(this),k.start())}}function S(p,...w){if(this.__zooming){var m=P(this,w).event(p),_=p.changedTouches,k=_.length,M,E,N,D;for(vt(p),M=0;M"u"?null:new TextDecoder("utf-8"),le=0,Dt=1,bt=2,Rt=5;class Ha{constructor(e=new Uint8Array(16)){this.buf=ArrayBuffer.isView(e)?e:new Uint8Array(e),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this.length=this.buf.length}readFields(e,n,i=this.length){for(;this.pos>3,o=this.pos;this.type=r&7,e(s,n,this),this.pos===o&&this.skip(r)}return n}readMessage(e,n){return this.readFields(e,n,this.readVarint()+this.pos)}readFixed32(){const e=this.dataView.getUint32(this.pos,!0);return this.pos+=4,e}readSFixed32(){const e=this.dataView.getInt32(this.pos,!0);return this.pos+=4,e}readFixed64(){const e=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*Fe;return this.pos+=8,e}readSFixed64(){const e=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*Fe;return this.pos+=8,e}readFloat(){const e=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,e}readDouble(){const e=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,e}readVarint(e){const n=this.buf;let i,r;return r=n[this.pos++],i=r&127,r<128||(r=n[this.pos++],i|=(r&127)<<7,r<128)||(r=n[this.pos++],i|=(r&127)<<14,r<128)||(r=n[this.pos++],i|=(r&127)<<21,r<128)?i:(r=n[this.pos],i|=(r&15)<<28,Xa(i,e,this))}readVarint64(){return this.readVarint(!0)}readSVarint(){const e=this.readVarint();return e%2===1?(e+1)/-2:e/2}readBoolean(){return!!this.readVarint()}readString(){const e=this.readVarint()+this.pos,n=this.pos;return this.pos=e,e-n>=qa&&hn?hn.decode(this.buf.subarray(n,e)):nu(this.buf,n,e)}readBytes(){const e=this.readVarint()+this.pos,n=this.buf.subarray(this.pos,e);return this.pos=e,n}readPackedVarint(e=[],n){const i=this.readPackedEnd();for(;this.pos127;);else if(n===bt)this.pos=this.readVarint()+this.pos;else if(n===Rt)this.pos+=4;else if(n===Dt)this.pos+=8;else throw new Error(`Unimplemented type: ${n}`)}writeTag(e,n){this.writeVarint(e<<3|n)}realloc(e){let n=this.length||16;for(;n268435455||e<0){Oa(e,this);return}this.realloc(4),this.buf[this.pos++]=e&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=e>>>7&127)))}writeSVarint(e){this.writeVarint(e<0?-e*2-1:e*2)}writeBoolean(e){this.writeVarint(+e)}writeString(e){e=String(e),this.realloc(e.length*4),this.pos++;const n=this.pos;this.pos=iu(this.buf,e,this.pos);const i=this.pos-n;i>=128&&fn(n,i,this),this.pos=n-1,this.writeVarint(i),this.pos+=i}writeFloat(e){this.realloc(4),this.dataView.setFloat32(this.pos,e,!0),this.pos+=4}writeDouble(e){this.realloc(8),this.dataView.setFloat64(this.pos,e,!0),this.pos+=8}writeBytes(e){const n=e.length;this.writeVarint(n),this.realloc(n);for(let i=0;i=128&&fn(i,r,this),this.pos=i-1,this.writeVarint(r),this.pos+=r}writeMessage(e,n,i){this.writeTag(e,bt),this.writeRawMessage(n,i)}writePackedVarint(e,n){n.length&&this.writeMessage(e,Ga,n)}writePackedSVarint(e,n){n.length&&this.writeMessage(e,Za,n)}writePackedBoolean(e,n){n.length&&this.writeMessage(e,Qa,n)}writePackedFloat(e,n){n.length&&this.writeMessage(e,Wa,n)}writePackedDouble(e,n){n.length&&this.writeMessage(e,Ka,n)}writePackedFixed32(e,n){n.length&&this.writeMessage(e,Ja,n)}writePackedSFixed32(e,n){n.length&&this.writeMessage(e,ja,n)}writePackedFixed64(e,n){n.length&&this.writeMessage(e,tu,n)}writePackedSFixed64(e,n){n.length&&this.writeMessage(e,eu,n)}writeBytesField(e,n){this.writeTag(e,bt),this.writeBytes(n)}writeFixed32Field(e,n){this.writeTag(e,Rt),this.writeFixed32(n)}writeSFixed32Field(e,n){this.writeTag(e,Rt),this.writeSFixed32(n)}writeFixed64Field(e,n){this.writeTag(e,Dt),this.writeFixed64(n)}writeSFixed64Field(e,n){this.writeTag(e,Dt),this.writeSFixed64(n)}writeVarintField(e,n){this.writeTag(e,le),this.writeVarint(n)}writeSVarintField(e,n){this.writeTag(e,le),this.writeSVarint(n)}writeStringField(e,n){this.writeTag(e,bt),this.writeString(n)}writeFloatField(e,n){this.writeTag(e,Rt),this.writeFloat(n)}writeDoubleField(e,n){this.writeTag(e,Dt),this.writeDouble(n)}writeBooleanField(e,n){this.writeVarintField(e,+n)}}function Xa(t,e,n){const i=n.buf;let r,s;if(s=i[n.pos++],r=(s&112)>>4,s<128||(s=i[n.pos++],r|=(s&127)<<3,s<128)||(s=i[n.pos++],r|=(s&127)<<10,s<128)||(s=i[n.pos++],r|=(s&127)<<17,s<128)||(s=i[n.pos++],r|=(s&127)<<24,s<128)||(s=i[n.pos++],r|=(s&1)<<31,s<128))return dt(t,r,e);throw new Error("Expected varint not more than 10 bytes")}function dt(t,e,n){return n?e*4294967296+(t>>>0):(e>>>0)*4294967296+(t>>>0)}function Oa(t,e){let n,i;if(t>=0?(n=t%4294967296|0,i=t/4294967296|0):(n=~(-t%4294967296),i=~(-t/4294967296),n^4294967295?n=n+1|0:(n=0,i=i+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),Ua(n,i,e),Ya(i,e)}function Ua(t,e,n){n.buf[n.pos++]=t&127|128,t>>>=7,n.buf[n.pos++]=t&127|128,t>>>=7,n.buf[n.pos++]=t&127|128,t>>>=7,n.buf[n.pos++]=t&127|128,t>>>=7,n.buf[n.pos]=t&127}function Ya(t,e){const n=(t&7)<<4;e.buf[e.pos++]|=n|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127)))))}function fn(t,e,n){const i=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(Math.LN2*7));n.realloc(i);for(let r=n.pos-1;r>=t;r--)n.buf[r+i]=n.buf[r]}function Ga(t,e){for(let n=0;n239?4:s>223?3:s>191?2:1;if(r+u>n)break;let l,a,c;u===1?s<128&&(o=s):u===2?(l=t[r+1],(l&192)===128&&(o=(s&31)<<6|l&63,o<=127&&(o=null))):u===3?(l=t[r+1],a=t[r+2],(l&192)===128&&(a&192)===128&&(o=(s&15)<<12|(l&63)<<6|a&63,(o<=2047||o>=55296&&o<=57343)&&(o=null))):u===4&&(l=t[r+1],a=t[r+2],c=t[r+3],(l&192)===128&&(a&192)===128&&(c&192)===128&&(o=(s&15)<<18|(l&63)<<12|(a&63)<<6|c&63,(o<=65535||o>=1114112)&&(o=null))),o===null?(o=65533,u=1):o>65535&&(o-=65536,i+=String.fromCharCode(o>>>10&1023|55296),o=56320|o&1023),i+=String.fromCharCode(o),r+=u}return i}function iu(t,e,n){for(let i=0,r,s;i55295&&r<57344)if(s)if(r<56320){t[n++]=239,t[n++]=191,t[n++]=189,s=r;continue}else r=s-55296<<10|r-56320|65536,s=null;else{r>56319||i+1===e.length?(t[n++]=239,t[n++]=191,t[n++]=189):s=r;continue}else s&&(t[n++]=239,t[n++]=191,t[n++]=189,s=null);r<128?t[n++]=r:(r<2048?t[n++]=r>>6|192:(r<65536?t[n++]=r>>12|224:(t[n++]=r>>18|240,t[n++]=r>>12&63|128),t[n++]=r>>6&63|128),t[n++]=r&63|128)}return n}var ru=st('
'),su=st('
'),ou=st("