@decidables/decidables-elements
Version:
decidables-elements: Basic UI Web Components for the decidables project
22 lines • 85.2 kB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).decidablesElements={})}(this,function(t){"use strict";
/**
* @license
* Copyright 2019 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const e=globalThis,n=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,r=Symbol(),i=new WeakMap;let o=class{constructor(t,e,n){if(this._$cssResult$=!0,n!==r)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(n&&void 0===t){const n=void 0!==e&&1===e.length;n&&(t=i.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),n&&i.set(e,t))}return t}toString(){return this.cssText}};const s=t=>new o("string"==typeof t?t:t+"",void 0,r),a=(t,...e)=>{const n=1===t.length?t[0]:e.reduce((e,n,r)=>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.")})(n)+t[r+1],t[0]);return new o(n,t,r)},l=n?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const n of t.cssRules)e+=n.cssText;return s(e)})(t):t,{is:u,defineProperty:h,getOwnPropertyDescriptor:c,getOwnPropertyNames:d,getOwnPropertySymbols:p,getPrototypeOf:f}=Object,b=globalThis,m=b.trustedTypes,g=m?m.emptyScript:"",y=b.reactiveElementPolyfillSupport,v=(t,e)=>t,w={toAttribute(t,e){switch(e){case Boolean:t=t?g:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let n=t;switch(e){case Boolean:n=null!==t;break;case Number:n=null===t?null:Number(t);break;case Object:case Array:try{n=JSON.parse(t)}catch(t){n=null}}return n}},_=(t,e)=>!u(t,e),x={attribute:!0,type:String,converter:w,reflect:!1,useDefault:!1,hasChanged:_};
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/Symbol.metadata??=Symbol("metadata"),b.litPropertyMetadata??=new WeakMap;let $=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=x){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const n=Symbol(),r=this.getPropertyDescriptor(t,n,e);void 0!==r&&h(this.prototype,t,r)}}static getPropertyDescriptor(t,e,n){const{get:r,set:i}=c(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:r,set(e){const o=r?.call(this);i?.call(this,e),this.requestUpdate(t,o,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??x}static _$Ei(){if(this.hasOwnProperty(v("elementProperties")))return;const t=f(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(v("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(v("properties"))){const t=this.properties,e=[...d(t),...p(t)];for(const n of e)this.createProperty(n,t[n])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,n]of e)this.elementProperties.set(t,n)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const n=this._$Eu(t,e);void 0!==n&&this._$Eh.set(n,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const n=new Set(t.flat(1/0).reverse());for(const t of n)e.unshift(l(t))}else void 0!==t&&e.push(l(t));return e}static _$Eu(t,e){const n=e.attribute;return!1===n?void 0:"string"==typeof n?n:"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 n of e.keys())this.hasOwnProperty(n)&&(t.set(n,this[n]),delete this[n]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,r)=>{if(n)t.adoptedStyleSheets=r.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const n of r){const r=document.createElement("style"),i=e.litNonce;void 0!==i&&r.setAttribute("nonce",i),r.textContent=n.cssText,t.appendChild(r)}})(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,n){this._$AK(t,n)}_$ET(t,e){const n=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,n);if(void 0!==r&&!0===n.reflect){const i=(void 0!==n.converter?.toAttribute?n.converter:w).toAttribute(e,n.type);this._$Em=t,null==i?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(t,e){const n=this.constructor,r=n._$Eh.get(t);if(void 0!==r&&this._$Em!==r){const t=n.getPropertyOptions(r),i="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:w;this._$Em=r;const o=i.fromAttribute(e,t.type);this[r]=o??this._$Ej?.get(r)??o,this._$Em=null}}requestUpdate(t,e,n,r=!1,i){if(void 0!==t){const o=this.constructor;if(!1===r&&(i=this[t]),n??=o.getPropertyOptions(t),!((n.hasChanged??_)(i,e)||n.useDefault&&n.reflect&&i===this._$Ej?.get(t)&&!this.hasAttribute(o._$Eu(t,n))))return;this.C(t,e,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:n,reflect:r,wrapped:i},o){n&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,o??e??this[t]),!0!==i||void 0!==o)||(this._$AL.has(t)||(this.hasUpdated||n||(e=void 0),this._$AL.set(t,e)),!0===r&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,n]of t){const{wrapped:t}=n,r=this[e];!0!==t||this._$AL.has(e)||void 0===r||this.C(e,void 0,n,r)}}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._$EM()}catch(e){throw t=!1,this._$EM(),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)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(t){}firstUpdated(t){}};$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[v("elementProperties")]=new Map,$[v("finalized")]=new Map,y?.({ReactiveElement:$}),(b.reactiveElementVersions??=[]).push("2.1.2");
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
const A=globalThis,k=t=>t,S=A.trustedTypes,E=S?S.createPolicy("lit-html",{createHTML:t=>t}):void 0,C="$lit$",N=`lit$${Math.random().toFixed(9).slice(2)}$`,P="?"+N,M=`<${P}>`,U=document,O=()=>U.createComment(""),T=t=>null===t||"object"!=typeof t&&"function"!=typeof t,z=Array.isArray,R="[ \t\n\f\r]",B=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,H=/-->/g,D=/>/g,j=RegExp(`>|${R}(?:([^\\s"'>=/]+)(${R}*=${R}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),I=/'/g,L=/"/g,q=/^(?:script|style|textarea|title)$/i,V=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),F=V(1),X=V(2),Y=Symbol.for("lit-noChange"),W=Symbol.for("lit-nothing"),G=new WeakMap,K=U.createTreeWalker(U,129);function J(t,e){if(!z(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==E?E.createHTML(e):e}const Z=(t,e)=>{const n=t.length-1,r=[];let i,o=2===e?"<svg>":3===e?"<math>":"",s=B;for(let e=0;e<n;e++){const n=t[e];let a,l,u=-1,h=0;for(;h<n.length&&(s.lastIndex=h,l=s.exec(n),null!==l);)h=s.lastIndex,s===B?"!--"===l[1]?s=H:void 0!==l[1]?s=D:void 0!==l[2]?(q.test(l[2])&&(i=RegExp("</"+l[2],"g")),s=j):void 0!==l[3]&&(s=j):s===j?">"===l[0]?(s=i??B,u=-1):void 0===l[1]?u=-2:(u=s.lastIndex-l[2].length,a=l[1],s=void 0===l[3]?j:'"'===l[3]?L:I):s===L||s===I?s=j:s===H||s===D?s=B:(s=j,i=void 0);const c=s===j&&t[e+1].startsWith("/>")?" ":"";o+=s===B?n+M:u>=0?(r.push(a),n.slice(0,u)+C+n.slice(u)+N+c):n+N+(-2===u?e:c)}return[J(t,o+(t[n]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),r]};class Q{constructor({strings:t,_$litType$:e},n){let r;this.parts=[];let i=0,o=0;const s=t.length-1,a=this.parts,[l,u]=Z(t,e);if(this.el=Q.createElement(l,n),K.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(r=K.nextNode())&&a.length<s;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith(C)){const e=u[o++],n=r.getAttribute(t).split(N),s=/([.?@])?(.*)/.exec(e);a.push({type:1,index:i,name:s[2],strings:n,ctor:"."===s[1]?it:"?"===s[1]?ot:"@"===s[1]?st:rt}),r.removeAttribute(t)}else t.startsWith(N)&&(a.push({type:6,index:i}),r.removeAttribute(t));if(q.test(r.tagName)){const t=r.textContent.split(N),e=t.length-1;if(e>0){r.textContent=S?S.emptyScript:"";for(let n=0;n<e;n++)r.append(t[n],O()),K.nextNode(),a.push({type:2,index:++i});r.append(t[e],O())}}}else if(8===r.nodeType)if(r.data===P)a.push({type:2,index:i});else{let t=-1;for(;-1!==(t=r.data.indexOf(N,t+1));)a.push({type:7,index:i}),t+=N.length-1}i++}}static createElement(t,e){const n=U.createElement("template");return n.innerHTML=t,n}}function tt(t,e,n=t,r){if(e===Y)return e;let i=void 0!==r?n._$Co?.[r]:n._$Cl;const o=T(e)?void 0:e._$litDirective$;return i?.constructor!==o&&(i?._$AO?.(!1),void 0===o?i=void 0:(i=new o(t),i._$AT(t,n,r)),void 0!==r?(n._$Co??=[])[r]=i:n._$Cl=i),void 0!==i&&(e=tt(t,i._$AS(t,e.values),i,r)),e}class et{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:n}=this._$AD,r=(t?.creationScope??U).importNode(e,!0);K.currentNode=r;let i=K.nextNode(),o=0,s=0,a=n[0];for(;void 0!==a;){if(o===a.index){let e;2===a.type?e=new nt(i,i.nextSibling,this,t):1===a.type?e=new a.ctor(i,a.name,a.strings,this,t):6===a.type&&(e=new at(i,this,t)),this._$AV.push(e),a=n[++s]}o!==a?.index&&(i=K.nextNode(),o++)}return K.currentNode=U,r}p(t){let e=0;for(const n of this._$AV)void 0!==n&&(void 0!==n.strings?(n._$AI(t,n,e),e+=n.strings.length-2):n._$AI(t[e])),e++}}class nt{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,n,r){this.type=2,this._$AH=W,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=n,this.options=r,this._$Cv=r?.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=tt(this,t,e),T(t)?t===W||null==t||""===t?(this._$AH!==W&&this._$AR(),this._$AH=W):t!==this._$AH&&t!==Y&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>z(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!==W&&T(this._$AH)?this._$AA.nextSibling.data=t:this.T(U.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:n}=t,r="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=Q.createElement(J(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(e);else{const t=new et(r,this),n=t.u(this.options);t.p(e),this.T(n),this._$AH=t}}_$AC(t){let e=G.get(t.strings);return void 0===e&&G.set(t.strings,e=new Q(t)),e}k(t){z(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let n,r=0;for(const i of t)r===e.length?e.push(n=new nt(this.O(O()),this.O(O()),this,this.options)):n=e[r],n._$AI(i),r++;r<e.length&&(this._$AR(n&&n._$AB.nextSibling,r),e.length=r)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){const e=k(t).nextSibling;k(t).remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class rt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,n,r,i){this.type=1,this._$AH=W,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=i,n.length>2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=W}_$AI(t,e=this,n,r){const i=this.strings;let o=!1;if(void 0===i)t=tt(this,t,e,0),o=!T(t)||t!==this._$AH&&t!==Y,o&&(this._$AH=t);else{const r=t;let s,a;for(t=i[0],s=0;s<i.length-1;s++)a=tt(this,r[n+s],e,s),a===Y&&(a=this._$AH[s]),o||=!T(a)||a!==this._$AH[s],a===W?t=W:t!==W&&(t+=(a??"")+i[s+1]),this._$AH[s]=a}o&&!r&&this.j(t)}j(t){t===W?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class it extends rt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===W?void 0:t}}class ot extends rt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==W)}}class st extends rt{constructor(t,e,n,r,i){super(t,e,n,r,i),this.type=5}_$AI(t,e=this){if((t=tt(this,t,e,0)??W)===Y)return;const n=this._$AH,r=t===W&&n!==W||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,i=t!==W&&(n===W||r);r&&this.element.removeEventListener(this.name,this,n),i&&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,n){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(t){tt(this,t)}}const lt=A.litHtmlPolyfillSupport;lt?.(Q,nt),(A.litHtmlVersions??=[]).push("3.3.2");const ut=globalThis;
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/class ht extends ${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,n)=>{const r=n?.renderBefore??e;let i=r._$litPart$;if(void 0===i){const t=n?.renderBefore??null;r._$litPart$=i=new nt(e.insertBefore(O(),t),t,void 0,n??{})}return i._$AI(t),i})(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Y}}ht._$litElement$=!0,ht.finalized=!0,ut.litElementHydrateSupport?.({LitElement:ht});const ct=ut.litElementPolyfillSupport;ct?.({LitElement:ht}),(ut.litElementVersions??=[]).push("4.2.2");var dt={value:()=>{}};function pt(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new ft(r)}function ft(t){this._=t}function bt(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}function mt(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=dt,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}ft.prototype=pt.prototype={constructor:ft,on:function(t,e){var n,r,i=this._,o=(r=i,(t+"").trim().split(/^|\s+/).map(function(t){var e="",n=t.indexOf(".");if(n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}})),s=-1,a=o.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++s<a;)if(n=(t=o[s]).type)i[n]=mt(i[n],t.name,e);else if(null==e)for(n in i)i[n]=mt(i[n],t.name,null);return this}for(;++s<a;)if((n=(t=o[s]).type)&&(n=bt(i[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new ft(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,i=new Array(n),o=0;o<n;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,n=(r=this._[t]).length;o<n;++o)r[o].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};var gt="http://www.w3.org/1999/xhtml",yt={svg:"http://www.w3.org/2000/svg",xhtml:gt,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function vt(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),yt.hasOwnProperty(e)?{space:yt[e],local:t}:t}function wt(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===gt&&e.documentElement.namespaceURI===gt?e.createElement(t):e.createElementNS(n,t)}}function _t(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function xt(t){var e=vt(t);return(e.local?_t:wt)(e)}function $t(){}function At(t){return null==t?$t:function(){return this.querySelector(t)}}function kt(){return[]}function St(t){return null==t?kt:function(){return this.querySelectorAll(t)}}function Et(t){return function(){return function(t){return null==t?[]:Array.isArray(t)?t:Array.from(t)}(t.apply(this,arguments))}}function Ct(t){return function(){return this.matches(t)}}function Nt(t){return function(e){return e.matches(t)}}var Pt=Array.prototype.find;function Mt(){return this.firstElementChild}var Ut=Array.prototype.filter;function Ot(){return Array.from(this.children)}function Tt(t){return new Array(t.length)}function zt(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function Rt(t,e,n,r,i,o){for(var s,a=0,l=e.length,u=o.length;a<u;++a)(s=e[a])?(s.__data__=o[a],r[a]=s):n[a]=new zt(t,o[a]);for(;a<l;++a)(s=e[a])&&(i[a]=s)}function Bt(t,e,n,r,i,o,s){var a,l,u,h=new Map,c=e.length,d=o.length,p=new Array(c);for(a=0;a<c;++a)(l=e[a])&&(p[a]=u=s.call(l,l.__data__,a,e)+"",h.has(u)?i[a]=l:h.set(u,l));for(a=0;a<d;++a)u=s.call(t,o[a],a,o)+"",(l=h.get(u))?(r[a]=l,l.__data__=o[a],h.delete(u)):n[a]=new zt(t,o[a]);for(a=0;a<c;++a)(l=e[a])&&h.get(p[a])===l&&(i[a]=l)}function Ht(t){return t.__data__}function Dt(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function jt(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function It(t){return function(){this.removeAttribute(t)}}function Lt(t){return function(){this.removeAttributeNS(t.space,t.local)}}function qt(t,e){return function(){this.setAttribute(t,e)}}function Vt(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Ft(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function Xt(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function Yt(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Wt(t){return function(){this.style.removeProperty(t)}}function Gt(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Kt(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function Jt(t,e){return t.style.getPropertyValue(e)||Yt(t).getComputedStyle(t,null).getPropertyValue(e)}function Zt(t){return function(){delete this[t]}}function Qt(t,e){return function(){this[t]=e}}function te(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function ee(t){return t.trim().split(/^|\s+/)}function ne(t){return t.classList||new re(t)}function re(t){this._node=t,this._names=ee(t.getAttribute("class")||"")}function ie(t,e){for(var n=ne(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function oe(t,e){for(var n=ne(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function se(t){return function(){ie(this,t)}}function ae(t){return function(){oe(this,t)}}function le(t,e){return function(){(e.apply(this,arguments)?ie:oe)(this,t)}}function ue(){this.textContent=""}function he(t){return function(){this.textContent=t}}function ce(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}function de(){this.innerHTML=""}function pe(t){return function(){this.innerHTML=t}}function fe(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}function be(){this.nextSibling&&this.parentNode.appendChild(this)}function me(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ge(){return null}function ye(){var t=this.parentNode;t&&t.removeChild(this)}function ve(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function we(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function _e(t){return function(){var e=this.__on;if(e){for(var n,r=0,i=-1,o=e.length;r<o;++r)n=e[r],t.type&&n.type!==t.type||n.name!==t.name?e[++i]=n:this.removeEventListener(n.type,n.listener,n.options);++i?e.length=i:delete this.__on}}}function xe(t,e,n){return function(){var r,i=this.__on,o=function(t){return function(e){t.call(this,e,this.__data__)}}(e);if(i)for(var s=0,a=i.length;s<a;++s)if((r=i[s]).type===t.type&&r.name===t.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=o,r.options=n),void(r.value=e);this.addEventListener(t.type,o,n),r={type:t.type,name:t.name,value:e,listener:o,options:n},i?i.push(r):this.__on=[r]}}function $e(t,e,n){var r=Yt(t),i=r.CustomEvent;"function"==typeof i?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function Ae(t,e){return function(){return $e(this,t,e)}}function ke(t,e){return function(){return $e(this,t,e.apply(this,arguments))}}zt.prototype={constructor:zt,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)}},re.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 Se=[null];function Ee(t,e){this._groups=t,this._parents=e}function Ce(){return new Ee([[document.documentElement]],Se)}function Ne(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Pe(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Me(){}Ee.prototype=Ce.prototype={constructor:Ee,select:function(t){"function"!=typeof t&&(t=At(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o,s,a=e[i],l=a.length,u=r[i]=new Array(l),h=0;h<l;++h)(o=a[h])&&(s=t.call(o,o.__data__,h,a))&&("__data__"in o&&(s.__data__=o.__data__),u[h]=s);return new Ee(r,this._parents)},selectAll:function(t){t="function"==typeof t?Et(t):St(t);for(var e=this._groups,n=e.length,r=[],i=[],o=0;o<n;++o)for(var s,a=e[o],l=a.length,u=0;u<l;++u)(s=a[u])&&(r.push(t.call(s,s.__data__,u,a)),i.push(s));return new Ee(r,i)},selectChild:function(t){return this.select(null==t?Mt:function(t){return function(){return Pt.call(this.children,t)}}("function"==typeof t?t:Nt(t)))},selectChildren:function(t){return this.selectAll(null==t?Ot:function(t){return function(){return Ut.call(this.children,t)}}("function"==typeof t?t:Nt(t)))},filter:function(t){"function"!=typeof t&&(t=Ct(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o,s=e[i],a=s.length,l=r[i]=[],u=0;u<a;++u)(o=s[u])&&t.call(o,o.__data__,u,s)&&l.push(o);return new Ee(r,this._parents)},data:function(t,e){if(!arguments.length)return Array.from(this,Ht);var n=e?Bt:Rt,r=this._parents,i=this._groups;"function"!=typeof t&&(t=function(t){return function(){return t}}(t));for(var o=i.length,s=new Array(o),a=new Array(o),l=new Array(o),u=0;u<o;++u){var h=r[u],c=i[u],d=c.length,p=Dt(t.call(h,h&&h.__data__,u,r)),f=p.length,b=a[u]=new Array(f),m=s[u]=new Array(f);n(h,c,b,m,l[u]=new Array(d),p,e);for(var g,y,v=0,w=0;v<f;++v)if(g=b[v]){for(v>=w&&(w=v+1);!(y=m[w])&&++w<f;);g._next=y||null}}return(s=new Ee(s,r))._enter=a,s._exit=l,s},enter:function(){return new Ee(this._enter||this._groups.map(Tt),this._parents)},exit:function(){return new Ee(this._exit||this._groups.map(Tt),this._parents)},join:function(t,e,n){var r=this.enter(),i=this,o=this.exit();return"function"==typeof t?(r=t(r))&&(r=r.selection()):r=r.append(t+""),null!=e&&(i=e(i))&&(i=i.selection()),null==n?o.remove():n(o),r&&i?r.merge(i).order():i},merge:function(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,o=r.length,s=Math.min(i,o),a=new Array(i),l=0;l<s;++l)for(var u,h=n[l],c=r[l],d=h.length,p=a[l]=new Array(d),f=0;f<d;++f)(u=h[f]||c[f])&&(p[f]=u);for(;l<i;++l)a[l]=n[l];return new Ee(a,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r,i=t[e],o=i.length-1,s=i[o];--o>=0;)(r=i[o])&&(s&&4^r.compareDocumentPosition(s)&&s.parentNode.insertBefore(r,s),s=r);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=jt);for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var s,a=n[o],l=a.length,u=i[o]=new Array(l),h=0;h<l;++h)(s=a[h])&&(u[h]=s);u.sort(e)}return new Ee(i,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,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length;i<o;++i){var s=r[i];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,n=0,r=e.length;n<r;++n)for(var i,o=e[n],s=0,a=o.length;s<a;++s)(i=o[s])&&t.call(i,i.__data__,s,o);return this},attr:function(t,e){var n=vt(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==e?n.local?Lt:It:"function"==typeof e?n.local?Xt:Ft:n.local?Vt:qt)(n,e))},style:function(t,e,n){return arguments.length>1?this.each((null==e?Wt:"function"==typeof e?Kt:Gt)(t,e,null==n?"":n)):Jt(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?Zt:"function"==typeof e?te:Qt)(t,e)):this.node()[t]},classed:function(t,e){var n=ee(t+"");if(arguments.length<2){for(var r=ne(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each(("function"==typeof e?le:e?se:ae)(n,e))},text:function(t){return arguments.length?this.each(null==t?ue:("function"==typeof t?ce:he)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?de:("function"==typeof t?fe:pe)(t)):this.node().innerHTML},raise:function(){return this.each(be)},lower:function(){return this.each(me)},append:function(t){var e="function"==typeof t?t:xt(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})},insert:function(t,e){var n="function"==typeof t?t:xt(t),r=null==e?ge:"function"==typeof e?e:At(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})},remove:function(){return this.each(ye)},clone:function(t){return this.select(t?we:ve)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,n){var r,i,o=function(t){return t.trim().split(/^|\s+/).map(function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}})}(t+""),s=o.length;if(!(arguments.length<2)){for(a=e?xe:_e,r=0;r<s;++r)this.each(a(o[r],e,n));return this}var a=this.node().__on;if(a)for(var l,u=0,h=a.length;u<h;++u)for(r=0,l=a[u];r<s;++r)if((i=o[r]).type===l.type&&i.name===l.name)return l.value},dispatch:function(t,e){return this.each(("function"==typeof e?ke:Ae)(t,e))},[Symbol.iterator]:function*(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r,i=t[e],o=0,s=i.length;o<s;++o)(r=i[o])&&(yield r)}};var Ue=.7,Oe=1/Ue,Te="\\s*([+-]?\\d+)\\s*",ze="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Re="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Be=/^#([0-9a-f]{3,8})$/,He=new RegExp(`^rgb\\(${Te},${Te},${Te}\\)$`),De=new RegExp(`^rgb\\(${Re},${Re},${Re}\\)$`),je=new RegExp(`^rgba\\(${Te},${Te},${Te},${ze}\\)$`),Ie=new RegExp(`^rgba\\(${Re},${Re},${Re},${ze}\\)$`),Le=new RegExp(`^hsl\\(${ze},${Re},${Re}\\)$`),qe=new RegExp(`^hsla\\(${ze},${Re},${Re},${ze}\\)$`),Ve={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 Fe(){return this.rgb().formatHex()}function Xe(){return this.rgb().formatRgb()}function Ye(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Be.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?We(e):3===n?new Je(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Ge(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Ge(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=He.exec(t))?new Je(e[1],e[2],e[3],1):(e=De.exec(t))?new Je(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=je.exec(t))?Ge(e[1],e[2],e[3],e[4]):(e=Ie.exec(t))?Ge(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Le.exec(t))?rn(e[1],e[2]/100,e[3]/100,1):(e=qe.exec(t))?rn(e[1],e[2]/100,e[3]/100,e[4]):Ve.hasOwnProperty(t)?We(Ve[t]):"transparent"===t?new Je(NaN,NaN,NaN,0):null}function We(t){return new Je(t>>16&255,t>>8&255,255&t,1)}function Ge(t,e,n,r){return r<=0&&(t=e=n=NaN),new Je(t,e,n,r)}function Ke(t,e,n,r){return 1===arguments.length?function(t){return t instanceof Me||(t=Ye(t)),t?new Je((t=t.rgb()).r,t.g,t.b,t.opacity):new Je}(t):new Je(t,e,n,null==r?1:r)}function Je(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Ze(){return`#${nn(this.r)}${nn(this.g)}${nn(this.b)}`}function Qe(){const t=tn(this.opacity);return`${1===t?"rgb(":"rgba("}${en(this.r)}, ${en(this.g)}, ${en(this.b)}${1===t?")":`, ${t})`}`}function tn(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function en(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function nn(t){return((t=en(t))<16?"0":"")+t.toString(16)}function rn(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new sn(t,e,n,r)}function on(t){if(t instanceof sn)return new sn(t.h,t.s,t.l,t.opacity);if(t instanceof Me||(t=Ye(t)),!t)return new sn;if(t instanceof sn)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),s=NaN,a=o-i,l=(o+i)/2;return a?(s=e===o?(n-r)/a+6*(n<r):n===o?(r-e)/a+2:(e-n)/a+4,a/=l<.5?o+i:2-o-i,s*=60):a=l>0&&l<1?0:s,new sn(s,a,l,t.opacity)}function sn(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function an(t){return(t=(t||0)%360)<0?t+360:t}function ln(t){return Math.max(0,Math.min(1,t||0))}function un(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}Ne(Me,Ye,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Fe,formatHex:Fe,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return on(this).formatHsl()},formatRgb:Xe,toString:Xe}),Ne(Je,Ke,Pe(Me,{brighter(t){return t=null==t?Oe:Math.pow(Oe,t),new Je(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?Ue:Math.pow(Ue,t),new Je(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Je(en(this.r),en(this.g),en(this.b),tn(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:Ze,formatHex:Ze,formatHex8:function(){return`#${nn(this.r)}${nn(this.g)}${nn(this.b)}${nn(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Qe,toString:Qe})),Ne(sn,function(t,e,n,r){return 1===arguments.length?on(t):new sn(t,e,n,null==r?1:r)},Pe(Me,{brighter(t){return t=null==t?Oe:Math.pow(Oe,t),new sn(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Ue:Math.pow(Ue,t),new sn(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,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new Je(un(t>=240?t-240:t+120,i,r),un(t,i,r),un(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new sn(an(this.h),ln(this.s),ln(this.l),tn(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=tn(this.opacity);return`${1===t?"hsl(":"hsla("}${an(this.h)}, ${100*ln(this.s)}%, ${100*ln(this.l)}%${1===t?")":`, ${t})`}`}}));var hn=t=>()=>t;function cn(t){return 1===(t=+t)?dn:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):hn(isNaN(e)?n:e)}}function dn(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):hn(isNaN(t)?e:t)}var pn=function t(e){var n=cn(e);function r(t,e){var r=n((t=Ke(t)).r,(e=Ke(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),s=dn(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=o(e),t.opacity=s(e),t+""}}return r.gamma=t,r}(1);function fn(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var bn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,mn=new RegExp(bn.source,"g");function gn(t,e){var n,r,i,o=bn.lastIndex=mn.lastIndex=0,s=-1,a=[],l=[];for(t+="",e+="";(n=bn.exec(t))&&(r=mn.exec(e));)(i=r.index)>o&&(i=e.slice(o,i),a[s]?a[s]+=i:a[++s]=i),(n=n[0])===(r=r[0])?a[s]?a[s]+=r:a[++s]=r:(a[++s]=null,l.push({i:s,x:fn(n,r)})),o=mn.lastIndex;return o<e.length&&(i=e.slice(o),a[s]?a[s]+=i:a[++s]=i),a.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 n,r=0;r<e;++r)a[(n=l[r]).i]=n.x(t);return a.join("")})}var yn,vn=180/Math.PI,wn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function _n(t,e,n,r,i,o){var s,a,l;return(s=Math.sqrt(t*t+e*e))&&(t/=s,e/=s),(l=t*n+e*r)&&(n-=t*l,r-=e*l),(a=Math.sqrt(n*n+r*r))&&(n/=a,r/=a,l/=a),t*r<e*n&&(t=-t,e=-e,l=-l,s=-s),{translateX:i,translateY:o,rotate:Math.atan2(e,t)*vn,skewX:Math.atan(l)*vn,scaleX:s,scaleY:a}}function xn(t,e,n,r){function i(t){return t.length?t.pop()+" ":""}return function(o,s){var a=[],l=[];return o=t(o),s=t(s),function(t,r,i,o,s,a){if(t!==i||r!==o){var l=s.push("translate(",null,e,null,n);a.push({i:l-4,x:fn(t,i)},{i:l-2,x:fn(r,o)})}else(i||o)&&s.push("translate("+i+e+o+n)}(o.translateX,o.translateY,s.translateX,s.translateY,a,l),function(t,e,n,o){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),o.push({i:n.push(i(n)+"rotate(",null,r)-2,x:fn(t,e)})):e&&n.push(i(n)+"rotate("+e+r)}(o.rotate,s.rotate,a,l),function(t,e,n,o){t!==e?o.push({i:n.push(i(n)+"skewX(",null,r)-2,x:fn(t,e)}):e&&n.push(i(n)+"skewX("+e+r)}(o.skewX,s.skewX,a,l),function(t,e,n,r,o,s){if(t!==n||e!==r){var a=o.push(i(o)+"scale(",null,",",null,")");s.push({i:a-4,x:fn(t,n)},{i:a-2,x:fn(e,r)})}else 1===n&&1===r||o.push(i(o)+"scale("+n+","+r+")")}(o.scaleX,o.scaleY,s.scaleX,s.scaleY,a,l),o=s=null,function(t){for(var e,n=-1,r=l.length;++n<r;)a[(e=l[n]).i]=e.x(t);return a.join("")}}}var $n,An,kn=xn(function(t){const e=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?wn:_n(e.a,e.b,e.c,e.d,e.e,e.f)},"px, ","px)","deg)"),Sn=xn(function(t){return null==t?wn:(yn||(yn=document.createElementNS("http://www.w3.org/2000/svg","g")),yn.setAttribute("transform",t),(t=yn.transform.baseVal.consolidate())?_n((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):wn)},", ",")",")"),En=0,Cn=0,Nn=0,Pn=0,Mn=0,Un=0,On="object"==typeof performance&&performance.now?performance:Date,Tn="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function zn(){return Mn||(Tn(Rn),Mn=On.now()+Un)}function Rn(){Mn=0}function Bn(){this._call=this._time=this._next=null}function Hn(t,e,n){var r=new Bn;return r.restart(t,e,n),r}function Dn(){Mn=(Pn=On.now())+Un,En=Cn=0;try{!function(){zn(),++En;for(var t,e=$n;e;)(t=Mn-e._time)>=0&&e._call.call(void 0,t),e=e._next;--En}()}finally{En=0,function(){var t,e,n=$n,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:$n=e);An=t,In(r)}(),Mn=0}}function jn(){var t=On.now(),e=t-Pn;e>1e3&&(Un-=e,Pn=t)}function In(t){En||(Cn&&(Cn=clearTimeout(Cn)),t-Mn>24?(t<1/0&&(Cn=setTimeout(Dn,t-On.now()-Un)),Nn&&(Nn=clearInterval(Nn))):(Nn||(Pn=On.now(),Nn=setInterval(jn,1e3)),En=1,Tn(Dn)))}function Ln(t,e,n){var r=new Bn;return e=null==e?0:+e,r.restart(n=>{r.stop(),t(n+e)},e,n),r}Bn.prototype=Hn.prototype={constructor:Bn,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?zn():+n)+(null==e?0:+e),this._next||An===this||(An?An._next=this:$n=this,An=this),this._call=t,this._time=n,In()},stop:function(){this._call&&(this._call=null,this._time=1/0,In())}};var qn=pt("start","end","cancel","interrupt"),Vn=[];function Fn(t,e,n,r,i,o){var s=t.__transition;if(s){if(n in s)return}else t.__transition={};!function(t,e,n){var r,i=t.__transition;function o(t){n.state=1,n.timer.restart(s,n.delay,n.time),n.delay<=t&&s(t-n.delay)}function s(o){var u,h,c,d;if(1!==n.state)return l();for(u in i)if((d=i[u]).name===n.name){if(3===d.state)return Ln(s);4===d.state?(d.state=6,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete i[u]):+u<e&&(d.state=6,d.timer.stop(),d.on.call("cancel",t,t.__data__,d.index,d.group),delete i[u])}if(Ln(function(){3===n.state&&(n.state=4,n.timer.restart(a,n.delay,n.time),a(o))}),n.state=2,n.on.call("start",t,t.__data__,n.index,n.group),2===n.state){for(n.state=3,r=new Array(c=n.tween.length),u=0,h=-1;u<c;++u)(d=n.tween[u].value.call(t,t.__data__,n.index,n.group))&&(r[++h]=d);r.length=h+1}}function a(e){for(var i=e<n.duration?n.ease.call(null,e/n.duration):(n.timer.restart(l),n.state=5,1),o=-1,s=r.length;++o<s;)r[o].call(t,i);5===n.state&&(n.on.call("end",t,t.__data__,n.index,n.group),l())}function l(){for(var r in n.state=6,n.timer.stop(),delete i[e],i)return;delete t.__transition}i[e]=n,n.timer=Hn(o,0,n.time)}(t,n,{name:e,index:r,group:i,on:qn,tween:Vn,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:0})}function Xn(t,e){var n=Wn(t,e);if(n.state>0)throw new Error("too late; already scheduled");return n}function Yn(t,e){var n=Wn(t,e);if(n.state>3)throw new Error("too late; already running");return n}function Wn(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Gn(t,e){var n,r;return function(){var i=Yn(this,t),o=i.tween;if(o!==n)for(var s=0,a=(r=n=o).length;s<a;++s)if(r[s].name===e){(r=r.slice()).splice(s,1);break}i.tween=r}}function Kn(t,e,n){var r,i;if("function"!=typeof n)throw new Error;return function(){var o=Yn(this,t),s=o.tween;if(s!==r){i=(r=s).slice();for(var a={name:e,value:n},l=0,u=i.length;l<u;++l)if(i[l].name===e){i[l]=a;break}l===u&&i.push(a)}o.tween=i}}function Jn(t,e,n){var r=t._id;return t.each(function(){var t=Yn(this,r);(t.value||(t.value={}))[e]=n.apply(this,arguments)}),function(t){return Wn(t,r).value[e]}}function Zn(t,e){var n;return("number"==typeof e?fn:e instanceof Ye?pn:(n=Ye(e))?(e=n,pn):gn)(t,e)}function Qn(t){return function(){this.removeAttribute(t)}}function tr(t){return function(){this.removeAttributeNS(t.space,t.local)}}function er(t,e,n){var r,i,o=n+"";return function(){var s=this.getAttribute(t);return s===o?null:s===r?i:i=e(r=s,n)}}function nr(t,e,n){var r,i,o=n+"";return function(){var s=this.getAttributeNS(t.space,t.local);return s===o?null:s===r?i:i=e(r=s,n)}}function rr(t,e,n){var r,i,o;return function(){var s,a,l=n(this);if(null!=l)return(s=this.getAttribute(t))===(a=l+"")?null:s===r&&a===i?o:(i=a,o=e(r=s,l));this.removeAttribute(t)}}function ir(t,e,n){var r,i,o;return function(){var s,a,l=n(this);if(null!=l)return(s=this.getAttributeNS(t.space,t.local))===(a=l+"")?null:s===r&&a===i?o:(i=a,o=e(r=s,l));this.removeAttributeNS(t.space,t.local)}}function or(t,e){var n,r;function i(){var i=e.apply(this,arguments);return i!==r&&(n=(r=i)&&function(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}(t,i)),n}return i._value=e,i}function sr(t,e){var n,r;function i(){var i=e.apply(this,arguments);return i!==r&&(n=(r=i)&&function(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}(t,i)),n}return i._value=e,i}function ar(t,e){return function(){Xn(this,t).delay=+e.apply(this,arguments)}}function lr(t,e){return e=+e,function(){Xn(this,t).delay=e}}function ur(t,e){return function(){Yn(this,t).duration=+e.apply(this,arguments)}}function hr(t,e){return e=+e,function(){Yn(this,t).duration=e}}var cr=Ce.prototype.constructor;function dr(t){return function(){this.style.removeProperty(t)}}var pr=0;function fr(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function br(){return++pr}var mr=Ce.prototype;fr.prototype={constructor:fr,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=At(t));for(var r=this._groups,i=r.length,o=new Array(i),s=0;s<i;++s)for(var a,l,u=r[s],h=u.length,c=o[s]=new Array(h),d=0;d<h;++d)(a=u[d])&&(l=t.call(a,a.__data__,d,u))&&("__data__"in a&&(l.__data__=a.__data__),c[d]=l,Fn(c[d],e,n,d,c,Wn(a,n)));return new fr(o,this._parents,e,n)},selectAll:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=St(t));for(var r=this._groups,i=r.length,o=[],s=[],a=0;a<i;++a)for(var l,u=r[a],h=u.length,c=0;c<h;++c)if(l=u[c]){for(var d,p=t.call(l,l.__data__,c,u),f=Wn(l,n),b=0,m=p.length;b<m;++b)(d=p[b])&&Fn(d,e,n,b,p,f);o.push(p),s.push(l)}return new fr(o,s,e,n)},selectChild:mr.selectChild,selectChildren:mr.selectChildren,filter:function(t){"function"!=typeof t&&(t=Ct(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o,s=e[i],a=s.length,l=r[i]=[],u=0;u<a;++u)(o=s[u])&&t.call(o,o.__data__,u,s)&&l.push(o);return new fr(r,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,o=Math.min(r,i),s=new Array(r),a=0;a<o;++a)for(var l,u=e[a],h=n[a],c=u.length,d=s[a]=new Array(c),p=0;p<c;++p)(l=u[p]||h[p])&&(d[p]=l);for(;a<r;++a)s[a]=e[a];return new fr(s,this._parents,this._name,this._id)},selection:function(){return new cr(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,n=br(),r=this._groups,i=r.length,o=0;o<i;++o)for(var s,a=r[o],l=a.length,u=0;u<l;++u)if(s=a[u]){var h=Wn(s,e);Fn(s,t,n,u,a,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new fr(r,this._parents,t,n)},call:mr.call,nodes:mr.nodes,node:mr.node,size:mr.size,empty:mr.empty,each:mr.each,on:function(t,e){var n=this._id;return arguments.length<2?Wn(this.node(),n).on.on(t):this.each(function(t,e,n){var r,i,o=function(t){return(t+"").trim().split(/^|\s+/).every(function(t){var e=t.indexOf(".");return e>=0&&(t=t.slice(0,e)),!t||"start"===t})}(e)?Xn:Yn;return function(){var s=o(this,t),a=s.on;a!==r&&(i=(r=a).copy()).on(e,n),s.on=i}}(n,t,e))},attr:function(t,e){var n=vt(t),r="transform"===n?Sn:Zn;return this.attrTween(t,"function"==typeof e?(n.local?ir:rr)(n,r,Jn(this,"attr."+t,e)):null==e?(n.local?tr:Qn)(n):(n.local?nr:er)(n,r,e))},attrTween:function(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;var r=vt(t);return this.tween(n,(r.local?or:sr)(r,e))},style:function(t,e,n){var r="transform"==(t+="")?kn:Zn;return null==e?this.styleTween(t,function(t,e){var n,r,i;return function(){var o=Jt(this,t),s=(this.style.removeProperty(t),Jt(this,t));return o===s?null:o===n&&s===r?i:i=e(n=o,r=s)}}(t,r)).on("end.style."+t,dr(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var r,i,o;return function(){var s=Jt(this,t),a=n(this),l=a+"";return null==a&&(this.style.removeProperty(t),l=a=Jt(this,t)),s===l?null:s===r&&l===i?o:(i=l,o=e(r=s,a))}}(t,r,Jn(this,"style."+t,e))).each(function(t,e){var n,r,i,o,s="style."+e,a="end."+s;return function(){var l=Yn(this,t),u=l.on,h=null==l.value[s]?o||(o=dr(e)):void 0;u===n&&i===h||(r=(n=u).copy()).on(a,i=h),l.on=r}}(this._id,t)):this.styleTween(t,function(t,e,n){var r,i,o=n+"";return function(){var s=Jt(this,t);return s===o?null:s===r?i:i=e(r=s,n)}}(t,r,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!=typeof e)throw new Error;return this.tween(r,function(t,e,n){var r,i;function o(){var o=e.apply(this,arguments);return o!==i&&(r=(i=o)&&function(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}(t,o,n)),r}return o._value=e,o}(t,e,null==n?"":n))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=null==e?"":e}}(Jn(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,function(t){var e,n;function r(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&function(t){return function(e){this.textContent=t.call(this,e)}}(r)),e}return r._value=t,r}(t))},remove:function(){return this.on("end.remove",function(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}(this._id))},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r,i=Wn(this.node(),n).tween,o=0,s=i.length;o<s;++o)if((r=i[o]).name===t)return r.value;return null}return this.each((null==e?Gn:Kn)(n,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?ar:lr)(e,t)):Wn(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?ur:hr)(e,t)):Wn(this.node(),e).duration},ease:function(t){var e=this._id;return arguments.length?this.each(function(t,e){if("function"!=typeof e)throw new Error;return function(){Yn(this,t).ease=e}}(e,t)):Wn(this.node(),e).ease},easeVarying:function(t){if("functio