@decidables/prospectable-elements
Version:
prospectable-elements: Web Components for visualizing Cumulative Prospect Theory
23 lines • 2.49 MB
JavaScript
function t(t,e){return e.forEach((function(e){e&&"string"!=typeof e&&!Array.isArray(e)&&Object.keys(e).forEach((function(i){if("default"!==i&&!(i in t)){var n=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,n.get?n:{enumerable:!0,get:function(){return e[i]}})}}))})),Object.freeze(t)}
/**
* @license
* Copyright 2019 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const e=globalThis,i=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,n=Symbol(),r=new WeakMap;let a=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==n)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(i&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=r.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&r.set(e,t))}return t}toString(){return this.cssText}};const s=t=>new a("string"==typeof t?t:t+"",void 0,n),o=(t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,i,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[n+1]),t[0]);return new a(i,t,n)},l=i?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return s(e)})(t):t
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/,{is:c,defineProperty:g,getOwnPropertyDescriptor:u,getOwnPropertyNames:d,getOwnPropertySymbols:h,getPrototypeOf:B}=Object,p=globalThis,F=p.trustedTypes,f=F?F.emptyScript:"",Q=p.reactiveElementPolyfillSupport,I=(t,e)=>t,U={toAttribute(t,e){switch(e){case Boolean:t=t?f:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},b=(t,e)=>!c(t,e),y={attribute:!0,type:String,converter:U,reflect:!1,hasChanged:b};Symbol.metadata??=Symbol("metadata"),p.litPropertyMetadata??=new WeakMap;let m=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=y){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),n=this.getPropertyDescriptor(t,i,e);void 0!==n&&g(this.prototype,t,n)}}static getPropertyDescriptor(t,e,i){const{get:n,set:r}=u(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get(){return n?.call(this)},set(e){const a=n?.call(this);r.call(this,e),this.requestUpdate(t,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??y}static _$Ei(){if(this.hasOwnProperty(I("elementProperties")))return;const t=B(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(I("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(I("properties"))){const t=this.properties,e=[...d(t),...h(t)];for(const i of e)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const i=this._$Eu(t,e);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(l(t))}else void 0!==t&&e.push(l(t));return e}static _$Eu(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,n)=>{if(i)t.adoptedStyleSheets=n.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const i of n){const n=document.createElement("style"),r=e.litNonce;void 0!==r&&n.setAttribute("nonce",r),n.textContent=i.cssText,t.appendChild(n)}})(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EC(t,e){const i=this.constructor.elementProperties.get(t),n=this.constructor._$Eu(t,i);if(void 0!==n&&!0===i.reflect){const r=(void 0!==i.converter?.toAttribute?i.converter:U).toAttribute(e,i.type);this._$Em=t,null==r?this.removeAttribute(n):this.setAttribute(n,r),this._$Em=null}}_$AK(t,e){const i=this.constructor,n=i._$Eh.get(t);if(void 0!==n&&this._$Em!==n){const t=i.getPropertyOptions(n),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:U;this._$Em=n,this[n]=r.fromAttribute(e,t.type),this._$Em=null}}requestUpdate(t,e,i){if(void 0!==t){if(i??=this.constructor.getPropertyOptions(t),!(i.hasChanged??b)(this[t],e))return;this.P(t,e,i)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(t,e,i){this._$AL.has(t)||this._$AL.set(t,e),!0===i.reflect&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,i]of t)!0!==i.wrapped||this._$AL.has(e)||void 0===this[e]||this.P(e,this[e],i)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(e)):this._$EU()}catch(e){throw t=!1,this._$EU(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach((t=>this._$EC(t,this[t]))),this._$EU()}updated(t){}firstUpdated(t){}};m.elementStyles=[],m.shadowRootOptions={mode:"open"},m[I("elementProperties")]=new Map,m[I("finalized")]=new Map,Q?.({ReactiveElement:m}),(p.reactiveElementVersions??=[]).push("2.0.4");
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
const x=globalThis,v=x.trustedTypes,C=v?v.createPolicy("lit-html",{createHTML:t=>t}):void 0,A="$lit$",L=`lit$${Math.random().toFixed(9).slice(2)}$`,G="?"+L,R=`<${G}>`,S=document,w=()=>S.createComment(""),V=t=>null===t||"object"!=typeof t&&"function"!=typeof t,E=Array.isArray,Z="[ \t\n\f\r]",N=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,D=/-->/g,X=/>/g,H=RegExp(`>|${Z}(?:([^\\s"'>=/]+)(${Z}*=${Z}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),W=/'/g,k=/"/g,M=/^(?:script|style|textarea|title)$/i,T=t=>(e,...i)=>({_$litType$:t,strings:e,values:i}),Y=T(1),J=T(2),_=Symbol.for("lit-noChange"),z=Symbol.for("lit-nothing"),O=new WeakMap,K=S.createTreeWalker(S,129);function P(t,e){if(!E(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==C?C.createHTML(e):e}let j=class t{constructor({strings:e,_$litType$:i},n){let r;this.parts=[];let a=0,s=0;const o=e.length-1,l=this.parts,[c,g]=((t,e)=>{const i=t.length-1,n=[];let r,a=2===e?"<svg>":3===e?"<math>":"",s=N;for(let e=0;e<i;e++){const i=t[e];let o,l,c=-1,g=0;for(;g<i.length&&(s.lastIndex=g,l=s.exec(i),null!==l);)g=s.lastIndex,s===N?"!--"===l[1]?s=D:void 0!==l[1]?s=X:void 0!==l[2]?(M.test(l[2])&&(r=RegExp("</"+l[2],"g")),s=H):void 0!==l[3]&&(s=H):s===H?">"===l[0]?(s=r??N,c=-1):void 0===l[1]?c=-2:(c=s.lastIndex-l[2].length,o=l[1],s=void 0===l[3]?H:'"'===l[3]?k:W):s===k||s===W?s=H:s===D||s===X?s=N:(s=H,r=void 0);const u=s===H&&t[e+1].startsWith("/>")?" ":"";a+=s===N?i+R:c>=0?(n.push(o),i.slice(0,c)+A+i.slice(c)+L+u):i+L+(-2===c?e:u)}return[P(t,a+(t[i]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),n]})(e,i);if(this.el=t.createElement(c,n),K.currentNode=this.el.content,2===i||3===i){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(r=K.nextNode())&&l.length<o;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith(A)){const e=g[s++],i=r.getAttribute(t).split(L),n=/([.?@])?(.*)/.exec(e);l.push({type:1,index:a,name:n[2],strings:i,ctor:"."===n[1]?it:"?"===n[1]?nt:"@"===n[1]?rt:et}),r.removeAttribute(t)}else t.startsWith(L)&&(l.push({type:6,index:a}),r.removeAttribute(t));if(M.test(r.tagName)){const t=r.textContent.split(L),e=t.length-1;if(e>0){r.textContent=v?v.emptyScript:"";for(let i=0;i<e;i++)r.append(t[i],w()),K.nextNode(),l.push({type:2,index:++a});r.append(t[e],w())}}}else if(8===r.nodeType)if(r.data===G)l.push({type:2,index:a});else{let t=-1;for(;-1!==(t=r.data.indexOf(L,t+1));)l.push({type:7,index:a}),t+=L.length-1}a++}}static createElement(t,e){const i=S.createElement("template");return i.innerHTML=t,i}};function q(t,e,i=t,n){if(e===_)return e;let r=void 0!==n?i._$Co?.[n]:i._$Cl;const a=V(e)?void 0:e._$litDirective$;return r?.constructor!==a&&(r?._$AO?.(!1),void 0===a?r=void 0:(r=new a(t),r._$AT(t,i,n)),void 0!==n?(i._$Co??=[])[n]=r:i._$Cl=r),void 0!==r&&(e=q(t,r._$AS(t,e.values),r,n)),e}let $=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:i}=this._$AD,n=(t?.creationScope??S).importNode(e,!0);K.currentNode=n;let r=K.nextNode(),a=0,s=0,o=i[0];for(;void 0!==o;){if(a===o.index){let e;2===o.type?e=new tt(r,r.nextSibling,this,t):1===o.type?e=new o.ctor(r,o.name,o.strings,this,t):6===o.type&&(e=new at(r,this,t)),this._$AV.push(e),o=i[++s]}a!==o?.index&&(r=K.nextNode(),a++)}return K.currentNode=S,n}p(t){let e=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}},tt=class t{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,i,n){this.type=2,this._$AH=z,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=q(this,t,e),V(t)?t===z||null==t||""===t?(this._$AH!==z&&this._$AR(),this._$AH=z):t!==this._$AH&&t!==_&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>E(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&&V(this._$AH)?this._$AA.nextSibling.data=t:this.T(S.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:i}=t,n="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=j.createElement(P(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===n)this._$AH.p(e);else{const t=new $(n,this),i=t.u(this.options);t.p(e),this.T(i),this._$AH=t}}_$AC(t){let e=O.get(t.strings);return void 0===e&&O.set(t.strings,e=new j(t)),e}k(e){E(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let n,r=0;for(const a of e)r===i.length?i.push(n=new t(this.O(w()),this.O(w()),this,this.options)):n=i[r],n._$AI(a),r++;r<i.length&&(this._$AR(n&&n._$AB.nextSibling,r),i.length=r)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}},et=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,n,r){this.type=1,this._$AH=z,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=r,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=z}_$AI(t,e=this,i,n){const r=this.strings;let a=!1;if(void 0===r)t=q(this,t,e,0),a=!V(t)||t!==this._$AH&&t!==_,a&&(this._$AH=t);else{const n=t;let s,o;for(t=r[0],s=0;s<r.length-1;s++)o=q(this,n[i+s],e,s),o===_&&(o=this._$AH[s]),a||=!V(o)||o!==this._$AH[s],o===z?t=z:t!==z&&(t+=(o??"")+r[s+1]),this._$AH[s]=o}a&&!n&&this.j(t)}j(t){t===z?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},it=class extends et{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===z?void 0:t}},nt=class extends et{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==z)}},rt=class extends et{constructor(t,e,i,n,r){super(t,e,i,n,r),this.type=5}_$AI(t,e=this){if((t=q(this,t,e,0)??z)===_)return;const i=this._$AH,n=t===z&&i!==z||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,r=t!==z&&(i===z||n);n&&this.element.removeEventListener(this.name,this,i),r&&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 at{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){q(this,t)}}const st=x.litHtmlPolyfillSupport;st?.(j,tt),(x.litHtmlVersions??=[]).push("3.2.1");
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
let ot=class extends m{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 e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,i)=>{const n=i?.renderBefore??e;let r=n._$litPart$;if(void 0===r){const t=i?.renderBefore??null;n._$litPart$=r=new tt(e.insertBefore(w(),t),t,void 0,i??{})}return r._$AI(t),r})(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return _}};ot._$litElement$=!0,ot.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:ot});const lt=globalThis.litElementPolyfillSupport;function ct(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function gt(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function ut(t){let e,i,n;function r(t,n,r=0,a=t.length){if(r<a){if(0!==e(n,n))return a;do{const e=r+a>>>1;i(t[e],n)<0?r=e+1:a=e}while(r<a)}return r}return 2!==t.length?(e=ct,i=(e,i)=>ct(t(e),i),n=(e,i)=>t(e)-i):(e=t===ct||t===gt?t:dt,i=t,n=t),{left:r,center:function(t,e,i=0,a=t.length){const s=r(t,e,i,a-1);return s>i&&n(t[s-1],e)>-n(t[s],e)?s-1:s},right:function(t,n,r=0,a=t.length){if(r<a){if(0!==e(n,n))return a;do{const e=r+a>>>1;i(t[e],n)<=0?r=e+1:a=e}while(r<a)}return r}}}function dt(){return 0}lt?.({LitElement:ot}),(globalThis.litElementVersions??=[]).push("4.1.1");const ht=ut(ct).right;ut((function(t){return null===t?NaN:+t})).center;const Bt=Math.sqrt(50),pt=Math.sqrt(10),Ft=Math.sqrt(2);function ft(t,e,i){const n=(e-t)/Math.max(0,i),r=Math.floor(Math.log10(n)),a=n/Math.pow(10,r),s=a>=Bt?10:a>=pt?5:a>=Ft?2:1;let o,l,c;return r<0?(c=Math.pow(10,-r)/s,o=Math.round(t*c),l=Math.round(e*c),o/c<t&&++o,l/c>e&&--l,c=-c):(c=Math.pow(10,r)*s,o=Math.round(t/c),l=Math.round(e/c),o*c<t&&++o,l*c>e&&--l),l<o&&.5<=i&&i<2?ft(t,e,2*i):[o,l,c]}function Qt(t,e,i){return ft(t=+t,e=+e,i=+i)[2]}function It(t,e,i){t=+t,e=+e,i=(r=arguments.length)<2?(e=t,t=0,1):r<3?1:+i;for(var n=-1,r=0|Math.max(0,Math.ceil((e-t)/i)),a=new Array(r);++n<r;)a[n]=t+n*i;return a}function Ut(t){return t}var bt=1,yt=2,mt=3,xt=4,vt=1e-6;function Ct(t){return"translate("+t+",0)"}function At(t){return"translate(0,"+t+")"}function Lt(t){return e=>+t(e)}function Gt(t,e){return e=Math.max(0,t.bandwidth()-2*e)/2,t.round()&&(e=Math.round(e)),i=>+t(i)+e}function Rt(){return!this.__axis}function St(t,e){var i=[],n=null,r=null,a=6,s=6,o=3,l="undefined"!=typeof window&&window.devicePixelRatio>1?0:.5,c=t===bt||t===xt?-1:1,g=t===xt||t===yt?"x":"y",u=t===bt||t===mt?Ct:At;function d(d){var h=null==n?e.ticks?e.ticks.apply(e,i):e.domain():n,B=null==r?e.tickFormat?e.tickFormat.apply(e,i):Ut:r,p=Math.max(a,0)+o,F=e.range(),f=+F[0]+l,Q=+F[F.length-1]+l,I=(e.bandwidth?Gt:Lt)(e.copy(),l),U=d.selection?d.selection():d,b=U.selectAll(".domain").data([null]),y=U.selectAll(".tick").data(h,e).order(),m=y.exit(),x=y.enter().append("g").attr("class","tick"),v=y.select("line"),C=y.select("text");b=b.merge(b.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),y=y.merge(x),v=v.merge(x.append("line").attr("stroke","currentColor").attr(g+"2",c*a)),C=C.merge(x.append("text").attr("fill","currentColor").attr(g,c*p).attr("dy",t===bt?"0em":t===mt?"0.71em":"0.32em")),d!==U&&(b=b.transition(d),y=y.transition(d),v=v.transition(d),C=C.transition(d),m=m.transition(d).attr("opacity",vt).attr("transform",(function(t){return isFinite(t=I(t))?u(t+l):this.getAttribute("transform")})),x.attr("opacity",vt).attr("transform",(function(t){var e=this.parentNode.__axis;return u((e&&isFinite(e=e(t))?e:I(t))+l)}))),m.remove(),b.attr("d",t===xt||t===yt?s?"M"+c*s+","+f+"H"+l+"V"+Q+"H"+c*s:"M"+l+","+f+"V"+Q:s?"M"+f+","+c*s+"V"+l+"H"+Q+"V"+c*s:"M"+f+","+l+"H"+Q),y.attr("opacity",1).attr("transform",(function(t){return u(I(t)+l)})),v.attr(g+"2",c*a),C.attr(g,c*p).text(B),U.filter(Rt).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===yt?"start":t===xt?"end":"middle"),U.each((function(){this.__axis=I}))}return d.scale=function(t){return arguments.length?(e=t,d):e},d.ticks=function(){return i=Array.from(arguments),d},d.tickArguments=function(t){return arguments.length?(i=null==t?[]:Array.from(t),d):i.slice()},d.tickValues=function(t){return arguments.length?(n=null==t?null:Array.from(t),d):n&&n.slice()},d.tickFormat=function(t){return arguments.length?(r=t,d):r},d.tickSize=function(t){return arguments.length?(a=s=+t,d):a},d.tickSizeInner=function(t){return arguments.length?(a=+t,d):a},d.tickSizeOuter=function(t){return arguments.length?(s=+t,d):s},d.tickPadding=function(t){return arguments.length?(o=+t,d):o},d.offset=function(t){return arguments.length?(l=+t,d):l},d}function wt(t){return St(mt,t)}function Vt(t){return St(xt,t)}var Et={value:()=>{}};function Zt(){for(var t,e=0,i=arguments.length,n={};e<i;++e){if(!(t=arguments[e]+"")||t in n||/[\s.]/.test(t))throw new Error("illegal type: "+t);n[t]=[]}return new Nt(n)}function Nt(t){this._=t}function Dt(t,e){for(var i,n=0,r=t.length;n<r;++n)if((i=t[n]).name===e)return i.value}function Xt(t,e,i){for(var n=0,r=t.length;n<r;++n)if(t[n].name===e){t[n]=Et,t=t.slice(0,n).concat(t.slice(n+1));break}return null!=i&&t.push({name:e,value:i}),t}Nt.prototype=Zt.prototype={constructor:Nt,on:function(t,e){var i,n,r=this._,a=(n=r,(t+"").trim().split(/^|\s+/).map((function(t){var e="",i=t.indexOf(".");if(i>=0&&(e=t.slice(i+1),t=t.slice(0,i)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))),s=-1,o=a.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++s<o;)if(i=(t=a[s]).type)r[i]=Xt(r[i],t.name,e);else if(null==e)for(i in r)r[i]=Xt(r[i],t.name,null);return this}for(;++s<o;)if((i=(t=a[s]).type)&&(i=Dt(r[i],t.name)))return i},copy:function(){var t={},e=this._;for(var i in e)t[i]=e[i].slice();return new Nt(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var i,n,r=new Array(i),a=0;a<i;++a)r[a]=arguments[a+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=0,i=(n=this._[t]).length;a<i;++a)n[a].value.apply(e,r)},apply:function(t,e,i){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var n=this._[t],r=0,a=n.length;r<a;++r)n[r].value.apply(e,i)}};var Ht="http://www.w3.org/1999/xhtml",Wt={svg:"http://www.w3.org/2000/svg",xhtml:Ht,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function kt(t){var e=t+="",i=e.indexOf(":");return i>=0&&"xmlns"!==(e=t.slice(0,i))&&(t=t.slice(i+1)),Wt.hasOwnProperty(e)?{space:Wt[e],local:t}:t}function Mt(t){return function(){var e=this.ownerDocument,i=this.namespaceURI;return i===Ht&&e.documentElement.namespaceURI===Ht?e.createElement(t):e.createElementNS(i,t)}}function Tt(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Yt(t){var e=kt(t);return(e.local?Tt:Mt)(e)}function Jt(){}function _t(t){return null==t?Jt:function(){return this.querySelector(t)}}function zt(){return[]}function Ot(t){return null==t?zt:function(){return this.querySelectorAll(t)}}function Kt(t){return function(){return function(t){return null==t?[]:Array.isArray(t)?t:Array.from(t)}(t.apply(this,arguments))}}function Pt(t){return function(){return this.matches(t)}}function jt(t){return function(e){return e.matches(t)}}var qt=Array.prototype.find;function $t(){return this.firstElementChild}var te=Array.prototype.filter;function ee(){return Array.from(this.children)}function ie(t){return new Array(t.length)}function ne(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function re(t,e,i,n,r,a){for(var s,o=0,l=e.length,c=a.length;o<c;++o)(s=e[o])?(s.__data__=a[o],n[o]=s):i[o]=new ne(t,a[o]);for(;o<l;++o)(s=e[o])&&(r[o]=s)}function ae(t,e,i,n,r,a,s){var o,l,c,g=new Map,u=e.length,d=a.length,h=new Array(u);for(o=0;o<u;++o)(l=e[o])&&(h[o]=c=s.call(l,l.__data__,o,e)+"",g.has(c)?r[o]=l:g.set(c,l));for(o=0;o<d;++o)c=s.call(t,a[o],o,a)+"",(l=g.get(c))?(n[o]=l,l.__data__=a[o],g.delete(c)):i[o]=new ne(t,a[o]);for(o=0;o<u;++o)(l=e[o])&&g.get(h[o])===l&&(r[o]=l)}function se(t){return t.__data__}function oe(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function le(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function ce(t){return function(){this.removeAttribute(t)}}function ge(t){return function(){this.removeAttributeNS(t.space,t.local)}}function ue(t,e){return function(){this.setAttribute(t,e)}}function de(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function he(t,e){return function(){var i=e.apply(this,arguments);null==i?this.removeAttribute(t):this.setAttribute(t,i)}}function Be(t,e){return function(){var i=e.apply(this,arguments);null==i?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,i)}}function pe(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Fe(t){return function(){this.style.removeProperty(t)}}function fe(t,e,i){return function(){this.style.setProperty(t,e,i)}}function Qe(t,e,i){return function(){var n=e.apply(this,arguments);null==n?this.style.removeProperty(t):this.style.setProperty(t,n,i)}}function Ie(t,e){return t.style.getPropertyValue(e)||pe(t).getComputedStyle(t,null).getPropertyValue(e)}function Ue(t){return function(){delete this[t]}}function be(t,e){return function(){this[t]=e}}function ye(t,e){return function(){var i=e.apply(this,arguments);null==i?delete this[t]:this[t]=i}}function me(t){return t.trim().split(/^|\s+/)}function xe(t){return t.classList||new ve(t)}function ve(t){this._node=t,this._names=me(t.getAttribute("class")||"")}function Ce(t,e){for(var i=xe(t),n=-1,r=e.length;++n<r;)i.add(e[n])}function Ae(t,e){for(var i=xe(t),n=-1,r=e.length;++n<r;)i.remove(e[n])}function Le(t){return function(){Ce(this,t)}}function Ge(t){return function(){Ae(this,t)}}function Re(t,e){return function(){(e.apply(this,arguments)?Ce:Ae)(this,t)}}function Se(){this.textContent=""}function we(t){return function(){this.textContent=t}}function Ve(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}function Ee(){this.innerHTML=""}function Ze(t){return function(){this.innerHTML=t}}function Ne(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}function De(){this.nextSibling&&this.parentNode.appendChild(this)}function Xe(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function He(){return null}function We(){var t=this.parentNode;t&&t.removeChild(this)}function ke(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Me(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Te(t){return function(){var e=this.__on;if(e){for(var i,n=0,r=-1,a=e.length;n<a;++n)i=e[n],t.type&&i.type!==t.type||i.name!==t.name?e[++r]=i:this.removeEventListener(i.type,i.listener,i.options);++r?e.length=r:delete this.__on}}}function Ye(t,e,i){return function(){var n,r=this.__on,a=function(t){return function(e){t.call(this,e,this.__data__)}}(e);if(r)for(var s=0,o=r.length;s<o;++s)if((n=r[s]).type===t.type&&n.name===t.name)return this.removeEventListener(n.type,n.listener,n.options),this.addEventListener(n.type,n.listener=a,n.options=i),void(n.value=e);this.addEventListener(t.type,a,i),n={type:t.type,name:t.name,value:e,listener:a,options:i},r?r.push(n):this.__on=[n]}}function Je(t,e,i){var n=pe(t),r=n.CustomEvent;"function"==typeof r?r=new r(e,i):(r=n.document.createEvent("Event"),i?(r.initEvent(e,i.bubbles,i.cancelable),r.detail=i.detail):r.initEvent(e,!1,!1)),t.dispatchEvent(r)}function _e(t,e){return function(){return Je(this,t,e)}}function ze(t,e){return function(){return Je(this,t,e.apply(this,arguments))}}ne.prototype={constructor:ne,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}},ve.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var Oe=[null];function Ke(t,e){this._groups=t,this._parents=e}function Pe(){return new Ke([[document.documentElement]],Oe)}function je(t){return"string"==typeof t?new Ke([[document.querySelector(t)]],[document.documentElement]):new Ke([[t]],Oe)}function qe(t,e){if(t=function(t){let e;for(;e=t.sourceEvent;)t=e;return t}(t),void 0===e&&(e=t.currentTarget),e){var i=e.ownerSVGElement||e;if(i.createSVGPoint){var n=i.createSVGPoint();return n.x=t.clientX,n.y=t.clientY,[(n=n.matrixTransform(e.getScreenCTM().inverse())).x,n.y]}if(e.getBoundingClientRect){var r=e.getBoundingClientRect();return[t.clientX-r.left-e.clientLeft,t.clientY-r.top-e.clientTop]}}return[t.pageX,t.pageY]}Ke.prototype=Pe.prototype={constructor:Ke,select:function(t){"function"!=typeof t&&(t=_t(t));for(var e=this._groups,i=e.length,n=new Array(i),r=0;r<i;++r)for(var a,s,o=e[r],l=o.length,c=n[r]=new Array(l),g=0;g<l;++g)(a=o[g])&&(s=t.call(a,a.__data__,g,o))&&("__data__"in a&&(s.__data__=a.__data__),c[g]=s);return new Ke(n,this._parents)},selectAll:function(t){t="function"==typeof t?Kt(t):Ot(t);for(var e=this._groups,i=e.length,n=[],r=[],a=0;a<i;++a)for(var s,o=e[a],l=o.length,c=0;c<l;++c)(s=o[c])&&(n.push(t.call(s,s.__data__,c,o)),r.push(s));return new Ke(n,r)},selectChild:function(t){return this.select(null==t?$t:function(t){return function(){return qt.call(this.children,t)}}("function"==typeof t?t:jt(t)))},selectChildren:function(t){return this.selectAll(null==t?ee:function(t){return function(){return te.call(this.children,t)}}("function"==typeof t?t:jt(t)))},filter:function(t){"function"!=typeof t&&(t=Pt(t));for(var e=this._groups,i=e.length,n=new Array(i),r=0;r<i;++r)for(var a,s=e[r],o=s.length,l=n[r]=[],c=0;c<o;++c)(a=s[c])&&t.call(a,a.__data__,c,s)&&l.push(a);return new Ke(n,this._parents)},data:function(t,e){if(!arguments.length)return Array.from(this,se);var i=e?ae:re,n=this._parents,r=this._groups;"function"!=typeof t&&(t=function(t){return function(){return t}}(t));for(var a=r.length,s=new Array(a),o=new Array(a),l=new Array(a),c=0;c<a;++c){var g=n[c],u=r[c],d=u.length,h=oe(t.call(g,g&&g.__data__,c,n)),B=h.length,p=o[c]=new Array(B),F=s[c]=new Array(B);i(g,u,p,F,l[c]=new Array(d),h,e);for(var f,Q,I=0,U=0;I<B;++I)if(f=p[I]){for(I>=U&&(U=I+1);!(Q=F[U])&&++U<B;);f._next=Q||null}}return(s=new Ke(s,n))._enter=o,s._exit=l,s},enter:function(){return new Ke(this._enter||this._groups.map(ie),this._parents)},exit:function(){return new Ke(this._exit||this._groups.map(ie),this._parents)},join:function(t,e,i){var n=this.enter(),r=this,a=this.exit();return"function"==typeof t?(n=t(n))&&(n=n.selection()):n=n.append(t+""),null!=e&&(r=e(r))&&(r=r.selection()),null==i?a.remove():i(a),n&&r?n.merge(r).order():r},merge:function(t){for(var e=t.selection?t.selection():t,i=this._groups,n=e._groups,r=i.length,a=n.length,s=Math.min(r,a),o=new Array(r),l=0;l<s;++l)for(var c,g=i[l],u=n[l],d=g.length,h=o[l]=new Array(d),B=0;B<d;++B)(c=g[B]||u[B])&&(h[B]=c);for(;l<r;++l)o[l]=i[l];return new Ke(o,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,e=-1,i=t.length;++e<i;)for(var n,r=t[e],a=r.length-1,s=r[a];--a>=0;)(n=r[a])&&(s&&4^n.compareDocumentPosition(s)&&s.parentNode.insertBefore(n,s),s=n);return this},sort:function(t){function e(e,i){return e&&i?t(e.__data__,i.__data__):!e-!i}t||(t=le);for(var i=this._groups,n=i.length,r=new Array(n),a=0;a<n;++a){for(var s,o=i[a],l=o.length,c=r[a]=new Array(l),g=0;g<l;++g)(s=o[g])&&(c[g]=s);c.sort(e)}return new Ke(r,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,e=0,i=t.length;e<i;++e)for(var n=t[e],r=0,a=n.length;r<a;++r){var s=n[r];if(s)return s}return null},size:function(){let t=0;for(const e of this)++t;return t},empty:function(){return!this.node()},each:function(t){for(var e=this._groups,i=0,n=e.length;i<n;++i)for(var r,a=e[i],s=0,o=a.length;s<o;++s)(r=a[s])&&t.call(r,r.__data__,s,a);return this},attr:function(t,e){var i=kt(t);if(arguments.length<2){var n=this.node();return i.local?n.getAttributeNS(i.space,i.local):n.getAttribute(i)}return this.each((null==e?i.local?ge:ce:"function"==typeof e?i.local?Be:he:i.local?de:ue)(i,e))},style:function(t,e,i){return arguments.length>1?this.each((null==e?Fe:"function"==typeof e?Qe:fe)(t,e,null==i?"":i)):Ie(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?Ue:"function"==typeof e?ye:be)(t,e)):this.node()[t]},classed:function(t,e){var i=me(t+"");if(arguments.length<2){for(var n=xe(this.node()),r=-1,a=i.length;++r<a;)if(!n.contains(i[r]))return!1;return!0}return this.each(("function"==typeof e?Re:e?Le:Ge)(i,e))},text:function(t){return arguments.length?this.each(null==t?Se:("function"==typeof t?Ve:we)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?Ee:("function"==typeof t?Ne:Ze)(t)):this.node().innerHTML},raise:function(){return this.each(De)},lower:function(){return this.each(Xe)},append:function(t){var e="function"==typeof t?t:Yt(t);return this.select((function(){return this.appendChild(e.apply(this,arguments))}))},insert:function(t,e){var i="function"==typeof t?t:Yt(t),n=null==e?He:"function"==typeof e?e:_t(e);return this.select((function(){return this.insertBefore(i.apply(this,arguments),n.apply(this,arguments)||null)}))},remove:function(){return this.each(We)},clone:function(t){return this.select(t?Me:ke)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,i){var n,r,a=function(t){return t.trim().split(/^|\s+/).map((function(t){var e="",i=t.indexOf(".");return i>=0&&(e=t.slice(i+1),t=t.slice(0,i)),{type:t,name:e}}))}(t+""),s=a.length;if(!(arguments.length<2)){for(o=e?Ye:Te,n=0;n<s;++n)this.each(o(a[n],e,i));return this}var o=this.node().__on;if(o)for(var l,c=0,g=o.length;c<g;++c)for(n=0,l=o[c];n<s;++n)if((r=a[n]).type===l.type&&r.name===l.name)return l.value},dispatch:function(t,e){return this.each(("function"==typeof e?ze:_e)(t,e))},[Symbol.iterator]:function*(){for(var t=this._groups,e=0,i=t.length;e<i;++e)for(var n,r=t[e],a=0,s=r.length;a<s;++a)(n=r[a])&&(yield n)}};const $e={passive:!1},ti={capture:!0,passive:!1};function ei(t){t.stopImmediatePropagation()}function ii(t){t.preventDefault(),t.stopImmediatePropagation()}var ni=t=>()=>t;function ri(t,{sourceEvent:e,subject:i,target:n,identifier:r,active:a,x:s,y:o,dx:l,dy:c,dispatch:g}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:i,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:o,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:g}})}function ai(t){return!t.ctrlKey&&!t.button}function si(){return this.parentNode}function oi(t,e){return null==e?{x:t.x,y:t.y}:e}function li(){return navigator.maxTouchPoints||"ontouchstart"in this}function ci(){var t,e,i,n,r=ai,a=si,s=oi,o=li,l={},c=Zt("start","drag","end"),g=0,u=0;function d(t){t.on("mousedown.drag",h).filter(o).on("touchstart.drag",F).on("touchmove.drag",f,$e).on("touchend.drag touchcancel.drag",Q).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(s,o){if(!n&&r.call(this,s,o)){var l=I(this,a.call(this,s,o),s,o,"mouse");l&&(je(s.view).on("mousemove.drag",B,ti).on("mouseup.drag",p,ti),function(t){var e=t.document.documentElement,i=je(t).on("dragstart.drag",ii,ti);"onselectstart"in e?i.on("selectstart.drag",ii,ti):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}(s.view),ei(s),i=!1,t=s.clientX,e=s.clientY,l("start",s))}}function B(n){if(ii(n),!i){var r=n.clientX-t,a=n.clientY-e;i=r*r+a*a>u}l.mouse("drag",n)}function p(t){je(t.view).on("mousemove.drag mouseup.drag",null),function(t,e){var i=t.document.documentElement,n=je(t).on("dragstart.drag",null);e&&(n.on("click.drag",ii,ti),setTimeout((function(){n.on("click.drag",null)}),0)),"onselectstart"in i?n.on("selectstart.drag",null):(i.style.MozUserSelect=i.__noselect,delete i.__noselect)}(t.view,i),ii(t),l.mouse("end",t)}function F(t,e){if(r.call(this,t,e)){var i,n,s=t.changedTouches,o=a.call(this,t,e),l=s.length;for(i=0;i<l;++i)(n=I(this,o,t,e,s[i].identifier,s[i]))&&(ei(t),n("start",t,s[i]))}}function f(t){var e,i,n=t.changedTouches,r=n.length;for(e=0;e<r;++e)(i=l[n[e].identifier])&&(ii(t),i("drag",t,n[e]))}function Q(t){var e,i,r=t.changedTouches,a=r.length;for(n&&clearTimeout(n),n=setTimeout((function(){n=null}),500),e=0;e<a;++e)(i=l[r[e].identifier])&&(ei(t),i("end",t,r[e]))}function I(t,e,i,n,r,a){var o,u,h,B=c.copy(),p=qe(a||i,e);if(null!=(h=s.call(t,new ri("beforestart",{sourceEvent:i,target:d,identifier:r,active:g,x:p[0],y:p[1],dx:0,dy:0,dispatch:B}),n)))return o=h.x-p[0]||0,u=h.y-p[1]||0,function i(a,s,c){var F,f=p;switch(a){case"start":l[r]=i,F=g++;break;case"end":delete l[r],--g;case"drag":p=qe(c||s,e),F=g}B.call(a,t,new ri(a,{sourceEvent:s,subject:h,target:d,identifier:r,active:F,x:p[0]+o,y:p[1]+u,dx:p[0]-f[0],dy:p[1]-f[1],dispatch:B}),n)}}return d.filter=function(t){return arguments.length?(r="function"==typeof t?t:ni(!!t),d):r},d.container=function(t){return arguments.length?(a="function"==typeof t?t:ni(t),d):a},d.subject=function(t){return arguments.length?(s="function"==typeof t?t:ni(t),d):s},d.touchable=function(t){return arguments.length?(o="function"==typeof t?t:ni(!!t),d):o},d.on=function(){var t=c.on.apply(c,arguments);return t===c?d:t},d.clickDistance=function(t){return arguments.length?(u=(t=+t)*t,d):Math.sqrt(u)},d}function gi(t,e,i){t.prototype=e.prototype=i,i.constructor=t}function ui(t,e){var i=Object.create(t.prototype);for(var n in e)i[n]=e[n];return i}function di(){}ri.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};var hi=.7,Bi=1/hi,pi="\\s*([+-]?\\d+)\\s*",Fi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",fi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Qi=/^#([0-9a-f]{3,8})$/,Ii=new RegExp(`^rgb\\(${pi},${pi},${pi}\\)$`),Ui=new RegExp(`^rgb\\(${fi},${fi},${fi}\\)$`),bi=new RegExp(`^rgba\\(${pi},${pi},${pi},${Fi}\\)$`),yi=new RegExp(`^rgba\\(${fi},${fi},${fi},${Fi}\\)$`),mi=new RegExp(`^hsl\\(${Fi},${fi},${fi}\\)$`),xi=new RegExp(`^hsla\\(${Fi},${fi},${fi},${Fi}\\)$`),vi={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 Ci(){return this.rgb().formatHex()}function Ai(){return this.rgb().formatRgb()}function Li(t){var e,i;return t=(t+"").trim().toLowerCase(),(e=Qi.exec(t))?(i=e[1].length,e=parseInt(e[1],16),6===i?Gi(e):3===i?new wi(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===i?Ri(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===i?Ri(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=Ii.exec(t))?new wi(e[1],e[2],e[3],1):(e=Ui.exec(t))?new wi(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=bi.exec(t))?Ri(e[1],e[2],e[3],e[4]):(e=yi.exec(t))?Ri(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=mi.exec(t))?Xi(e[1],e[2]/100,e[3]/100,1):(e=xi.exec(t))?Xi(e[1],e[2]/100,e[3]/100,e[4]):vi.hasOwnProperty(t)?Gi(vi[t]):"transparent"===t?new wi(NaN,NaN,NaN,0):null}function Gi(t){return new wi(t>>16&255,t>>8&255,255&t,1)}function Ri(t,e,i,n){return n<=0&&(t=e=i=NaN),new wi(t,e,i,n)}function Si(t,e,i,n){return 1===arguments.length?function(t){return t instanceof di||(t=Li(t)),t?new wi((t=t.rgb()).r,t.g,t.b,t.opacity):new wi}(t):new wi(t,e,i,null==n?1:n)}function wi(t,e,i,n){this.r=+t,this.g=+e,this.b=+i,this.opacity=+n}function Vi(){return`#${Di(this.r)}${Di(this.g)}${Di(this.b)}`}function Ei(){const t=Zi(this.opacity);return`${1===t?"rgb(":"rgba("}${Ni(this.r)}, ${Ni(this.g)}, ${Ni(this.b)}${1===t?")":`, ${t})`}`}function Zi(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Ni(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Di(t){return((t=Ni(t))<16?"0":"")+t.toString(16)}function Xi(t,e,i,n){return n<=0?t=e=i=NaN:i<=0||i>=1?t=e=NaN:e<=0&&(t=NaN),new Wi(t,e,i,n)}function Hi(t){if(t instanceof Wi)return new Wi(t.h,t.s,t.l,t.opacity);if(t instanceof di||(t=Li(t)),!t)return new Wi;if(t instanceof Wi)return t;var e=(t=t.rgb()).r/255,i=t.g/255,n=t.b/255,r=Math.min(e,i,n),a=Math.max(e,i,n),s=NaN,o=a-r,l=(a+r)/2;return o?(s=e===a?(i-n)/o+6*(i<n):i===a?(n-e)/o+2:(e-i)/o+4,o/=l<.5?a+r:2-a-r,s*=60):o=l>0&&l<1?0:s,new Wi(s,o,l,t.opacity)}function Wi(t,e,i,n){this.h=+t,this.s=+e,this.l=+i,this.opacity=+n}function ki(t){return(t=(t||0)%360)<0?t+360:t}function Mi(t){return Math.max(0,Math.min(1,t||0))}function Ti(t,e,i){return 255*(t<60?e+(i-e)*t/60:t<180?i:t<240?e+(i-e)*(240-t)/60:e)}gi(di,Li,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Ci,formatHex:Ci,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Hi(this).formatHsl()},formatRgb:Ai,toString:Ai}),gi(wi,Si,ui(di,{brighter(t){return t=null==t?Bi:Math.pow(Bi,t),new wi(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?hi:Math.pow(hi,t),new wi(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new wi(Ni(this.r),Ni(this.g),Ni(this.b),Zi(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Vi,formatHex:Vi,formatHex8:function(){return`#${Di(this.r)}${Di(this.g)}${Di(this.b)}${Di(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Ei,toString:Ei})),gi(Wi,(function(t,e,i,n){return 1===arguments.length?Hi(t):new Wi(t,e,i,null==n?1:n)}),ui(di,{brighter(t){return t=null==t?Bi:Math.pow(Bi,t),new Wi(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?hi:Math.pow(hi,t),new Wi(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,i=this.l,n=i+(i<.5?i:1-i)*e,r=2*i-n;return new wi(Ti(t>=240?t-240:t+120,r,n),Ti(t,r,n),Ti(t<120?t+240:t-120,r,n),this.opacity)},clamp(){return new Wi(ki(this.h),Mi(this.s),Mi(this.l),Zi(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Zi(this.opacity);return`${1===t?"hsl(":"hsla("}${ki(this.h)}, ${100*Mi(this.s)}%, ${100*Mi(this.l)}%${1===t?")":`, ${t})`}`}}));var Yi=t=>()=>t;function Ji(t){return 1==(t=+t)?_i:function(e,i){return i-e?function(t,e,i){return t=Math.pow(t,i),e=Math.pow(e,i)-t,i=1/i,function(n){return Math.pow(t+n*e,i)}}(e,i,t):Yi(isNaN(e)?i:e)}}function _i(t,e){var i=e-t;return i?function(t,e){return function(i){return t+i*e}}(t,i):Yi(isNaN(t)?e:t)}var zi=function t(e){var i=Ji(e);function n(t,e){var n=i((t=Si(t)).r,(e=Si(e)).r),r=i(t.g,e.g),a=i(t.b,e.b),s=_i(t.opacity,e.opacity);return function(e){return t.r=n(e),t.g=r(e),t.b=a(e),t.opacity=s(e),t+""}}return n.gamma=t,n}(1);function Oi(t,e){e||(e=[]);var i,n=t?Math.min(e.length,t.length):0,r=e.slice();return function(a){for(i=0;i<n;++i)r[i]=t[i]*(1-a)+e[i]*a;return r}}function Ki(t,e){var i,n=e?e.length:0,r=t?Math.min(n,t.length):0,a=new Array(r),s=new Array(n);for(i=0;i<r;++i)a[i]=nn(t[i],e[i]);for(;i<n;++i)s[i]=e[i];return function(t){for(i=0;i<r;++i)s[i]=a[i](t);return s}}function Pi(t,e){var i=new Date;return t=+t,e=+e,function(n){return i.setTime(t*(1-n)+e*n),i}}function ji(t,e){return t=+t,e=+e,function(i){return t*(1-i)+e*i}}function qi(t,e){var i,n={},r={};for(i in null!==t&&"object"==typeof t||(t={}),null!==e&&"object"==typeof e||(e={}),e)i in t?n[i]=nn(t[i],e[i]):r[i]=e[i];return function(t){for(i in n)r[i]=n[i](t);return r}}var $i=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,tn=new RegExp($i.source,"g");function en(t,e){var i,n,r,a=$i.lastIndex=tn.lastIndex=0,s=-1,o=[],l=[];for(t+="",e+="";(i=$i.exec(t))&&(n=tn.exec(e));)(r=n.index)>a&&(r=e.slice(a,r),o[s]?o[s]+=r:o[++s]=r),(i=i[0])===(n=n[0])?o[s]?o[s]+=n:o[++s]=n:(o[++s]=null,l.push({i:s,x:ji(i,n)})),a=tn.lastIndex;return a<e.length&&(r=e.slice(a),o[s]?o[s]+=r:o[++s]=r),o.length<2?l[0]?function(t){return function(e){return t(e)+""}}(l[0].x):function(t){return function(){return t}}(e):(e=l.length,function(t){for(var i,n=0;n<e;++n)o[(i=l[n]).i]=i.x(t);return o.join("")})}function nn(t,e){var i,n=typeof e;return null==e||"boolean"===n?Yi(e):("number"===n?ji:"string"===n?(i=Li(e))?(e=i,zi):en:e instanceof Li?zi:e instanceof Date?Pi:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}(e)?Oi:Array.isArray(e)?Ki:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?qi:ji)(t,e)}function rn(t,e){return t=+t,e=+e,function(i){return Math.round(t*(1-i)+e*i)}}var an,sn=180/Math.PI,on={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function ln(t,e,i,n,r,a){var s,o,l;return(s=Math.sqrt(t*t+e*e))&&(t/=s,e/=s),(l=t*i+e*n)&&(i-=t*l,n-=e*l),(o=Math.sqrt(i*i+n*n))&&(i/=o,n/=o,l/=o),t*n<e*i&&(t=-t,e=-e,l=-l,s=-s),{translateX:r,translateY:a,rotate:Math.atan2(e,t)*sn,skewX:Math.atan(l)*sn,scaleX:s,scaleY:o}}function cn(t,e,i,n){function r(t){return t.length?t.pop()+" ":""}return function(a,s){var o=[],l=[];return a=t(a),s=t(s),function(t,n,r,a,s,o){if(t!==r||n!==a){var l=s.push("translate(",null,e,null,i);o.push({i:l-4,x:ji(t,r)},{i:l-2,x:ji(n,a)})}else(r||a)&&s.push("translate("+r+e+a+i)}(a.translateX,a.translateY,s.translateX,s.translateY,o,l),function(t,e,i,a){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),a.push({i:i.push(r(i)+"rotate(",null,n)-2,x:ji(t,e)})):e&&i.push(r(i)+"rotate("+e+n)}(a.rotate,s.rotate,o,l),function(t,e,i,a){t!==e?a.push({i:i.push(r(i)+"skewX(",null,n)-2,x:ji(t,e)}):e&&i.push(r(i)+"skewX("+e+n)}(a.skewX,s.skewX,o,l),function(t,e,i,n,a,s){if(t!==i||e!==n){var o=a.push(r(a)+"scale(",null,",",null,")");s.push({i:o-4,x:ji(t,i)},{i:o-2,x:ji(e,n)})}else 1===i&&1===n||a.push(r(a)+"scale("+i+","+n+")")}(a.scaleX,a.scaleY,s.scaleX,s.scaleY,o,l),a=s=null,function(t){for(var e,i=-1,n=l.length;++i<n;)o[(e=l[i]).i]=e.x(t);return o.join("")}}}var gn,un,dn=cn((function(t){const e=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?on:ln(e.a,e.b,e.c,e.d,e.e,e.f)}),"px, ","px)","deg)"),hn=cn((function(t){return null==t?on:(an||(an=document.createElementNS("http://www.w3.org/2000/svg","g")),an.setAttribute("transform",t),(t=an.transform.baseVal.consolidate())?ln((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):on)}),", ",")",")"),Bn=0,pn=0,Fn=0,fn=1e3,Qn=0,In=0,Un=0,bn="object"==typeof performance&&performance.now?performance:Date,yn="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function mn(){return In||(yn(xn),In=bn.now()+Un)}function xn(){In=0}function vn(){this._call=this._time=this._next=null}function Cn(t,e,i){var n=new vn;return n.restart(t,e,i),n}function An(){In=(Qn=bn.now())+Un,Bn=pn=0;try{!function(){mn(),++Bn;for(var t,e=gn;e;)(t=In-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Bn}()}finally{Bn=0,function(){var t,e,i=gn,n=1/0;for(;i;)i._call?(n>i._time&&(n=i._time),t=i,i=i._next):(e=i._next,i._next=null,i=t?t._next=e:gn=e);un=t,Gn(n)}(),In=0}}function Ln(){var t=bn.now(),e=t-Qn;e>fn&&(Un-=e,Qn=t)}function Gn(t){Bn||(pn&&(pn=clearTimeout(pn)),t-In>24?(t<1/0&&(pn=setTimeout(An,t-bn.now()-Un)),Fn&&(Fn=clearInterval(Fn))):(Fn||(Qn=bn.now(),Fn=setInterval(Ln,fn)),Bn=1,yn(An)))}function Rn(t,e,i){var n=new vn;return e=null==e?0:+e,n.restart((i=>{n.stop(),t(i+e)}),e,i),n}vn.prototype=Cn.prototype={constructor:vn,restart:function(t,e,i){if("function"!=typeof t)throw new TypeError("callback is not a function");i=(null==i?mn():+i)+(null==e?0:+e),this._next||un===this||(un?un._next=this:gn=this,un=this),this._call=t,this._time=i,Gn()},stop:function(){this._call&&(this._call=null,this._time=1/0,Gn())}};var Sn=Zt("start","end","cancel","interrupt"),wn=[],Vn=0,En=1,Zn=2,Nn=3,Dn=4,Xn=5,Hn=6;function Wn(t,e,i,n,r,a){var s=t.__transition;if(s){if(i in s)return}else t.__transition={};!function(t,e,i){var n,r=t.__transition;function a(t){i.state=En,i.timer.restart(s,i.delay,i.time),i.delay<=t&&s(t-i.delay)}function