@decidables/discountable-elements
Version:
discountable-elements: Web Components for visualizing Hyperbolic Temporal Discounting
23 lines • 1.01 MB
JavaScript
/**
* @license
* Copyright 2019 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
const B=globalThis,Q=B.ShadowRoot&&(void 0===B.ShadyCSS||B.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,F=Symbol(),t=new WeakMap;let U=class{constructor(B,Q,t){if(this._$cssResult$=!0,t!==F)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=B,this.t=Q}get styleSheet(){let B=this.o;const F=this.t;if(Q&&void 0===B){const Q=void 0!==F&&1===F.length;Q&&(B=t.get(F)),void 0===B&&((this.o=B=new CSSStyleSheet).replaceSync(this.cssText),Q&&t.set(F,B))}return B}toString(){return this.cssText}};const I=B=>new U("string"==typeof B?B:B+"",void 0,F),s=(B,...Q)=>{const t=1===B.length?B[0]:Q.reduce(((Q,F,t)=>Q+(B=>{if(!0===B._$cssResult$)return B.cssText;if("number"==typeof B)return B;throw Error("Value passed to 'css' function must be a 'css' function result: "+B+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(F)+B[t+1]),B[0]);return new U(t,B,F)},g=Q?B=>B:B=>B instanceof CSSStyleSheet?(B=>{let Q="";for(const F of B.cssRules)Q+=F.cssText;return I(Q)})(B):B
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/,{is:i,defineProperty:l,getOwnPropertyDescriptor:c,getOwnPropertyNames:e,getOwnPropertySymbols:n,getPrototypeOf:d}=Object,C=globalThis,a=C.trustedTypes,b=a?a.emptyScript:"",o=C.reactiveElementPolyfillSupport,G=(B,Q)=>B,u={toAttribute(B,Q){switch(Q){case Boolean:B=B?b:null;break;case Object:case Array:B=null==B?B:JSON.stringify(B)}return B},fromAttribute(B,Q){let F=B;switch(Q){case Boolean:F=null!==B;break;case Number:F=null===B?null:Number(B);break;case Object:case Array:try{F=JSON.parse(B)}catch(B){F=null}}return F}},r=(B,Q)=>!i(B,Q),x={attribute:!0,type:String,converter:u,reflect:!1,hasChanged:r};Symbol.metadata??=Symbol("metadata"),C.litPropertyMetadata??=new WeakMap;let A=class extends HTMLElement{static addInitializer(B){this._$Ei(),(this.l??=[]).push(B)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(B,Q=x){if(Q.state&&(Q.attribute=!1),this._$Ei(),this.elementProperties.set(B,Q),!Q.noAccessor){const F=Symbol(),t=this.getPropertyDescriptor(B,F,Q);void 0!==t&&l(this.prototype,B,t)}}static getPropertyDescriptor(B,Q,F){const{get:t,set:U}=c(this.prototype,B)??{get(){return this[Q]},set(B){this[Q]=B}};return{get(){return t?.call(this)},set(Q){const I=t?.call(this);U.call(this,Q),this.requestUpdate(B,I,F)},configurable:!0,enumerable:!0}}static getPropertyOptions(B){return this.elementProperties.get(B)??x}static _$Ei(){if(this.hasOwnProperty(G("elementProperties")))return;const B=d(this);B.finalize(),void 0!==B.l&&(this.l=[...B.l]),this.elementProperties=new Map(B.elementProperties)}static finalize(){if(this.hasOwnProperty(G("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(G("properties"))){const B=this.properties,Q=[...e(B),...n(B)];for(const F of Q)this.createProperty(F,B[F])}const B=this[Symbol.metadata];if(null!==B){const Q=litPropertyMetadata.get(B);if(void 0!==Q)for(const[B,F]of Q)this.elementProperties.set(B,F)}this._$Eh=new Map;for(const[B,Q]of this.elementProperties){const F=this._$Eu(B,Q);void 0!==F&&this._$Eh.set(F,B)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(B){const Q=[];if(Array.isArray(B)){const F=new Set(B.flat(1/0).reverse());for(const B of F)Q.unshift(g(B))}else void 0!==B&&Q.push(g(B));return Q}static _$Eu(B,Q){const F=Q.attribute;return!1===F?void 0:"string"==typeof F?F:"string"==typeof B?B.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((B=>this.enableUpdating=B)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((B=>B(this)))}addController(B){(this._$EO??=new Set).add(B),void 0!==this.renderRoot&&this.isConnected&&B.hostConnected?.()}removeController(B){this._$EO?.delete(B)}_$E_(){const B=new Map,Q=this.constructor.elementProperties;for(const F of Q.keys())this.hasOwnProperty(F)&&(B.set(F,this[F]),delete this[F]);B.size>0&&(this._$Ep=B)}createRenderRoot(){const F=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((F,t)=>{if(Q)F.adoptedStyleSheets=t.map((B=>B instanceof CSSStyleSheet?B:B.styleSheet));else for(const Q of t){const t=document.createElement("style"),U=B.litNonce;void 0!==U&&t.setAttribute("nonce",U),t.textContent=Q.cssText,F.appendChild(t)}})(F,this.constructor.elementStyles),F}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((B=>B.hostConnected?.()))}enableUpdating(B){}disconnectedCallback(){this._$EO?.forEach((B=>B.hostDisconnected?.()))}attributeChangedCallback(B,Q,F){this._$AK(B,F)}_$EC(B,Q){const F=this.constructor.elementProperties.get(B),t=this.constructor._$Eu(B,F);if(void 0!==t&&!0===F.reflect){const U=(void 0!==F.converter?.toAttribute?F.converter:u).toAttribute(Q,F.type);this._$Em=B,null==U?this.removeAttribute(t):this.setAttribute(t,U),this._$Em=null}}_$AK(B,Q){const F=this.constructor,t=F._$Eh.get(B);if(void 0!==t&&this._$Em!==t){const B=F.getPropertyOptions(t),U="function"==typeof B.converter?{fromAttribute:B.converter}:void 0!==B.converter?.fromAttribute?B.converter:u;this._$Em=t,this[t]=U.fromAttribute(Q,B.type),this._$Em=null}}requestUpdate(B,Q,F){if(void 0!==B){if(F??=this.constructor.getPropertyOptions(B),!(F.hasChanged??r)(this[B],Q))return;this.P(B,Q,F)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(B,Q,F){this._$AL.has(B)||this._$AL.set(B,Q),!0===F.reflect&&this._$Em!==B&&(this._$Ej??=new Set).add(B)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(B){Promise.reject(B)}const B=this.scheduleUpdate();return null!=B&&await B,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[B,Q]of this._$Ep)this[B]=Q;this._$Ep=void 0}const B=this.constructor.elementProperties;if(B.size>0)for(const[Q,F]of B)!0!==F.wrapped||this._$AL.has(Q)||void 0===this[Q]||this.P(Q,this[Q],F)}let B=!1;const Q=this._$AL;try{B=this.shouldUpdate(Q),B?(this.willUpdate(Q),this._$EO?.forEach((B=>B.hostUpdate?.())),this.update(Q)):this._$EU()}catch(Q){throw B=!1,this._$EU(),Q}B&&this._$AE(Q)}willUpdate(B){}_$AE(B){this._$EO?.forEach((B=>B.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(B)),this.updated(B)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(B){return!0}update(B){this._$Ej&&=this._$Ej.forEach((B=>this._$EC(B,this[B]))),this._$EU()}updated(B){}firstUpdated(B){}};A.elementStyles=[],A.shadowRootOptions={mode:"open"},A[G("elementProperties")]=new Map,A[G("finalized")]=new Map,o?.({ReactiveElement:A}),(C.reactiveElementVersions??=[]).push("2.0.4");
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
const L=globalThis,h=L.trustedTypes,y=h?h.createPolicy("lit-html",{createHTML:B=>B}):void 0,R="$lit$",V=`lit$${Math.random().toFixed(9).slice(2)}$`,Z="?"+V,S=`<${Z}>`,m=document,E=()=>m.createComment(""),N=B=>null===B||"object"!=typeof B&&"function"!=typeof B,X=Array.isArray,p="[ \t\n\f\r]",W=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,H=/-->/g,D=/>/g,Y=RegExp(`>|${p}(?:([^\\s"'>=/]+)(${p}*=${p}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),f=/'/g,w=/"/g,v=/^(?:script|style|textarea|title)$/i,J=B=>(Q,...F)=>({_$litType$:B,strings:Q,values:F}),k=J(1),M=J(2),T=Symbol.for("lit-noChange"),z=Symbol.for("lit-nothing"),K=new WeakMap,O=m.createTreeWalker(m,129);function P(B,Q){if(!X(B)||!B.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==y?y.createHTML(Q):Q}let j=class B{constructor({strings:Q,_$litType$:F},t){let U;this.parts=[];let I=0,s=0;const g=Q.length-1,i=this.parts,[l,c]=((B,Q)=>{const F=B.length-1,t=[];let U,I=2===Q?"<svg>":3===Q?"<math>":"",s=W;for(let Q=0;Q<F;Q++){const F=B[Q];let g,i,l=-1,c=0;for(;c<F.length&&(s.lastIndex=c,i=s.exec(F),null!==i);)c=s.lastIndex,s===W?"!--"===i[1]?s=H:void 0!==i[1]?s=D:void 0!==i[2]?(v.test(i[2])&&(U=RegExp("</"+i[2],"g")),s=Y):void 0!==i[3]&&(s=Y):s===Y?">"===i[0]?(s=U??W,l=-1):void 0===i[1]?l=-2:(l=s.lastIndex-i[2].length,g=i[1],s=void 0===i[3]?Y:'"'===i[3]?w:f):s===w||s===f?s=Y:s===H||s===D?s=W:(s=Y,U=void 0);const e=s===Y&&B[Q+1].startsWith("/>")?" ":"";I+=s===W?F+S:l>=0?(t.push(g),F.slice(0,l)+R+F.slice(l)+V+e):F+V+(-2===l?Q:e)}return[P(B,I+(B[F]||"<?>")+(2===Q?"</svg>":3===Q?"</math>":"")),t]})(Q,F);if(this.el=B.createElement(l,t),O.currentNode=this.el.content,2===F||3===F){const B=this.el.content.firstChild;B.replaceWith(...B.childNodes)}for(;null!==(U=O.nextNode())&&i.length<g;){if(1===U.nodeType){if(U.hasAttributes())for(const B of U.getAttributeNames())if(B.endsWith(R)){const Q=c[s++],F=U.getAttribute(B).split(V),t=/([.?@])?(.*)/.exec(Q);i.push({type:1,index:I,name:t[2],strings:F,ctor:"."===t[1]?QB:"?"===t[1]?FB:"@"===t[1]?tB:BB}),U.removeAttribute(B)}else B.startsWith(V)&&(i.push({type:6,index:I}),U.removeAttribute(B));if(v.test(U.tagName)){const B=U.textContent.split(V),Q=B.length-1;if(Q>0){U.textContent=h?h.emptyScript:"";for(let F=0;F<Q;F++)U.append(B[F],E()),O.nextNode(),i.push({type:2,index:++I});U.append(B[Q],E())}}}else if(8===U.nodeType)if(U.data===Z)i.push({type:2,index:I});else{let B=-1;for(;-1!==(B=U.data.indexOf(V,B+1));)i.push({type:7,index:I}),B+=V.length-1}I++}}static createElement(B,Q){const F=m.createElement("template");return F.innerHTML=B,F}};function _(B,Q,F=B,t){if(Q===T)return Q;let U=void 0!==t?F._$Co?.[t]:F._$Cl;const I=N(Q)?void 0:Q._$litDirective$;return U?.constructor!==I&&(U?._$AO?.(!1),void 0===I?U=void 0:(U=new I(B),U._$AT(B,F,t)),void 0!==t?(F._$Co??=[])[t]=U:F._$Cl=U),void 0!==U&&(Q=_(B,U._$AS(B,Q.values),U,t)),Q}let $=class{constructor(B,Q){this._$AV=[],this._$AN=void 0,this._$AD=B,this._$AM=Q}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(B){const{el:{content:Q},parts:F}=this._$AD,t=(B?.creationScope??m).importNode(Q,!0);O.currentNode=t;let U=O.nextNode(),I=0,s=0,g=F[0];for(;void 0!==g;){if(I===g.index){let Q;2===g.type?Q=new q(U,U.nextSibling,this,B):1===g.type?Q=new g.ctor(U,g.name,g.strings,this,B):6===g.type&&(Q=new UB(U,this,B)),this._$AV.push(Q),g=F[++s]}I!==g?.index&&(U=O.nextNode(),I++)}return O.currentNode=m,t}p(B){let Q=0;for(const F of this._$AV)void 0!==F&&(void 0!==F.strings?(F._$AI(B,F,Q),Q+=F.strings.length-2):F._$AI(B[Q])),Q++}};class q{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(B,Q,F,t){this.type=2,this._$AH=z,this._$AN=void 0,this._$AA=B,this._$AB=Q,this._$AM=F,this.options=t,this._$Cv=t?.isConnected??!0}get parentNode(){let B=this._$AA.parentNode;const Q=this._$AM;return void 0!==Q&&11===B?.nodeType&&(B=Q.parentNode),B}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(B,Q=this){B=_(this,B,Q),N(B)?B===z||null==B||""===B?(this._$AH!==z&&this._$AR(),this._$AH=z):B!==this._$AH&&B!==T&&this._(B):void 0!==B._$litType$?this.$(B):void 0!==B.nodeType?this.T(B):(B=>X(B)||"function"==typeof B?.[Symbol.iterator])(B)?this.k(B):this._(B)}O(B){return this._$AA.parentNode.insertBefore(B,this._$AB)}T(B){this._$AH!==B&&(this._$AR(),this._$AH=this.O(B))}_(B){this._$AH!==z&&N(this._$AH)?this._$AA.nextSibling.data=B:this.T(m.createTextNode(B)),this._$AH=B}$(B){const{values:Q,_$litType$:F}=B,t="number"==typeof F?this._$AC(B):(void 0===F.el&&(F.el=j.createElement(P(F.h,F.h[0]),this.options)),F);if(this._$AH?._$AD===t)this._$AH.p(Q);else{const B=new $(t,this),F=B.u(this.options);B.p(Q),this.T(F),this._$AH=B}}_$AC(B){let Q=K.get(B.strings);return void 0===Q&&K.set(B.strings,Q=new j(B)),Q}k(B){X(this._$AH)||(this._$AH=[],this._$AR());const Q=this._$AH;let F,t=0;for(const U of B)t===Q.length?Q.push(F=new q(this.O(E()),this.O(E()),this,this.options)):F=Q[t],F._$AI(U),t++;t<Q.length&&(this._$AR(F&&F._$AB.nextSibling,t),Q.length=t)}_$AR(B=this._$AA.nextSibling,Q){for(this._$AP?.(!1,!0,Q);B&&B!==this._$AB;){const Q=B.nextSibling;B.remove(),B=Q}}setConnected(B){void 0===this._$AM&&(this._$Cv=B,this._$AP?.(B))}}let BB=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(B,Q,F,t,U){this.type=1,this._$AH=z,this._$AN=void 0,this.element=B,this.name=Q,this._$AM=t,this.options=U,F.length>2||""!==F[0]||""!==F[1]?(this._$AH=Array(F.length-1).fill(new String),this.strings=F):this._$AH=z}_$AI(B,Q=this,F,t){const U=this.strings;let I=!1;if(void 0===U)B=_(this,B,Q,0),I=!N(B)||B!==this._$AH&&B!==T,I&&(this._$AH=B);else{const t=B;let s,g;for(B=U[0],s=0;s<U.length-1;s++)g=_(this,t[F+s],Q,s),g===T&&(g=this._$AH[s]),I||=!N(g)||g!==this._$AH[s],g===z?B=z:B!==z&&(B+=(g??"")+U[s+1]),this._$AH[s]=g}I&&!t&&this.j(B)}j(B){B===z?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,B??"")}};class QB extends BB{constructor(){super(...arguments),this.type=3}j(B){this.element[this.name]=B===z?void 0:B}}class FB extends BB{constructor(){super(...arguments),this.type=4}j(B){this.element.toggleAttribute(this.name,!!B&&B!==z)}}class tB extends BB{constructor(B,Q,F,t,U){super(B,Q,F,t,U),this.type=5}_$AI(B,Q=this){if((B=_(this,B,Q,0)??z)===T)return;const F=this._$AH,t=B===z&&F!==z||B.capture!==F.capture||B.once!==F.once||B.passive!==F.passive,U=B!==z&&(F===z||t);t&&this.element.removeEventListener(this.name,this,F),U&&this.element.addEventListener(this.name,this,B),this._$AH=B}handleEvent(B){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,B):this._$AH.handleEvent(B)}}class UB{constructor(B,Q,F){this.element=B,this.type=6,this._$AN=void 0,this._$AM=Q,this.options=F}get _$AU(){return this._$AM._$AU}_$AI(B){_(this,B)}}const IB=L.litHtmlPolyfillSupport;IB?.(j,q),(L.litHtmlVersions??=[]).push("3.2.1");
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
let sB=class extends A{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const B=super.createRenderRoot();return this.renderOptions.renderBefore??=B.firstChild,B}update(B){const Q=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(B),this._$Do=((B,Q,F)=>{const t=F?.renderBefore??Q;let U=t._$litPart$;if(void 0===U){const B=F?.renderBefore??null;t._$litPart$=U=new q(Q.insertBefore(E(),B),B,void 0,F??{})}return U._$AI(B),U})(Q,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return T}};sB._$litElement$=!0,sB.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:sB});const gB=globalThis.litElementPolyfillSupport;function iB(B,Q){return null==B||null==Q?NaN:B<Q?-1:B>Q?1:B>=Q?0:NaN}function lB(B,Q){return null==B||null==Q?NaN:Q<B?-1:Q>B?1:Q>=B?0:NaN}function cB(B){let Q,F,t;function U(B,t,U=0,I=B.length){if(U<I){if(0!==Q(t,t))return I;do{const Q=U+I>>>1;F(B[Q],t)<0?U=Q+1:I=Q}while(U<I)}return U}return 2!==B.length?(Q=iB,F=(Q,F)=>iB(B(Q),F),t=(Q,F)=>B(Q)-F):(Q=B===iB||B===lB?B:eB,F=B,t=B),{left:U,center:function(B,Q,F=0,I=B.length){const s=U(B,Q,F,I-1);return s>F&&t(B[s-1],Q)>-t(B[s],Q)?s-1:s},right:function(B,t,U=0,I=B.length){if(U<I){if(0!==Q(t,t))return I;do{const Q=U+I>>>1;F(B[Q],t)<=0?U=Q+1:I=Q}while(U<I)}return U}}}function eB(){return 0}function nB(B){return null===B?NaN:+B}gB?.({LitElement:sB}),(globalThis.litElementVersions??=[]).push("4.1.1");const dB=cB(iB).right;function CB(B,Q){let F=0;for(let Q of B)null!=Q&&(Q=+Q)>=Q&&++F;return F}function aB(B){return 0|B.length}function bB(B){return!(B>0)}function oB(B){return"object"!=typeof B||"length"in B?B:Array.from(B)}function GB(B,Q){var F=0;return Float64Array.from(B,(B=>F+=+B||0))}function uB(B,Q){let F,t=0,U=0,I=0;if(void 0===Q)for(let Q of B)null!=Q&&(Q=+Q)>=Q&&(F=Q-U,U+=F/++t,I+=F*(Q-U));else{let s=-1;for(let g of B)null!=(g=Q(g,++s,B))&&(g=+g)>=g&&(F=g-U,U+=F/++t,I+=F*(g-U))}if(t>1)return I/(t-1)}function rB(B,Q){const F=uB(B,Q);return F?Math.sqrt(F):F}function xB(B,Q){let F,t;if(void 0===Q)for(const Q of B)null!=Q&&(void 0===F?Q>=Q&&(F=t=Q):(F>Q&&(F=Q),t<Q&&(t=Q)));else{let U=-1;for(let I of B)null!=(I=Q(I,++U,B))&&(void 0===F?I>=I&&(F=t=I):(F>I&&(F=I),t<I&&(t=I)))}return[F,t]}cB(nB).center;class AB{constructor(){this._partials=new Float64Array(32),this._n=0}add(B){const Q=this._partials;let F=0;for(let t=0;t<this._n&&t<32;t++){const U=Q[t],I=B+U,s=Math.abs(B)<Math.abs(U)?B-(I-U):U-(I-B);s&&(Q[F++]=s),B=I}return Q[F]=B,this._n=F+1,this}valueOf(){const B=this._partials;let Q,F,t,U=this._n,I=0;if(U>0){for(I=B[--U];U>0&&(Q=I,F=B[--U],I=Q+F,t=F-(I-Q),!t););U>0&&(t<0&&B[U-1]<0||t>0&&B[U-1]>0)&&(F=2*t,Q=I+F,F==Q-I&&(I=Q))}return I}}class LB extends Map{constructor(B,Q=ZB){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:Q}}),null!=B)for(const[Q,F]of B)this.set(Q,F)}get(B){return super.get(yB(this,B))}has(B){return super.has(yB(this,B))}set(B,Q){return super.set(RB(this,B),Q)}delete(B){return super.delete(VB(this,B))}}class hB extends Set{constructor(B,Q=ZB){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:Q}}),null!=B)for(const Q of B)this.add(Q)}has(B){return super.has(yB(this,B))}add(B){return super.add(RB(this,B))}delete(B){return super.delete(VB(this,B))}}function yB({_intern:B,_key:Q},F){const t=Q(F);return B.has(t)?B.get(t):F}function RB({_intern:B,_key:Q},F){const t=Q(F);return B.has(t)?B.get(t):(B.set(t,F),F)}function VB({_intern:B,_key:Q},F){const t=Q(F);return B.has(t)&&(F=B.get(t),B.delete(t)),F}function ZB(B){return null!==B&&"object"==typeof B?B.valueOf():B}function SB(B){return B}function mB(B,...Q){return XB(B,SB,SB,Q)}function EB(B,Q,...F){return XB(B,SB,Q,F)}function NB(B,Q,...F){return XB(B,Array.from,Q,F)}function XB(B,Q,F,t){return function B(U,I){if(I>=t.length)return F(U);const s=new LB,g=t[I++];let i=-1;for(const B of U){const Q=g(B,++i,U),F=s.get(Q);F?F.push(B):s.set(Q,[B])}for(const[Q,F]of s)s.set(Q,B(F,I));return Q(s)}(B,0)}function pB(B,...Q){if("function"!=typeof B[Symbol.iterator])throw new TypeError("values is not iterable");B=Array.from(B);let[F]=Q;if(F&&2!==F.length||Q.length>1){const I=Uint32Array.from(B,((B,Q)=>Q));return Q.length>1?(Q=Q.map((Q=>B.map(Q))),I.sort(((B,F)=>{for(const t of Q){const Q=HB(t[B],t[F]);if(Q)return Q}}))):(F=B.map(F),I.sort(((B,Q)=>HB(F[B],F[Q])))),t=B,U=I,Array.from(U,(B=>t[B]))}var t,U;return B.sort(WB(F))}function WB(B=iB){if(B===iB)return HB;if("function"!=typeof B)throw new TypeError("compare is not a function");return(Q,F)=>{const t=B(Q,F);return t||0===t?t:(0===B(F,F))-(0===B(Q,Q))}}function HB(B,Q){return(null==B||!(B>=B))-(null==Q||!(Q>=Q))||(B<Q?-1:B>Q?1:0)}function DB(B,Q,F){return(2!==Q.length?pB(EB(B,Q,F),(([B,Q],[F,t])=>iB(Q,t)||iB(B,F))):pB(mB(B,F),(([B,F],[t,U])=>Q(F,U)||iB(B,t)))).map((([B])=>B))}const YB=Math.sqrt(50),fB=Math.sqrt(10),wB=Math.sqrt(2);function vB(B,Q,F){const t=(Q-B)/Math.max(0,F),U=Math.floor(Math.log10(t)),I=t/Math.pow(10,U),s=I>=YB?10:I>=fB?5:I>=wB?2:1;let g,i,l;return U<0?(l=Math.pow(10,-U)/s,g=Math.round(B*l),i=Math.round(Q*l),g/l<B&&++g,i/l>Q&&--i,l=-l):(l=Math.pow(10,U)*s,g=Math.round(B/l),i=Math.round(Q/l),g*l<B&&++g,i*l>Q&&--i),i<g&&.5<=F&&F<2?vB(B,Q,2*F):[g,i,l]}function JB(B,Q,F){if(!((F=+F)>0))return[];if((B=+B)===(Q=+Q))return[B];const t=Q<B,[U,I,s]=t?vB(Q,B,F):vB(B,Q,F);if(!(I>=U))return[];const g=I-U+1,i=new Array(g);if(t)if(s<0)for(let B=0;B<g;++B)i[B]=(I-B)/-s;else for(let B=0;B<g;++B)i[B]=(I-B)*s;else if(s<0)for(let B=0;B<g;++B)i[B]=(U+B)/-s;else for(let B=0;B<g;++B)i[B]=(U+B)*s;return i}function kB(B,Q,F){return vB(B=+B,Q=+Q,F=+F)[2]}function MB(B,Q,F){F=+F;const t=(Q=+Q)<(B=+B),U=t?kB(Q,B,F):kB(B,Q,F);return(t?-1:1)*(U<0?1/-U:U)}function TB(B){return Math.max(1,Math.ceil(Math.log(CB(B))/Math.LN2)+1)}function zB(B,Q){let F;if(void 0===Q)for(const Q of B)null!=Q&&(F<Q||void 0===F&&Q>=Q)&&(F=Q);else{let t=-1;for(let U of B)null!=(U=Q(U,++t,B))&&(F<U||void 0===F&&U>=U)&&(F=U)}return F}function KB(B,Q){let F,t=-1,U=-1;if(void 0===Q)for(const Q of B)++U,null!=Q&&(F<Q||void 0===F&&Q>=Q)&&(F=Q,t=U);else for(let I of B)null!=(I=Q(I,++U,B))&&(F<I||void 0===F&&I>=I)&&(F=I,t=U);return t}function OB(B,Q){let F;if(void 0===Q)for(const Q of B)null!=Q&&(F>Q||void 0===F&&Q>=Q)&&(F=Q);else{let t=-1;for(let U of B)null!=(U=Q(U,++t,B))&&(F>U||void 0===F&&U>=U)&&(F=U)}return F}function PB(B,Q){let F,t=-1,U=-1;if(void 0===Q)for(const Q of B)++U,null!=Q&&(F>Q||void 0===F&&Q>=Q)&&(F=Q,t=U);else for(let I of B)null!=(I=Q(I,++U,B))&&(F>I||void 0===F&&I>=I)&&(F=I,t=U);return t}function jB(B,Q,F=0,t=1/0,U){if(Q=Math.floor(Q),F=Math.floor(Math.max(0,F)),t=Math.floor(Math.min(B.length-1,t)),!(F<=Q&&Q<=t))return B;for(U=void 0===U?HB:WB(U);t>F;){if(t-F>600){const I=t-F+1,s=Q-F+1,g=Math.log(I),i=.5*Math.exp(2*g/3),l=.5*Math.sqrt(g*i*(I-i)/I)*(s-I/2<0?-1:1);jB(B,Q,Math.max(F,Math.floor(Q-s*i/I+l)),Math.min(t,Math.floor(Q+(I-s)*i/I+l)),U)}const I=B[Q];let s=F,g=t;for(_B(B,F,Q),U(B[t],I)>0&&_B(B,F,t);s<g;){for(_B(B,s,g),++s,--g;U(B[s],I)<0;)++s;for(;U(B[g],I)>0;)--g}0===U(B[F],I)?_B(B,F,g):(++g,_B(B,g,t)),g<=Q&&(F=g+1),Q<=g&&(t=g-1)}return B}function _B(B,Q,F){const t=B[Q];B[Q]=B[F],B[F]=t}function $B(B,Q=iB){let F,t=!1;if(1===Q.length){let U;for(const I of B){const B=Q(I);(t?iB(B,U)>0:0===iB(B,B))&&(F=I,U=B,t=!0)}}else for(const U of B)(t?Q(U,F)>0:0===Q(U,U))&&(F=U,t=!0);return F}function qB(B,Q,F){if(B=Float64Array.from(function*(B,Q){if(void 0===Q)for(let Q of B)null!=Q&&(Q=+Q)>=Q&&(yield Q);else{let F=-1;for(let t of B)null!=(t=Q(t,++F,B))&&(t=+t)>=t&&(yield t)}}(B,F)),(t=B.length)&&!isNaN(Q=+Q)){if(Q<=0||t<2)return OB(B);if(Q>=1)return zB(B);var t,U=(t-1)*Q,I=Math.floor(U),s=zB(jB(B,I).subarray(0,I+1));return s+(OB(B.subarray(I+1))-s)*(U-I)}}function BQ(B,Q,F=nB){if((t=B.length)&&!isNaN(Q=+Q)){if(Q<=0||t<2)return+F(B[0],0,B);if(Q>=1)return+F(B[t-1],t-1,B);var t,U=(t-1)*Q,I=Math.floor(U),s=+F(B[I],I,B);return s+(+F(B[I+1],I+1,B)-s)*(U-I)}}function QQ(B,Q,F){const t=CB(B),U=qB(B,.75)-qB(B,.25);return t&&U?Math.ceil((F-Q)/(2*U*Math.pow(t,-1/3))):1}function FQ(B,Q,F){const t=CB(B),U=rB(B);return t&&U?Math.ceil((F-Q)*Math.cbrt(t)/(3.49*U)):1}function tQ(B,Q){let F=0,t=0;if(void 0===Q)for(let Q of B)null!=Q&&(Q=+Q)>=Q&&(++F,t+=Q);else{let U=-1;for(let I of B)null!=(I=Q(I,++U,B))&&(I=+I)>=I&&(++F,t+=I)}if(F)return t/F}function UQ(B,Q){return qB(B,.5,Q)}function IQ(B){return Array.from(function*(B){for(const Q of B)yield*Q}(B))}function sQ(B,Q){const F=new LB;if(void 0===Q)for(let Q of B)null!=Q&&Q>=Q&&F.set(Q,(F.get(Q)||0)+1);else{let t=-1;for(let U of B)null!=(U=Q(U,++t,B))&&U>=U&&F.set(U,(F.get(U)||0)+1)}let t,U=0;for(const[B,Q]of F)Q>U&&(U=Q,t=B);return t}function gQ(B,Q){return[B,Q]}function iQ(B,Q,F){B=+B,Q=+Q,F=(U=arguments.length)<2?(Q=B,B=0,1):U<3?1:+F;for(var t=-1,U=0|Math.max(0,Math.ceil((Q-B)/F)),I=new Array(U);++t<U;)I[t]=B+t*F;return I}function lQ(B,Q){let F=0;if(void 0===Q)for(let Q of B)(Q=+Q)&&(F+=Q);else{let t=-1;for(let U of B)(U=+Q(U,++t,B))&&(F+=U)}return F}function cQ(B){if("function"!=typeof B[Symbol.iterator])throw new TypeError("values is not iterable");return Array.from(B).reverse()}function eQ(B){return B}var nQ=1e-6;function dQ(B){return"translate("+B+",0)"}function CQ(B){return"translate(0,"+B+")"}function aQ(B){return Q=>+B(Q)}function bQ(B,Q){return Q=Math.max(0,B.bandwidth()-2*Q)/2,B.round()&&(Q=Math.round(Q)),F=>+B(F)+Q}function oQ(){return!this.__axis}function GQ(B,Q){var F=[],t=null,U=null,I=6,s=6,g=3,i="undefined"!=typeof window&&window.devicePixelRatio>1?0:.5,l=1===B||4===B?-1:1,c=4===B||2===B?"x":"y",e=1===B||3===B?dQ:CQ;function n(n){var d=null==t?Q.ticks?Q.ticks.apply(Q,F):Q.domain():t,C=null==U?Q.tickFormat?Q.tickFormat.apply(Q,F):eQ:U,a=Math.max(I,0)+g,b=Q.range(),o=+b[0]+i,G=+b[b.length-1]+i,u=(Q.bandwidth?bQ:aQ)(Q.copy(),i),r=n.selection?n.selection():n,x=r.selectAll(".domain").data([null]),A=r.selectAll(".tick").data(d,Q).order(),L=A.exit(),h=A.enter().append("g").attr("class","tick"),y=A.select("line"),R=A.select("text");x=x.merge(x.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),A=A.merge(h),y=y.merge(h.append("line").attr("stroke","currentColor").attr(c+"2",l*I)),R=R.merge(h.append("text").attr("fill","currentColor").attr(c,l*a).attr("dy",1===B?"0em":3===B?"0.71em":"0.32em")),n!==r&&(x=x.transition(n),A=A.transition(n),y=y.transition(n),R=R.transition(n),L=L.transition(n).attr("opacity",nQ).attr("transform",(function(B){return isFinite(B=u(B))?e(B+i):this.getAttribute("transform")})),h.attr("opacity",nQ).attr("transform",(function(B){var Q=this.parentNode.__axis;return e((Q&&isFinite(Q=Q(B))?Q:u(B))+i)}))),L.remove(),x.attr("d",4===B||2===B?s?"M"+l*s+","+o+"H"+i+"V"+G+"H"+l*s:"M"+i+","+o+"V"+G:s?"M"+o+","+l*s+"V"+i+"H"+G+"V"+l*s:"M"+o+","+i+"H"+G),A.attr("opacity",1).attr("transform",(function(B){return e(u(B)+i)})),y.attr(c+"2",l*I),R.attr(c,l*a).text(C),r.filter(oQ).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",2===B?"start":4===B?"end":"middle"),r.each((function(){this.__axis=u}))}return n.scale=function(B){return arguments.length?(Q=B,n):Q},n.ticks=function(){return F=Array.from(arguments),n},n.tickArguments=function(B){return arguments.length?(F=null==B?[]:Array.from(B),n):F.slice()},n.tickValues=function(B){return arguments.length?(t=null==B?null:Array.from(B),n):t&&t.slice()},n.tickFormat=function(B){return arguments.length?(U=B,n):U},n.tickSize=function(B){return arguments.length?(I=s=+B,n):I},n.tickSizeInner=function(B){return arguments.length?(I=+B,n):I},n.tickSizeOuter=function(B){return arguments.length?(s=+B,n):s},n.tickPadding=function(B){return arguments.length?(g=+B,n):g},n.offset=function(B){return arguments.length?(i=+B,n):i},n}function uQ(B){return GQ(3,B)}var rQ={value:()=>{}};function xQ(){for(var B,Q=0,F=arguments.length,t={};Q<F;++Q){if(!(B=arguments[Q]+"")||B in t||/[\s.]/.test(B))throw new Error("illegal type: "+B);t[B]=[]}return new AQ(t)}function AQ(B){this._=B}function LQ(B,Q){for(var F,t=0,U=B.length;t<U;++t)if((F=B[t]).name===Q)return F.value}function hQ(B,Q,F){for(var t=0,U=B.length;t<U;++t)if(B[t].name===Q){B[t]=rQ,B=B.slice(0,t).concat(B.slice(t+1));break}return null!=F&&B.push({name:Q,value:F}),B}AQ.prototype=xQ.prototype={constructor:AQ,on:function(B,Q){var F,t,U=this._,I=(t=U,(B+"").trim().split(/^|\s+/).map((function(B){var Q="",F=B.indexOf(".");if(F>=0&&(Q=B.slice(F+1),B=B.slice(0,F)),B&&!t.hasOwnProperty(B))throw new Error("unknown type: "+B);return{type:B,name:Q}}))),s=-1,g=I.length;if(!(arguments.length<2)){if(null!=Q&&"function"!=typeof Q)throw new Error("invalid callback: "+Q);for(;++s<g;)if(F=(B=I[s]).type)U[F]=hQ(U[F],B.name,Q);else if(null==Q)for(F in U)U[F]=hQ(U[F],B.name,null);return this}for(;++s<g;)if((F=(B=I[s]).type)&&(F=LQ(U[F],B.name)))return F},copy:function(){var B={},Q=this._;for(var F in Q)B[F]=Q[F].slice();return new AQ(B)},call:function(B,Q){if((F=arguments.length-2)>0)for(var F,t,U=new Array(F),I=0;I<F;++I)U[I]=arguments[I+2];if(!this._.hasOwnProperty(B))throw new Error("unknown type: "+B);for(I=0,F=(t=this._[B]).length;I<F;++I)t[I].value.apply(Q,U)},apply:function(B,Q,F){if(!this._.hasOwnProperty(B))throw new Error("unknown type: "+B);for(var t=this._[B],U=0,I=t.length;U<I;++U)t[U].value.apply(Q,F)}};var yQ="http://www.w3.org/1999/xhtml",RQ={svg:"http://www.w3.org/2000/svg",xhtml:yQ,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function VQ(B){var Q=B+="",F=Q.indexOf(":");return F>=0&&"xmlns"!==(Q=B.slice(0,F))&&(B=B.slice(F+1)),RQ.hasOwnProperty(Q)?{space:RQ[Q],local:B}:B}function ZQ(B){return function(){var Q=this.ownerDocument,F=this.namespaceURI;return F===yQ&&Q.documentElement.namespaceURI===yQ?Q.createElement(B):Q.createElementNS(F,B)}}function SQ(B){return function(){return this.ownerDocument.createElementNS(B.space,B.local)}}function mQ(B){var Q=VQ(B);return(Q.local?SQ:ZQ)(Q)}function EQ(){}function NQ(B){return null==B?EQ:function(){return this.querySelector(B)}}function XQ(){return[]}function pQ(B){return null==B?XQ:function(){return this.querySelectorAll(B)}}function WQ(B){return function(){return function(B){return null==B?[]:Array.isArray(B)?B:Array.from(B)}(B.apply(this,arguments))}}function HQ(B){return function(){return this.matches(B)}}function DQ(B){return function(Q){return Q.matches(B)}}var YQ=Array.prototype.find;function fQ(){return this.firstElementChild}var wQ=Array.prototype.filter;function vQ(){return Array.from(this.children)}function JQ(B){return new Array(B.length)}function kQ(B,Q){this.ownerDocument=B.ownerDocument,this.namespaceURI=B.namespaceURI,this._next=null,this._parent=B,this.__data__=Q}function MQ(B,Q,F,t,U,I){for(var s,g=0,i=Q.length,l=I.length;g<l;++g)(s=Q[g])?(s.__data__=I[g],t[g]=s):F[g]=new kQ(B,I[g]);for(;g<i;++g)(s=Q[g])&&(U[g]=s)}function TQ(B,Q,F,t,U,I,s){var g,i,l,c=new Map,e=Q.length,n=I.length,d=new Array(e);for(g=0;g<e;++g)(i=Q[g])&&(d[g]=l=s.call(i,i.__data__,g,Q)+"",c.has(l)?U[g]=i:c.set(l,i));for(g=0;g<n;++g)l=s.call(B,I[g],g,I)+"",(i=c.get(l))?(t[g]=i,i.__data__=I[g],c.delete(l)):F[g]=new kQ(B,I[g]);for(g=0;g<e;++g)(i=Q[g])&&c.get(d[g])===i&&(U[g]=i)}function zQ(B){return B.__data__}function KQ(B){return"object"==typeof B&&"length"in B?B:Array.from(B)}function OQ(B,Q){return B<Q?-1:B>Q?1:B>=Q?0:NaN}function PQ(B){return function(){this.removeAttribute(B)}}function jQ(B){return function(){this.removeAttributeNS(B.space,B.local)}}function _Q(B,Q){return function(){this.setAttribute(B,Q)}}function $Q(B,Q){return function(){this.setAttributeNS(B.space,B.local,Q)}}function qQ(B,Q){return function(){var F=Q.apply(this,arguments);null==F?this.removeAttribute(B):this.setAttribute(B,F)}}function BF(B,Q){return function(){var F=Q.apply(this,arguments);null==F?this.removeAttributeNS(B.space,B.local):this.setAttributeNS(B.space,B.local,F)}}function QF(B){return B.ownerDocument&&B.ownerDocument.defaultView||B.document&&B||B.defaultView}function FF(B){return function(){this.style.removeProperty(B)}}function tF(B,Q,F){return function(){this.style.setProperty(B,Q,F)}}function UF(B,Q,F){return function(){var t=Q.apply(this,arguments);null==t?this.style.removeProperty(B):this.style.setProperty(B,t,F)}}function IF(B,Q){return B.style.getPropertyValue(Q)||QF(B).getComputedStyle(B,null).getPropertyValue(Q)}function sF(B){return function(){delete this[B]}}function gF(B,Q){return function(){this[B]=Q}}function iF(B,Q){return function(){var F=Q.apply(this,arguments);null==F?delete this[B]:this[B]=F}}function lF(B){return B.trim().split(/^|\s+/)}function cF(B){return B.classList||new eF(B)}function eF(B){this._node=B,this._names=lF(B.getAttribute("class")||"")}function nF(B,Q){for(var F=cF(B),t=-1,U=Q.length;++t<U;)F.add(Q[t])}function dF(B,Q){for(var F=cF(B),t=-1,U=Q.length;++t<U;)F.remove(Q[t])}function CF(B){return function(){nF(this,B)}}function aF(B){return function(){dF(this,B)}}function bF(B,Q){return function(){(Q.apply(this,arguments)?nF:dF)(this,B)}}function oF(){this.textContent=""}function GF(B){return function(){this.textContent=B}}function uF(B){return function(){var Q=B.apply(this,arguments);this.textContent=null==Q?"":Q}}function rF(){this.innerHTML=""}function xF(B){return function(){this.innerHTML=B}}function AF(B){return function(){var Q=B.apply(this,arguments);this.innerHTML=null==Q?"":Q}}function LF(){this.nextSibling&&this.parentNode.appendChild(this)}function hF(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function yF(){return null}function RF(){var B=this.parentNode;B&&B.removeChild(this)}function VF(){var B=this.cloneNode(!1),Q=this.parentNode;return Q?Q.insertBefore(B,this.nextSibling):B}function ZF(){var B=this.cloneNode(!0),Q=this.parentNode;return Q?Q.insertBefore(B,this.nextSibling):B}function SF(B){return function(){var Q=this.__on;if(Q){for(var F,t=0,U=-1,I=Q.length;t<I;++t)F=Q[t],B.type&&F.type!==B.type||F.name!==B.name?Q[++U]=F:this.removeEventListener(F.type,F.listener,F.options);++U?Q.length=U:delete this.__on}}}function mF(B,Q,F){return function(){var t,U=this.__on,I=function(B){return function(Q){B.call(this,Q,this.__data__)}}(Q);if(U)for(var s=0,g=U.length;s<g;++s)if((t=U[s]).type===B.type&&t.name===B.name)return this.removeEventListener(t.type,t.listener,t.options),this.addEventListener(t.type,t.listener=I,t.options=F),void(t.value=Q);this.addEventListener(B.type,I,F),t={type:B.type,name:B.name,value:Q,listener:I,options:F},U?U.push(t):this.__on=[t]}}function EF(B,Q,F){var t=QF(B),U=t.CustomEvent;"function"==typeof U?U=new U(Q,F):(U=t.document.createEvent("Event"),F?(U.initEvent(Q,F.bubbles,F.cancelable),U.detail=F.detail):U.initEvent(Q,!1,!1)),B.dispatchEvent(U)}function NF(B,Q){return function(){return EF(this,B,Q)}}function XF(B,Q){return function(){return EF(this,B,Q.apply(this,arguments))}}kQ.prototype={constructor:kQ,appendChild:function(B){return this._parent.insertBefore(B,this._next)},insertBefore:function(B,Q){return this._parent.insertBefore(B,Q)},querySelector:function(B){return this._parent.querySelector(B)},querySelectorAll:function(B){return this._parent.querySelectorAll(B)}},eF.prototype={add:function(B){this._names.indexOf(B)<0&&(this._names.push(B),this._node.setAttribute("class",this._names.join(" ")))},remove:function(B){var Q=this._names.indexOf(B);Q>=0&&(this._names.splice(Q,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(B){return this._names.indexOf(B)>=0}};var pF=[null];function WF(B,Q){this._groups=B,this._parents=Q}function HF(){return new WF([[document.documentElement]],pF)}function DF(B){return"string"==typeof B?new WF([[document.querySelector(B)]],[document.documentElement]):new WF([[B]],pF)}function YF(B,Q){if(B=function(B){let Q;for(;Q=B.sourceEvent;)B=Q;return B}(B),void 0===Q&&(Q=B.currentTarget),Q){var F=Q.ownerSVGElement||Q;if(F.createSVGPoint){var t=F.createSVGPoint();return t.x=B.clientX,t.y=B.clientY,[(t=t.matrixTransform(Q.getScreenCTM().inverse())).x,t.y]}if(Q.getBoundingClientRect){var U=Q.getBoundingClientRect();return[B.clientX-U.left-Q.clientLeft,B.clientY-U.top-Q.clientTop]}}return[B.pageX,B.pageY]}WF.prototype=HF.prototype={constructor:WF,select:function(B){"function"!=typeof B&&(B=NQ(B));for(var Q=this._groups,F=Q.length,t=new Array(F),U=0;U<F;++U)for(var I,s,g=Q[U],i=g.length,l=t[U]=new Array(i),c=0;c<i;++c)(I=g[c])&&(s=B.call(I,I.__data__,c,g))&&("__data__"in I&&(s.__data__=I.__data__),l[c]=s);return new WF(t,this._parents)},selectAll:function(B){B="function"==typeof B?WQ(B):pQ(B);for(var Q=this._groups,F=Q.length,t=[],U=[],I=0;I<F;++I)for(var s,g=Q[I],i=g.length,l=0;l<i;++l)(s=g[l])&&(t.push(B.call(s,s.__data__,l,g)),U.push(s));return new WF(t,U)},selectChild:function(B){return this.select(null==B?fQ:function(B){return function(){return YQ.call(this.children,B)}}("function"==typeof B?B:DQ(B)))},selectChildren:function(B){return this.selectAll(null==B?vQ:function(B){return function(){return wQ.call(this.children,B)}}("function"==typeof B?B:DQ(B)))},filter:function(B){"function"!=typeof B&&(B=HQ(B));for(var Q=this._groups,F=Q.length,t=new Array(F),U=0;U<F;++U)for(var I,s=Q[U],g=s.length,i=t[U]=[],l=0;l<g;++l)(I=s[l])&&B.call(I,I.__data__,l,s)&&i.push(I);return new WF(t,this._parents)},data:function(B,Q){if(!arguments.length)return Array.from(this,zQ);var F=Q?TQ:MQ,t=this._parents,U=this._groups;"function"!=typeof B&&(B=function(B){return function(){return B}}(B));for(var I=U.length,s=new Array(I),g=new Array(I),i=new Array(I),l=0;l<I;++l){var c=t[l],e=U[l],n=e.length,d=KQ(B.call(c,c&&c.__data__,l,t)),C=d.length,a=g[l]=new Array(C),b=s[l]=new Array(C);F(c,e,a,b,i[l]=new Array(n),d,Q);for(var o,G,u=0,r=0;u<C;++u)if(o=a[u]){for(u>=r&&(r=u+1);!(G=b[r])&&++r<C;);o._next=G||null}}return(s=new WF(s,t))._enter=g,s._exit=i,s},enter:function(){return new WF(this._enter||this._groups.map(JQ),this._parents)},exit:function(){return new WF(this._exit||this._groups.map(JQ),this._parents)},join:function(B,Q,F){var t=this.enter(),U=this,I=this.exit();return"function"==typeof B?(t=B(t))&&(t=t.selection()):t=t.append(B+""),null!=Q&&(U=Q(U))&&(U=U.selection()),null==F?I.remove():F(I),t&&U?t.merge(U).order():U},merge:function(B){for(var Q=B.selection?B.selection():B,F=this._groups,t=Q._groups,U=F.length,I=t.length,s=Math.min(U,I),g=new Array(U),i=0;i<s;++i)for(var l,c=F[i],e=t[i],n=c.length,d=g[i]=new Array(n),C=0;C<n;++C)(l=c[C]||e[C])&&(d[C]=l);for(;i<U;++i)g[i]=F[i];return new WF(g,this._parents)},selection:function(){return this},order:function(){for(var B=this._groups,Q=-1,F=B.length;++Q<F;)for(var t,U=B[Q],I=U.length-1,s=U[I];--I>=0;)(t=U[I])&&(s&&4^t.compareDocumentPosition(s)&&s.parentNode.insertBefore(t,s),s=t);return this},sort:function(B){function Q(Q,F){return Q&&F?B(Q.__data__,F.__data__):!Q-!F}B||(B=OQ);for(var F=this._groups,t=F.length,U=new Array(t),I=0;I<t;++I){for(var s,g=F[I],i=g.length,l=U[I]=new Array(i),c=0;c<i;++c)(s=g[c])&&(l[c]=s);l.sort(Q)}return new WF(U,this._parents).order()},call:function(){var B=arguments[0];return arguments[0]=this,B.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var B=this._groups,Q=0,F=B.length;Q<F;++Q)for(var t=B[Q],U=0,I=t.length;U<I;++U){var s=t[U];if(s)return s}return null},size:function(){let B=0;for(const Q of this)++B;return B},empty:function(){return!this.node()},each:function(B){for(var Q=this._groups,F=0,t=Q.length;F<t;++F)for(var U,I=Q[F],s=0,g=I.length;s<g;++s)(U=I[s])&&B.call(U,U.__data__,s,I);return this},attr:function(B,Q){var F=VQ(B);if(arguments.length<2){var t=this.node();return F.local?t.getAttributeNS(F.space,F.local):t.getAttribute(F)}return this.each((null==Q?F.local?jQ:PQ:"function"==typeof Q?F.local?BF:qQ:F.local?$Q:_Q)(F,Q))},style:function(B,Q,F){return arguments.length>1?this.each((null==Q?FF:"function"==typeof Q?UF:tF)(B,Q,null==F?"":F)):IF(this.node(),B)},property:function(B,Q){return arguments.length>1?this.each((null==Q?sF:"function"==typeof Q?iF:gF)(B,Q)):this.node()[B]},classed:function(B,Q){var F=lF(B+"");if(arguments.length<2){for(var t=cF(this.node()),U=-1,I=F.length;++U<I;)if(!t.contains(F[U]))return!1;return!0}return this.each(("function"==typeof Q?bF:Q?CF:aF)(F,Q))},text:function(B){return arguments.length?this.each(null==B?oF:("function"==typeof B?uF:GF)(B)):this.node().textContent},html:function(B){return arguments.length?this.each(null==B?rF:("function"==typeof B?AF:xF)(B)):this.node().innerHTML},raise:function(){return this.each(LF)},lower:function(){return this.each(hF)},append:function(B){var Q="function"==typeof B?B:mQ(B);return this.select((function(){return this.appendChild(Q.apply(this,arguments))}))},insert:function(B,Q){var F="function"==typeof B?B:mQ(B),t=null==Q?yF:"function"==typeof Q?Q:NQ(Q);return this.select((function(){return this.insertBefore(F.apply(this,arguments),t.apply(this,arguments)||null)}))},remove:function(){return this.each(RF)},clone:function(B){return this.select(B?ZF:VF)},datum:function(B){return arguments.length?this.property("__data__",B):this.node().__data__},on:function(B,Q,F){var t,U,I=function(B){return B.trim().split(/^|\s+/).map((function(B){var Q="",F=B.indexOf(".");return F>=0&&(Q=B.slice(F+1),B=B.slice(0,F)),{type:B,name:Q}}))}(B+""),s=I.length;if(!(arguments.length<2)){for(g=Q?mF:SF,t=0;t<s;++t)this.each(g(I[t],Q,F));return this}var g=this.node().__on;if(g)for(var i,l=0,c=g.length;l<c;++l)for(t=0,i=g[l];t<s;++t)if((U=I[t]).type===i.type&&U.name===i.name)return i.value},dispatch:function(B,Q){return this.each(("function"==typeof Q?XF:NF)(B,Q))},[Symbol.iterator]:function*(){for(var B=this._groups,Q=0,F=B.length;Q<F;++Q)for(var t,U=B[Q],I=0,s=U.length;I<s;++I)(t=U[I])&&(yield t)}};const fF={passive:!1},wF={capture:!0,passive:!1};function vF(B){B.stopImmediatePropagation()}function JF(B){B.preventDefault(),B.stopImmediatePropagation()}var kF=B=>()=>B;function MF(B,{sourceEvent:Q,subject:F,target:t,identifier:U,active:I,x:s,y:g,dx:i,dy:l,dispatch:c}){Object.defineProperties(this,{type:{value:B,enumerable:!0,configurable:!0},sourceEvent:{value:Q,enumerable:!0,configurable:!0},subject:{value:F,enumerable:!0,configurable:!0},target:{value:t,enumerable:!0,configurable:!0},identifier:{value:U,enumerable:!0,configurable:!0},active:{value:I,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:g,enumerable:!0,configurable:!0},dx:{value:i,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:c}})}function TF(B){return!B.ctrlKey&&!B.button}function zF(){return this.parentNode}function KF(B,Q){return null==Q?{x:B.x,y:B.y}:Q}function OF(){return navigator.maxTouchPoints||"ontouchstart"in this}function PF(){var B,Q,F,t,U=TF,I=zF,s=KF,g=OF,i={},l=xQ("start","drag","end"),c=0,e=0;function n(B){B.on("mousedown.drag",d).filter(g).on("touchstart.drag",b).on("touchmove.drag",o,fF).on("touchend.drag touchcancel.drag",G).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function d(s,g){if(!t&&U.call(this,s,g)){var i=u(this,I.call(this,s,g),s,g,"mouse");i&&(DF(s.view).on("mousemove.drag",C,wF).on("mouseup.drag",a,wF),function(B){var Q=B.document.documentElement,F=DF(B).on("dragstart.drag",JF,wF);"onselectstart"in Q?F.on("selectstart.drag",JF,wF):(Q.__noselect=Q.style.MozUserSelect,Q.style.MozUserSelect="none")}(s.view),vF(s),F=!1,B=s.clientX,Q=s.clientY,i("start",s))}}function C(t){if(JF(t),!F){var U=t.clientX-B,I=t.clientY-Q;F=U*U+I*I>e}i.mouse("drag",t)}function a(B){DF(B.view).on("mousemove.drag mouseup.drag",null),function(B,Q){var F=B.document.documentElement,t=DF(B).on("dragstart.drag",null);Q&&(t.on("click.drag",JF,wF),setTimeout((function(){t.on("click.drag",null)}),0)),"onselectstart"in F?t.on("selectstart.drag",null):(F.style.MozUserSelect=F.__noselect,delete F.__noselect)}(B.view,F),JF(B),i.mouse("end",B)}function b(B,Q){if(U.call(this,B,Q)){var F,t,s=B.changedTouches,g=I.call(this,B,Q),i=s.length;for(F=0;F<i;++F)(t=u(this,g,B,Q,s[F].identifier,s[F]))&&(vF(B),t("start",B,s[F]))}}function o(B){var Q,F,t=B.changedTouches,U=t.length;for(Q=0;Q<U;++Q)(F=i[t[Q].identifier])&&(JF(B),F("drag",B,t[Q]))}function G(B){var Q,F,U=B.changedTouches,I=U.length;for(t&&clearTimeout(t),t=setTimeout((function(){t=null}),500),Q=0;Q<I;++Q)(F=i[U[Q].identifier])&&(vF(B),F("end",B,U[Q]))}function u(B,Q,F,t,U,I){var g,e,d,C=l.copy(),a=YF(I||F,Q);if(null!=(d=s.call(B,new MF("beforestart",{sourceEvent:F,target:n,identifier:U,active:c,x:a[0],y:a[1],dx:0,dy:0,dispatch:C}),t)))return g=d.x-a[0]||0,e=d.y-a[1]||0,function F(I,s,l){var b,o=a;switch(I){case"start":i[U]=F,b=c++;break;case"end":delete i[U],--c;case"drag":a=YF(l||s,Q),b=c}C.call(I,B,new MF(I,{sourceEvent:s,subject:d,target:n,identifier:U,active:b,x:a[0]+g,y:a[1]+e,dx:a[0]-o[0],dy:a[1]-o[1],dispatch:C}),t)}}return n.filter=function(B){return arguments.length?(U="function"==typeof B?B:kF(!!B),n):U},n.container=function(B){return arguments.length?(I="function"==typeof B?B:kF(B),n):I},n.subject=function(B){return arguments.length?(s="function"==typeof B?B:kF(B),n):s},n.touchable=function(B){return arguments.length?(g="function"==typeof B?B:kF(!!B),n):g},n.on=function(){var B=l.on.apply(l,arguments);return B===l?n:B},n.clickDistance=function(B){return arguments.length?(e=(B=+B)*B,n):Math.sqrt(e)},n}function jF(B,Q,F){B.prototype=Q.prototype=F,F.constructor=B}function _F(B,Q){var F=Object.create(B.prototype);for(var t in Q)F[t]=Q[t];return F}function $F(){}MF.prototype.on=function(){var B=this._.on.apply(this._,arguments);return B===this._?this:B};var qF=.7,Bt=1/qF,Qt="\\s*([+-]?\\d+)\\s*",Ft="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",tt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ut=/^#([0-9a-f]{3,8})$/,It=new RegExp(`^rgb\\(${Qt},${Qt},${Qt}\\)$`),st=new RegExp(`^rgb\\(${tt},${tt},${tt}\\)$`),gt=new RegExp(`^rgba\\(${Qt},${Qt},${Qt},${Ft}\\)$`),lt=new RegExp(`^rgba\\(${tt},${tt},${tt},${Ft}\\)$`),ct=new RegExp(`^hsl\\(${Ft},${tt},${tt}\\)$`),et=new RegExp(`^hsla\\(${Ft},${tt},${tt},${Ft}\\)$`),nt={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 dt(){return this.rgb().formatHex()}function Ct(){return this.rgb().formatRgb()}function at(B){var Q,F;return B=(B+"").trim().toLowerCase(),(Q=Ut.exec(B))?(F=Q[1].length,Q=parseInt(Q[1],16),6===F?bt(Q):3===F?new rt(Q>>8&15|Q>>4&240,Q>>4&15|240&Q,(15&Q)<<4|15&Q,1):8===F?ot(Q>>24&255,Q>>16&255,Q>>8&255,(255&Q)/255):4===F?ot(Q>>12&15|Q>>8&240,Q>>8&15|Q>>4&240,Q>>4&15|240&Q,((15&Q)<<4|15&Q)/255):null):(Q=It.exec(B))?new rt(Q[1],Q[2],Q[3],1):(Q=st.exec(B))?new rt(255*Q[1]/100,255*Q[2]/100,255*Q[3]/100,1):(Q=gt.exec(B))?ot(Q[1],Q[2],Q[3],Q[4]):(Q=lt.exec(B))?ot(255*Q[1]/100,255*Q[2]/100,255*Q[3]/100,Q[4]):(Q=ct.exec(B))?Rt(Q[1],Q[2]/100,Q[3]/100,1):(Q=et.exec(B))?Rt(Q[1],Q[2]/100,Q[3]/100,Q[4]):nt.hasOwnProperty(B)?bt(nt[B]):"transparent"===B?new rt(NaN,NaN,NaN,0):null}function bt(B){return new rt(B>>16&255,B>>8&255,255&B,1)}function ot(B,Q,F,t){return t<=0&&(B=Q=F=NaN),new rt(B,Q,F,t)}function Gt(B){return B instanceof $F||(B=at(B)),B?new rt((B=B.rgb()).r,B.g,B.b,B.opacity):new rt}function ut(B,Q,F,t){return 1===arguments.length?Gt(B):new rt(B,Q,F,null==t?1:t)}function rt(B,Q,F,t){this.r=+B,this.g=+Q,this.b=+F,this.opacity=+t}function xt(){return`#${yt(this.r)}${yt(this.g)}${yt(this.b)}`}function At(){const B=Lt(this.opacity);return`${1===B?"rgb(":"rgba("}${ht(this.r)}, ${ht(this.g)}, ${ht(this.b)}${1===B?")":`, ${B})`}`}function Lt(B){return isNaN(B)?1:Math.max(0,Math.min(1,B))}function ht(B){return Math.max(0,Math.min(255,Math.round(B)||0))}function yt(B){return((B=ht(B))<16?"0":"")+B.toString(16)}function Rt(B,Q,F,t){return t<=0?B=Q=F=NaN:F<=0||F>=1?B=Q=NaN:Q<=0&&(B=NaN),new St(B,Q,F,t)}function Vt(B){if(B instanceof St)return new St(B.h,B.s,B.l,B.opacity);if(B instanceof $F||(B=at(B)),!B)return new St;if(B instanceof St)return B;var Q=(B=B.rgb()).r/255,F=B.g/255,t=B.b/255,U=Math.min(Q,F,t),I=Math.max(Q,F,t),s=NaN,g=I-U,i=(I+U)/2;return g?(s=Q===I?(F-t)/g+6*(F<t):F===I?(t-Q)/g+2:(Q-F)/g+4,g/=i<.5?I+U:2-I-U,s*=60):g=i>0&&i<1?0:s,new St(s,g,i,B.opacity)}function Zt(B,Q,F,t){return 1===arguments.length?Vt(B):new St(B,Q,F,null==t?1:t)}function St(B,Q,F,t){this.h=+B,this.s=+Q,this.l=+F,this.opacity=+t}function mt(B){return(B=(B||0)%360)<0?B+360:B}function Et(B){return Math.max(0,Math.min(1,B||0))}function Nt(B,Q,F){return 255*(B<60?Q+(F-Q)*B/60:B<180?F:B<240?Q+(F-Q)*(240-B)/60:Q)}jF($F,at,{copy(B){return Object.assign(new this.constructor,this,B)},displayable(){return this.rgb().displayable()},hex:dt,formatHex:dt,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Vt(this).formatHsl()},formatRgb:Ct,toString:Ct}),jF(rt,ut,_F($F,{brighter(B){return B=null==B?Bt:Math.pow(Bt,B),new rt(this.r*B,this.g*B,this.b*B,this.opacity)},darker(B){return B=null==B?qF:Math.pow(qF,B),new rt(this.r*B,this.g*B,this.b*B,this.opacity)},rgb(){return this},clamp(){return new rt(ht(this.r),ht(this.g),ht(this.b),Lt(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.