UNPKG

@scottlogic/tech-carbon-estimator

Version:

The tech carbon estimator is a web component that allow you to estimate, at high level, your carbon emissions

4 lines 577 kB
import{a as Ve,b as _t,d as Ka}from"./chunk-65MYOLBY.js";function fi(o,e){(e==null||e>o.length)&&(e=o.length);for(var t=0,i=Array(e);t<e;t++)i[t]=o[t];return i}function ha(o){if(o===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o}function O(o,e){if(!(o instanceof e))throw new TypeError("Cannot call a class as a function")}function ji(o,e){for(var t=0;t<e.length;t++){var i=e[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(o,ua(i.key),i)}}function F(o,e,t){return e&&ji(o.prototype,e),t&&ji(o,t),Object.defineProperty(o,"prototype",{writable:!1}),o}function wt(o,e){var t=typeof Symbol<"u"&&o[Symbol.iterator]||o["@@iterator"];if(!t){if(Array.isArray(o)||(t=Ri(o))||e&&o&&typeof o.length=="number"){t&&(o=t);var i=0,a=function(){};return{s:a,n:function(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function(l){throw l},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,r=!0,n=!1;return{s:function(){t=t.call(o)},n:function(){var l=t.next();return r=l.done,l},e:function(l){n=!0,s=l},f:function(){try{r||t.return==null||t.return()}finally{if(n)throw s}}}}function Ft(o){var e=ca();return function(){var t,i=Ut(o);if(e){var a=Ut(this).constructor;t=Reflect.construct(i,arguments,a)}else t=i.apply(this,arguments);return function(s,r){if(r&&(typeof r=="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ha(s)}(this,t)}}function Vt(o,e,t){return(e=ua(e))in o?Object.defineProperty(o,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):o[e]=t,o}function Ut(o){return Ut=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ut(o)}function Dt(o,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");o.prototype=Object.create(e&&e.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),Object.defineProperty(o,"prototype",{writable:!1}),e&&xi(o,e)}function ca(){try{var o=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ca=function(){return!!o})()}function Vi(o,e){var t=Object.keys(o);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(o);e&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(o,a).enumerable})),t.push.apply(t,i)}return t}function H(o){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Vi(Object(t),!0).forEach(function(i){Vt(o,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(t)):Vi(Object(t)).forEach(function(i){Object.defineProperty(o,i,Object.getOwnPropertyDescriptor(t,i))})}return o}function xi(o,e){return xi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,i){return t.__proto__=i,t},xi(o,e)}function da(o,e){return function(t){if(Array.isArray(t))return t}(o)||function(t,i){var a=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(a!=null){var s,r,n,l,h=[],c=!0,d=!1;try{if(n=(a=a.call(t)).next,i===0){if(Object(a)!==a)return;c=!1}else for(;!(c=(s=n.call(a)).done)&&(h.push(s.value),h.length!==i);c=!0);}catch(u){d=!0,r=u}finally{try{if(!c&&a.return!=null&&(l=a.return(),Object(l)!==l))return}finally{if(d)throw r}}return h}}(o,e)||Ri(o,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function ue(o){return function(e){if(Array.isArray(e))return fi(e)}(o)||function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}(o)||Ri(o)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function ua(o){var e=function(t,i){if(typeof t!="object"||!t)return t;var a=t[Symbol.toPrimitive];if(a!==void 0){var s=a.call(t,i||"default");if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(t)}(o,"string");return typeof e=="symbol"?e:e+""}function me(o){return me=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},me(o)}function Ri(o,e){if(o){if(typeof o=="string")return fi(o,e);var t={}.toString.call(o).slice(8,-1);return t==="Object"&&o.constructor&&(t=o.constructor.name),t==="Map"||t==="Set"?Array.from(o):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?fi(o,e):void 0}}function G(o,e){if(Array.isArray(o))for(let t of o)G(t,e);else if(typeof o!="object")pa(Object.getOwnPropertyNames(e)),bi[o]=Object.assign(bi[o]||{},e);else for(let t in o)G(t,o[t])}function ke(o){return bi[o]||{}}function pa(o){ga.push(...o)}function Ei(o,e){let t,i=o.length,a=[];for(t=0;t<i;t++)a.push(e(o[t]));return a}function ai(o){return o%360*Math.PI/180}function ft(o){return o.charAt(0).toUpperCase()+o.slice(1)}function xt(o,e,t,i){return e!=null&&t!=null||(i=i||o.bbox(),e==null?e=i.width/i.height*t:t==null&&(t=i.height/i.width*e)),{width:e,height:t}}function mi(o,e){let t=o.origin,i=o.ox!=null?o.ox:o.originX!=null?o.originX:"center",a=o.oy!=null?o.oy:o.originY!=null?o.originY:"center";t!=null&&([i,a]=Array.isArray(t)?t:typeof t=="object"?[t.x,t.y]:[t,t]);let s=typeof i=="string",r=typeof a=="string";if(s||r){let{height:n,width:l,x:h,y:c}=e.bbox();s&&(i=i.includes("left")?h:i.includes("right")?h+l:h+l/2),r&&(a=a.includes("top")?c:a.includes("bottom")?c+n:c+n/2)}return[i,a]}function Nt(){return J.window}function It(o,e=Hi){return J.document.createElementNS(e,o)}function ve(o,e=!1){if(o instanceof Yi)return o;if(typeof o=="object")return ri(o);if(o==null)return new $e[Oi];if(typeof o=="string"&&o.charAt(0)!=="<")return ri(J.document.querySelector(o));let t=e?J.document.createElement("div"):It("svg");return t.innerHTML=o,o=ri(t.firstChild),t.removeChild(t.firstChild),o}function re(o,e){return e&&(e instanceof J.window.Node||e.ownerDocument&&e instanceof e.ownerDocument.defaultView.Node)?e:It(o)}function Le(o){if(!o)return null;if(o.instance instanceof Yi)return o.instance;if(o.nodeName==="#document-fragment")return new $e.Fragment(o);let e=ft(o.nodeName||"Dom");return e==="LinearGradient"||e==="RadialGradient"?e="Gradient":$e[e]||(e="Dom"),new $e[e](o)}function Q(o,e=o.name,t=!1){return $e[e]=o,t&&($e[Oi]=o),pa(Object.getOwnPropertyNames(o.prototype)),o}function xa(o){return"Svgjs"+ft(o)+ts++}function ba(o){for(let e=o.children.length-1;e>=0;e--)ba(o.children[e]);return o.id&&(o.id=xa(o.nodeName)),o}function B(o,e){let t,i;for(i=(o=Array.isArray(o)?o:[o]).length-1;i>=0;i--)for(t in e)o[i].prototype[t]=e[t]}function se(o){return function(...e){let t=e[e.length-1];return!t||t.constructor!==Object||t instanceof Array?o.apply(this,e):o.apply(this,e.slice(0,-1)).attr(t)}}function ls(o){let e=Math.round(o),t=Math.max(0,Math.min(255,e)).toString(16);return t.length===1?"0"+t:t}function it(o,e){for(let t=e.length;t--;)if(o[e[t]]==null)return!1;return!0}function ni(o,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?o+6*(e-o)*t:t<.5?e:t<2/3?o+(e-o)*(2/3-t)*6:o}function at(o,e,t){return Math.abs(e-o)<(t||1e-6)}function We(){if(!We.nodes){let o=ve().size(2,0);o.node.style.cssText=["opacity: 0","position: absolute","left: -100%","top: -100%","overflow: hidden"].join(";"),o.attr("focusable","false"),o.attr("aria-hidden","true");let e=o.path().node;We.nodes={svg:o,path:e}}if(!We.nodes.svg.node.parentNode){let o=J.document.body||J.document.documentElement;We.nodes.svg.addTo(o)}return We.nodes}function va(o){return!(o.width||o.height||o.x||o.y)}function Ji(o,e,t){let i;try{if(i=e(o.node),va(i)&&(a=o.node)!==J.document&&!(J.document.documentElement.contains||function(s){for(;s.parentNode;)s=s.parentNode;return s===J.document}).call(J.document.documentElement,a))throw new Error("Element not in the dom")}catch{i=t(o)}var a;return i}function tt(o,e){return new Fe(Ei((e||J.document).querySelectorAll(o),function(t){return Le(t)}))}function wa(o){let e=o.getEventHolder();return e===J.window&&(e=ya),e.events||(e.events={}),e.events}function Di(o){return o.getEventTarget()}function He(o,e,t,i,a){let s=t.bind(i||o),r=ve(o),n=wa(r),l=Di(r);e=Array.isArray(e)?e:e.split(Ne),t._svgjsListenerId||(t._svgjsListenerId=++cs),e.forEach(function(h){let c=h.split(".")[0],d=h.split(".")[1]||"*";n[c]=n[c]||{},n[c][d]=n[c][d]||{},n[c][d][t._svgjsListenerId]=s,l.addEventListener(c,s,a||!1)})}function Me(o,e,t,i){let a=ve(o),s=wa(a),r=Di(a);(typeof t!="function"||(t=t._svgjsListenerId))&&(e=Array.isArray(e)?e:(e||"").split(Ne)).forEach(function(n){let l=n&&n.split(".")[0],h=n&&n.split(".")[1],c,d;if(t)s[l]&&s[l][h||"*"]&&(r.removeEventListener(l,s[l][h||"*"][t],i||!1),delete s[l][h||"*"][t]);else if(l&&h){if(s[l]&&s[l][h]){for(d in s[l][h])Me(r,[l,h].join("."),d);delete s[l][h]}}else if(h)for(n in s)for(c in s[n])h===c&&Me(r,[n,h].join("."));else if(l){if(s[l]){for(c in s[l])Me(r,[l,c].join("."));delete s[l]}}else{for(n in s)Me(r,n);(function(u){let g=u.getEventHolder();g===J.window&&(g=ya),g.events&&(g.events={})})(a)}})}function Qi(){}function Ni(o){return this.attr("rx",o)}function Wi(o){return this.attr("ry",o)}function Aa(o){return o==null?this.cx()-this.rx():this.cx(o+this.rx())}function Ca(o){return o==null?this.cy()-this.ry():this.cy(o+this.ry())}function Sa(o){return this.attr("cx",o)}function La(o){return this.attr("cy",o)}function Ma(o){return o==null?2*this.rx():this.rx(new $(o).divide(2))}function Pa(o){return o==null?2*this.ry():this.ry(new $(o).divide(2))}function Ia(o,e){return(this._element||this).type==="radialGradient"?this.attr({fx:new $(o),fy:new $(e)}):this.attr({x1:new $(o),y1:new $(e)})}function Ta(o,e){return(this._element||this).type==="radialGradient"?this.attr({cx:new $(o),cy:new $(e)}):this.attr({x2:new $(o),y2:new $(e)})}function st(o,e){return function(t){return t==null?this[o]:(this[o]=t,e&&e.call(this),this)}}function ea(){let o=(this._duration||500)/1e3,e=this._overshoot||0,t=Math.PI,i=Math.log(e/100+1e-10),a=-i/Math.sqrt(t*t+i*i),s=3.9/(a*o);this.d=2*a*s,this.k=s*s}function wi(o){return o.segment.length&&o.segment.length-1===vs[o.segment[0].toUpperCase()]}function ys(o,e){o.inNumber&&Ue(o,!1);let t=Fi.test(e);if(t)o.segment=[e];else{let i=o.lastCommand,a=i.toLowerCase(),s=i===a;o.segment=[a==="m"?s?"l":"L":i]}return o.inSegment=!0,o.lastCommand=o.segment[0],t}function Ue(o,e){if(!o.inNumber)throw new Error("Parser Error");o.number&&o.segment.push(parseFloat(o.number)),o.inNumber=e,o.number="",o.pointSeen=!1,o.hasExponent=!1,wi(o)&&ki(o)}function ki(o){o.inSegment=!1,o.absolute&&(o.segment=function(e){let t=e.segment[0];return yi[t](e.segment.slice(1),e.p,e.p0)}(o)),o.segments.push(o.segment)}function ws(o){if(!o.segment.length)return!1;let e=o.segment[0].toUpperCase()==="A",t=o.segment.length;return e&&(t===4||t===5)}function ks(o){return o.lastToken.toUpperCase()==="E"}function Ms(){let o=this._transformationRunners.runners.map(Ha).reduce(Ea,new V);this.transform(o),this._transformationRunners.merge(),this._transformationRunners.length()===1&&(this._frameId=null)}function ui(o,e){return(e[1]-o[1])/(e[0]-o[0])}function Ii(o,e,t,i=null){return function(a){a.preventDefault(),a.stopPropagation();var s=a.pageX||a.touches[0].pageX,r=a.pageY||a.touches[0].pageY;e.fire(o,{x:s,y:r,event:a,index:i,points:t})}}function Ti([o,e],{a:t,b:i,c:a,d:s,e:r,f:n}){return[o*t+e*a+r,o*i+e*s+n]}function zi(o,e,t,i=null){return function(a){a.preventDefault(),a.stopPropagation();var s=a.pageX||a.touches[0].pageX,r=a.pageY||a.touches[0].pageY;e.fire(o,{x:s,y:r,event:a,index:i,points:t})}}function Xi([o,e],{a:t,b:i,c:a,d:s,e:r,f:n}){return[o*t+e*a+r,o*i+e*s+n]}var L,pt,bi,ga,es,vi,fa,Hi,si,bt,J,Yi,$e,Oi,ri,ts,ma,is,as,ss,rs,ns,Ui,qi,Zi,$i,os,Ne,Fi,Ie,te,V,de,Fe,hs,cs,ya,Qe,oi,ds,us,gs,De,$,ps,ka,Ge,fe,yt,ye,ht,we,fs,nt,qt,xs,Je,Ke,Gt,Ki,Xe,bs,_i,Ze,jt,ms,Tt,zt,ct,vs,yi,li,As,Ae,za,Ee,Xt,Xa,Cs,et,Ai,_e,Ra,Ye,Oe,ot,kt,ie,Ss,Ls,Zt,Be,dt,Ea,Ha,Ci,Rt,Si,Ya,Ce,lt,At,Ct,$t,Oa,ze,rt,St,Jt,Lt,Mt,Qt,Ps,ae,Et,Se,Is,Ts,pe,X,le,ii,zs,ge,Wt,je,Xs,Rs,Fa,qe,Es,hi,ci,Ht,Yt,Da,Hs,Te,mt,Na,ut,Pe,Bi,Pt,Ot,Wa,_a,Li,Gi,Ys,Os,Fs,Mi,Ds,Ns,Ws,_s,Bs,Gs,js,Kt,Vs,Ba,Ga,Us,ja,qs,Va,Zs,$s,Js,ta,Qs,Ks,gt,ia,di,Ua,er,qa,Za,tr,ir,ar,sr,rr,nr,or,gi,lr,$a,hr,cr,dr,ur,aa,Pi,Ja,sa,ei,ra,Bt,na,ti,oa,la,pi,pr,gr=Ka(()=>{L=function(){function o(){O(this,o)}return F(o,[{key:"shadeRGBColor",value:function(e,t){var i=t.split(","),a=e<0?0:255,s=e<0?-1*e:e,r=parseInt(i[0].slice(4),10),n=parseInt(i[1],10),l=parseInt(i[2],10);return"rgb("+(Math.round((a-r)*s)+r)+","+(Math.round((a-n)*s)+n)+","+(Math.round((a-l)*s)+l)+")"}},{key:"shadeHexColor",value:function(e,t){var i=parseInt(t.slice(1),16),a=e<0?0:255,s=e<0?-1*e:e,r=i>>16,n=i>>8&255,l=255&i;return"#"+(16777216+65536*(Math.round((a-r)*s)+r)+256*(Math.round((a-n)*s)+n)+(Math.round((a-l)*s)+l)).toString(16).slice(1)}},{key:"shadeColor",value:function(e,t){return o.isColorHex(t)?this.shadeHexColor(e,t):this.shadeRGBColor(e,t)}}],[{key:"bind",value:function(e,t){return function(){return e.apply(t,arguments)}}},{key:"isObject",value:function(e){return e&&me(e)==="object"&&!Array.isArray(e)&&e!=null}},{key:"is",value:function(e,t){return Object.prototype.toString.call(t)==="[object "+e+"]"}},{key:"isSafari",value:function(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}},{key:"listToArray",value:function(e){var t,i=[];for(t=0;t<e.length;t++)i[t]=e[t];return i}},{key:"extend",value:function(e,t){var i=this;typeof Object.assign!="function"&&(Object.assign=function(s){if(s==null)throw new TypeError("Cannot convert undefined or null to object");for(var r=Object(s),n=1;n<arguments.length;n++){var l=arguments[n];if(l!=null)for(var h in l)l.hasOwnProperty(h)&&(r[h]=l[h])}return r});var a=Object.assign({},e);return this.isObject(e)&&this.isObject(t)&&Object.keys(t).forEach(function(s){i.isObject(t[s])&&s in e?a[s]=i.extend(e[s],t[s]):Object.assign(a,Vt({},s,t[s]))}),a}},{key:"extendArray",value:function(e,t){var i=[];return e.map(function(a){i.push(o.extend(t,a))}),e=i}},{key:"monthMod",value:function(e){return e%12}},{key:"clone",value:function(e){var t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new WeakMap;if(e===null||me(e)!=="object")return e;if(i.has(e))return i.get(e);if(Array.isArray(e)){t=[],i.set(e,t);for(var a=0;a<e.length;a++)t[a]=this.clone(e[a],i)}else if(e instanceof Date)t=new Date(e.getTime());else for(var s in t={},i.set(e,t),e)e.hasOwnProperty(s)&&(t[s]=this.clone(e[s],i));return t}},{key:"log10",value:function(e){return Math.log(e)/Math.LN10}},{key:"roundToBase10",value:function(e){return Math.pow(10,Math.floor(Math.log10(e)))}},{key:"roundToBase",value:function(e,t){return Math.pow(t,Math.floor(Math.log(e)/Math.log(t)))}},{key:"parseNumber",value:function(e){return typeof e=="number"||e===null?e:parseFloat(e)}},{key:"stripNumber",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;return Number.isInteger(e)?e:parseFloat(e.toPrecision(t))}},{key:"randomId",value:function(){return(Math.random()+1).toString(36).substring(4)}},{key:"noExponents",value:function(e){return e.toString().includes("e")?Math.round(e):e}},{key:"elementExists",value:function(e){return!(!e||!e.isConnected)}},{key:"getDimensions",value:function(e){var t=getComputedStyle(e,null),i=e.clientHeight,a=e.clientWidth;return i-=parseFloat(t.paddingTop)+parseFloat(t.paddingBottom),[a-=parseFloat(t.paddingLeft)+parseFloat(t.paddingRight),i]}},{key:"getBoundingClientRect",value:function(e){var t=e.getBoundingClientRect();return{top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:e.clientWidth,height:e.clientHeight,x:t.left,y:t.top}}},{key:"getLargestStringFromArr",value:function(e){return e.reduce(function(t,i){return Array.isArray(i)&&(i=i.reduce(function(a,s){return a.length>s.length?a:s})),t.length>i.length?t:i},0)}},{key:"hexToRgba",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"#999999",t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:.6;e.substring(0,1)!=="#"&&(e="#999999");var i=e.replace("#","");i=i.match(new RegExp("(.{"+i.length/3+"})","g"));for(var a=0;a<i.length;a++)i[a]=parseInt(i[a].length===1?i[a]+i[a]:i[a],16);return t!==void 0&&i.push(t),"rgba("+i.join(",")+")"}},{key:"getOpacityFromRGBA",value:function(e){return parseFloat(e.replace(/^.*,(.+)\)/,"$1"))}},{key:"rgb2hex",value:function(e){return(e=e.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i))&&e.length===4?"#"+("0"+parseInt(e[1],10).toString(16)).slice(-2)+("0"+parseInt(e[2],10).toString(16)).slice(-2)+("0"+parseInt(e[3],10).toString(16)).slice(-2):""}},{key:"isColorHex",value:function(e){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)|(^#[0-9A-F]{8}$)/i.test(e)}},{key:"getPolygonPos",value:function(e,t){for(var i=[],a=2*Math.PI/t,s=0;s<t;s++){var r={};r.x=e*Math.sin(s*a),r.y=-e*Math.cos(s*a),i.push(r)}return i}},{key:"polarToCartesian",value:function(e,t,i,a){var s=(a-90)*Math.PI/180;return{x:e+i*Math.cos(s),y:t+i*Math.sin(s)}}},{key:"escapeString",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"x",i=e.toString().slice();return i=i.replace(/[` ~!@#$%^&*()|+\=?;:'",.<>{}[\]\\/]/gi,t)}},{key:"negToZero",value:function(e){return e<0?0:e}},{key:"moveIndexInArray",value:function(e,t,i){if(i>=e.length)for(var a=i-e.length+1;a--;)e.push(void 0);return e.splice(i,0,e.splice(t,1)[0]),e}},{key:"extractNumber",value:function(e){return parseFloat(e.replace(/[^\d.]*/g,""))}},{key:"findAncestor",value:function(e,t){for(;(e=e.parentElement)&&!e.classList.contains(t););return e}},{key:"setELstyles",value:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e.style.key=t[i])}},{key:"preciseAddition",value:function(e,t){var i=(String(e).split(".")[1]||"").length,a=(String(t).split(".")[1]||"").length,s=Math.pow(10,Math.max(i,a));return(Math.round(e*s)+Math.round(t*s))/s}},{key:"isNumber",value:function(e){return!isNaN(e)&&parseFloat(Number(e))===e&&!isNaN(parseInt(e,10))}},{key:"isFloat",value:function(e){return Number(e)===e&&e%1!=0}},{key:"isMsEdge",value:function(){var e=window.navigator.userAgent,t=e.indexOf("Edge/");return t>0&&parseInt(e.substring(t+5,e.indexOf(".",t)),10)}},{key:"getGCD",value:function(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:7,a=Math.pow(10,i-Math.floor(Math.log10(Math.max(e,t))));for(e=Math.round(Math.abs(e)*a),t=Math.round(Math.abs(t)*a);t;){var s=t;t=e%t,e=s}return e/a}},{key:"getPrimeFactors",value:function(e){for(var t=[],i=2;e>=2;)e%i==0?(t.push(i),e/=i):i++;return t}},{key:"mod",value:function(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:7,a=Math.pow(10,i-Math.floor(Math.log10(Math.max(e,t))));return(e=Math.round(Math.abs(e)*a))%(t=Math.round(Math.abs(t)*a))/a}}]),o}(),pt=function(){function o(e){O(this,o),this.ctx=e,this.w=e.w}return F(o,[{key:"animateLine",value:function(e,t,i,a){e.attr(t).animate(a).attr(i)}},{key:"animateMarker",value:function(e,t,i,a){e.attr({opacity:0}).animate(t).attr({opacity:1}).after(function(){a()})}},{key:"animateRect",value:function(e,t,i,a,s){e.attr(t).animate(a).attr(i).after(function(){return s()})}},{key:"animatePathsGradually",value:function(e){var t=e.el,i=e.realIndex,a=e.j,s=e.fill,r=e.pathFrom,n=e.pathTo,l=e.speed,h=e.delay,c=this.w,d=0;c.config.chart.animations.animateGradually.enabled&&(d=c.config.chart.animations.animateGradually.delay),c.config.chart.animations.dynamicAnimation.enabled&&c.globals.dataChanged&&c.config.chart.type!=="bar"&&(d=0),this.morphSVG(t,i,a,c.config.chart.type!=="line"||c.globals.comboCharts?s:"stroke",r,n,l,h*d)}},{key:"showDelayedElements",value:function(){this.w.globals.delayedElements.forEach(function(e){var t=e.el;t.classList.remove("apexcharts-element-hidden"),t.classList.add("apexcharts-hidden-element-shown")})}},{key:"animationCompleted",value:function(e){var t=this.w;t.globals.animationEnded||(t.globals.animationEnded=!0,this.showDelayedElements(),typeof t.config.chart.events.animationEnd=="function"&&t.config.chart.events.animationEnd(this.ctx,{el:e,w:t}))}},{key:"morphSVG",value:function(e,t,i,a,s,r,n,l){var h=this,c=this.w;s||(s=e.attr("pathFrom")),r||(r=e.attr("pathTo"));var d=function(u){return c.config.chart.type==="radar"&&(n=1),"M 0 ".concat(c.globals.gridHeight)};(!s||s.indexOf("undefined")>-1||s.indexOf("NaN")>-1)&&(s=d()),(!r.trim()||r.indexOf("undefined")>-1||r.indexOf("NaN")>-1)&&(r=d()),c.globals.shouldAnimate||(n=1),e.plot(s).animate(1,l).plot(s).animate(n,l).plot(r).after(function(){L.isNumber(i)?i===c.globals.series[c.globals.maxValsInArrayIndex].length-2&&c.globals.shouldAnimate&&h.animationCompleted(e):a!=="none"&&c.globals.shouldAnimate&&(!c.globals.comboCharts&&t===c.globals.series.length-1||c.globals.comboCharts)&&h.animationCompleted(e),h.showDelayedElements()})}}]),o}(),bi={},ga=[];es=new Set(["desc","metadata","title"]),vi=o=>es.has(o.nodeName),fa=(o,e,t={})=>{let i=Ve({},e);for(let a in i)i[a].valueOf()===t[a]&&delete i[a];Object.keys(i).length?o.node.setAttribute("data-svgjs",JSON.stringify(i)):(o.node.removeAttribute("data-svgjs"),o.node.removeAttribute("svgjs:data"))},Hi="http://www.w3.org/2000/svg",si="http://www.w3.org/2000/xmlns/",bt="http://www.w3.org/1999/xlink",J={window:typeof window>"u"?null:window,document:typeof document>"u"?null:document};Yi=class{},$e={},Oi="___SYMBOL___ROOT___";ri=Le;ts=1e3;G("Dom",{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},prev:function(){return this.siblings()[this.position()-1]},forward:function(){let o=this.position();return this.parent().add(this.remove(),o+1),this},backward:function(){let o=this.position();return this.parent().add(this.remove(),o?o-1:0),this},front:function(){return this.parent().add(this.remove()),this},back:function(){return this.parent().add(this.remove(),0),this},before:function(o){(o=ve(o)).remove();let e=this.position();return this.parent().add(o,e),this},after:function(o){(o=ve(o)).remove();let e=this.position();return this.parent().add(o,e+1),this},insertBefore:function(o){return(o=ve(o)).before(this),this},insertAfter:function(o){return(o=ve(o)).after(this),this}});ma=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,is=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,as=/rgb\((\d+),(\d+),(\d+)\)/,ss=/(#[a-z_][a-z0-9\-_]*)/i,rs=/\)\s*,?\s*/,ns=/\s/g,Ui=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,qi=/^rgb\(/,Zi=/^(\s+)?$/,$i=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,os=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,Ne=/[\s,]+/,Fi=/[MLHVCSQTAZ]/i;G("Dom",{classes:function(){let o=this.attr("class");return o==null?[]:o.trim().split(Ne)},hasClass:function(o){return this.classes().indexOf(o)!==-1},addClass:function(o){if(!this.hasClass(o)){let e=this.classes();e.push(o),this.attr("class",e.join(" "))}return this},removeClass:function(o){return this.hasClass(o)&&this.attr("class",this.classes().filter(function(e){return e!==o}).join(" ")),this},toggleClass:function(o){return this.hasClass(o)?this.removeClass(o):this.addClass(o)}}),G("Dom",{css:function(o,e){let t={};if(arguments.length===0)return this.node.style.cssText.split(/\s*;\s*/).filter(function(i){return!!i.length}).forEach(function(i){let a=i.split(/\s*:\s*/);t[a[0]]=a[1]}),t;if(arguments.length<2){if(Array.isArray(o)){for(let i of o){let a=i;t[i]=this.node.style.getPropertyValue(a)}return t}if(typeof o=="string")return this.node.style.getPropertyValue(o);if(typeof o=="object")for(let i in o)this.node.style.setProperty(i,o[i]==null||Zi.test(o[i])?"":o[i])}return arguments.length===2&&this.node.style.setProperty(o,e==null||Zi.test(e)?"":e),this},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},visible:function(){return this.css("display")!=="none"}}),G("Dom",{data:function(o,e,t){if(o==null)return this.data(Ei(function(i,a){let s,r=i.length,n=[];for(s=0;s<r;s++)a(i[s])&&n.push(i[s]);return n}(this.node.attributes,i=>i.nodeName.indexOf("data-")===0),i=>i.nodeName.slice(5)));if(o instanceof Array){let i={};for(let a of o)i[a]=this.data(a);return i}if(typeof o=="object")for(e in o)this.data(e,o[e]);else if(arguments.length<2)try{return JSON.parse(this.attr("data-"+o))}catch{return this.attr("data-"+o)}else this.attr("data-"+o,e===null?null:t===!0||typeof e=="string"||typeof e=="number"?e:JSON.stringify(e));return this}}),G("Dom",{remember:function(o,e){if(typeof arguments[0]=="object")for(let t in o)this.remember(t,o[t]);else{if(arguments.length===1)return this.memory()[o];this.memory()[o]=e}return this},forget:function(){if(arguments.length===0)this._memory={};else for(let o=arguments.length-1;o>=0;o--)delete this.memory()[arguments[o]];return this},memory:function(){return this._memory=this._memory||{}}});Ie=class o{constructor(...e){this.init(...e)}static isColor(e){return e&&(e instanceof o||this.isRgb(e)||this.test(e))}static isRgb(e){return e&&typeof e.r=="number"&&typeof e.g=="number"&&typeof e.b=="number"}static random(e="vibrant",t){let{random:i,round:a,sin:s,PI:r}=Math;if(e==="vibrant"){let n=24*i()+57,l=38*i()+45,h=360*i();return new o(n,l,h,"lch")}if(e==="sine"){let n=a(80*s(2*r*(t=t??i())/.5+.01)+150),l=a(50*s(2*r*t/.5+4.6)+200),h=a(100*s(2*r*t/.5+2.3)+150);return new o(n,l,h)}if(e==="pastel"){let n=8*i()+86,l=17*i()+9,h=360*i();return new o(n,l,h,"lch")}if(e==="dark"){let n=10+10*i(),l=50*i()+86,h=360*i();return new o(n,l,h,"lch")}if(e==="rgb"){let n=255*i(),l=255*i(),h=255*i();return new o(n,l,h)}if(e==="lab"){let n=100*i(),l=256*i()-128,h=256*i()-128;return new o(n,l,h,"lab")}if(e==="grey"){let n=255*i();return new o(n,n,n)}throw new Error("Unsupported random color mode")}static test(e){return typeof e=="string"&&(Ui.test(e)||qi.test(e))}cmyk(){let{_a:e,_b:t,_c:i}=this.rgb(),[a,s,r]=[e,t,i].map(l=>l/255),n=Math.min(1-a,1-s,1-r);return n===1?new o(0,0,0,1,"cmyk"):new o((1-a-n)/(1-n),(1-s-n)/(1-n),(1-r-n)/(1-n),n,"cmyk")}hsl(){let{_a:e,_b:t,_c:i}=this.rgb(),[a,s,r]=[e,t,i].map(u=>u/255),n=Math.max(a,s,r),l=Math.min(a,s,r),h=(n+l)/2,c=n===l,d=n-l;return new o(360*(c?0:n===a?((s-r)/d+(s<r?6:0))/6:n===s?((r-a)/d+2)/6:n===r?((a-s)/d+4)/6:0),100*(c?0:h>.5?d/(2-n-l):d/(n+l)),100*h,"hsl")}init(e=0,t=0,i=0,a=0,s="rgb"){if(e=e||0,this.space)for(let d in this.space)delete this[this.space[d]];if(typeof e=="number")s=typeof a=="string"?a:s,a=typeof a=="string"?0:a,Object.assign(this,{_a:e,_b:t,_c:i,_d:a,space:s});else if(e instanceof Array)this.space=t||(typeof e[3]=="string"?e[3]:e[4])||"rgb",Object.assign(this,{_a:e[0],_b:e[1],_c:e[2],_d:e[3]||0});else if(e instanceof Object){let d=function(u,g){let f=it(u,"rgb")?{_a:u.r,_b:u.g,_c:u.b,_d:0,space:"rgb"}:it(u,"xyz")?{_a:u.x,_b:u.y,_c:u.z,_d:0,space:"xyz"}:it(u,"hsl")?{_a:u.h,_b:u.s,_c:u.l,_d:0,space:"hsl"}:it(u,"lab")?{_a:u.l,_b:u.a,_c:u.b,_d:0,space:"lab"}:it(u,"lch")?{_a:u.l,_b:u.c,_c:u.h,_d:0,space:"lch"}:it(u,"cmyk")?{_a:u.c,_b:u.m,_c:u.y,_d:u.k,space:"cmyk"}:{_a:0,_b:0,_c:0,space:"rgb"};return f.space=g||f.space,f}(e,t);Object.assign(this,d)}else if(typeof e=="string")if(qi.test(e)){let d=e.replace(ns,""),[u,g,f]=as.exec(d).slice(1,4).map(p=>parseInt(p));Object.assign(this,{_a:u,_b:g,_c:f,_d:0,space:"rgb"})}else{if(!Ui.test(e))throw Error("Unsupported string format, can't construct Color");{let d=p=>parseInt(p,16),[,u,g,f]=is.exec(function(p){return p.length===4?["#",p.substring(1,2),p.substring(1,2),p.substring(2,3),p.substring(2,3),p.substring(3,4),p.substring(3,4)].join(""):p}(e)).map(d);Object.assign(this,{_a:u,_b:g,_c:f,_d:0,space:"rgb"})}}let{_a:r,_b:n,_c:l,_d:h}=this,c=this.space==="rgb"?{r,g:n,b:l}:this.space==="xyz"?{x:r,y:n,z:l}:this.space==="hsl"?{h:r,s:n,l}:this.space==="lab"?{l:r,a:n,b:l}:this.space==="lch"?{l:r,c:n,h:l}:this.space==="cmyk"?{c:r,m:n,y:l,k:h}:{};Object.assign(this,c)}lab(){let{x:e,y:t,z:i}=this.xyz();return new o(116*t-16,500*(e-t),200*(t-i),"lab")}lch(){let{l:e,a:t,b:i}=this.lab(),a=Math.sqrt(t**2+i**2),s=180*Math.atan2(i,t)/Math.PI;return s<0&&(s*=-1,s=360-s),new o(e,a,s,"lch")}rgb(){if(this.space==="rgb")return this;if((e=this.space)==="lab"||e==="xyz"||e==="lch"){let{x:t,y:i,z:a}=this;if(this.space==="lab"||this.space==="lch"){let{l:g,a:f,b:p}=this;if(this.space==="lch"){let{c:C,h:w}=this,A=Math.PI/180;f=C*Math.cos(A*w),p=C*Math.sin(A*w)}let x=(g+16)/116,b=f/500+x,m=x-p/200,y=16/116,k=.008856,v=7.787;t=.95047*(b**3>k?b**3:(b-y)/v),i=1*(x**3>k?x**3:(x-y)/v),a=1.08883*(m**3>k?m**3:(m-y)/v)}let s=3.2406*t+-1.5372*i+-.4986*a,r=-.9689*t+1.8758*i+.0415*a,n=.0557*t+-.204*i+1.057*a,l=Math.pow,h=.0031308,c=s>h?1.055*l(s,1/2.4)-.055:12.92*s,d=r>h?1.055*l(r,1/2.4)-.055:12.92*r,u=n>h?1.055*l(n,1/2.4)-.055:12.92*n;return new o(255*c,255*d,255*u)}if(this.space==="hsl"){let{h:t,s:i,l:a}=this;if(t/=360,i/=100,a/=100,i===0)return a*=255,new o(a,a,a);let s=a<.5?a*(1+i):a+i-a*i,r=2*a-s,n=255*ni(r,s,t+1/3),l=255*ni(r,s,t),h=255*ni(r,s,t-1/3);return new o(n,l,h)}if(this.space==="cmyk"){let{c:t,m:i,y:a,k:s}=this,r=255*(1-Math.min(1,t*(1-s)+s)),n=255*(1-Math.min(1,i*(1-s)+s)),l=255*(1-Math.min(1,a*(1-s)+s));return new o(r,n,l)}return this;var e}toArray(){let{_a:e,_b:t,_c:i,_d:a,space:s}=this;return[e,t,i,a,s]}toHex(){let[e,t,i]=this._clamped().map(ls);return`#${e}${t}${i}`}toRgb(){let[e,t,i]=this._clamped();return`rgb(${e},${t},${i})`}toString(){return this.toHex()}xyz(){let{_a:e,_b:t,_c:i}=this.rgb(),[a,s,r]=[e,t,i].map(x=>x/255),n=a>.04045?Math.pow((a+.055)/1.055,2.4):a/12.92,l=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92,h=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92,c=(.4124*n+.3576*l+.1805*h)/.95047,d=(.2126*n+.7152*l+.0722*h)/1,u=(.0193*n+.1192*l+.9505*h)/1.08883,g=c>.008856?Math.pow(c,1/3):7.787*c+16/116,f=d>.008856?Math.pow(d,1/3):7.787*d+16/116,p=u>.008856?Math.pow(u,1/3):7.787*u+16/116;return new o(g,f,p,"xyz")}_clamped(){let{_a:e,_b:t,_c:i}=this.rgb(),{max:a,min:s,round:r}=Math;return[e,t,i].map(n=>a(0,s(r(n),255)))}},te=class o{constructor(...e){this.init(...e)}clone(){return new o(this)}init(e,t){let s=Array.isArray(e)?{x:e[0],y:e[1]}:typeof e=="object"?{x:e.x,y:e.y}:{x:e,y:t};return this.x=s.x==null?0:s.x,this.y=s.y==null?0:s.y,this}toArray(){return[this.x,this.y]}transform(e){return this.clone().transformO(e)}transformO(e){V.isMatrixLike(e)||(e=new V(e));let{x:t,y:i}=this;return this.x=e.a*t+e.c*i+e.e,this.y=e.b*t+e.d*i+e.f,this}};V=class o{constructor(...e){this.init(...e)}static formatTransforms(e){let t=e.flip==="both"||e.flip===!0,i=e.flip&&(t||e.flip==="x")?-1:1,a=e.flip&&(t||e.flip==="y")?-1:1,s=e.skew&&e.skew.length?e.skew[0]:isFinite(e.skew)?e.skew:isFinite(e.skewX)?e.skewX:0,r=e.skew&&e.skew.length?e.skew[1]:isFinite(e.skew)?e.skew:isFinite(e.skewY)?e.skewY:0,n=e.scale&&e.scale.length?e.scale[0]*i:isFinite(e.scale)?e.scale*i:isFinite(e.scaleX)?e.scaleX*i:i,l=e.scale&&e.scale.length?e.scale[1]*a:isFinite(e.scale)?e.scale*a:isFinite(e.scaleY)?e.scaleY*a:a,h=e.shear||0,c=e.rotate||e.theta||0,d=new te(e.origin||e.around||e.ox||e.originX,e.oy||e.originY),u=d.x,g=d.y,f=new te(e.position||e.px||e.positionX||NaN,e.py||e.positionY||NaN),p=f.x,x=f.y,b=new te(e.translate||e.tx||e.translateX,e.ty||e.translateY),m=b.x,y=b.y,k=new te(e.relative||e.rx||e.relativeX,e.ry||e.relativeY);return{scaleX:n,scaleY:l,skewX:s,skewY:r,shear:h,theta:c,rx:k.x,ry:k.y,tx:m,ty:y,ox:u,oy:g,px:p,py:x}}static fromArray(e){return{a:e[0],b:e[1],c:e[2],d:e[3],e:e[4],f:e[5]}}static isMatrixLike(e){return e.a!=null||e.b!=null||e.c!=null||e.d!=null||e.e!=null||e.f!=null}static matrixMultiply(e,t,i){let a=e.a*t.a+e.c*t.b,s=e.b*t.a+e.d*t.b,r=e.a*t.c+e.c*t.d,n=e.b*t.c+e.d*t.d,l=e.e+e.a*t.e+e.c*t.f,h=e.f+e.b*t.e+e.d*t.f;return i.a=a,i.b=s,i.c=r,i.d=n,i.e=l,i.f=h,i}around(e,t,i){return this.clone().aroundO(e,t,i)}aroundO(e,t,i){let a=e||0,s=t||0;return this.translateO(-a,-s).lmultiplyO(i).translateO(a,s)}clone(){return new o(this)}decompose(e=0,t=0){let i=this.a,a=this.b,s=this.c,r=this.d,n=this.e,l=this.f,h=i*r-a*s,c=h>0?1:-1,d=c*Math.sqrt(i*i+a*a),u=Math.atan2(c*a,c*i),g=180/Math.PI*u,f=Math.cos(u),p=Math.sin(u),x=(i*s+a*r)/h,b=s*d/(x*i-a)||r*d/(x*a+i);return{scaleX:d,scaleY:b,shear:x,rotate:g,translateX:n-e+e*f*d+t*(x*f*d-p*b),translateY:l-t+e*p*d+t*(x*p*d+f*b),originX:e,originY:t,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}equals(e){if(e===this)return!0;let t=new o(e);return at(this.a,t.a)&&at(this.b,t.b)&&at(this.c,t.c)&&at(this.d,t.d)&&at(this.e,t.e)&&at(this.f,t.f)}flip(e,t){return this.clone().flipO(e,t)}flipO(e,t){return e==="x"?this.scaleO(-1,1,t,0):e==="y"?this.scaleO(1,-1,0,t):this.scaleO(-1,-1,e,t||e)}init(e){let t=o.fromArray([1,0,0,1,0,0]);return e=e instanceof fe?e.matrixify():typeof e=="string"?o.fromArray(e.split(Ne).map(parseFloat)):Array.isArray(e)?o.fromArray(e):typeof e=="object"&&o.isMatrixLike(e)?e:typeof e=="object"?new o().transform(e):arguments.length===6?o.fromArray([].slice.call(arguments)):t,this.a=e.a!=null?e.a:t.a,this.b=e.b!=null?e.b:t.b,this.c=e.c!=null?e.c:t.c,this.d=e.d!=null?e.d:t.d,this.e=e.e!=null?e.e:t.e,this.f=e.f!=null?e.f:t.f,this}inverse(){return this.clone().inverseO()}inverseO(){let e=this.a,t=this.b,i=this.c,a=this.d,s=this.e,r=this.f,n=e*a-t*i;if(!n)throw new Error("Cannot invert "+this);let l=a/n,h=-t/n,c=-i/n,d=e/n,u=-(l*s+c*r),g=-(h*s+d*r);return this.a=l,this.b=h,this.c=c,this.d=d,this.e=u,this.f=g,this}lmultiply(e){return this.clone().lmultiplyO(e)}lmultiplyO(e){let t=e instanceof o?e:new o(e);return o.matrixMultiply(t,this,this)}multiply(e){return this.clone().multiplyO(e)}multiplyO(e){let t=e instanceof o?e:new o(e);return o.matrixMultiply(this,t,this)}rotate(e,t,i){return this.clone().rotateO(e,t,i)}rotateO(e,t=0,i=0){e=ai(e);let a=Math.cos(e),s=Math.sin(e),{a:r,b:n,c:l,d:h,e:c,f:d}=this;return this.a=r*a-n*s,this.b=n*a+r*s,this.c=l*a-h*s,this.d=h*a+l*s,this.e=c*a-d*s+i*s-t*a+t,this.f=d*a+c*s-t*s-i*a+i,this}scale(){return this.clone().scaleO(...arguments)}scaleO(e,t=e,i=0,a=0){arguments.length===3&&(a=i,i=t,t=e);let{a:s,b:r,c:n,d:l,e:h,f:c}=this;return this.a=s*e,this.b=r*t,this.c=n*e,this.d=l*t,this.e=h*e-i*e+i,this.f=c*t-a*t+a,this}shear(e,t,i){return this.clone().shearO(e,t,i)}shearO(e,t=0,i=0){let{a,b:s,c:r,d:n,e:l,f:h}=this;return this.a=a+s*e,this.c=r+n*e,this.e=l+h*e-i*e,this}skew(){return this.clone().skewO(...arguments)}skewO(e,t=e,i=0,a=0){arguments.length===3&&(a=i,i=t,t=e),e=ai(e),t=ai(t);let s=Math.tan(e),r=Math.tan(t),{a:n,b:l,c:h,d:c,e:d,f:u}=this;return this.a=n+l*s,this.b=l+n*r,this.c=h+c*s,this.d=c+h*r,this.e=d+u*s-a*s,this.f=u+d*r-i*r,this}skewX(e,t,i){return this.skew(e,0,t,i)}skewY(e,t,i){return this.skew(0,e,t,i)}toArray(){return[this.a,this.b,this.c,this.d,this.e,this.f]}toString(){return"matrix("+this.a+","+this.b+","+this.c+","+this.d+","+this.e+","+this.f+")"}transform(e){if(o.isMatrixLike(e))return new o(e).multiplyO(this);let t=o.formatTransforms(e),{x:i,y:a}=new te(t.ox,t.oy).transform(this),s=new o().translateO(t.rx,t.ry).lmultiplyO(this).translateO(-i,-a).scaleO(t.scaleX,t.scaleY).skewO(t.skewX,t.skewY).shearO(t.shear).rotateO(t.theta).translateO(i,a);if(isFinite(t.px)||isFinite(t.py)){let r=new te(i,a).transform(s),n=isFinite(t.px)?t.px-r.x:0,l=isFinite(t.py)?t.py-r.y:0;s.translateO(n,l)}return s.translateO(t.tx,t.ty),s}translate(e,t){return this.clone().translateO(e,t)}translateO(e,t){return this.e+=e||0,this.f+=t||0,this}valueOf(){return{a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}};Q(V,"Matrix");de=class o{constructor(...e){this.init(...e)}addOffset(){return this.x+=J.window.pageXOffset,this.y+=J.window.pageYOffset,new o(this)}init(e){return e=typeof e=="string"?e.split(Ne).map(parseFloat):Array.isArray(e)?e:typeof e=="object"?[e.left!=null?e.left:e.x,e.top!=null?e.top:e.y,e.width,e.height]:arguments.length===4?[].slice.call(arguments):[0,0,0,0],this.x=e[0]||0,this.y=e[1]||0,this.width=this.w=e[2]||0,this.height=this.h=e[3]||0,this.x2=this.x+this.w,this.y2=this.y+this.h,this.cx=this.x+this.w/2,this.cy=this.y+this.h/2,this}isNulled(){return va(this)}merge(e){let t=Math.min(this.x,e.x),i=Math.min(this.y,e.y),a=Math.max(this.x+this.width,e.x+e.width)-t,s=Math.max(this.y+this.height,e.y+e.height)-i;return new o(t,i,a,s)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+" "+this.y+" "+this.width+" "+this.height}transform(e){e instanceof V||(e=new V(e));let t=1/0,i=-1/0,a=1/0,s=-1/0;return[new te(this.x,this.y),new te(this.x2,this.y),new te(this.x,this.y2),new te(this.x2,this.y2)].forEach(function(r){r=r.transform(e),t=Math.min(t,r.x),i=Math.max(i,r.x),a=Math.min(a,r.y),s=Math.max(s,r.y)}),new o(t,a,i-t,s-a)}};G({viewbox:{viewbox(o,e,t,i){return o==null?new de(this.attr("viewBox")):this.attr("viewBox",new de(o,e,t,i))},zoom(o,e){let{width:t,height:i}=this.attr(["width","height"]);if((t||i)&&typeof t!="string"&&typeof i!="string"||(t=this.node.clientWidth,i=this.node.clientHeight),!t||!i)throw new Error("Impossible to get absolute width and height. Please provide an absolute width and height attribute on the zooming element");let a=this.viewbox(),s=t/a.width,r=i/a.height,n=Math.min(s,r);if(o==null)return n;let l=n/o;l===1/0&&(l=Number.MAX_SAFE_INTEGER/100),e=e||new te(t/2/s+a.x,i/2/r+a.y);let h=new de(a).transform(new V({scale:l,origin:e}));return this.viewbox(h)}}}),Q(de,"Box");Fe=class extends Array{constructor(e=[],...t){if(super(e,...t),typeof e=="number")return this;this.length=0,this.push(...e)}};B([Fe],{each(o,...e){return typeof o=="function"?this.map((t,i,a)=>o.call(t,t,i,a)):this.map(t=>t[o](...e))},toArray(){return Array.prototype.concat.apply([],this)}});hs=["toArray","constructor","each"];Fe.extend=function(o){o=o.reduce((e,t)=>(hs.includes(t)||t[0]==="_"||(t in Array.prototype&&(e["$"+t]=Array.prototype[t]),e[t]=function(...i){return this.each(t,...i)}),e),{}),B([Fe],o)};cs=0,ya={};Qe=class extends Yi{addEventListener(){}dispatch(e,t,i){return function(a,s,r,n){let l=Di(a);return s instanceof J.window.Event||(s=new J.window.CustomEvent(s,Ve({detail:r,cancelable:!0},n))),l.dispatchEvent(s),s}(this,e,t,i)}dispatchEvent(e){let t=this.getEventHolder().events;if(!t)return!0;let i=t[e.type];for(let a in i)for(let s in i[a])i[a][s](e);return!e.defaultPrevented}fire(e,t,i){return this.dispatch(e,t,i),this}getEventHolder(){return this}getEventTarget(){return this}off(e,t,i){return Me(this,e,t,i),this}on(e,t,i,a){return He(this,e,t,i,a),this}removeEventListener(){}};Q(Qe,"EventTarget");oi=400,ds=">",us=0,gs={"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":"miter","stroke-linecap":"butt",fill:"#000000",stroke:"#000000",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":"#000000","text-anchor":"start"},De=class extends Array{constructor(...e){super(...e),this.init(...e)}clone(){return new this.constructor(this)}init(e){return typeof e=="number"||(this.length=0,this.push(...this.parse(e))),this}parse(e=[]){return e instanceof Array?e:e.trim().split(Ne).map(parseFloat)}toArray(){return Array.prototype.concat.apply([],this)}toSet(){return new Set(this)}toString(){return this.join(" ")}valueOf(){let e=[];return e.push(...this),e}},$=class o{constructor(...e){this.init(...e)}convert(e){return new o(this.value,e)}divide(e){return e=new o(e),new o(this/e,this.unit||e.unit)}init(e,t){return t=Array.isArray(e)?e[1]:t,e=Array.isArray(e)?e[0]:e,this.value=0,this.unit=t||"",typeof e=="number"?this.value=isNaN(e)?0:isFinite(e)?e:e<0?-34e37:34e37:typeof e=="string"?(t=e.match(ma))&&(this.value=parseFloat(t[1]),t[5]==="%"?this.value/=100:t[5]==="s"&&(this.value*=1e3),this.unit=t[5]):e instanceof o&&(this.value=e.valueOf(),this.unit=e.unit),this}minus(e){return e=new o(e),new o(this-e,this.unit||e.unit)}plus(e){return e=new o(e),new o(this+e,this.unit||e.unit)}times(e){return e=new o(e),new o(this*e,this.unit||e.unit)}toArray(){return[this.value,this.unit]}toJSON(){return this.toString()}toString(){return(this.unit==="%"?~~(1e8*this.value)/1e6:this.unit==="s"?this.value/1e3:this.value)+this.unit}valueOf(){return this.value}},ps=new Set(["fill","stroke","color","bgcolor","stop-color","flood-color","lighting-color"]),ka=[],Ge=class o extends Qe{constructor(e,t){super(),this.node=e,this.type=e.nodeName,t&&e!==t&&this.attr(t)}add(e,t){return(e=ve(e)).removeNamespace&&this.node instanceof J.window.SVGElement&&e.removeNamespace(),t==null?this.node.appendChild(e.node):e.node!==this.node.childNodes[t]&&this.node.insertBefore(e.node,this.node.childNodes[t]),this}addTo(e,t){return ve(e).put(this,t)}children(){return new Fe(Ei(this.node.children,function(e){return Le(e)}))}clear(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this}clone(e=!0,t=!0){this.writeDataToDom();let i=this.node.cloneNode(e);return t&&(i=ba(i)),new this.constructor(i)}each(e,t){let i=this.children(),a,s;for(a=0,s=i.length;a<s;a++)e.apply(i[a],[a,i]),t&&i[a].each(e,t);return this}element(e,t){return this.put(new o(It(e),t))}first(){return Le(this.node.firstChild)}get(e){return Le(this.node.childNodes[e])}getEventHolder(){return this.node}getEventTarget(){return this.node}has(e){return this.index(e)>=0}html(e,t){return this.xml(e,t,"http://www.w3.org/1999/xhtml")}id(e){return e!==void 0||this.node.id||(this.node.id=xa(this.type)),this.attr("id",e)}index(e){return[].slice.call(this.node.childNodes).indexOf(e.node)}last(){return Le(this.node.lastChild)}matches(e){let t=this.node,i=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector||null;return i&&i.call(t,e)}parent(e){let t=this;if(!t.node.parentNode)return null;if(t=Le(t.node.parentNode),!e)return t;do if(typeof e=="string"?t.matches(e):t instanceof e)return t;while(t=Le(t.node.parentNode));return t}put(e,t){return e=ve(e),this.add(e,t),e}putIn(e,t){return ve(e).add(this,t)}remove(){return this.parent()&&this.parent().removeElement(this),this}removeElement(e){return this.node.removeChild(e.node),this}replace(e){return e=ve(e),this.node.parentNode&&this.node.parentNode.replaceChild(e.node,this.node),e}round(e=2,t=null){let i=10**e,a=this.attr(t);for(let s in a)typeof a[s]=="number"&&(a[s]=Math.round(a[s]*i)/i);return this.attr(a),this}svg(e,t){return this.xml(e,t,Hi)}toString(){return this.id()}words(e){return this.node.textContent=e,this}wrap(e){let t=this.parent();if(!t)return this.addTo(e);let i=t.index(this);return t.put(e,i).put(this)}writeDataToDom(){return this.each(function(){this.writeDataToDom()}),this}xml(e,t,i){if(typeof e=="boolean"&&(i=t,t=e,e=null),e==null||typeof e=="function"){t=t==null||t,this.writeDataToDom();let n=this;if(e!=null){if(n=Le(n.node.cloneNode(!0)),t){let l=e(n);if(n=l||n,l===!1)return""}n.each(function(){let l=e(this),h=l||this;l===!1?this.remove():l&&this!==h&&this.replace(h)},!0)}return t?n.node.outerHTML:n.node.innerHTML}t=t!=null&&t;let a=It("wrapper",i),s=J.document.createDocumentFragment();a.innerHTML=e;for(let n=a.children.length;n--;)s.appendChild(a.firstElementChild);let r=this.parent();return t?this.replace(s)&&r:this.add(s)}};B(Ge,{attr:function(o,e,t){if(o==null){o={},e=this.node.attributes;for(let i of e)o[i.nodeName]=$i.test(i.nodeValue)?parseFloat(i.nodeValue):i.nodeValue;return o}if(o instanceof Array)return o.reduce((i,a)=>(i[a]=this.attr(a),i),{});if(typeof o=="object"&&o.constructor===Object)for(e in o)this.attr(e,o[e]);else if(e===null)this.node.removeAttribute(o);else{if(e==null)return(e=this.node.getAttribute(o))==null?gs[o]:$i.test(e)?parseFloat(e):e;typeof(e=ka.reduce((i,a)=>a(o,i,this),e))=="number"?e=new $(e):ps.has(o)&&Ie.isColor(e)?e=new Ie(e):e.constructor===Array&&(e=new De(e)),o==="leading"?this.leading&&this.leading(e):typeof t=="string"?this.node.setAttributeNS(t,o,e.toString()):this.node.setAttribute(o,e.toString()),!this.rebuild||o!=="font-size"&&o!=="x"||this.rebuild()}return this},find:function(o){return tt(o,this.node)},findOne:function(o){return Le(this.node.querySelector(o))}}),Q(Ge,"Dom");fe=class extends Ge{constructor(o,e){super(o,e),this.dom={},this.node.instance=this,(o.hasAttribute("data-svgjs")||o.hasAttribute("svgjs:data"))&&this.setData(JSON.parse(o.getAttribute("data-svgjs"))??JSON.parse(o.getAttribute("svgjs:data"))??{})}center(o,e){return this.cx(o).cy(e)}cx(o){return o==null?this.x()+this.width()/2:this.x(o-this.width()/2)}cy(o){return o==null?this.y()+this.height()/2:this.y(o-this.height()/2)}defs(){let o=this.root();return o&&o.defs()}dmove(o,e){return this.dx(o).dy(e)}dx(o=0){return this.x(new $(o).plus(this.x()))}dy(o=0){return this.y(new $(o).plus(this.y()))}getEventHolder(){return this}height(o){return this.attr("height",o)}move(o,e){return this.x(o).y(e)}parents(o=this.root()){let e=typeof o=="string";e||(o=ve(o));let t=new Fe,i=this;for(;(i=i.parent())&&i.node!==J.document&&i.nodeName!=="#document-fragment"&&(t.push(i),e||i.node!==o.node)&&(!e||!i.matches(o));)if(i.node===this.root().node)return null;return t}reference(o){if(!(o=this.attr(o)))return null;let e=(o+"").match(ss);return e?ve(e[1]):null}root(){let o=this.parent(function(e){return $e[e]}(Oi));return o&&o.root()}setData(o){return this.dom=o,this}size(o,e){let t=xt(this,o,e);return this.width(new $(t.width)).height(new $(t.height))}width(o){return this.attr("width",o)}writeDataToDom(){return fa(this,this.dom),super.writeDataToDom()}x(o){return this.attr("x",o)}y(o){return this.attr("y",o)}};B(fe,{bbox:function(){let o=Ji(this,e=>e.getBBox(),e=>{try{let t=e.clone().addTo(We().svg).show(),i=t.node.getBBox();return t.remove(),i}catch(t){throw new Error(`Getting bbox of element "${e.node.nodeName}" is not possible: ${t.toString()}`)}});return new de(o)},rbox:function(o){let e=Ji(this,i=>i.getBoundingClientRect(),i=>{throw new Error(`Getting rbox of element "${i.node.nodeName}" is not possible`)}),t=new de(e);return o?t.transform(o.screenCTM().inverseO()):t.addOffset()},inside:function(o,e){let t=this.bbox();return o>t.x&&e>t.y&&o<t.x+t.width&&e<t.y+t.height},point:function(o,e){return new te(o,e).transformO(this.screenCTM().inverseO())},ctm:function(){return new V(this.node.getCTM())},screenCTM:function(){try{if(typeof this.isRoot=="function"&&!this.isRoot()){let o=this.rect(1,1),e=o.node.getScreenCTM();return o.remove(),new V(e)}return new V(this.node.getScreenCTM())}catch{return console.warn(`Cannot get CTM from SVG node ${this.node.nodeName}. Is the element rendered?`),new V}}}),Q(fe,"Element");yt={stroke:["color","width","opacity","linecap","linejoin","miterlimit","dasharray","dashoffset"],fill:["color","opacity","rule"],prefix:function(o,e){return e==="color"?o:o+"-"+e}};["fill","stroke"].forEach(function(o){let e={},t;e[o]=function(i){if(i===void 0)return this.attr(o);if(typeof i=="string"||i instanceof Ie||Ie.isRgb(i)||i instanceof fe)this.attr(o,i);else for(t=yt[o].length-1;t>=0;t--)i[yt[o][t]]!=null&&this.attr(yt.prefix(o,yt[o][t]),i[yt[o][t]]);return this},G(["Element","Runner"],e)}),G(["Element","Runner"],{matrix:function(o,e,t,i,a,s){return o==null?new V(this):this.attr("transform",new V(o,e,t,i,a,s))},rotate:function(o,e,t){return this.transform({rotate:o,ox:e,oy:t},!0)},skew:function(o,e,t,i){return arguments.length===1||arguments.length===3?this.transform({skew:o,ox:e,oy:t},!0):this.transform({skew:[o,e],ox:t,oy:i},!0)},shear:function(o,e,t){return this.transform({shear:o,ox:e,oy:t},!0)},scale:function(o,e,t,i){return arguments.length===1||arguments.length===3?this.transform({scale:o,ox:e,oy:t},!0):this.transform({scale:[o,e],ox:t,oy:i},!0)},translate:function(o,e){return this.transform({translate:[o,e]},!0)},relative:function(o,e){return this.transform({relative:[o,e]},!0)},flip:function(o="both",e="center"){return"xybothtrue".indexOf(o)===-1&&(e=o,o="both"),this.transform({flip:o,origin:e},!0)},opacity:function(o){return this.attr("opacity",o)}}),G("radius",{radius:function(o,e=o){return(this._element||this).type==="radialGradient"?this.attr("r",new $(o)):this.rx(o).ry(e)}}),G("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(o){return new te(this.node.getPointAtLength(o))}}),G(["Element","Runner"],{font:function(o,e){if(typeof o=="object"){for(e in o)this.font(e,o[e]);return this}return o==="leading"?this.leading(e):o==="anchor"?this.attr("text-anchor",e):o==="size"||o==="family"||o==="weight"||o==="stretch"||o==="variant"||o==="style"?this.attr("font-"+o,e):this.attr(o,e)}});G("Element",["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel","contextmenu","wheel","pointerdown","pointermove","pointerup","pointerleave","pointercancel"].reduce(function(o,e){return o[e]=function(t){return t===null?this.off(e):this.on(e,t),this},o},{})),G("Element",{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(rs).slice(0,-1).map(function(e){let t=e.trim().split("(");return[t[0],t[1].split(Ne).map(function(i){return parseFloat(i)})]}).reverse().reduce(function(e,t){return t[0]==="matrix"?e.lmultiply(V.fromArray(t[1])):e[t[0]].apply(e,t[1])},new V)},toParent:function(o,e){if(this===o)return this;if(vi(this.node))return this.addTo(o,e);let t=this.screenCTM(),i=o.screenCTM().inverse();return this.addTo(o,e).untransform().transform(i.multiply(t)),this},toRoot:function(o){return this.toParent(this.root(),o)},transform:function(o,e){if(o==null||typeof o=="string"){let i=new V(this).decompose();return o==null?i:i[o]}V.isMatrixLike(o)||(o=_t(Ve({},o),{origin:mi(o,this)}));let t=new V(e===!0?this:e||!1).transform(o);return this.attr("transform",t)}});ye=class o extends fe{flatten(){return this.each(function(){if(this instanceof o)return this.flatten().ungroup()}),this}ungroup(e=this