UNPKG

@decidables/prospectable-elements

Version:

prospectable-elements: Web Components for visualizing Cumulative Prospect Theory

22 lines 1.13 MB
/** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const t=globalThis,B=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s=Symbol(),Q=new WeakMap;let F=class{constructor(t,B,Q){if(this._$cssResult$=!0,Q!==s)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=B}get styleSheet(){let t=this.o;const s=this.t;if(B&&void 0===t){const B=void 0!==s&&1===s.length;B&&(t=Q.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),B&&Q.set(s,t))}return t}toString(){return this.cssText}};const i=t=>new F("string"==typeof t?t:t+"",void 0,s),U=(t,...B)=>{const Q=1===t.length?t[0]:B.reduce((B,s,Q)=>B+(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.")})(s)+t[Q+1],t[0]);return new F(Q,t,s)},g=B?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let B="";for(const s of t.cssRules)B+=s.cssText;return i(B)})(t):t,{is:e,defineProperty:I,getOwnPropertyDescriptor:l,getOwnPropertyNames:c,getOwnPropertySymbols:n,getPrototypeOf:a}=Object,d=globalThis,o=d.trustedTypes,b=o?o.emptyScript:"",C=d.reactiveElementPolyfillSupport,r=(t,B)=>t,u={toAttribute(t,B){switch(B){case Boolean:t=t?b:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,B){let s=t;switch(B){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch(t){s=null}}return s}},h=(t,B)=>!e(t,B),x={attribute:!0,type:String,converter:u,reflect:!1,useDefault:!1,hasChanged:h}; /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */Symbol.metadata??=Symbol("metadata"),d.litPropertyMetadata??=new WeakMap;let G=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,B=x){if(B.state&&(B.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((B=Object.create(B)).wrapped=!0),this.elementProperties.set(t,B),!B.noAccessor){const s=Symbol(),Q=this.getPropertyDescriptor(t,s,B);void 0!==Q&&I(this.prototype,t,Q)}}static getPropertyDescriptor(t,B,s){const{get:Q,set:F}=l(this.prototype,t)??{get(){return this[B]},set(t){this[B]=t}};return{get:Q,set(B){const i=Q?.call(this);F?.call(this,B),this.requestUpdate(t,i,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??x}static _$Ei(){if(this.hasOwnProperty(r("elementProperties")))return;const t=a(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(r("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(r("properties"))){const t=this.properties,B=[...c(t),...n(t)];for(const s of B)this.createProperty(s,t[s])}const t=this[Symbol.metadata];if(null!==t){const B=litPropertyMetadata.get(t);if(void 0!==B)for(const[t,s]of B)this.elementProperties.set(t,s)}this._$Eh=new Map;for(const[t,B]of this.elementProperties){const s=this._$Eu(t,B);void 0!==s&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const B=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const t of s)B.unshift(g(t))}else void 0!==t&&B.push(g(t));return B}static _$Eu(t,B){const s=B.attribute;return!1===s?void 0:"string"==typeof s?s:"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,B=this.constructor.elementProperties;for(const s of B.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const s=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((s,Q)=>{if(B)s.adoptedStyleSheets=Q.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const B of Q){const Q=document.createElement("style"),F=t.litNonce;void 0!==F&&Q.setAttribute("nonce",F),Q.textContent=B.cssText,s.appendChild(Q)}})(s,this.constructor.elementStyles),s}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,B,s){this._$AK(t,s)}_$ET(t,B){const s=this.constructor.elementProperties.get(t),Q=this.constructor._$Eu(t,s);if(void 0!==Q&&!0===s.reflect){const F=(void 0!==s.converter?.toAttribute?s.converter:u).toAttribute(B,s.type);this._$Em=t,null==F?this.removeAttribute(Q):this.setAttribute(Q,F),this._$Em=null}}_$AK(t,B){const s=this.constructor,Q=s._$Eh.get(t);if(void 0!==Q&&this._$Em!==Q){const t=s.getPropertyOptions(Q),F="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:u;this._$Em=Q;const i=F.fromAttribute(B,t.type);this[Q]=i??this._$Ej?.get(Q)??i,this._$Em=null}}requestUpdate(t,B,s){if(void 0!==t){const Q=this.constructor,F=this[t];if(s??=Q.getPropertyOptions(t),!((s.hasChanged??h)(F,B)||s.useDefault&&s.reflect&&F===this._$Ej?.get(t)&&!this.hasAttribute(Q._$Eu(t,s))))return;this.C(t,B,s)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,B,{useDefault:s,reflect:Q,wrapped:F},i){s&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,i??B??this[t]),!0!==F||void 0!==i)||(this._$AL.has(t)||(this.hasUpdated||s||(B=void 0),this._$AL.set(t,B)),!0===Q&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){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,B]of this._$Ep)this[t]=B;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[B,s]of t){const{wrapped:t}=s,Q=this[B];!0!==t||this._$AL.has(B)||void 0===Q||this.C(B,void 0,s,Q)}}let t=!1;const B=this._$AL;try{t=this.shouldUpdate(B),t?(this.willUpdate(B),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(B)):this._$EM()}catch(B){throw t=!1,this._$EM(),B}t&&this._$AE(B)}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(t){}firstUpdated(t){}};G.elementStyles=[],G.shadowRootOptions={mode:"open"},G[r("elementProperties")]=new Map,G[r("finalized")]=new Map,C?.({ReactiveElement:G}),(d.reactiveElementVersions??=[]).push("2.1.1"); /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const y=globalThis,A=y.trustedTypes,L=A?A.createPolicy("lit-html",{createHTML:t=>t}):void 0,R="$lit$",m=`lit$${Math.random().toFixed(9).slice(2)}$`,V="?"+m,S=`<${V}>`,Z=document,p=()=>Z.createComment(""),E=t=>null===t||"object"!=typeof t&&"function"!=typeof t,N=Array.isArray,X="[ \t\n\f\r]",W=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,H=/-->/g,D=/>/g,f=RegExp(`>|${X}(?:([^\\s"'>=/]+)(${X}*=${X}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),w=/'/g,v=/"/g,Y=/^(?:script|style|textarea|title)$/i,J=t=>(B,...s)=>({_$litType$:t,strings:B,values:s}),k=J(1),M=J(2),T=Symbol.for("lit-noChange"),z=Symbol.for("lit-nothing"),K=new WeakMap,O=Z.createTreeWalker(Z,129);function P(t,B){if(!N(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==L?L.createHTML(B):B}let j=class t{constructor({strings:B,_$litType$:s},Q){let F;this.parts=[];let i=0,U=0;const g=B.length-1,e=this.parts,[I,l]=((t,B)=>{const s=t.length-1,Q=[];let F,i=2===B?"<svg>":3===B?"<math>":"",U=W;for(let B=0;B<s;B++){const s=t[B];let g,e,I=-1,l=0;for(;l<s.length&&(U.lastIndex=l,e=U.exec(s),null!==e);)l=U.lastIndex,U===W?"!--"===e[1]?U=H:void 0!==e[1]?U=D:void 0!==e[2]?(Y.test(e[2])&&(F=RegExp("</"+e[2],"g")),U=f):void 0!==e[3]&&(U=f):U===f?">"===e[0]?(U=F??W,I=-1):void 0===e[1]?I=-2:(I=U.lastIndex-e[2].length,g=e[1],U=void 0===e[3]?f:'"'===e[3]?v:w):U===v||U===w?U=f:U===H||U===D?U=W:(U=f,F=void 0);const c=U===f&&t[B+1].startsWith("/>")?" ":"";i+=U===W?s+S:I>=0?(Q.push(g),s.slice(0,I)+R+s.slice(I)+m+c):s+m+(-2===I?B:c)}return[P(t,i+(t[s]||"<?>")+(2===B?"</svg>":3===B?"</math>":"")),Q]})(B,s);if(this.el=t.createElement(I,Q),O.currentNode=this.el.content,2===s||3===s){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(F=O.nextNode())&&e.length<g;){if(1===F.nodeType){if(F.hasAttributes())for(const t of F.getAttributeNames())if(t.endsWith(R)){const B=l[U++],s=F.getAttribute(t).split(m),Q=/([.?@])?(.*)/.exec(B);e.push({type:1,index:i,name:Q[2],strings:s,ctor:"."===Q[1]?Bt:"?"===Q[1]?st:"@"===Q[1]?Qt:tt}),F.removeAttribute(t)}else t.startsWith(m)&&(e.push({type:6,index:i}),F.removeAttribute(t));if(Y.test(F.tagName)){const t=F.textContent.split(m),B=t.length-1;if(B>0){F.textContent=A?A.emptyScript:"";for(let s=0;s<B;s++)F.append(t[s],p()),O.nextNode(),e.push({type:2,index:++i});F.append(t[B],p())}}}else if(8===F.nodeType)if(F.data===V)e.push({type:2,index:i});else{let t=-1;for(;-1!==(t=F.data.indexOf(m,t+1));)e.push({type:7,index:i}),t+=m.length-1}i++}}static createElement(t,B){const s=Z.createElement("template");return s.innerHTML=t,s}};function _(t,B,s=t,Q){if(B===T)return B;let F=void 0!==Q?s._$Co?.[Q]:s._$Cl;const i=E(B)?void 0:B._$litDirective$;return F?.constructor!==i&&(F?._$AO?.(!1),void 0===i?F=void 0:(F=new i(t),F._$AT(t,s,Q)),void 0!==Q?(s._$Co??=[])[Q]=F:s._$Cl=F),void 0!==F&&(B=_(t,F._$AS(t,B.values),F,Q)),B}let $=class{constructor(t,B){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=B}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:B},parts:s}=this._$AD,Q=(t?.creationScope??Z).importNode(B,!0);O.currentNode=Q;let F=O.nextNode(),i=0,U=0,g=s[0];for(;void 0!==g;){if(i===g.index){let B;2===g.type?B=new q(F,F.nextSibling,this,t):1===g.type?B=new g.ctor(F,g.name,g.strings,this,t):6===g.type&&(B=new Ft(F,this,t)),this._$AV.push(B),g=s[++U]}i!==g?.index&&(F=O.nextNode(),i++)}return O.currentNode=Z,Q}p(t){let B=0;for(const s of this._$AV)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,B),B+=s.strings.length-2):s._$AI(t[B])),B++}};class q{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,B,s,Q){this.type=2,this._$AH=z,this._$AN=void 0,this._$AA=t,this._$AB=B,this._$AM=s,this.options=Q,this._$Cv=Q?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const B=this._$AM;return void 0!==B&&11===t?.nodeType&&(t=B.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,B=this){t=_(this,t,B),E(t)?t===z||null==t||""===t?(this._$AH!==z&&this._$AR(),this._$AH=z):t!==this._$AH&&t!==T&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>N(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==z&&E(this._$AH)?this._$AA.nextSibling.data=t:this.T(Z.createTextNode(t)),this._$AH=t}$(t){const{values:B,_$litType$:s}=t,Q="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=j.createElement(P(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===Q)this._$AH.p(B);else{const t=new $(Q,this),s=t.u(this.options);t.p(B),this.T(s),this._$AH=t}}_$AC(t){let B=K.get(t.strings);return void 0===B&&K.set(t.strings,B=new j(t)),B}k(t){N(this._$AH)||(this._$AH=[],this._$AR());const B=this._$AH;let s,Q=0;for(const F of t)Q===B.length?B.push(s=new q(this.O(p()),this.O(p()),this,this.options)):s=B[Q],s._$AI(F),Q++;Q<B.length&&(this._$AR(s&&s._$AB.nextSibling,Q),B.length=Q)}_$AR(t=this._$AA.nextSibling,B){for(this._$AP?.(!1,!0,B);t!==this._$AB;){const B=t.nextSibling;t.remove(),t=B}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}let tt=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,B,s,Q,F){this.type=1,this._$AH=z,this._$AN=void 0,this.element=t,this.name=B,this._$AM=Q,this.options=F,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=z}_$AI(t,B=this,s,Q){const F=this.strings;let i=!1;if(void 0===F)t=_(this,t,B,0),i=!E(t)||t!==this._$AH&&t!==T,i&&(this._$AH=t);else{const Q=t;let U,g;for(t=F[0],U=0;U<F.length-1;U++)g=_(this,Q[s+U],B,U),g===T&&(g=this._$AH[U]),i||=!E(g)||g!==this._$AH[U],g===z?t=z:t!==z&&(t+=(g??"")+F[U+1]),this._$AH[U]=g}i&&!Q&&this.j(t)}j(t){t===z?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}};class Bt extends tt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===z?void 0:t}}class st extends tt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==z)}}class Qt extends tt{constructor(t,B,s,Q,F){super(t,B,s,Q,F),this.type=5}_$AI(t,B=this){if((t=_(this,t,B,0)??z)===T)return;const s=this._$AH,Q=t===z&&s!==z||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,F=t!==z&&(s===z||Q);Q&&this.element.removeEventListener(this.name,this,s),F&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class Ft{constructor(t,B,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=B,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){_(this,t)}}const Ut=y.litHtmlPolyfillSupport;Ut?.(j,q),(y.litHtmlVersions??=[]).push("3.3.1");const gt=(t,B,s)=>{const Q=s?.renderBefore??B;let F=Q._$litPart$;if(void 0===F){const t=s?.renderBefore??null;Q._$litPart$=F=new q(B.insertBefore(p(),t),t,void 0,s??{})}return F._$AI(t),F},et=globalThis; /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */let It=class extends G{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const B=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=gt(B,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return T}};It._$litElement$=!0,It.finalized=!0,et.litElementHydrateSupport?.({LitElement:It});const lt=et.litElementPolyfillSupport;function ct(t,B){return null==t||null==B?NaN:t<B?-1:t>B?1:t>=B?0:NaN}function nt(t,B){return null==t||null==B?NaN:B<t?-1:B>t?1:B>=t?0:NaN}function at(t){let B,s,Q;function F(t,Q,F=0,i=t.length){if(F<i){if(0!==B(Q,Q))return i;do{const B=F+i>>>1;s(t[B],Q)<0?F=B+1:i=B}while(F<i)}return F}return 2!==t.length?(B=ct,s=(B,s)=>ct(t(B),s),Q=(B,s)=>t(B)-s):(B=t===ct||t===nt?t:dt,s=t,Q=t),{left:F,center:function(t,B,s=0,i=t.length){const U=F(t,B,s,i-1);return U>s&&Q(t[U-1],B)>-Q(t[U],B)?U-1:U},right:function(t,Q,F=0,i=t.length){if(F<i){if(0!==B(Q,Q))return i;do{const B=F+i>>>1;s(t[B],Q)<=0?F=B+1:i=B}while(F<i)}return F}}}function dt(){return 0}function ot(t){return null===t?NaN:+t}lt?.({LitElement:It}),(et.litElementVersions??=[]).push("4.2.1");const bt=at(ct).right;function Ct(t,B){let s=0;for(let B of t)null!=B&&(B=+B)>=B&&++s;return s}function rt(t){return 0|t.length}function ut(t){return!(t>0)}function ht(t){return"object"!=typeof t||"length"in t?t:Array.from(t)}function xt(t,B){var s=0;return Float64Array.from(t,t=>s+=+t||0)}function Gt(t,B){let s,Q=0,F=0,i=0;if(void 0===B)for(let B of t)null!=B&&(B=+B)>=B&&(s=B-F,F+=s/++Q,i+=s*(B-F));else{let U=-1;for(let g of t)null!=(g=B(g,++U,t))&&(g=+g)>=g&&(s=g-F,F+=s/++Q,i+=s*(g-F))}if(Q>1)return i/(Q-1)}function yt(t,B){const s=Gt(t,B);return s?Math.sqrt(s):s}function At(t,B){let s,Q;if(void 0===B)for(const B of t)null!=B&&(void 0===s?B>=B&&(s=Q=B):(s>B&&(s=B),Q<B&&(Q=B)));else{let F=-1;for(let i of t)null!=(i=B(i,++F,t))&&(void 0===s?i>=i&&(s=Q=i):(s>i&&(s=i),Q<i&&(Q=i)))}return[s,Q]}at(ot).center;class Lt{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const B=this._partials;let s=0;for(let Q=0;Q<this._n&&Q<32;Q++){const F=B[Q],i=t+F,U=Math.abs(t)<Math.abs(F)?t-(i-F):F-(i-t);U&&(B[s++]=U),t=i}return B[s]=t,this._n=s+1,this}valueOf(){const t=this._partials;let B,s,Q,F=this._n,i=0;if(F>0){for(i=t[--F];F>0&&(B=i,s=t[--F],i=B+s,Q=s-(i-B),!Q););F>0&&(Q<0&&t[F-1]<0||Q>0&&t[F-1]>0)&&(s=2*Q,B=i+s,s==B-i&&(i=B))}return i}}class Rt extends Map{constructor(t,B=pt){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:B}}),null!=t)for(const[B,s]of t)this.set(B,s)}get(t){return super.get(Vt(this,t))}has(t){return super.has(Vt(this,t))}set(t,B){return super.set(St(this,t),B)}delete(t){return super.delete(Zt(this,t))}}class mt extends Set{constructor(t,B=pt){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:B}}),null!=t)for(const B of t)this.add(B)}has(t){return super.has(Vt(this,t))}add(t){return super.add(St(this,t))}delete(t){return super.delete(Zt(this,t))}}function Vt({_intern:t,_key:B},s){const Q=B(s);return t.has(Q)?t.get(Q):s}function St({_intern:t,_key:B},s){const Q=B(s);return t.has(Q)?t.get(Q):(t.set(Q,s),s)}function Zt({_intern:t,_key:B},s){const Q=B(s);return t.has(Q)&&(s=t.get(Q),t.delete(Q)),s}function pt(t){return null!==t&&"object"==typeof t?t.valueOf():t}function Et(t){return t}function Nt(t,...B){return Ht(t,Et,Et,B)}function Xt(t,B,...s){return Ht(t,Et,B,s)}function Wt(t,B,...s){return Ht(t,Array.from,B,s)}function Ht(t,B,s,Q){return function t(F,i){if(i>=Q.length)return s(F);const U=new Rt,g=Q[i++];let e=-1;for(const t of F){const B=g(t,++e,F),s=U.get(B);s?s.push(t):U.set(B,[t])}for(const[B,s]of U)U.set(B,t(s,i));return B(U)}(t,0)}function Dt(t,...B){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");t=Array.from(t);let[s]=B;if(s&&2!==s.length||B.length>1){const i=Uint32Array.from(t,(t,B)=>B);return B.length>1?(B=B.map(B=>t.map(B)),i.sort((t,s)=>{for(const Q of B){const B=wt(Q[t],Q[s]);if(B)return B}})):(s=t.map(s),i.sort((t,B)=>wt(s[t],s[B]))),Q=t,F=i,Array.from(F,t=>Q[t])}var Q,F;return t.sort(ft(s))}function ft(t=ct){if(t===ct)return wt;if("function"!=typeof t)throw new TypeError("compare is not a function");return(B,s)=>{const Q=t(B,s);return Q||0===Q?Q:(0===t(s,s))-(0===t(B,B))}}function wt(t,B){return(null==t||!(t>=t))-(null==B||!(B>=B))||(t<B?-1:t>B?1:0)}function vt(t,B,s){return(2!==B.length?Dt(Xt(t,B,s),([t,B],[s,Q])=>ct(B,Q)||ct(t,s)):Dt(Nt(t,s),([t,s],[Q,F])=>B(s,F)||ct(t,Q))).map(([t])=>t)}const Yt=Math.sqrt(50),Jt=Math.sqrt(10),kt=Math.sqrt(2);function Mt(t,B,s){const Q=(B-t)/Math.max(0,s),F=Math.floor(Math.log10(Q)),i=Q/Math.pow(10,F),U=i>=Yt?10:i>=Jt?5:i>=kt?2:1;let g,e,I;return F<0?(I=Math.pow(10,-F)/U,g=Math.round(t*I),e=Math.round(B*I),g/I<t&&++g,e/I>B&&--e,I=-I):(I=Math.pow(10,F)*U,g=Math.round(t/I),e=Math.round(B/I),g*I<t&&++g,e*I>B&&--e),e<g&&.5<=s&&s<2?Mt(t,B,2*s):[g,e,I]}function Tt(t,B,s){if(!((s=+s)>0))return[];if((t=+t)===(B=+B))return[t];const Q=B<t,[F,i,U]=Q?Mt(B,t,s):Mt(t,B,s);if(!(i>=F))return[];const g=i-F+1,e=new Array(g);if(Q)if(U<0)for(let t=0;t<g;++t)e[t]=(i-t)/-U;else for(let t=0;t<g;++t)e[t]=(i-t)*U;else if(U<0)for(let t=0;t<g;++t)e[t]=(F+t)/-U;else for(let t=0;t<g;++t)e[t]=(F+t)*U;return e}function zt(t,B,s){return Mt(t=+t,B=+B,s=+s)[2]}function Kt(t,B,s){s=+s;const Q=(B=+B)<(t=+t),F=Q?zt(B,t,s):zt(t,B,s);return(Q?-1:1)*(F<0?1/-F:F)}function Ot(t){return Math.max(1,Math.ceil(Math.log(Ct(t))/Math.LN2)+1)}function Pt(t,B){let s;if(void 0===B)for(const B of t)null!=B&&(s<B||void 0===s&&B>=B)&&(s=B);else{let Q=-1;for(let F of t)null!=(F=B(F,++Q,t))&&(s<F||void 0===s&&F>=F)&&(s=F)}return s}function jt(t,B){let s,Q=-1,F=-1;if(void 0===B)for(const B of t)++F,null!=B&&(s<B||void 0===s&&B>=B)&&(s=B,Q=F);else for(let i of t)null!=(i=B(i,++F,t))&&(s<i||void 0===s&&i>=i)&&(s=i,Q=F);return Q}function _t(t,B){let s;if(void 0===B)for(const B of t)null!=B&&(s>B||void 0===s&&B>=B)&&(s=B);else{let Q=-1;for(let F of t)null!=(F=B(F,++Q,t))&&(s>F||void 0===s&&F>=F)&&(s=F)}return s}function $t(t,B){let s,Q=-1,F=-1;if(void 0===B)for(const B of t)++F,null!=B&&(s>B||void 0===s&&B>=B)&&(s=B,Q=F);else for(let i of t)null!=(i=B(i,++F,t))&&(s>i||void 0===s&&i>=i)&&(s=i,Q=F);return Q}function qt(t,B,s=0,Q=1/0,F){if(B=Math.floor(B),s=Math.floor(Math.max(0,s)),Q=Math.floor(Math.min(t.length-1,Q)),!(s<=B&&B<=Q))return t;for(F=void 0===F?wt:ft(F);Q>s;){if(Q-s>600){const i=Q-s+1,U=B-s+1,g=Math.log(i),e=.5*Math.exp(2*g/3),I=.5*Math.sqrt(g*e*(i-e)/i)*(U-i/2<0?-1:1);qt(t,B,Math.max(s,Math.floor(B-U*e/i+I)),Math.min(Q,Math.floor(B+(i-U)*e/i+I)),F)}const i=t[B];let U=s,g=Q;for(tB(t,s,B),F(t[Q],i)>0&&tB(t,s,Q);U<g;){for(tB(t,U,g),++U,--g;F(t[U],i)<0;)++U;for(;F(t[g],i)>0;)--g}0===F(t[s],i)?tB(t,s,g):(++g,tB(t,g,Q)),g<=B&&(s=g+1),B<=g&&(Q=g-1)}return t}function tB(t,B,s){const Q=t[B];t[B]=t[s],t[s]=Q}function BB(t,B=ct){let s,Q=!1;if(1===B.length){let F;for(const i of t){const t=B(i);(Q?ct(t,F)>0:0===ct(t,t))&&(s=i,F=t,Q=!0)}}else for(const F of t)(Q?B(F,s)>0:0===B(F,F))&&(s=F,Q=!0);return s}function sB(t,B,s){if(t=Float64Array.from(function*(t,B){if(void 0===B)for(let B of t)null!=B&&(B=+B)>=B&&(yield B);else{let s=-1;for(let Q of t)null!=(Q=B(Q,++s,t))&&(Q=+Q)>=Q&&(yield Q)}}(t,s)),(Q=t.length)&&!isNaN(B=+B)){if(B<=0||Q<2)return _t(t);if(B>=1)return Pt(t);var Q,F=(Q-1)*B,i=Math.floor(F),U=Pt(qt(t,i).subarray(0,i+1));return U+(_t(t.subarray(i+1))-U)*(F-i)}}function QB(t,B,s=ot){if((Q=t.length)&&!isNaN(B=+B)){if(B<=0||Q<2)return+s(t[0],0,t);if(B>=1)return+s(t[Q-1],Q-1,t);var Q,F=(Q-1)*B,i=Math.floor(F),U=+s(t[i],i,t);return U+(+s(t[i+1],i+1,t)-U)*(F-i)}}function FB(t,B,s){const Q=Ct(t),F=sB(t,.75)-sB(t,.25);return Q&&F?Math.ceil((s-B)/(2*F*Math.pow(Q,-1/3))):1}function iB(t,B,s){const Q=Ct(t),F=yt(t);return Q&&F?Math.ceil((s-B)*Math.cbrt(Q)/(3.49*F)):1}function UB(t,B){let s=0,Q=0;if(void 0===B)for(let B of t)null!=B&&(B=+B)>=B&&(++s,Q+=B);else{let F=-1;for(let i of t)null!=(i=B(i,++F,t))&&(i=+i)>=i&&(++s,Q+=i)}if(s)return Q/s}function gB(t,B){return sB(t,.5,B)}function eB(t){return Array.from(function*(t){for(const B of t)yield*B}(t))}function IB(t,B){const s=new Rt;if(void 0===B)for(let B of t)null!=B&&B>=B&&s.set(B,(s.get(B)||0)+1);else{let Q=-1;for(let F of t)null!=(F=B(F,++Q,t))&&F>=F&&s.set(F,(s.get(F)||0)+1)}let Q,F=0;for(const[t,B]of s)B>F&&(F=B,Q=t);return Q}function lB(t,B){return[t,B]}function cB(t,B,s){t=+t,B=+B,s=(F=arguments.length)<2?(B=t,t=0,1):F<3?1:+s;for(var Q=-1,F=0|Math.max(0,Math.ceil((B-t)/s)),i=new Array(F);++Q<F;)i[Q]=t+Q*s;return i}function nB(t,B){let s=0;if(void 0===B)for(let B of t)(B=+B)&&(s+=B);else{let Q=-1;for(let F of t)(F=+B(F,++Q,t))&&(s+=F)}return s}function aB(t){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");return Array.from(t).reverse()}function dB(t){return t}var oB=1e-6;function bB(t){return"translate("+t+",0)"}function CB(t){return"translate(0,"+t+")"}function rB(t){return B=>+t(B)}function uB(t,B){return B=Math.max(0,t.bandwidth()-2*B)/2,t.round()&&(B=Math.round(B)),s=>+t(s)+B}function hB(){return!this.__axis}function xB(t,B){var s=[],Q=null,F=null,i=6,U=6,g=3,e="undefined"!=typeof window&&window.devicePixelRatio>1?0:.5,I=1===t||4===t?-1:1,l=4===t||2===t?"x":"y",c=1===t||3===t?bB:CB;function n(n){var a=null==Q?B.ticks?B.ticks.apply(B,s):B.domain():Q,d=null==F?B.tickFormat?B.tickFormat.apply(B,s):dB:F,o=Math.max(i,0)+g,b=B.range(),C=+b[0]+e,r=+b[b.length-1]+e,u=(B.bandwidth?uB:rB)(B.copy(),e),h=n.selection?n.selection():n,x=h.selectAll(".domain").data([null]),G=h.selectAll(".tick").data(a,B).order(),y=G.exit(),A=G.enter().append("g").attr("class","tick"),L=G.select("line"),R=G.select("text");x=x.merge(x.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),G=G.merge(A),L=L.merge(A.append("line").attr("stroke","currentColor").attr(l+"2",I*i)),R=R.merge(A.append("text").attr("fill","currentColor").attr(l,I*o).attr("dy",1===t?"0em":3===t?"0.71em":"0.32em")),n!==h&&(x=x.transition(n),G=G.transition(n),L=L.transition(n),R=R.transition(n),y=y.transition(n).attr("opacity",oB).attr("transform",function(t){return isFinite(t=u(t))?c(t+e):this.getAttribute("transform")}),A.attr("opacity",oB).attr("transform",function(t){var B=this.parentNode.__axis;return c((B&&isFinite(B=B(t))?B:u(t))+e)})),y.remove(),x.attr("d",4===t||2===t?U?"M"+I*U+","+C+"H"+e+"V"+r+"H"+I*U:"M"+e+","+C+"V"+r:U?"M"+C+","+I*U+"V"+e+"H"+r+"V"+I*U:"M"+C+","+e+"H"+r),G.attr("opacity",1).attr("transform",function(t){return c(u(t)+e)}),L.attr(l+"2",I*i),R.attr(l,I*o).text(d),h.filter(hB).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",2===t?"start":4===t?"end":"middle"),h.each(function(){this.__axis=u})}return n.scale=function(t){return arguments.length?(B=t,n):B},n.ticks=function(){return s=Array.from(arguments),n},n.tickArguments=function(t){return arguments.length?(s=null==t?[]:Array.from(t),n):s.slice()},n.tickValues=function(t){return arguments.length?(Q=null==t?null:Array.from(t),n):Q&&Q.slice()},n.tickFormat=function(t){return arguments.length?(F=t,n):F},n.tickSize=function(t){return arguments.length?(i=U=+t,n):i},n.tickSizeInner=function(t){return arguments.length?(i=+t,n):i},n.tickSizeOuter=function(t){return arguments.length?(U=+t,n):U},n.tickPadding=function(t){return arguments.length?(g=+t,n):g},n.offset=function(t){return arguments.length?(e=+t,n):e},n}function GB(t){return xB(3,t)}function yB(t){return xB(4,t)}var AB={value:()=>{}};function LB(){for(var t,B=0,s=arguments.length,Q={};B<s;++B){if(!(t=arguments[B]+"")||t in Q||/[\s.]/.test(t))throw new Error("illegal type: "+t);Q[t]=[]}return new RB(Q)}function RB(t){this._=t}function mB(t,B){for(var s,Q=0,F=t.length;Q<F;++Q)if((s=t[Q]).name===B)return s.value}function VB(t,B,s){for(var Q=0,F=t.length;Q<F;++Q)if(t[Q].name===B){t[Q]=AB,t=t.slice(0,Q).concat(t.slice(Q+1));break}return null!=s&&t.push({name:B,value:s}),t}RB.prototype=LB.prototype={constructor:RB,on:function(t,B){var s,Q,F=this._,i=(Q=F,(t+"").trim().split(/^|\s+/).map(function(t){var B="",s=t.indexOf(".");if(s>=0&&(B=t.slice(s+1),t=t.slice(0,s)),t&&!Q.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:B}})),U=-1,g=i.length;if(!(arguments.length<2)){if(null!=B&&"function"!=typeof B)throw new Error("invalid callback: "+B);for(;++U<g;)if(s=(t=i[U]).type)F[s]=VB(F[s],t.name,B);else if(null==B)for(s in F)F[s]=VB(F[s],t.name,null);return this}for(;++U<g;)if((s=(t=i[U]).type)&&(s=mB(F[s],t.name)))return s},copy:function(){var t={},B=this._;for(var s in B)t[s]=B[s].slice();return new RB(t)},call:function(t,B){if((s=arguments.length-2)>0)for(var s,Q,F=new Array(s),i=0;i<s;++i)F[i]=arguments[i+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(i=0,s=(Q=this._[t]).length;i<s;++i)Q[i].value.apply(B,F)},apply:function(t,B,s){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var Q=this._[t],F=0,i=Q.length;F<i;++F)Q[F].value.apply(B,s)}};var SB="http://www.w3.org/1999/xhtml",ZB={svg:"http://www.w3.org/2000/svg",xhtml:SB,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function pB(t){var B=t+="",s=B.indexOf(":");return s>=0&&"xmlns"!==(B=t.slice(0,s))&&(t=t.slice(s+1)),ZB.hasOwnProperty(B)?{space:ZB[B],local:t}:t}function EB(t){return function(){var B=this.ownerDocument,s=this.namespaceURI;return s===SB&&B.documentElement.namespaceURI===SB?B.createElement(t):B.createElementNS(s,t)}}function NB(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function XB(t){var B=pB(t);return(B.local?NB:EB)(B)}function WB(){}function HB(t){return null==t?WB:function(){return this.querySelector(t)}}function DB(){return[]}function fB(t){return null==t?DB:function(){return this.querySelectorAll(t)}}function wB(t){return function(){return function(t){return null==t?[]:Array.isArray(t)?t:Array.from(t)}(t.apply(this,arguments))}}function vB(t){return function(){return this.matches(t)}}function YB(t){return function(B){return B.matches(t)}}var JB=Array.prototype.find;function kB(){return this.firstElementChild}var MB=Array.prototype.filter;function TB(){return Array.from(this.children)}function zB(t){return new Array(t.length)}function KB(t,B){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=B}function OB(t,B,s,Q,F,i){for(var U,g=0,e=B.length,I=i.length;g<I;++g)(U=B[g])?(U.__data__=i[g],Q[g]=U):s[g]=new KB(t,i[g]);for(;g<e;++g)(U=B[g])&&(F[g]=U)}function PB(t,B,s,Q,F,i,U){var g,e,I,l=new Map,c=B.length,n=i.length,a=new Array(c);for(g=0;g<c;++g)(e=B[g])&&(a[g]=I=U.call(e,e.__data__,g,B)+"",l.has(I)?F[g]=e:l.set(I,e));for(g=0;g<n;++g)I=U.call(t,i[g],g,i)+"",(e=l.get(I))?(Q[g]=e,e.__data__=i[g],l.delete(I)):s[g]=new KB(t,i[g]);for(g=0;g<c;++g)(e=B[g])&&l.get(a[g])===e&&(F[g]=e)}function jB(t){return t.__data__}function _B(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function $B(t,B){return t<B?-1:t>B?1:t>=B?0:NaN}function qB(t){return function(){this.removeAttribute(t)}}function ts(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Bs(t,B){return function(){this.setAttribute(t,B)}}function ss(t,B){return function(){this.setAttributeNS(t.space,t.local,B)}}function Qs(t,B){return function(){var s=B.apply(this,arguments);null==s?this.removeAttribute(t):this.setAttribute(t,s)}}function Fs(t,B){return function(){var s=B.apply(this,arguments);null==s?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,s)}}function is(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Us(t){return function(){this.style.removeProperty(t)}}function gs(t,B,s){return function(){this.style.setProperty(t,B,s)}}function es(t,B,s){return function(){var Q=B.apply(this,arguments);null==Q?this.style.removeProperty(t):this.style.setProperty(t,Q,s)}}function Is(t,B){return t.style.getPropertyValue(B)||is(t).getComputedStyle(t,null).getPropertyValue(B)}function ls(t){return function(){delete this[t]}}function cs(t,B){return function(){this[t]=B}}function ns(t,B){return function(){var s=B.apply(this,arguments);null==s?delete this[t]:this[t]=s}}function as(t){return t.trim().split(/^|\s+/)}function ds(t){return t.classList||new os(t)}function os(t){this._node=t,this._names=as(t.getAttribute("class")||"")}function bs(t,B){for(var s=ds(t),Q=-1,F=B.length;++Q<F;)s.add(B[Q])}function Cs(t,B){for(var s=ds(t),Q=-1,F=B.length;++Q<F;)s.remove(B[Q])}function rs(t){return function(){bs(this,t)}}function us(t){return function(){Cs(this,t)}}function hs(t,B){return function(){(B.apply(this,arguments)?bs:Cs)(this,t)}}function xs(){this.textContent=""}function Gs(t){return function(){this.textContent=t}}function ys(t){return function(){var B=t.apply(this,arguments);this.textContent=null==B?"":B}}function As(){this.innerHTML=""}function Ls(t){return function(){this.innerHTML=t}}function Rs(t){return function(){var B=t.apply(this,arguments);this.innerHTML=null==B?"":B}}function ms(){this.nextSibling&&this.parentNode.appendChild(this)}function Vs(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Ss(){return null}function Zs(){var t=this.parentNode;t&&t.removeChild(this)}function ps(){var t=this.cloneNode(!1),B=this.parentNode;return B?B.insertBefore(t,this.nextSibling):t}function Es(){var t=this.cloneNode(!0),B=this.parentNode;return B?B.insertBefore(t,this.nextSibling):t}function Ns(t){return function(){var B=this.__on;if(B){for(var s,Q=0,F=-1,i=B.length;Q<i;++Q)s=B[Q],t.type&&s.type!==t.type||s.name!==t.name?B[++F]=s:this.removeEventListener(s.type,s.listener,s.options);++F?B.length=F:delete this.__on}}}function Xs(t,B,s){return function(){var Q,F=this.__on,i=function(t){return function(B){t.call(this,B,this.__data__)}}(B);if(F)for(var U=0,g=F.length;U<g;++U)if((Q=F[U]).type===t.type&&Q.name===t.name)return this.removeEventListener(Q.type,Q.listener,Q.options),this.addEventListener(Q.type,Q.listener=i,Q.options=s),void(Q.value=B);this.addEventListener(t.type,i,s),Q={type:t.type,name:t.name,value:B,listener:i,options:s},F?F.push(Q):this.__on=[Q]}}function Ws(t,B,s){var Q=is(t),F=Q.CustomEvent;"function"==typeof F?F=new F(B,s):(F=Q.document.createEvent("Event"),s?(F.initEvent(B,s.bubbles,s.cancelable),F.detail=s.detail):F.initEvent(B,!1,!1)),t.dispatchEvent(F)}function Hs(t,B){return function(){return Ws(this,t,B)}}function Ds(t,B){return function(){return Ws(this,t,B.apply(this,arguments))}}KB.prototype={constructor:KB,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,B){return this._parent.insertBefore(t,B)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}},os.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var B=this._names.indexOf(t);B>=0&&(this._names.splice(B,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var fs=[null];function ws(t,B){this._groups=t,this._parents=B}function vs(){return new ws([[document.documentElement]],fs)}function Ys(t){return"string"==typeof t?new ws([[document.querySelector(t)]],[document.documentElement]):new ws([[t]],fs)}function Js(t,B){if(t=function(t){let B;for(;B=t.sourceEvent;)t=B;return t}(t),void 0===B&&(B=t.currentTarget),B){var s=B.ownerSVGElement||B;if(s.createSVGPoint){var Q=s.createSVGPoint();return Q.x=t.clientX,Q.y=t.clientY,[(Q=Q.matrixTransform(B.getScreenCTM().inverse())).x,Q.y]}if(B.getBoundingClientRect){var F=B.getBoundingClientRect();return[t.clientX-F.left-B.clientLeft,t.clientY-F.top-B.clientTop]}}return[t.pageX,t.pageY]}ws.prototype=vs.prototype={constructor:ws,select:function(t){"function"!=typeof t&&(t=HB(t));for(var B=this._groups,s=B.length,Q=new Array(s),F=0;F<s;++F)for(var i,U,g=B[F],e=g.length,I=Q[F]=new Array(e),l=0;l<e;++l)(i=g[l])&&(U=t.call(i,i.__data__,l,g))&&("__data__"in i&&(U.__data__=i.__data__),I[l]=U);return new ws(Q,this._parents)},selectAll:function(t){t="function"==typeof t?wB(t):fB(t);for(var B=this._groups,s=B.length,Q=[],F=[],i=0;i<s;++i)for(var U,g=B[i],e=g.length,I=0;I<e;++I)(U=g[I])&&(Q.push(t.call(U,U.__data__,I,g)),F.push(U));return new ws(Q,F)},selectChild:function(t){return this.select(null==t?kB:function(t){return function(){return JB.call(this.children,t)}}("function"==typeof t?t:YB(t)))},selectChildren:function(t){return this.selectAll(null==t?TB:function(t){return function(){return MB.call(this.children,t)}}("function"==typeof t?t:YB(t)))},filter:function(t){"function"!=typeof t&&(t=vB(t));for(var B=this._groups,s=B.length,Q=new Array(s),F=0;F<s;++F)for(var i,U=B[F],g=U.length,e=Q[F]=[],I=0;I<g;++I)(i=U[I])&&t.call(i,i.__data__,I,U)&&e.push(i);return new ws(Q,this._parents)},data:function(t,B){if(!arguments.length)return Array.from(this,jB);var s=B?PB:OB,Q=this._parents,F=this._groups;"function"!=typeof t&&(t=function(t){return function(){return t}}(t));for(var i=F.length,U=new Array(i),g=new Array(i),e=new Array(i),I=0;I<i;++I){var l=Q[I],c=F[I],n=c.length,a=_B(t.call(l,l&&l.__data__,I,Q)),d=a.length,o=g[I]=new Array(d),b=U[I]=new Array(d);s(l,c,o,b,e[I]=new Array(n),a,B);for(var C,r,u=0,h=0;u<d;++u)if(C=o[u]){for(u>=h&&(h=u+1);!(r=b[h])&&++h<d;);C._next=r||null}}return(U=new ws(U,Q))._enter=g,U._exit=e,U},enter:function(){return new ws(this._enter||this._groups.map(zB),this._parents)},exit:function(){return new ws(this._exit||this._groups.map(zB),this._parents)},join:function(t,B,s){var Q=this.enter(),F=this,i=this.exit();return"function"==typeof t?(Q=t(Q))&&(Q=Q.selection()):Q=Q.append(t+""),null!=B&&(F=B(F))&&(F=F.selection()),null==s?i.remove():s(i),Q&&F?Q.merge(F).order():F},merge:function(t){for(var B=t.selection?t.selection():t,s=this._groups,Q=B._groups,F=s.length,i=Q.length,U=Math.min(F,i),g=new Array(F),e=0;e<U;++e)for(var I,l=s[e],c=Q[e],n=l.length,a=g[e]=new Array(n),d=0;d<n;++d)(I=l[d]||c[d])&&(a[d]=I);for(;e<F;++e)g[e]=s[e];return new ws(g,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,B=-1,s=t.length;++B<s;)for(var Q,F=t[B],i=F.length-1,U=F[i];--i>=0;)(Q=F[i])&&(U&&4^Q.compareDocumentPosition(U)&&U.parentNode.insertBefore(Q,U),U=Q);return this},sort:function(t){function B(B,s){return B&&s?t(B.__data__,s.__data__):!B-!s}t||(t=$B);for(var s=this._groups,Q=s.length,F=new Array(Q),i=0;i<Q;++i){for(var U,g=s[i],e=g.length,I=F[i]=new Array(e),l=0;l<e;++l)(U=g[l])&&(I[l]=U);I.sort(B)}return new ws(F,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var t=this._groups,B=0,s=t.length;B<s;++B)for(var Q=t[B],F=0,i=Q.length;F<i;++F){var U=Q[F];if(U)return U}return null},size:function(){let t=0;for(const B of this)++t;return t},empty:function(){return!this.node()},each:function(t){for(var B=this._groups,s=0,Q=B.length;s<Q;++s)for(var F,i=B[s],U=0,g=i.length;U<g;++U)(F=i[U])&&t.call(F,F.__data__,U,i);return this},attr:function(t,B){var s=pB(t);if(arguments.length<2){var Q=this.node();return s.local?Q.getAttributeNS(s.space,s.local):Q.getAttribute(s)}return this.each((null==B?s.local?ts:qB:"function"==typeof B?s.local?Fs:Qs:s.local?ss:Bs)(s,B))},style:function(t,B,s){return arguments.length>1?this.each((null==B?Us:"function"==typeof B?es:gs)(t,B,null==s?"":s)):Is(this.node(),t)},property:function(t,B){return arguments.length>1?this.each((null==B?ls:"function"==typeof B?ns:cs)(t,B)):this.node()[t]},classed:function(t,B){var s=as(t+"");if(arguments.length<2){for(var Q=ds(this.node()),F=-1,i=s.length;++F<i;)if(!Q.contains(s[F]))return!1;return!0}return this.each(("function"==typeof B?hs:B?rs:us)(s,B))},text:function(t){return arguments.length?this.each(null==t?xs:("function"==typeof t?ys:Gs)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?As:("function"==typeof t?Rs:Ls)(t)):this.node().innerHTML},raise:function(){return this.each(ms)},lower:function(){return this.each(Vs)},append:function(t){var B="function"==typeof t?t:XB(t);return this.select(function(){return this.appendChild(B.apply(this,arguments))})},insert:function(t,B){var s="function"==typeof t?t:XB(t),Q=null==B?Ss:"function"==typeof B?B:HB(B);return this.select(function(){return this.insertBefore(s.apply(this,arguments),Q.apply(this,arguments)||null)})},remove:function(){return this.each(Zs)},clone:function(t){return this.select(t?Es:ps)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,B,s){var Q,F,i=function(t){return t.trim().split(/^|\s+/).map(function(t){var B="",s=t.indexOf(".");return s>=0&&(B=t.slice(s+1),t=t.slice(0,s)),{type:t,name:B}})}(t+""),U=i.length;if(!(arguments.length<2)){for(g=B?Xs:Ns,Q=0;Q<U;++Q)this.each(g(i[Q],B,s));return this}var g=this.node().__on;if(g)for(var e,I=0,l=g.length;I<l;++I)for(Q=0,e=g[I];Q<U;++Q)if((F=i[Q]).type===e.type&&F.name===e.name)return e.value},dispatch:function(t,B){return this.each(("function"==typeof B?Ds:Hs)(t,B))},[Symbol.iterator]:function*(){for(var t=this._groups,B=0,s=t.length;B<s;++B)for(var Q,F=t[B],i=0,U=F.length;i<U;++i)(Q=F[i])&&(yield Q)}};const ks={passive:!1},Ms={capture:!0,passive:!1};function Ts(t){t.stopImmediatePropagation()}function zs(t){t.preventDefault(),t.stopImmediatePropagation()}var Ks=t=>()=>t;function Os(t,{sourceEvent:B,subject:s,target:Q,identifier:F,active:i,x:U,y:g,dx:e,dy:I,dispatch:l}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:B,enumerable:!0,configurable:!0},subject:{value:s,enumerable:!0,configurable:!0},target:{value:Q,enumerable:!0,configurable:!0},identifier:{value:F,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:U,enumerable:!0,configurable:!0},y:{value:g,enumerable:!0,configurable:!0},dx:{value:e,enumerable:!0,configurable:!0},dy:{value:I,enumerable:!0,configurable:!0},_:{value:l}})}function Ps(t){return!t.ctrlKey&&!t.button}function js(){return this.parentNode}function _s(t,B){return null==B?{x:t.x,y:t.y}:B}function $s(){return navigator.maxTouchPoints||"ontouchstart"in this}function qs(){var t,B,s,Q,F=Ps,i=js,U=_s,g=$s,e={},I=LB("start","drag","end"),l=0,c=0;function n(t){t.on("mousedown.drag",a).filter(g).on("touchstart.drag",b).on("touchmove.drag",C,ks).on("touchend.drag touchcancel.drag",r).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function a(U,g){if(!Q&&F.call(this,U,g)){var e=u(this,i.call(this,U,g),U,g,"mouse");e&&(Ys(U.view).on("mousemove.drag",d,Ms).on("mouseup.drag",o,Ms),function(t){var B=t.document.documentElement,s=Ys(t).on("dragstart.drag",zs,Ms);"onselectstart"in B?s.on("selectstart.drag",zs,Ms):(B.__noselect=B.style.MozUserSelect,B.style.MozUserSelect="none")}(U.view),Ts(U),s=!1,t=U.clientX,B=U.clientY,e("start",U))}}function d(Q){if(zs(Q),!s){var F=Q.clientX-t,i=Q.clientY-B;s=F*F+i*i>c}e.mouse("drag",Q)}function o(t){Ys(t.view).on("mousemove.drag mouseup.drag",null),function(t,B){var s=t.document.documentElement,Q=Ys(t).on("dragstart.drag",null);B&&(Q.on("click.drag",zs,Ms),setTimeout(function(){Q.on("click.drag",null)},0)),"onselectstart"in s?Q.on("selectstart.drag",null):(s.style.MozUserSelect=s.__noselect,delete s.__noselect)}(t.view,s),zs(t),e.mouse("end",t)}function b(t,B){if(F.call(this,t,B)){var s,Q,U=t.changedTouches,g=i.call(this,t,B),e=U.length;for(s=0;s<e;++s)(Q=u(this,g,t,B,U[s].identifier,U[s]))&&(Ts(t),Q("start",t,U[s]))}}function C(t){var B,s,Q=t.changedTouches,F=Q.length;for(B=0;B<F;++B)(s=e[Q[B].identifier])&&(zs(t),s("drag",t,Q[B]))}function r(t){var B,s,F=t.changedTouches,i=F.length;for(Q&&clearTimeout(Q),Q=setTimeout(function(){Q=null},500),B=0;B<i;++B)(s=e[F[B].identifier])&&(Ts(t),s("end",t,F[B]))}function u(t,B,s,Q,F,i){var g,c,a,d=I.copy(),o=Js(i||s,B);if(null!=(a=U.call(t,new Os("beforestart",{sourceEvent:s,target:n,identifier:F,active:l,x:o[0],y:o[1],dx:0,dy:0,dispatch:d}),Q)))return g=a.x-o[0]||0,c=a.y-o[1]||0,function s(i,U,I){var b,C=o;switch(i){case"start":e[F]=s,b=l++;break;case"end":delete e[F],--l;case"drag":o=Js(I||U,B),b=l}d.call(i,t,new Os(i,{sourceEvent:U,subject:a,target:n,identifier:F,active:b,x:o[0]+g,y:o[1]+c,dx:o[0]-C[0],dy:o[1]-C[1],dispatch:d}),Q)}}return n.filter=function(t){return arguments.length?(F="function"==typeof t?t:Ks(!!t),n):F},n.container=function(t){return arguments.length?(i="function"==typeof t?t:Ks(t),n):i},n.subject=function(t){return arguments.length?(U="function"==typeof t?t:Ks(t),n):U},n.touchable=function(t){return arguments.length?(g="function"==typeof t?t:Ks(!!t),n):g},n.on=function(){var t=I.on.apply(I,arguments);return t===I?n:t},n.clickDistance=function(t){return arguments.length?(c=(t=+t)*t,n):Math.sqrt(c)},n}function tQ(t,B,s){t.prototype=B.prototype=s,s.constructor=t}function BQ(t,B){var s=Object.create(t.prototype);for(var Q in B)s[Q]=B[Q];return s}function sQ(){}Os.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};var QQ=.7,FQ=1/QQ,iQ="\\s*([+-]?\\d+)\\s*",UQ="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",gQ="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",eQ=/^#([0-9a-f]{3,8})$/,IQ=new RegExp(`^rgb\\(${iQ},${iQ},${iQ}\\)$`),lQ=new RegExp(`^rgb\\(${gQ},${gQ},${gQ}\\)$`),cQ=new RegExp(`^rgba\\(${iQ},${iQ},${iQ},${UQ}\\)$`),nQ=new RegExp(`^rgba\\(${gQ},${gQ},${gQ},${UQ}\\)$`),aQ=new RegExp(`^hsl\\(${UQ},${gQ},${gQ}\\)$`),dQ=new RegExp(`^hsla\\(${UQ},${gQ},${gQ},${UQ}\\)$`),oQ={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};function bQ(){return this.rgb().formatHex()}function CQ(){return this.rgb().formatRgb()}function rQ(t){var B,s;return t=(t+"").trim().toLowerCase(),(B=eQ.exec(t))?(s=B[1].length,B=parseInt(B[1],16),6===s?uQ(B):3===s?new yQ(B>>8&15|B>>4&240,B>>4&15|240&B,(15&B)<<4|15&B,1):8===s?hQ(B>>24&255,B>>16&255,B>>8&255,(255&B)/255):4===s?hQ(B>>12&15|B>>8&240,B>>8&15|B>>4&240,B>>4&15|240&B,((15&B)<<4|15&B)/255):null):(B=IQ.exec(t))?new yQ(B[1],B[2],B[3],1):(B=lQ.exec(t))?new yQ(255*B[1]/100,255*B[2]/100,255*B[3]/100,1):(B=cQ.exec(t))?hQ(B[1],B[2],B[3],B[4]):(B=nQ.exec(t))?hQ(255*B[1]/100,255*B[2]/100,255*B[3]/100,B[4]):(B=aQ.exec(t))?SQ(B[1],B[2]/100,B[3]/100,1):(B=dQ.exec(t))?SQ(B[1],B[2]/100,B[3]/100,B[4]):oQ.hasOwnProperty(t)?uQ(oQ[t]):"transparent"===t?new yQ(NaN,NaN,NaN,0):null}function uQ(t){return new yQ(t>>16&255,t>>8&255,255&t,1)}function hQ(t,B,s,Q){return Q<=0&&(t=B=s=NaN),new yQ(t,B,s,Q)}function xQ(t){return t instanceof sQ||(t=rQ(t)),t?new yQ((t=t.rgb()).r,t.g,t.b,t.opacity):new yQ}function GQ(t,B,s,Q){return 1===arguments.length?xQ(t):new yQ(t,B,s,null==Q?1:Q)}function yQ(t,B,s,Q){this.r=+t,this.g=+B,this.b=+s,this.opacity=+Q}function AQ(){return`#${VQ(this.r)}${VQ(this.g)}${VQ(this.b)}`}function LQ(){const t=RQ(this.opacity);return`${1===t?"rgb(":"rgba("}${mQ(this.r)}, ${mQ(this.g)}, ${mQ(this.b)}${1===t?")":`, ${t})`}`}function RQ(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function mQ(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function VQ(t){return((t=mQ(t))<16?"0":"")+t.toString(16)}function SQ(t,B,s,Q){return Q<=0?t=B=s=NaN:s<=0||s>=1?t=B=NaN:B<=0&&(t=NaN),new EQ(t,B,s,Q)}function ZQ(t){if(t instanceof EQ)return new EQ(t.h,t.s,t.l,t.opacity);if(t instanceof sQ||(t=rQ(t)),!t)return new EQ;if(t instanceof EQ)return t;var B=(t=t.rgb()).r/255,s=t.g/255,Q=t.b/255,F=Math.min(B,s,Q),i=Math.max(B,s,Q),U=NaN,g=i-F,e=(i+F)/2;return g?(U=B===i?(s-Q)/g+6*(s<Q):s===i?(Q-B)/g+2:(B-s)/g+4,g/=e<.5?i+F:2-i-F,U*=60):g=e>0&&e<1?0:U,new EQ(U,g,e,t.opacity)}function pQ(t,B,s,Q){return 1===arguments.length?ZQ(t):new EQ(t,B,s,null==Q?1:Q)}function EQ(t,B,s,Q){this.h=+t,this.s=+B,this.l=+s,this.opacity=+Q}function NQ(t){return(t=(t||0)%360)<0?t+360:t}function XQ(t){return Math.max(0,Math.min(1,t||0))}function WQ(t,B,s){return 255*(t<60?B+(s-B)*t/60:t<180?s:t<240?B+(s-B)*(240-t)/60:B)}tQ(sQ,rQ,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:bQ,formatHex:bQ,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return ZQ(this).formatHsl()},formatRgb:CQ,toString:CQ}),tQ(yQ,GQ,BQ(sQ,{brighter(t){return t=