UNPKG

plotly.js

Version:

The open source javascript graphing library that powers plotly

18 lines 5.19 MB
/** * plotly.js (strict - minified) v3.5.0 * Copyright 2012-2026, Plotly, Inc. * All rights reserved. * Licensed under the MIT license */ ( function(root, factory) { if (typeof module === "object" && module.exports) { module.exports = factory(); } else { root.moduleName = factory(); } } (typeof self !== "undefined" ? self : this, () => { "use strict";var Plotly=(()=>{var ort=Object.create;var DM=Object.defineProperty,srt=Object.defineProperties,lrt=Object.getOwnPropertyDescriptor,urt=Object.getOwnPropertyDescriptors,frt=Object.getOwnPropertyNames,vL=Object.getOwnPropertySymbols,crt=Object.getPrototypeOf,DB=Object.prototype.hasOwnProperty,Eee=Object.prototype.propertyIsEnumerable;var Mee=(e,t,r)=>t in e?DM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,_m=(e,t)=>{for(var r in t||(t={}))DB.call(t,r)&&Mee(e,r,t[r]);if(vL)for(var r of vL(t))Eee.call(t,r)&&Mee(e,r,t[r]);return e},W1=(e,t)=>srt(e,urt(t));var kee=(e,t)=>{var r={};for(var n in e)DB.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&vL)for(var n of vL(e))t.indexOf(n)<0&&Eee.call(e,n)&&(r[n]=e[n]);return r};var tc=(e,t)=>()=>(e&&(t=e(e=0)),t);var we=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Cee=(e,t)=>{for(var r in t)DM(e,r,{get:t[r],enumerable:!0})},Lee=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of frt(t))!DB.call(e,i)&&i!==r&&DM(e,i,{get:()=>t[i],enumerable:!(n=lrt(t,i))||n.enumerable});return e};var hrt=(e,t,r)=>(r=e!=null?ort(crt(e)):{},Lee(t||!e||!e.__esModule?DM(r,"default",{value:e,enumerable:!0}):r,e)),vb=e=>Lee(DM({},"__esModule",{value:!0}),e);var mL=we(Pee=>{"use strict";Pee.version="3.5.0"});var Iee=we((zee,yL)=>{(function(t,r,n){r[t]=r[t]||n(),typeof yL!="undefined"&&yL.exports&&(yL.exports=r[t])})("Promise",typeof window!="undefined"?window:zee,function(){"use strict";var t,r,n,i=Object.prototype.toString,a=typeof setImmediate!="undefined"?function(C){return setImmediate(C)}:setTimeout;try{Object.defineProperty({},"x",{}),t=function(C,M,A,L){return Object.defineProperty(C,M,{value:A,writable:!0,configurable:L!==!1})}}catch(m){t=function(M,A,L){return M[A]=L,M}}n=function(){var C,M,A;function L(x,k){this.fn=x,this.self=k,this.next=void 0}return{add:function(k,S){A=new L(k,S),M?M.next=A:C=A,M=A,A=void 0},drain:function(){var k=C;for(C=M=r=void 0;k;)k.fn.call(k.self),k=k.next}}}();function o(m,C){n.add(m,C),r||(r=a(n.drain))}function s(m){var C,M=typeof m;return m!=null&&(M=="object"||M=="function")&&(C=m.then),typeof C=="function"?C:!1}function u(){for(var m=0;m<this.chain.length;m++)l(this,this.state===1?this.chain[m].success:this.chain[m].failure,this.chain[m]);this.chain.length=0}function l(m,C,M){var A,L;try{C===!1?M.reject(m.msg):(C===!0?A=m.msg:A=C.call(void 0,m.msg),A===M.promise?M.reject(TypeError("Promise-chain cycle")):(L=s(A))?L.call(A,M.resolve,M.reject):M.resolve(A))}catch(x){M.reject(x)}}function f(m){var C,M=this;if(!M.triggered){M.triggered=!0,M.def&&(M=M.def);try{(C=s(m))?o(function(){var A=new d(M);try{C.call(m,function(){f.apply(A,arguments)},function(){c.apply(A,arguments)})}catch(L){c.call(A,L)}}):(M.msg=m,M.state=1,M.chain.length>0&&o(u,M))}catch(A){c.call(new d(M),A)}}}function c(m){var C=this;C.triggered||(C.triggered=!0,C.def&&(C=C.def),C.msg=m,C.state=2,C.chain.length>0&&o(u,C))}function h(m,C,M,A){for(var L=0;L<C.length;L++)(function(k){m.resolve(C[k]).then(function(v){M(k,v)},A)})(L)}function d(m){this.def=m,this.triggered=!1}function p(m){this.promise=m,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function y(m){if(typeof m!="function")throw TypeError("Not a function");if(this.__NPO__!==0)throw TypeError("Not a promise");this.__NPO__=1;var C=new p(this);this.then=function(A,L){var x={success:typeof A=="function"?A:!0,failure:typeof L=="function"?L:!1};return x.promise=new this.constructor(function(S,v){if(typeof S!="function"||typeof v!="function")throw TypeError("Not a function");x.resolve=S,x.reject=v}),C.chain.push(x),C.state!==0&&o(u,C),x.promise},this.catch=function(A){return this.then(void 0,A)};try{m.call(void 0,function(A){f.call(C,A)},function(A){c.call(C,A)})}catch(M){c.call(C,M)}}var b=t({},"constructor",y,!1);return y.prototype=b,t(b,"__NPO__",0,!1),t(y,"resolve",function(C){var M=this;return C&&typeof C=="object"&&C.__NPO__===1?C:new M(function(L,x){if(typeof L!="function"||typeof x!="function")throw TypeError("Not a function");L(C)})}),t(y,"reject",function(C){return new this(function(A,L){if(typeof A!="function"||typeof L!="function")throw TypeError("Not a function");L(C)})}),t(y,"all",function(C){var M=this;return i.call(C)!="[object Array]"?M.reject(TypeError("Not an array")):C.length===0?M.resolve([]):new M(function(L,x){if(typeof L!="function"||typeof x!="function")throw TypeError("Not a function");var k=C.length,S=Array(k),v=0;h(M,C,function(E,O){S[E]=O,++v===k&&L(S)},x)})}),t(y,"race",function(C){var M=this;return i.call(C)!="[object Array]"?M.reject(TypeError("Not an array")):new M(function(L,x){if(typeof L!="function"||typeof x!="function")throw TypeError("Not a function");h(M,C,function(S,v){L(v)},x)})}),y})});var Jl=we((Xir,gL)=>{(function(){var e={version:"3.8.2"},t=[].slice,r=function(Z){return t.call(Z)},n=self.document;function i(Z){return Z&&(Z.ownerDocument||Z.document||Z).documentElement}function a(Z){return Z&&(Z.ownerDocument&&Z.ownerDocument.defaultView||Z.document&&Z||Z.defaultView)}if(n)try{r(n.documentElement.childNodes)[0].nodeType}catch(Z){r=function(le){for(var Ce=le.length,Ye=new Array(Ce);Ce--;)Ye[Ce]=le[Ce];return Ye}}if(Date.now||(Date.now=function(){return+new Date}),n)try{n.createElement("DIV").style.setProperty("opacity",0,"")}catch(Z){var o=this.Element.prototype,s=o.setAttribute,u=o.setAttributeNS,l=this.CSSStyleDeclaration.prototype,f=l.setProperty;o.setAttribute=function(le,Ce){s.call(this,le,Ce+"")},o.setAttributeNS=function(le,Ce,Ye){u.call(this,le,Ce,Ye+"")},l.setProperty=function(le,Ce,Ye){f.call(this,le,Ce+"",Ye)}}e.ascending=c;function c(Z,le){return Z<le?-1:Z>le?1:Z>=le?0:NaN}e.descending=function(Z,le){return le<Z?-1:le>Z?1:le>=Z?0:NaN},e.min=function(Z,le){var Ce=-1,Ye=Z.length,it,ut;if(arguments.length===1){for(;++Ce<Ye;)if((ut=Z[Ce])!=null&&ut>=ut){it=ut;break}for(;++Ce<Ye;)(ut=Z[Ce])!=null&&it>ut&&(it=ut)}else{for(;++Ce<Ye;)if((ut=le.call(Z,Z[Ce],Ce))!=null&&ut>=ut){it=ut;break}for(;++Ce<Ye;)(ut=le.call(Z,Z[Ce],Ce))!=null&&it>ut&&(it=ut)}return it},e.max=function(Z,le){var Ce=-1,Ye=Z.length,it,ut;if(arguments.length===1){for(;++Ce<Ye;)if((ut=Z[Ce])!=null&&ut>=ut){it=ut;break}for(;++Ce<Ye;)(ut=Z[Ce])!=null&&ut>it&&(it=ut)}else{for(;++Ce<Ye;)if((ut=le.call(Z,Z[Ce],Ce))!=null&&ut>=ut){it=ut;break}for(;++Ce<Ye;)(ut=le.call(Z,Z[Ce],Ce))!=null&&ut>it&&(it=ut)}return it},e.extent=function(Z,le){var Ce=-1,Ye=Z.length,it,ut,Ht;if(arguments.length===1){for(;++Ce<Ye;)if((ut=Z[Ce])!=null&&ut>=ut){it=Ht=ut;break}for(;++Ce<Ye;)(ut=Z[Ce])!=null&&(it>ut&&(it=ut),Ht<ut&&(Ht=ut))}else{for(;++Ce<Ye;)if((ut=le.call(Z,Z[Ce],Ce))!=null&&ut>=ut){it=Ht=ut;break}for(;++Ce<Ye;)(ut=le.call(Z,Z[Ce],Ce))!=null&&(it>ut&&(it=ut),Ht<ut&&(Ht=ut))}return[it,Ht]};function h(Z){return Z===null?NaN:+Z}function d(Z){return!isNaN(Z)}e.sum=function(Z,le){var Ce=0,Ye=Z.length,it,ut=-1;if(arguments.length===1)for(;++ut<Ye;)d(it=+Z[ut])&&(Ce+=it);else for(;++ut<Ye;)d(it=+le.call(Z,Z[ut],ut))&&(Ce+=it);return Ce},e.mean=function(Z,le){var Ce=0,Ye=Z.length,it,ut=-1,Ht=Ye;if(arguments.length===1)for(;++ut<Ye;)d(it=h(Z[ut]))?Ce+=it:--Ht;else for(;++ut<Ye;)d(it=h(le.call(Z,Z[ut],ut)))?Ce+=it:--Ht;if(Ht)return Ce/Ht},e.quantile=function(Z,le){var Ce=(Z.length-1)*le+1,Ye=Math.floor(Ce),it=+Z[Ye-1],ut=Ce-Ye;return ut?it+ut*(Z[Ye]-it):it},e.median=function(Z,le){var Ce=[],Ye=Z.length,it,ut=-1;if(arguments.length===1)for(;++ut<Ye;)d(it=h(Z[ut]))&&Ce.push(it);else for(;++ut<Ye;)d(it=h(le.call(Z,Z[ut],ut)))&&Ce.push(it);if(Ce.length)return e.quantile(Ce.sort(c),.5)},e.variance=function(Z,le){var Ce=Z.length,Ye=0,it,ut,Ht=0,wt=-1,lr=0;if(arguments.length===1)for(;++wt<Ce;)d(it=h(Z[wt]))&&(ut=it-Ye,Ye+=ut/++lr,Ht+=ut*(it-Ye));else for(;++wt<Ce;)d(it=h(le.call(Z,Z[wt],wt)))&&(ut=it-Ye,Ye+=ut/++lr,Ht+=ut*(it-Ye));if(lr>1)return Ht/(lr-1)},e.deviation=function(){var Z=e.variance.apply(this,arguments);return Z&&Math.sqrt(Z)};function p(Z){return{left:function(le,Ce,Ye,it){for(arguments.length<3&&(Ye=0),arguments.length<4&&(it=le.length);Ye<it;){var ut=Ye+it>>>1;Z(le[ut],Ce)<0?Ye=ut+1:it=ut}return Ye},right:function(le,Ce,Ye,it){for(arguments.length<3&&(Ye=0),arguments.length<4&&(it=le.length);Ye<it;){var ut=Ye+it>>>1;Z(le[ut],Ce)>0?it=ut:Ye=ut+1}return Ye}}}var y=p(c);e.bisectLeft=y.left,e.bisect=e.bisectRight=y.right,e.bisector=function(Z){return p(Z.length===1?function(le,Ce){return c(Z(le),Ce)}:Z)},e.shuffle=function(Z,le,Ce){(Ye=arguments.length)<3&&(Ce=Z.length,Ye<2&&(le=0));for(var Ye=Ce-le,it,ut;Ye;)ut=Math.random()*Ye--|0,it=Z[Ye+le],Z[Ye+le]=Z[ut+le],Z[ut+le]=it;return Z},e.permute=function(Z,le){for(var Ce=le.length,Ye=new Array(Ce);Ce--;)Ye[Ce]=Z[le[Ce]];return Ye},e.pairs=function(Z){for(var le=0,Ce=Z.length-1,Ye,it=Z[0],ut=new Array(Ce<0?0:Ce);le<Ce;)ut[le]=[Ye=it,it=Z[++le]];return ut},e.transpose=function(Z){if(!(ut=Z.length))return[];for(var le=-1,Ce=e.min(Z,b),Ye=new Array(Ce);++le<Ce;)for(var it=-1,ut,Ht=Ye[le]=new Array(ut);++it<ut;)Ht[it]=Z[it][le];return Ye};function b(Z){return Z.length}e.zip=function(){return e.transpose(arguments)},e.keys=function(Z){var le=[];for(var Ce in Z)le.push(Ce);return le},e.values=function(Z){var le=[];for(var Ce in Z)le.push(Z[Ce]);return le},e.entries=function(Z){var le=[];for(var Ce in Z)le.push({key:Ce,value:Z[Ce]});return le},e.merge=function(Z){for(var le=Z.length,Ce,Ye=-1,it=0,ut,Ht;++Ye<le;)it+=Z[Ye].length;for(ut=new Array(it);--le>=0;)for(Ht=Z[le],Ce=Ht.length;--Ce>=0;)ut[--it]=Ht[Ce];return ut};var m=Math.abs;e.range=function(Z,le,Ce){if(arguments.length<3&&(Ce=1,arguments.length<2&&(le=Z,Z=0)),(le-Z)/Ce===1/0)throw new Error("infinite range");var Ye=[],it=C(m(Ce)),ut=-1,Ht;if(Z*=it,le*=it,Ce*=it,Ce<0)for(;(Ht=Z+Ce*++ut)>le;)Ye.push(Ht/it);else for(;(Ht=Z+Ce*++ut)<le;)Ye.push(Ht/it);return Ye};function C(Z){for(var le=1;Z*le%1;)le*=10;return le}function M(Z,le){for(var Ce in le)Object.defineProperty(Z.prototype,Ce,{value:le[Ce],enumerable:!1})}e.map=function(Z,le){var Ce=new A;if(Z instanceof A)Z.forEach(function(wt,lr){Ce.set(wt,lr)});else if(Array.isArray(Z)){var Ye=-1,it=Z.length,ut;if(arguments.length===1)for(;++Ye<it;)Ce.set(Ye,Z[Ye]);else for(;++Ye<it;)Ce.set(le.call(Z,ut=Z[Ye],Ye),ut)}else for(var Ht in Z)Ce.set(Ht,Z[Ht]);return Ce};function A(){this._=Object.create(null)}var L="__proto__",x="\0";M(A,{has:v,get:function(Z){return this._[k(Z)]},set:function(Z,le){return this._[k(Z)]=le},remove:P,keys:E,values:function(){var Z=[];for(var le in this._)Z.push(this._[le]);return Z},entries:function(){var Z=[];for(var le in this._)Z.push({key:S(le),value:this._[le]});return Z},size:O,empty:F,forEach:function(Z){for(var le in this._)Z.call(this,S(le),this._[le])}});function k(Z){return(Z+="")===L||Z[0]===x?x+Z:Z}function S(Z){return(Z+="")[0]===x?Z.slice(1):Z}function v(Z){return k(Z)in this._}function P(Z){return(Z=k(Z))in this._&&delete this._[Z]}function E(){var Z=[];for(var le in this._)Z.push(S(le));return Z}function O(){var Z=0;for(var le in this._)++Z;return Z}function F(){for(var Z in this._)return!1;return!0}e.nest=function(){var Z={},le=[],Ce=[],Ye,it;function ut(wt,lr,Cr){if(Cr>=le.length)return it?it.call(Z,lr):Ye?lr.sort(Ye):lr;for(var zr=-1,ui=lr.length,$r=le[Cr++],Oi,un,pi,Pi=new A,ji;++zr<ui;)(ji=Pi.get(Oi=$r(un=lr[zr])))?ji.push(un):Pi.set(Oi,[un]);return wt?(un=wt(),pi=function(pn,an){un.set(pn,ut(wt,an,Cr))}):(un={},pi=function(pn,an){un[pn]=ut(wt,an,Cr)}),Pi.forEach(pi),un}function Ht(wt,lr){if(lr>=le.length)return wt;var Cr=[],zr=Ce[lr++];return wt.forEach(function(ui,$r){Cr.push({key:ui,values:Ht($r,lr)})}),zr?Cr.sort(function(ui,$r){return zr(ui.key,$r.key)}):Cr}return Z.map=function(wt,lr){return ut(lr,wt,0)},Z.entries=function(wt){return Ht(ut(e.map,wt,0),0)},Z.key=function(wt){return le.push(wt),Z},Z.sortKeys=function(wt){return Ce[le.length-1]=wt,Z},Z.sortValues=function(wt){return Ye=wt,Z},Z.rollup=function(wt){return it=wt,Z},Z},e.set=function(Z){var le=new U;if(Z)for(var Ce=0,Ye=Z.length;Ce<Ye;++Ce)le.add(Z[Ce]);return le};function U(){this._=Object.create(null)}M(U,{has:v,add:function(Z){return this._[k(Z+="")]=!0,Z},remove:P,values:E,size:O,empty:F,forEach:function(Z){for(var le in this._)Z.call(this,S(le))}}),e.behavior={};function G(Z){return Z}e.rebind=function(Z,le){for(var Ce=1,Ye=arguments.length,it;++Ce<Ye;)Z[it=arguments[Ce]]=j(Z,le,le[it]);return Z};function j(Z,le,Ce){return function(){var Ye=Ce.apply(le,arguments);return Ye===le?Z:Ye}}function W(Z,le){if(le in Z)return le;le=le.charAt(0).toUpperCase()+le.slice(1);for(var Ce=0,Ye=N.length;Ce<Ye;++Ce){var it=N[Ce]+le;if(it in Z)return it}}var N=["webkit","ms","moz","Moz","o","O"];function H(){}e.dispatch=function(){for(var Z=new re,le=-1,Ce=arguments.length;++le<Ce;)Z[arguments[le]]=ae(Z);return Z};function re(){}re.prototype.on=function(Z,le){var Ce=Z.indexOf("."),Ye="";if(Ce>=0&&(Ye=Z.slice(Ce+1),Z=Z.slice(0,Ce)),Z)return arguments.length<2?this[Z].on(Ye):this[Z].on(Ye,le);if(arguments.length===2){if(le==null)for(Z in this)this.hasOwnProperty(Z)&&this[Z].on(Ye,null);return this}};function ae(Z){var le=[],Ce=new A;function Ye(){for(var it=le,ut=-1,Ht=it.length,wt;++ut<Ht;)(wt=it[ut].on)&&wt.apply(this,arguments);return Z}return Ye.on=function(it,ut){var Ht=Ce.get(it),wt;return arguments.length<2?Ht&&Ht.on:(Ht&&(Ht.on=null,le=le.slice(0,wt=le.indexOf(Ht)).concat(le.slice(wt+1)),Ce.remove(it)),ut&&le.push(Ce.set(it,{on:ut})),Z)},Ye}e.event=null;function me(){e.event.preventDefault()}function Le(){for(var Z=e.event,le;le=Z.sourceEvent;)Z=le;return Z}function ke(Z){for(var le=new re,Ce=0,Ye=arguments.length;++Ce<Ye;)le[arguments[Ce]]=ae(le);return le.of=function(it,ut){return function(Ht){try{var wt=Ht.sourceEvent=e.event;Ht.target=Z,e.event=Ht,le[Ht.type].apply(it,ut)}finally{e.event=wt}}},le}e.requote=function(Z){return Z.replace(de,"\\$&")};var de=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,te={}.__proto__?function(Z,le){Z.__proto__=le}:function(Z,le){for(var Ce in le)Z[Ce]=le[Ce]};function Se(Z){return te(Z,Ie),Z}var Te=function(Z,le){return le.querySelector(Z)},be=function(Z,le){return le.querySelectorAll(Z)},Ve=function(Z,le){var Ce=Z.matches||Z[W(Z,"matchesSelector")];return Ve=function(Ye,it){return Ce.call(Ye,it)},Ve(Z,le)};typeof Sizzle=="function"&&(Te=function(Z,le){return Sizzle(Z,le)[0]||null},be=Sizzle,Ve=Sizzle.matchesSelector),e.selection=function(){return e.select(n.documentElement)};var Ie=e.selection.prototype=[];Ie.select=function(Z){var le=[],Ce,Ye,it,ut;Z=ge(Z);for(var Ht=-1,wt=this.length;++Ht<wt;){le.push(Ce=[]),Ce.parentNode=(it=this[Ht]).parentNode;for(var lr=-1,Cr=it.length;++lr<Cr;)(ut=it[lr])?(Ce.push(Ye=Z.call(ut,ut.__data__,lr,Ht)),Ye&&"__data__"in ut&&(Ye.__data__=ut.__data__)):Ce.push(null)}return Se(le)};function ge(Z){return typeof Z=="function"?Z:function(){return Te(Z,this)}}Ie.selectAll=function(Z){var le=[],Ce,Ye;Z=qe(Z);for(var it=-1,ut=this.length;++it<ut;)for(var Ht=this[it],wt=-1,lr=Ht.length;++wt<lr;)(Ye=Ht[wt])&&(le.push(Ce=r(Z.call(Ye,Ye.__data__,wt,it))),Ce.parentNode=Ye);return Se(le)};function qe(Z){return typeof Z=="function"?Z:function(){return be(Z,this)}}var ce="http://www.w3.org/1999/xhtml",Xe={svg:"http://www.w3.org/2000/svg",xhtml:ce,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};e.ns={prefix:Xe,qualify:function(Z){var le=Z.indexOf(":"),Ce=Z;return le>=0&&(Ce=Z.slice(0,le))!=="xmlns"&&(Z=Z.slice(le+1)),Xe.hasOwnProperty(Ce)?{space:Xe[Ce],local:Z}:Z}},Ie.attr=function(Z,le){if(arguments.length<2){if(typeof Z=="string"){var Ce=this.node();return Z=e.ns.qualify(Z),Z.local?Ce.getAttributeNS(Z.space,Z.local):Ce.getAttribute(Z)}for(le in Z)this.each(rt(le,Z[le]));return this}return this.each(rt(Z,le))};function rt(Z,le){Z=e.ns.qualify(Z);function Ce(){this.removeAttribute(Z)}function Ye(){this.removeAttributeNS(Z.space,Z.local)}function it(){this.setAttribute(Z,le)}function ut(){this.setAttributeNS(Z.space,Z.local,le)}function Ht(){var lr=le.apply(this,arguments);lr==null?this.removeAttribute(Z):this.setAttribute(Z,lr)}function wt(){var lr=le.apply(this,arguments);lr==null?this.removeAttributeNS(Z.space,Z.local):this.setAttributeNS(Z.space,Z.local,lr)}return le==null?Z.local?Ye:Ce:typeof le=="function"?Z.local?wt:Ht:Z.local?ut:it}function bt(Z){return Z.trim().replace(/\s+/g," ")}Ie.classed=function(Z,le){if(arguments.length<2){if(typeof Z=="string"){var Ce=this.node(),Ye=(Z=ot(Z)).length,it=-1;if(le=Ce.classList){for(;++it<Ye;)if(!le.contains(Z[it]))return!1}else for(le=Ce.getAttribute("class");++it<Ye;)if(!Ot(Z[it]).test(le))return!1;return!0}for(le in Z)this.each(Ke(le,Z[le]));return this}return this.each(Ke(Z,le))};function Ot(Z){return new RegExp("(?:^|\\s+)"+e.requote(Z)+"(?:\\s+|$)","g")}function ot(Z){return(Z+"").trim().split(/^|\s+/)}function Ke(Z,le){Z=ot(Z).map(Pt);var Ce=Z.length;function Ye(){for(var ut=-1;++ut<Ce;)Z[ut](this,le)}function it(){for(var ut=-1,Ht=le.apply(this,arguments);++ut<Ce;)Z[ut](this,Ht)}return typeof le=="function"?it:Ye}function Pt(Z){var le=Ot(Z);return function(Ce,Ye){if(it=Ce.classList)return Ye?it.add(Z):it.remove(Z);var it=Ce.getAttribute("class")||"";Ye?(le.lastIndex=0,le.test(it)||Ce.setAttribute("class",bt(it+" "+Z))):Ce.setAttribute("class",bt(it.replace(le," ")))}}Ie.style=function(Z,le,Ce){var Ye=arguments.length;if(Ye<3){if(typeof Z!="string"){Ye<2&&(le="");for(Ce in Z)this.each(Et(Ce,Z[Ce],le));return this}if(Ye<2){var it=this.node();return a(it).getComputedStyle(it,null).getPropertyValue(Z)}Ce=""}return this.each(Et(Z,le,Ce))};function Et(Z,le,Ce){function Ye(){this.style.removeProperty(Z)}function it(){this.style.setProperty(Z,le,Ce)}function ut(){var Ht=le.apply(this,arguments);Ht==null?this.style.removeProperty(Z):this.style.setProperty(Z,Ht,Ce)}return le==null?Ye:typeof le=="function"?ut:it}Ie.property=function(Z,le){if(arguments.length<2){if(typeof Z=="string")return this.node()[Z];for(le in Z)this.each(kt(le,Z[le]));return this}return this.each(kt(Z,le))};function kt(Z,le){function Ce(){delete this[Z]}function Ye(){this[Z]=le}function it(){var ut=le.apply(this,arguments);ut==null?delete this[Z]:this[Z]=ut}return le==null?Ce:typeof le=="function"?it:Ye}Ie.text=function(Z){return arguments.length?this.each(typeof Z=="function"?function(){var le=Z.apply(this,arguments);this.textContent=le==null?"":le}:Z==null?function(){this.textContent=""}:function(){this.textContent=Z}):this.node().textContent},Ie.html=function(Z){return arguments.length?this.each(typeof Z=="function"?function(){var le=Z.apply(this,arguments);this.innerHTML=le==null?"":le}:Z==null?function(){this.innerHTML=""}:function(){this.innerHTML=Z}):this.node().innerHTML},Ie.append=function(Z){return Z=$e(Z),this.select(function(){return this.appendChild(Z.apply(this,arguments))})};function $e(Z){function le(){var Ye=this.ownerDocument,it=this.namespaceURI;return it===ce&&Ye.documentElement.namespaceURI===ce?Ye.createElement(Z):Ye.createElementNS(it,Z)}function Ce(){return this.ownerDocument.createElementNS(Z.space,Z.local)}return typeof Z=="function"?Z:(Z=e.ns.qualify(Z)).local?Ce:le}Ie.insert=function(Z,le){return Z=$e(Z),le=ge(le),this.select(function(){return this.insertBefore(Z.apply(this,arguments),le.apply(this,arguments)||null)})},Ie.remove=function(){return this.each(De)};function De(){var Z=this.parentNode;Z&&Z.removeChild(this)}Ie.data=function(Z,le){var Ce=-1,Ye=this.length,it,ut;if(!arguments.length){for(Z=new Array(Ye=(it=this[0]).length);++Ce<Ye;)(ut=it[Ce])&&(Z[Ce]=ut.__data__);return Z}function Ht(zr,ui){var $r,Oi=zr.length,un=ui.length,pi=Math.min(Oi,un),Pi=new Array(un),ji=new Array(un),pn=new Array(Oi),an,bi;if(le){var xo=new A,no=new Array(Oi),Xo;for($r=-1;++$r<Oi;)(an=zr[$r])&&(xo.has(Xo=le.call(an,an.__data__,$r))?pn[$r]=an:xo.set(Xo,an),no[$r]=Xo);for($r=-1;++$r<un;)(an=xo.get(Xo=le.call(ui,bi=ui[$r],$r)))?an!==!0&&(Pi[$r]=an,an.__data__=bi):ji[$r]=Me(bi),xo.set(Xo,!0);for($r=-1;++$r<Oi;)$r in no&&xo.get(no[$r])!==!0&&(pn[$r]=zr[$r])}else{for($r=-1;++$r<pi;)an=zr[$r],bi=ui[$r],an?(an.__data__=bi,Pi[$r]=an):ji[$r]=Me(bi);for(;$r<un;++$r)ji[$r]=Me(ui[$r]);for(;$r<Oi;++$r)pn[$r]=zr[$r]}ji.update=Pi,ji.parentNode=Pi.parentNode=pn.parentNode=zr.parentNode,wt.push(ji),lr.push(Pi),Cr.push(pn)}var wt=lt([]),lr=Se([]),Cr=Se([]);if(typeof Z=="function")for(;++Ce<Ye;)Ht(it=this[Ce],Z.call(it,it.parentNode.__data__,Ce));else for(;++Ce<Ye;)Ht(it=this[Ce],Z);return lr.enter=function(){return wt},lr.exit=function(){return Cr},lr};function Me(Z){return{__data__:Z}}Ie.datum=function(Z){return arguments.length?this.property("__data__",Z):this.property("__data__")},Ie.filter=function(Z){var le=[],Ce,Ye,it;typeof Z!="function"&&(Z=oe(Z));for(var ut=0,Ht=this.length;ut<Ht;ut++){le.push(Ce=[]),Ce.parentNode=(Ye=this[ut]).parentNode;for(var wt=0,lr=Ye.length;wt<lr;wt++)(it=Ye[wt])&&Z.call(it,it.__data__,wt,ut)&&Ce.push(it)}return Se(le)};function oe(Z){return function(){return Ve(this,Z)}}Ie.order=function(){for(var Z=-1,le=this.length;++Z<le;)for(var Ce=this[Z],Ye=Ce.length-1,it=Ce[Ye],ut;--Ye>=0;)(ut=Ce[Ye])&&(it&&it!==ut.nextSibling&&it.parentNode.insertBefore(ut,it),it=ut);return this},Ie.sort=function(Z){Z=Ne.apply(this,arguments);for(var le=-1,Ce=this.length;++le<Ce;)this[le].sort(Z);return this.order()};function Ne(Z){return arguments.length||(Z=c),function(le,Ce){return le&&Ce?Z(le.__data__,Ce.__data__):!le-!Ce}}Ie.each=function(Z){return vt(this,function(le,Ce,Ye){Z.call(le,le.__data__,Ce,Ye)})};function vt(Z,le){for(var Ce=0,Ye=Z.length;Ce<Ye;Ce++)for(var it=Z[Ce],ut=0,Ht=it.length,wt;ut<Ht;ut++)(wt=it[ut])&&le(wt,ut,Ce);return Z}Ie.call=function(Z){var le=r(arguments);return Z.apply(le[0]=this,le),this},Ie.empty=function(){return!this.node()},Ie.node=function(){for(var Z=0,le=this.length;Z<le;Z++)for(var Ce=this[Z],Ye=0,it=Ce.length;Ye<it;Ye++){var ut=Ce[Ye];if(ut)return ut}return null},Ie.size=function(){var Z=0;return vt(this,function(){++Z}),Z};function lt(Z){return te(Z,We),Z}var We=[];e.selection.enter=lt,e.selection.enter.prototype=We,We.append=Ie.append,We.empty=Ie.empty,We.node=Ie.node,We.call=Ie.call,We.size=Ie.size,We.select=function(Z){for(var le=[],Ce,Ye,it,ut,Ht,wt=-1,lr=this.length;++wt<lr;){it=(ut=this[wt]).update,le.push(Ce=[]),Ce.parentNode=ut.parentNode;for(var Cr=-1,zr=ut.length;++Cr<zr;)(Ht=ut[Cr])?(Ce.push(it[Cr]=Ye=Z.call(ut.parentNode,Ht.__data__,Cr,wt)),Ye.__data__=Ht.__data__):Ce.push(null)}return Se(le)},We.insert=function(Z,le){return arguments.length<2&&(le=Ge(this)),Ie.insert.call(this,Z,le)};function Ge(Z){var le,Ce;return function(Ye,it,ut){var Ht=Z[ut].update,wt=Ht.length,lr;for(ut!=Ce&&(Ce=ut,le=0),it>=le&&(le=it+1);!(lr=Ht[le])&&++le<wt;);return lr}}e.select=function(Z){var le;return typeof Z=="string"?(le=[Te(Z,n)],le.parentNode=n.documentElement):(le=[Z],le.parentNode=i(Z)),Se([le])},e.selectAll=function(Z){var le;return typeof Z=="string"?(le=r(be(Z,n)),le.parentNode=n.documentElement):(le=r(Z),le.parentNode=null),Se([le])},Ie.on=function(Z,le,Ce){var Ye=arguments.length;if(Ye<3){if(typeof Z!="string"){Ye<2&&(le=!1);for(Ce in Z)this.each(et(Ce,Z[Ce],le));return this}if(Ye<2)return(Ye=this.node()["__on"+Z])&&Ye._;Ce=!1}return this.each(et(Z,le,Ce))};function et(Z,le,Ce){var Ye="__on"+Z,it=Z.indexOf("."),ut=Lt;it>0&&(Z=Z.slice(0,it));var Ht=tt.get(Z);Ht&&(Z=Ht,ut=jt);function wt(){var zr=this[Ye];zr&&(this.removeEventListener(Z,zr,zr.$),delete this[Ye])}function lr(){var zr=ut(le,r(arguments));wt.call(this),this.addEventListener(Z,this[Ye]=zr,zr.$=Ce),zr._=le}function Cr(){var zr=new RegExp("^__on([^.]+)"+e.requote(Z)+"$"),ui;for(var $r in this)if(ui=$r.match(zr)){var Oi=this[$r];this.removeEventListener(ui[1],Oi,Oi.$),delete this[$r]}}return it?le?lr:wt:le?H:Cr}var tt=e.map({mouseenter:"mouseover",mouseleave:"mouseout"});n&&tt.forEach(function(Z){"on"+Z in n&&tt.remove(Z)});function Lt(Z,le){return function(Ce){var Ye=e.event;e.event=Ce,le[0]=this.__data__;try{Z.apply(this,le)}finally{e.event=Ye}}}function jt(Z,le){var Ce=Lt(Z,le);return function(Ye){var it=this,ut=Ye.relatedTarget;(!ut||ut!==it&&!(ut.compareDocumentPosition(it)&8))&&Ce.call(it,Ye)}}var sr,yr=0;function vr(Z){var le=".dragsuppress-"+ ++yr,Ce="click"+le,Ye=e.select(a(Z)).on("touchmove"+le,me).on("dragstart"+le,me).on("selectstart"+le,me);if(sr==null&&(sr="onselectstart"in Z?!1:W(Z.style,"userSelect")),sr){var it=i(Z).style,ut=it[sr];it[sr]="none"}return function(Ht){if(Ye.on(le,null),sr&&(it[sr]=ut),Ht){var wt=function(){Ye.on(Ce,null)};Ye.on(Ce,function(){me(),wt()},!0),setTimeout(wt,0)}}}e.mouse=function(Z){return Pe(Z,Le())};var Vt=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;function Pe(Z,le){le.changedTouches&&(le=le.changedTouches[0]);var Ce=Z.ownerSVGElement||Z;if(Ce.createSVGPoint){var Ye=Ce.createSVGPoint();if(Vt<0){var it=a(Z);if(it.scrollX||it.scrollY){Ce=e.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var ut=Ce[0][0].getScreenCTM();Vt=!(ut.f||ut.e),Ce.remove()}}return Vt?(Ye.x=le.pageX,Ye.y=le.pageY):(Ye.x=le.clientX,Ye.y=le.clientY),Ye=Ye.matrixTransform(Z.getScreenCTM().inverse()),[Ye.x,Ye.y]}var Ht=Z.getBoundingClientRect();return[le.clientX-Ht.left-Z.clientLeft,le.clientY-Ht.top-Z.clientTop]}e.touch=function(Z,le,Ce){if(arguments.length<3&&(Ce=le,le=Le().changedTouches),le){for(var Ye=0,it=le.length,ut;Ye<it;++Ye)if((ut=le[Ye]).identifier===Ce)return Pe(Z,ut)}},e.behavior.drag=function(){var Z=ke(it,"drag","dragstart","dragend"),le=null,Ce=ut(H,e.mouse,a,"mousemove","mouseup"),Ye=ut(xe,e.touch,G,"touchmove","touchend");function it(){this.on("mousedown.drag",Ce).on("touchstart.drag",Ye)}function ut(Ht,wt,lr,Cr,zr){return function(){var ui=this,$r=e.event.target.correspondingElement||e.event.target,Oi=ui.parentNode,un=Z.of(ui,arguments),pi=0,Pi=Ht(),ji=".drag"+(Pi==null?"":"-"+Pi),pn,an=e.select(lr($r)).on(Cr+ji,no).on(zr+ji,Xo),bi=vr($r),xo=wt(Oi,Pi);le?(pn=le.apply(ui,arguments),pn=[pn.x-xo[0],pn.y-xo[1]]):pn=[0,0],un({type:"dragstart"});function no(){var js=wt(Oi,Pi),El,Pl;js&&(El=js[0]-xo[0],Pl=js[1]-xo[1],pi|=El|Pl,xo=js,un({type:"drag",x:js[0]+pn[0],y:js[1]+pn[1],dx:El,dy:Pl}))}function Xo(){wt(Oi,Pi)&&(an.on(Cr+ji,null).on(zr+ji,null),bi(pi),un({type:"dragend"}))}}}return it.origin=function(Ht){return arguments.length?(le=Ht,it):le},e.rebind(it,Z,"on")};function xe(){return e.event.changedTouches[0].identifier}e.touches=function(Z,le){return arguments.length<2&&(le=Le().touches),le?r(le).map(function(Ce){var Ye=Pe(Z,Ce);return Ye.identifier=Ce.identifier,Ye}):[]};var Oe=1e-6,ze=Oe*Oe,Re=Math.PI,ht=2*Re,st=ht-Oe,gt=Re/2,xt=Re/180,pr=180/Re;function br(Z){return Z>0?1:Z<0?-1:0}function cr(Z,le,Ce){return(le[0]-Z[0])*(Ce[1]-Z[1])-(le[1]-Z[1])*(Ce[0]-Z[0])}function Er(Z){return Z>1?0:Z<-1?Re:Math.acos(Z)}function ii(Z){return Z>1?gt:Z<-1?-gt:Math.asin(Z)}function jr(Z){return((Z=Math.exp(Z))-1/Z)/2}function kr(Z){return((Z=Math.exp(Z))+1/Z)/2}function Vr(Z){return((Z=Math.exp(2*Z))-1)/(Z+1)}function Ai(Z){return(Z=Math.sin(Z/2))*Z}var Bi=Math.SQRT2,Di=2,ln=4;e.interpolateZoom=function(Z,le){var Ce=Z[0],Ye=Z[1],it=Z[2],ut=le[0],Ht=le[1],wt=le[2],lr=ut-Ce,Cr=Ht-Ye,zr=lr*lr+Cr*Cr,ui,$r;if(zr<ze)$r=Math.log(wt/it)/Bi,ui=function(pn){return[Ce+pn*lr,Ye+pn*Cr,it*Math.exp(Bi*pn*$r)]};else{var Oi=Math.sqrt(zr),un=(wt*wt-it*it+ln*zr)/(2*it*Di*Oi),pi=(wt*wt-it*it-ln*zr)/(2*wt*Di*Oi),Pi=Math.log(Math.sqrt(un*un+1)-un),ji=Math.log(Math.sqrt(pi*pi+1)-pi);$r=(ji-Pi)/Bi,ui=function(pn){var an=pn*$r,bi=kr(Pi),xo=it/(Di*Oi)*(bi*Vr(Bi*an+Pi)-jr(Pi));return[Ce+xo*lr,Ye+xo*Cr,it*bi/kr(Bi*an+Pi)]}}return ui.duration=$r*1e3,ui},e.behavior.zoom=function(){var Z={x:0,y:0,k:1},le,Ce,Ye,it=[960,500],ut=hn,Ht=250,wt=0,lr="mousedown.zoom",Cr="mousemove.zoom",zr="mouseup.zoom",ui,$r="touchstart.zoom",Oi,un=ke(an,"zoomstart","zoom","zoomend"),pi,Pi,ji,pn;_i||(_i="onwheel"in n?(qr=function(){return-e.event.deltaY*(e.event.deltaMode?120:1)},"wheel"):"onmousewheel"in n?(qr=function(){return e.event.wheelDelta},"mousewheel"):(qr=function(){return-e.event.detail},"MozMousePixelScroll"));function an(ds){ds.on(lr,fu).on(_i+".zoom",Vu).on("dblclick.zoom",tf).on($r,Xu)}an.event=function(ds){ds.each(function(){var Wl=un.of(this,arguments),Au=Z;Bl?e.select(this).transition().each("start.zoom",function(){Z=this.__chart__||{x:0,y:0,k:1},Pl(Wl)}).tween("zoom:zoom",function(){var Tu=it[0],lf=it[1],hf=Ce?Ce[0]:Tu/2,Mf=Ce?Ce[1]:lf/2,pf=e.interpolateZoom([(hf-Z.x)/Z.k,(Mf-Z.y)/Z.k,Tu/Z.k],[(hf-Au.x)/Au.k,(Mf-Au.y)/Au.k,Tu/Au.k]);return function(fc){var Fe=pf(fc),Bt=Tu/Fe[2];this.__chart__=Z={x:hf-Fe[0]*Bt,y:Mf-Fe[1]*Bt,k:Bt},pu(Wl)}}).each("interrupt.zoom",function(){Il(Wl)}).each("end.zoom",function(){Il(Wl)}):(this.__chart__=Z,Pl(Wl),pu(Wl),Il(Wl))})},an.translate=function(ds){return arguments.length?(Z={x:+ds[0],y:+ds[1],k:Z.k},El(),an):[Z.x,Z.y]},an.scale=function(ds){return arguments.length?(Z={x:Z.x,y:Z.y,k:null},no(+ds),El(),an):Z.k},an.scaleExtent=function(ds){return arguments.length?(ut=ds==null?hn:[+ds[0],+ds[1]],an):ut},an.center=function(ds){return arguments.length?(Ye=ds&&[+ds[0],+ds[1]],an):Ye},an.size=function(ds){return arguments.length?(it=ds&&[+ds[0],+ds[1]],an):it},an.duration=function(ds){return arguments.length?(Ht=+ds,an):Ht},an.x=function(ds){return arguments.length?(Pi=ds,pi=ds.copy(),Z={x:0,y:0,k:1},an):Pi},an.y=function(ds){return arguments.length?(pn=ds,ji=ds.copy(),Z={x:0,y:0,k:1},an):pn};function bi(ds){return[(ds[0]-Z.x)/Z.k,(ds[1]-Z.y)/Z.k]}function xo(ds){return[ds[0]*Z.k+Z.x,ds[1]*Z.k+Z.y]}function no(ds){Z.k=Math.max(ut[0],Math.min(ut[1],ds))}function Xo(ds,Wl){Wl=xo(Wl),Z.x+=ds[0]-Wl[0],Z.y+=ds[1]-Wl[1]}function js(ds,Wl,Au,Tu){ds.__chart__={x:Z.x,y:Z.y,k:Z.k},no(Math.pow(2,Tu)),Xo(Ce=Wl,Au),ds=e.select(ds),Ht>0&&(ds=ds.transition().duration(Ht)),ds.call(an.event)}function El(){Pi&&Pi.domain(pi.range().map(function(ds){return(ds-Z.x)/Z.k}).map(pi.invert)),pn&&pn.domain(ji.range().map(function(ds){return(ds-Z.y)/Z.k}).map(ji.invert))}function Pl(ds){wt++||ds({type:"zoomstart"})}function pu(ds){El(),ds({type:"zoom",scale:Z.k,translate:[Z.x,Z.y]})}function Il(ds){--wt||(ds({type:"zoomend"}),Ce=null)}function fu(){var ds=this,Wl=un.of(ds,arguments),Au=0,Tu=e.select(a(ds)).on(Cr,Mf).on(zr,pf),lf=bi(e.mouse(ds)),hf=vr(ds);Us.call(ds),Pl(Wl);function Mf(){Au=1,Xo(e.mouse(ds),lf),pu(Wl)}function pf(){Tu.on(Cr,null).on(zr,null),hf(Au),Il(Wl)}}function Xu(){var ds=this,Wl=un.of(ds,arguments),Au={},Tu=0,lf,hf=".zoom-"+e.event.changedTouches[0].identifier,Mf="touchmove"+hf,pf="touchend"+hf,fc=[],Fe=e.select(ds),Bt=vr(ds);Qr(),Pl(Wl),Fe.on(lr,null).on($r,Qr);function tr(){var di=e.touches(ds);return lf=Z.k,di.forEach(function(nn){nn.identifier in Au&&(Au[nn.identifier]=bi(nn))}),di}function Qr(){var di=e.event.target;e.select(di).on(Mf,vi).on(pf,fi),fc.push(di);for(var nn=e.event.changedTouches,On=0,Ln=nn.length;On<Ln;++On)Au[nn[On].identifier]=null;var wn=tr(),Ls=Date.now();if(wn.length===1){if(Ls-Oi<500){var ua=wn[0];js(ds,ua,Au[ua.identifier],Math.floor(Math.log(Z.k)/Math.LN2)+1),me()}Oi=Ls}else if(wn.length>1){var ua=wn[0],Hn=wn[1],Ni=ua[0]-Hn[0],Wr=ua[1]-Hn[1];Tu=Ni*Ni+Wr*Wr}}function vi(){var di=e.touches(ds),nn,On,Ln,wn;Us.call(ds);for(var Ls=0,ua=di.length;Ls<ua;++Ls,wn=null)if(Ln=di[Ls],wn=Au[Ln.identifier]){if(On)break;nn=Ln,On=wn}if(wn){var Hn=(Hn=Ln[0]-nn[0])*Hn+(Hn=Ln[1]-nn[1])*Hn,Ni=Tu&&Math.sqrt(Hn/Tu);nn=[(nn[0]+Ln[0])/2,(nn[1]+Ln[1])/2],On=[(On[0]+wn[0])/2,(On[1]+wn[1])/2],no(Ni*lf)}Oi=null,Xo(nn,On),pu(Wl)}function fi(){if(e.event.touches.length){for(var di=e.event.changedTouches,nn=0,On=di.length;nn<On;++nn)delete Au[di[nn].identifier];for(var Ln in Au)return void tr()}e.selectAll(fc).on(hf,null),Fe.on(lr,fu).on($r,Xu),Bt(),Il(Wl)}}function Vu(){var ds=un.of(this,arguments);ui?clearTimeout(ui):(Us.call(this),le=bi(Ce=Ye||e.mouse(this)),Pl(ds)),ui=setTimeout(function(){ui=null,Il(ds)},50),me(),no(Math.pow(2,qr()*.002)*Z.k),Xo(Ce,le),pu(ds)}function tf(){var ds=e.mouse(this),Wl=Math.log(Z.k)/Math.LN2;js(this,ds,bi(ds),e.event.shiftKey?Math.ceil(Wl)-1:Math.floor(Wl)+1)}return e.rebind(an,un,"on")};var hn=[0,1/0],qr,_i;e.color=zi;function zi(){}zi.prototype.toString=function(){return this.rgb()+""},e.hsl=Rt;function Rt(Z,le,Ce){return this instanceof Rt?(this.h=+Z,this.s=+le,void(this.l=+Ce)):arguments.length<2?Z instanceof Rt?new Rt(Z.h,Z.s,Z.l):xn(""+Z,xi,Rt):new Rt(Z,le,Ce)}var _t=Rt.prototype=new zi;_t.brighter=function(Z){return Z=Math.pow(.7,arguments.length?Z:1),new Rt(this.h,this.s,this.l/Z)},_t.darker=function(Z){return Z=Math.pow(.7,arguments.length?Z:1),new Rt(this.h,this.s,Z*this.l)},_t.rgb=function(){return qt(this.h,this.s,this.l)};function qt(Z,le,Ce){var Ye,it;Z=isNaN(Z)?0:(Z%=360)<0?Z+360:Z,le=isNaN(le)||le<0?0:le>1?1:le,Ce=Ce<0?0:Ce>1?1:Ce,it=Ce<=.5?Ce*(1+le):Ce+le-Ce*le,Ye=2*Ce-it;function ut(wt){return wt>360?wt-=360:wt<0&&(wt+=360),wt<60?Ye+(it-Ye)*wt/60:wt<180?it:wt<240?Ye+(it-Ye)*(240-wt)/60:Ye}function Ht(wt){return Math.round(ut(wt)*255)}return new Fi(Ht(Z+120),Ht(Z),Ht(Z-120))}e.hcl=Nt;function Nt(Z,le,Ce){return this instanceof Nt?(this.h=+Z,this.c=+le,void(this.l=+Ce)):arguments.length<2?Z instanceof Nt?new Nt(Z.h,Z.c,Z.l):Z instanceof Nr?ti(Z.l,Z.a,Z.b):ti((Z=Xr((Z=e.rgb(Z)).r,Z.g,Z.b)).l,Z.a,Z.b):new Nt(Z,le,Ce)}var mr=Nt.prototype=new zi;mr.brighter=function(Z){return new Nt(this.h,this.c,Math.min(100,this.l+Fr*(arguments.length?Z:1)))},mr.darker=function(Z){return new Nt(this.h,this.c,Math.max(0,this.l-Fr*(arguments.length?Z:1)))},mr.rgb=function(){return Lr(this.h,this.c,this.l).rgb()};function Lr(Z,le,Ce){return isNaN(Z)&&(Z=0),isNaN(le)&&(le=0),new Nr(Ce,Math.cos(Z*=xt)*le,Math.sin(Z)*le)}e.lab=Nr;function Nr(Z,le,Ce){return this instanceof Nr?(this.l=+Z,this.a=+le,void(this.b=+Ce)):arguments.length<2?Z instanceof Nr?new Nr(Z.l,Z.a,Z.b):Z instanceof Nt?Lr(Z.h,Z.c,Z.l):Xr((Z=Fi(Z)).r,Z.g,Z.b):new Nr(Z,le,Ce)}var Fr=18,Gr=.95047,Hr=1,mi=1.08883,Ei=Nr.prototype=new zi;Ei.brighter=function(Z){return new Nr(Math.min(100,this.l+Fr*(arguments.length?Z:1)),this.a,this.b)},Ei.darker=function(Z){return new Nr(Math.max(0,this.l-Fr*(arguments.length?Z:1)),this.a,this.b)},Ei.rgb=function(){return Vi(this.l,this.a,this.b)};function Vi(Z,le,Ce){var Ye=(Z+16)/116,it=Ye+le/500,ut=Ye-Ce/200;return it=Qi(it)*Gr,Ye=Qi(Ye)*Hr,ut=Qi(ut)*mi,new Fi(oi(3.2404542*it-1.5371385*Ye-.4985314*ut),oi(-.969266*it+1.8760108*Ye+.041556*ut),oi(.0556434*it-.2040259*Ye+1.0572252*ut))}function ti(Z,le,Ce){return Z>0?new Nt(Math.atan2(Ce,le)*pr,Math.sqrt(le*le+Ce*Ce),Z):new Nt(NaN,NaN,Z)}function Qi(Z){return Z>.206893034?Z*Z*Z:(Z-4/29)/7.787037}function Yr(Z){return Z>.008856?Math.pow(Z,1/3):7.787037*Z+4/29}function oi(Z){return Math.round(255*(Z<=.00304?12.92*Z:1.055*Math.pow(Z,1/2.4)-.055))}e.rgb=Fi;function Fi(Z,le,Ce){return this instanceof Fi?(this.r=~~Z,this.g=~~le,void(this.b=~~Ce)):arguments.length<2?Z instanceof Fi?new Fi(Z.r,Z.g,Z.b):xn(""+Z,Fi,qt):new Fi(Z,le,Ce)}function rn(Z){return new Fi(Z>>16,Z>>8&255,Z&255)}function tn(Z){return rn(Z)+""}var Ri=Fi.prototype=new zi;Ri.brighter=function(Z){Z=Math.pow(.7,arguments.length?Z:1);var le=this.r,Ce=this.g,Ye=this.b,it=30;return!le&&!Ce&&!Ye?new Fi(it,it,it):(le&&le<it&&(le=it),Ce&&Ce<it&&(Ce=it),Ye&&Ye<it&&(Ye=it),new Fi(Math.min(255,le/Z),Math.min(255,Ce/Z),Math.min(255,Ye/Z)))},Ri.darker=function(Z){return Z=Math.pow(.7,arguments.length?Z:1),new Fi(Z*this.r,Z*this.g,Z*this.b)},Ri.hsl=function(){return xi(this.r,this.g,this.b)},Ri.toString=function(){return"#"+Ii(this.r)+Ii(this.g)+Ii(this.b)};function Ii(Z){return Z<16?"0"+Math.max(0,Z).toString(16):Math.min(255,Z).toString(16)}function xn(Z,le,Ce){var Ye=0,it=0,ut=0,Ht,wt,lr;if(Ht=/([a-z]+)\((.*)\)/.exec(Z=Z.toLowerCase()),Ht)switch(wt=Ht[2].split(","),Ht[1]){case"hsl":return Ce(parseFloat(wt[0]),parseFloat(wt[1])/100,parseFloat(wt[2])/100);case"rgb":return le($t(wt[0]),$t(wt[1]),$t(wt[2]))}return(lr=fr.get(Z))?le(lr.r,lr.g,lr.b):(Z!=null&&Z.charAt(0)==="#"&&!isNaN(lr=parseInt(Z.slice(1),16))&&(Z.length===4?(Ye=(lr&3840)>>4,Ye=Ye>>4|Ye,it=lr&240,it=it>>4|it,ut=lr&15,ut=ut<<4|ut):Z.length===7&&(Ye=(lr&16711680)>>16,it=(lr&65280)>>8,ut=lr&255)),le(Ye,it,ut))}function xi(Z,le,Ce){var Ye=Math.min(Z/=255,le/=255,Ce/=255),it=Math.max(Z,le,Ce),ut=it-Ye,Ht,wt,lr=(it+Ye)/2;return ut?(wt=lr<.5?ut/(it+Ye):ut/(2-it-Ye),Z==it?Ht=(le-Ce)/ut+(le<Ce?6:0):le==it?Ht=(Ce-Z)/ut+2:Ht=(Z-le)/ut+4,Ht*=60):(Ht=NaN,wt=lr>0&&lr<1?0:Ht),new Rt(Ht,wt,lr)}function Xr(Z,le,Ce){Z=dt(Z),le=dt(le),Ce=dt(Ce);var Ye=Yr((.4124564*Z+.3575761*le+.1804375*Ce)/Gr),it=Yr((.2126729*Z+.7151522*le+.072175*Ce)/Hr),ut=Yr((.0193339*Z+.119192*le+.9503041*Ce)/mi);return Nr(116*it-16,500*(Ye-it),200*(it-ut))}function dt(Z){return(Z/=255)<=.04045?Z/12.92:Math.pow((Z+.055)/1.055,2.4)}function $t(Z){var le=parseFloat(Z);return Z.charAt(Z.length-1)==="%"?Math.round(le*2.55):le}var fr=e.map({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});fr.forEach(function(Z,le){fr.set(Z,rn(le))});function gr(Z){return typeof Z=="function"?Z:function(){return Z}}e.functor=gr,e.xhr=Zr(G);function Zr(Z){return function(le,Ce,Ye){return arguments.length===2&&typeof Ce=="function"&&(Ye=Ce,Ce=null),wi(le,Ce,Z,Ye)}}function wi(Z,le,Ce,Ye){var it={},ut=e.dispatch("beforesend","progress","load","error"),Ht={},wt=new XMLHttpRequest,lr=null;self.XDomainRequest&&!("withCredentials"in wt)&&/^(http(s)?:)?\/\//.test(Z)&&(wt=new XDomainRequest),"onload"in wt?wt.onload=wt.onerror=Cr:wt.onreadystatechange=function(){wt.readyState>3&&Cr()};function Cr(){var zr=wt.status,ui;if(!zr&&ni(wt)||zr>=200&&zr<300||zr===304){try{ui=Ce.call(it,wt)}catch($r){ut.error.call(it,$r);return}ut.load.call(it,ui)}else ut.error.call(it,wt)}return wt.onprogress=function(zr){var ui=e.event;e.event=zr;try{ut.progress.call(it,wt)}finally{e.event=ui}},it.header=function(zr,ui){return zr=(zr+"").toLowerCase(),arguments.length<2?Ht[zr]:(ui==null?delete Ht[zr]:Ht[zr]=ui+"",it)},it.mimeType=function(zr){return arguments.length?(le=zr==null?null:zr+"",it):le},it.responseType=function(zr){return arguments.length?(lr=zr,it):lr},it.response=function(zr){return Ce=zr,it},["get","post"].forEach(function(zr){it[zr]=function(){return it.send.apply(it,[zr].concat(r(arguments)))}}),it.send=function(zr,ui,$r){if(arguments.length===2&&typeof ui=="function"&&($r=ui,ui=null),wt.open(zr,Z,!0),le!=null&&!("accept"in Ht)&&(Ht.accept=le+",*/*"),wt.setRequestHeader)for(var Oi in Ht)wt.setRequestHeader(Oi,Ht[Oi]);return le!=null&&wt.overrideMimeType&&wt.overrideMimeType(le),lr!=null&&(wt.responseType=lr),$r!=null&&it.on("error",$r).on("load",function(un){$r(null,un)}),ut.beforesend.call(it,wt),wt.send(ui==null?null:ui),it},it.abort=function(){return wt.abort(),it},e.rebind(it,ut,"on"),Ye==null?it:it.get($i(Ye))}function $i(Z){return Z.length===1?function(le,Ce){Z(le==null?Ce:null)}:Z}function ni(Z){var le=Z.responseType;return le&&le!=="text"?Z.response:Z.responseText}e.dsv=function(Z,le){var Ce=new RegExp('["'+Z+` ]`),Ye=Z.charCodeAt(0);function it(Cr,zr,ui){arguments.length<3&&(ui=zr,zr=null);var $r=wi(Cr,le,zr==null?ut:Ht(zr),ui);return $r.row=function(Oi){return arguments.length?$r.response((zr=Oi)==null?ut:Ht(Oi)):zr},$r}function ut(Cr){return it.parse(Cr.responseText)}function Ht(Cr){return function(zr){return it.parse(zr.responseText,Cr)}}it.parse=function(Cr,zr){var ui;return it.parseRows(Cr,function($r,Oi){if(ui)return ui($r,Oi-1);var un=function(pi){for(var Pi={},ji=$r.length,pn=0;pn<ji;++pn)Pi[$r[pn]]=pi[pn];return Pi};ui=zr?function(pi,Pi){return zr(un(pi),Pi)}:un})},it.parseRows=function(Cr,zr){var ui={},$r={},Oi=[],un=Cr.length,pi=0,Pi=0,ji,pn;function an(){if(pi>=un)return $r;if(pn)return pn=!1,ui;var xo=pi;if(Cr.charCodeAt(xo)===34){for(var no=xo;no++<un;)if(Cr.charCodeAt(no)===34){if(Cr.charCodeAt(no+1)!==34)break;++no}pi=no+2;var Xo=Cr.charCodeAt(no+1);return Xo===13?(pn=!0,Cr.charCodeAt(no+2)===10&&++pi):Xo===10&&(pn=!0),Cr.slice(xo+1,no).replace(/""/g,'"')}for(;pi<un;){var Xo=Cr.charCodeAt(pi++),js=1;if(Xo===10)pn=!0;else if(Xo===13)pn=!0,Cr.charCodeAt(pi)===10&&(++pi,++js);else if(Xo!==Ye)continue;return Cr.slice(xo,pi-js)}return Cr.slice(xo)}for(;(ji=an())!==$r;){for(var bi=[];ji!==ui&&ji!==$r;)bi.push(ji),ji=an();zr&&(bi=zr(bi,Pi++))==null||Oi.push(bi)}return Oi},it.format=function(Cr){if(Array.isArray(Cr[0]))return it.formatRows(Cr);var zr=new U,ui=[];return Cr.forEach(function($r){for(var Oi in $r)zr.has(Oi)||ui.push(zr.add(Oi))}),[ui.map(lr).join(Z)].concat(Cr.map(function($r){return ui.map(function(Oi){return lr($r[Oi])}).join(Z)})).join(` `)},it.formatRows=function(Cr){return Cr.map(wt).join(` `)};function wt(Cr){return Cr.map(lr).join(Z)}function lr(Cr){return Ce.test(Cr)?'"'+Cr.replace(/\"/g,'""')+'"':Cr}return it},e.csv=e.dsv(",","text/csv"),e.tsv=e.dsv(" ","text/tab-separated-values");var Xi,aa,Mn,Un,Ga=this[W(this,"requestAnimationFrame")]||function(Z){setTimeout(Z,17)};e.timer=function(){ma.apply(this,arguments)};function ma(Z,le,Ce){var Ye=arguments.length;Ye<2&&(le=0),Ye<3&&(Ce=Date.now());var it=Ce+le,ut={c:Z,t:it,n:null};return aa?aa.n=ut:Xi=ut,aa=ut,Mn||(Un=clearTimeout(Un),Mn=1,Ga(oa)),ut}function oa(){var Z=ka(),le=so()-Z;le>24?(isFinite(le)&&(clearTimeout(Un),Un=setTimeout(oa,le)),Mn=0):(Mn=1,Ga(oa))}e.timer.flush=function(){ka(),so()};function ka(){for(var Z=Date.now(),le=Xi;le;)Z>=le.t&&le.c(Z-le.t)&&(le.c=null),le=le.n;return Z}function so(){for(var Z,le=Xi,Ce=1/0;le;)le.c?(le.t<Ce&&(Ce=le.t),le=(Z=le).n):le=Z?Z.n=le.n:Xi=le.n;return aa=Z,Ce}e.round=function(Z,le){return le?Math.round(Z*(le=Math.pow(10,le)))/le:Math.round(Z)},e.geom={};function Kr(Z){return Z[0]}function Ia(Z){return Z[1]}e.geom.hull=function(Z){var le=Kr,Ce=Ia;if(arguments.length)return Ye(Z);function Ye(it){if(it.length<3)return[];var ut=gr(le),Ht=gr(Ce),wt,lr=it.length,Cr=[],zr=[];for(wt=0;wt<lr;wt++)Cr.push([+ut.call(this,it[wt],wt),+Ht.call(this,it[wt],wt),wt]);for(Cr.sort(fa),wt=0;wt<lr;wt++)zr.push([Cr[wt][0],-Cr[wt][1]]);var ui=Yo(Cr),$r=Yo(zr),Oi=$r[0]===ui[0],un=$r[$r.length-1]===ui[ui.length-1],pi=[];for(wt=ui.length-1;wt>=0;--wt)pi.push(it[Cr[ui[wt]][2]]);for(wt=+Oi;wt<$r.length-un;++wt)pi.push(it[Cr[$r[wt]][2]]);return pi}return Ye.x=function(it){return arguments.length?(le=it,Ye):le},Ye.y=function(it){return arguments.length?(Ce=it,Ye):Ce},Ye};function Yo(Z){for(var le=Z.length,Ce=[0,1],Ye=2,it=2;it<le;it++){for(;Ye>1&&cr(Z[Ce[Ye-2]],Z[Ce[Ye-1]],Z[it])<=0;)--Ye;Ce[Ye++]=it}return Ce.slice(0,Ye)}function fa(Z,le){return Z[0]-le[0]||Z[1]-le[1]}e.geom.polygon=function(Z){return te(Z,kn),Z};var kn=e.geom.polygon.prototype=[];kn.area=function(){for(var Z=-1,le=this.length,Ce,Ye=this[le-1],it=0;++Z<le;)Ce=Ye,Ye=this[Z],it+=Ce[1]*Ye[0]-Ce[0]*Ye[1];return it*.5},kn.centroid=function(Z){var le=-1,Ce=this.length,Ye=0,it=0,ut,Ht=this[Ce-1],wt;for(arguments.length||(Z=-1/(6*this.area()));++le<Ce;)ut=Ht,Ht=this[le],wt=ut[0]*Ht[1]-Ht[0]*ut[1],Ye+=(ut[0]+Ht[0])*wt,it+=(ut[1]+Ht[1])*wt;return[Ye*Z,it*Z]},kn.clip=function(Z){for(var le,Ce=uo(Z),Ye=-1,it=this.length-uo(this),ut,Ht,wt=this[it-1],lr,Cr,zr;++Ye<it;){for(le=Z.slice(),Z.length=0,lr=this[Ye],Cr=le[(Ht=le.length-Ce)-1],ut=-1;++ut<Ht;)zr=le[ut],Ta(zr,wt,lr)?(Ta(Cr,wt,lr)||Z.push(ys(Cr,zr,wt,lr)),Z.push(zr)):Ta(Cr,wt,lr)&&Z.push(ys(Cr,zr,wt,lr)),Cr=zr;Ce&&Z.push(Z[0]),wt=lr}return Z};function Ta(Z,le,Ce){return(Ce[0]-le[0])*(Z[1]-le[1])<(Ce[1]-le[1])*(Z[0]-le[0])}function ys(Z,le,Ce,Ye){var it=Z[0],ut=Ce[0],Ht=le[0]-it,wt=Ye[0]-ut,lr=Z[1],Cr=Ce[1],zr=le[1]-lr,ui=Ye[1]-Cr,$r=(wt*(lr-Cr)-ui*(it-ut))/(ui*Ht-wt*zr);return[it+$r*Ht,lr+$r*zr]}function uo(Z){var le=Z[0],Ce=Z[Z.length-1];return!(le[0]-Ce[0]||le[1]-Ce[1])}var ls,$a,fo,mn=[],ra,wa,ws=[];function Co(){No(this),this.edge=this.site=this.circle=null}function Po(Z){var le=mn.pop()||new Co;return le.site=Z,le}function Wi(Z){Sa(Z),fo.remove(Z),mn.push(Z),No(Z)}function gn(Z){var le=Z.circle,Ce=le.x,Ye=le.cy,it={x:Ce,y:Ye},ut=Z.P,Ht=Z.N,wt=[Z];Wi(Z);for(var lr=ut;lr.circle&&m(Ce-lr.circle.x)<Oe&&m(Ye-lr.circle.cy)<Oe;)ut=lr.P,wt.unshift(lr),Wi(lr),lr=ut;wt.unshift(lr),Sa(lr);for(var Cr=Ht;Cr.circle&&m(Ce-Cr.circle.x)<Oe&&m(Ye-Cr.circle.cy)<Oe;)Ht=Cr.N,wt.push(Cr),Wi(Cr),Cr=Ht;wt.push(Cr),Sa(Cr);var zr=wt.length,ui;for(ui=1;ui<zr;++ui)Cr=wt[ui],lr=wt[ui-1],ps(Cr.edge,lr.site,Cr.site,it);lr=wt[0],Cr=wt[zr-1],Cr.edge=vo(lr.site,Cr.site,null,it),Hi(lr),Hi(Cr)}function Ps(Z){for(var le=Z.x,Ce=Z.y,Ye,it,ut,Ht,wt=fo._;wt;)if(ut=Ha(wt,Ce)-le,ut>Oe)wt=wt.L;else if(Ht=le-Sn(wt,Ce),Ht>Oe){if(!wt.R){Ye=wt;break}wt=wt.R}else{ut>-Oe?(Ye=wt.P,it=wt):Ht>-Oe?(Ye=wt,it=wt.N):Ye=it=wt;break}var lr=Po(Z);if(fo.insert(Ye,lr),!(!Ye&&!it)){if(Ye===it){Sa(Ye),it=Po(Ye.site),fo.insert(lr,it),lr.edge=it.edge=vo(Ye.site,lr.site),Hi(Ye),Hi(it);return}if(!it){lr.edge=vo(Ye.site,lr.site);return}Sa(Ye),Sa(it);var Cr=Ye.site,zr=Cr.x,ui=Cr.y,$r=Z.x-zr,Oi=Z.y-ui,un=it.site,pi=un.x-zr,Pi=un.y-ui,ji=2*($r*Pi-Oi*pi),pn=$r*$r+Oi*Oi,an=pi*pi+Pi*Pi,bi={x:(Pi*pn-Oi*an)/ji+zr,y:($r*an-pi*pn)/ji+ui};ps(it.edge,Cr,un,bi),lr.edge=vo(Cr,Z,null,bi),it.edge=vo(Z,un,null,bi),Hi(Ye),Hi(it)}}function Ha(Z,le){var Ce=Z.site,Ye=Ce.x,it=Ce.y,ut=it-le;if(!ut)return Ye;var Ht=Z.P;if(!Ht)return-1/0;Ce=Ht.site;var wt=Ce.x,lr=Ce.y,Cr=lr-le;if(!Cr)return wt;var zr=wt-Ye,ui=1/ut-1/Cr,$r=zr/Cr;return ui?(-$r+Math.sqrt($r*$r-2*ui*(zr*zr/(-2*Cr)-lr+Cr/2+it-ut/2)))/ui+Ye:(Ye+wt)/2}function Sn(Z,le){var Ce=Z.N;if(Ce)return Ha(Ce,le);var Ye=Z.site;return Ye.y===le?Ye.x:1/0}function ao(Z){this.site=Z,this.edges=[]}ao.prototype.prepare=function(){for(var Z=this.edges,le=Z.length,Ce;le--;)Ce=Z[le].edge,(!Ce.b||!Ce.a)&&Z.splice(le,1);return Z.sort(Ko),Z.length};function Oa(Z){for(var le=Z[0][0],Ce=Z[1][0],Ye=Z[0][1],it=Z[1][1],ut,Ht,wt,lr,Cr=$a,zr=Cr.length,ui,$r,Oi,un,pi,Pi;zr--;)if(ui=Cr[zr],!(!ui||!ui.prepare()))for(Oi=ui.edges,un=Oi.length,$r=0;$r<un;)Pi=Oi[$r].end(),wt=Pi.x,lr=Pi.y,pi=Oi[++$r%un].start(),ut=pi.x,Ht=pi.y,(m(wt-ut)>Oe||m(lr-Ht)>Oe)&&(Oi.splice($r,0,new co(As(ui.site,Pi,m(wt-le)<Oe&&it-lr>Oe?{x:le,y:m(ut-le)<Oe?Ht:it}:m(lr-it)<Oe&&Ce-wt>Oe?{x:m(Ht-it)<Oe?ut:Ce,y:it}:m(wt-Ce)<Oe&&lr-Ye>Oe?{x:Ce,y:m(ut-Ce)<Oe?Ht:Ye}:m(lr-Ye)<Oe&&wt-le>Oe?{x:m(Ht-Ye)<Oe?ut:le,y:Ye}:null),ui.site,null)),++un)}function Ko(Z,le){return le.angle-Z.angle}function Qo(){No(this),this.x=this.y=this.arc=this.site=this.cy=null}function Hi(Z){var le=Z.P,Ce=Z.N;if(!(!le||!Ce)){var Ye=le.site,it=Z.site,ut=Ce.site;if(Ye!==ut){var Ht=it.x,wt=it.y,lr=Ye.x-Ht,Cr=Ye.y-wt,zr=ut.x-Ht,Pi=ut.y-wt,ui=2*(lr*Pi-Cr*zr);if(!(ui>=-ze)){var $r=lr*lr+Cr*Cr,Oi=zr*zr+Pi*Pi,un=(Pi*$r-Cr*Oi)/ui,pi=(lr*Oi-zr*$r)/ui,Pi=pi+wt,ji=ws.pop()||new Qo;ji.arc=Z,ji.site=it,ji.x=un+Ht,ji.y=Pi+Math.sqrt(un*un+pi*pi),ji.cy=Pi,Z.circle=ji;for(var pn=null,an=wa._;an;)if(ji.y<an.y||ji.y===an.y&&ji.x<=an.x)if(an.L)an=an.L;else{pn=an.P;break}else if(an.R)an=an.R;else{pn=an;break}wa.insert(pn,ji),pn||(ra=ji)}}}}function Sa(Z){var le=Z.circle;le&&(le.P||(ra=le.N),wa.remove(le),ws.push(le),No(le),Z.circle=null)}function Qa(Z,le,Ce,Ye){return function(it){var ut=it.a,Ht=it.b,wt=ut.x,lr=ut.y,Cr=Ht.x,zr=Ht.y,ui=0,$r=1,Oi=Cr-wt,un=zr-lr,pi;if(pi=Z-wt,!(!Oi&&pi>0)){if(pi/=Oi,Oi<0){if(pi<ui)return;pi<$r&&($r=pi)}else