@deephaven/embed-widget 1.4.1-beta.0 → 1.4.1-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/build/assets/{App-Cck4me54.js → App-BJxDY7iu.js} +2 -2
  2. package/build/assets/{App-Cck4me54.js.map → App-BJxDY7iu.js.map} +1 -1
  3. package/build/assets/{Chart-CGHueNRa.js → Chart-BWi9z_I5.js} +2 -2
  4. package/build/assets/{Chart-CGHueNRa.js.map → Chart-BWi9z_I5.js.map} +1 -1
  5. package/build/assets/IrisGrid-9OvwYA6e.js +5 -0
  6. package/build/assets/IrisGrid-9OvwYA6e.js.map +1 -0
  7. package/build/assets/IrisGridThemeProvider-BhDCJ-O6.js +12 -0
  8. package/build/assets/IrisGridThemeProvider-BhDCJ-O6.js.map +1 -0
  9. package/build/assets/{LocalWorkspaceStorage-BhZNXNoT.js → LocalWorkspaceStorage-CFvJln-B.js} +2 -2
  10. package/build/assets/{LocalWorkspaceStorage-BhZNXNoT.js.map → LocalWorkspaceStorage-CFvJln-B.js.map} +1 -1
  11. package/build/assets/{LogPanel-BEvxEQ5P.js → LogPanel-zVjvZPEP.js} +3 -3
  12. package/build/assets/{LogPanel-BEvxEQ5P.js.map → LogPanel-zVjvZPEP.js.map} +1 -1
  13. package/build/assets/{MarkdownEditor-bbgRMENW.js → MarkdownEditor-0HzWawYb.js} +2 -2
  14. package/build/assets/{MarkdownEditor-bbgRMENW.js.map → MarkdownEditor-0HzWawYb.js.map} +1 -1
  15. package/build/assets/{MarkdownNotebook-C1JS5TYD.js → MarkdownNotebook-BP-RSbF7.js} +2 -2
  16. package/build/assets/{MarkdownNotebook-C1JS5TYD.js.map → MarkdownNotebook-BP-RSbF7.js.map} +1 -1
  17. package/build/assets/Plot-CrWE09z_.js +2 -0
  18. package/build/assets/{Plot-BTki1mPQ.js.map → Plot-CrWE09z_.js.map} +1 -1
  19. package/build/assets/{Plotly-D5d4m8Ha.js → Plotly-AbR82OTZ.js} +2 -2
  20. package/build/assets/{Plotly-D5d4m8Ha.js.map → Plotly-AbR82OTZ.js.map} +1 -1
  21. package/build/assets/index-BIJNWIp_.js +14 -0
  22. package/build/assets/index-BIJNWIp_.js.map +1 -0
  23. package/build/assets/{index-C9xjLbor.js → index-CYeL07f8.js} +2 -2
  24. package/build/assets/{index-C9xjLbor.js.map → index-CYeL07f8.js.map} +1 -1
  25. package/build/assets/{index-C0yrO8wr.js → index-Cq8JqnNf.js} +3 -3
  26. package/build/assets/{index-C0yrO8wr.js.map → index-Cq8JqnNf.js.map} +1 -1
  27. package/build/assets/plotly-DPMKRrOg.js +7 -0
  28. package/build/assets/{plotly-DDnZiLFO.js.map → plotly-DPMKRrOg.js.map} +1 -1
  29. package/build/index.html +1 -1
  30. package/package.json +17 -17
  31. package/build/assets/IrisGrid-BL1Aygl8.js +0 -5
  32. package/build/assets/IrisGrid-BL1Aygl8.js.map +0 -1
  33. package/build/assets/IrisGridThemeProvider-CIcnD7r4.js +0 -12
  34. package/build/assets/IrisGridThemeProvider-CIcnD7r4.js.map +0 -1
  35. package/build/assets/Plot-BTki1mPQ.js +0 -2
  36. package/build/assets/index-c6rlljHp.js +0 -14
  37. package/build/assets/index-c6rlljHp.js.map +0 -1
  38. package/build/assets/plotly-DDnZiLFO.js +0 -7
@@ -1,7 +0,0 @@
1
- import{g as Ni,c as AM}from"./helpers-BosuxZz1.js";import{r as MM,p as SM,a as U1,f as kt,t as _a,d as bt,g as V1,b as Gl,i as LM,c as W1,e as Eh,h as X1,m as CM,j as Y1,k as q1,l as DM,n as PM,o as $M,q as Z1,s as EM,u as zM,v as RM,w as IM,x as FM,y as NM,z as HM,A as zh,B as K1}from"./vendor-Bp3qklGK.js";var Q1={};(function(t){function e(x){"@babel/helpers - typeof";return e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(w){return typeof w}:function(w){return w&&typeof Symbol=="function"&&w.constructor===Symbol&&w!==Symbol.prototype?"symbol":typeof w},e(x)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=g;var r=o(MM),a=i(SM);function i(x){return x&&x.__esModule?x:{default:x}}function n(x){if(typeof WeakMap!="function")return null;var w=new WeakMap,T=new WeakMap;return(n=function(M){return M?T:w})(x)}function o(x,w){if(x&&x.__esModule)return x;if(x===null||e(x)!=="object"&&typeof x!="function")return{default:x};var T=n(w);if(T&&T.has(x))return T.get(x);var A={},M=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var S in x)if(S!=="default"&&Object.prototype.hasOwnProperty.call(x,S)){var L=M?Object.getOwnPropertyDescriptor(x,S):null;L&&(L.get||L.set)?Object.defineProperty(A,S,L):A[S]=x[S]}return A.default=x,T&&T.set(x,A),A}function l(x,w){if(!(x instanceof w))throw new TypeError("Cannot call a class as a function")}function s(x,w){for(var T=0;T<w.length;T++){var A=w[T];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(x,A.key,A)}}function f(x,w,T){return w&&s(x.prototype,w),Object.defineProperty(x,"prototype",{writable:!1}),x}function c(x,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function");x.prototype=Object.create(w&&w.prototype,{constructor:{value:x,writable:!0,configurable:!0}}),Object.defineProperty(x,"prototype",{writable:!1}),w&&u(x,w)}function u(x,w){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(A,M){return A.__proto__=M,A},u(x,w)}function v(x){var w=h();return function(){var A=m(x),M;if(w){var S=m(this).constructor;M=Reflect.construct(A,arguments,S)}else M=A.apply(this,arguments);return p(this,M)}}function p(x,w){if(w&&(e(w)==="object"||typeof w=="function"))return w;if(w!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return d(x)}function d(x){if(x===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x}function h(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function m(x){return m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(T){return T.__proto__||Object.getPrototypeOf(T)},m(x)}var y=["AfterExport","AfterPlot","Animated","AnimatingFrame","AnimationInterrupted","AutoSize","BeforeExport","BeforeHover","ButtonClicked","Click","ClickAnnotation","Deselect","DoubleClick","Framework","Hover","LegendClick","LegendDoubleClick","Relayout","Relayouting","Restyle","Redraw","Selected","Selecting","SliderChange","SliderEnd","SliderStart","SunburstClick","Transitioning","TransitionInterrupted","Unhover","WebGlContextLost"],b=["plotly_restyle","plotly_redraw","plotly_relayout","plotly_relayouting","plotly_doubleclick","plotly_animated","plotly_sunburstclick"],_=typeof window<"u";function g(x){var w=function(T){c(M,T);var A=v(M);function M(S){var L;return l(this,M),L=A.call(this,S),L.p=Promise.resolve(),L.resizeHandler=null,L.handlers={},L.syncWindowResize=L.syncWindowResize.bind(d(L)),L.syncEventHandlers=L.syncEventHandlers.bind(d(L)),L.attachUpdateEvents=L.attachUpdateEvents.bind(d(L)),L.getRef=L.getRef.bind(d(L)),L.handleUpdate=L.handleUpdate.bind(d(L)),L.figureCallback=L.figureCallback.bind(d(L)),L.updatePlotly=L.updatePlotly.bind(d(L)),L}return f(M,[{key:"updatePlotly",value:function(L,E,F){var N=this;this.p=this.p.then(function(){if(!N.unmounting){if(!N.el)throw new Error("Missing element reference");return x.react(N.el,{data:N.props.data,layout:N.props.layout,config:N.props.config,frames:N.props.frames})}}).then(function(){N.unmounting||(N.syncWindowResize(L),N.syncEventHandlers(),N.figureCallback(E),F&&N.attachUpdateEvents())}).catch(function(z){N.props.onError&&N.props.onError(z)})}},{key:"componentDidMount",value:function(){this.unmounting=!1,this.updatePlotly(!0,this.props.onInitialized,!0)}},{key:"componentDidUpdate",value:function(L){this.unmounting=!1;var E=L.frames&&L.frames.length?L.frames.length:0,F=this.props.frames&&this.props.frames.length?this.props.frames.length:0,N=!(L.layout===this.props.layout&&L.data===this.props.data&&L.config===this.props.config&&F===E),z=L.revision!==void 0,H=L.revision!==this.props.revision;!N&&(!z||z&&!H)||this.updatePlotly(!1,this.props.onUpdate,!1)}},{key:"componentWillUnmount",value:function(){this.unmounting=!0,this.figureCallback(this.props.onPurge),this.resizeHandler&&_&&(window.removeEventListener("resize",this.resizeHandler),this.resizeHandler=null),this.removeUpdateEvents(),x.purge(this.el)}},{key:"attachUpdateEvents",value:function(){var L=this;!this.el||!this.el.removeListener||b.forEach(function(E){L.el.on(E,L.handleUpdate)})}},{key:"removeUpdateEvents",value:function(){var L=this;!this.el||!this.el.removeListener||b.forEach(function(E){L.el.removeListener(E,L.handleUpdate)})}},{key:"handleUpdate",value:function(){this.figureCallback(this.props.onUpdate)}},{key:"figureCallback",value:function(L){if(typeof L=="function"){var E=this.el,F=E.data,N=E.layout,z=this.el._transitionData?this.el._transitionData._frames:null,H={data:F,layout:N,frames:z};L(H,this.el)}}},{key:"syncWindowResize",value:function(L){var E=this;_&&(this.props.useResizeHandler&&!this.resizeHandler?(this.resizeHandler=function(){return x.Plots.resize(E.el)},window.addEventListener("resize",this.resizeHandler),L&&this.resizeHandler()):!this.props.useResizeHandler&&this.resizeHandler&&(window.removeEventListener("resize",this.resizeHandler),this.resizeHandler=null))}},{key:"getRef",value:function(L){this.el=L,this.props.debug&&_&&(window.gd=this.el)}},{key:"syncEventHandlers",value:function(){var L=this;y.forEach(function(E){var F=L.props["on"+E],N=L.handlers[E],z=!!N;F&&!z?L.addEventHandler(E,F):!F&&z?L.removeEventHandler(E):F&&z&&F!==N&&(L.removeEventHandler(E),L.addEventHandler(E,F))})}},{key:"addEventHandler",value:function(L,E){this.handlers[L]=E,this.el.on(this.getPlotlyEventName(L),this.handlers[L])}},{key:"removeEventHandler",value:function(L){this.el.removeListener(this.getPlotlyEventName(L),this.handlers[L]),delete this.handlers[L]}},{key:"getPlotlyEventName",value:function(L){return"plotly_"+L.toLowerCase()}},{key:"render",value:function(){return r.default.createElement("div",{id:this.props.divId,style:this.props.style,ref:this.getRef,className:this.props.className})}}]),M}(r.Component);return w.propTypes={data:a.default.arrayOf(a.default.object),config:a.default.object,layout:a.default.object,frames:a.default.arrayOf(a.default.object),revision:a.default.number,onInitialized:a.default.func,onPurge:a.default.func,onError:a.default.func,onUpdate:a.default.func,debug:a.default.bool,style:a.default.object,className:a.default.string,useResizeHandler:a.default.bool,divId:a.default.string},y.forEach(function(T){w.propTypes["on"+T]=a.default.func}),w.defaultProps={debug:!1,useResizeHandler:!1,data:[],style:{position:"relative",display:"inline-block"}},w}})(Q1);const kB=Ni(Q1);var J1={},Ic={};Ic.version="3.1.0-rc.0";var e_={exports:{}},fr={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE*1e-4,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,ONEMILLI:1,ONEMICROSEC:.001,EPOCHJD:24405875e-1,ALMOST_EQUAL:1-1e-6,LOG_CLIP:10,MINUS_SIGN:"−"},sr={},Dn=function(e){return window&&window.process&&window.process.versions?Object.prototype.toString.call(e)==="[object Object]":Object.prototype.toString.call(e)==="[object Object]"&&Object.getPrototypeOf(e).hasOwnProperty("hasOwnProperty")},OM=U1.decode,jM=Dn,Rh=Array.isArray,BM=ArrayBuffer,GM=DataView;function t_(t){return BM.isView(t)&&!(t instanceof GM)}sr.isTypedArray=t_;function Jf(t){return Rh(t)||t_(t)}sr.isArrayOrTypedArray=Jf;function UM(t){return!Jf(t[0])}sr.isArray1D=UM;sr.ensureArray=function(t,e){return Rh(t)||(t=[]),t.length=e,t};var Ar={u1c:typeof Uint8ClampedArray>"u"?void 0:Uint8ClampedArray,i1:typeof Int8Array>"u"?void 0:Int8Array,u1:typeof Uint8Array>"u"?void 0:Uint8Array,i2:typeof Int16Array>"u"?void 0:Int16Array,u2:typeof Uint16Array>"u"?void 0:Uint16Array,i4:typeof Int32Array>"u"?void 0:Int32Array,u4:typeof Uint32Array>"u"?void 0:Uint32Array,f4:typeof Float32Array>"u"?void 0:Float32Array,f8:typeof Float64Array>"u"?void 0:Float64Array};Ar.uint8c=Ar.u1c;Ar.uint8=Ar.u1;Ar.int8=Ar.i1;Ar.uint16=Ar.u2;Ar.int16=Ar.i2;Ar.uint32=Ar.u4;Ar.int32=Ar.i4;Ar.float32=Ar.f4;Ar.float64=Ar.f8;function Ih(t){return t.constructor===ArrayBuffer}sr.isArrayBuffer=Ih;sr.decodeTypedArraySpec=function(t){var e=[],r=VM(t),a=r.dtype,i=Ar[a];if(!i)throw new Error('Error in dtype: "'+a+'"');var n=i.BYTES_PER_ELEMENT,o=r.bdata;Ih(o)||(o=OM(o));var l=r.shape===void 0?[o.byteLength/n]:(""+r.shape).split(",");l.reverse();var s=l.length,f,c,u=+l[0],v=n*u,p=0;if(s===1)e=new i(o);else if(s===2)for(f=+l[1],c=0;c<f;c++)e[c]=new i(o,p,u),p+=v;else if(s===3){f=+l[1];for(var d=+l[2],h=0;h<d;h++)for(e[h]=[],c=0;c<f;c++)e[h][c]=new i(o,p,u),p+=v}else throw new Error("ndim: "+s+'is not supported with the shape:"'+r.shape+'"');return e.bdata=r.bdata,e.dtype=r.dtype,e.shape=l.reverse().join(","),t._inputArray=e,e};sr.isTypedArraySpec=function(t){return jM(t)&&t.hasOwnProperty("dtype")&&typeof t.dtype=="string"&&t.hasOwnProperty("bdata")&&(typeof t.bdata=="string"||Ih(t.bdata))&&(t.shape===void 0||t.hasOwnProperty("shape")&&(typeof t.shape=="string"||typeof t.shape=="number"))};function VM(t){return{bdata:t.bdata,dtype:t.dtype,shape:t.shape}}sr.concat=function(){var t=[],e=!0,r=0,a,i,n,o,l,s,f,c;for(n=0;n<arguments.length;n++)o=arguments[n],s=o.length,s&&(i?t.push(o):(i=o,l=s),Rh(o)?a=!1:(e=!1,r?a!==o.constructor&&(a=!1):a=o.constructor),r+=s);if(!r)return[];if(!t.length)return i;if(e)return i.concat.apply(i,t);if(a){for(f=new a(r),f.set(i),n=0;n<t.length;n++)o=t[n],f.set(o,l),l+=o.length;return f}for(f=new Array(r),c=0;c<i.length;c++)f[c]=i[c];for(n=0;n<t.length;n++){for(o=t[n],c=0;c<o.length;c++)f[l+c]=o[c];l+=c}return f};sr.maxRowLength=function(t){return r_(t,Math.max,0)};sr.minRowLength=function(t){return r_(t,Math.min,1/0)};function r_(t,e,r){if(Jf(t))if(Jf(t[0])){for(var a=r,i=0;i<t.length;i++)a=e(a,t[i].length);return a}else return t.length;return 0}var a_=kt,Fh=sr.isArrayOrTypedArray,Nh=function(e,r){if(a_(r))r=String(r);else if(typeof r!="string"||r.substr(r.length-4)==="[-1]")throw"bad property string";var a=r.split("."),i,n,o,l;for(l=0;l<a.length;l++)if(String(a[l]).slice(0,2)==="__")throw"bad property string";for(l=0;l<a.length;){if(i=String(a[l]).match(/^([^\[\]]*)((\[\-?[0-9]*\])+)$/),i){if(i[1])a[l]=i[1];else if(l===0)a.splice(0,1);else throw"bad property string";for(n=i[2].substr(1,i[2].length-2).split("]["),o=0;o<n.length;o++)l++,a.splice(l,0,Number(n[o]))}l++}return typeof e!="object"?qM(e,r,a):{set:n_(e,a,r),get:i_(e,a),astr:r,parts:a,obj:e}};function i_(t,e){return function(r){var a=t,i,n,o,l,s;for(l=0;l<e.length-1;l++){if(i=e[l],i===-1){for(n=!0,o=[],s=0;s<a.length;s++)o[s]=i_(a[s],e.slice(l+1))(r),o[s]!==o[0]&&(n=!1);return n?o[0]:o}if(typeof i=="number"&&!Fh(a)||(a=a[i],typeof a!="object"||a===null))return}if(!(typeof a!="object"||a===null)&&(o=a[e[l]],!(!r&&o===null)))return o}}var WM=/(^|\.)args\[/;function Ed(t,e){return t===void 0||t===null&&!e.match(WM)}function n_(t,e,r){return function(a){var i=t,n="",o=Ed(a,r),l,s;for(s=0;s<e.length-1;s++){if(l=e[s],typeof l=="number"&&!Fh(i))throw"array index but container is not an array";if(l===-1){if(o=!YM(i,e.slice(s+1),a,r),o)break;return}if(!o_(i,l,e[s+1],o))break;if(i=i[l],typeof i!="object"||i===null)throw"container is not an object";n=XM(n,l)}if(o){if(s===e.length-1&&(delete i[e[s]],Array.isArray(i)&&+e[s]===i.length-1))for(;i.length&&i[i.length-1]===void 0;)i.pop()}else i[e[s]]=a}}function XM(t,e){var r=e;return a_(e)?r="["+e+"]":t&&(r="."+e),t+r}function YM(t,e,r,a){var i=Fh(r),n=!0,o=r,l=a.replace("-1",0),s=i?!1:Ed(r,l),f=e[0],c;for(c=0;c<t.length;c++)l=a.replace("-1",c),i&&(o=r[c%r.length],s=Ed(o,l)),s&&(n=!1),o_(t,c,f,s)&&n_(t[c],e,a.replace("-1",c))(o);return n}function o_(t,e,r,a){if(t[e]===void 0){if(a)return!1;typeof r=="number"?t[e]=[]:t[e]={}}return!0}function qM(t,e,r){return{set:function(){throw"bad container"},get:function(){},astr:e,parts:r,obj:t}}var Nn=Nh,ZM=/^\w*$/,KM=0,_m=1,Ls=2,wm=3,Yi=4,QM=function(e,r,a,i){a=a||"name",i=i||"value";var n,o,l,s={};r&&r.length?(l=Nn(e,r),o=l.get()):o=e,r=r||"";var f={};if(o)for(n=0;n<o.length;n++)f[o[n][a]]=n;var c=ZM.test(i),u={set:function(v,p){var d=p===null?Yi:KM;if(!o){if(!l||d===Yi)return;o=[],l.set(o)}var h=f[v];if(h===void 0){if(d===Yi)return;d=d|wm,h=o.length,f[v]=h}else p!==(c?o[h][i]:Nn(o[h],i).get())&&(d=d|Ls);var m=o[h]=o[h]||{};return m[a]=v,c?m[i]=p:Nn(m,i).set(p),p!==null&&(d=d&~Yi),s[h]=s[h]|d,u},get:function(v){if(o){var p=f[v];if(p!==void 0)return c?o[p][i]:Nn(o[p],i).get()}},rename:function(v,p){var d=f[v];return d===void 0||(s[d]=s[d]|_m,f[p]=d,delete f[v],o[d][a]=p),u},remove:function(v){var p=f[v];if(p===void 0)return u;var d=o[p];if(Object.keys(d).length>2)return s[p]=s[p]|Ls,u.set(v,null);if(c){for(n=p;n<o.length;n++)s[n]=s[n]|wm;for(n=p;n<o.length;n++)f[o[n][a]]--;o.splice(p,1),delete f[v]}else Nn(d,i).set(null),s[p]=s[p]|Ls|Yi;return u},constructUpdate:function(){for(var v,p,d={},h=Object.keys(s),m=0;m<h.length;m++)p=h[m],v=r+"["+p+"]",o[p]?(s[p]&_m&&(d[v+"."+a]=o[p][a]),s[p]&Ls&&(c?d[v+"."+i]=s[p]&Yi?null:o[p][i]:d[v+"."+i]=s[p]&Yi?null:Nn(o[p],i).get())):d[v]=null;return d}};return u},JM=/^(.*)(\.[^\.\[\]]+|\[\d\])$/,eS=/^[^\.\[\]]+$/,tS=function(t,e){for(;e;){var r=t.match(JM);if(r)t=r[1];else if(t.match(eS))t="";else throw new Error("bad relativeAttr call:"+[t,e]);if(e.charAt(0)==="^")e=e.slice(1);else break}return t&&e.charAt(0)!=="["?t+"."+e:t+e},rS=kt,Hh=function(e,r){if(e>0)return Math.log(e)/Math.LN10;var a=Math.log(Math.min(r[0],r[1]))/Math.LN10;return rS(a)||(a=Math.log(Math.max(r[0],r[1]))/Math.LN10-6),a},Tm=sr.isArrayOrTypedArray,el=Dn,aS=function t(e,r){for(var a in r){var i=r[a],n=e[a];if(n!==i)if(a.charAt(0)==="_"||typeof i=="function"){if(a in e)continue;e[a]=i}else if(Tm(i)&&Tm(n)&&el(i[0])){if(a==="customdata"||a==="ids")continue;for(var o=Math.min(i.length,n.length),l=0;l<o;l++)n[l]!==i[l]&&el(i[l])&&el(n[l])&&t(n[l],i[l])}else el(i)&&el(n)&&(t(n,i),Object.keys(n).length||delete e[a])}};function iS(t,e){var r=t%e;return r<0?r+e:r}function nS(t,e){return Math.abs(t)>e/2?t-Math.round(t/e)*e:t}var us={mod:iS,modHalf:nS},l_={},Xt={},km=Dn,tl=Array.isArray;function oS(t,e){var r,a;for(r=0;r<t.length;r++){if(a=t[r],a!==null&&typeof a=="object")return!1;a!==void 0&&(e[r]=a)}return!0}Xt.extendFlat=function(){return vs(arguments,!1,!1,!1)};Xt.extendDeep=function(){return vs(arguments,!0,!1,!1)};Xt.extendDeepAll=function(){return vs(arguments,!0,!0,!1)};Xt.extendDeepNoArrays=function(){return vs(arguments,!0,!1,!0)};function vs(t,e,r,a){var i=t[0],n=t.length,o,l,s,f,c,u,v;if(n===2&&tl(i)&&tl(t[1])&&i.length===0){if(v=oS(t[1],i),v)return i;i.splice(0,i.length)}for(var p=1;p<n;p++){o=t[p];for(l in o)s=i[l],f=o[l],a&&tl(f)?i[l]=f:e&&f&&(km(f)||(c=tl(f)))?(c?(c=!1,u=s&&tl(s)?s:[]):u=s&&km(s)?s:{},i[l]=vs([u,f],e,r,a)):(typeof f<"u"||r)&&(i[l]=f)}return i}var Mr=function(t){var e=t.variantValues,r=t.editType,a=t.colorEditType;a===void 0&&(a=r);var i={editType:r,valType:"integer",min:1,max:1e3,extras:["normal","bold"],dflt:"normal",description:["Sets the weight (or boldness) of the font."].join(" ")};t.noNumericWeightValues&&(i.valType="enumerated",i.values=i.extras,i.extras=void 0,i.min=void 0,i.max=void 0);var n={family:{valType:"string",noBlank:!0,strict:!0,editType:r,description:["HTML font family - the typeface that will be applied by the web browser.","The web browser can only apply a font if it is available on the system where","it runs. Provide multiple font families, separated by commas, to indicate","the order in which to apply fonts if they aren't available."].join(" ")},size:{valType:"number",min:1,editType:r},color:{valType:"color",editType:a},weight:i,style:{editType:r,valType:"enumerated",values:["normal","italic"],dflt:"normal",description:["Sets whether a font should be styled with a normal or italic face from its family."].join(" ")},variant:t.noFontVariant?void 0:{editType:r,valType:"enumerated",values:e||["normal","small-caps","all-small-caps","all-petite-caps","petite-caps","unicase"],dflt:"normal",description:["Sets the variant of the font."].join(" ")},textcase:t.noFontTextcase?void 0:{editType:r,valType:"enumerated",values:["normal","word caps","upper","lower"],dflt:"normal",description:["Sets capitalization of text.","It can be used to make text appear in all-uppercase or all-lowercase,","or with each word capitalized."].join(" ")},lineposition:t.noFontLineposition?void 0:{editType:r,valType:"flaglist",flags:["under","over","through"],extras:["none"],dflt:"none",description:["Sets the kind of decoration line(s) with text,","such as an *under*, *over* or *through*","as well as combinations e.g. *under+over*, etc."].join(" ")},shadow:t.noFontShadow?void 0:{editType:r,valType:"string",dflt:t.autoShadowDflt?"auto":"none",description:["Sets the shape and color of the shadow behind text.","*auto* places minimal shadow and applies contrast text font color.","See https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow for additional options."].join(" ")},editType:r,description:""+(t.description||"")};return t.autoSize&&(n.size.dflt="auto"),t.autoColor&&(n.color.dflt="auto"),t.arrayOk&&(n.family.arrayOk=!0,n.weight.arrayOk=!0,n.style.arrayOk=!0,t.noFontVariant||(n.variant.arrayOk=!0),t.noFontTextcase||(n.textcase.arrayOk=!0),t.noFontLineposition||(n.lineposition.arrayOk=!0),t.noFontShadow||(n.shadow.arrayOk=!0),n.size.arrayOk=!0,n.color.arrayOk=!0),n},Fc={YANGLE:60,HOVERARROWSIZE:6,HOVERTEXTPAD:3,HOVERFONTSIZE:13,HOVERFONT:"Arial, sans-serif",HOVERMINTIME:50,HOVERID:"-hover"},s_=Fc,f_=Mr,Oh=f_({editType:"none",description:"Sets the default hover label font used by all traces on the graph."});Oh.family.dflt=s_.HOVERFONT;Oh.size.dflt=s_.HOVERFONTSIZE;var ds={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"],description:["Determines the mode of single click interactions.","*event* is the default value and emits the `plotly_click`","event. In addition this mode emits the `plotly_selected` event","in drag modes *lasso* and *select*, but with no event data attached","(kept for compatibility reasons).","The *select* flag enables selecting single","data points via click. This mode also supports persistent selections,","meaning that pressing Shift while clicking, adds to / subtracts from an","existing selection. *select* with `hovermode`: *x* can be confusing, consider","explicitly setting `hovermode`: *closest* when using this feature.","Selection events are sent accordingly as long as *event* flag is set as well.","When the *event* flag is missing, `plotly_click` and `plotly_selected`","events are not fired."].join(" ")},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","drawclosedpath","drawopenpath","drawline","drawrect","drawcircle","orbit","turntable",!1],dflt:"zoom",editType:"modebar",description:["Determines the mode of drag interactions.","*select* and *lasso* apply only to scatter traces with","markers or text. *orbit* and *turntable* apply only to","3D scenes."].join(" ")},hovermode:{valType:"enumerated",values:["x","y","closest",!1,"x unified","y unified"],dflt:"closest",editType:"modebar",description:["Determines the mode of hover interactions.","If *closest*, a single hoverlabel will appear","for the *closest* point within the `hoverdistance`.","If *x* (or *y*), multiple hoverlabels will appear for multiple points","at the *closest* x- (or y-) coordinate within the `hoverdistance`,","with the caveat that no more than one hoverlabel will appear per trace.","If *x unified* (or *y unified*), a single hoverlabel will appear","multiple points at the closest x- (or y-) coordinate within the `hoverdistance`","with the caveat that no more than one hoverlabel will appear per trace.","In this mode, spikelines are enabled by default perpendicular to the specified axis.","If false, hover interactions are disabled."].join(" ")},hoversubplots:{valType:"enumerated",values:["single","overlaying","axis"],dflt:"overlaying",editType:"none",description:["Determines expansion of hover effects to other subplots","If *single* just the axis pair of the primary point is included without overlaying subplots.","If *overlaying* all subplots using the main axis and occupying the same space are included.","If *axis*, also include stacked subplots using the same axis","when `hovermode` is set to *x*, *x unified*, *y* or *y unified*."].join(" ")},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none",description:["Sets the default distance (in pixels) to look for data","to add hover labels (-1 means no cutoff, 0 means no looking for data).","This is only a real distance for hovering on point-like objects,","like scatter points. For area-like objects (bars, scatter fills, etc)","hovering is on inside the area and off outside, but these objects","will not supersede hover on point-like objects in case of conflict."].join(" ")},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none",description:["Sets the default distance (in pixels) to look for data to draw","spikelines to (-1 means no cutoff, 0 means no looking for data).","As with hoverdistance, distance does not apply to area-like objects.","In addition, some objects can be hovered on but will not generate","spikelines, such as scatter fills."].join(" ")},hoverlabel:{bgcolor:{valType:"color",editType:"none",description:["Sets the background color of all hover labels on graph"].join(" ")},bordercolor:{valType:"color",editType:"none",description:["Sets the border color of all hover labels on graph."].join(" ")},font:Oh,grouptitlefont:f_({editType:"none",description:["Sets the font for group titles in hover (unified modes).","Defaults to `hoverlabel.font`."].join(" ")}),align:{valType:"enumerated",values:["left","right","auto"],dflt:"auto",editType:"none",description:["Sets the horizontal alignment of the text content within hover label box.","Has an effect only if the hover label text spans more two or more lines"].join(" ")},namelength:{valType:"integer",min:-1,dflt:15,editType:"none",description:["Sets the default length (in number of characters) of the trace name in","the hover labels for all traces. -1 shows the whole name","regardless of length. 0-3 shows the first 0-3 characters, and","an integer >3 will show the whole name if it is less than that","many characters, but if it is longer, will truncate to","`namelength - 3` characters and add an ellipsis."].join(" ")},editType:"none"},selectdirection:{valType:"enumerated",values:["h","v","d","any"],dflt:"any",description:["When `dragmode` is set to *select*, this limits the selection of the drag to","horizontal, vertical or diagonal. *h* only allows horizontal selection,","*v* only vertical, *d* only diagonal and *any* sets no limit."].join(" "),editType:"none"}},lS=Mr,Cs=ds.hoverlabel,Ds=Xt.extendFlat,Nc={hoverlabel:{bgcolor:Ds({},Cs.bgcolor,{arrayOk:!0,description:"Sets the background color of the hover labels for this trace"}),bordercolor:Ds({},Cs.bordercolor,{arrayOk:!0,description:"Sets the border color of the hover labels for this trace."}),font:lS({arrayOk:!0,editType:"none",description:"Sets the font used in hover labels."}),align:Ds({},Cs.align,{arrayOk:!0}),namelength:Ds({},Cs.namelength,{arrayOk:!0}),editType:"none"}},sS=Mr,fS=Nc,wa={type:{valType:"enumerated",values:[],dflt:"scatter",editType:"calc+clearAxisTypes",_noTemplating:!0},visible:{valType:"enumerated",values:[!0,!1,"legendonly"],dflt:!0,editType:"calc",description:["Determines whether or not this trace is visible.","If *legendonly*, the trace is not drawn,","but can appear as a legend item","(provided that the legend itself is visible)."].join(" ")},showlegend:{valType:"boolean",dflt:!0,editType:"style",description:["Determines whether or not an item corresponding to this","trace is shown in the legend."].join(" ")},legend:{valType:"subplotid",dflt:"legend",editType:"style",description:["Sets the reference to a legend to show this trace in.","References to these legends are *legend*, *legend2*, *legend3*, etc.","Settings for these legends are set in the layout, under","`layout.legend`, `layout.legend2`, etc."].join(" ")},legendgroup:{valType:"string",dflt:"",editType:"style",description:["Sets the legend group for this trace.","Traces and shapes part of the same legend group hide/show at the same time","when toggling legend items."].join(" ")},legendgrouptitle:{text:{valType:"string",dflt:"",editType:"style",description:["Sets the title of the legend group."].join(" ")},font:sS({editType:"style",description:["Sets this legend group's title font."].join(" ")}),editType:"style"},legendrank:{valType:"number",dflt:1e3,editType:"style",description:["Sets the legend rank for this trace.","Items and groups with smaller ranks are presented on top/left side while","with *reversed* `legend.traceorder` they are on bottom/right side.","The default legendrank is 1000,","so that you can use ranks less than 1000 to place certain items before all unranked items,","and ranks greater than 1000 to go after all unranked items.","When having unranked or equal rank items shapes would be displayed after traces","i.e. according to their order in data and layout."].join(" ")},legendwidth:{valType:"number",min:0,editType:"style",description:"Sets the width (in px or fraction) of the legend for this trace."},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"style",description:"Sets the opacity of the trace."},name:{valType:"string",editType:"style",description:["Sets the trace name.","The trace name appears as the legend item and on hover."].join(" ")},uid:{valType:"string",editType:"plot",anim:!0,description:["Assign an id to this trace,","Use this to provide object constancy between traces during animations","and transitions."].join(" ")},ids:{valType:"data_array",editType:"calc",anim:!0,description:["Assigns id labels to each datum.","These ids for object constancy of data points during animation.","Should be an array of strings, not numbers or any other type."].join(" ")},customdata:{valType:"data_array",editType:"calc",description:["Assigns extra data each datum.","This may be useful when listening to hover, click and selection events.","Note that, *scatter* traces also appends customdata items in the markers","DOM elements"].join(" ")},meta:{valType:"any",arrayOk:!0,editType:"plot",description:["Assigns extra meta information associated with this trace","that can be used in various text attributes.","Attributes such as trace `name`, graph, axis and colorbar `title.text`, annotation `text`","`rangeselector`, `updatemenues` and `sliders` `label` text","all support `meta`.","To access the trace `meta` values in an attribute in the same trace, simply use","`%{meta[i]}` where `i` is the index or key of the `meta`","item in question.","To access trace `meta` in layout attributes, use","`%{data[n[.meta[i]}` where `i` is the index or key of the `meta`","and `n` is the trace index."].join(" ")},selectedpoints:{valType:"any",editType:"calc",description:["Array containing integer indices of selected points.","Has an effect only for traces that support selections.","Note that an empty array means an empty selection where the `unselected`","are turned on for all points, whereas, any other non-array values means no","selection all where the `selected` and `unselected` styles have no effect."].join(" ")},hoverinfo:{valType:"flaglist",flags:["x","y","z","text","name"],extras:["all","none","skip"],arrayOk:!0,dflt:"all",editType:"none",description:["Determines which trace information appear on hover.","If `none` or `skip` are set, no information is displayed upon hovering.","But, if `none` is set, click and hover events are still fired."].join(" ")},hoverlabel:fS.hoverlabel,stream:{token:{valType:"string",noBlank:!0,strict:!0,editType:"calc",description:["The stream id number links a data trace on a plot with a stream.","See https://chart-studio.plotly.com/settings for more details."].join(" ")},maxpoints:{valType:"number",min:0,max:1e4,dflt:500,editType:"calc",description:["Sets the maximum number of points to keep on the plots from an","incoming stream.","If `maxpoints` is set to *50*, only the newest 50 points will","be displayed on the plot."].join(" ")},editType:"calc"},uirevision:{valType:"any",editType:"none",description:["Controls persistence of some user-driven changes to the trace:","`constraintrange` in `parcoords` traces, as well as some","`editable: true` modifications such as `name` and `colorbar.title`.","Defaults to `layout.uirevision`.","Note that other user-driven trace attribute changes are controlled","by `layout` attributes:","`trace.visible` is controlled by `layout.legend.uirevision`,","`selectedpoints` is controlled by `layout.selectionrevision`,","and `colorbar.(x|y)` (accessible with `config: {editable: true}`)","is controlled by `layout.editrevision`.","Trace changes are tracked by `uid`, which only falls back on trace","index if no `uid` is provided. So if your app can add/remove traces","before the end of the `data` array, such that the same trace has a","different index, you can still preserve user-driven changes if you","give each trace a `uid` that stays with it as it moves."].join(" ")}},cS=_a,Hc={Greys:[[0,"rgb(0,0,0)"],[1,"rgb(255,255,255)"]],YlGnBu:[[0,"rgb(8,29,88)"],[.125,"rgb(37,52,148)"],[.25,"rgb(34,94,168)"],[.375,"rgb(29,145,192)"],[.5,"rgb(65,182,196)"],[.625,"rgb(127,205,187)"],[.75,"rgb(199,233,180)"],[.875,"rgb(237,248,217)"],[1,"rgb(255,255,217)"]],Greens:[[0,"rgb(0,68,27)"],[.125,"rgb(0,109,44)"],[.25,"rgb(35,139,69)"],[.375,"rgb(65,171,93)"],[.5,"rgb(116,196,118)"],[.625,"rgb(161,217,155)"],[.75,"rgb(199,233,192)"],[.875,"rgb(229,245,224)"],[1,"rgb(247,252,245)"]],YlOrRd:[[0,"rgb(128,0,38)"],[.125,"rgb(189,0,38)"],[.25,"rgb(227,26,28)"],[.375,"rgb(252,78,42)"],[.5,"rgb(253,141,60)"],[.625,"rgb(254,178,76)"],[.75,"rgb(254,217,118)"],[.875,"rgb(255,237,160)"],[1,"rgb(255,255,204)"]],Bluered:[[0,"rgb(0,0,255)"],[1,"rgb(255,0,0)"]],RdBu:[[0,"rgb(5,10,172)"],[.35,"rgb(106,137,247)"],[.5,"rgb(190,190,190)"],[.6,"rgb(220,170,132)"],[.7,"rgb(230,145,90)"],[1,"rgb(178,10,28)"]],Reds:[[0,"rgb(220,220,220)"],[.2,"rgb(245,195,157)"],[.4,"rgb(245,160,105)"],[1,"rgb(178,10,28)"]],Blues:[[0,"rgb(5,10,172)"],[.35,"rgb(40,60,190)"],[.5,"rgb(70,100,245)"],[.6,"rgb(90,120,245)"],[.7,"rgb(106,137,247)"],[1,"rgb(220,220,220)"]],Picnic:[[0,"rgb(0,0,255)"],[.1,"rgb(51,153,255)"],[.2,"rgb(102,204,255)"],[.3,"rgb(153,204,255)"],[.4,"rgb(204,204,255)"],[.5,"rgb(255,255,255)"],[.6,"rgb(255,204,255)"],[.7,"rgb(255,153,255)"],[.8,"rgb(255,102,204)"],[.9,"rgb(255,102,102)"],[1,"rgb(255,0,0)"]],Rainbow:[[0,"rgb(150,0,90)"],[.125,"rgb(0,0,200)"],[.25,"rgb(0,25,255)"],[.375,"rgb(0,152,255)"],[.5,"rgb(44,255,150)"],[.625,"rgb(151,255,0)"],[.75,"rgb(255,234,0)"],[.875,"rgb(255,111,0)"],[1,"rgb(255,0,0)"]],Portland:[[0,"rgb(12,51,131)"],[.25,"rgb(10,136,186)"],[.5,"rgb(242,211,56)"],[.75,"rgb(242,143,56)"],[1,"rgb(217,30,30)"]],Jet:[[0,"rgb(0,0,131)"],[.125,"rgb(0,60,170)"],[.375,"rgb(5,255,255)"],[.625,"rgb(255,255,0)"],[.875,"rgb(250,0,0)"],[1,"rgb(128,0,0)"]],Hot:[[0,"rgb(0,0,0)"],[.3,"rgb(230,0,0)"],[.6,"rgb(255,210,0)"],[1,"rgb(255,255,255)"]],Blackbody:[[0,"rgb(0,0,0)"],[.2,"rgb(230,0,0)"],[.4,"rgb(230,210,0)"],[.7,"rgb(255,255,255)"],[1,"rgb(160,200,255)"]],Earth:[[0,"rgb(0,0,130)"],[.1,"rgb(0,180,180)"],[.2,"rgb(40,210,40)"],[.4,"rgb(230,230,50)"],[.6,"rgb(120,70,20)"],[1,"rgb(255,255,255)"]],Electric:[[0,"rgb(0,0,0)"],[.15,"rgb(30,0,100)"],[.4,"rgb(120,0,100)"],[.6,"rgb(160,90,0)"],[.8,"rgb(230,200,0)"],[1,"rgb(255,250,220)"]],Viridis:[[0,"#440154"],[.06274509803921569,"#48186a"],[.12549019607843137,"#472d7b"],[.18823529411764706,"#424086"],[.25098039215686274,"#3b528b"],[.3137254901960784,"#33638d"],[.3764705882352941,"#2c728e"],[.4392156862745098,"#26828e"],[.5019607843137255,"#21918c"],[.5647058823529412,"#1fa088"],[.6274509803921569,"#28ae80"],[.6901960784313725,"#3fbc73"],[.7529411764705882,"#5ec962"],[.8156862745098039,"#84d44b"],[.8784313725490196,"#addc30"],[.9411764705882353,"#d8e219"],[1,"#fde725"]],Cividis:[[0,"rgb(0,32,76)"],[.058824,"rgb(0,42,102)"],[.117647,"rgb(0,52,110)"],[.176471,"rgb(39,63,108)"],[.235294,"rgb(60,74,107)"],[.294118,"rgb(76,85,107)"],[.352941,"rgb(91,95,109)"],[.411765,"rgb(104,106,112)"],[.470588,"rgb(117,117,117)"],[.529412,"rgb(131,129,120)"],[.588235,"rgb(146,140,120)"],[.647059,"rgb(161,152,118)"],[.705882,"rgb(176,165,114)"],[.764706,"rgb(192,177,109)"],[.823529,"rgb(209,191,102)"],[.882353,"rgb(225,204,92)"],[.941176,"rgb(243,219,79)"],[1,"rgb(255,233,69)"]]},c_=Hc.RdBu;function uS(t,e){if(e||(e=c_),!t)return e;function r(){try{t=Hc[t]||JSON.parse(t)}catch{t=e}}return typeof t=="string"&&(r(),typeof t=="string"&&r()),u_(t)?t:e}function u_(t){var e=0;if(!Array.isArray(t)||t.length<2||!t[0]||!t[t.length-1]||+t[0][0]!=0||+t[t.length-1][0]!=1)return!1;for(var r=0;r<t.length;r++){var a=t[r];if(a.length!==2||+a[0]<e||!cS(a[1]).isValid())return!1;e=+a[0]}return!0}function vS(t){return Hc[t]!==void 0?!0:u_(t)}var jo={scales:Hc,defaultScale:c_,get:uS,isValid:vS},v_={exports:{}},Or={};Or.defaults=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"];Or.defaultLine="#444";Or.lightLine="#eee";Or.background="#fff";Or.borderLine="#BEC8D9";Or.lightFraction=100*10/11;var ea=_a,dS=kt,hS=sr.isTypedArray,_r=v_.exports={},Oc=Or;_r.defaults=Oc.defaults;var pS=_r.defaultLine=Oc.defaultLine;_r.lightLine=Oc.lightLine;var zd=_r.background=Oc.background;_r.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"};_r.rgb=function(t){return _r.tinyRGB(ea(t))};_r.opacity=function(t){return t?ea(t).getAlpha():0};_r.addOpacity=function(t,e){var r=ea(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"};_r.combine=function(t,e){var r=ea(t).toRgb();if(r.a===1)return ea(t).toRgbString();var a=ea(e||zd).toRgb(),i=a.a===1?a:{r:255*(1-a.a)+a.r*a.a,g:255*(1-a.a)+a.g*a.a,b:255*(1-a.a)+a.b*a.a},n={r:i.r*(1-r.a)+r.r*r.a,g:i.g*(1-r.a)+r.g*r.a,b:i.b*(1-r.a)+r.b*r.a};return ea(n).toRgbString()};_r.interpolate=function(t,e,r){var a=ea(t).toRgb(),i=ea(e).toRgb(),n={r:r*a.r+(1-r)*i.r,g:r*a.g+(1-r)*i.g,b:r*a.b+(1-r)*i.b};return ea(n).toRgbString()};_r.contrast=function(t,e,r){var a=ea(t);a.getAlpha()!==1&&(a=ea(_r.combine(t,zd)));var i=a.isDark()?e?a.lighten(e):zd:r?a.darken(r):pS;return i.toString()};_r.stroke=function(t,e){var r=ea(e);t.style({stroke:_r.tinyRGB(r),"stroke-opacity":r.getAlpha()})};_r.fill=function(t,e){var r=ea(e);t.style({fill:_r.tinyRGB(r),"fill-opacity":r.getAlpha()})};_r.clean=function(t){if(!(!t||typeof t!="object")){var e=Object.keys(t),r,a,i,n;for(r=0;r<e.length;r++)if(i=e[r],n=t[i],i.substr(i.length-5)==="color")if(Array.isArray(n))for(a=0;a<n.length;a++)n[a]=Pu(n[a]);else t[i]=Pu(n);else if(i.substr(i.length-10)==="colorscale"&&Array.isArray(n))for(a=0;a<n.length;a++)Array.isArray(n[a])&&(n[a][1]=Pu(n[a][1]));else if(Array.isArray(n)){var o=n[0];if(!Array.isArray(o)&&o&&typeof o=="object")for(a=0;a<n.length;a++)_r.clean(n[a])}else n&&typeof n=="object"&&!hS(n)&&_r.clean(n)}};function Pu(t){if(dS(t)||typeof t!="string")return t;var e=t.trim();if(e.substr(0,3)!=="rgb")return t;var r=e.match(/^rgba?\s*\(([^()]*)\)$/);if(!r)return t;var a=r[1].trim().split(/\s*[\s,]\s*/),i=e.charAt(3)==="a"&&a.length===4;if(!i&&a.length!==3)return t;for(var n=0;n<a.length;n++){if(!a[n].length||(a[n]=Number(a[n]),!(a[n]>=0)))return t;if(n===3)a[n]>1&&(a[n]=1);else if(a[n]>=1)return t}var o=Math.round(a[0]*255)+", "+Math.round(a[1]*255)+", "+Math.round(a[2]*255);return i?"rgba("+o+", "+a[3]+")":"rgb("+o+")"}var yt=v_.exports,hs={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2},Bo={};Bo.counter=function(t,e,r,a){var i=(e||"")+(r?"":"$"),n=a===!1?"":"^";return t==="xy"?new RegExp(n+"x([2-9]|[1-9][0-9]+)?y([2-9]|[1-9][0-9]+)?"+i):new RegExp(n+t+"([2-9]|[1-9][0-9]+)?"+i)};(function(t){var e=kt,r=_a,a=Xt.extendFlat,i=wa,n=jo,o=yt,l=hs.DESELECTDIM,s=Nh,f=Bo.counter,c=us.modHalf,u=sr.isArrayOrTypedArray,v=sr.isTypedArraySpec,p=sr.decodeTypedArraySpec;t.valObjectMeta={data_array:{description:["An {array} of data.","The value must represent an {array} or it will be ignored,","but this array can be provided in several forms:","(1) a regular {array} object","(2) a typed array (e.g. Float32Array)","(3) an object with keys dtype, bdata, and optionally shape.","In this 3rd form, dtype is one of","*f8*, *f4*.","*i4*, *u4*,","*i2*, *u2*,","*i1*, *u1* or *u1c* for Uint8ClampedArray.","In addition to shorthand `dtype` above one could also use the following forms:","*float64*, *float32*,","*int32*, *uint32*,","*int16*, *uint16*,","*int8*, *uint8* or *uint8c* for Uint8ClampedArray.","`bdata` is either a base64-encoded string or the ArrayBuffer of","an integer or float typed array.","For either multi-dimensional arrays you must also","provide its dimensions separated by comma via `shape`.","For example using `dtype`: *f4* and `shape`: *5,100* you can","declare a 2-D array that has 5 rows and 100 columns","containing float32 values i.e. 4 bits per value.","`shape` is optional for one dimensional arrays."].join(" "),requiredOpts:[],otherOpts:["dflt"],coerceFunction:function(h,m,y){m.set(u(h)?h:v(h)?p(h):y)}},enumerated:{description:["Enumerated value type. The available values are listed","in `values`."].join(" "),requiredOpts:["values"],otherOpts:["dflt","coerceNumber","arrayOk"],coerceFunction:function(h,m,y,b){b.coerceNumber&&(h=+h),b.values.indexOf(h)===-1?m.set(y):m.set(h)},validateFunction:function(h,m){m.coerceNumber&&(h=+h);for(var y=m.values,b=0;b<y.length;b++){var _=String(y[b]);if(_.charAt(0)==="/"&&_.charAt(_.length-1)==="/"){var g=new RegExp(_.substr(1,_.length-2));if(g.test(h))return!0}else if(h===y[b])return!0}return!1}},boolean:{description:"A boolean (true/false) value.",requiredOpts:[],otherOpts:["dflt"],coerceFunction:function(h,m,y){h===!0||h===!1?m.set(h):m.set(y)}},number:{description:["A number or a numeric value","(e.g. a number inside a string).","When applicable, values greater (less) than `max` (`min`)","are coerced to the `dflt`."].join(" "),requiredOpts:[],otherOpts:["dflt","min","max","arrayOk"],coerceFunction:function(h,m,y,b){v(h)&&(h=p(h)),!e(h)||b.min!==void 0&&h<b.min||b.max!==void 0&&h>b.max?m.set(y):m.set(+h)}},integer:{description:["An integer or an integer inside a string.","When applicable, values greater (less) than `max` (`min`)","are coerced to the `dflt`."].join(" "),requiredOpts:[],otherOpts:["dflt","min","max","arrayOk","extras"],coerceFunction:function(h,m,y,b){if((b.extras||[]).indexOf(h)!==-1){m.set(h);return}v(h)&&(h=p(h)),h%1||!e(h)||b.min!==void 0&&h<b.min||b.max!==void 0&&h>b.max?m.set(y):m.set(+h)}},string:{description:["A string value.","Numbers are converted to strings except for attributes with","`strict` set to true."].join(" "),requiredOpts:[],otherOpts:["dflt","noBlank","strict","arrayOk","values"],coerceFunction:function(h,m,y,b){if(typeof h!="string"){var _=typeof h=="number";b.strict===!0||!_?m.set(y):m.set(String(h))}else b.noBlank&&!h?m.set(y):m.set(h)}},color:{description:["A string describing color.","Supported formats:","- hex (e.g. '#d3d3d3')","- rgb (e.g. 'rgb(255, 0, 0)')","- rgba (e.g. 'rgb(255, 0, 0, 0.5)')","- hsl (e.g. 'hsl(0, 100%, 50%)')","- hsv (e.g. 'hsv(0, 100%, 100%)')","- named colors (full list: http://www.w3.org/TR/css3-color/#svg-color)"].join(" "),requiredOpts:[],otherOpts:["dflt","arrayOk"],coerceFunction:function(h,m,y){v(h)&&(h=p(h)),r(h).isValid()?m.set(h):m.set(y)}},colorlist:{description:["A list of colors.","Must be an {array} containing valid colors."].join(" "),requiredOpts:[],otherOpts:["dflt"],coerceFunction:function(h,m,y){function b(_){return r(_).isValid()}!Array.isArray(h)||!h.length?m.set(y):h.every(b)?m.set(h):m.set(y)}},colorscale:{description:["A Plotly colorscale either picked by a name:","(any of",Object.keys(n.scales).join(", "),")","customized as an {array} of 2-element {arrays} where","the first element is the normalized color level value","(starting at *0* and ending at *1*),","and the second item is a valid color string."].join(" "),requiredOpts:[],otherOpts:["dflt"],coerceFunction:function(h,m,y){m.set(n.get(h,y))}},angle:{description:["A number (in degree) between -180 and 180."].join(" "),requiredOpts:[],otherOpts:["dflt","arrayOk"],coerceFunction:function(h,m,y){v(h)&&(h=p(h)),h==="auto"?m.set("auto"):e(h)?m.set(c(+h,360)):m.set(y)}},subplotid:{description:["An id string of a subplot type (given by dflt), optionally","followed by an integer >1. e.g. if dflt='geo', we can have","'geo', 'geo2', 'geo3', ..."].join(" "),requiredOpts:["dflt"],otherOpts:["regex"],coerceFunction:function(h,m,y,b){var _=b.regex||f(y);if(typeof h=="string"&&_.test(h)){m.set(h);return}m.set(y)},validateFunction:function(h,m){var y=m.dflt;return h===y?!0:typeof h!="string"?!1:!!f(y).test(h)}},flaglist:{description:["A string representing a combination of flags","(order does not matter here).","Combine any of the available `flags` with *+*.","(e.g. ('lines+markers')).","Values in `extras` cannot be combined."].join(" "),requiredOpts:["flags"],otherOpts:["dflt","extras","arrayOk"],coerceFunction:function(h,m,y,b){if((b.extras||[]).indexOf(h)!==-1){m.set(h);return}if(typeof h!="string"){m.set(y);return}for(var _=h.split("+"),g=0;g<_.length;){var x=_[g];b.flags.indexOf(x)===-1||_.indexOf(x)<g?_.splice(g,1):g++}_.length?m.set(_.join("+")):m.set(y)}},any:{description:"Any type.",requiredOpts:[],otherOpts:["dflt","values","arrayOk"],coerceFunction:function(h,m,y){h===void 0?m.set(y):m.set(v(h)?p(h):h)}},info_array:{description:["An {array} of plot information."].join(" "),requiredOpts:["items"],otherOpts:["dflt","freeLength","dimensions"],coerceFunction:function(h,m,y,b){function _(D,P,k){var C,$={set:function(R){C=R}};return k===void 0&&(k=P.dflt),t.valObjectMeta[P.valType].coerceFunction(D,$,k,P),C}if(v(h)&&(h=p(h)),!u(h)){m.set(y);return}var g=b.dimensions===2||b.dimensions==="1-2"&&Array.isArray(h)&&u(h[0]),x=b.items,w=[],T=Array.isArray(x),A=T&&g&&u(x[0]),M=g&&T&&!A,S=T&&!M?x.length:h.length,L,E,F,N,z,H;if(y=Array.isArray(y)?y:[],g)for(L=0;L<S;L++)for(w[L]=[],F=u(h[L])?h[L]:[],M?z=x.length:T?z=x[L].length:z=F.length,E=0;E<z;E++)M?N=x[E]:T?N=x[L][E]:N=x,H=_(F[E],N,(y[L]||[])[E]),H!==void 0&&(w[L][E]=H);else for(L=0;L<S;L++)H=_(h[L],T?x[L]:x,y[L]),H!==void 0&&(w[L]=H);m.set(w)},validateFunction:function(h,m){if(!u(h))return!1;var y=m.items,b=Array.isArray(y),_=m.dimensions===2;if(!m.freeLength&&h.length!==y.length)return!1;for(var g=0;g<h.length;g++)if(_){if(!u(h[g])||!m.freeLength&&h[g].length!==y[g].length)return!1;for(var x=0;x<h[g].length;x++)if(!d(h[g][x],b?y[g][x]:y))return!1}else if(!d(h[g],b?y[g]:y))return!1;return!0}}},t.coerce=function(h,m,y,b,_){var g=s(y,b).get(),x=s(h,b),w=s(m,b),T=x.get(),A=m._template;if(T===void 0&&A&&(T=s(A,b).get(),A=0),_===void 0&&(_=g.dflt),g.arrayOk){if(u(T))return w.set(T),T;if(v(T))return T=p(T),w.set(T),T}var M=t.valObjectMeta[g.valType].coerceFunction;M(T,w,_,g);var S=w.get();return A&&S===_&&!d(T,g)&&(T=s(A,b).get(),M(T,w,_,g),S=w.get()),S},t.coerce2=function(h,m,y,b,_){var g=s(h,b),x=t.coerce(h,m,y,b,_),w=g.get();return w!=null?x:!1},t.coerceFont=function(h,m,y,b){b||(b={}),y=a({},y),y=a(y,b.overrideDflt||{});var _={family:h(m+".family",y.family),size:h(m+".size",y.size),color:h(m+".color",y.color),weight:h(m+".weight",y.weight),style:h(m+".style",y.style)};if(b.noFontVariant||(_.variant=h(m+".variant",y.variant)),b.noFontLineposition||(_.lineposition=h(m+".lineposition",y.lineposition)),b.noFontTextcase||(_.textcase=h(m+".textcase",y.textcase)),!b.noFontShadow){var g=y.shadow;g==="none"&&b.autoShadowDflt&&(g="auto"),_.shadow=h(m+".shadow",g)}return _},t.coercePattern=function(h,m,y,b){var _=h(m+".shape"),g;if(_||(g=h(m+".path")),_||g){_&&h(m+".solidity"),h(m+".size");var x=h(m+".fillmode"),w=x==="overlay";if(!b){var T=h(m+".bgcolor",w?y:void 0);h(m+".fgcolor",w?o.contrast(T):y)}h(m+".fgopacity",w?.5:1)}},t.coerceHoverinfo=function(h,m,y){var b=m._module.attributes,_=b.hoverinfo?b:i,g=_.hoverinfo,x;if(y._dataLength===1){var w=g.dflt==="all"?g.flags.slice():g.dflt.split("+");w.splice(w.indexOf("name"),1),x=w.join("+")}return t.coerce(h,m,_,"hoverinfo",x)},t.coerceSelectionMarkerOpacity=function(h,m){if(h.marker){var y=h.marker.opacity;if(y!==void 0){var b,_;!u(y)&&!h.selected&&!h.unselected&&(b=y,_=l*y),m("selected.marker.opacity",b),m("unselected.marker.opacity",_)}}};function d(h,m){var y=t.valObjectMeta[m.valType];if(m.arrayOk&&u(h))return!0;if(y.validateFunction)return y.validateFunction(h,m);var b={},_=b,g={set:function(x){_=x}};return y.coerceFunction(h,g,b,m),_!==b}t.validate=d})(l_);var d_={},h_={exports:{}},p_={staticPlot:{valType:"boolean",dflt:!1,description:["Determines whether the graphs are interactive or not.","If *false*, no interactivity, for export or image generation."].join(" ")},typesetMath:{valType:"boolean",dflt:!0,description:["Determines whether math should be typeset or not,","when MathJax (either v2 or v3) is present on the page."].join(" ")},plotlyServerURL:{valType:"string",dflt:"",description:["When set it determines base URL for","the 'Edit in Chart Studio' `showEditInChartStudio`/`showSendToCloud` mode bar button","and the showLink/sendData on-graph link.","To enable sending your data to Chart Studio Cloud, you need to","set both `plotlyServerURL` to 'https://chart-studio.plotly.com' and","also set `showSendToCloud` to true."].join(" ")},editable:{valType:"boolean",dflt:!1,description:["Determines whether the graph is editable or not.","Sets all pieces of `edits`","unless a separate `edits` config item overrides individual parts."].join(" ")},edits:{annotationPosition:{valType:"boolean",dflt:!1,description:["Determines if the main anchor of the annotation is editable.","The main anchor corresponds to the","text (if no arrow) or the arrow (which drags the whole thing leaving","the arrow length & direction unchanged)."].join(" ")},annotationTail:{valType:"boolean",dflt:!1,description:["Has only an effect for annotations with arrows.","Enables changing the length and direction of the arrow."].join(" ")},annotationText:{valType:"boolean",dflt:!1,description:"Enables editing annotation text."},axisTitleText:{valType:"boolean",dflt:!1,description:"Enables editing axis title text."},colorbarPosition:{valType:"boolean",dflt:!1,description:"Enables moving colorbars."},colorbarTitleText:{valType:"boolean",dflt:!1,description:"Enables editing colorbar title text."},legendPosition:{valType:"boolean",dflt:!1,description:"Enables moving the legend."},legendText:{valType:"boolean",dflt:!1,description:"Enables editing the trace name fields from the legend"},shapePosition:{valType:"boolean",dflt:!1,description:"Enables moving shapes."},titleText:{valType:"boolean",dflt:!1,description:"Enables editing the global layout title."}},editSelection:{valType:"boolean",dflt:!0,description:"Enables moving selections."},autosizable:{valType:"boolean",dflt:!1,description:["Determines whether the graphs are plotted with respect to","layout.autosize:true and infer its container size."].join(" ")},responsive:{valType:"boolean",dflt:!1,description:["Determines whether to change the layout size when window is resized.","In v3, this option will be removed and will always be true."].join(" ")},fillFrame:{valType:"boolean",dflt:!1,description:["When `layout.autosize` is turned on, determines whether the graph","fills the container (the default) or the screen (if set to *true*)."].join(" ")},frameMargins:{valType:"number",dflt:0,min:0,max:.5,description:["When `layout.autosize` is turned on, set the frame margins","in fraction of the graph size."].join(" ")},scrollZoom:{valType:"flaglist",flags:["cartesian","gl3d","geo","mapbox","map"],extras:[!0,!1],dflt:"gl3d+geo+map",description:["Determines whether mouse wheel or two-finger scroll zooms is enable.","Turned on by default for gl3d, geo, mapbox and map subplots","(as these subplot types do not have zoombox via pan),","but turned off by default for cartesian subplots.","Set `scrollZoom` to *false* to disable scrolling for all subplots."].join(" ")},doubleClick:{valType:"enumerated",values:[!1,"reset","autosize","reset+autosize"],dflt:"reset+autosize",description:["Sets the double click interaction mode.","Has an effect only in cartesian plots.","If *false*, double click is disable.","If *reset*, double click resets the axis ranges to their initial values.","If *autosize*, double click set the axis ranges to their autorange values.","If *reset+autosize*, the odd double clicks resets the axis ranges","to their initial values and even double clicks set the axis ranges","to their autorange values."].join(" ")},doubleClickDelay:{valType:"number",dflt:300,min:0,description:["Sets the delay for registering a double-click in ms.","This is the time interval (in ms) between first mousedown and","2nd mouseup to constitute a double-click.","This setting propagates to all on-subplot double clicks","(except for geo, mapbox and map) and on-legend double clicks."].join(" ")},showAxisDragHandles:{valType:"boolean",dflt:!0,description:["Set to *false* to omit cartesian axis pan/zoom drag handles."].join(" ")},showAxisRangeEntryBoxes:{valType:"boolean",dflt:!0,description:["Set to *false* to omit direct range entry at the pan/zoom drag points,","note that `showAxisDragHandles` must be enabled to have an effect."].join(" ")},showTips:{valType:"boolean",dflt:!0,description:["Determines whether or not tips are shown while interacting","with the resulting graphs."].join(" ")},showLink:{valType:"boolean",dflt:!1,description:["Determines whether a link to Chart Studio Cloud is displayed","at the bottom right corner of resulting graphs.","Use with `sendData` and `linkText`."].join(" ")},linkText:{valType:"string",dflt:"Edit chart",noBlank:!0,description:["Sets the text appearing in the `showLink` link."].join(" ")},sendData:{valType:"boolean",dflt:!0,description:["If *showLink* is true, does it contain data","just link to a Chart Studio Cloud file?"].join(" ")},showSources:{valType:"any",dflt:!1,description:["Adds a source-displaying function to show sources on","the resulting graphs."].join(" ")},displayModeBar:{valType:"enumerated",values:["hover",!0,!1],dflt:"hover",description:["Determines the mode bar display mode.","If *true*, the mode bar is always visible.","If *false*, the mode bar is always hidden.","If *hover*, the mode bar is visible while the mouse cursor","is on the graph container."].join(" ")},showSendToCloud:{valType:"boolean",dflt:!1,description:['Should we include a ModeBar button, labeled "Edit in Chart Studio",',"that sends this chart to chart-studio.plotly.com (formerly plot.ly) or another plotly server","as specified by `plotlyServerURL` for editing, export, etc? Prior to version 1.43.0","this button was included by default, now it is opt-in using this flag.","Note that this button can (depending on `plotlyServerURL` being set) send your data","to an external server. However that server does not persist your data",'until you arrive at the Chart Studio and explicitly click "Save".'].join(" ")},showEditInChartStudio:{valType:"boolean",dflt:!1,description:["Same as `showSendToCloud`, but use a pencil icon instead of a floppy-disk.","Note that if both `showSendToCloud` and `showEditInChartStudio` are turned,","only `showEditInChartStudio` will be honored."].join(" ")},modeBarButtonsToRemove:{valType:"any",dflt:[],description:["Remove mode bar buttons by name.","See ./components/modebar/buttons.js for the list of names."].join(" ")},modeBarButtonsToAdd:{valType:"any",dflt:[],description:["Add mode bar button using config objects","See ./components/modebar/buttons.js for list of arguments.","To enable predefined modebar buttons e.g. shape drawing, hover and spikelines,","simply provide their string name(s). This could include:","*v1hovermode*, *hoverclosest*, *hovercompare*, *togglehover*, *togglespikelines*,","*drawline*, *drawopenpath*, *drawclosedpath*, *drawcircle*, *drawrect* and *eraseshape*.","Please note that these predefined buttons will only be shown if they are compatible","with all trace types used in a graph."].join(" ")},modeBarButtons:{valType:"any",dflt:!1,description:["Define fully custom mode bar buttons as nested array,","where the outer arrays represents button groups, and","the inner arrays have buttons config objects or names of default buttons","See ./components/modebar/buttons.js for more info."].join(" ")},toImageButtonOptions:{valType:"any",dflt:{},description:["Statically override options for toImage modebar button","allowed keys are format, filename, width, height, scale","see ../components/modebar/buttons.js"].join(" ")},displaylogo:{valType:"boolean",dflt:!0,description:["Determines whether or not the plotly logo is displayed","on the end of the mode bar."].join(" ")},watermark:{valType:"boolean",dflt:!1,description:"watermark the images with the company's logo"},plotGlPixelRatio:{valType:"number",dflt:2,min:1,max:4,description:["Set the pixel ratio during WebGL image export."].join(" ")},setBackground:{valType:"any",dflt:"transparent",description:["Set function to add the background color (i.e. `layout.paper_color`)","to a different container.","This function take the graph div as first argument and the current background","color as second argument.","Alternatively, set to string *opaque* to ensure there is white behind it."].join(" ")},topojsonURL:{valType:"string",noBlank:!0,dflt:"https://cdn.plot.ly/",description:["Set the URL to topojson used in geo charts.","By default, the topojson files are fetched from cdn.plot.ly.","For example, set this option to:","<path-to-plotly.js>/dist/topojson/","to render geographical feature using the topojson files","that ship with the plotly.js module."].join(" ")},mapboxAccessToken:{valType:"string",dflt:null,description:["Mapbox access token (required to plot mapbox trace types)","If using an Mapbox Atlas server, set this option to ''","so that plotly.js won't attempt to authenticate to the public Mapbox server."].join(" ")},logging:{valType:"integer",min:0,max:2,dflt:1,description:["Turn all console logging on or off (errors will be thrown)","This should ONLY be set via Plotly.setPlotConfig","Available levels:","0: no logs","1: warnings and errors, but not informational messages","2: verbose logs"].join(" ")},notifyOnLogging:{valType:"integer",min:0,max:2,dflt:0,description:["Set on-graph logging (notifier) level","This should ONLY be set via Plotly.setPlotConfig","Available levels:","0: no on-graph logs","1: warnings and errors, but not informational messages","2: verbose logs"].join(" ")},queueLength:{valType:"integer",min:0,dflt:0,description:"Sets the length of the undo/redo queue."},locale:{valType:"string",dflt:"en-US",description:["Which localization should we use?","Should be a string like 'en' or 'en-US'."].join(" ")},locales:{valType:"any",dflt:{},description:["Localization definitions","Locales can be provided either here (specific to one chart) or globally","by registering them as modules.","Should be an object of objects {locale: {dictionary: {...}, format: {...}}}","{"," da: {"," dictionary: {'Reset axes': 'Nulstil aksler', ...},"," format: {months: [...], shortMonths: [...]}"," },"," ...","}","All parts are optional. When looking for translation or format fields, we","look first for an exact match in a config locale, then in a registered","module. If those fail, we strip off any regionalization ('en-US' -> 'en')","and try each (config, registry) again. The final fallback for translation","is untranslated (which is US English) and for formats is the base English","(the only consequence being the last fallback date format %x is DD/MM/YYYY","instead of MM/DD/YYYY). Currently `grouping` and `currency` are ignored","for our automatic number formatting, but can be used in custom formats."].join(" ")}},m_={};function y_(t,e){for(var r in t){var a=t[r];a.valType?e[r]=a.dflt:(e[r]||(e[r]={}),y_(a,e[r]))}}y_(p_,m_);var Go={configAttributes:p_,dfltConfig:m_},$u=bt,mS=kt,rl=[],g_=function(t,e){if(rl.indexOf(t)!==-1)return;rl.push(t);var r=1e3;mS(e)?r=e:e==="long"&&(r=3e3);var a=$u.select("body").selectAll(".plotly-notifier").data([0]);a.enter().append("div").classed("plotly-notifier",!0);var i=a.selectAll(".notifier-note").data(rl);function n(o){o.duration(700).style("opacity",0).each("end",function(l){var s=rl.indexOf(l);s!==-1&&rl.splice(s,1),$u.select(this).remove()})}i.enter().append("div").classed("notifier-note",!0).style("opacity",0).each(function(o){var l=$u.select(this);l.append("button").classed("notifier-close",!0).html("&times;").on("click",function(){l.transition().call(n)});for(var s=l.append("p"),f=o.split(/<br\s*\/?>/g),c=0;c<f.length;c++)c&&s.append("br"),s.append("span").text(f[c]);e==="stick"?l.transition().duration(350).style("opacity",1):l.transition().duration(700).style("opacity",1).transition().delay(r).call(n)})},Lo=Go.dfltConfig,jh=g_,Bh=h_.exports={};Bh.log=function(){var t;if(Lo.logging>1){var e=["LOG:"];for(t=0;t<arguments.length;t++)e.push(arguments[t]);console.trace.apply(console,e)}if(Lo.notifyOnLogging>1){var r=[];for(t=0;t<arguments.length;t++)r.push(arguments[t]);jh(r.join("<br>"),"long")}};Bh.warn=function(){var t;if(Lo.logging>0){var e=["WARN:"];for(t=0;t<arguments.length;t++)e.push(arguments[t]);console.trace.apply(console,e)}if(Lo.notifyOnLogging>0){var r=[];for(t=0;t<arguments.length;t++)r.push(arguments[t]);jh(r.join("<br>"),"stick")}};Bh.error=function(){var t;if(Lo.logging>0){var e=["ERROR:"];for(t=0;t<arguments.length;t++)e.push(arguments[t]);console.error.apply(console,e)}if(Lo.notifyOnLogging>0){var r=[];for(t=0;t<arguments.length;t++)r.push(arguments[t]);jh(r.join("<br>"),"stick")}};var Uo=h_.exports,ot={},Gh=function(){},b_=function(e,r){if(r instanceof RegExp){for(var a=r.toString(),i=0;i<e.length;i++)if(e[i]instanceof RegExp&&e[i].toString()===a)return e;e.push(r)}else(r||r===0)&&e.indexOf(r)===-1&&e.push(r);return e},jc={};(function(t){var e=V1;t.init2dArray=function(r,a){for(var i=new Array(r),n=0;n<r;n++)i[n]=new Array(a);return i},t.transposeRagged=function(r){var a=0,i=r.length,n,o;for(n=0;n<i;n++)a=Math.max(a,r[n].length);var l=new Array(a);for(n=0;n<a;n++)for(l[n]=new Array(i),o=0;o<i;o++)l[n][o]=r[o][n];return l},t.dot=function(r,a){if(!(r.length&&a.length)||r.length!==a.length)return null;var i=r.length,n,o;if(r[0].length)for(n=new Array(i),o=0;o<i;o++)n[o]=t.dot(r[o],a);else if(a[0].length){var l=t.transposeRagged(a);for(n=new Array(l.length),o=0;o<l.length;o++)n[o]=t.dot(r,l[o])}else for(n=0,o=0;o<i;o++)n+=r[o]*a[o];return n},t.translationMatrix=function(r,a){return[[1,0,r],[0,1,a],[0,0,1]]},t.rotationMatrix=function(r){var a=r*Math.PI/180;return[[Math.cos(a),-Math.sin(a),0],[Math.sin(a),Math.cos(a),0],[0,0,1]]},t.rotationXYMatrix=function(r,a,i){return t.dot(t.dot(t.translationMatrix(a,i),t.rotationMatrix(r)),t.translationMatrix(-a,-i))},t.apply3DTransform=function(r){return function(){var a=arguments,i=arguments.length===1?a[0]:[a[0],a[1],a[2]||0];return t.dot(r,[i[0],i[1],i[2],1]).slice(0,3)}},t.apply2DTransform=function(r){return function(){var a=arguments;a.length===3&&(a=a[0]);var i=arguments.length===1?a[0]:[a[0],a[1]];return t.dot(r,[i[0],i[1],1]).slice(0,2)}},t.apply2DTransform2=function(r){var a=t.apply2DTransform(r);return function(i){return a(i.slice(0,2)).concat(a(i.slice(2,4)))}},t.convertCssMatrix=function(r){if(r){var a=r.length;if(a===16)return r;if(a===6)return[r[0],r[1],0,0,r[2],r[3],0,0,0,0,1,0,r[4],r[5],0,1]}return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},t.inverseTransformMatrix=function(r){var a=[];return e.invert(a,r),[[a[0],a[1],a[2],a[3]],[a[4],a[5],a[6],a[7]],[a[8],a[9],a[10],a[11]],[a[12],a[13],a[14],a[15]]]}})(jc);var yS=bt,Am=Uo,gS=jc,bS=V1;function xS(t){var e;if(typeof t=="string"){if(e=document.getElementById(t),e===null)throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}else if(t==null)throw new Error("DOM element provided is null or undefined");return t}function _S(t){var e=yS.select(t);return e.node()instanceof HTMLElement&&e.size()&&e.classed("js-plotly-plot")}function x_(t){var e=t&&t.parentNode;e&&e.removeChild(t)}function wS(t,e){__("global",t,e)}function __(t,e,r){var a="plotly.js-style-"+t,i=document.getElementById(a);if(!(i&&i.matches(".no-inline-styles"))){i||(i=document.createElement("style"),i.setAttribute("id",a),i.appendChild(document.createTextNode("")),document.head.appendChild(i));var n=i.sheet;n?n.insertRule?n.insertRule(e+"{"+r+"}",0):n.addRule?n.addRule(e,r,0):Am.warn("addStyleRule failed"):Am.warn("Cannot addRelatedStyleRule, probably due to strict CSP...")}}function TS(t){var e="plotly.js-style-"+t,r=document.getElementById(e);r&&x_(r)}function kS(t,e,r,a,i,n){var o=a.split(":"),l=i.split(":"),s="data-btn-style-event-added";n||(n=document),n.querySelectorAll(t).forEach(function(f){f.getAttribute(s)||(f.addEventListener("mouseenter",function(){var c=this.querySelector(r);c&&(c.style[o[0]]=o[1])}),f.addEventListener("mouseleave",function(){var c=this.querySelector(r);c&&(e&&this.matches(e)?c.style[o[0]]=o[1]:c.style[l[0]]=l[1])}),f.setAttribute(s,!0))})}function AS(t){var e=T_(t),r=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return e.forEach(function(a){var i=w_(a);if(i){var n=gS.convertCssMatrix(i);r=bS.multiply(r,r,n)}}),r}function w_(t){var e=window.getComputedStyle(t,null),r=e.getPropertyValue("-webkit-transform")||e.getPropertyValue("-moz-transform")||e.getPropertyValue("-ms-transform")||e.getPropertyValue("-o-transform")||e.getPropertyValue("transform");return r==="none"?null:r.replace("matrix","").replace("3d","").slice(1,-1).split(",").map(function(a){return+a})}function T_(t){for(var e=[];MS(t);)e.push(t),t=t.parentNode,typeof ShadowRoot=="function"&&t instanceof ShadowRoot&&(t=t.host);return e}function MS(t){return t&&(t instanceof Element||t instanceof HTMLElement)}function SS(t,e){return t&&e&&t.top===e.top&&t.left===e.left&&t.right===e.right&&t.bottom===e.bottom}var Bc={getGraphDiv:xS,isPlotDiv:_S,removeElement:x_,addStyleRule:wS,addRelatedStyleRule:__,deleteRelatedStyleRule:TS,setStyleOnHover:kS,getFullTransformMatrix:AS,getElementTransformMatrix:w_,getElementAndAncestors:T_,equalDomRects:SS},Gc={mode:{valType:"enumerated",dflt:"afterall",values:["immediate","next","afterall"],description:["Describes how a new animate call interacts with currently-running","animations. If `immediate`, current animations are interrupted and","the new animation is started. If `next`, the current frame is allowed","to complete, after which the new animation is started. If `afterall`","all existing frames are animated to completion before the new animation","is started."].join(" ")},direction:{valType:"enumerated",values:["forward","reverse"],dflt:"forward",description:["The direction in which to play the frames triggered by the animation call"].join(" ")},fromcurrent:{valType:"boolean",dflt:!1,description:["Play frames starting at the current frame instead of the beginning."].join(" ")},frame:{duration:{valType:"number",min:0,dflt:500,description:["The duration in milliseconds of each frame. If greater than the frame","duration, it will be limited to the frame duration."].join(" ")},redraw:{valType:"boolean",dflt:!0,description:["Redraw the plot at completion of the transition. This is desirable","for transitions that include properties that cannot be transitioned,","but may significantly slow down updates that do not require a full","redraw of the plot"].join(" ")}},transition:{duration:{valType:"number",min:0,dflt:500,editType:"none",description:["The duration of the transition, in milliseconds. If equal to zero,","updates are synchronous."].join(" ")},easing:{valType:"enumerated",dflt:"cubic-in-out",values:["linear","quad","cubic","sin","exp","circle","elastic","back","bounce","linear-in","quad-in","cubic-in","sin-in","exp-in","circle-in","elastic-in","back-in","bounce-in","linear-out","quad-out","cubic-out","sin-out","exp-out","circle-out","elastic-out","back-out","bounce-out","linear-in-out","quad-in-out","cubic-in-out","sin-in-out","exp-in-out","circle-in-out","elastic-in-out","back-in-out","bounce-in-out"],editType:"none",description:"The easing function used for the transition"},ordering:{valType:"enumerated",values:["layout first","traces first"],dflt:"layout first",editType:"none",description:["Determines whether the figure's layout or traces smoothly transitions","during updates that make both traces and layout change."].join(" ")}}},k_=Xt.extendFlat,LS=Dn,A_={valType:"flaglist",extras:["none"],flags:["calc","clearAxisTypes","plot","style","markerSize","colorbars"],description:["trace attributes should include an `editType` string matching this flaglist.","*calc* is the most extensive: a full (re)plot starting by clearing `gd.calcdata`","to force it to be regenerated","*clearAxisTypes* resets the types of the axes this trace is on, because new data could","cause the automatic axis type detection to change. Log type will not be cleared, as that","is never automatically chosen so must have been user-specified.","*plot* (re)plots but without first clearing `gd.calcdata`.","*style* only calls `module.style` (or module.editStyle) for all trace modules and redraws the legend.","*markerSize* is like *style*, but propagate axis-range changes due to scatter `marker.size`","*colorbars* only redraws colorbars."].join(" ")},M_={valType:"flaglist",extras:["none"],flags:["calc","plot","legend","ticks","axrange","layoutstyle","modebar","camera","arraydraw","colorbars"],description:["layout attributes should include an `editType` string matching this flaglist.","*calc* is the most extensive: a full (re)plot starting by clearing `gd.calcdata`","to force it to be regenerated","*plot* (re)plots but without first clearing `gd.calcdata`.","*legend* only redraws the legend.","*ticks* only redraws axis ticks, labels, and gridlines.","*axrange* minimal sequence when updating axis ranges.","*layoutstyle* reapplies global and SVG cartesian axis styles.","*modebar* just updates the modebar.","*camera* just updates the camera settings for gl3d scenes.","*arraydraw* allows component arrays to invoke the redraw routines just for the","component(s) that changed.","*colorbars* only redraws colorbars."].join(" ")},CS=A_.flags.slice().concat(["fullReplot"]),DS=M_.flags.slice().concat("layoutReplot"),Ja={traces:A_,layout:M_,traceFlags:function(){return Mm(CS)},layoutFlags:function(){return Mm(DS)},update:function(t,e){var r=e.editType;if(r&&r!=="none")for(var a=r.split("+"),i=0;i<a.length;i++)t[a[i]]=!0},overrideAll:S_};function Mm(t){for(var e={},r=0;r<t.length;r++)e[t[r]]=!1;return e}function S_(t,e,r){var a=k_({},t);for(var i in a){var n=a[i];LS(n)&&(a[i]=L_(n,e,r,i))}return r==="from-root"&&(a.editType=e),a}function L_(t,e,r,a){if(t.valType){var i=k_({},t);if(i.editType=e,Array.isArray(t.items)){i.items=new Array(t.items.length);for(var n=0;n<t.items.length;n++)i.items[n]=L_(t.items[n],e)}return i}else return S_(t,e,a.charAt(0)==="_"?"nested":"from-root")}var ta={};ta.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style",description:["Sets the dash style of lines. Set to a dash type string","(*solid*, *dot*, *dash*, *longdash*, *dashdot*, or *longdashdot*)","or a dash length list in px (eg *5px,10px,2px,2px*)."].join(" ")};ta.pattern={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style",description:["Sets the shape of the pattern fill.","By default, no pattern is used for filling the area."].join(" ")},path:{valType:"string",arrayOk:!0,editType:"style",description:["Sets a custom path for pattern fill.","Use with no `shape` or `solidity`, provide an SVG path string for","the regions of the square from (0,0) to (`size`,`size`) to color."].join(" ")},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style",description:["Determines whether `marker.color` should be used","as a default to `bgcolor` or a `fgcolor`."].join(" ")},bgcolor:{valType:"color",arrayOk:!0,editType:"style",description:["When there is no colorscale sets the color of background pattern fill.","Defaults to a `marker.color` background when `fillmode` is *overlay*.","Otherwise, defaults to a transparent background."].join(" ")},fgcolor:{valType:"color",arrayOk:!0,editType:"style",description:["When there is no colorscale sets the color of foreground pattern fill.","Defaults to a `marker.color` background when `fillmode` is *replace*.","Otherwise, defaults to dark grey or white","to increase contrast with the `bgcolor`."].join(" ")},fgopacity:{valType:"number",editType:"style",min:0,max:1,description:["Sets the opacity of the foreground pattern fill.","Defaults to a 0.5 when `fillmode` is *overlay*.","Otherwise, defaults to 1."].join(" ")},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style",description:["Sets the size of unit squares of the pattern fill in pixels,","which corresponds to the interval of repetition of the pattern."].join(" ")},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style",description:["Sets the solidity of the pattern fill.","Solidity is roughly the fraction of the area filled by the pattern.","Solidity of 0 shows only the background color without pattern","and solidty of 1 shows only the foreground color without pattern."].join(" ")},editType:"style",description:["Sets the pattern within the marker."].join(" ")};var zr={},C_={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"},D_=C_,P_=D_.FORMAT_LINK,$_=D_.DATE_FORMAT_LINK;function E_(t){var e=t&&t.supportOther;return["Variables are inserted using %{variable},",'for example "y: %{y}"'+(e?" as well as %{xother}, {%_xother}, {%_xother_}, {%xother_}. When showing info for several points, *xother* will be added to those with different x positions from the first point. An underscore before or after *(x|y)other* will add a space on that side, only when this field is shown.":"."),`Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example "Price: %{y:$.2f}".`,P_,"for details on the formatting syntax.",`Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}".`,$_,"for details on the date formatting syntax."].join(" ")}function PS(){return["Variables are inserted using %{variable},",'for example "x0: %{x0}".',`Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example "Price: %{x0:$.2f}". See`,P_,"for details on the formatting syntax.",`Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example "Day: %{x0|%m %b %Y}". See`,$_,"for details on the date formatting syntax.","A single multiplication or division operation may be applied to numeric variables, and combined with",'d3 number formatting, for example "Length in cm: %{x0*2.54}", "%{slope*60:.1f} meters per second."',"For log axes, variable values are given in log units.","For date axes, x/y coordinate variables and center variables use datetimes, while all other variable values use values in ms."].join(" ")}function Uh(t){var e=t.description?" "+t.description:"",r=t.keys||[];if(r.length>0){for(var a=[],i=0;i<r.length;i++)a[i]="`"+r[i]+"`";e=e+"Finally, the template string has access to ",r.length===1?e=e+"variable "+a[0]:e=e+"variables "+a.slice(0,-1).join(", ")+" and "+a.slice(-1)+"."}return e}zr.hovertemplateAttrs=function(t,e){t=t||{},e=e||{};var r=Uh(e),a={valType:"string",dflt:"",editType:t.editType||"none",description:["Template string used for rendering the information that appear on hover box.","Note that this will override `hoverinfo`.",E_({supportOther:!0}),"The variables available in `hovertemplate` are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data.","Additionally, every attributes that can be specified per-point (the ones that are `arrayOk: true`) are available.",r,'Anything contained in tag `<extra>` is displayed in the secondary box, for example "<extra>{fullData.name}</extra>".',"To hide the secondary box completely, use an empty tag `<extra></extra>`."].join(" ")};return t.arrayOk!==!1&&(a.arrayOk=!0),a};zr.texttemplateAttrs=function(t,e){t=t||{},e=e||{};var r=Uh(e),a={valType:"string",dflt:"",editType:t.editType||"calc",description:["Template string used for rendering the information text that appear on points.","Note that this will override `textinfo`.",E_(),"Every attributes that can be specified per-point (the ones that are `arrayOk: true`) are available.",r].join(" ")};return t.arrayOk!==!1&&(a.arrayOk=!0),a};zr.shapeTexttemplateAttrs=function(t,e){t=t||{},e=e||{};var r=t.newshape?"new ":"",a=Uh(e),i={valType:"string",dflt:"",editType:t.editType||"arraydraw",description:["Template string used for rendering the "+r+"shape's label.","Note that this will override `text`.",PS(),a].join(" ")};return i};function Ri(t,e){return e?e.d2l(t):t}function z_(t,e){return e?e.l2d(t):t}function $S(t){return t.x0}function ES(t){return t.x1}function zS(t){return t.y0}function RS(t){return t.y1}function R_(t){return t.x0shift||0}function I_(t){return t.x1shift||0}function F_(t){return t.y0shift||0}function N_(t){return t.y1shift||0}function Uc(t,e){return Ri(t.x1,e)+I_(t)-Ri(t.x0,e)-R_(t)}function Vc(t,e,r){return Ri(t.y1,r)+N_(t)-Ri(t.y0,r)-F_(t)}function IS(t,e){return Math.abs(Uc(t,e))}function FS(t,e,r){return Math.abs(Vc(t,e,r))}function NS(t,e,r){return t.type!=="line"?void 0:Math.sqrt(Math.pow(Uc(t,e),2)+Math.pow(Vc(t,e,r),2))}function HS(t,e){return z_((Ri(t.x1,e)+I_(t)+Ri(t.x0,e)+R_(t))/2,e)}function OS(t,e,r){return z_((Ri(t.y1,r)+N_(t)+Ri(t.y0,r)+F_(t))/2,r)}function jS(t,e,r){return t.type!=="line"?void 0:Vc(t,e,r)/Uc(t,e)}var Vh={x0:$S,x1:ES,y0:zS,y1:RS,slope:jS,dx:Uc,dy:Vc,width:IS,height:FS,length:NS,xcenter:HS,ycenter:OS},BS=Ja.overrideAll,qi=wa,Sm=Mr,GS=ta.dash,bi=Xt.extendFlat,US=zr.shapeTexttemplateAttrs,VS=Vh,WS=BS({newshape:{visible:bi({},qi.visible,{description:["Determines whether or not new shape is visible.","If *legendonly*, the shape is not drawn,","but can appear as a legend item","(provided that the legend itself is visible)."].join(" ")}),showlegend:{valType:"boolean",dflt:!1,description:["Determines whether or not new","shape is shown in the legend."].join(" ")},legend:bi({},qi.legend,{description:["Sets the reference to a legend to show new shape in.","References to these legends are *legend*, *legend2*, *legend3*, etc.","Settings for these legends are set in the layout, under","`layout.legend`, `layout.legend2`, etc."].join(" ")}),legendgroup:bi({},qi.legendgroup,{description:["Sets the legend group for new shape.","Traces and shapes part of the same legend group hide/show at the same time","when toggling legend items."].join(" ")}),legendgrouptitle:{text:bi({},qi.legendgrouptitle.text,{}),font:Sm({description:["Sets this legend group's title font."].join(" ")})},legendrank:bi({},qi.legendrank,{description:["Sets the legend rank for new shape.","Items and groups with smaller ranks are presented on top/left side while","with *reversed* `legend.traceorder` they are on bottom/right side.","The default legendrank is 1000,","so that you can use ranks less than 1000 to place certain items before all unranked items,","and ranks greater than 1000 to go after all unranked items."].join(" ")}),legendwidth:bi({},qi.legendwidth,{description:"Sets the width (in px or fraction) of the legend for new shape."}),line:{color:{valType:"color",description:["Sets the line color.","By default uses either dark grey or white","to increase contrast with background color."].join(" ")},width:{valType:"number",min:0,dflt:4,description:"Sets the line width (in px)."},dash:bi({},GS,{dflt:"solid"})},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",description:["Sets the color filling new shapes' interior.","Please note that if using a fillcolor with alpha greater than half,","drag inside the active shape starts moving the shape underneath,","otherwise a new shape could be started over."].join(" ")},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd",description:["Determines the path's interior.","For more info please visit https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill-rule"].join(" ")},opacity:{valType:"number",min:0,max:1,dflt:1,description:"Sets the opacity of new shapes."},layer:{valType:"enumerated",values:["below","above","between"],dflt:"above",description:["Specifies whether new shapes are drawn below gridlines (*below*),","between gridlines and traces (*between*) or above traces (*above*)."].join(" ")},drawdirection:{valType:"enumerated",values:["ortho","horizontal","vertical","diagonal"],dflt:"diagonal",description:["When `dragmode` is set to *drawrect*, *drawline* or *drawcircle*","this limits the drag to be horizontal, vertical or diagonal.","Using *diagonal* there is no limit e.g. in drawing lines in any direction.","*ortho* limits the draw to be either horizontal or vertical.","*horizontal* allows horizontal extend.","*vertical* allows vertical extend."].join(" ")},name:bi({},qi.name,{description:["Sets new shape name.","The name appears as the legend item."].join(" ")}),label:{text:{valType:"string",dflt:"",description:["Sets the text to display with the new shape.","It is also used for legend item if `name` is not provided."].join(" ")},texttemplate:US({newshape:!0},{keys:Object.keys(VS)}),font:Sm({description:"Sets the new shape label text font."}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right","start","middle","end"],description:["Sets the position of the label text relative to the new shape.","Supported values for rectangles, circles and paths are","*top left*, *top center*, *top right*, *middle left*,","*middle center*, *middle right*, *bottom left*, *bottom center*,","and *bottom right*.","Supported values for lines are *start*, *middle*, and *end*.","Default: *middle center* for rectangles, circles, and paths; *middle* for lines."].join(" ")},textangle:{valType:"angle",dflt:"auto",description:["Sets the angle at which the label text is drawn","with respect to the horizontal. For lines, angle *auto*","is the same angle as the line. For all other shapes,","angle *auto* is horizontal."].join(" ")},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",description:["Sets the label's horizontal position anchor","This anchor binds the specified `textposition` to the *left*, *center*","or *right* of the label text.","For example, if `textposition` is set to *top right* and","`xanchor` to *right* then the right-most portion of the","label text lines up with the right-most edge of the","new shape."].join(" ")},yanchor:{valType:"enumerated",values:["top","middle","bottom"],description:["Sets the label's vertical position anchor","This anchor binds the specified `textposition` to the *top*, *middle*","or *bottom* of the label text.","For example, if `textposition` is set to *top right* and","`yanchor` to *top* then the top-most portion of the","label text lines up with the top-most edge of the","new shape."].join(" ")},padding:{valType:"number",dflt:3,min:0,description:"Sets padding (in px) between edge of label and edge of new shape."}}},activeshape:{fillcolor:{valType:"color",dflt:"rgb(255,0,255)",description:"Sets the color filling the active shape' interior."},opacity:{valType:"number",min:0,max:1,dflt:.5,description:"Sets the opacity of the active shape."}}},"none","from-root"),XS=ta.dash,YS=Xt.extendFlat,qS={newselection:{mode:{valType:"enumerated",values:["immediate","gradual"],dflt:"immediate",editType:"none",description:["Describes how a new selection is created.","If `immediate`, a new selection is created after first mouse up.","If `gradual`, a new selection is not created after first mouse.","By adding to and subtracting from the initial selection,","this option allows declaring extra outlines of the selection."].join(" ")},line:{color:{valType:"color",editType:"none",description:["Sets the line color.","By default uses either dark grey or white","to increase contrast with background color."].join(" ")},width:{valType:"number",min:1,dflt:1,editType:"none",description:"Sets the line width (in px)."},dash:YS({},XS,{dflt:"dot",editType:"none"}),editType:"none"},editType:"none"},activeselection:{fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"none",description:"Sets the color filling the active selection' interior."},opacity:{valType:"number",min:0,max:1,dflt:.5,editType:"none",description:"Sets the opacity of the active selection."},editType:"none"}},Wh=function(t){var e=t.editType;return{t:{valType:"number",dflt:0,editType:e,description:"The amount of padding (in px) along the top of the component."},r:{valType:"number",dflt:0,editType:e,description:"The amount of padding (in px) on the right side of the component."},b:{valType:"number",dflt:0,editType:e,description:"The amount of padding (in px) along the bottom of the component."},l:{valType:"number",dflt:0,editType:e,description:"The amount of padding (in px) on the left side of the component."},editType:e}},Rd=Mr,ZS=Gc,$f=Or,Lm=WS,Cm=qS,KS=Wh,Dm=Xt.extendFlat,Wc=Rd({editType:"calc",description:["Sets the global font.","Note that fonts used in traces and other","layout components inherit from the global font."].join(" ")});Wc.family.dflt='"Open Sans", verdana, arial, sans-serif';Wc.size.dflt=12;Wc.color.dflt=$f.defaultLine;var ps={font:Wc,title:{text:{valType:"string",editType:"layoutstyle",description:"Sets the plot's title."},font:Rd({editType:"layoutstyle",description:"Sets the title font."}),subtitle:{text:{valType:"string",editType:"layoutstyle",description:"Sets the plot's subtitle."},font:Rd({editType:"layoutstyle",description:"Sets the subtitle font."}),editType:"layoutstyle"},xref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle",description:["Sets the container `x` refers to.","*container* spans the entire `width` of the plot.","*paper* refers to the width of the plotting area only."].join(" ")},yref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle",description:["Sets the container `y` refers to.","*container* spans the entire `height` of the plot.","*paper* refers to the height of the plotting area only."].join(" ")},x:{valType:"number",min:0,max:1,dflt:.5,editType:"layoutstyle",description:["Sets the x position with respect to `xref` in normalized","coordinates from *0* (left) to *1* (right)."].join(" ")},y:{valType:"number",min:0,max:1,dflt:"auto",editType:"layoutstyle",description:["Sets the y position with respect to `yref` in normalized","coordinates from *0* (bottom) to *1* (top).","*auto* places the baseline of the title onto the","vertical center of the top margin."].join(" ")},xanchor:{valType:"enumerated",dflt:"auto",values:["auto","left","center","right"],editType:"layoutstyle",description:["Sets the title's horizontal alignment with respect to its x position.","*left* means that the title starts at x,","*right* means that the title ends at x","and *center* means that the title's center is at x.","*auto* divides `xref` by three and calculates the `xanchor`","value automatically based on the value of `x`."].join(" ")},yanchor:{valType:"enumerated",dflt:"auto",values:["auto","top","middle","bottom"],editType:"layoutstyle",description:["Sets the title's vertical alignment with respect to its y position.","*top* means that the title's cap line is at y,","*bottom* means that the title's baseline is at y","and *middle* means that the title's midline is at y.","*auto* divides `yref` by three and calculates the `yanchor`","value automatically based on the value of `y`."].join(" ")},pad:Dm(KS({editType:"layoutstyle"}),{description:["Sets the padding of the title.","Each padding value only applies when the corresponding","`xanchor`/`yanchor` value is set accordingly. E.g. for left","padding to take effect, `xanchor` must be set to *left*.","The same rule applies if `xanchor`/`yanchor` is determined automatically.","Padding is muted if the respective anchor value is *middle*/*center*."].join(" ")}),automargin:{valType:"boolean",dflt:!1,editType:"plot",description:["Determines whether the title can automatically push the figure margins.","If `yref='paper'` then the margin will expand to ensure that the title doesn’t","overlap with the edges of the container. If `yref='container'` then the margins","will ensure that the title doesn’t overlap with the plot area, tick labels,","and axis titles. If `automargin=true` and the margins need to be expanded,","then y will be set to a default 1 and yanchor will be set to an appropriate","default to ensure that minimal margin space is needed. Note that when `yref='paper'`,","only 1 or 0 are allowed y values. Invalid values will be reset to the default 1."].join(" ")},editType:"layoutstyle"},uniformtext:{mode:{valType:"enumerated",values:[!1,"hide","show"],dflt:!1,editType:"plot",description:["Determines how the font size for various text","elements are uniformed between each trace type.","If the computed text sizes were smaller than","the minimum size defined by `uniformtext.minsize`","using *hide* option hides the text; and","using *show* option shows the text without further downscaling.","Please note that if the size defined by `minsize` is greater than","the font size defined by trace, then the `minsize` is used."].join(" ")},minsize:{valType:"number",min:0,dflt:0,editType:"plot",description:["Sets the minimum text size between traces of the same type."].join(" ")},editType:"plot"},autosize:{valType:"boolean",dflt:!1,editType:"none",description:["Determines whether or not a layout width or height","that has been left undefined by the user","is initialized on each relayout.","Note that, regardless of this attribute,","an undefined layout width or height","is always initialized on the first call to plot."].join(" ")},width:{valType:"number",min:10,dflt:700,editType:"plot",description:["Sets the plot's width (in px)."].join(" ")},height:{valType:"number",min:10,dflt:450,editType:"plot",description:["Sets the plot's height (in px)."].join(" ")},minreducedwidth:{valType:"number",min:2,dflt:64,editType:"plot",description:"Minimum width of the plot with margin.automargin applied (in px)"},minreducedheight:{valType:"number",min:2,dflt:64,editType:"plot",description:"Minimum height of the plot with margin.automargin applied (in px)"},margin:{l:{valType:"number",min:0,dflt:80,editType:"plot",description:"Sets the left margin (in px)."},r:{valType:"number",min:0,dflt:80,editType:"plot",description:"Sets the right margin (in px)."},t:{valType:"number",min:0,dflt:100,editType:"plot",description:"Sets the top margin (in px)."},b:{valType:"number",min:0,dflt:80,editType:"plot",description:"Sets the bottom margin (in px)."},pad:{valType:"number",min:0,dflt:0,editType:"plot",description:["Sets the amount of padding (in px)","between the plotting area and the axis lines"].join(" ")},autoexpand:{valType:"boolean",dflt:!0,editType:"plot",description:["Turns on/off margin expansion computations.","Legends, colorbars, updatemenus, sliders, axis rangeselector and rangeslider","are allowed to push the margins by defaults."].join(" ")},editType:"plot"},computed:{valType:"any",editType:"none",description:["Placeholder for exporting automargin-impacting values namely","`margin.t`, `margin.b`, `margin.l` and `margin.r` in *full-json* mode."].join(" ")},paper_bgcolor:{valType:"color",dflt:$f.background,editType:"plot",description:"Sets the background color of the paper where the graph is drawn."},plot_bgcolor:{valType:"color",dflt:$f.background,editType:"layoutstyle",description:["Sets the background color of the plotting area in-between x and y axes."].join(" ")},autotypenumbers:{valType:"enumerated",values:["convert types","strict"],dflt:"convert types",editType:"calc",description:["Using *strict* a numeric string in trace data is not converted to a number.","Using *convert types* a numeric string in trace data may be","treated as a number during automatic axis `type` detection.","This is the default value; however it could be overridden for individual axes."].join(" ")},separators:{valType:"string",editType:"plot",description:["Sets the decimal and thousand separators.","For example, *. * puts a '.' before decimals and a space","between thousands. In English locales, dflt is *.,* but","other locales may alter this default."].join(" ")},hidesources:{valType:"boolean",dflt:!1,editType:"plot",description:["Determines whether or not a text link citing the data source is","placed at the bottom-right cored of the figure.","Has only an effect only on graphs that have been generated via","forked graphs from the Chart Studio Cloud (at https://chart-studio.plotly.com or on-premise)."].join(" ")},showlegend:{valType:"boolean",editType:"legend",description:["Determines whether or not a legend is drawn.","Default is `true` if there is a trace to show and any of these:","a) Two or more traces would by default be shown in the legend.","b) One pie trace is shown in the legend.","c) One trace is explicitly given with `showlegend: true`."].join(" ")},colorway:{valType:"colorlist",dflt:$f.defaults,editType:"calc",description:"Sets the default trace colors."},datarevision:{valType:"any",editType:"calc",description:["If provided, a changed value tells `Plotly.react` that","one or more data arrays has changed. This way you can modify","arrays in-place rather than making a complete new copy for an","incremental change.","If NOT provided, `Plotly.react` assumes that data arrays are","being treated as immutable, thus any data array with a","different identity from its predecessor contains new data."].join(" ")},uirevision:{valType:"any",editType:"none",description:["Used to allow user interactions with the plot to persist after","`Plotly.react` calls that are unaware of these interactions.","If `uirevision` is omitted, or if it is given and it changed from","the previous `Plotly.react` call, the exact new figure is used.","If `uirevision` is truthy and did NOT change, any attribute","that has been affected by user interactions and did not receive a","different value in the new figure will keep the interaction value.","`layout.uirevision` attribute serves as the default for","`uirevision` attributes in various sub-containers. For finer","control you can set these sub-attributes directly. For example,","if your app separately controls the data on the x and y axes you","might set `xaxis.uirevision=*time*` and `yaxis.uirevision=*cost*`.","Then if only the y data is changed, you can update","`yaxis.uirevision=*quantity*` and the y axis range will reset but","the x axis range will retain any user-driven zoom."].join(" ")},editrevision:{valType:"any",editType:"none",description:["Controls persistence of user-driven changes in `editable: true`","configuration, other than trace names and axis titles.","Defaults to `layout.uirevision`."].join(" ")},selectionrevision:{valType:"any",editType:"none",description:["Controls persistence of user-driven changes in selected points","from all traces."].join(" ")},template:{valType:"any",editType:"calc",description:["Default attributes to be applied to the plot. Templates can be","created from existing plots using `Plotly.makeTemplate`, or","created manually. They should be objects with format:","`{layout: layoutTemplate, data: {[type]: [traceTemplate, ...]}, ...}`","`layoutTemplate` and `traceTemplate` are objects matching the","attribute structure of `layout` and a data trace. ","Trace templates are applied cyclically to traces of each type.","Container arrays (eg `annotations`) have special handling:","An object ending in `defaults` (eg `annotationdefaults`) is applied","to each array item. But if an item has a `templateitemname` key","we look in the template array for an item with matching `name` and","apply that instead. If no matching `name` is found we mark the item","invisible. Any named template item not referenced is appended to","the end of the array, so you can use this for a watermark annotation","or a logo image, for example. To omit one of these items on the plot,","make an item with matching `templateitemname` and `visible: false`."].join(" ")},newshape:Lm.newshape,activeshape:Lm.activeshape,newselection:Cm.newselection,activeselection:Cm.activeselection,meta:{valType:"any",arrayOk:!0,editType:"plot",description:["Assigns extra meta information that can be used in various `text` attributes.","Attributes such as the graph, axis and colorbar `title.text`, annotation `text`","`trace.name` in legend items, `rangeselector`, `updatemenus` and `sliders` `label` text","all support `meta`. One can access `meta` fields using template strings:","`%{meta[i]}` where `i` is the index of the `meta`","item in question.","`meta` can also be an object for example `{key: value}` which can be accessed","%{meta[key]}."].join(" ")},transition:Dm({},ZS.transition,{description:["Sets transition options used during Plotly.react updates."].join(" "),editType:"none"})};(function(t){var e=Uo,r=Gh,a=b_,i=Dn,n=Bc.addStyleRule,o=Xt,l=wa,s=ps,f=o.extendFlat,c=o.extendDeepAll;t.modules={},t.allCategories={},t.allTypes=[],t.subplotsRegistry={},t.componentsRegistry={},t.layoutArrayContainers=[],t.layoutArrayRegexes=[],t.traceLayoutAttributes={},t.localeRegistry={},t.apiMethodRegistry={},t.collectableSubplotTypes=null,t.register=function(x){if(t.collectableSubplotTypes=null,x)x&&!Array.isArray(x)&&(x=[x]);else throw new Error("No argument passed to Plotly.register.");for(var w=0;w<x.length;w++){var T=x[w];if(!T)throw new Error("Invalid module was attempted to be registered!");switch(T.moduleType){case"trace":u(T);break;case"transform":d(T);break;case"component":p(T);break;case"locale":h(T);break;case"apiMethod":var A=T.name;t.apiMethodRegistry[A]=T.fn;break;default:throw new Error("Invalid module was attempted to be registered!")}}},t.getModule=function(g){var x=t.modules[_(g)];return x?x._module:!1},t.traceIs=function(g,x){if(g=_(g),g==="various")return!1;var w=t.modules[g];return w||(g&&e.log("Unrecognized trace type "+g+"."),w=t.modules[l.type.dflt]),!!w.categories[x]},t.getComponentMethod=function(g,x){var w=t.componentsRegistry[g];return w&&w[x]||r},t.call=function(){var g=arguments[0],x=[].slice.call(arguments,1);return t.apiMethodRegistry[g].apply(null,x)};function u(g){var x=g.name,w=g.categories,T=g.meta;if(t.modules[x]){e.log("Type "+x+" already registered");return}t.subplotsRegistry[g.basePlotModule.name]||v(g.basePlotModule);for(var A={},M=0;M<w.length;M++)A[w[M]]=!0,t.allCategories[w[M]]=!0;t.modules[x]={_module:g,categories:A},T&&Object.keys(T).length&&(t.modules[x].meta=T),t.allTypes.push(x);for(var S in t.componentsRegistry)y(S,x);g.layoutAttributes&&f(t.traceLayoutAttributes,g.layoutAttributes);var L=g.basePlotModule,E=L.name;if(E==="mapbox"){var F=L.constants.styleRules;for(var N in F)n(".js-plotly-plot .plotly .mapboxgl-"+N,F[N])}(E==="geo"||E==="mapbox"||E==="map")&&window.PlotlyGeoAssets===void 0&&(window.PlotlyGeoAssets={topojson:{}})}function v(g){var x=g.name;if(t.subplotsRegistry[x]){e.log("Plot type "+x+" already registered.");return}m(g),t.subplotsRegistry[x]=g;for(var w in t.componentsRegistry)b(w,g.name)}function p(g){if(typeof g.name!="string")throw new Error("Component module *name* must be a string.");var x=g.name;t.componentsRegistry[x]=g,g.layoutAttributes&&(g.layoutAttributes._isLinkedToArray&&a(t.layoutArrayContainers,x),m(g));for(var w in t.modules)y(x,w);for(var T in t.subplotsRegistry)b(x,T);g.schema&&g.schema.layout&&c(s,g.schema.layout)}function d(g){if(typeof g.name!="string")throw new Error("Transform module *name* must be a string.");var x="Transform module "+g.name,w=typeof g.transform=="function",T=typeof g.calcTransform=="function";if(!w&&!T)throw new Error(x+" is missing a *transform* or *calcTransform* method.");w&&T&&e.log([x+" has both a *transform* and *calcTransform* methods.","Please note that all *transform* methods are executed","before all *calcTransform* methods."].join(" ")),i(g.attributes)||e.log(x+" registered without an *attributes* object."),typeof g.supplyDefaults!="function"&&e.log(x+" registered without a *supplyDefaults* method.")}function h(g){var x=g.name,w=x.split("-")[0],T=g.dictionary,A=g.format,M=T&&Object.keys(T).length,S=A&&Object.keys(A).length,L=t.localeRegistry,E=L[x];if(E||(L[x]=E={}),w!==x){var F=L[w];F||(L[w]=F={}),M&&F.dictionary===E.dictionary&&(F.dictionary=T),S&&F.format===E.format&&(F.format=A)}M&&(E.dictionary=T),S&&(E.format=A)}function m(g){if(g.layoutAttributes){var x=g.layoutAttributes._arrayAttrRegexps;if(x)for(var w=0;w<x.length;w++)a(t.layoutArrayRegexes,x[w])}}function y(g,x){var w=t.componentsRegistry[g].schema;if(!(!w||!w.traces)){var T=w.traces[x];T&&c(t.modules[x]._module.attributes,T)}}function b(g,x){var w=t.componentsRegistry[g].schema;if(!(!w||!w.subplots)){var T=t.subplotsRegistry[x],A=T.layoutAttributes,M=T.attr==="subplot"?T.name:T.attr;Array.isArray(M)&&(M=M[0]);var S=w.subplots[M];A&&S&&c(A,S)}}function _(g){return typeof g=="object"&&(g=g.type),g}})(ot);(function(t){var e=Gl.timeFormat,r=kt,a=Uo,i=us.mod,n=fr,o=n.BADNUM,l=n.ONEDAY,s=n.ONEHOUR,f=n.ONEMIN,c=n.ONESEC,u=n.EPOCHJD,v=ot,p=Gl.utcFormat,d=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\d)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d(:?\d\d)?)?)?)?)?)?\s*$/m,h=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\di?)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d(:?\d\d)?)?)?)?)?)?\s*$/m,m=new Date().getFullYear()-70;function y(D){return D&&v.componentsRegistry.calendars&&typeof D=="string"&&D!=="gregorian"}t.dateTick0=function(D,P){var k=b(D,!!P);if(P<2)return k;var C=t.dateTime2ms(k,D);return C+=l*(P-1),t.ms2DateTime(C,0,D)};function b(D,P){return y(D)?P?v.getComponentMethod("calendars","CANONICAL_SUNDAY")[D]:v.getComponentMethod("calendars","CANONICAL_TICK")[D]:P?"2000-01-02":"2000-01-01"}t.dfltRange=function(D){return y(D)?v.getComponentMethod("calendars","DFLTRANGE")[D]:["2000-01-01","2001-01-01"]},t.isJSDate=function(D){return typeof D=="object"&&D!==null&&typeof D.getTime=="function"};var _,g;t.dateTime2ms=function(D,P){if(t.isJSDate(D)){var k=D.getTimezoneOffset()*f,C=(D.getUTCMinutes()-D.getMinutes())*f+(D.getUTCSeconds()-D.getSeconds())*c+(D.getUTCMilliseconds()-D.getMilliseconds());if(C){var $=3*f;k=k-$/2+i(C-k+$/2,$)}return D=Number(D)-k,D>=_&&D<=g?D:o}if(typeof D!="string"&&typeof D!="number")return o;D=String(D);var R=y(P),j=D.charAt(0);R&&(j==="G"||j==="g")&&(D=D.substr(1),P="");var G=R&&P.substr(0,7)==="chinese",Y=D.match(G?h:d);if(!Y)return o;var O=Y[1],K=Y[3]||"1",W=Number(Y[5]||1),X=Number(Y[7]||0),B=Number(Y[9]||0),ee=Number(Y[11]||0);if(R){if(O.length===2)return o;O=Number(O);var ae;try{var de=v.getComponentMethod("calendars","getCal")(P);if(G){var fe=K.charAt(K.length-1)==="i";K=parseInt(K,10),ae=de.newDate(O,de.toMonthIndex(O,K,fe),W)}else ae=de.newDate(O,Number(K),W)}catch{return o}return ae?(ae.toJD()-u)*l+X*s+B*f+ee*c:o}O.length===2?O=(Number(O)+2e3-m)%100+m:O=Number(O),K-=1;var q=new Date(Date.UTC(2e3,K,W,X,B));return q.setUTCFullYear(O),q.getUTCMonth()!==K||q.getUTCDate()!==W?o:q.getTime()+ee*c},_=t.MIN_MS=t.dateTime2ms("-9999"),g=t.MAX_MS=t.dateTime2ms("9999-12-31 23:59:59.9999"),t.isDateTime=function(D,P){return t.dateTime2ms(D,P)!==o};function x(D,P){return String(D+Math.pow(10,P)).substr(1)}var w=90*l,T=3*s,A=5*f;t.ms2DateTime=function(D,P,k){if(typeof D!="number"||!(D>=_&&D<=g))return o;P||(P=0);var C=Math.floor(i(D+.05,1)*10),$=Math.round(D-C/10),R,j,G,Y,O,K;if(y(k)){var W=Math.floor($/l)+u,X=Math.floor(i(D,l));try{R=v.getComponentMethod("calendars","getCal")(k).fromJD(W).formatDate("yyyy-mm-dd")}catch{R=p("G%Y-%m-%d")(new Date($))}if(R.charAt(0)==="-")for(;R.length<11;)R="-0"+R.substr(1);else for(;R.length<10;)R="0"+R;j=P<w?Math.floor(X/s):0,G=P<w?Math.floor(X%s/f):0,Y=P<T?Math.floor(X%f/c):0,O=P<A?X%c*10+C:0}else K=new Date($),R=p("%Y-%m-%d")(K),j=P<w?K.getUTCHours():0,G=P<w?K.getUTCMinutes():0,Y=P<T?K.getUTCSeconds():0,O=P<A?K.getUTCMilliseconds()*10+C:0;return M(R,j,G,Y,O)},t.ms2DateTimeLocal=function(D){if(!(D>=_+l&&D<=g-l))return o;var P=Math.floor(i(D+.05,1)*10),k=new Date(Math.round(D-P/10)),C=e("%Y-%m-%d")(k),$=k.getHours(),R=k.getMinutes(),j=k.getSeconds(),G=k.getUTCMilliseconds()*10+P;return M(C,$,R,j,G)};function M(D,P,k,C,$){if((P||k||C||$)&&(D+=" "+x(P,2)+":"+x(k,2),(C||$)&&(D+=":"+x(C,2),$))){for(var R=4;$%10===0;)R-=1,$/=10;D+="."+x($,R)}return D}t.cleanDate=function(D,P,k){if(D===o)return P;if(t.isJSDate(D)||typeof D=="number"&&isFinite(D)){if(y(k))return a.error("JS Dates and milliseconds are incompatible with world calendars",D),P;if(D=t.ms2DateTimeLocal(+D),!D&&P!==void 0)return P}else if(!t.isDateTime(D,k))return a.error("unrecognized date",D),P;return D};var S=/%\d?f/g,L=/%h/g,E={1:"1",2:"1",3:"2",4:"2"};function F(D,P,k,C){D=D.replace(S,function(R){var j=Math.min(+R.charAt(1)||6,6),G=(P/1e3%1+2).toFixed(j).substr(2).replace(/0+$/,"")||"0";return G});var $=new Date(Math.floor(P+.05));if(D=D.replace(L,function(){return E[k("%q")($)]}),y(C))try{D=v.getComponentMethod("calendars","worldCalFmt")(D,P,C)}catch{return"Invalid"}return k(D)($)}var N=[59,59.9,59.99,59.999,59.9999];function z(D,P){var k=i(D+.05,l),C=x(Math.floor(k/s),2)+":"+x(i(Math.floor(k/f),60),2);if(P!=="M"){r(P)||(P=0);var $=Math.min(i(D/c,60),N[P]),R=(100+$).toFixed(P).substr(1);P>0&&(R=R.replace(/0+$/,"").replace(/[\.]$/,"")),C+=":"+R}return C}t.formatDate=function(D,P,k,C,$,R){if($=y($)&&$,!P)if(k==="y")P=R.year;else if(k==="m")P=R.month;else if(k==="d")P=R.dayMonth+`
2
- `+R.year;else return z(D,k)+`
3
- `+F(R.dayMonthYear,D,C,$);return F(P,D,C,$)};var H=3*l;t.incrementMonth=function(D,P,k){k=y(k)&&k;var C=i(D,l);if(D=Math.round(D-C),k)try{var $=Math.round(D/l)+u,R=v.getComponentMethod("calendars","getCal")(k),j=R.fromJD($);return P%12?R.add(j,P,"m"):R.add(j,P/12,"y"),(j.toJD()-u)*l+C}catch{a.error("invalid ms "+D+" in calendar "+k)}var G=new Date(D+H);return G.setUTCMonth(G.getUTCMonth()+P)+C-H},t.findExactDates=function(D,P){for(var k=0,C=0,$=0,R=0,j,G,Y=y(P)&&v.getComponentMethod("calendars","getCal")(P),O=0;O<D.length;O++){if(G=D[O],!r(G)){R++;continue}if(!(G%l))if(Y)try{j=Y.fromJD(G/l+u),j.day()===1?j.month()===1?k++:C++:$++}catch{}else j=new Date(G),j.getUTCDate()===1?j.getUTCMonth()===0?k++:C++:$++}C+=k,$+=C;var K=D.length-R;return{exactYears:k/K,exactMonths:C/K,exactDays:$/K}}})(d_);var Xh={},H_=function(e){return e};(function(t){var e=kt,r=Uo,a=H_,i=fr.BADNUM,n=1e-9;t.findBin=function(c,u,v){if(e(u.start))return v?Math.ceil((c-u.start)/u.size-n)-1:Math.floor((c-u.start)/u.size+n);var p=0,d=u.length,h=0,m=d>1?(u[d-1]-u[0])/(d-1):1,y,b;for(m>=0?b=v?o:l:b=v?f:s,c+=m*n*(v?-1:1)*(m>=0?1:-1);p<d&&h++<100;)y=Math.floor((p+d)/2),b(u[y],c)?p=y+1:d=y;return h>90&&r.log("Long binary search..."),p-1};function o(c,u){return c<u}function l(c,u){return c<=u}function s(c,u){return c>u}function f(c,u){return c>=u}t.sorterAsc=function(c,u){return c-u},t.sorterDes=function(c,u){return u-c},t.distinctVals=function(c){var u=c.slice();u.sort(t.sorterAsc);var v;for(v=u.length-1;v>-1&&u[v]===i;v--);for(var p=u[v]-u[0]||1,d=p/(v||1)/1e4,h=[],m,y=0;y<=v;y++){var b=u[y],_=b-m;m===void 0?(h.push(b),m=b):_>d&&(p=Math.min(p,_),h.push(b),m=b)}return{vals:h,minDiff:p}},t.roundUp=function(c,u,v){for(var p=0,d=u.length-1,h,m=0,y=v?0:1,b=v?1:0,_=v?Math.ceil:Math.floor;p<d&&m++<100;)h=_((p+d)/2),u[h]<=c?p=h+y:d=h-b;return u[p]},t.sort=function(c,u){for(var v=0,p=0,d=1;d<c.length;d++){var h=u(c[d],c[d-1]);if(h<0?v=1:h>0&&(p=1),v&&p)return c.sort(u)}return p?c:c.reverse()},t.findIndexOfMin=function(c,u){u=u||a;for(var v=1/0,p,d=0;d<c.length;d++){var h=u(c[d]);h<v&&(v=h,p=d)}return p}})(Xh);var Yh=function(e){return Object.keys(e).sort()},O_={};(function(t){var e=kt,r=sr.isArrayOrTypedArray;t.aggNums=function(a,i,n,o){var l,s;if((!o||o>n.length)&&(o=n.length),e(i)||(i=!1),r(n[0])){for(s=new Array(o),l=0;l<o;l++)s[l]=t.aggNums(a,i,n[l]);n=s}for(l=0;l<o;l++)e(i)?e(n[l])&&(i=a(+i,+n[l])):i=n[l];return i},t.len=function(a){return t.aggNums(function(i){return i+1},0,a)},t.mean=function(a,i){return i||(i=t.len(a)),t.aggNums(function(n,o){return n+o},0,a)/i},t.geometricMean=function(a,i){return i||(i=t.len(a)),Math.pow(t.aggNums(function(n,o){return n*o},1,a),1/i)},t.midRange=function(a){if(!(a===void 0||a.length===0))return(t.aggNums(Math.max,null,a)+t.aggNums(Math.min,null,a))/2},t.variance=function(a,i,n){return i||(i=t.len(a)),e(n)||(n=t.mean(a,i)),t.aggNums(function(o,l){return o+Math.pow(l-n,2)},0,a)/i},t.stdev=function(a,i,n){return Math.sqrt(t.variance(a,i,n))},t.median=function(a){var i=a.slice().sort();return t.interp(i,.5)},t.interp=function(a,i){if(!e(i))throw"n should be a finite number";if(i=i*a.length-.5,i<0)return a[0];if(i>a.length-1)return a[a.length-1];var n=i%1;return n*a[Math.ceil(i)]+(1-n)*a[Math.floor(i)]}})(O_);var j_=us,Eu=j_.mod,QS=j_.modHalf,Ul=Math.PI,Ci=2*Ul;function JS(t){return t/180*Ul}function eL(t){return t/Ul*180}function qh(t){return Math.abs(t[1]-t[0])>Ci-1e-14}function B_(t,e){return QS(e-t,Ci)}function tL(t,e){return Math.abs(B_(t,e))}function G_(t,e){if(qh(e))return!0;var r,a;e[0]<e[1]?(r=e[0],a=e[1]):(r=e[1],a=e[0]),r=Eu(r,Ci),a=Eu(a,Ci),r>a&&(a+=Ci);var i=Eu(t,Ci),n=i+Ci;return i>=r&&i<=a||n>=r&&n<=a}function rL(t,e,r,a){if(!G_(e,a))return!1;var i,n;return r[0]<r[1]?(i=r[0],n=r[1]):(i=r[1],n=r[0]),t>=i&&t<=n}function Zh(t,e,r,a,i,n,o){i=i||0,n=n||0;var l=qh([r,a]),s,f,c,u,v;l?(s=0,f=Ul,c=Ci):r<a?(s=r,c=a):(s=a,c=r),t<e?(u=t,v=e):(u=e,v=t);function p(y,b){return[y*Math.cos(b)+i,n-y*Math.sin(b)]}var d=Math.abs(c-s)<=Ul?0:1;function h(y,b,_){return"A"+[y,y]+" "+[0,d,_]+" "+p(y,b)}var m;return l?u===null?m="M"+p(v,s)+h(v,f,0)+h(v,c,0)+"Z":m="M"+p(u,s)+h(u,f,0)+h(u,c,0)+"ZM"+p(v,s)+h(v,f,1)+h(v,c,1)+"Z":u===null?(m="M"+p(v,s)+h(v,c,0),o&&(m+="L0,0Z")):m="M"+p(u,s)+"L"+p(v,s)+h(v,c,0)+"L"+p(u,c)+h(u,s,1)+"Z",m}function aL(t,e,r,a,i){return Zh(null,t,e,r,a,i,0)}function iL(t,e,r,a,i){return Zh(null,t,e,r,a,i,1)}function nL(t,e,r,a,i,n){return Zh(t,e,r,a,i,n,1)}var oL={deg2rad:JS,rad2deg:eL,angleDelta:B_,angleDist:tL,isFullCircle:qh,isAngleInsideSector:G_,isPtInsideSector:rL,pathArc:aL,pathSector:iL,pathAnnulus:nL},Pn={};Pn.isLeftAnchor=function(e){return e.xanchor==="left"||e.xanchor==="auto"&&e.x<=1/3};Pn.isCenterAnchor=function(e){return e.xanchor==="center"||e.xanchor==="auto"&&e.x>1/3&&e.x<2/3};Pn.isRightAnchor=function(e){return e.xanchor==="right"||e.xanchor==="auto"&&e.x>=2/3};Pn.isTopAnchor=function(e){return e.yanchor==="top"||e.yanchor==="auto"&&e.y>=2/3};Pn.isMiddleAnchor=function(e){return e.yanchor==="middle"||e.yanchor==="auto"&&e.y>1/3&&e.y<2/3};Pn.isBottomAnchor=function(e){return e.yanchor==="bottom"||e.yanchor==="auto"&&e.y<=1/3};var $n={},zu=us.mod;$n.segmentsIntersect=U_;function U_(t,e,r,a,i,n,o,l){var s=r-t,f=i-t,c=o-i,u=a-e,v=n-e,p=l-n,d=s*p-c*u;if(d===0)return null;var h=(f*p-c*v)/d,m=(f*u-s*v)/d;return m<0||m>1||h<0||h>1?null:{x:t+s*h,y:e+u*h}}$n.segmentDistance=function(e,r,a,i,n,o,l,s){if(U_(e,r,a,i,n,o,l,s))return 0;var f=a-e,c=i-r,u=l-n,v=s-o,p=f*f+c*c,d=u*u+v*v,h=Math.min(Ps(f,c,p,n-e,o-r),Ps(f,c,p,l-e,s-r),Ps(u,v,d,e-n,r-o),Ps(u,v,d,a-n,i-o));return Math.sqrt(h)};function Ps(t,e,r,a,i){var n=a*t+i*e;if(n<0)return a*a+i*i;if(n>r){var o=a-t,l=i-e;return o*o+l*l}else{var s=a*e-i*t;return s*s/r}}var $s,Id,Pm;$n.getTextLocation=function(e,r,a,i){if((e!==Id||i!==Pm)&&($s={},Id=e,Pm=i),$s[a])return $s[a];var n=e.getPointAtLength(zu(a-i/2,r)),o=e.getPointAtLength(zu(a+i/2,r)),l=Math.atan((o.y-n.y)/(o.x-n.x)),s=e.getPointAtLength(zu(a,r)),f=(s.x*4+n.x+o.x)/6,c=(s.y*4+n.y+o.y)/6,u={x:f,y:c,theta:l};return $s[a]=u,u};$n.clearLocationCache=function(){Id=null};$n.getVisibleSegment=function(e,r,a){var i=r.left,n=r.right,o=r.top,l=r.bottom,s=0,f=e.getTotalLength(),c=f,u,v;function p(h){var m=e.getPointAtLength(h);h===0?u=m:h===f&&(v=m);var y=m.x<i?i-m.x:m.x>n?m.x-n:0,b=m.y<o?o-m.y:m.y>l?m.y-l:0;return Math.sqrt(y*y+b*b)}for(var d=p(s);d;){if(s+=d+a,s>c)return;d=p(s)}for(d=p(c);d;){if(c-=d+a,s>c)return;d=p(c)}return{min:s,max:c,len:c-s,total:f,isClosed:s===0&&c===f&&Math.abs(u.x-v.x)<.1&&Math.abs(u.y-v.y)<.1}};$n.findPointOnPath=function(e,r,a,i){i=i||{};for(var n=i.pathLength||e.getTotalLength(),o=i.tolerance||.001,l=i.iterationLimit||30,s=e.getPointAtLength(0)[a]>e.getPointAtLength(n)[a]?-1:1,f=0,c=0,u=n,v,p,d;f<l;){if(v=(c+u)/2,p=e.getPointAtLength(v),d=p[a]-r,Math.abs(d)<o)return p;s*d>0?u=v:c=v,f++}return p};var Xc={};(function(t){var e={};t.throttle=function(i,n,o){var l=e[i],s=Date.now();if(!l){for(var f in e)e[f].ts<s-6e4&&delete e[f];l=e[i]={ts:0,timer:null}}r(l);function c(){o(),l.ts=Date.now(),l.onDone&&(l.onDone(),l.onDone=null)}if(s>l.ts+n){c();return}l.timer=setTimeout(function(){c(),l.timer=null},n)},t.done=function(a){var i=e[a];return!i||!i.timer?Promise.resolve():new Promise(function(n){var o=i.onDone;i.onDone=function(){o&&o(),n(),i.onDone=null}})},t.clear=function(a){if(a)r(e[a]),delete e[a];else for(var i in e)t.clear(i)};function r(a){a&&a.timer!==null&&(clearTimeout(a.timer),a.timer=null)}})(Xc);var lL=function(e){e._responsiveChartHandler&&(window.removeEventListener("resize",e._responsiveChartHandler),delete e._responsiveChartHandler)},sL=kt,fL=LM,cL=function(e){var r;if(e&&e.hasOwnProperty("userAgent")?r=e.userAgent:r=uL(),typeof r!="string")return!0;var a=fL({ua:{headers:{"user-agent":r}},tablet:!0,featureDetect:!1});if(!a)for(var i=r.split(" "),n=1;n<i.length;n++){var o=i[n];if(o.indexOf("Safari")!==-1)for(var l=n-1;l>-1;l--){var s=i[l];if(s.substr(0,8)==="Version/"){var f=s.substr(8).split(".")[0];if(sL(f)&&(f=+f),f>=13)return!0}}}return a};function uL(){var t;return typeof navigator<"u"&&(t=navigator.userAgent),t&&t.headers&&typeof t.headers["user-agent"]=="string"&&(t=t.headers["user-agent"]),t}var vL=bt,dL=function(e,r,a){var i=e.selectAll("g."+a.replace(/\s/g,".")).data(r,function(o){return o[0].trace.uid});i.exit().remove(),i.enter().append("g").attr("class",a),i.order();var n=e.classed("rangeplot")?"nodeRangePlot3":"node3";return i.each(function(o){o[0][n]=vL.select(this)}),i},hL=ot,pL=function(e,r){for(var a=e._context.locale,i=0;i<2;i++){for(var n=e._context.locales,o=0;o<2;o++){var l=(n[a]||{}).dictionary;if(l){var s=l[r];if(s)return s}n=hL.localeRegistry}var f=a.split("-")[0];if(f===a)break;a=f}return r},mL=function(e){for(var r={},a=[],i=0,n=0;n<e.length;n++){var o=e[n];r[o]!==1&&(r[o]=1,a[i++]=o)}return a},yL=function(e){for(var r=xL(e)?bL:gL,a=[],i=0;i<e.length;i++){var n=e[i];r(n)&&a.push(n)}return a};function gL(t){return t.visible===!0}function bL(t){var e=t[0].trace;return e.visible===!0&&e._length!==0}function xL(t){return Array.isArray(t)&&Array.isArray(t[0])&&t[0][0]&&t[0][0].trace}var _L=function(e,r){if(!r)return e;var a=1/Math.abs(r),i=a>1?(a*e+a*r)/a:e+r,n=String(i).length;if(n>16){var o=String(r).length,l=String(e).length;if(n>=l+o){var s=parseFloat(i).toPrecision(12);s.indexOf("e+")===-1&&(i=+s)}}return i},wL=kt,TL=fr.BADNUM,kL=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g,AL=function(e){return typeof e=="string"&&(e=e.replace(kL,"")),wL(e)?Number(e):TL},Ll=bt,ML=Gl.utcFormat,SL=W1.format,V_=kt,W_=fr,X_=W_.FP_SAFE,LL=-X_,$m=W_.BADNUM,ie=e_.exports={};ie.adjustFormat=function(e){return!e||/^\d[.]\df/.test(e)||/[.]\d%/.test(e)?e:e==="0.f"?"~f":/^\d%/.test(e)?"~%":/^\ds/.test(e)?"~s":!/^[~,.0$]/.test(e)&&/[&fps]/.test(e)?"~"+e:e};var Em={};ie.warnBadFormat=function(t){var e=String(t);Em[e]||(Em[e]=1,ie.warn('encountered bad format: "'+e+'"'))};ie.noFormat=function(t){return String(t)};ie.numberFormat=function(t){var e;try{e=SL(ie.adjustFormat(t))}catch{return ie.warnBadFormat(t),ie.noFormat}return e};ie.nestedProperty=Nh;ie.keyedContainer=QM;ie.relativeAttr=tS;ie.isPlainObject=Dn;ie.toLogRange=Hh;ie.relinkPrivateKeys=aS;var Hi=sr;ie.isArrayBuffer=Hi.isArrayBuffer;ie.isTypedArray=Hi.isTypedArray;ie.isArrayOrTypedArray=Hi.isArrayOrTypedArray;ie.isArray1D=Hi.isArray1D;ie.ensureArray=Hi.ensureArray;ie.concat=Hi.concat;ie.maxRowLength=Hi.maxRowLength;ie.minRowLength=Hi.minRowLength;var Y_=us;ie.mod=Y_.mod;ie.modHalf=Y_.modHalf;var Oi=l_;ie.valObjectMeta=Oi.valObjectMeta;ie.coerce=Oi.coerce;ie.coerce2=Oi.coerce2;ie.coerceFont=Oi.coerceFont;ie.coercePattern=Oi.coercePattern;ie.coerceHoverinfo=Oi.coerceHoverinfo;ie.coerceSelectionMarkerOpacity=Oi.coerceSelectionMarkerOpacity;ie.validate=Oi.validate;var ca=d_;ie.dateTime2ms=ca.dateTime2ms;ie.isDateTime=ca.isDateTime;ie.ms2DateTime=ca.ms2DateTime;ie.ms2DateTimeLocal=ca.ms2DateTimeLocal;ie.cleanDate=ca.cleanDate;ie.isJSDate=ca.isJSDate;ie.formatDate=ca.formatDate;ie.incrementMonth=ca.incrementMonth;ie.dateTick0=ca.dateTick0;ie.dfltRange=ca.dfltRange;ie.findExactDates=ca.findExactDates;ie.MIN_MS=ca.MIN_MS;ie.MAX_MS=ca.MAX_MS;var En=Xh;ie.findBin=En.findBin;ie.sorterAsc=En.sorterAsc;ie.sorterDes=En.sorterDes;ie.distinctVals=En.distinctVals;ie.roundUp=En.roundUp;ie.sort=En.sort;ie.findIndexOfMin=En.findIndexOfMin;ie.sortObjectKeys=Yh;var di=O_;ie.aggNums=di.aggNums;ie.len=di.len;ie.mean=di.mean;ie.geometricMean=di.geometricMean;ie.median=di.median;ie.midRange=di.midRange;ie.variance=di.variance;ie.stdev=di.stdev;ie.interp=di.interp;var Ha=jc;ie.init2dArray=Ha.init2dArray;ie.transposeRagged=Ha.transposeRagged;ie.dot=Ha.dot;ie.translationMatrix=Ha.translationMatrix;ie.rotationMatrix=Ha.rotationMatrix;ie.rotationXYMatrix=Ha.rotationXYMatrix;ie.apply3DTransform=Ha.apply3DTransform;ie.apply2DTransform=Ha.apply2DTransform;ie.apply2DTransform2=Ha.apply2DTransform2;ie.convertCssMatrix=Ha.convertCssMatrix;ie.inverseTransformMatrix=Ha.inverseTransformMatrix;var ei=oL;ie.deg2rad=ei.deg2rad;ie.rad2deg=ei.rad2deg;ie.angleDelta=ei.angleDelta;ie.angleDist=ei.angleDist;ie.isFullCircle=ei.isFullCircle;ie.isAngleInsideSector=ei.isAngleInsideSector;ie.isPtInsideSector=ei.isPtInsideSector;ie.pathArc=ei.pathArc;ie.pathSector=ei.pathSector;ie.pathAnnulus=ei.pathAnnulus;var Vo=Pn;ie.isLeftAnchor=Vo.isLeftAnchor;ie.isCenterAnchor=Vo.isCenterAnchor;ie.isRightAnchor=Vo.isRightAnchor;ie.isTopAnchor=Vo.isTopAnchor;ie.isMiddleAnchor=Vo.isMiddleAnchor;ie.isBottomAnchor=Vo.isBottomAnchor;var Wo=$n;ie.segmentsIntersect=Wo.segmentsIntersect;ie.segmentDistance=Wo.segmentDistance;ie.getTextLocation=Wo.getTextLocation;ie.clearLocationCache=Wo.clearLocationCache;ie.getVisibleSegment=Wo.getVisibleSegment;ie.findPointOnPath=Wo.findPointOnPath;var Yc=Xt;ie.extendFlat=Yc.extendFlat;ie.extendDeep=Yc.extendDeep;ie.extendDeepAll=Yc.extendDeepAll;ie.extendDeepNoArrays=Yc.extendDeepNoArrays;var Kh=Uo;ie.log=Kh.log;ie.warn=Kh.warn;ie.error=Kh.error;var CL=Bo;ie.counterRegex=CL.counter;var Qh=Xc;ie.throttle=Qh.throttle;ie.throttleDone=Qh.done;ie.clearThrottle=Qh.clear;var Oa=Bc;ie.getGraphDiv=Oa.getGraphDiv;ie.isPlotDiv=Oa.isPlotDiv;ie.removeElement=Oa.removeElement;ie.addStyleRule=Oa.addStyleRule;ie.addRelatedStyleRule=Oa.addRelatedStyleRule;ie.deleteRelatedStyleRule=Oa.deleteRelatedStyleRule;ie.setStyleOnHover=Oa.setStyleOnHover;ie.getFullTransformMatrix=Oa.getFullTransformMatrix;ie.getElementTransformMatrix=Oa.getElementTransformMatrix;ie.getElementAndAncestors=Oa.getElementAndAncestors;ie.equalDomRects=Oa.equalDomRects;ie.clearResponsive=lL;ie.preserveDrawingBuffer=cL;ie.makeTraceGroups=dL;ie._=pL;ie.notifier=g_;ie.filterUnique=mL;ie.filterVisible=yL;ie.pushUnique=b_;ie.increment=_L;ie.cleanNumber=AL;ie.ensureNumber=function(e){return V_(e)?(e=Number(e),e>X_||e<LL?$m:e):$m};ie.isIndex=function(t,e){return e!==void 0&&t>=e?!1:V_(t)&&t>=0&&t%1===0};ie.noop=Gh;ie.identity=H_;ie.repeat=function(t,e){for(var r=new Array(e),a=0;a<e;a++)r[a]=t;return r};ie.swapAttrs=function(t,e,r,a){r||(r="x"),a||(a="y");for(var i=0;i<e.length;i++){var n=e[i],o=ie.nestedProperty(t,n.replace("?",r)),l=ie.nestedProperty(t,n.replace("?",a)),s=o.get();o.set(l.get()),l.set(s)}};ie.raiseToTop=function(e){e.parentNode.appendChild(e)};ie.cancelTransition=function(t){return t.transition().duration(0)};ie.constrain=function(t,e,r){return e>r?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))};ie.bBoxIntersect=function(t,e,r){return r=r||0,t.left<=e.right+r&&e.left<=t.right+r&&t.top<=e.bottom+r&&e.top<=t.bottom+r};ie.simpleMap=function(t,e,r,a,i){for(var n=t.length,o=new Array(n),l=0;l<n;l++)o[l]=e(t[l],r,a,i);return o};ie.randstr=function t(e,r,a,i){if(a||(a=16),r===void 0&&(r=24),r<=0)return"0";var n=Math.log(Math.pow(2,r))/Math.log(a),o="",l,s,f;for(l=2;n===1/0;l*=2)n=Math.log(Math.pow(2,r/l))/Math.log(a)*l;var c=n-Math.floor(n);for(l=0;l<Math.floor(n);l++)f=Math.floor(Math.random()*a).toString(a),o=f+o;c&&(s=Math.pow(a,c),f=Math.floor(Math.random()*s).toString(a),o=f+o);var u=parseInt(o,a);return e&&e[o]||u!==1/0&&u>=Math.pow(2,r)?i>10?(ie.warn("randstr failed uniqueness"),o):t(e,r,a,(i||0)+1):o};ie.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={};return r.optionList=[],r._newoption=function(a){a[e]=t,r[a.name]=a,r.optionList.push(a)},r["_"+e]=t,r};ie.smooth=function(t,e){if(e=Math.round(e)||0,e<2)return t;var r=t.length,a=2*r,i=2*e-1,n=new Array(i),o=new Array(r),l,s,f,c;for(l=0;l<i;l++)n[l]=(1-Math.cos(Math.PI*(l+1)/e))/(2*e);for(l=0;l<r;l++){for(c=0,s=0;s<i;s++)f=l+s+1-e,f<-r?f-=a*Math.round(f/a):f>=a&&(f-=a*Math.floor(f/a)),f<0?f=-1-f:f>=r&&(f=a-1-f),c+=t[f]*n[s];o[l]=c}return o};ie.syncOrAsync=function(t,e,r){var a,i;function n(){return ie.syncOrAsync(t,e,r)}for(;t.length;)if(i=t.splice(0,1)[0],a=i(e),a&&a.then)return a.then(n);return r&&r(e)};ie.stripTrailingSlash=function(t){return t.substr(-1)==="/"?t.substr(0,t.length-1):t};ie.noneOrAll=function(t,e,r){if(t){var a=!1,i=!0,n,o;for(n=0;n<r.length;n++)o=t[r[n]],o!=null?a=!0:i=!1;if(a&&!i)for(n=0;n<r.length;n++)t[r[n]]=e[r[n]]}};ie.mergeArray=function(t,e,r,a){var i=typeof a=="function";if(ie.isArrayOrTypedArray(t))for(var n=Math.min(t.length,e.length),o=0;o<n;o++){var l=t[o];e[o][r]=i?a(l):l}};ie.mergeArrayCastPositive=function(t,e,r){return ie.mergeArray(t,e,r,function(a){var i=+a;return isFinite(i)&&i>0?i:0})};ie.fillArray=function(t,e,r,a){if(a=a||ie.identity,ie.isArrayOrTypedArray(t))for(var i=0;i<e.length;i++)e[i][r]=a(t[i])};ie.castOption=function(t,e,r,a){a=a||ie.identity;var i=ie.nestedProperty(t,r).get();return ie.isArrayOrTypedArray(i)?Array.isArray(e)&&ie.isArrayOrTypedArray(i[e[0]])?a(i[e[0]][e[1]]):a(i[e]):i};ie.extractOption=function(t,e,r,a){if(r in t)return t[r];var i=ie.nestedProperty(e,a).get();if(!Array.isArray(i))return i};function q_(t){var e={};for(var r in t)for(var a=t[r],i=0;i<a.length;i++)e[a[i]]=+r;return e}ie.tagSelected=function(t,e,r){var a=e.selectedpoints,i=e._indexToPoints,n;i&&(n=q_(i));function o(u){return u!==void 0&&u<t.length}for(var l=0;l<a.length;l++){var s=a[l];if(ie.isIndex(s)||ie.isArrayOrTypedArray(s)&&ie.isIndex(s[0])&&ie.isIndex(s[1])){var f=n?n[s]:s,c=r?r[f]:f;o(c)&&(t[c].selected=1)}}};ie.selIndices2selPoints=function(t){var e=t.selectedpoints,r=t._indexToPoints;if(r){for(var a=q_(r),i=[],n=0;n<e.length;n++){var o=e[n];if(ie.isIndex(o)){var l=a[o];ie.isIndex(l)&&i.push(l)}}return i}else return e};ie.getTargetArray=function(t,e){var r=e.target;if(typeof r=="string"&&r){var a=ie.nestedProperty(t,r).get();return ie.isArrayOrTypedArray(a)?a:!1}else if(ie.isArrayOrTypedArray(r))return r;return!1};function Z_(t,e,r){var a={};typeof e!="object"&&(e={});var i=r==="pieLike"?-1:3,n=Object.keys(t),o,l,s;for(o=0;o<n.length;o++)l=n[o],s=t[l],!(l.charAt(0)==="_"||typeof s=="function")&&(l==="module"?a[l]=s:Array.isArray(s)?l==="colorscale"||i===-1?a[l]=s.slice():a[l]=s.slice(0,i):ie.isTypedArray(s)?i===-1?a[l]=s.subarray():a[l]=s.subarray(0,i):s&&typeof s=="object"?a[l]=Z_(t[l],e[l],r):a[l]=s);for(n=Object.keys(e),o=0;o<n.length;o++)l=n[o],s=e[l],(typeof s!="object"||!(l in a)||typeof a[l]!="object")&&(a[l]=s);return a}ie.minExtend=Z_;ie.titleCase=function(t){return t.charAt(0).toUpperCase()+t.substr(1)};ie.containsAny=function(t,e){for(var r=0;r<e.length;r++)if(t.indexOf(e[r])!==-1)return!0;return!1};var DL=/Version\/[\d\.]+.*Safari/;ie.isSafari=function(){return DL.test(window.navigator.userAgent)};var PL=/iPad|iPhone|iPod/;ie.isIOS=function(){return PL.test(window.navigator.userAgent)};var $L=/Firefox\/(\d+)\.\d+/;ie.getFirefoxVersion=function(){var t=$L.exec(window.navigator.userAgent);if(t&&t.length===2){var e=parseInt(t[1]);if(!isNaN(e))return e}return null};ie.isD3Selection=function(t){return t instanceof Ll.selection};ie.ensureSingle=function(t,e,r,a){var i=t.select(e+(r?"."+r:""));if(i.size())return i;var n=t.append(e);return r&&n.classed(r,!0),a&&n.call(a),n};ie.ensureSingleById=function(t,e,r,a){var i=t.select(e+"#"+r);if(i.size())return i;var n=t.append(e).attr("id",r);return a&&n.call(a),n};ie.objectFromPath=function(t,e){for(var r=t.split("."),a,i=a={},n=0;n<r.length;n++){var o=r[n],l=null,s=r[n].match(/(.*)\[([0-9]+)\]/);s?(o=s[1],l=s[2],a=a[o]=[],n===r.length-1?a[l]=e:a[l]={},a=a[l]):(n===r.length-1?a[o]=e:a[o]={},a=a[o])}return i};var EL=/^([^\[\.]+)\.(.+)?/,zL=/^([^\.]+)\[([0-9]+)\](\.)?(.+)?/;function Es(t){return t.slice(0,2)==="__"}ie.expandObjectPaths=function(t){var e,r,a,i,n,o,l;if(typeof t=="object"&&!Array.isArray(t)){for(r in t)if(t.hasOwnProperty(r))if(e=r.match(EL)){if(i=t[r],a=e[1],Es(a))continue;delete t[r],t[a]=ie.extendDeepNoArrays(t[a]||{},ie.objectFromPath(r,ie.expandObjectPaths(i))[a])}else if(e=r.match(zL)){if(i=t[r],a=e[1],Es(a))continue;if(n=parseInt(e[2]),delete t[r],t[a]=t[a]||[],e[3]===".")l=e[4],o=t[a][n]=t[a][n]||{},ie.extendDeepNoArrays(o,ie.objectFromPath(l,ie.expandObjectPaths(i)));else{if(Es(a))continue;t[a][n]=ie.expandObjectPaths(i)}}else{if(Es(r))continue;t[r]=ie.expandObjectPaths(t[r])}}return t};ie.numSeparate=function(t,e,r){if(r||(r=!1),typeof e!="string"||e.length===0)throw new Error("Separator string required for formatting!");typeof t=="number"&&(t=String(t));var a=/(\d+)(\d{3})/,i=e.charAt(0),n=e.charAt(1),o=t.split("."),l=o[0],s=o.length>1?i+o[1]:"";if(n&&(o.length>1||l.length>4||r))for(;a.test(l);)l=l.replace(a,"$1"+n+"$2");return l+s};ie.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var K_=/^\w*$/;ie.templateString=function(t,e){var r={};return t.replace(ie.TEMPLATE_STRING_REGEX,function(a,i){var n;return K_.test(i)?n=e[i]:(r[i]=r[i]||ie.nestedProperty(e,i).get,n=r[i](!0)),n!==void 0?n:""})};var RL={max:10,count:0,name:"hovertemplate"};ie.hovertemplateString=function(){return Jh.apply(RL,arguments)};var IL={max:10,count:0,name:"texttemplate"};ie.texttemplateString=function(){return Jh.apply(IL,arguments)};var FL=/^(\S+)([\*\/])(-?\d+(\.\d+)?)$/;function NL(t){var e=t.match(FL);return e?{key:e[1],op:e[2],number:Number(e[3])}:{key:t,op:null,number:null}}var HL={max:10,count:0,name:"texttemplate",parseMultDiv:!0};ie.texttemplateStringForShapes=function(){return Jh.apply(HL,arguments)};var zm=/^[:|\|]/;function Jh(t,e,r){var a=this,i=arguments;return e||(e={}),t.replace(ie.TEMPLATE_STRING_REGEX,function(n,o,l){var s=o==="xother"||o==="yother",f=o==="_xother"||o==="_yother",c=o==="_xother_"||o==="_yother_",u=o==="xother_"||o==="yother_",v=s||f||u||c,p=o;(f||c)&&(p=p.substring(1)),(u||c)&&(p=p.substring(0,p.length-1));var d=null,h=null;if(a.parseMultDiv){var m=NL(p);p=m.key,d=m.op,h=m.number}var y;if(v){if(y=e[p],y===void 0)return""}else{var b,_;for(_=3;_<i.length;_++)if(b=i[_],!!b){if(b.hasOwnProperty(p)){y=b[p];break}if(K_.test(p)||(y=ie.nestedProperty(b,p).get(!0)),y!==void 0)break}}if(y!==void 0&&(d==="*"&&(y*=h),d==="/"&&(y/=h)),y===void 0&&a)return a.count<a.max&&(ie.warn("Variable '"+p+"' in "+a.name+" could not be found!"),y=n),a.count===a.max&&ie.warn("Too many "+a.name+" warnings - additional warnings will be suppressed"),a.count++,n;if(l){var g;if(l[0]===":"&&(g=r?r.numberFormat:ie.numberFormat,y!==""&&(y=g(l.replace(zm,""))(y))),l[0]==="|"){g=r?r.timeFormat:ML;var x=ie.dateTime2ms(y);y=ie.formatDate(x,l.replace(zm,""),!1,g)}}else{var w=p+"Label";e.hasOwnProperty(w)&&(y=e[w])}return v&&(y="("+y+")",(f||c)&&(y=" "+y),(u||c)&&(y=y+" ")),y})}var zs=48,Rm=57;ie.subplotSort=function(t,e){for(var r=Math.min(t.length,e.length)+1,a=0,i=0,n=0;n<r;n++){var o=t.charCodeAt(n)||0,l=e.charCodeAt(n)||0,s=o>=zs&&o<=Rm,f=l>=zs&&l<=Rm;if(s&&(a=10*a+o-zs),f&&(i=10*i+l-zs),!s||!f){if(a!==i)return a-i;if(o!==l)return o-l}}return i-a};var lo=2e9;ie.seedPseudoRandom=function(){lo=2e9};ie.pseudoRandom=function(){var t=lo;return lo=(69069*lo+1)%4294967296,Math.abs(lo-t)<429496729?ie.pseudoRandom():lo/4294967296};ie.fillText=function(t,e,r){var a=Array.isArray(r)?function(o){r.push(o)}:function(o){r.text=o},i=ie.extractOption(t,e,"htx","hovertext");if(ie.isValidTextValue(i))return a(i);var n=ie.extractOption(t,e,"tx","text");if(ie.isValidTextValue(n))return a(n)};ie.isValidTextValue=function(t){return t||t===0};ie.formatPercent=function(t,e){e=e||0;for(var r=(Math.round(100*t*Math.pow(10,e))*Math.pow(.1,e)).toFixed(e)+"%",a=0;a<e;a++)r.indexOf(".")!==-1&&(r=r.replace("0%","%"),r=r.replace(".%","%"));return r};ie.isHidden=function(t){var e=window.getComputedStyle(t).display;return!e||e==="none"};ie.strTranslate=function(t,e){return t||e?"translate("+t+","+e+")":""};ie.strRotate=function(t){return t?"rotate("+t+")":""};ie.strScale=function(t){return t!==1?"scale("+t+")":""};ie.getTextTransform=function(t){var e=t.noCenter,r=t.textX,a=t.textY,i=t.targetX,n=t.targetY,o=t.anchorX||0,l=t.anchorY||0,s=t.rotate,f=t.scale;return f?f>1&&(f=1):f=0,ie.strTranslate(i-f*(r+o),n-f*(a+l))+ie.strScale(f)+(s?"rotate("+s+(e?"":" "+r+" "+a)+")":"")};ie.setTransormAndDisplay=function(t,e){t.attr("transform",ie.getTextTransform(e)),t.style("display",e.scale?null:"none")};ie.ensureUniformFontSize=function(t,e){var r=ie.extendFlat({},e);return r.size=Math.max(e.size,t._fullLayout.uniformtext.minsize||0),r};ie.join2=function(t,e,r){var a=t.length;return a>1?t.slice(0,-1).join(e)+r+t[a-1]:t.join(e)};ie.bigFont=function(t){return Math.round(1.2*t)};var Im=ie.getFirefoxVersion(),OL=Im!==null&&Im<86;ie.getPositionFromD3Event=function(){return OL?[Ll.event.layerX,Ll.event.layerY]:[Ll.event.offsetX,Ll.event.offsetY]};var we=e_.exports,jL=we,Fm={"X,X div":'direction:ltr;font-family:"Open Sans",verdana,arial,sans-serif;margin:0;padding:0;',"X input,X button":'font-family:"Open Sans",verdana,arial,sans-serif;',"X input:focus,X button:focus":"outline:none;","X a":"text-decoration:none;","X a:hover":"text-decoration:none;","X .crisp":"shape-rendering:crispEdges;","X .user-select-none":"-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;","X svg a":"fill:#447adb;","X svg a:hover":"fill:#3c6dc5;","X .main-svg":"position:absolute;top:0;left:0;pointer-events:none;","X .main-svg .draglayer":"pointer-events:all;","X .cursor-default":"cursor:default;","X .cursor-pointer":"cursor:pointer;","X .cursor-crosshair":"cursor:crosshair;","X .cursor-move":"cursor:move;","X .cursor-col-resize":"cursor:col-resize;","X .cursor-row-resize":"cursor:row-resize;","X .cursor-ns-resize":"cursor:ns-resize;","X .cursor-ew-resize":"cursor:ew-resize;","X .cursor-sw-resize":"cursor:sw-resize;","X .cursor-s-resize":"cursor:s-resize;","X .cursor-se-resize":"cursor:se-resize;","X .cursor-w-resize":"cursor:w-resize;","X .cursor-e-resize":"cursor:e-resize;","X .cursor-nw-resize":"cursor:nw-resize;","X .cursor-n-resize":"cursor:n-resize;","X .cursor-ne-resize":"cursor:ne-resize;","X .cursor-grab":"cursor:-webkit-grab;cursor:grab;","X .modebar":"position:absolute;top:2px;right:2px;","X .ease-bg":"-webkit-transition:background-color .3s ease 0s;-moz-transition:background-color .3s ease 0s;-ms-transition:background-color .3s ease 0s;-o-transition:background-color .3s ease 0s;transition:background-color .3s ease 0s;","X .modebar--hover>:not(.watermark)":"opacity:0;-webkit-transition:opacity .3s ease 0s;-moz-transition:opacity .3s ease 0s;-ms-transition:opacity .3s ease 0s;-o-transition:opacity .3s ease 0s;transition:opacity .3s ease 0s;","X:hover .modebar--hover .modebar-group":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;","X .modebar-btn svg":"position:relative;top:2px;","X .modebar.vertical":"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;","X .modebar.vertical svg":"top:-1px;","X .modebar.vertical .modebar-group":"display:block;float:none;padding-left:0px;padding-bottom:8px;","X .modebar.vertical .modebar-group .modebar-btn":"display:block;text-align:center;","X [data-title]:before,X [data-title]:after":"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;","X [data-title]:hover:before,X [data-title]:hover:after":"display:block;opacity:1;","X [data-title]:before":'content:"";position:absolute;background:rgba(0,0,0,0);border:6px solid rgba(0,0,0,0);z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;',"X [data-title]:after":"content:attr(data-title);background:#69738a;color:#fff;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .vertical [data-title]:before,X .vertical [data-title]:after":"top:0%;right:200%;","X .vertical [data-title]:before":"border:6px solid rgba(0,0,0,0);border-left-color:#69738a;margin-top:8px;margin-right:-30px;",Y:'font-family:"Open Sans",verdana,arial,sans-serif;position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;',"Y p":"margin:0;","Y .notifier-note":"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;","Y .notifier-close:hover":"color:#444;text-decoration:none;cursor:pointer;"};for(var Nm in Fm){var BL=Nm.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier");jL.addStyleRule(BL,Fm[Nm])}var Yt={},ep={},Ru=Eh.EventEmitter,GL={init:function(t){if(t._ev instanceof Ru)return t;var e=new Ru,r=new Ru;return t._ev=e,t._internalEv=r,t.on=e.on.bind(e),t.once=e.once.bind(e),t.removeListener=e.removeListener.bind(e),t.removeAllListeners=e.removeAllListeners.bind(e),t._internalOn=r.on.bind(r),t._internalOnce=r.once.bind(r),t._removeInternalListener=r.removeListener.bind(r),t._removeAllInternalListeners=r.removeAllListeners.bind(r),t.emit=function(a,i){e.emit(a,i),r.emit(a,i)},t},triggerHandler:function(t,e,r){var a,i=t._ev;if(!i)return;var n=i._events[e];if(!n)return;function o(s){if(s.listener){if(i.removeListener(e,s.listener),!s.fired)return s.fired=!0,s.listener.apply(i,[r])}else return s.apply(i,[r])}n=Array.isArray(n)?n:[n];var l;for(l=0;l<n.length-1;l++)o(n[l]);return a=o(n[l]),a},purge:function(t){return delete t._ev,delete t.on,delete t.once,delete t.removeListener,delete t.removeAllListeners,delete t.emit,delete t._ev,delete t._internalEv,delete t._internalOn,delete t._internalOnce,delete t._removeInternalListener,delete t._removeAllInternalListeners,t}},ms=GL,Hm=we,UL=Go.dfltConfig;function VL(t,e){for(var r=[],a,i=0;i<e.length;i++)a=e[i],a===t?r[i]=a:typeof a=="object"?r[i]=Array.isArray(a)?Hm.extendDeep([],a):Hm.extendDeepAll({},a):r[i]=a;return r}var vi={};vi.add=function(t,e,r,a,i){var n,o;if(t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},o=t.undoQueue.index,t.autoplay){t.undoQueue.inSequence||(t.autoplay=!1);return}!t.undoQueue.sequence||t.undoQueue.beginSequence?(n={undo:{calls:[],args:[]},redo:{calls:[],args:[]}},t.undoQueue.queue.splice(o,t.undoQueue.queue.length-o,n),t.undoQueue.index+=1):n=t.undoQueue.queue[o-1],t.undoQueue.beginSequence=!1,n&&(n.undo.calls.unshift(e),n.undo.args.unshift(r),n.redo.calls.push(a),n.redo.args.push(i)),t.undoQueue.queue.length>UL.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--)};vi.startSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0};vi.stopSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1};vi.undo=function(e){var r,a;if(!(e.undoQueue===void 0||isNaN(e.undoQueue.index)||e.undoQueue.index<=0)){for(e.undoQueue.index--,r=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,a=0;a<r.undo.calls.length;a++)vi.plotDo(e,r.undo.calls[a],r.undo.args[a]);e.undoQueue.inSequence=!1,e.autoplay=!1}};vi.redo=function(e){var r,a;if(!(e.undoQueue===void 0||isNaN(e.undoQueue.index)||e.undoQueue.index>=e.undoQueue.queue.length)){for(r=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,a=0;a<r.redo.calls.length;a++)vi.plotDo(e,r.redo.calls[a],r.redo.args[a]);e.undoQueue.inSequence=!1,e.autoplay=!1,e.undoQueue.index++}};vi.plotDo=function(t,e,r){t.autoplay=!0,r=VL(t,r),e.apply(null,r)};var WL=vi,Xo={},Q_={_isLinkedToArray:"frames_entry",group:{valType:"string",description:["An identifier that specifies the group to which the frame belongs,","used by animate to select a subset of frames."].join(" ")},name:{valType:"string",description:"A label by which to identify the frame"},traces:{valType:"any",description:["A list of trace indices that identify the respective traces in the","data attribute"].join(" ")},baseframe:{valType:"string",description:["The name of the frame into which this frame's properties are merged","before applying. This is used to unify properties and avoid needing","to specify the same values for the same properties in multiple frames."].join(" ")},data:{valType:"any",description:["A list of traces this frame modifies. The format is identical to the","normal trace definition."].join(" ")},layout:{valType:"any",description:["Layout properties which this frame modifies. The format is identical","to the normal layout definition."].join(" ")}};(function(t){var e=ot,r=we,a=wa,i=ps,n=Q_,o=Gc,l=Go.configAttributes,s=Ja,f=r.extendDeepAll,c=r.isPlainObject,u=r.isArrayOrTypedArray,v=r.nestedProperty,p=r.valObjectMeta,d="_isSubplotObj",h="_isLinkedToArray",m="_arrayAttrRegexps",y="_deprecated",b=[d,h,m,y];t.IS_SUBPLOT_OBJ=d,t.IS_LINKED_TO_ARRAY=h,t.DEPRECATED=y,t.UNDERSCORE_ATTRS=b,t.get=function(){var z={};return e.allTypes.forEach(function(H){z[H]=w(H)}),{defs:{valObjects:p,metaKeys:b.concat(["description","role","editType","impliedEdits"]),editType:{traces:s.traces,layout:s.layout},impliedEdits:{description:["Sometimes when an attribute is changed, other attributes","must be altered as well in order to achieve the intended","result. For example, when `range` is specified, it is","important to set `autorange` to `false` or the new `range`","value would be lost in the redraw. `impliedEdits` is the","mechanism to do this: `impliedEdits: {autorange: false}`.","Each key is a relative paths to the attribute string to","change, using *^* to ascend into the parent container,","for example `range[0]` has `impliedEdits: {*^autorange*: false}`.","A value of `undefined` means that the attribute will not be","changed, but its previous value should be recorded in case","we want to reverse this change later. For example, `autorange`","has `impliedEdits: {*range[0]*: undefined, *range[1]*:undefined}","because the range will likely be changed by redraw."].join(" ")}},traces:z,layout:T(),frames:A(),animation:M(o),config:M(l)}},t.crawl=function(z,H,D,P){var k=D||0;P=P||"",Object.keys(z).forEach(function(C){var $=z[C];if(b.indexOf(C)===-1){var R=(P?P+".":"")+C;H($,C,z,k,R),!t.isValObject($)&&c($)&&C!=="impliedEdits"&&t.crawl($,H,k+1,R)}})},t.isValObject=function(z){return z&&z.valType!==void 0},t.findArrayAttributes=function(z){var H=[],D=[],P=[],k,C;function $(j,G,Y,O){D=D.slice(0,O).concat([G]),P=P.slice(0,O).concat([j&&j._isLinkedToArray]);var K=j&&(j.valType==="data_array"||j.arrayOk===!0)&&!(D[O-1]==="colorbar"&&(G==="ticktext"||G==="tickvals"));K&&R(k,0,"")}function R(j,G,Y){var O=j[D[G]],K=Y+D[G];if(G===D.length-1)u(O)&&H.push(C+K);else if(P[G]){if(Array.isArray(O))for(var W=0;W<O.length;W++)c(O[W])&&R(O[W],G+1,K+"["+W+"].")}else c(O)&&R(O,G+1,K+".")}return k=z,C="",t.crawl(a,$),z._module&&z._module.attributes&&t.crawl(z._module.attributes,$),H},t.getTraceValObject=function(z,H){var D=H[0],P=1,k,C,$=z._module;if($||($=(e.modules[z.type||a.type.dflt]||{})._module),!$)return!1;if(k=$.attributes,C=k&&k[D],!C){var R=$.basePlotModule;R&&R.attributes&&(C=R.attributes[D])}return C||(C=a[D]),g(C,H,P)},t.getLayoutValObject=function(z,H){var D=_(z,H[0]);return g(D,H,1)};function _(z,H){var D,P,k,C,$=z._basePlotModules;if($){var R;for(D=0;D<$.length;D++){if(k=$[D],k.attrRegex&&k.attrRegex.test(H)){if(k.layoutAttrOverrides)return k.layoutAttrOverrides;!R&&k.layoutAttributes&&(R=k.layoutAttributes)}var j=k.baseLayoutAttrOverrides;if(j&&H in j)return j[H]}if(R)return R}var G=z._modules;if(G){for(D=0;D<G.length;D++)if(C=G[D].layoutAttributes,C&&H in C)return C[H]}for(P in e.componentsRegistry){if(k=e.componentsRegistry[P],k.name==="colorscale"&&H.indexOf("coloraxis")===0)return k.layoutAttributes[H];if(!k.schema&&H===k.name)return k.layoutAttributes}return H in i?i[H]:!1}function g(z,H,D){if(!z)return!1;if(z._isLinkedToArray){if(x(H[D]))D++;else if(D<H.length)return!1}for(;D<H.length;D++){var P=z[H[D]];if(c(P))z=P;else break;if(D===H.length-1)break;if(z._isLinkedToArray){if(D++,!x(H[D]))return!1}else if(z.valType==="info_array"){D++;var k=H[D];if(!x(k))return!1;var C=z.items;if(Array.isArray(C)){if(k>=C.length)return!1;if(z.dimensions===2){if(D++,H.length===D)return z;var $=H[D];if(!x($))return!1;z=C[k][$]}else z=C[k]}else z=C}}return z}function x(z){return z===Math.round(z)&&z>=0}function w(z){var H,D;H=e.modules[z]._module,D=H.basePlotModule;var P={};P.type=null;var k=f({},a),C=f({},H.attributes);t.crawl(C,function(j,G,Y,O,K){v(k,K).set(void 0),j===void 0&&v(C,K).set(void 0)}),f(P,k),e.traceIs(z,"noOpacity")&&delete P.opacity,e.traceIs(z,"showLegend")||(delete P.showlegend,delete P.legendgroup),e.traceIs(z,"noHover")&&(delete P.hoverinfo,delete P.hoverlabel),H.selectPoints||delete P.selectedpoints,f(P,C),D.attributes&&f(P,D.attributes),P.type=z;var $={meta:H.meta||{},categories:H.categories||{},animatable:!!H.animatable,type:z,attributes:M(P)};if(H.layoutAttributes){var R={};f(R,H.layoutAttributes),$.layoutAttributes=M(R)}return H.animatable||t.crawl($,function(j){t.isValObject(j)&&"anim"in j&&delete j.anim}),$}function T(){var z={},H,D;f(z,i);for(H in e.subplotsRegistry)if(D=e.subplotsRegistry[H],!!D.layoutAttributes)if(Array.isArray(D.attr))for(var P=0;P<D.attr.length;P++)F(z,D,D.attr[P]);else{var k=D.attr==="subplot"?D.name:D.attr;F(z,D,k)}for(H in e.componentsRegistry){D=e.componentsRegistry[H];var C=D.schema;if(C&&(C.subplots||C.layout)){var $=C.subplots;if($&&$.xaxis&&!$.yaxis)for(var R in $.xaxis)delete z.yaxis[R];delete z.xaxis.shift,delete z.xaxis.autoshift}else D.name==="colorscale"?f(z,D.layoutAttributes):D.layoutAttributes&&N(z,D.layoutAttributes,D.name)}return{layoutAttributes:M(z)}}function A(){var z={frames:f({},n)};return M(z),z.frames}function M(z){return S(z),L(z),E(z),z}function S(z){function H(P){return{valType:"string",description:"Sets the source reference on Chart Studio Cloud for `"+P+"`.",editType:"none"}}function D(P,k,C){t.isValObject(P)?(P.arrayOk===!0||P.valType==="data_array")&&(C[k+"src"]=H(k)):c(P)&&(P.role="object")}t.crawl(z,D)}function L(z){function H(D,P,k){if(D){var C=D[h];C&&(delete D[h],k[P]={items:{}},k[P].items[C]=D,k[P].role="object")}}t.crawl(z,H)}function E(z){function H(D){for(var P in D)if(c(D[P]))H(D[P]);else if(Array.isArray(D[P]))for(var k=0;k<D[P].length;k++)H(D[P][k]);else D[P]instanceof RegExp&&(D[P]=D[P].toString())}H(z)}function F(z,H,D){var P=v(z,D),k=f({},H.layoutAttributes);k[d]=!0,P.set(k)}function N(z,H,D){var P=v(z,D);P.set(f(P.get()||{},H))}})(Xo);var J_={exports:{}},Ht={},_o=we,XL=wa,Pi="templateitemname",Fd={name:{valType:"string",editType:"none",description:["When used in a template, named items are created in the output figure","in addition to any items the figure already has in this array.","You can modify these items in the output figure by making your own","item with `templateitemname` matching this `name`","alongside your modifications (including `visible: false` or","`enabled: false` to hide it).","Has no effect outside of a template."].join(" ")}};Fd[Pi]={valType:"string",editType:"calc",description:["Used to refer to a named item in this array in the template. Named","items from the template will be created even without a matching item","in the input figure, but you can modify one by making an item with","`templateitemname` matching its `name`, alongside your modifications","(including `visible: false` or `enabled: false` to hide it).","If there is no template or no matching item, this item will be","hidden unless you explicitly show it with `visible: true`."].join(" ")};Ht.templatedArray=function(t,e){return e._isLinkedToArray=t,e.name=Fd.name,e[Pi]=Fd[Pi],e};Ht.traceTemplater=function(t){var e={},r,a;for(r in t)a=t[r],Array.isArray(a)&&a.length&&(e[r]=0);function i(n){r=_o.coerce(n,{},XL,"type");var o={type:r,_template:null};if(r in e){a=t[r];var l=e[r]%a.length;e[r]++,o._template=a[l]}return o}return{newTrace:i}};Ht.newContainer=function(t,e,r){var a=t._template,i=a&&(a[e]||r&&a[r]);_o.isPlainObject(i)||(i=null);var n=t[e]={_template:i};return n};Ht.arrayTemplater=function(t,e,r){var a=t._template,i=a&&a[ew(e)],n=a&&a[e];(!Array.isArray(n)||!n.length)&&(n=[]);var o={};function l(f){var c={name:f.name,_input:f},u=c[Pi]=f[Pi];if(!Om(u))return c._template=i,c;for(var v=0;v<n.length;v++){var p=n[v];if(p.name===u)return o[u]=1,c._template=p,c}return c[r]=f[r]||!1,c._template=!1,c}function s(){for(var f=[],c=0;c<n.length;c++){var u=n[c],v=u.name;if(Om(v)&&!o[v]){var p={_template:u,name:v,_input:{_templateitemname:v}};p[Pi]=u[Pi],f.push(p),o[v]=1}}return f}return{newItem:l,defaultItems:s}};function Om(t){return t&&typeof t=="string"}function ew(t){var e=t.length-1;return t.charAt(e)!=="s"&&_o.warn("bad argument to arrayDefaultKey: "+t),t.substr(0,t.length-1)+"defaults"}Ht.arrayDefaultKey=ew;Ht.arrayEditor=function(t,e,r){var a=(_o.nestedProperty(t,e).get()||[]).length,i=r._index,n=i>=a&&(r._input||{})._templateitemname;n&&(i=a);var o=e+"["+i+"]",l;function s(){l={},n&&(l[o]={},l[o][Pi]=n)}s();function f(p,d){l[p]=d}function c(p,d){n?_o.nestedProperty(l[o],p).set(d):l[o+"."+p]=d}function u(){var p=l;return s(),p}function v(p,d){p&&c(p,d);var h=u();for(var m in h)_o.nestedProperty(t,m).set(h[m])}return{modifyBase:f,modifyItem:c,getUpdateObj:u,applyUpdate:v}};var cr={},al=Bo.counter,Rr={idRegex:{x:al("x","( domain)?"),y:al("y","( domain)?")},attrRegex:al("[xy]axis"),xAxisMatch:al("xaxis"),yAxisMatch:al("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*( domain)?$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,SUBPLOT_PATTERN:/^x([0-9]*)y([0-9]*)$/,HOUR_PATTERN:"hour",WEEKDAY_PATTERN:"day of week",MINDRAG:8,MINZOOM:20,DRAGGERSIZE:20,REDRAWDELAY:50,DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","heatmaplayer","contourcarpetlayer","contourlayer","funnellayer","waterfalllayer","barlayer","carpetlayer","violinlayer","boxlayer","ohlclayer","scattercarpetlayer","scatterlayer"],clipOnAxisFalseQuery:[".scatterlayer",".barlayer",".funnellayer",".waterfalllayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"},zindexSeparator:"z"};(function(t){var e=ot,r=Rr;t.id2name=function(n){if(!(typeof n!="string"||!n.match(r.AX_ID_PATTERN))){var o=n.split(" ")[0].substr(1);return o==="1"&&(o=""),n.charAt(0)+"axis"+o}},t.name2id=function(n){if(n.match(r.AX_NAME_PATTERN)){var o=n.substr(5);return o==="1"&&(o=""),n.charAt(0)+o}},t.cleanId=function(n,o,l){var s=/( domain)$/.test(n);if(!(typeof n!="string"||!n.match(r.AX_ID_PATTERN))&&!(o&&n.charAt(0)!==o)&&!(s&&!l)){var f=n.split(" ")[0].substr(1).replace(/^0+/,"");return f==="1"&&(f=""),n.charAt(0)+f+(s&&l?" domain":"")}},t.list=function(i,n,o){var l=i._fullLayout;if(!l)return[];var s=t.listIds(i,n),f=new Array(s.length),c;for(c=0;c<s.length;c++){var u=s[c];f[c]=l[u.charAt(0)+"axis"+u.substr(1)]}if(!o){var v=l._subplots.gl3d||[];for(c=0;c<v.length;c++){var p=l[v[c]];n?f.push(p[n+"axis"]):f.push(p.xaxis,p.yaxis,p.zaxis)}}return f},t.listIds=function(i,n){var o=i._fullLayout;if(!o)return[];var l=o._subplots;return n?l[n+"axis"]:l.xaxis.concat(l.yaxis)},t.getFromId=function(i,n,o){var l=i._fullLayout;return n=n===void 0||typeof n!="string"?n:n.replace(" domain",""),o==="x"?n=n.replace(/y[0-9]*/,""):o==="y"&&(n=n.replace(/x[0-9]*/,"")),l[t.id2name(n)]},t.getFromTrace=function(i,n,o){var l=i._fullLayout,s=null;if(e.traceIs(n,"gl3d")){var f=n.scene;f.substr(0,5)==="scene"&&(s=l[f][o+"axis"])}else s=t.getFromId(i,n[o+"axis"]||o);return s},t.idSort=function(i,n){var o=i.charAt(0),l=n.charAt(0);return o!==l?o>l?1:-1:+(i.substr(1)||1)-+(n.substr(1)||1)},t.ref2id=function(i){return/^[xyz]/.test(i)?i.split(" ")[0]:!1};function a(i,n){if(n&&n.length){for(var o=0;o<n.length;o++)if(n[o][i])return!0}return!1}t.isLinked=function(i,n){return a(n,i._axisMatchGroups)||a(n,i._axisConstraintGroups)}})(cr);function YL(t){var e=t._fullLayout._zoomlayer;e&&e.selectAll(".outline-controllers").remove()}function qL(t){var e=t._fullLayout._zoomlayer;e&&e.selectAll(".select-outline").remove(),t._fullLayout._outlining=!1}var zn={clearOutlineControllers:YL,clearOutline:qL},tp={scattermode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay",editType:"calc",description:["Determines how scatter points at the same location coordinate","are displayed on the graph.","With *group*, the scatter points are plotted next to one another","centered around the shared location.","With *overlay*, the scatter points are plotted over one another,","you might need to reduce *opacity* to see multiple scatter points."].join(" ")},scattergap:{valType:"number",min:0,max:1,editType:"calc",description:["Sets the gap (in plot fraction) between scatter points of","adjacent location coordinates.","Defaults to `bargap`."].join(" ")}},ys={},ec=ot;Rr.SUBPLOT_PATTERN;ys.getSubplotCalcData=function(t,e,r){var a=ec.subplotsRegistry[e];if(!a)return[];for(var i=a.attr,n=[],o=0;o<t.length;o++){var l=t[o],s=l[0].trace;s[i]===r&&n.push(l)}return n};ys.getModuleCalcData=function(t,e,r){var a=[],i=[],n;if(typeof e=="string"?n=ec.getModule(e).plot:typeof e=="function"?n=e:n=e.plot,!n)return[a,t];for(var o=r,l=0;l<t.length;l++){var s=t[l],f=s[0].trace,c=f.zorder!==void 0;f.visible!==!0||f._length===0||(f._module&&f._module.plot===n&&(!c||f.zorder===o)?a.push(s):i.push(s))}return[a,i]};ys.getSubplotData=function(e,r,a){if(!ec.subplotsRegistry[r])return[];for(var i=ec.subplotsRegistry[r].attr,n=[],o,l=0;l<e.length;l++)o=e[l],o[i]===a&&n.push(o);return n};var Iu={},jm;function ZL(){return jm||(jm=1,function(t){var e=ot,r=we;t.manageCommandObserver=function(s,f,c,u){var v={},p=!0;f&&f._commandObserver&&(v=f._commandObserver),v.cache||(v.cache={}),v.lookupTable={};var d=t.hasSimpleAPICommandBindings(s,c,v.lookupTable);if(f&&f._commandObserver){if(d)return v;if(f._commandObserver.remove)return f._commandObserver.remove(),f._commandObserver=null,v}if(d){a(s,d,v.cache),v.check=function(){if(p){var b=a(s,d,v.cache);return b.changed&&u&&v.lookupTable[b.value]!==void 0&&(v.disable(),Promise.resolve(u({value:b.value,type:d.type,prop:d.prop,traces:d.traces,index:v.lookupTable[b.value]})).then(v.enable,v.enable)),b.changed}};for(var h=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],m=0;m<h.length;m++)s._internalOn(h[m],v.check);v.remove=function(){for(var y=0;y<h.length;y++)s._removeInternalListener(h[y],v.check)}}else r.log("Unable to automatically bind plot updates to API command"),v.lookupTable={},v.remove=function(){};return v.disable=function(){p=!1},v.enable=function(){p=!0},f&&(f._commandObserver=v),v},t.hasSimpleAPICommandBindings=function(s,f,c){var u,v=f.length,p;for(u=0;u<v;u++){var d,h=f[u],m=h.method,y=h.args;if(Array.isArray(y)||(y=[]),!m)return!1;var b=t.computeAPICommandBindings(s,m,y);if(b.length!==1)return!1;if(!p)p=b[0],Array.isArray(p.traces)&&p.traces.sort();else{if(d=b[0],d.type!==p.type||d.prop!==p.prop)return!1;if(Array.isArray(p.traces))if(Array.isArray(d.traces)){d.traces.sort();for(var _=0;_<p.traces.length;_++)if(p.traces[_]!==d.traces[_])return!1}else return!1;else if(d.prop!==p.prop)return!1}d=b[0];var g=d.value;if(Array.isArray(g))if(g.length===1)g=g[0];else return!1;c&&(c[g]=u)}return p};function a(s,f,c){var u,v,p,d=!1;if(f.type==="data")u=s._fullData[f.traces!==null?f.traces[0]:0];else if(f.type==="layout")u=s._fullLayout;else return!1;return v=r.nestedProperty(u,f.prop).get(),p=c[f.type]=c[f.type]||{},p.hasOwnProperty(f.prop)&&p[f.prop]!==v&&(d=!0),p[f.prop]=v,{changed:d,value:v}}t.executeAPICommand=function(s,f,c){if(f==="skip")return Promise.resolve();var u=e.apiMethodRegistry[f],v=[s];Array.isArray(c)||(c=[]);for(var p=0;p<c.length;p++)v.push(c[p]);return u.apply(null,v).catch(function(d){return r.warn("API call to Plotly."+f+" rejected.",d),Promise.reject(d)})},t.computeAPICommandBindings=function(s,f,c){var u;switch(Array.isArray(c)||(c=[]),f){case"restyle":u=o(s,c);break;case"relayout":u=n(s,c);break;case"update":u=o(s,[c[0],c[2]]).concat(n(s,[c[1]]));break;case"animate":u=i(s,c);break;default:u=[]}return u};function i(s,f){return Array.isArray(f[0])&&f[0].length===1&&["string","number"].indexOf(typeof f[0][0])!==-1?[{type:"layout",prop:"_currentFrame",value:f[0][0].toString()}]:[]}function n(s,f){var c=[],u=f[0],v={};if(typeof u=="string")v[u]=f[1];else if(r.isPlainObject(u))v=u;else return c;return l(v,function(p,d,h){c.push({type:"layout",prop:p,value:h})},"",0),c}function o(s,f){var c,u,v,p,d=[];if(u=f[0],v=f[1],c=f[2],p={},typeof u=="string")p[u]=v;else if(r.isPlainObject(u))p=u,c===void 0&&(c=v);else return d;return c===void 0&&(c=null),l(p,function(h,m,y){var b,_;if(Array.isArray(y)){_=y.slice();var g=Math.min(_.length,s.data.length);c&&(g=Math.min(g,c.length)),b=[];for(var x=0;x<g;x++)b[x]=c?c[x]:x}else _=y,b=c?c.slice():null;if(b===null)Array.isArray(_)&&(_=_[0]);else if(Array.isArray(b)){if(!Array.isArray(_)){var w=_;_=[];for(var T=0;T<b.length;T++)_[T]=w}_.length=Math.min(b.length,_.length)}d.push({type:"data",prop:h,traces:b,value:_})},"",0),d}function l(s,f,c,u){Object.keys(s).forEach(function(v){var p=s[v];if(v[0]!=="_"){var d=c+(u>0?".":"")+v;r.isPlainObject(p)?l(p,f,d,u+1):f(d,v,p)}})}}(Iu)),Iu}var tw=bt,KL=Gl.timeFormatLocale,QL=W1.formatLocale,El=kt,JL=U1,$t=ot,rw=Xo,eC=Ht,qe=we,aw=yt,Bm=fr.BADNUM,Kr=cr,tC=zn.clearOutline,rC=tp,rp=Gc,aC=Q_,iC=ys.getModuleCalcData,Gm=qe.relinkPrivateKeys,Zi=qe._,He=J_.exports={};qe.extendFlat(He,$t);He.attributes=wa;He.attributes.type.values=He.allTypes;He.fontAttrs=Mr;He.layoutAttributes=ps;var qc=ZL();He.executeAPICommand=qc.executeAPICommand;He.computeAPICommandBindings=qc.computeAPICommandBindings;He.manageCommandObserver=qc.manageCommandObserver;He.hasSimpleAPICommandBindings=qc.hasSimpleAPICommandBindings;He.redrawText=function(t){return t=qe.getGraphDiv(t),new Promise(function(e){setTimeout(function(){t._fullLayout&&($t.getComponentMethod("annotations","draw")(t),$t.getComponentMethod("legend","draw")(t),$t.getComponentMethod("colorbar","draw")(t),e(He.previousPromises(t)))},300)})};He.resize=function(t){t=qe.getGraphDiv(t);var e,r=new Promise(function(a,i){(!t||qe.isHidden(t))&&i(new Error("Resize must be passed a displayed plot div element.")),t._redrawTimer&&clearTimeout(t._redrawTimer),t._resolveResize&&(e=t._resolveResize),t._resolveResize=a,t._redrawTimer=setTimeout(function(){if(!t.layout||t.layout.width&&t.layout.height||qe.isHidden(t)){a(t);return}delete t.layout.width,delete t.layout.height;var n=t.changed;t.autoplay=!0,$t.call("relayout",t,{autosize:!0}).then(function(){t.changed=n,t._resolveResize===a&&(delete t._resolveResize,a(t))})},100)});return e&&e(r),r};He.previousPromises=function(t){if((t._promises||[]).length)return Promise.all(t._promises).then(function(){t._promises=[]})};He.addLinks=function(t){if(!(!t._context.showLink&&!t._context.showSources)){var e=t._fullLayout,r=qe.ensureSingle(e._paper,"text","js-plot-link-container",function(s){s.style({"font-family":'"Open Sans", Arial, sans-serif',"font-size":"12px",fill:aw.defaultLine,"pointer-events":"all"}).each(function(){var f=tw.select(this);f.append("tspan").classed("js-link-to-tool",!0),f.append("tspan").classed("js-link-spacer",!0),f.append("tspan").classed("js-sourcelinks",!0)})}),a=r.node(),i={y:e._paper.attr("height")-9};document.body.contains(a)&&a.getComputedTextLength()>=e.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=e._paper.attr("width")-7),r.attr(i);var n=r.select(".js-link-to-tool"),o=r.select(".js-link-spacer"),l=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&nC(t,n),o.text(n.text()&&l.text()?" - ":"")}};function nC(t,e){e.text("");var r=e.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(t._context.linkText+" »");if(t._context.sendData)r.on("click",function(){He.sendDataToCloud(t)});else{var a=window.location.pathname.split("/"),i=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+a[2].split(".")[0]+"/"+a[1]+i})}}He.sendDataToCloud=function(t){var e=(window.PLOTLYENV||{}).BASE_URL||t._context.plotlyServerURL;if(e){t.emit("plotly_beforeexport");var r=tw.select(t).append("div").attr("id","hiddenform").style("display","none"),a=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"}),i=a.append("input").attr({type:"text",name:"data"});return i.node().value=He.graphJson(t,!1,"keepdata"),a.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1}};var oC=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],lC=["year","month","dayMonth","dayMonthYear"];He.supplyDefaults=function(t,e){var r=e&&e.skipUpdateCalc,a=t._fullLayout||{};if(a._skipDefaults){delete a._skipDefaults;return}var i=t._fullLayout={},n=t.layout||{},o=t._fullData||[],l=t._fullData=[],s=t.data||[],f=t.calcdata||[],c=t._context||{},u;t._transitionData||He.createTransitionData(t),i._dfltTitle={plot:Zi(t,"Click to enter Plot title"),subtitle:Zi(t,"Click to enter Plot subtitle"),x:Zi(t,"Click to enter X axis title"),y:Zi(t,"Click to enter Y axis title"),colorbar:Zi(t,"Click to enter Colorscale title"),annotation:Zi(t,"new text")},i._traceWord=Zi(t,"trace");var v=Um(t,oC);if(i._mapboxAccessToken=c.mapboxAccessToken,a._initialAutoSizeIsDone){var p=a.width,d=a.height;He.supplyLayoutGlobalDefaults(n,i,v),n.width||(i.width=p),n.height||(i.height=d),He.sanitizeMargins(i)}else{He.supplyLayoutGlobalDefaults(n,i,v);var h=!n.width||!n.height,m=i.autosize,y=c.autosizable,b=h&&(m||y);b?He.plotAutoSize(t,n,i):h&&He.sanitizeMargins(i),!m&&h&&(n.width=i.width,n.height=i.height)}i._d3locale=cC(v,i.separators),i._extraFormat=Um(t,lC),i._initialAutoSizeIsDone=!0,i._dataLength=s.length,i._modules=[],i._visibleModules=[],i._basePlotModules=[];var _=i._subplots=fC(),g=i._splomAxes={x:{},y:{}},x=i._splomSubplots={};i._splomGridDflt={},i._scatterStackOpts={},i._firstScatter={},i._alignmentOpts={},i._colorAxes={},i._requestRangeslider={},i._traceUids=sC(o,s),He.supplyDataDefaults(s,l,n,i);var w=Object.keys(g.x),T=Object.keys(g.y);if(w.length>1&&T.length>1){for($t.getComponentMethod("grid","sizeDefaults")(n,i),u=0;u<w.length;u++)qe.pushUnique(_.xaxis,w[u]);for(u=0;u<T.length;u++)qe.pushUnique(_.yaxis,T[u]);for(var A in x)qe.pushUnique(_.cartesian,A)}if(i._has=He._hasPlotType.bind(i),o.length===l.length)for(u=0;u<l.length;u++)Gm(l[u],o[u]);He.supplyLayoutModuleDefaults(n,i,l,t._transitionData);var M=i._visibleModules,S=[];for(u=0;u<M.length;u++){var L=M[u].crossTraceDefaults;L&&qe.pushUnique(S,L)}for(u=0;u<S.length;u++)S[u](l,i);i._hasOnlyLargeSploms=i._basePlotModules.length===1&&i._basePlotModules[0].name==="splom"&&w.length>15&&T.length>15&&i.shapes.length===0&&i.images.length===0,He.linkSubplots(l,i,o,a),He.cleanPlot(l,i,o,a);var E=!!(a._has&&a._has("cartesian")),F=!!(i._has&&i._has("cartesian")),N=E,z=F;N&&!z?a._bgLayer.remove():z&&!N&&(i._shouldCreateBgLayer=!0),a._zoomlayer&&!t._dragging&&tC({_fullLayout:a}),uC(l,i),Gm(i,a),$t.getComponentMethod("colorscale","crossTraceDefaults")(l,i),i._preGUI||(i._preGUI={}),i._tracePreGUI||(i._tracePreGUI={});var H=i._tracePreGUI,D={},P;for(P in H)D[P]="old";for(u=0;u<l.length;u++)P=l[u]._fullInput.uid,D[P]||(H[P]={}),D[P]="new";for(P in D)D[P]==="old"&&delete H[P];iw(i),$t.getComponentMethod("rangeslider","makeData")(i),!r&&f.length===l.length&&He.supplyDefaultsUpdateCalc(f,l)};He.supplyDefaultsUpdateCalc=function(t,e){for(var r=0;r<e.length;r++){var a=e[r],i=(t[r]||[])[0];if(i&&i.trace){var n=i.trace;if(n._hasCalcTransform){var o=n._arrayAttrs,l,s,f;for(l=0;l<o.length;l++)s=o[l],f=qe.nestedProperty(n,s).get().slice(),qe.nestedProperty(a,s).set(f)}i.trace=a}}};function sC(t,e){var r=e.length,a=[],i,n;for(i=0;i<t.length;i++){var o=t[i]._fullInput;o!==n&&a.push(o),n=o}var l=a.length,s=new Array(r),f={};function c(p,d){s[d]=p,f[p]=1}function u(p,d){if(p&&typeof p=="string"&&!f[p])return c(p,d),!0}for(i=0;i<r;i++){var v=e[i].uid;typeof v=="number"&&(v=String(v)),!u(v,i)&&(i<l&&u(a[i].uid,i)||c(qe.randstr(f),i))}return s}function fC(){var t=$t.collectableSubplotTypes,e={},r,a;if(!t){t=[];var i=$t.subplotsRegistry;for(var n in i){var o=i[n],l=o.attr;if(l&&(t.push(n),Array.isArray(l)))for(a=0;a<l.length;a++)qe.pushUnique(t,l[a])}}for(r=0;r<t.length;r++)e[t[r]]=[];return e}function Um(t,e){var r=t._context.locale;r||(r="en-US");var a=!1,i={};function n(u){for(var v=!0,p=0;p<e.length;p++){var d=e[p];i[d]||(u[d]?i[d]=u[d]:v=!1)}v&&(a=!0)}for(var o=0;o<2;o++){for(var l=t._context.locales,s=0;s<2;s++){var f=(l[r]||{}).format;if(f&&(n(f),a))break;l=$t.localeRegistry}var c=r.split("-")[0];if(a||c===r)break;r=c}return a||n($t.localeRegistry.en.format),i}function cC(t,e){return t.decimal=e.charAt(0),t.thousands=e.charAt(1),{numberFormat:function(r){try{r=QL(t).format(qe.adjustFormat(r))}catch{return qe.warnBadFormat(r),qe.noFormat}return r},timeFormat:KL(t).utcFormat}}function uC(t,e){var r,a=[];e.meta&&(r=e._meta={meta:e.meta,layout:{meta:e.meta}});for(var i=0;i<t.length;i++){var n=t[i];n.meta?a[n.index]=n._meta={meta:n.meta}:e.meta&&(n._meta={meta:e.meta}),e.meta&&(n._meta.layout={meta:e.meta})}a.length&&(r||(r=e._meta={}),r.data=a)}He.createTransitionData=function(t){t._transitionData||(t._transitionData={}),t._transitionData._frames||(t._transitionData._frames=[]),t._transitionData._frameHash||(t._transitionData._frameHash={}),t._transitionData._counter||(t._transitionData._counter=0),t._transitionData._interruptCallbacks||(t._transitionData._interruptCallbacks=[])};He._hasPlotType=function(t){var e,r=this._basePlotModules||[];for(e=0;e<r.length;e++)if(r[e].name===t)return!0;var a=this._modules||[];for(e=0;e<a.length;e++){var i=a[e].name;if(i===t)return!0;var n=$t.modules[i];if(n&&n.categories[t])return!0}return!1};He.cleanPlot=function(t,e,r,a){var i,n,o=a._basePlotModules||[];for(i=0;i<o.length;i++){var l=o[i];l.clean&&l.clean(t,e,r,a)}var s=a._has&&a._has("gl"),f=e._has&&e._has("gl");s&&!f&&a._glcontainer!==void 0&&(a._glcontainer.selectAll(".gl-canvas").remove(),a._glcontainer.selectAll(".no-webgl").remove(),a._glcanvas=null);var c=!!a._infolayer;e:for(i=0;i<r.length;i++){var u=r[i],v=u.uid;for(n=0;n<t.length;n++){var p=t[n];if(v===p.uid)continue e}c&&a._infolayer.select(".cb"+v).remove()}};He.linkSubplots=function(t,e,r,a){var i,n,o=a._plots||{},l=e._plots={},s=e._subplots,f={_fullData:t,_fullLayout:e},c=s.cartesian||[];for(i=0;i<c.length;i++){var u=c[i],v=o[u],p=Kr.getFromId(f,u,"x"),d=Kr.getFromId(f,u,"y"),h;for(v?h=l[u]=v:(h=l[u]={},h.id=u),p._counterAxes.push(d._id),d._counterAxes.push(p._id),p._subplotsWith.push(u),d._subplotsWith.push(u),h.xaxis=p,h.yaxis=d,h._hasClipOnAxisFalse=!1,n=0;n<t.length;n++){var m=t[n];if(m.xaxis===h.xaxis._id&&m.yaxis===h.yaxis._id&&m.cliponaxis===!1){h._hasClipOnAxisFalse=!0;break}}}var y=Kr.list(f,null,!0),b;for(i=0;i<y.length;i++){b=y[i];var _=null;b.overlaying&&(_=Kr.getFromId(f,b.overlaying),_&&_.overlaying&&(b.overlaying=!1,_=null)),b._mainAxis=_||b,_&&(b.domain=_.domain.slice()),b._anchorAxis=b.anchor==="free"?null:Kr.getFromId(f,b.anchor)}for(i=0;i<y.length;i++)if(b=y[i],b._counterAxes.sort(Kr.idSort),b._subplotsWith.sort(qe.subplotSort),b._mainSubplot=vC(b,e),b._counterAxes.length&&(b.spikemode&&b.spikemode.indexOf("across")!==-1||b.automargin&&b.mirror&&b.anchor!=="free"||$t.getComponentMethod("rangeslider","isVisible")(b))){var g=1,x=0;for(n=0;n<b._counterAxes.length;n++){var w=Kr.getFromId(f,b._counterAxes[n]);g=Math.min(g,w.domain[0]),x=Math.max(x,w.domain[1])}g<x&&(b._counterDomainMin=g,b._counterDomainMax=x)}};function vC(t,e){var r={_fullLayout:e},a=t._id.charAt(0)==="x",i=t._mainAxis._anchorAxis,n="",o="",l="";if(i&&(l=i._mainAxis._id,n=a?t._id+l:l+t._id),!n||!e._plots[n]){n="";for(var s=t._counterAxes,f=0;f<s.length;f++){var c=s[f],u=a?t._id+c:c+t._id;o||(o=u);var v=Kr.getFromId(r,c);if(l&&v.overlaying===l){n=u;break}}}return n||o}He.clearExpandedTraceDefaultColors=function(t){var e,r,a;function i(o,l,s,f){r[f]=l,r.length=f+1,o.valType==="color"&&o.dflt===void 0&&e.push(r.join("."))}for(r=[],e=t._module._colorAttrs,e||(t._module._colorAttrs=e=[],rw.crawl(t._module.attributes,i)),a=0;a<e.length;a++){var n=qe.nestedProperty(t,"_input."+e[a]);n.get()||qe.nestedProperty(t,e[a]).set(null)}};He.supplyDataDefaults=function(t,e,r,a){var i=a._modules,n=a._visibleModules,o=a._basePlotModules,l=0,s,f,c;a._transformModules=[];function u(y){e.push(y);var b=y._module;b&&(qe.pushUnique(i,b),y.visible===!0&&qe.pushUnique(n,b),qe.pushUnique(o,y._module.basePlotModule),y._input.visible!==!1&&l++)}var v={},p=[],d=(r.template||{}).data||{},h=eC.traceTemplater(d);for(s=0;s<t.length;s++)c=t[s],f=h.newTrace(c),f.uid=a._traceUids[s],He.supplyTraceDefaults(c,f,l,a,s),f.index=s,f._input=c,f._fullInput=f,u(f),$t.traceIs(f,"carpetAxis")&&(v[f.carpet]=f),$t.traceIs(f,"carpetDependent")&&p.push(s);for(s=0;s<p.length;s++)if(f=e[p[s]],!!f.visible){var m=v[f.carpet];if(f._carpet=m,!m||!m.visible){f.visible=!1;continue}f.xaxis=m.xaxis,f.yaxis=m.yaxis}};He.supplyAnimationDefaults=function(t){t=t||{};var e,r={};function a(i,n){return qe.coerce(t||{},r,rp,i,n)}if(a("mode"),a("direction"),a("fromcurrent"),Array.isArray(t.frame))for(r.frame=[],e=0;e<t.frame.length;e++)r.frame[e]=He.supplyAnimationFrameDefaults(t.frame[e]||{});else r.frame=He.supplyAnimationFrameDefaults(t.frame||{});if(Array.isArray(t.transition))for(r.transition=[],e=0;e<t.transition.length;e++)r.transition[e]=He.supplyAnimationTransitionDefaults(t.transition[e]||{});else r.transition=He.supplyAnimationTransitionDefaults(t.transition||{});return r};He.supplyAnimationFrameDefaults=function(t){var e={};function r(a,i){return qe.coerce(t||{},e,rp.frame,a,i)}return r("duration"),r("redraw"),e};He.supplyAnimationTransitionDefaults=function(t){var e={};function r(a,i){return qe.coerce(t||{},e,rp.transition,a,i)}return r("duration"),r("easing"),e};He.supplyFrameDefaults=function(t){var e={};function r(a,i){return qe.coerce(t,e,aC,a,i)}return r("group"),r("name"),r("traces"),r("baseframe"),r("data"),r("layout"),e};He.supplyTraceDefaults=function(t,e,r,a,i){var n=a.colorway||aw.defaults,o=n[r%n.length],l;function s(_,g){return qe.coerce(t,e,He.attributes,_,g)}var f=s("visible");s("type"),s("name",a._traceWord+" "+i),s("uirevision",a.uirevision);var c=He.getModule(e);if(e._module=c,c){var u=c.basePlotModule,v=u.attr,p=u.attributes;if(v&&p){var d=a._subplots,h="";if(Array.isArray(v))for(l=0;l<v.length;l++){var m=v[l],y=qe.coerce(t,e,p,m);d[m]&&qe.pushUnique(d[m],y),h+=y}else h=qe.coerce(t,e,p,v);d[u.name]&&qe.pushUnique(d[u.name],h)}}if(f&&(s("customdata"),s("ids"),s("meta"),$t.traceIs(e,"showLegend")?(qe.coerce(t,e,c.attributes.showlegend?c.attributes:He.attributes,"showlegend"),s("legend"),s("legendwidth"),s("legendgroup"),s("legendgrouptitle.text"),s("legendrank"),e._dfltShowLegend=!0):e._dfltShowLegend=!1,c&&c.supplyDefaults(t,e,o,a),$t.traceIs(e,"noOpacity")||s("opacity"),$t.traceIs(e,"notLegendIsolatable")&&(e.visible=!!e.visible),$t.traceIs(e,"noHover")||(e.hovertemplate||qe.coerceHoverinfo(t,e,a),e.type!=="parcats"&&$t.getComponentMethod("fx","supplyDefaults")(t,e,o,a)),c&&c.selectPoints)){var b=s("selectedpoints");qe.isTypedArray(b)&&(e.selectedpoints=Array.from(b))}return e};He.supplyLayoutGlobalDefaults=function(t,e,r){function a(u,v){return qe.coerce(t,e,He.layoutAttributes,u,v)}var i=t.template;qe.isPlainObject(i)&&(e.template=i,e._template=i.layout,e._dataTemplate=i.data),a("autotypenumbers");var n=qe.coerceFont(a,"font"),o=n.size;qe.coerceFont(a,"title.font",n,{overrideDflt:{size:Math.round(o*1.4)}}),a("title.text",e._dfltTitle.plot),a("title.xref");var l=a("title.yref");a("title.pad.t"),a("title.pad.r"),a("title.pad.b"),a("title.pad.l");var s=a("title.automargin");a("title.x"),a("title.xanchor"),a("title.y"),a("title.yanchor"),a("title.subtitle.text",e._dfltTitle.subtitle),qe.coerceFont(a,"title.subtitle.font",n,{overrideDflt:{size:Math.round(e.title.font.size*.7)}}),s&&(l==="paper"&&(e.title.y!==0&&(e.title.y=1),e.title.yanchor==="auto"&&(e.title.yanchor=e.title.y===0?"top":"bottom")),l==="container"&&(e.title.y==="auto"&&(e.title.y=1),e.title.yanchor==="auto"&&(e.title.yanchor=e.title.y<.5?"bottom":"top")));var f=a("uniformtext.mode");f&&a("uniformtext.minsize"),a("autosize",!(t.width&&t.height)),a("width"),a("height"),a("minreducedwidth"),a("minreducedheight"),a("margin.l"),a("margin.r"),a("margin.t"),a("margin.b"),a("margin.pad"),a("margin.autoexpand"),t.width&&t.height&&He.sanitizeMargins(e),$t.getComponentMethod("grid","sizeDefaults")(t,e),a("paper_bgcolor"),a("separators",r.decimal+r.thousands),a("hidesources"),a("colorway"),a("datarevision");var c=a("uirevision");a("editrevision",c),a("selectionrevision",c),$t.getComponentMethod("modebar","supplyLayoutDefaults")(t,e),$t.getComponentMethod("shapes","supplyDrawNewShapeDefaults")(t,e,a),$t.getComponentMethod("selections","supplyDrawNewSelectionDefaults")(t,e,a),a("meta"),qe.isPlainObject(t.transition)&&(a("transition.duration"),a("transition.easing"),a("transition.ordering")),$t.getComponentMethod("calendars","handleDefaults")(t,e,"calendar"),$t.getComponentMethod("fx","supplyLayoutGlobalDefaults")(t,e,a),qe.coerce(t,e,rC,"scattermode")};function Rs(t){return typeof t=="string"&&t.substr(t.length-2)==="px"&&parseFloat(t)}He.plotAutoSize=function(e,r,a){var i=e._context||{},n=i.frameMargins,o,l,s=qe.isPlotDiv(e);if(s&&e.emit("plotly_autosize"),i.fillFrame)o=window.innerWidth,l=window.innerHeight,document.body.style.overflow="hidden";else{var f=s?window.getComputedStyle(e):{};if(o=Rs(f.width)||Rs(f.maxWidth)||a.width,l=Rs(f.height)||Rs(f.maxHeight)||a.height,El(n)&&n>0){var c=1-2*n;o=Math.round(c*o),l=Math.round(c*l)}}var u=He.layoutAttributes.width.min,v=He.layoutAttributes.height.min;o<u&&(o=u),l<v&&(l=v);var p=!r.width&&Math.abs(a.width-o)>1,d=!r.height&&Math.abs(a.height-l)>1;(d||p)&&(p&&(a.width=o),d&&(a.height=l)),e._initialAutoSize||(e._initialAutoSize={width:o,height:l}),He.sanitizeMargins(a)};He.supplyLayoutModuleDefaults=function(t,e,r,a){var i=$t.componentsRegistry,n=e._basePlotModules,o,l,s,f=$t.subplotsRegistry.cartesian;for(o in i)s=i[o],s.includeBasePlot&&s.includeBasePlot(t,e);n.length||n.push(f),e._has("cartesian")&&($t.getComponentMethod("grid","contentDefaults")(t,e),f.finalizeSubplots(t,e));for(var c in e._subplots)e._subplots[c].sort(qe.subplotSort);for(l=0;l<n.length;l++)s=n[l],s.supplyLayoutDefaults&&s.supplyLayoutDefaults(t,e,r);var u=e._modules;for(l=0;l<u.length;l++)s=u[l],s.supplyLayoutDefaults&&s.supplyLayoutDefaults(t,e,r);var v=e._transformModules;for(l=0;l<v.length;l++)s=v[l],s.supplyLayoutDefaults&&s.supplyLayoutDefaults(t,e,r,a);for(o in i)s=i[o],s.supplyLayoutDefaults&&s.supplyLayoutDefaults(t,e,r)};He.purge=function(t){var e=t._fullLayout||{};e._glcontainer!==void 0&&(e._glcontainer.selectAll(".gl-canvas").remove(),e._glcontainer.remove(),e._glcanvas=null),e._modeBar&&e._modeBar.destroy(),t._transitionData&&(t._transitionData._interruptCallbacks&&(t._transitionData._interruptCallbacks.length=0),t._transitionData._animationRaf&&window.cancelAnimationFrame(t._transitionData._animationRaf)),qe.clearThrottle(),qe.clearResponsive(t),delete t.data,delete t.layout,delete t._fullData,delete t._fullLayout,delete t.calcdata,delete t.empty,delete t.fid,delete t.undoqueue,delete t.undonum,delete t.autoplay,delete t.changed,delete t._promises,delete t._redrawTimer,delete t._hmlumcount,delete t._hmpixcount,delete t._transitionData,delete t._transitioning,delete t._initialAutoSize,delete t._transitioningWithDuration,delete t._dragging,delete t._dragged,delete t._dragdata,delete t._hoverdata,delete t._snapshotInProgress,delete t._editing,delete t._mouseDownTime,delete t._legendMouseDownTime,t.removeAllListeners&&t.removeAllListeners()};He.style=function(t){var e=t._fullLayout._visibleModules,r=[],a;for(a=0;a<e.length;a++){var i=e[a];i.style&&qe.pushUnique(r,i.style)}for(a=0;a<r.length;a++)r[a](t)};He.sanitizeMargins=function(t){if(!(!t||!t.margin)){var e=t.width,r=t.height,a=t.margin,i=e-(a.l+a.r),n=r-(a.t+a.b),o;i<0&&(o=(e-1)/(a.l+a.r),a.l=Math.floor(o*a.l),a.r=Math.floor(o*a.r)),n<0&&(o=(r-1)/(a.t+a.b),a.t=Math.floor(o*a.t),a.b=Math.floor(o*a.b))}};He.clearAutoMarginIds=function(t){t._fullLayout._pushmarginIds={}};He.allowAutoMargin=function(t,e){t._fullLayout._pushmarginIds[e]=1};function iw(t){var e=t.margin;if(!t._size){var r=t._size={l:Math.round(e.l),r:Math.round(e.r),t:Math.round(e.t),b:Math.round(e.b),p:Math.round(e.pad)};r.w=Math.round(t.width)-r.l-r.r,r.h=Math.round(t.height)-r.t-r.b}t._pushmargin||(t._pushmargin={}),t._pushmarginIds||(t._pushmarginIds={}),t._reservedMargin||(t._reservedMargin={})}var nw=2,ow=2;He.autoMargin=function(t,e,r){var a=t._fullLayout,i=a.width,n=a.height,o=a.margin,l=a.minreducedwidth,s=a.minreducedheight,f=qe.constrain(i-o.l-o.r,nw,l),c=qe.constrain(n-o.t-o.b,ow,s),u=Math.max(0,i-f),v=Math.max(0,n-c),p=a._pushmargin,d=a._pushmarginIds;if(o.autoexpand!==!1){if(!r)delete p[e],delete d[e];else{var h=r.pad;if(h===void 0&&(h=Math.min(12,o.l,o.r,o.t,o.b)),u){var m=(r.l+r.r)/u;m>1&&(r.l/=m,r.r/=m)}if(v){var y=(r.t+r.b)/v;y>1&&(r.t/=y,r.b/=y)}var b=r.xl!==void 0?r.xl:r.x,_=r.xr!==void 0?r.xr:r.x,g=r.yt!==void 0?r.yt:r.y,x=r.yb!==void 0?r.yb:r.y;p[e]={l:{val:b,size:r.l+h},r:{val:_,size:r.r+h},b:{val:x,size:r.b+h},t:{val:g,size:r.t+h}},d[e]=1}if(!a._replotting)return He.doAutoMargin(t)}};function dC(t){if("_redrawFromAutoMarginCount"in t._fullLayout)return!1;var e=Kr.list(t,"",!0);for(var r in e)if(e[r].autoshift||e[r].shift)return!0;return!1}He.doAutoMargin=function(t){var e=t._fullLayout,r=e.width,a=e.height;e._size||(e._size={}),iw(e);var i=e._size,n=e.margin,o={t:0,b:0,l:0,r:0},l=qe.extendFlat({},i),s=n.l,f=n.r,c=n.t,u=n.b,v=e._pushmargin,p=e._pushmarginIds,d=e.minreducedwidth,h=e.minreducedheight;if(n.autoexpand!==!1){for(var m in v)p[m]||delete v[m];var y=t._fullLayout._reservedMargin;for(var b in y)for(var _ in y[b]){var g=y[b][_];o[_]=Math.max(o[_],g)}v.base={l:{val:0,size:s},r:{val:1,size:f},t:{val:1,size:c},b:{val:0,size:u}};for(var x in o){var w=0;for(var T in v)T!=="base"&&El(v[T][x].size)&&(w=v[T][x].size>w?v[T][x].size:w);var A=Math.max(0,n[x]-w);o[x]=Math.max(0,o[x]-A)}for(var M in v){var S=v[M].l||{},L=v[M].b||{},E=S.val,F=S.size,N=L.val,z=L.size,H=r-o.r-o.l,D=a-o.t-o.b;for(var P in v){if(El(F)&&v[P].r){var k=v[P].r.val,C=v[P].r.size;if(k>E){var $=(F*k+(C-H)*E)/(k-E),R=(C*(1-E)+(F-H)*(1-k))/(k-E);$+R>s+f&&(s=$,f=R)}}if(El(z)&&v[P].t){var j=v[P].t.val,G=v[P].t.size;if(j>N){var Y=(z*j+(G-D)*N)/(j-N),O=(G*(1-N)+(z-D)*(1-j))/(j-N);Y+O>u+c&&(u=Y,c=O)}}}}}var K=qe.constrain(r-n.l-n.r,nw,d),W=qe.constrain(a-n.t-n.b,ow,h),X=Math.max(0,r-K),B=Math.max(0,a-W);if(X){var ee=(s+f)/X;ee>1&&(s/=ee,f/=ee)}if(B){var ae=(u+c)/B;ae>1&&(u/=ae,c/=ae)}if(i.l=Math.round(s)+o.l,i.r=Math.round(f)+o.r,i.t=Math.round(c)+o.t,i.b=Math.round(u)+o.b,i.p=Math.round(n.pad),i.w=Math.round(r)-i.l-i.r,i.h=Math.round(a)-i.t-i.b,!e._replotting&&(He.didMarginChange(l,i)||dC(t))){"_redrawFromAutoMarginCount"in e?e._redrawFromAutoMarginCount++:e._redrawFromAutoMarginCount=1;var de=3*(1+Object.keys(p).length);if(e._redrawFromAutoMarginCount<de)return $t.call("_doPlot",t);e._size=l,qe.warn("Too many auto-margin redraws.")}hC(t)};function hC(t){var e=Kr.list(t,"",!0);["_adjustTickLabelsOverflow","_hideCounterAxisInsideTickLabels"].forEach(function(r){for(var a=0;a<e.length;a++){var i=e[a][r];i&&i()}})}var Vm=["l","r","t","b","p","w","h"];He.didMarginChange=function(t,e){for(var r=0;r<Vm.length;r++){var a=Vm[r],i=t[a],n=e[a];if(!El(i)||Math.abs(n-i)>1)return!0}return!1};He.graphJson=function(t,e,r,a,i,n){(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&He.supplyDefaults(t);var o=i?t._fullData:t.data,l=i?t._fullLayout:t.layout,s=(t._transitionData||{})._frames;function f(v,p){if(typeof v=="function")return p?"_function_":null;if(qe.isPlainObject(v)){var d={},h;return Object.keys(v).sort().forEach(function(_){if(["_","["].indexOf(_.charAt(0))===-1){if(typeof v[_]=="function"){p&&(d[_]="_function");return}if(r==="keepdata"){if(_.substr(_.length-3)==="src")return}else if(r==="keepstream"){if(h=v[_+"src"],typeof h=="string"&&h.indexOf(":")>0&&!qe.isPlainObject(v.stream))return}else if(r!=="keepall"&&(h=v[_+"src"],typeof h=="string"&&h.indexOf(":")>0))return;d[_]=f(v[_],p)}}),d}var m=Array.isArray(v),y=qe.isTypedArray(v);if((m||y)&&v.dtype&&v.shape){var b=v.bdata;return f({dtype:v.dtype,shape:v.shape,bdata:qe.isArrayBuffer(b)?JL.encode(b):b},p)}return m?v.map(function(_){return f(_,p)}):y?qe.simpleMap(v,qe.identity):qe.isJSDate(v)?qe.ms2DateTimeLocal(+v):v}var c={data:(o||[]).map(function(v){var p=f(v);return e&&delete p.fit,p})};if(!e&&(c.layout=f(l),i)){var u=l._size;c.layout.computed={margin:{b:u.b,l:u.l,r:u.r,t:u.t}}}return s&&(c.frames=f(s)),n&&(c.config=f(t._context,!0)),a==="object"?c:JSON.stringify(c)};He.modifyFrames=function(t,e){var r,a,i,n=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r<e.length;r++)switch(a=e[r],a.type){case"replace":i=a.value;var l=(n[a.index]||{}).name,s=i.name;n[a.index]=o[s]=i,s!==l&&(delete o[l],o[s]=i);break;case"insert":i=a.value,o[i.name]=i,n.splice(a.index,0,i);break;case"delete":i=n[a.index],delete o[i.name],n.splice(a.index,1);break}return Promise.resolve()};He.computeFrame=function(t,e){var r=t._transitionData._frameHash,a,i,n,o;if(!e)throw new Error("computeFrame must be given a string frame name");var l=r[e.toString()];if(!l)return!1;for(var s=[l],f=[l.name];l.baseframe&&(l=r[l.baseframe.toString()])&&f.indexOf(l.name)===-1;)s.push(l),f.push(l.name);for(var c={};l=s.pop();)if(l.layout&&(c.layout=He.extendLayout(c.layout,l.layout)),l.data){if(c.data||(c.data=[]),i=l.traces,!i)for(i=[],a=0;a<l.data.length;a++)i[a]=a;for(c.traces||(c.traces=[]),a=0;a<l.data.length;a++)n=i[a],n!=null&&(o=c.traces.indexOf(n),o===-1&&(o=c.data.length,c.traces[o]=n),c.data[o]=He.extendTrace(c.data[o],l.data[a]))}return c};He.recomputeFrameHash=function(t){for(var e=t._transitionData._frameHash={},r=t._transitionData._frames,a=0;a<r.length;a++){var i=r[a];i&&i.name&&(e[i.name]=i)}};He.extendObjectWithContainers=function(t,e,r){var a,i,n,o,l,s,f,c,u=qe.extendDeepNoArrays({},e||{}),v=qe.expandObjectPaths(u),p={};if(r&&r.length)for(n=0;n<r.length;n++)a=qe.nestedProperty(v,r[n]),i=a.get(),i===void 0?qe.nestedProperty(p,r[n]).set(null):(a.set(null),qe.nestedProperty(p,r[n]).set(i));if(t=qe.extendDeepNoArrays(t||{},v),r&&r.length){for(n=0;n<r.length;n++)if(l=qe.nestedProperty(p,r[n]),f=l.get(),!!f){for(s=qe.nestedProperty(t,r[n]),c=s.get(),Array.isArray(c)||(c=[],s.set(c)),o=0;o<f.length;o++){var d=f[o];d===null?c[o]=null:c[o]=He.extendObjectWithContainers(c[o],d)}s.set(c)}}return t};He.dataArrayContainers=["transforms","dimensions"];He.layoutArrayContainers=$t.layoutArrayContainers;He.extendTrace=function(t,e){return He.extendObjectWithContainers(t,e,He.dataArrayContainers)};He.extendLayout=function(t,e){return He.extendObjectWithContainers(t,e,He.layoutArrayContainers)};He.transition=function(t,e,r,a,i,n){var o={redraw:i.redraw},l={},s=[];return o.prepareFn=function(){for(var f=Array.isArray(e)?e.length:0,c=a.slice(0,f),u=0;u<c.length;u++){var v=c[u],p=t._fullData[v],d=p._module;if(d){if(d.animatable){var h=d.basePlotModule.name;l[h]||(l[h]=[]),l[h].push(v)}t.data[c[u]]=He.extendTrace(t.data[c[u]],e[u])}}var m=qe.expandObjectPaths(qe.extendDeepNoArrays({},r)),y=/^[xy]axis[0-9]*$/;for(var b in m)y.test(b)&&delete m[b].range;He.extendLayout(t.layout,m),delete t.calcdata,He.supplyDefaults(t),He.doCalcdata(t);var _=qe.expandObjectPaths(r);if(_){var g=t._fullLayout._plots;for(var x in g){var w=g[x],T=w.xaxis,A=w.yaxis,M=T.range.slice(),S=A.range.slice(),L=null,E=null,F=null,N=null;Array.isArray(_[T._name+".range"])?L=_[T._name+".range"].slice():Array.isArray((_[T._name]||{}).range)&&(L=_[T._name].range.slice()),Array.isArray(_[A._name+".range"])?E=_[A._name+".range"].slice():Array.isArray((_[A._name]||{}).range)&&(E=_[A._name].range.slice()),M&&L&&(T.r2l(M[0])!==T.r2l(L[0])||T.r2l(M[1])!==T.r2l(L[1]))&&(F={xr0:M,xr1:L}),S&&E&&(A.r2l(S[0])!==A.r2l(E[0])||A.r2l(S[1])!==A.r2l(E[1]))&&(N={yr0:S,yr1:E}),(F||N)&&s.push(qe.extendFlat({plotinfo:w},F,N))}}return Promise.resolve()},o.runFn=function(f){var c,u=t._fullLayout._basePlotModules,v=s.length,p;if(r)for(p=0;p<u.length;p++)u[p].transitionAxes&&u[p].transitionAxes(t,s,n,f);v?(c=qe.extendFlat({},n),c.duration=0,delete l.cartesian):c=n;for(var d in l){var h=l[d],m=t._fullData[h[0]]._module;m.basePlotModule.plot(t,h,c,f)}},lw(t,n,o)};He.transitionFromReact=function(t,e,r,a){var i=t._fullLayout,n=i.transition,o={},l=[];return o.prepareFn=function(){var s=i._plots;o.redraw=!1,e.anim==="some"&&(o.redraw=!0),r.anim==="some"&&(o.redraw=!0);for(var f in s){var c=s[f],u=c.xaxis,v=c.yaxis,p=a[u._name].range.slice(),d=a[v._name].range.slice(),h=u.range.slice(),m=v.range.slice();u.setScale(),v.setScale();var y=null,b=null;(u.r2l(p[0])!==u.r2l(h[0])||u.r2l(p[1])!==u.r2l(h[1]))&&(y={xr0:p,xr1:h}),(v.r2l(d[0])!==v.r2l(m[0])||v.r2l(d[1])!==v.r2l(m[1]))&&(b={yr0:d,yr1:m}),(y||b)&&l.push(qe.extendFlat({plotinfo:c},y,b))}return Promise.resolve()},o.runFn=function(s){for(var f=t._fullData,c=t._fullLayout,u=c._basePlotModules,v,p,d,h=[],m=0;m<f.length;m++)h.push(m);function y(){if(t._fullLayout)for(var _=0;_<u.length;_++)u[_].transitionAxes&&u[_].transitionAxes(t,l,v,s)}function b(){if(t._fullLayout)for(var _=0;_<u.length;_++)u[_].plot(t,d,p,s)}l.length&&e.anim?n.ordering==="traces first"?(v=qe.extendFlat({},n,{duration:0}),d=h,p=n,setTimeout(y,n.duration),b()):(v=n,d=null,p=qe.extendFlat({},n,{duration:0}),setTimeout(b,v.duration),y()):l.length?(v=n,y()):e.anim&&(d=h,p=n,b())},lw(t,n,o)};function lw(t,e,r){var a=!1;function i(u){var v=Promise.resolve();if(!u)return v;for(;u.length;)v=v.then(u.shift());return v}function n(u){if(u)for(;u.length;)u.shift()}function o(){return t.emit("plotly_transitioning",[]),new Promise(function(u){t._transitioning=!0,e.duration>0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push(function(){a=!0}),r.redraw&&t._transitionData._interruptCallbacks.push(function(){return $t.call("redraw",t)}),t._transitionData._interruptCallbacks.push(function(){t.emit("plotly_transitioninterrupted",[])});var v=0,p=0;function d(){return v++,function(){p++,!a&&p===v&&l(u)}}r.runFn(d),setTimeout(d())})}function l(u){if(t._transitionData)return n(t._transitionData._interruptCallbacks),Promise.resolve().then(function(){if(r.redraw)return $t.call("redraw",t)}).then(function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])}).then(u)}function s(){if(t._transitionData)return t._transitioning=!1,i(t._transitionData._interruptCallbacks)}var f=[He.previousPromises,s,r.prepareFn,He.rehover,He.reselect,o],c=qe.syncOrAsync(f,t);return(!c||!c.then)&&(c=Promise.resolve()),c.then(function(){return t})}He.doCalcdata=function(t,e){var r=Kr.list(t),a=t._fullData,i=t._fullLayout,n,o,l,s,f=new Array(a.length),c=(t.calcdata||[]).slice();for(t.calcdata=f,i._numBoxes=0,i._numViolins=0,i._violinScaleGroupStats={},t._hmpixcount=0,t._hmlumcount=0,i._piecolormap={},i._sunburstcolormap={},i._treemapcolormap={},i._iciclecolormap={},i._funnelareacolormap={},l=0;l<a.length;l++)if(Array.isArray(e)&&e.indexOf(l)===-1){f[l]=c[l];continue}for(l=0;l<a.length;l++)n=a[l],n._arrayAttrs=rw.findArrayAttributes(n),n._extremes={};var u=i._subplots.polar||[];for(l=0;l<u.length;l++)r.push(i[u[l]].radialaxis,i[u[l]].angularaxis);for(var v in i._colorAxes){var p=i[v];p.cauto!==!1&&(delete p.cmin,delete p.cmax)}var d=!1;function h(b){if(n=a[b],o=n._module,n.visible===!0&&n.transforms){if(o&&o.calc){var _=o.calc(t,n);_[0]&&_[0].t&&_[0].t._scene&&delete _[0].t._scene.dirty}for(s=0;s<n.transforms.length;s++){var g=n.transforms[s];o=transformsRegistry[g.type],o&&o.calcTransform&&(n._hasCalcTransform=!0,d=!0,o.calcTransform(t,n,g))}}}function m(b,_){if(n=a[b],o=n._module,!!o.isContainer===_){var g=[];if(n.visible===!0&&n._length!==0){delete n._indexToPoints;var x=n.transforms||[];for(s=x.length-1;s>=0;s--)if(x[s].enabled){n._indexToPoints=x[s]._indexToPoints;break}o&&o.calc&&(g=o.calc(t,n))}(!Array.isArray(g)||!g[0])&&(g=[{x:Bm,y:Bm}]),g[0].t||(g[0].t={}),g[0].trace=n,f[b]=g}}for(Wm(r,a,i),l=0;l<a.length;l++)m(l,!0);for(l=0;l<a.length;l++)h(l);for(d&&Wm(r,a,i),l=0;l<a.length;l++)m(l,!0);for(l=0;l<a.length;l++)m(l,!1);Xm(t);var y=mC(r,t);if(y.length){for(i._numBoxes=0,i._numViolins=0,l=0;l<y.length;l++)m(y[l],!0);for(l=0;l<y.length;l++)m(y[l],!1);Xm(t)}$t.getComponentMethod("fx","calc")(t),$t.getComponentMethod("errorbars","calc")(t)};var pC=/(total|sum|min|max|mean|geometric mean|median) (ascending|descending)/;function mC(t,e){var r=[],a,i,n,o,l;function s(P,k,C){var $=k._id.charAt(0);if(P==="histogram2dcontour"){var R=k._counterAxes[0],j=Kr.getFromId(e,R),G=$==="x"||R==="x"&&j.type==="category",Y=$==="y"||R==="y"&&j.type==="category";return function(O,K){return O===0||K===0||G&&O===C[K].length-1||Y&&K===C.length-1?-1:($==="y"?K:O)-1}}else return function(O,K){return $==="y"?K:O}}var f={min:function(P){return qe.aggNums(Math.min,null,P)},max:function(P){return qe.aggNums(Math.max,null,P)},sum:function(P){return qe.aggNums(function(k,C){return k+C},null,P)},total:function(P){return qe.aggNums(function(k,C){return k+C},null,P)},mean:function(P){return qe.mean(P)},"geometric mean":function(P){return qe.geometricMean(P)},median:function(P){return qe.median(P)}};function c(P,k){return P[1]-k[1]}function u(P,k){return k[1]-P[1]}for(a=0;a<t.length;a++){var v=t[a];if(v.type==="category"){var p=v.categoryorder.match(pC);if(p){var d=p[1],h=p[2],m=v._id.charAt(0),y=m==="x",b=[];for(i=0;i<v._categories.length;i++)b.push([v._categories[i],[]]);for(i=0;i<v._traceIndices.length;i++){var _=v._traceIndices[i],g=e._fullData[_];if(g.visible===!0){var x=g.type;$t.traceIs(g,"histogram")&&(delete g._xautoBinFinished,delete g._yautoBinFinished);var w=x==="splom",T=x==="scattergl",A=e.calcdata[_];for(n=0;n<A.length;n++){var M=A[n],S,L;if(w){var E=g._axesDim[v._id];if(!y){var F=g._diag[E][0];F&&(v=e._fullLayout[Kr.id2name(F)])}var N=M.trace.dimensions[E].values;for(o=0;o<N.length;o++)for(S=v._categoriesMap[N[o]],l=0;l<M.trace.dimensions.length;l++)if(l!==E){var z=M.trace.dimensions[l];b[S][1].push(z.values[o])}}else if(T){for(o=0;o<M.t.x.length;o++)y?(S=M.t.x[o],L=M.t.y[o]):(S=M.t.y[o],L=M.t.x[o]),b[S][1].push(L);M.t&&M.t._scene&&delete M.t._scene.dirty}else if(M.hasOwnProperty("z")){L=M.z;var H=s(g.type,v,L);for(o=0;o<L.length;o++)for(l=0;l<L[o].length;l++)S=H(l,o),S+1&&b[S][1].push(L[o][l])}else for(S=M.p,S===void 0&&(S=M[m]),L=M.s,L===void 0&&(L=M.v),L===void 0&&(L=y?M.y:M.x),Array.isArray(L)||(L===void 0?L=[]:L=[L]),o=0;o<L.length;o++)b[S][1].push(L[o])}}}v._categoriesValue=b;var D=[];for(i=0;i<b.length;i++)D.push([b[i][0],f[d](b[i][1])]);D.sort(h==="descending"?u:c),v._categoriesAggregatedValue=D,v._initialCategories=D.map(function(P){return P[0]}),r=r.concat(v.sortByInitialCategories())}}}return r}function Wm(t,e,r){var a={};function i(s){s.clearCalc(),s.type==="multicategory"&&s.setupMultiCategory(e),a[s._id]=1}qe.simpleMap(t,i);for(var n=r._axisMatchGroups||[],o=0;o<n.length;o++)for(var l in n[o])a[l]||i(r[Kr.id2name(l)])}function Xm(t){var e=t._fullLayout,r=e._visibleModules,a={},i,n,o;for(n=0;n<r.length;n++){var l=r[n],s=l.crossTraceCalc;if(s){var f=l.basePlotModule.name;a[f]?qe.pushUnique(a[f],s):a[f]=[s]}}for(o in a){var c=a[o],u=e._subplots[o];if(Array.isArray(u))for(i=0;i<u.length;i++){var v=u[i],p=o==="cartesian"?e._plots[v]:e[v];for(n=0;n<c.length;n++)c[n](t,p,v)}else for(n=0;n<c.length;n++)c[n](t)}}He.rehover=function(t){t._fullLayout._rehover&&t._fullLayout._rehover()};He.redrag=function(t){t._fullLayout._redrag&&t._fullLayout._redrag()};He.reselect=function(t){var e=t._fullLayout,r=(t.layout||{}).selections,a=e._previousSelections;e._previousSelections=r;var i=e._reselect||JSON.stringify(r)!==JSON.stringify(a);$t.getComponentMethod("selections","reselect")(t,i)};He.generalUpdatePerTraceModule=function(t,e,r,a){var i=e.traceHash,n={},o;for(o=0;o<r.length;o++){var l=r[o],s=l[0].trace;s.visible&&(n[s.type]=n[s.type]||[],n[s.type].push(l))}for(var f in i)if(!n[f]){var c=i[f][0],u=c[0].trace;u.visible=!1,n[f]=[c]}for(var v in n){var p=n[v],d=p[0][0].trace._module;d.plot(t,e,qe.filterVisible(p),a)}e.traceHash=n};He.plotBasePlot=function(t,e,r,a,i){var n=$t.getModule(t),o=iC(e.calcdata,n)[0];n.plot(e,o,a,i)};He.cleanBasePlot=function(t,e,r,a,i){var n=i._has&&i._has(t),o=r._has&&r._has(t);n&&!o&&i["_"+t+"layer"].selectAll("g.trace").remove()};var hr=J_.exports,sw={exports:{}},Tr={},Yo={};(function(t){t.xmlns="http://www.w3.org/2000/xmlns/",t.svg="http://www.w3.org/2000/svg",t.xlink="http://www.w3.org/1999/xlink",t.svgAttrs={xmlns:t.svg,"xmlns:xlink":t.xlink}})(Yo);var Vr={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}};(function(t){var e=bt,r=we,a=r.strTranslate,i=Yo,n=Vr.LINE_SPACING,o=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;t.convertToTspans=function(k,C,$){var R=k.text(),j=!k.attr("data-notex")&&C&&C._context.typesetMath&&typeof MathJax<"u"&&R.match(o),G=e.select(k.node().parentNode);if(G.empty())return;var Y=k.attr("class")?k.attr("class").split(" ")[0]:"text";Y+="-math",G.selectAll("svg."+Y).remove(),G.selectAll("g."+Y+"-group").remove(),k.style("display",null).attr({"data-unformatted":R,"data-math":"N"});function O(){G.empty()||(Y=k.attr("class")+"-math",G.select("svg."+Y).remove()),k.text("").style("white-space","pre");var K=z(k.node(),R);K&&k.style("pointer-events","all"),t.positionText(k),$&&$.call(k)}return j?(C&&C._promises||[]).push(new Promise(function(K){k.style("display","none");var W=parseInt(k.node().style.fontSize,10),X={fontSize:W};u(j[2],X,function(B,ee,ae){G.selectAll("svg."+Y).remove(),G.selectAll("g."+Y+"-group").remove();var de=B&&B.select("svg");if(!de||!de.node()){O(),K();return}var fe=G.append("g").classed(Y+"-group",!0).attr({"pointer-events":"none","data-unformatted":R,"data-math":"Y"});fe.node().appendChild(de.node()),ee&&ee.node()&&de.node().insertBefore(ee.node().cloneNode(!0),de.node().firstChild);var q=ae.width,te=ae.height;de.attr({class:Y,height:te,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var le=k.node().style.fill||"black",ce=de.select("g");ce.attr({fill:le,stroke:le});var ye=ce.node().getBoundingClientRect(),ue=ye.width,oe=ye.height;(ue>q||oe>te)&&(de.style("overflow","hidden"),ye=de.node().getBoundingClientRect(),ue=ye.width,oe=ye.height);var pe=+k.attr("x"),Me=+k.attr("y"),ve=W||k.node().getBoundingClientRect().height,ke=-ve/4;if(Y[0]==="y")fe.attr({transform:"rotate("+[-90,pe,Me]+")"+a(-ue/2,ke-oe/2)});else if(Y[0]==="l")Me=ke-oe/2;else if(Y[0]==="a"&&Y.indexOf("atitle")!==0)pe=0,Me=ke;else{var _e=k.attr("text-anchor");pe=pe-ue*(_e==="middle"?.5:_e==="end"?1:0),Me=Me+ke-oe/2}de.attr({x:pe,y:Me}),$&&$.call(k,fe),K(fe)})})):O(),k};var l=/(<|&lt;|&#60;)/g,s=/(>|&gt;|&#62;)/g;function f(k){return k.replace(l,"\\lt ").replace(s,"\\gt ")}var c=[["$","$"],["\\(","\\)"]];function u(k,C,$){var R=parseInt((MathJax.version||"").split(".")[0]);if(R!==2&&R!==3){r.warn("No MathJax version:",MathJax.version);return}var j,G,Y,O,K=function(){return G=r.extendDeepAll({},MathJax.Hub.config),Y=MathJax.Hub.processSectionDelay,MathJax.Hub.processSectionDelay!==void 0&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:c},displayAlign:"left"})},W=function(){G=r.extendDeepAll({},MathJax.config),MathJax.config.tex||(MathJax.config.tex={}),MathJax.config.tex.inlineMath=c},X=function(){if(j=MathJax.Hub.config.menuSettings.renderer,j!=="SVG")return MathJax.Hub.setRenderer("SVG")},B=function(){j=MathJax.config.startup.output,j!=="svg"&&(MathJax.config.startup.output="svg")},ee=function(){var le="math-output-"+r.randstr({},64);O=e.select("body").append("div").attr({id:le}).style({visibility:"hidden",position:"absolute","font-size":C.fontSize+"px"}).text(f(k));var ce=O.node();return R===2?MathJax.Hub.Typeset(ce):MathJax.typeset([ce])},ae=function(){var le=O.select(R===2?".MathJax_SVG":".MathJax"),ce=!le.empty()&&O.select("svg").node();if(!ce)r.log("There was an error in the tex syntax.",k),$();else{var ye=ce.getBoundingClientRect(),ue;R===2?ue=e.select("body").select("#MathJax_SVG_glyphs"):ue=le.select("defs"),$(le,ue,ye)}O.remove()},de=function(){if(j!=="SVG")return MathJax.Hub.setRenderer(j)},fe=function(){j!=="svg"&&(MathJax.config.startup.output=j)},q=function(){return Y!==void 0&&(MathJax.Hub.processSectionDelay=Y),MathJax.Hub.Config(G)},te=function(){MathJax.config=G};R===2?MathJax.Hub.Queue(K,X,ee,ae,de,q):R===3&&(W(),B(),MathJax.startup.defaultReady(),MathJax.startup.promise.then(function(){ee(),ae(),fe(),te()}))}var v={sup:"font-size:70%",sub:"font-size:70%",s:"text-decoration:line-through",u:"text-decoration:underline",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},p={sub:"0.3em",sup:"-0.6em"},d={sub:"-0.21em",sup:"0.42em"},h="​",m=["http:","https:","mailto:","",void 0,":"],y=t.NEWLINES=/(\r\n?|\n)/g,b=/(<[^<>]*>)/,_=/<(\/?)([^ >]*)(\s+(.*))?>/i,g=/<br(\s+.*)?>/i;t.BR_TAG_ALL=/<br(\s+.*)?>/gi;var x=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,w=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,T=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,A=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function M(k,C){if(!k)return null;var $=k.match(C),R=$&&($[3]||$[4]);return R&&F(R)}var S=/(^|;)\s*color:/;t.plainText=function(k,C){C=C||{};for(var $=C.len!==void 0&&C.len!==-1?C.len:1/0,R=C.allowedTags!==void 0?C.allowedTags:["br"],j="...",G=j.length,Y=k.split(b),O=[],K="",W=0,X=0;X<Y.length;X++){var B=Y[X],ee=B.match(_),ae=ee&&ee[2].toLowerCase();if(ae)R.indexOf(ae)!==-1&&(O.push(B),K=ae);else{var de=B.length;if(W+de<$)O.push(B),W+=de;else if(W<$){var fe=$-W;K&&(K!=="br"||fe<=G||de<=G)&&O.pop(),$>G?O.push(B.substr(0,fe-G)+j):O.push(B.substr(0,fe));break}K=""}}return O.join("")};var L={mu:"μ",amp:"&",lt:"<",gt:">",nbsp:" ",times:"×",plusmn:"±",deg:"°"},E=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function F(k){return k.replace(E,function(C,$){var R;return $.charAt(0)==="#"?R=N($.charAt(1)==="x"?parseInt($.substr(2),16):parseInt($.substr(1),10)):R=L[$],R||C})}t.convertEntities=F;function N(k){if(!(k>1114111)){var C=String.fromCodePoint;if(C)return C(k);var $=String.fromCharCode;return k<=65535?$(k):$((k>>10)+55232,k%1024+56320)}}function z(k,C){C=C.replace(y," ");var $=!1,R=[],j,G=-1;function Y(){G++;var oe=document.createElementNS(i.svg,"tspan");e.select(oe).attr({class:"line",dy:G*n+"em"}),k.appendChild(oe),j=oe;var pe=R;if(R=[{node:oe}],pe.length>1)for(var Me=1;Me<pe.length;Me++)O(pe[Me])}function O(oe){var pe=oe.type,Me={},ve;if(pe==="a"){ve="a";var ke=oe.target,_e=oe.href,J=oe.popup;_e&&(Me={"xlink:xlink:show":ke==="_blank"||ke.charAt(0)!=="_"?"new":"replace",target:ke,"xlink:xlink:href":_e},J&&(Me.onclick='window.open(this.href.baseVal,this.target.baseVal,"'+J+'");return false;'))}else ve="tspan";oe.style&&(Me.style=oe.style);var be=document.createElementNS(i.svg,ve);if(pe==="sup"||pe==="sub"){K(j,h),j.appendChild(be);var Z=document.createElementNS(i.svg,"tspan");K(Z,h),e.select(Z).attr("dy",d[pe]),Me.dy=p[pe],j.appendChild(be),j.appendChild(Z)}else j.appendChild(be);e.select(be).attr(Me),j=oe.node=be,R.push(oe)}function K(oe,pe){oe.appendChild(document.createTextNode(pe))}function W(oe){if(R.length===1){r.log("Ignoring unexpected end tag </"+oe+">.",C);return}var pe=R.pop();oe!==pe.type&&r.log("Start tag <"+pe.type+"> doesnt match end tag <"+oe+">. Pretending it did match.",C),j=R[R.length-1].node}var X=g.test(C);X?Y():(j=k,R=[{node:k}]);for(var B=C.split(b),ee=0;ee<B.length;ee++){var ae=B[ee],de=ae.match(_),fe=de&&de[2].toLowerCase(),q=v[fe];if(fe==="br")Y();else if(q===void 0)K(j,F(ae));else if(de[1])W(fe);else{var te=de[4],le={type:fe},ce=M(te,x);if(ce?(ce=ce.replace(S,"$1 fill:"),q&&(ce+=";"+q)):q&&(ce=q),ce&&(le.style=ce),fe==="a"){$=!0;var ye=M(te,w);if(ye){var ue=H(ye);ue&&(le.href=ue,le.target=M(te,T)||"_blank",le.popup=M(te,A))}}O(le)}}return $}function H(k){var C=encodeURI(decodeURI(k)),$=document.createElement("a"),R=document.createElement("a");$.href=k,R.href=C;var j=$.protocol,G=R.protocol;return m.indexOf(j)!==-1&&m.indexOf(G)!==-1?C:""}t.sanitizeHTML=function(C){C=C.replace(y," ");for(var $=document.createElement("p"),R=$,j=[],G=C.split(b),Y=0;Y<G.length;Y++){var O=G[Y],K=O.match(_),W=K&&K[2].toLowerCase();if(W in v)if(K[1])j.length&&(R=j.pop());else{var X=K[4],B=M(X,x),ee=B?{style:B}:{};if(W==="a"){var ae=M(X,w);if(ae){var de=H(ae);if(de){ee.href=de;var fe=M(X,T);fe&&(ee.target=fe)}}}var q=document.createElement(W);R.appendChild(q),e.select(q).attr(ee),R=q,j.push(q)}else R.appendChild(document.createTextNode(F(O)))}var te="innerHTML";return $[te]},t.lineCount=function(C){return C.selectAll("tspan.line").size()||1},t.positionText=function(C,$,R){return C.each(function(){var j=e.select(this);function G(K,W){return W===void 0?(W=j.attr(K),W===null&&(j.attr(K,0),W=0)):j.attr(K,W),W}var Y=G("x",$),O=G("y",R);this.nodeName==="text"&&j.selectAll("tspan.line").attr({x:Y,y:O})})};function D(k,C,$){var R=$.horizontalAlign,j=$.verticalAlign||"top",G=k.node().getBoundingClientRect(),Y=C.node().getBoundingClientRect(),O,K,W;return j==="bottom"?K=function(){return G.bottom-O.height}:j==="middle"?K=function(){return G.top+(G.height-O.height)/2}:K=function(){return G.top},R==="right"?W=function(){return G.right-O.width}:R==="center"?W=function(){return G.left+(G.width-O.width)/2}:W=function(){return G.left},function(){O=this.node().getBoundingClientRect();var X=W()-Y.left,B=K()-Y.top,ee=$.gd||{};if($.gd){ee._fullLayout._calcInverseTransform(ee);var ae=r.apply3DTransform(ee._fullLayout._invTransform)(X,B);X=ae[0],B=ae[1]}return this.style({top:B+"px",left:X+"px","z-index":1e3}),this}}var P="1px ";t.makeTextShadow=function(k){var C=P,$=P,R=P;return C+$+R+k+", -"+C+"-"+$+R+k+", "+C+"-"+$+R+k+", -"+C+$+R+k},t.makeEditable=function(k,C){var $=C.gd,R=C.delegate,j=e.dispatch("edit","input","cancel"),G=R||k;if(k.style({"pointer-events":R?"none":"all"}),k.size()!==1)throw new Error("boo");function Y(){K(),k.style({opacity:0});var W=G.attr("class"),X;W?X="."+W.split(" ")[0]+"-math-group":X="[class*=-math-group]",X&&e.select(k.node().parentNode).select(X).style({opacity:0})}function O(W){var X=W.node(),B=document.createRange();B.selectNodeContents(X);var ee=window.getSelection();ee.removeAllRanges(),ee.addRange(B),X.focus()}function K(){var W=e.select($),X=W.select(".svg-container"),B=X.append("div"),ee=k.node().style,ae=parseFloat(ee.fontSize||12),de=C.text;de===void 0&&(de=k.attr("data-unformatted")),B.classed("plugin-editable editable",!0).style({position:"absolute","font-family":ee.fontFamily||"Arial","font-size":ae,color:C.fill||ee.fill||"black",opacity:1,"background-color":C.background||"transparent",outline:"#ffffff33 1px solid",margin:[-ae/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(de).call(D(k,X,C)).on("blur",function(){$._editing=!1,k.text(this.textContent).style({opacity:1});var fe=e.select(this).attr("class"),q;fe?q="."+fe.split(" ")[0]+"-math-group":q="[class*=-math-group]",q&&e.select(k.node().parentNode).select(q).style({opacity:0});var te=this.textContent;e.select(this).transition().duration(0).remove(),e.select(document).on("mouseup",null),j.edit.call(k,te)}).on("focus",function(){var fe=this;$._editing=!0,e.select(document).on("mouseup",function(){if(e.event.target===fe)return!1;document.activeElement===B.node()&&B.node().blur()})}).on("keyup",function(){e.event.which===27?($._editing=!1,k.style({opacity:1}),e.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),j.cancel.call(k,this.textContent)):(j.input.call(k,this.textContent),e.select(this).call(D(k,X,C)))}).on("keydown",function(){e.event.which===13&&this.blur()}).call(O)}return C.immediate?Y():G.on("click",Y),e.rebind(k,j,"on")}})(Tr);var fw={exports:{}},yC=bt,Ef=_a,zl=kt,Is=we,Ym=yt,gC=jo.isValid;function bC(t,e,r){var a=e?Is.nestedProperty(t,e).get()||{}:t,i=a[r||"color"];i&&i._inputArray&&(i=i._inputArray);var n=!1;if(Is.isArrayOrTypedArray(i)){for(var o=0;o<i.length;o++)if(zl(i[o])){n=!0;break}}return Is.isPlainObject(a)&&(n||a.showscale===!0||zl(a.cmin)&&zl(a.cmax)||gC(a.colorscale)||Is.isPlainObject(a.colorbar))}var qm=["showscale","autocolorscale","colorscale","reversescale","colorbar"],il=["min","max","mid","auto"];function cw(t){var e=t._colorAx,r=e||t,a={},i,n,o;for(n=0;n<qm.length;n++)o=qm[n],a[o]=r[o];if(e)for(i="c",n=0;n<il.length;n++)o=il[n],a[o]=r["c"+o];else{var l;for(n=0;n<il.length;n++){if(o=il[n],l="c"+o,l in r){a[o]=r[l];continue}l="z"+o,l in r&&(a[o]=r[l])}i=l.charAt(0)}return a._sync=function(s,f){var c=il.indexOf(s)!==-1?i+s:s;r[c]=r["_"+c]=f},a}function uw(t){for(var e=cw(t),r=e.min,a=e.max,i=e.reversescale?vw(e.colorscale):e.colorscale,n=i.length,o=new Array(n),l=new Array(n),s=0;s<n;s++){var f=i[s];o[s]=r+f[0]*(a-r),l[s]=f[1]}return{domain:o,range:l}}function vw(t){for(var e=t.length,r=new Array(e),a=e-1,i=0;a>=0;a--,i++){var n=t[a];r[i]=[1-n[0],n[1]]}return r}function dw(t,e){e=e||{};for(var r=t.domain,a=t.range,i=a.length,n=new Array(i),o=0;o<i;o++){var l=Ef(a[o]).toRgb();n[o]=[l.r,l.g,l.b,l.a]}var s=yC.scale.linear().domain(r).range(n).clamp(!0),f=e.noNumericCheck,c=e.returnArray,u;return f&&c?u=s:f?u=function(v){return Zm(s(v))}:c?u=function(v){return zl(v)?s(v):Ef(v).isValid()?v:Ym.defaultLine}:u=function(v){return zl(v)?Zm(s(v)):Ef(v).isValid()?v:Ym.defaultLine},u.domain=s.domain,u.range=function(){return a},u}function xC(t,e){return dw(uw(t),e)}function Zm(t){var e={r:t[0],g:t[1],b:t[2],a:t[3]};return Ef(e).toRgbString()}var ja={hasColorscale:bC,extractOpts:cw,extractScale:uw,flipScale:vw,makeColorScaleFunc:dw,makeColorScaleFuncFromTrace:xC},hw=C_,_C=hw.FORMAT_LINK,wC=hw.DATE_FORMAT_LINK;function TC(t,e){return{valType:"string",dflt:"",editType:"none",description:(e?ap:pw)("hover text",t)+["By default the values are formatted using "+(e?"generic number format":"`"+t+"axis.hoverformat`")+"."].join(" ")}}function ap(t,e){return["Sets the "+t+" formatting rule"+(e?"for `"+e+"` ":""),"using d3 formatting mini-languages","which are very similar to those in Python. For numbers, see: "+_C+"."].join(" ")}function pw(t,e){return ap(t,e)+[" And for dates see: "+wC+".","We add two items to d3's date formatter:","*%h* for half of the year as a decimal number as well as","*%{n}f* for fractional seconds","with n digits. For example, *2016-10-13 09:15:23.456* with tickformat","*%H~%M~%S.%2f* would display *09~15~23.46*"].join(" ")}var qo={axisHoverFormat:TC,descriptionOnlyNumbers:ap,descriptionWithDates:pw},Km=Mr,vo=Or,mw=ta.dash,ip=Xt.extendFlat,Qm=Ht.templatedArray,Jm=qo.descriptionWithDates,kC=fr.ONEDAY,Ya=Rr,Fu=Ya.HOUR_PATTERN,Nu=Ya.WEEKDAY_PATTERN,zf={valType:"enumerated",values:["auto","linear","array"],editType:"ticks",impliedEdits:{tick0:void 0,dtick:void 0},description:["Sets the tick mode for this axis.","If *auto*, the number of ticks is set via `nticks`.","If *linear*, the placement of the ticks is determined by","a starting position `tick0` and a tick step `dtick`","(*linear* is the default value if `tick0` and `dtick` are provided).","If *array*, the placement of the ticks is set via `tickvals`","and the tick text is `ticktext`.","(*array* is the default value if `tickvals` is provided)."].join(" ")},AC=ip({},zf,{values:zf.values.slice().concat(["sync"]),description:[zf.description,"If *sync*, the number of ticks will sync with the overlayed axis","set by `overlaying` property."].join(" ")});function ey(t){return{valType:"integer",min:0,dflt:t?5:0,editType:"ticks",description:["Specifies the maximum number of ticks for the particular axis.","The actual number of ticks will be chosen automatically to be","less than or equal to `nticks`.","Has an effect only if `tickmode` is set to *auto*."].join(" ")}}var ty={valType:"any",editType:"ticks",impliedEdits:{tickmode:"linear"},description:["Sets the placement of the first tick on this axis.","Use with `dtick`.","If the axis `type` is *log*, then you must take the log of your starting tick","(e.g. to set the starting tick to 100, set the `tick0` to 2)","except when `dtick`=*L<f>* (see `dtick` for more info).","If the axis `type` is *date*, it should be a date string, like date data.","If the axis `type` is *category*, it should be a number, using the scale where","each category is assigned a serial number from zero in the order it appears."].join(" ")},ry={valType:"any",editType:"ticks",impliedEdits:{tickmode:"linear"},description:["Sets the step in-between ticks on this axis. Use with `tick0`.","Must be a positive number, or special strings available to *log* and *date* axes.","If the axis `type` is *log*, then ticks are set every 10^(n*dtick) where n","is the tick number. For example,","to set a tick mark at 1, 10, 100, 1000, ... set dtick to 1.","To set tick marks at 1, 100, 10000, ... set dtick to 2.","To set tick marks at 1, 5, 25, 125, 625, 3125, ... set dtick to log_10(5), or 0.69897000433.","*log* has several special values; *L<f>*, where `f` is a positive number,","gives ticks linearly spaced in value (but not position).","For example `tick0` = 0.1, `dtick` = *L0.5* will put ticks at 0.1, 0.6, 1.1, 1.6 etc.","To show powers of 10 plus small digits between, use *D1* (all digits) or *D2* (only 2 and 5).","`tick0` is ignored for *D1* and *D2*.","If the axis `type` is *date*, then you must convert the time to milliseconds.","For example, to set the interval between ticks to one day,","set `dtick` to 86400000.0.","*date* also has special values *M<n>* gives ticks spaced by a number of months.","`n` must be a positive integer.","To set ticks on the 15th of every third month, set `tick0` to *2000-01-15* and `dtick` to *M3*.","To set ticks every 4 years, set `dtick` to *M48*"].join(" ")},ay={valType:"data_array",editType:"ticks",description:["Sets the values at which ticks on this axis appear.","Only has an effect if `tickmode` is set to *array*.","Used with `ticktext`."].join(" ")},iy={valType:"enumerated",values:["outside","inside",""],editType:"ticks",description:["Determines whether ticks are drawn or not.","If **, this axis' ticks are not drawn.","If *outside* (*inside*), this axis' are drawn outside (inside)","the axis lines."].join(" ")};function ny(t){var e={valType:"number",min:0,editType:"ticks",description:"Sets the tick length (in px)."};return t||(e.dflt=5),e}function oy(t){var e={valType:"number",min:0,editType:"ticks",description:"Sets the tick width (in px)."};return t||(e.dflt=1),e}var ly={valType:"color",dflt:vo.defaultLine,editType:"ticks",description:"Sets the tick color."},sy={valType:"color",dflt:vo.lightLine,editType:"ticks",description:"Sets the color of the grid lines."};function fy(t){var e={valType:"number",min:0,editType:"ticks",description:"Sets the width (in px) of the grid lines."};return t||(e.dflt=1),e}var cy=ip({},mw,{editType:"ticks"}),uy={valType:"boolean",editType:"ticks",description:["Determines whether or not grid lines are drawn.","If *true*, the grid lines are drawn at every tick mark."].join(" ")},ti={visible:{valType:"boolean",editType:"plot",description:["A single toggle to hide the axis while preserving interaction like dragging.","Default is true when a cheater plot is present on the axis, otherwise","false"].join(" ")},color:{valType:"color",dflt:vo.defaultLine,editType:"ticks",description:["Sets default for all colors associated with this axis","all at once: line, font, tick, and grid colors.","Grid color is lightened by blending this with the plot background","Individual pieces can override this."].join(" ")},title:{text:{valType:"string",editType:"ticks",description:"Sets the title of this axis."},font:Km({editType:"ticks",description:"Sets this axis' title font."}),standoff:{valType:"number",min:0,editType:"ticks",description:["Sets the standoff distance (in px) between the axis labels and the title text","The default value is a function of the axis tick labels, the title `font.size`","and the axis `linewidth`.","Note that the axis title position is always constrained within the margins,","so the actual standoff distance is always less than the set or default value.","By setting `standoff` and turning on `automargin`, plotly.js will push the","margins to fit the axis title at given standoff distance."].join(" ")},editType:"ticks"},type:{valType:"enumerated",values:["-","linear","log","date","category","multicategory"],dflt:"-",editType:"calc",_noTemplating:!0,description:["Sets the axis type.","By default, plotly attempts to determined the axis type","by looking into the data of the traces that referenced","the axis in question."].join(" ")},autotypenumbers:{valType:"enumerated",values:["convert types","strict"],dflt:"convert types",editType:"calc",description:["Using *strict* a numeric string in trace data is not converted to a number.","Using *convert types* a numeric string in trace data may be","treated as a number during automatic axis `type` detection.","Defaults to layout.autotypenumbers."].join(" ")},autorange:{valType:"enumerated",values:[!0,!1,"reversed","min reversed","max reversed","min","max"],dflt:!0,editType:"axrange",impliedEdits:{"range[0]":void 0,"range[1]":void 0},description:["Determines whether or not the range of this axis is","computed in relation to the input data.","See `rangemode` for more info.","If `range` is provided and it has a value for both the","lower and upper bound, `autorange` is set to *false*.","Using *min* applies autorange only to set the minimum.","Using *max* applies autorange only to set the maximum.","Using *min reversed* applies autorange only to set the minimum on a reversed axis.","Using *max reversed* applies autorange only to set the maximum on a reversed axis.","Using *reversed* applies autorange on both ends and reverses the axis direction."].join(" ")},autorangeoptions:{minallowed:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0},description:["Use this value exactly as autorange minimum."].join(" ")},maxallowed:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0},description:["Use this value exactly as autorange maximum."].join(" ")},clipmin:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0},description:["Clip autorange minimum if it goes beyond this value.","Has no effect when `autorangeoptions.minallowed` is provided."].join(" ")},clipmax:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0},description:["Clip autorange maximum if it goes beyond this value.","Has no effect when `autorangeoptions.maxallowed` is provided."].join(" ")},include:{valType:"any",arrayOk:!0,editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0},description:["Ensure this value is included in autorange."].join(" ")},editType:"plot"},rangemode:{valType:"enumerated",values:["normal","tozero","nonnegative"],dflt:"normal",editType:"plot",description:["If *normal*, the range is computed in relation to the extrema","of the input data.","If *tozero*`, the range extends to 0,","regardless of the input data","If *nonnegative*, the range is non-negative,","regardless of the input data.","Applies only to linear axes."].join(" ")},range:{valType:"info_array",items:[{valType:"any",editType:"axrange",impliedEdits:{"^autorange":!1},anim:!0},{valType:"any",editType:"axrange",impliedEdits:{"^autorange":!1},anim:!0}],editType:"axrange",impliedEdits:{autorange:!1},anim:!0,description:["Sets the range of this axis.","If the axis `type` is *log*, then you must take the log of your","desired range (e.g. to set the range from 1 to 100,","set the range from 0 to 2).","If the axis `type` is *date*, it should be date strings,","like date data, though Date objects and unix milliseconds","will be accepted and converted to strings.","If the axis `type` is *category*, it should be numbers,","using the scale where each category is assigned a serial","number from zero in the order it appears.","Leaving either or both elements `null` impacts the default `autorange`."].join(" ")},minallowed:{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1},description:["Determines the minimum range of this axis."].join(" ")},maxallowed:{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1},description:["Determines the maximum range of this axis."].join(" ")},fixedrange:{valType:"boolean",dflt:!1,editType:"calc",description:["Determines whether or not this axis is zoom-able.","If true, then zoom is disabled."].join(" ")},insiderange:{valType:"info_array",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot",description:["Could be used to set the desired inside range of this axis","(excluding the labels) when `ticklabelposition` of","the anchored axis has *inside*.","Not implemented for axes with `type` *log*.","This would be ignored when `range` is provided."].join(" ")},scaleanchor:{valType:"enumerated",values:[Ya.idRegex.x.toString(),Ya.idRegex.y.toString(),!1],editType:"plot",description:["If set to another axis id (e.g. `x2`, `y`), the range of this axis","changes together with the range of the corresponding axis","such that the scale of pixels per unit is in a constant ratio.","Both axes are still zoomable, but when you zoom one, the other will","zoom the same amount, keeping a fixed midpoint.","`constrain` and `constraintoward` determine how we enforce the constraint.","You can chain these, ie `yaxis: {scaleanchor: *x*}, xaxis2: {scaleanchor: *y*}`","but you can only link axes of the same `type`.","The linked axis can have the opposite letter (to constrain the aspect ratio)","or the same letter (to match scales across subplots).","Loops (`yaxis: {scaleanchor: *x*}, xaxis: {scaleanchor: *y*}` or longer) are redundant","and the last constraint encountered will be ignored to avoid possible","inconsistent constraints via `scaleratio`.","Note that setting axes simultaneously in both a `scaleanchor` and a `matches` constraint","is currently forbidden.","Setting `false` allows to remove a default constraint (occasionally,","you may need to prevent a default `scaleanchor` constraint from",'being applied, eg. when having an image trace `yaxis: {scaleanchor: "x"}`',"is set automatically in order for pixels to be rendered as squares,","setting `yaxis: {scaleanchor: false}` allows to remove the constraint)."].join(" ")},scaleratio:{valType:"number",min:0,dflt:1,editType:"plot",description:["If this axis is linked to another by `scaleanchor`, this determines the pixel","to unit scale ratio. For example, if this value is 10, then every unit on","this axis spans 10 times the number of pixels as a unit on the linked axis.","Use this for example to create an elevation profile where the vertical scale","is exaggerated a fixed amount with respect to the horizontal."].join(" ")},constrain:{valType:"enumerated",values:["range","domain"],editType:"plot",description:["If this axis needs to be compressed (either due to its own `scaleanchor` and","`scaleratio` or those of the other axis), determines how that happens:","by increasing the *range*, or by decreasing the *domain*.","Default is *domain* for axes containing image traces, *range* otherwise."].join(" ")},constraintoward:{valType:"enumerated",values:["left","center","right","top","middle","bottom"],editType:"plot",description:["If this axis needs to be compressed (either due to its own `scaleanchor` and","`scaleratio` or those of the other axis), determines which direction we push","the originally specified plot area. Options are *left*, *center* (default),","and *right* for x axes, and *top*, *middle* (default), and *bottom* for y axes."].join(" ")},matches:{valType:"enumerated",values:[Ya.idRegex.x.toString(),Ya.idRegex.y.toString()],editType:"calc",description:["If set to another axis id (e.g. `x2`, `y`), the range of this axis","will match the range of the corresponding axis in data-coordinates space.","Moreover, matching axes share auto-range values, category lists and","histogram auto-bins.","Note that setting axes simultaneously in both a `scaleanchor` and a `matches` constraint","is currently forbidden.","Moreover, note that matching axes must have the same `type`."].join(" ")},rangebreaks:Qm("rangebreak",{enabled:{valType:"boolean",dflt:!0,editType:"calc",description:["Determines whether this axis rangebreak is enabled or disabled.","Please note that `rangebreaks` only work for *date* axis type."].join(" ")},bounds:{valType:"info_array",items:[{valType:"any",editType:"calc"},{valType:"any",editType:"calc"}],editType:"calc",description:["Sets the lower and upper bounds of this axis rangebreak.","Can be used with `pattern`."].join(" ")},pattern:{valType:"enumerated",values:[Nu,Fu,""],editType:"calc",description:["Determines a pattern on the time line that generates breaks.","If *"+Nu+"* - days of the week in English e.g. 'Sunday' or `sun`","(matching is case-insensitive and considers only the first three characters),","as well as Sunday-based integers between 0 and 6.","If *"+Fu+"* - hour (24-hour clock) as decimal numbers between 0 and 24.","for more info.","Examples:","- { pattern: '"+Nu+"', bounds: [6, 1] }"," or simply { bounds: ['sat', 'mon'] }"," breaks from Saturday to Monday (i.e. skips the weekends).","- { pattern: '"+Fu+"', bounds: [17, 8] }"," breaks from 5pm to 8am (i.e. skips non-work hours)."].join(" ")},values:{valType:"info_array",freeLength:!0,editType:"calc",items:{valType:"any",editType:"calc"},description:["Sets the coordinate values corresponding to the rangebreaks.","An alternative to `bounds`.","Use `dvalue` to set the size of the values along the axis."].join(" ")},dvalue:{valType:"number",editType:"calc",min:0,dflt:kC,description:["Sets the size of each `values` item.","The default is one day in milliseconds."].join(" ")},editType:"calc"}),tickmode:AC,nticks:ey(),tick0:ty,dtick:ry,ticklabelstep:{valType:"integer",min:1,dflt:1,editType:"ticks",description:["Sets the spacing between tick labels as compared to the spacing between ticks.","A value of 1 (default) means each tick gets a label.","A value of 2 means shows every 2nd label.","A larger value n means only every nth tick is labeled.","`tick0` determines which labels are shown.","Not implemented for axes with `type` *log* or *multicategory*, or when `tickmode` is *array*."].join(" ")},tickvals:ay,ticktext:{valType:"data_array",editType:"ticks",description:["Sets the text displayed at the ticks position via `tickvals`.","Only has an effect if `tickmode` is set to *array*.","Used with `tickvals`."].join(" ")},ticks:iy,tickson:{valType:"enumerated",values:["labels","boundaries"],dflt:"labels",editType:"ticks",description:["Determines where ticks and grid lines are drawn with respect to their","corresponding tick labels.","Only has an effect for axes of `type` *category* or *multicategory*.","When set to *boundaries*, ticks and grid lines are drawn half a category","to the left/bottom of labels."].join(" ")},ticklabelmode:{valType:"enumerated",values:["instant","period"],dflt:"instant",editType:"ticks",description:["Determines where tick labels are drawn with respect to their","corresponding ticks and grid lines.","Only has an effect for axes of `type` *date*","When set to *period*, tick labels are drawn in the middle of the period","between ticks."].join(" ")},ticklabelposition:{valType:"enumerated",values:["outside","inside","outside top","inside top","outside left","inside left","outside right","inside right","outside bottom","inside bottom"],dflt:"outside",editType:"calc",description:["Determines where tick labels are drawn with respect to the axis.","Please note that","top or bottom has no effect on x axes or when `ticklabelmode` is set to *period*","or when `tickson` is set to *boundaries*. Similarly,","left or right has no effect on y axes or when `ticklabelmode` is set to *period*","or when `tickson` is set to *boundaries*.","Has no effect on *multicategory* axes.","When used on axes linked by `matches` or `scaleanchor`,","no extra padding for inside labels would be added by autorange,","so that the scales could match."].join(" ")},ticklabeloverflow:{valType:"enumerated",values:["allow","hide past div","hide past domain"],editType:"calc",description:["Determines how we handle tick labels that would overflow either the graph div or the domain of the axis.","The default value for inside tick labels is *hide past domain*.","Otherwise on *category* and *multicategory* axes the default is *allow*.","In other cases the default is *hide past div*."].join(" ")},ticklabelshift:{valType:"integer",dflt:0,editType:"ticks",description:["Shifts the tick labels by the specified number of pixels in parallel to the axis.","Positive values move the labels in the positive direction of the axis."].join(" ")},ticklabelstandoff:{valType:"integer",dflt:0,editType:"ticks",description:["Sets the standoff distance (in px) between the axis tick labels and their default position.","A positive `ticklabelstandoff` moves the labels farther away from the plot area","if `ticklabelposition` is *outside*, and deeper into the plot area if","`ticklabelposition` is *inside*. A negative `ticklabelstandoff` works in the opposite","direction, moving outside ticks towards the plot area and inside ticks towards","the outside. If the negative value is large enough, inside ticks can even end up","outside and vice versa."].join(" ")},ticklabelindex:{valType:"integer",arrayOk:!0,editType:"calc",description:["Only for axes with `type` *date* or *linear*.","Instead of drawing the major tick label, draw the label for the minor tick","that is n positions away from the major tick. E.g. to always draw the label for the","minor tick before each major tick, choose `ticklabelindex` -1. This is useful for date","axes with `ticklabelmode` *period* if you want to label the period that ends with each","major tick instead of the period that begins there."].join(" ")},mirror:{valType:"enumerated",values:[!0,"ticks",!1,"all","allticks"],dflt:!1,editType:"ticks+layoutstyle",description:["Determines if the axis lines or/and ticks are mirrored to","the opposite side of the plotting area.","If *true*, the axis lines are mirrored.","If *ticks*, the axis lines and ticks are mirrored.","If *false*, mirroring is disable.","If *all*, axis lines are mirrored on all shared-axes subplots.","If *allticks*, axis lines and ticks are mirrored","on all shared-axes subplots."].join(" ")},ticklen:ny(),tickwidth:oy(),tickcolor:ly,showticklabels:{valType:"boolean",dflt:!0,editType:"ticks",description:"Determines whether or not the tick labels are drawn."},labelalias:{valType:"any",dflt:!1,editType:"ticks",description:["Replacement text for specific tick or hover labels.","For example using {US: 'USA', CA: 'Canada'} changes US to USA","and CA to Canada. The labels we would have shown must match","the keys exactly, after adding any tickprefix or ticksuffix.","For negative numbers the minus sign symbol used (U+2212) is wider than the regular ascii dash.","That means you need to use −1 instead of -1.","labelalias can be used with any axis type, and both keys (if needed)","and values (if desired) can include html-like tags or MathJax."].join(" ")},automargin:{valType:"flaglist",flags:["height","width","left","right","top","bottom"],extras:[!0,!1],dflt:!1,editType:"ticks",description:["Determines whether long tick labels automatically grow the figure","margins."].join(" ")},showspikes:{valType:"boolean",dflt:!1,editType:"modebar",description:["Determines whether or not spikes (aka droplines) are drawn for this axis.","Note: This only takes affect when hovermode = closest"].join(" ")},spikecolor:{valType:"color",dflt:null,editType:"none",description:"Sets the spike color. If undefined, will use the series color"},spikethickness:{valType:"number",dflt:3,editType:"none",description:"Sets the width (in px) of the zero line."},spikedash:ip({},mw,{dflt:"dash",editType:"none"}),spikemode:{valType:"flaglist",flags:["toaxis","across","marker"],dflt:"toaxis",editType:"none",description:["Determines the drawing mode for the spike line","If *toaxis*, the line is drawn from the data point to the axis the ","series is plotted on.","If *across*, the line is drawn across the entire plot area, and","supercedes *toaxis*.","If *marker*, then a marker dot is drawn on the axis the series is","plotted on"].join(" ")},spikesnap:{valType:"enumerated",values:["data","cursor","hovered data"],dflt:"hovered data",editType:"none",description:"Determines whether spikelines are stuck to the cursor or to the closest datapoints."},tickfont:Km({editType:"ticks",description:"Sets the tick font."}),tickangle:{valType:"angle",dflt:"auto",editType:"ticks",description:["Sets the angle of the tick labels with respect to the horizontal.","For example, a `tickangle` of -90 draws the tick labels","vertically."].join(" ")},autotickangles:{valType:"info_array",freeLength:!0,items:{valType:"angle"},dflt:[0,30,90],editType:"ticks",description:["When `tickangle` is set to *auto*, it will be set to the first","angle in this array that is large enough to prevent label","overlap."].join(" ")},tickprefix:{valType:"string",dflt:"",editType:"ticks",description:"Sets a tick label prefix."},showtickprefix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks",description:["If *all*, all tick labels are displayed with a prefix.","If *first*, only the first tick is displayed with a prefix.","If *last*, only the last tick is displayed with a suffix.","If *none*, tick prefixes are hidden."].join(" ")},ticksuffix:{valType:"string",dflt:"",editType:"ticks",description:"Sets a tick label suffix."},showticksuffix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks",description:"Same as `showtickprefix` but for tick suffixes."},showexponent:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks",description:["If *all*, all exponents are shown besides their significands.","If *first*, only the exponent of the first tick is shown.","If *last*, only the exponent of the last tick is shown.","If *none*, no exponents appear."].join(" ")},exponentformat:{valType:"enumerated",values:["none","e","E","power","SI","B"],dflt:"B",editType:"ticks",description:["Determines a formatting rule for the tick exponents.","For example, consider the number 1,000,000,000.","If *none*, it appears as 1,000,000,000.","If *e*, 1e+9.","If *E*, 1E+9.","If *power*, 1x10^9 (with 9 in a super script).","If *SI*, 1G.","If *B*, 1B."].join(" ")},minexponent:{valType:"number",dflt:3,min:0,editType:"ticks",description:["Hide SI prefix for 10^n if |n| is below this number.","This only has an effect when `tickformat` is *SI* or *B*."].join(" ")},separatethousands:{valType:"boolean",dflt:!1,editType:"ticks",description:['If "true", even 4-digit integers are separated'].join(" ")},tickformat:{valType:"string",dflt:"",editType:"ticks",description:Jm("tick label")},tickformatstops:Qm("tickformatstop",{enabled:{valType:"boolean",dflt:!0,editType:"ticks",description:["Determines whether or not this stop is used.","If `false`, this stop is ignored even within its `dtickrange`."].join(" ")},dtickrange:{valType:"info_array",items:[{valType:"any",editType:"ticks"},{valType:"any",editType:"ticks"}],editType:"ticks",description:["range [*min*, *max*], where *min*, *max* - dtick values","which describe some zoom level, it is possible to omit *min*","or *max* value by passing *null*"].join(" ")},value:{valType:"string",dflt:"",editType:"ticks",description:["string - dtickformat for described zoom level, the same as *tickformat*"].join(" ")},editType:"ticks"}),hoverformat:{valType:"string",dflt:"",editType:"none",description:Jm("hover text")},showline:{valType:"boolean",dflt:!1,editType:"ticks+layoutstyle",description:["Determines whether or not a line bounding this axis is drawn."].join(" ")},linecolor:{valType:"color",dflt:vo.defaultLine,editType:"layoutstyle",description:"Sets the axis line color."},linewidth:{valType:"number",min:0,dflt:1,editType:"ticks+layoutstyle",description:"Sets the width (in px) of the axis line."},showgrid:uy,gridcolor:sy,gridwidth:fy(),griddash:cy,zeroline:{valType:"boolean",editType:"ticks",description:["Determines whether or not a line is drawn at along the 0 value","of this axis.","If *true*, the zero line is drawn on top of the grid lines."].join(" ")},zerolinecolor:{valType:"color",dflt:vo.defaultLine,editType:"ticks",description:"Sets the line color of the zero line."},zerolinelayer:{valType:"enumerated",values:["above traces","below traces"],dflt:"below traces",editType:"plot",description:["Sets the layer on which this zeroline is displayed.","If *above traces*, this zeroline is displayed above all the subplot's traces","If *below traces*, this zeroline is displayed below all the subplot's traces,","but above the grid lines. Limitation: *zerolinelayer* currently has no effect","if the *zorder* property is set on any trace."].join(" ")},zerolinewidth:{valType:"number",dflt:1,editType:"ticks",description:"Sets the width (in px) of the zero line."},showdividers:{valType:"boolean",dflt:!0,editType:"ticks",description:["Determines whether or not a dividers are drawn","between the category levels of this axis.","Only has an effect on *multicategory* axes."].join(" ")},dividercolor:{valType:"color",dflt:vo.defaultLine,editType:"ticks",description:["Sets the color of the dividers","Only has an effect on *multicategory* axes."].join(" ")},dividerwidth:{valType:"number",dflt:1,editType:"ticks",description:["Sets the width (in px) of the dividers","Only has an effect on *multicategory* axes."].join(" ")},anchor:{valType:"enumerated",values:["free",Ya.idRegex.x.toString(),Ya.idRegex.y.toString()],editType:"plot",description:["If set to an opposite-letter axis id (e.g. `x2`, `y`), this axis is bound to","the corresponding opposite-letter axis.","If set to *free*, this axis' position is determined by `position`."].join(" ")},side:{valType:"enumerated",values:["top","bottom","left","right"],editType:"plot",description:["Determines whether a x (y) axis is positioned","at the *bottom* (*left*) or *top* (*right*)","of the plotting area."].join(" ")},overlaying:{valType:"enumerated",values:["free",Ya.idRegex.x.toString(),Ya.idRegex.y.toString()],editType:"plot",description:["If set a same-letter axis id, this axis is overlaid on top of","the corresponding same-letter axis, with traces and axes visible for both","axes.","If *false*, this axis does not overlay any same-letter axes.","In this case, for axes with overlapping domains only the highest-numbered","axis will be visible."].join(" ")},minor:{tickmode:zf,nticks:ey("minor"),tick0:ty,dtick:ry,tickvals:ay,ticks:iy,ticklen:ny("minor"),tickwidth:oy("minor"),tickcolor:ly,gridcolor:sy,gridwidth:fy("minor"),griddash:cy,showgrid:uy,editType:"ticks"},layer:{valType:"enumerated",values:["above traces","below traces"],dflt:"above traces",editType:"plot",description:["Sets the layer on which this axis is displayed.","If *above traces*, this axis is displayed above all the subplot's traces","If *below traces*, this axis is displayed below all the subplot's traces,","but above the grid lines.","Useful when used together with scatter-like traces with `cliponaxis`","set to *false* to show markers and/or text nodes above this axis."].join(" ")},domain:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"plot"},{valType:"number",min:0,max:1,editType:"plot"}],dflt:[0,1],editType:"plot",description:["Sets the domain of this axis (in plot fraction)."].join(" ")},position:{valType:"number",min:0,max:1,dflt:0,editType:"plot",description:["Sets the position of this axis in the plotting space","(in normalized coordinates).","Only has an effect if `anchor` is set to *free*."].join(" ")},autoshift:{valType:"boolean",dflt:!1,editType:"plot",description:["Automatically reposition the axis to avoid","overlap with other axes with the same `overlaying` value.","This repositioning will account for any `shift` amount applied to other","axes on the same side with `autoshift` is set to true.","Only has an effect if `anchor` is set to *free*."].join(" ")},shift:{valType:"number",editType:"plot",description:["Moves the axis a given number of pixels from where it would have been otherwise.","Accepts both positive and negative values, which will shift the axis either right","or left, respectively.","If `autoshift` is set to true, then this defaults to a padding of -3 if `side` is set to *left*.","and defaults to +3 if `side` is set to *right*. Defaults to 0 if `autoshift` is set to false.","Only has an effect if `anchor` is set to *free*."].join(" ")},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array","total ascending","total descending","min ascending","min descending","max ascending","max descending","sum ascending","sum descending","mean ascending","mean descending","geometric mean ascending","geometric mean descending","median ascending","median descending"],dflt:"trace",editType:"calc",description:["Specifies the ordering logic for the case of categorical variables.","By default, plotly uses *trace*, which specifies the order that is present in the data supplied.","Set `categoryorder` to *category ascending* or *category descending* if order should be determined by","the alphanumerical order of the category names.","Set `categoryorder` to *array* to derive the ordering from the attribute `categoryarray`. If a category","is not found in the `categoryarray` array, the sorting behavior for that attribute will be identical to","the *trace* mode. The unspecified categories will follow the categories in `categoryarray`.","Set `categoryorder` to *total ascending* or *total descending* if order should be determined by the","numerical order of the values.","Similarly, the order can be determined by the min, max, sum, mean, geometric mean or median of all the values."].join(" ")},categoryarray:{valType:"data_array",editType:"calc",description:["Sets the order in which categories on this axis appear.","Only has an effect if `categoryorder` is set to *array*.","Used with `categoryorder`."].join(" ")},uirevision:{valType:"any",editType:"none",description:["Controls persistence of user-driven changes in axis `range`,","`autorange`, and `title` if in `editable: true` configuration.","Defaults to `layout.uirevision`."].join(" ")},editType:"calc"},Wt=ti,vy=Mr,dy=Xt.extendFlat,MC=Ja.overrideAll,np=MC({orientation:{valType:"enumerated",values:["h","v"],dflt:"v",description:"Sets the orientation of the colorbar."},thicknessmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"pixels",description:["Determines whether this color bar's thickness","(i.e. the measure in the constant color direction)","is set in units of plot *fraction* or in *pixels*.","Use `thickness` to set the value."].join(" ")},thickness:{valType:"number",min:0,dflt:30,description:["Sets the thickness of the color bar","This measure excludes the size of the padding, ticks and labels."].join(" ")},lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction",description:["Determines whether this color bar's length","(i.e. the measure in the color variation direction)","is set in units of plot *fraction* or in *pixels.","Use `len` to set the value."].join(" ")},len:{valType:"number",min:0,dflt:1,description:["Sets the length of the color bar","This measure excludes the padding of both ends.","That is, the color bar length is this length minus the","padding on both ends."].join(" ")},x:{valType:"number",description:["Sets the x position with respect to `xref` of the color bar (in plot fraction).","When `xref` is *paper*, defaults to 1.02 when `orientation` is *v* and","0.5 when `orientation` is *h*.","When `xref` is *container*, defaults to *1* when `orientation` is *v* and","0.5 when `orientation` is *h*.","Must be between *0* and *1* if `xref` is *container*","and between *-2* and *3* if `xref` is *paper*."].join(" ")},xref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle",description:["Sets the container `x` refers to.","*container* spans the entire `width` of the plot.","*paper* refers to the width of the plotting area only."].join(" ")},xanchor:{valType:"enumerated",values:["left","center","right"],description:["Sets this color bar's horizontal position anchor.","This anchor binds the `x` position to the *left*, *center*","or *right* of the color bar.","Defaults to *left* when `orientation` is *v* and","*center* when `orientation` is *h*."].join(" ")},xpad:{valType:"number",min:0,dflt:10,description:"Sets the amount of padding (in px) along the x direction."},y:{valType:"number",description:["Sets the y position with respect to `yref` of the color bar (in plot fraction).","When `yref` is *paper*, defaults to 0.5 when `orientation` is *v* and","1.02 when `orientation` is *h*.","When `yref` is *container*, defaults to 0.5 when `orientation` is *v* and","1 when `orientation` is *h*.","Must be between *0* and *1* if `yref` is *container*","and between *-2* and *3* if `yref` is *paper*."].join(" ")},yref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle",description:["Sets the container `y` refers to.","*container* spans the entire `height` of the plot.","*paper* refers to the height of the plotting area only."].join(" ")},yanchor:{valType:"enumerated",values:["top","middle","bottom"],description:["Sets this color bar's vertical position anchor","This anchor binds the `y` position to the *top*, *middle*","or *bottom* of the color bar.","Defaults to *middle* when `orientation` is *v* and","*bottom* when `orientation` is *h*."].join(" ")},ypad:{valType:"number",min:0,dflt:10,description:"Sets the amount of padding (in px) along the y direction."},outlinecolor:Wt.linecolor,outlinewidth:Wt.linewidth,bordercolor:Wt.linecolor,borderwidth:{valType:"number",min:0,dflt:0,description:["Sets the width (in px) or the border enclosing this color bar."].join(" ")},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",description:"Sets the color of padded area."},tickmode:Wt.minor.tickmode,nticks:Wt.nticks,tick0:Wt.tick0,dtick:Wt.dtick,tickvals:Wt.tickvals,ticktext:Wt.ticktext,ticks:dy({},Wt.ticks,{dflt:""}),ticklabeloverflow:dy({},Wt.ticklabeloverflow,{description:["Determines how we handle tick labels that would overflow either the graph div or the domain of the axis.","The default value for inside tick labels is *hide past domain*.","In other cases the default is *hide past div*."].join(" ")}),ticklabelposition:{valType:"enumerated",values:["outside","inside","outside top","inside top","outside left","inside left","outside right","inside right","outside bottom","inside bottom"],dflt:"outside",description:["Determines where tick labels are drawn relative to the ticks.","Left and right options are used when `orientation` is *h*,","top and bottom when `orientation` is *v*."].join(" ")},ticklen:Wt.ticklen,tickwidth:Wt.tickwidth,tickcolor:Wt.tickcolor,ticklabelstep:Wt.ticklabelstep,showticklabels:Wt.showticklabels,labelalias:Wt.labelalias,tickfont:vy({description:"Sets the color bar's tick label font"}),tickangle:Wt.tickangle,tickformat:Wt.tickformat,tickformatstops:Wt.tickformatstops,tickprefix:Wt.tickprefix,showtickprefix:Wt.showtickprefix,ticksuffix:Wt.ticksuffix,showticksuffix:Wt.showticksuffix,separatethousands:Wt.separatethousands,exponentformat:Wt.exponentformat,minexponent:Wt.minexponent,showexponent:Wt.showexponent,title:{text:{valType:"string",description:"Sets the title of the color bar."},font:vy({description:"Sets this color bar's title font."}),side:{valType:"enumerated",values:["right","top","bottom"],description:["Determines the location of color bar's title","with respect to the color bar.","Defaults to *top* when `orientation` if *v* and ","defaults to *right* when `orientation` if *h*."].join(" ")}}},"colorbars","from-root"),SC=np,LC=Bo.counter,CC=Yh,yw=jo.scales,DC=CC(yw);function nl(t){return"`"+t+"`"}var Rn=function(e,r){e=e||"",r=r||{};var a=r.cLetter||"c",i="onlyIfNumerical"in r?r.onlyIfNumerical:!!e,n="noScale"in r?r.noScale:e==="marker.line",o="showScaleDflt"in r?r.showScaleDflt:a==="z",l=typeof r.colorscaleDflt=="string"?yw[r.colorscaleDflt]:null,s=r.editTypeOverride||"",f=e?e+".":"",c,u;"colorAttr"in r?(c=r.colorAttr,u=r.colorAttr):(c={z:"z",c:"color"}[a],u="in "+nl(f+c));var v=i?" Has an effect only if "+u+" is set to a numerical array.":"",p=a+"auto",d=a+"min",h=a+"max",m=a+"mid",y=nl(f+p),b=nl(f+d),_=nl(f+h),g=b+" and "+_,x={};x[d]=x[h]=void 0;var w={};w[p]=!1;var T={};return c==="color"&&(T.color={valType:"color",arrayOk:!0,editType:s||"style",description:["Sets the",e,"color.","It accepts either a specific color","or an array of numbers that are mapped to the colorscale","relative to the max and min values of the array or relative to",g,"if set."].join(" ")},r.anim&&(T.color.anim=!0)),T[p]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:x,description:["Determines whether or not the color domain is computed","with respect to the input data (here "+u+") or the bounds set in",g+v,"Defaults to `false` when",g,"are set by the user."].join(" ")},T[d]={valType:"number",dflt:null,editType:s||"plot",impliedEdits:w,description:["Sets the lower bound of the color domain."+v,"Value should have the same units as",u,"and if set,",_,"must be set as well."].join(" ")},T[h]={valType:"number",dflt:null,editType:s||"plot",impliedEdits:w,description:["Sets the upper bound of the color domain."+v,"Value should have the same units as",u,"and if set,",b,"must be set as well."].join(" ")},T[m]={valType:"number",dflt:null,editType:"calc",impliedEdits:x,description:["Sets the mid-point of the color domain by scaling",b,"and/or",_,"to be equidistant to this point."+v,"Value should have the same units as",u+".","Has no effect when",y,"is `false`."].join(" ")},T.colorscale={valType:"colorscale",editType:"calc",dflt:l,impliedEdits:{autocolorscale:!1},description:["Sets the colorscale."+v,"The colorscale must be an array containing","arrays mapping a normalized value to an","rgb, rgba, hex, hsl, hsv, or named color string.","At minimum, a mapping for the lowest (0) and highest (1)","values are required. For example,","`[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]`.","To control the bounds of the colorscale in color space,","use",g+".","Alternatively, `colorscale` may be a palette name string","of the following list: "+DC+"."].join(" ")},T.autocolorscale={valType:"boolean",dflt:r.autoColorDflt!==!1,editType:"calc",impliedEdits:{colorscale:void 0},description:["Determines whether the colorscale is a default palette (`autocolorscale: true`)","or the palette determined by",nl(f+"colorscale")+"."+v,"In case `colorscale` is unspecified or `autocolorscale` is true, the default","palette will be chosen according to whether numbers in the `color` array are","all positive, all negative or mixed."].join(" ")},T.reversescale={valType:"boolean",dflt:!1,editType:"plot",description:["Reverses the color mapping if true."+v,"If true,",b,"will correspond to the last color","in the array and",_,"will correspond to the first color."].join(" ")},n||(T.showscale={valType:"boolean",dflt:o,editType:"calc",description:["Determines whether or not a colorbar is displayed for this trace."+v].join(" ")},T.colorbar=SC),r.noColorAxis||(T.coloraxis={valType:"subplotid",regex:LC("coloraxis"),dflt:null,editType:"calc",description:["Sets a reference to a shared color axis.","References to these shared color axes are *coloraxis*, *coloraxis2*, *coloraxis3*, etc.","Settings for these shared color axes are set in the layout, under","`layout.coloraxis`, `layout.coloraxis2`, etc.","Note that multiple color scales can be linked to the same color axis."].join(" ")}),T},PC=Xt.extendFlat,$C=Rn,Hu=jo.scales,Ou="Note that `autocolorscale` must be true for this attribute to work.",gw={editType:"calc",colorscale:{editType:"calc",sequential:{valType:"colorscale",dflt:Hu.Reds,editType:"calc",description:["Sets the default sequential colorscale for positive values.",Ou].join(" ")},sequentialminus:{valType:"colorscale",dflt:Hu.Blues,editType:"calc",description:["Sets the default sequential colorscale for negative values.",Ou].join(" ")},diverging:{valType:"colorscale",dflt:Hu.RdBu,editType:"calc",description:["Sets the default diverging colorscale.",Ou].join(" ")}},coloraxis:PC({_isSubplotObj:!0,editType:"calc",description:[""].join(" ")},$C("",{colorAttr:"corresponding trace color array(s)",noColorAxis:!0,showScaleDflt:!0}))},EC=we,bw=function(e){return EC.isPlainObject(e.colorbar)},Zc={},Nd=kt,hy=we,xw=fr,zC=xw.ONEDAY,RC=xw.ONEWEEK;Zc.dtick=function(t,e){var r=e==="log",a=e==="date",i=e==="category",n=a?zC:1;if(!t)return n;if(Nd(t))return t=Number(t),t<=0?n:i?Math.max(1,Math.round(t)):a?Math.max(.1,t):t;if(typeof t!="string"||!(a||r))return n;var o=t.charAt(0),l=t.substr(1);return l=Nd(l)?Number(l):0,l<=0||!(a&&o==="M"&&l===Math.round(l)||r&&o==="L"||r&&o==="D"&&(l===1||l===2))?n:t};Zc.tick0=function(t,e,r,a){if(e==="date")return hy.cleanDate(t,hy.dateTick0(r,a%RC===0?1:0));if(!(a==="D1"||a==="D2"))return Nd(t)?Number(t):0};var py=Zc,IC=we.isArrayOrTypedArray,FC=sr.isTypedArraySpec,NC=sr.decodeTypedArraySpec,_w=function(e,r,a,i,n){n||(n={});var o=n.isMinor,l=o?e.minor||{}:e,s=o?r.minor:r,f=o?"minor.":"";function c(b){var _=l[b];return FC(_)&&(_=NC(_)),_!==void 0?_:(s._template||{})[b]}var u=c("tick0"),v=c("dtick"),p=c("tickvals"),d=IC(p)?"array":v?"linear":"auto",h=a(f+"tickmode",d);if(h==="auto"||h==="sync")a(f+"nticks");else if(h==="linear"){var m=s.dtick=py.dtick(v,i);s.tick0=py.tick0(u,i,r.calendar,m)}else if(i!=="multicategory"){var y=a(f+"tickvals");y===void 0?s.tickmode="auto":o||a("ticktext")}},ju=we,my=ti,ww=function(e,r,a,i){var n=i.isMinor,o=n?e.minor||{}:e,l=n?r.minor:r,s=n?my.minor:my,f=n?"minor.":"",c=ju.coerce2(o,l,s,"ticklen",n?(r.ticklen||5)*.6:void 0),u=ju.coerce2(o,l,s,"tickwidth",n?r.tickwidth||1:void 0),v=ju.coerce2(o,l,s,"tickcolor",(n?r.tickcolor:void 0)||l.color),p=a(f+"ticks",!n&&i.outerTicks||c||u||v?"outside":"");p||(delete l.ticklen,delete l.tickwidth,delete l.tickcolor)},Tw=function(e){var r=["showexponent","showtickprefix","showticksuffix"],a=r.filter(function(n){return e[n]!==void 0}),i=function(n){return e[n]===e[a[0]]};if(a.every(i)||a.length===1)return e[a[0]]},Fs=we,HC=Ht,ri=function(e,r,a){var i=a.name,n=a.inclusionAttr||"visible",o=r[i],l=Fs.isArrayOrTypedArray(e[i])?e[i]:[],s=r[i]=[],f=HC.arrayTemplater(r,i,n),c,u;for(c=0;c<l.length;c++){var v=l[c];Fs.isPlainObject(v)?u=f.newItem(v):(u=f.newItem({}),u[n]=!1),u._index=c,u[n]!==!1&&a.handleItemDefaults(v,u,r,a),s.push(u)}var p=f.defaultItems();for(c=0;c<p.length;c++)u=p[c],u._index=s.length,a.handleItemDefaults({},u,r,a,{}),s.push(u);if(Fs.isArrayOrTypedArray(o)){var d=Math.min(o.length,s.length);for(c=0;c<d;c++)Fs.relinkPrivateKeys(s[c],o[c])}return s},Hd=we,OC=yt.contrast,kw=ti,jC=Tw,BC=ri,Aw=function(e,r,a,i,n){n||(n={});var o=a("labelalias");Hd.isPlainObject(o)||delete r.labelalias;var l=jC(e),s=a("showticklabels");if(s){n.noTicklabelshift||a("ticklabelshift"),n.noTicklabelstandoff||a("ticklabelstandoff");var f=n.font||{},c=r.color,u=r.ticklabelposition||"",v=u.indexOf("inside")!==-1?OC(n.bgColor):c&&c!==kw.color.dflt?c:f.color;if(Hd.coerceFont(a,"tickfont",f,{overrideDflt:{color:v}}),!n.noTicklabelstep&&i!=="multicategory"&&i!=="log"&&a("ticklabelstep"),!n.noAng){var p=a("tickangle");!n.noAutotickangles&&p==="auto"&&a("autotickangles")}if(i!=="category"){var d=a("tickformat");BC(e,r,{name:"tickformatstops",inclusionAttr:"enabled",handleItemDefaults:GC}),r.tickformatstops.length||delete r.tickformatstops,!n.noExp&&!d&&i!=="date"&&(a("showexponent",l),a("exponentformat"),a("minexponent"),a("separatethousands"))}}};function GC(t,e){function r(i,n){return Hd.coerce(t,e,kw.tickformatstops,i,n)}var a=r("enabled");a&&(r("dtickrange"),r("value"))}var UC=Tw,Mw=function(e,r,a,i,n){n||(n={});var o=n.tickSuffixDflt,l=UC(e),s=a("tickprefix");s&&a("showtickprefix",l);var f=a("ticksuffix",o);f&&a("showticksuffix",l)},xi=we,VC=Ht,WC=_w,XC=ww,YC=Aw,qC=Mw,ZC=np,Sw=function(e,r,a){var i=VC.newContainer(r,"colorbar"),n=e.colorbar||{};function o(L,E){return xi.coerce(n,i,ZC,L,E)}var l=a.margin||{t:0,b:0,l:0,r:0},s=a.width-l.l-l.r,f=a.height-l.t-l.b,c=o("orientation"),u=c==="v",v=o("thicknessmode");o("thickness",v==="fraction"?30/(u?s:f):30);var p=o("lenmode");o("len",p==="fraction"?1:u?f:s);var d=o("yref"),h=o("xref"),m=d==="paper",y=h==="paper",b,_,g,x="left";u?(g="middle",x=y?"left":"right",b=y?1.02:1,_=.5):(g=m?"bottom":"top",x="center",b=.5,_=m?1.02:1),xi.coerce(n,i,{x:{valType:"number",min:y?-2:0,max:y?3:1,dflt:b}},"x"),xi.coerce(n,i,{y:{valType:"number",min:m?-2:0,max:m?3:1,dflt:_}},"y"),o("xanchor",x),o("xpad"),o("yanchor",g),o("ypad"),xi.noneOrAll(n,i,["x","y"]),o("outlinecolor"),o("outlinewidth"),o("bordercolor"),o("borderwidth"),o("bgcolor");var w=xi.coerce(n,i,{ticklabelposition:{valType:"enumerated",dflt:"outside",values:u?["outside","inside","outside top","inside top","outside bottom","inside bottom"]:["outside","inside","outside left","inside left","outside right","inside right"]}},"ticklabelposition");o("ticklabeloverflow",w.indexOf("inside")!==-1?"hide past domain":"hide past div"),WC(n,i,o,"linear");var T=a.font,A={noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0,outerTicks:!1,font:T};w.indexOf("inside")!==-1&&(A.bgColor="black"),qC(n,i,o,"linear",A),YC(n,i,o,"linear",A),XC(n,i,o,"linear"),o("title.text",a._dfltTitle.colorbar);var M=i.showticklabels?i.tickfont:T,S=xi.extendFlat({},T,{family:M.family,size:xi.bigFont(M.size)});xi.coerceFont(o,"title.font",S),o("title.side",u?"top":"right")},yy=kt,Od=we,KC=bw,QC=Sw,gy=jo.isValid,JC=ot.traceIs;function Bu(t,e){var r=e.slice(0,e.length-1);return e?Od.nestedProperty(t,r).get()||{}:t}var gs=function t(e,r,a,i,n){var o=n.prefix,l=n.cLetter,s="_module"in r,f=Bu(e,o),c=Bu(r,o),u=Bu(r._template||{},o)||{},v=function(){return delete e.coloraxis,delete r.coloraxis,t(e,r,a,i,n)};if(s){var p=a._colorAxes||{},d=i(o+"coloraxis");if(d){var h=JC(r,"contour")&&Od.nestedProperty(r,"contours.coloring").get()||"heatmap",m=p[d];m?(m[2].push(v),m[0]!==h&&(m[0]=!1,Od.warn(["Ignoring coloraxis:",d,"setting","as it is linked to incompatible colorscales."].join(" ")))):p[d]=[h,r,[v]];return}}var y=f[l+"min"],b=f[l+"max"],_=yy(y)&&yy(b)&&y<b,g=i(o+l+"auto",!_);g?i(o+l+"mid"):(i(o+l+"min"),i(o+l+"max"));var x=f.colorscale,w=u.colorscale,T;if(x!==void 0&&(T=!gy(x)),w!==void 0&&(T=!gy(w)),i(o+"autocolorscale",T),i(o+"colorscale"),i(o+"reversescale"),o!=="marker.line."){var A;o&&s&&(A=KC(f));var M=i(o+"showscale",A);M&&(o&&u&&(c._template=u),QC(f,c,a))}},by=we,eD=Ht,xy=gw,tD=gs,rD=function(e,r){function a(u,v){return by.coerce(e,r,xy,u,v)}a("colorscale.sequential"),a("colorscale.sequentialminus"),a("colorscale.diverging");var i=r._colorAxes,n,o;function l(u,v){return by.coerce(n,o,xy.coloraxis,u,v)}for(var s in i){var f=i[s];if(f[0])n=e[s]||{},o=eD.newContainer(r,s,"coloraxis"),o._name=s,tD(n,o,r,l,{prefix:"",cLetter:"c"});else{for(var c=0;c<f[2].length;c++)f[2][c]();delete r._colorAxes[s]}}},aD=we,iD=ja.hasColorscale,nD=ja.extractOpts,oD=function(e,r){function a(c,u){var v=c["_"+u];v!==void 0&&(c[u]=v)}function i(c,u){var v=u.container?aD.nestedProperty(c,u.container).get():c;if(v)if(v.coloraxis)v._colorAx=r[v.coloraxis];else{var p=nD(v),d=p.auto;(d||p.min===void 0)&&a(v,u.min),(d||p.max===void 0)&&a(v,u.max),p.autocolorscale&&a(v,"colorscale")}}for(var n=0;n<e.length;n++){var o=e[n],l=o._module.colorbar;if(l)if(Array.isArray(l))for(var s=0;s<l.length;s++)i(o,l[s]);else i(o,l);iD(o,"marker.line")&&i(o,{container:"marker.line",min:"cmin",max:"cmax"})}for(var f in r._colorAxes)i(r[f],{min:"cmin",max:"cmax"})},_y=kt,Gu=we,lD=ja.extractOpts,op=function(e,r,a){var i=e._fullLayout,n=a.vals,o=a.containerStr,l=o?Gu.nestedProperty(r,o).get():r,s=lD(l),f=s.auto!==!1,c=s.min,u=s.max,v=s.mid,p=function(){return Gu.aggNums(Math.min,null,n)},d=function(){return Gu.aggNums(Math.max,null,n)};if(c===void 0?c=p():f&&(l._colorAx&&_y(c)?c=Math.min(c,p()):c=p()),u===void 0?u=d():f&&(l._colorAx&&_y(u)?u=Math.max(u,d()):u=d()),f&&v!==void 0&&(u-v>v-c?c=v-(u-v):u-v<v-c&&(u=v+(v-c))),c===u&&(c-=.5,u+=.5),s._sync("min",c),s._sync("max",u),s.autocolorscale){var h;c*u<0?h=i.colorscale.diverging:c>=0?h=i.colorscale.sequential:h=i.colorscale.sequentialminus,s._sync("colorscale",h)}},Ns=jo,Hn=ja,Co={moduleType:"component",name:"colorscale",attributes:Rn,layoutAttributes:gw,supplyLayoutDefaults:rD,handleDefaults:gs,crossTraceDefaults:oD,calc:op,scales:Ns.scales,defaultScale:Ns.defaultScale,getScale:Ns.get,isValidScale:Ns.isValid,hasColorscale:Hn.hasColorscale,extractOpts:Hn.extractOpts,extractScale:Hn.extractScale,flipScale:Hn.flipScale,makeColorScaleFunc:Hn.makeColorScaleFunc,makeColorScaleFuncFromTrace:Hn.makeColorScaleFuncFromTrace},wy=we,sD=sr.isTypedArraySpec,jr={hasLines:function(t){return t.visible&&t.mode&&t.mode.indexOf("lines")!==-1},hasMarkers:function(t){return t.visible&&(t.mode&&t.mode.indexOf("markers")!==-1||t.type==="splom")},hasText:function(t){return t.visible&&t.mode&&t.mode.indexOf("text")!==-1},isBubble:function(t){var e=t.marker;return wy.isPlainObject(e)&&(wy.isArrayOrTypedArray(e.size)||sD(e.size))}},fD=kt,Lw=function(e,r){r||(r=2);var a=e.marker,i=a.sizeref||1,n=a.sizemin||0,o=a.sizemode==="area"?function(l){return Math.sqrt(l/i)}:function(l){return l/i};return function(l){var s=o(l/r);return fD(s)&&s>0?Math.max(s,n):0}},Ta={};(function(t){var e=we;t.getSubplot=function(l){return l.subplot||l.xaxis+l.yaxis||l.geo},t.isTraceInSubplots=function(l,s){if(l.type==="splom"){for(var f=l.xaxes||[],c=l.yaxes||[],u=0;u<f.length;u++)for(var v=0;v<c.length;v++)if(s.indexOf(f[u]+c[v])!==-1)return!0;return!1}return s.indexOf(t.getSubplot(l))!==-1},t.flat=function(l,s){for(var f=new Array(l.length),c=0;c<l.length;c++)f[c]=s;return f},t.p2c=function(l,s){for(var f=new Array(l.length),c=0;c<l.length;c++)f[c]=l[c].p2c(s);return f},t.getDistanceFunction=function(l,s,f,c){return l==="closest"?c||t.quadrature(s,f):l.charAt(0)==="x"?s:f},t.getClosest=function(l,s,f){if(f.index!==!1)f.index>=0&&f.index<l.length?f.distance=0:f.index=!1;else for(var c=1/0,u=l.length,v=0;v<u;v++)c=s(l[v]),c<=f.distance&&(f.index=v,f.distance=c);return f},t.inbox=function(l,s,f){return l*s<0||l===0?f:1/0},t.quadrature=function(l,s){return function(f){var c=l(f),u=s(f);return Math.sqrt(c*c+u*u)}},t.makeEventData=function(l,s,f){var c="index"in l?l.index:l.pointNumber,u={data:s._input,fullData:s,curveNumber:s.index,pointNumber:c};if(s._indexToPoints){var v=s._indexToPoints[c];v.length===1?u.pointIndex=v[0]:u.pointIndices=v}else u.pointIndex=c;return s._module.eventData?u=s._module.eventData(u,l,s,f,c):("xVal"in l?u.x=l.xVal:"x"in l&&(u.x=l.x),"yVal"in l?u.y=l.yVal:"y"in l&&(u.y=l.y),l.xa&&(u.xaxis=l.xa),l.ya&&(u.yaxis=l.ya),l.zLabelVal!==void 0&&(u.z=l.zLabelVal)),t.appendArrayPointValue(u,s,c),u},t.appendArrayPointValue=function(l,s,f){var c=s._arrayAttrs;if(c)for(var u=0;u<c.length;u++){var v=c[u],p=a(v);if(l[p]===void 0){var d=e.nestedProperty(s,v).get(),h=i(d,f);h!==void 0&&(l[p]=h)}}},t.appendArrayMultiPointValues=function(l,s,f){var c=s._arrayAttrs;if(c)for(var u=0;u<c.length;u++){var v=c[u],p=a(v);if(l[p]===void 0){for(var d=e.nestedProperty(s,v).get(),h=new Array(f.length),m=0;m<f.length;m++)h[m]=i(d,f[m]);l[p]=h}}};var r={ids:"id",locations:"location",labels:"label",values:"value","marker.colors":"color",parents:"parent"};function a(l){return r[l]||l}function i(l,s){if(Array.isArray(s)){if(Array.isArray(l)&&Array.isArray(l[s[0]]))return l[s[0]][s[1]]}else return l[s]}var n={x:!0,y:!0},o={"x unified":!0,"y unified":!0};t.isUnifiedHover=function(l){return typeof l!="string"?!1:!!o[l]},t.isXYhover=function(l){return typeof l!="string"?!1:!!n[l]}})(Ta);var Uu,Ty;function cD(){if(Ty)return Uu;Ty=1;var t=X1,e=function(d,h){return h?Math.round(d*(h=Math.pow(10,h)))/h:Math.round(d)},r="M0,0Z",a=Math.sqrt(2),i=Math.sqrt(3),n=Math.PI,o=Math.cos,l=Math.sin;Uu={circle:{n:0,f:function(d,h,m){if(s(h))return r;var y=e(d,2),b="M"+y+",0A"+y+","+y+" 0 1,1 0,-"+y+"A"+y+","+y+" 0 0,1 "+y+",0Z";return m?p(h,m,b):b}},square:{n:1,f:function(d,h,m){if(s(h))return r;var y=e(d,2);return p(h,m,"M"+y+","+y+"H-"+y+"V-"+y+"H"+y+"Z")}},diamond:{n:2,f:function(d,h,m){if(s(h))return r;var y=e(d*1.3,2);return p(h,m,"M"+y+",0L0,"+y+"L-"+y+",0L0,-"+y+"Z")}},cross:{n:3,f:function(d,h,m){if(s(h))return r;var y=e(d*.4,2),b=e(d*1.2,2);return p(h,m,"M"+b+","+y+"H"+y+"V"+b+"H-"+y+"V"+y+"H-"+b+"V-"+y+"H-"+y+"V-"+b+"H"+y+"V-"+y+"H"+b+"Z")}},x:{n:4,f:function(d,h,m){if(s(h))return r;var y=e(d*.8/a,2),b="l"+y+","+y,_="l"+y+",-"+y,g="l-"+y+",-"+y,x="l-"+y+","+y;return p(h,m,"M0,"+y+b+_+g+_+g+x+g+x+b+x+b+"Z")}},"triangle-up":{n:5,f:function(d,h,m){if(s(h))return r;var y=e(d*2/i,2),b=e(d/2,2),_=e(d,2);return p(h,m,"M-"+y+","+b+"H"+y+"L0,-"+_+"Z")}},"triangle-down":{n:6,f:function(d,h,m){if(s(h))return r;var y=e(d*2/i,2),b=e(d/2,2),_=e(d,2);return p(h,m,"M-"+y+",-"+b+"H"+y+"L0,"+_+"Z")}},"triangle-left":{n:7,f:function(d,h,m){if(s(h))return r;var y=e(d*2/i,2),b=e(d/2,2),_=e(d,2);return p(h,m,"M"+b+",-"+y+"V"+y+"L-"+_+",0Z")}},"triangle-right":{n:8,f:function(d,h,m){if(s(h))return r;var y=e(d*2/i,2),b=e(d/2,2),_=e(d,2);return p(h,m,"M-"+b+",-"+y+"V"+y+"L"+_+",0Z")}},"triangle-ne":{n:9,f:function(d,h,m){if(s(h))return r;var y=e(d*.6,2),b=e(d*1.2,2);return p(h,m,"M-"+b+",-"+y+"H"+y+"V"+b+"Z")}},"triangle-se":{n:10,f:function(d,h,m){if(s(h))return r;var y=e(d*.6,2),b=e(d*1.2,2);return p(h,m,"M"+y+",-"+b+"V"+y+"H-"+b+"Z")}},"triangle-sw":{n:11,f:function(d,h,m){if(s(h))return r;var y=e(d*.6,2),b=e(d*1.2,2);return p(h,m,"M"+b+","+y+"H-"+y+"V-"+b+"Z")}},"triangle-nw":{n:12,f:function(d,h,m){if(s(h))return r;var y=e(d*.6,2),b=e(d*1.2,2);return p(h,m,"M-"+y+","+b+"V-"+y+"H"+b+"Z")}},pentagon:{n:13,f:function(d,h,m){if(s(h))return r;var y=e(d*.951,2),b=e(d*.588,2),_=e(-d,2),g=e(d*-.309,2),x=e(d*.809,2);return p(h,m,"M"+y+","+g+"L"+b+","+x+"H-"+b+"L-"+y+","+g+"L0,"+_+"Z")}},hexagon:{n:14,f:function(d,h,m){if(s(h))return r;var y=e(d,2),b=e(d/2,2),_=e(d*i/2,2);return p(h,m,"M"+_+",-"+b+"V"+b+"L0,"+y+"L-"+_+","+b+"V-"+b+"L0,-"+y+"Z")}},hexagon2:{n:15,f:function(d,h,m){if(s(h))return r;var y=e(d,2),b=e(d/2,2),_=e(d*i/2,2);return p(h,m,"M-"+b+","+_+"H"+b+"L"+y+",0L"+b+",-"+_+"H-"+b+"L-"+y+",0Z")}},octagon:{n:16,f:function(d,h,m){if(s(h))return r;var y=e(d*.924,2),b=e(d*.383,2);return p(h,m,"M-"+b+",-"+y+"H"+b+"L"+y+",-"+b+"V"+b+"L"+b+","+y+"H-"+b+"L-"+y+","+b+"V-"+b+"Z")}},star:{n:17,f:function(d,h,m){if(s(h))return r;var y=d*1.4,b=e(y*.225,2),_=e(y*.951,2),g=e(y*.363,2),x=e(y*.588,2),w=e(-y,2),T=e(y*-.309,2),A=e(y*.118,2),M=e(y*.809,2),S=e(y*.382,2);return p(h,m,"M"+b+","+T+"H"+_+"L"+g+","+A+"L"+x+","+M+"L0,"+S+"L-"+x+","+M+"L-"+g+","+A+"L-"+_+","+T+"H-"+b+"L0,"+w+"Z")}},hexagram:{n:18,f:function(d,h,m){if(s(h))return r;var y=e(d*.66,2),b=e(d*.38,2),_=e(d*.76,2);return p(h,m,"M-"+_+",0l-"+b+",-"+y+"h"+_+"l"+b+",-"+y+"l"+b+","+y+"h"+_+"l-"+b+","+y+"l"+b+","+y+"h-"+_+"l-"+b+","+y+"l-"+b+",-"+y+"h-"+_+"Z")}},"star-triangle-up":{n:19,f:function(d,h,m){if(s(h))return r;var y=e(d*i*.8,2),b=e(d*.8,2),_=e(d*1.6,2),g=e(d*4,2),x="A "+g+","+g+" 0 0 1 ";return p(h,m,"M-"+y+","+b+x+y+","+b+x+"0,-"+_+x+"-"+y+","+b+"Z")}},"star-triangle-down":{n:20,f:function(d,h,m){if(s(h))return r;var y=e(d*i*.8,2),b=e(d*.8,2),_=e(d*1.6,2),g=e(d*4,2),x="A "+g+","+g+" 0 0 1 ";return p(h,m,"M"+y+",-"+b+x+"-"+y+",-"+b+x+"0,"+_+x+y+",-"+b+"Z")}},"star-square":{n:21,f:function(d,h,m){if(s(h))return r;var y=e(d*1.1,2),b=e(d*2,2),_="A "+b+","+b+" 0 0 1 ";return p(h,m,"M-"+y+",-"+y+_+"-"+y+","+y+_+y+","+y+_+y+",-"+y+_+"-"+y+",-"+y+"Z")}},"star-diamond":{n:22,f:function(d,h,m){if(s(h))return r;var y=e(d*1.4,2),b=e(d*1.9,2),_="A "+b+","+b+" 0 0 1 ";return p(h,m,"M-"+y+",0"+_+"0,"+y+_+y+",0"+_+"0,-"+y+_+"-"+y+",0Z")}},"diamond-tall":{n:23,f:function(d,h,m){if(s(h))return r;var y=e(d*.7,2),b=e(d*1.4,2);return p(h,m,"M0,"+b+"L"+y+",0L0,-"+b+"L-"+y+",0Z")}},"diamond-wide":{n:24,f:function(d,h,m){if(s(h))return r;var y=e(d*1.4,2),b=e(d*.7,2);return p(h,m,"M0,"+b+"L"+y+",0L0,-"+b+"L-"+y+",0Z")}},hourglass:{n:25,f:function(d,h,m){if(s(h))return r;var y=e(d,2);return p(h,m,"M"+y+","+y+"H-"+y+"L"+y+",-"+y+"H-"+y+"Z")},noDot:!0},bowtie:{n:26,f:function(d,h,m){if(s(h))return r;var y=e(d,2);return p(h,m,"M"+y+","+y+"V-"+y+"L-"+y+","+y+"V-"+y+"Z")},noDot:!0},"circle-cross":{n:27,f:function(d,h,m){if(s(h))return r;var y=e(d,2);return p(h,m,"M0,"+y+"V-"+y+"M"+y+",0H-"+y+"M"+y+",0A"+y+","+y+" 0 1,1 0,-"+y+"A"+y+","+y+" 0 0,1 "+y+",0Z")},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(d,h,m){if(s(h))return r;var y=e(d,2),b=e(d/a,2);return p(h,m,"M"+b+","+b+"L-"+b+",-"+b+"M"+b+",-"+b+"L-"+b+","+b+"M"+y+",0A"+y+","+y+" 0 1,1 0,-"+y+"A"+y+","+y+" 0 0,1 "+y+",0Z")},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(d,h,m){if(s(h))return r;var y=e(d,2);return p(h,m,"M0,"+y+"V-"+y+"M"+y+",0H-"+y+"M"+y+","+y+"H-"+y+"V-"+y+"H"+y+"Z")},needLine:!0,noDot:!0},"square-x":{n:30,f:function(d,h,m){if(s(h))return r;var y=e(d,2);return p(h,m,"M"+y+","+y+"L-"+y+",-"+y+"M"+y+",-"+y+"L-"+y+","+y+"M"+y+","+y+"H-"+y+"V-"+y+"H"+y+"Z")},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(d,h,m){if(s(h))return r;var y=e(d*1.3,2);return p(h,m,"M"+y+",0L0,"+y+"L-"+y+",0L0,-"+y+"ZM0,-"+y+"V"+y+"M-"+y+",0H"+y)},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(d,h,m){if(s(h))return r;var y=e(d*1.3,2),b=e(d*.65,2);return p(h,m,"M"+y+",0L0,"+y+"L-"+y+",0L0,-"+y+"ZM-"+b+",-"+b+"L"+b+","+b+"M-"+b+","+b+"L"+b+",-"+b)},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(d,h,m){if(s(h))return r;var y=e(d*1.4,2);return p(h,m,"M0,"+y+"V-"+y+"M"+y+",0H-"+y)},needLine:!0,noDot:!0,noFill:!0},"x-thin":{n:34,f:function(d,h,m){if(s(h))return r;var y=e(d,2);return p(h,m,"M"+y+","+y+"L-"+y+",-"+y+"M"+y+",-"+y+"L-"+y+","+y)},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(d,h,m){if(s(h))return r;var y=e(d*1.2,2),b=e(d*.85,2);return p(h,m,"M0,"+y+"V-"+y+"M"+y+",0H-"+y+"M"+b+","+b+"L-"+b+",-"+b+"M"+b+",-"+b+"L-"+b+","+b)},needLine:!0,noDot:!0,noFill:!0},hash:{n:36,f:function(d,h,m){if(s(h))return r;var y=e(d/2,2),b=e(d,2);return p(h,m,"M"+y+","+b+"V-"+b+"M"+(y-b)+",-"+b+"V"+b+"M"+b+","+y+"H-"+b+"M-"+b+","+(y-b)+"H"+b)},needLine:!0,noFill:!0},"y-up":{n:37,f:function(d,h,m){if(s(h))return r;var y=e(d*1.2,2),b=e(d*1.6,2),_=e(d*.8,2);return p(h,m,"M-"+y+","+_+"L0,0M"+y+","+_+"L0,0M0,-"+b+"L0,0")},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(d,h,m){if(s(h))return r;var y=e(d*1.2,2),b=e(d*1.6,2),_=e(d*.8,2);return p(h,m,"M-"+y+",-"+_+"L0,0M"+y+",-"+_+"L0,0M0,"+b+"L0,0")},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(d,h,m){if(s(h))return r;var y=e(d*1.2,2),b=e(d*1.6,2),_=e(d*.8,2);return p(h,m,"M"+_+","+y+"L0,0M"+_+",-"+y+"L0,0M-"+b+",0L0,0")},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(d,h,m){if(s(h))return r;var y=e(d*1.2,2),b=e(d*1.6,2),_=e(d*.8,2);return p(h,m,"M-"+_+","+y+"L0,0M-"+_+",-"+y+"L0,0M"+b+",0L0,0")},needLine:!0,noDot:!0,noFill:!0},"line-ew":{n:41,f:function(d,h,m){if(s(h))return r;var y=e(d*1.4,2);return p(h,m,"M"+y+",0H-"+y)},needLine:!0,noDot:!0,noFill:!0},"line-ns":{n:42,f:function(d,h,m){if(s(h))return r;var y=e(d*1.4,2);return p(h,m,"M0,"+y+"V-"+y)},needLine:!0,noDot:!0,noFill:!0},"line-ne":{n:43,f:function(d,h,m){if(s(h))return r;var y=e(d,2);return p(h,m,"M"+y+",-"+y+"L-"+y+","+y)},needLine:!0,noDot:!0,noFill:!0},"line-nw":{n:44,f:function(d,h,m){if(s(h))return r;var y=e(d,2);return p(h,m,"M"+y+","+y+"L-"+y+",-"+y)},needLine:!0,noDot:!0,noFill:!0},"arrow-up":{n:45,f:function(d,h,m){if(s(h))return r;var y=e(d,2),b=e(d*2,2);return p(h,m,"M0,0L-"+y+","+b+"H"+y+"Z")},backoff:1,noDot:!0},"arrow-down":{n:46,f:function(d,h,m){if(s(h))return r;var y=e(d,2),b=e(d*2,2);return p(h,m,"M0,0L-"+y+",-"+b+"H"+y+"Z")},noDot:!0},"arrow-left":{n:47,f:function(d,h,m){if(s(h))return r;var y=e(d*2,2),b=e(d,2);return p(h,m,"M0,0L"+y+",-"+b+"V"+b+"Z")},noDot:!0},"arrow-right":{n:48,f:function(d,h,m){if(s(h))return r;var y=e(d*2,2),b=e(d,2);return p(h,m,"M0,0L-"+y+",-"+b+"V"+b+"Z")},noDot:!0},"arrow-bar-up":{n:49,f:function(d,h,m){if(s(h))return r;var y=e(d,2),b=e(d*2,2);return p(h,m,"M-"+y+",0H"+y+"M0,0L-"+y+","+b+"H"+y+"Z")},backoff:1,needLine:!0,noDot:!0},"arrow-bar-down":{n:50,f:function(d,h,m){if(s(h))return r;var y=e(d,2),b=e(d*2,2);return p(h,m,"M-"+y+",0H"+y+"M0,0L-"+y+",-"+b+"H"+y+"Z")},needLine:!0,noDot:!0},"arrow-bar-left":{n:51,f:function(d,h,m){if(s(h))return r;var y=e(d*2,2),b=e(d,2);return p(h,m,"M0,-"+b+"V"+b+"M0,0L"+y+",-"+b+"V"+b+"Z")},needLine:!0,noDot:!0},"arrow-bar-right":{n:52,f:function(d,h,m){if(s(h))return r;var y=e(d*2,2),b=e(d,2);return p(h,m,"M0,-"+b+"V"+b+"M0,0L-"+y+",-"+b+"V"+b+"Z")},needLine:!0,noDot:!0},arrow:{n:53,f:function(d,h,m){if(s(h))return r;var y=n/2.5,b=2*d*o(y),_=2*d*l(y);return p(h,m,"M0,0L"+-b+","+_+"L"+b+","+_+"Z")},backoff:.9,noDot:!0},"arrow-wide":{n:54,f:function(d,h,m){if(s(h))return r;var y=n/4,b=2*d*o(y),_=2*d*l(y);return p(h,m,"M0,0L"+-b+","+_+"A "+2*d+","+2*d+" 0 0 1 "+b+","+_+"Z")},backoff:.4,noDot:!0}};function s(d){return d===null}var f,c,u,v;function p(d,h,m){if((!d||d%360===0)&&!h)return m;if(u===d&&v===h&&f===m)return c;u=d,v=h,f=m;function y(N,z){var H=o(N),D=l(N),P=z[0],k=z[1]+(h||0);return[P*H-k*D,P*D+k*H]}for(var b=d/180*n,_=0,g=0,x=t(m),w="",T=0;T<x.length;T++){var A=x[T],M=A[0],S=_,L=g;if(M==="M"||M==="L")_=+A[1],g=+A[2];else if(M==="m"||M==="l")_+=+A[1],g+=+A[2];else if(M==="H")_=+A[1];else if(M==="h")_+=+A[1];else if(M==="V")g=+A[1];else if(M==="v")g+=+A[1];else if(M==="A"){_=+A[1],g=+A[2];var E=y(b,[+A[6],+A[7]]);A[6]=E[0],A[7]=E[1],A[3]=+A[3]+d}(M==="H"||M==="V")&&(M="L"),(M==="h"||M==="v")&&(M="l"),(M==="m"||M==="l")&&(_-=S,g-=L);var F=y(b,[_,g]);(M==="H"||M==="V")&&(M="L"),(M==="M"||M==="L"||M==="m"||M==="l")&&(A[1]=F[0],A[2]=F[1]),A[0]=M,w+=A[0]+A.slice(1).join(",")}return c=w,w}return Uu}var wr=bt,Nt=we,uD=Nt.numberFormat,Tn=kt,jd=_a,Kc=ot,Dr=yt,vD=Co,Vl=Nt.strTranslate,Qc=Tr,dD=Yo,hD=Vr,pD=hD.LINE_SPACING,Cw=hs.DESELECTDIM,mD=jr,yD=Lw,gD=Ta.appendArrayPointValue,Be=fw.exports={};Be.font=function(t,e){var r=e.variant,a=e.style,i=e.weight,n=e.color,o=e.size,l=e.family,s=e.shadow,f=e.lineposition,c=e.textcase;l&&t.style("font-family",l),o+1&&t.style("font-size",o+"px"),n&&t.call(Dr.fill,n),i&&t.style("font-weight",i),a&&t.style("font-style",a),r&&t.style("font-variant",r),c&&t.style("text-transform",Vu(xD(c))),s&&t.style("text-shadow",s==="auto"?Qc.makeTextShadow(Dr.contrast(n)):Vu(s)),f&&t.style("text-decoration-line",Vu(_D(f)))};function Vu(t){return t==="none"?void 0:t}var bD={normal:"none",lower:"lowercase",upper:"uppercase","word caps":"capitalize"};function xD(t){return bD[t]}function _D(t){return t.replace("under","underline").replace("over","overline").replace("through","line-through").split("+").join(" ")}Be.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)};Be.setSize=function(t,e,r){t.attr("width",e).attr("height",r)};Be.setRect=function(t,e,r,a,i){t.call(Be.setPosition,e,r).call(Be.setSize,a,i)};Be.translatePoint=function(t,e,r,a){var i=r.c2p(t.x),n=a.c2p(t.y);if(Tn(i)&&Tn(n)&&e.node())e.node().nodeName==="text"?e.attr("x",i).attr("y",n):e.attr("transform",Vl(i,n));else return!1;return!0};Be.translatePoints=function(t,e,r){t.each(function(a){var i=wr.select(this);Be.translatePoint(a,i,e,r)})};Be.hideOutsideRangePoint=function(t,e,r,a,i,n){e.attr("display",r.isPtWithinRange(t,i)&&a.isPtWithinRange(t,n)?null:"none")};Be.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,a=e.yaxis;t.each(function(i){var n=i[0].trace,o=n.xcalendar,l=n.ycalendar,s=Kc.traceIs(n,"bar-like")?".bartext":".point,.textpoint";t.selectAll(s).each(function(f){Be.hideOutsideRangePoint(f,wr.select(this),r,a,o,l)})})}};Be.crispRound=function(t,e,r){return!e||!Tn(e)?r||0:t._context.staticPlot?e:e<1?1:Math.round(e)};Be.singleLineStyle=function(t,e,r,a,i){e.style("fill","none");var n=(((t||[])[0]||{}).trace||{}).line||{},o=r||n.width||0,l=i||n.dash||"";Dr.stroke(e,a||n.color),Be.dashLine(e,l,o)};Be.lineGroupStyle=function(t,e,r,a){t.style("fill","none").each(function(i){var n=(((i||[])[0]||{}).trace||{}).line||{},o=e||n.width||0,l=a||n.dash||"";wr.select(this).call(Dr.stroke,r||n.color).call(Be.dashLine,l,o)})};Be.dashLine=function(t,e,r){r=+r||0,e=Be.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})};Be.dashStyle=function(t,e){e=+e||1;var r=Math.max(e,3);return t==="solid"?t="":t==="dot"?t=r+"px,"+r+"px":t==="dash"?t=3*r+"px,"+3*r+"px":t==="longdash"?t=5*r+"px,"+5*r+"px":t==="dashdot"?t=3*r+"px,"+r+"px,"+r+"px,"+r+"px":t==="longdashdot"&&(t=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),t};function Dw(t,e,r,a){var i=e.fillpattern,n=e.fillgradient,o=Be.getPatternAttr,l=i&&(o(i.shape,0,"")||o(i.path,0,""));if(l){var s=o(i.bgcolor,0,null),f=o(i.fgcolor,0,null),c=i.fgopacity,u=o(i.size,0,8),v=o(i.solidity,0,.3),p=e.uid;Be.pattern(t,"point",r,p,l,u,v,void 0,i.fillmode,s,f,c)}else if(n&&n.type!=="none"){var d=n.type,h="scatterfill-"+e.uid;if(a&&(h="legendfill-"+e.uid),!a&&(n.start!==void 0||n.stop!==void 0)){var m,y;d==="horizontal"?(m={x:n.start,y:0},y={x:n.stop,y:0}):d==="vertical"&&(m={x:0,y:n.start},y={x:0,y:n.stop}),m.x=e._xA.c2p(m.x===void 0?e._extremes.x.min[0].val:m.x,!0),m.y=e._yA.c2p(m.y===void 0?e._extremes.y.min[0].val:m.y,!0),y.x=e._xA.c2p(y.x===void 0?e._extremes.x.max[0].val:y.x,!0),y.y=e._yA.c2p(y.y===void 0?e._extremes.y.max[0].val:y.y,!0),t.call(Ew,r,h,"linear",n.colorscale,"fill",m,y,!0,!1)}else d==="horizontal"&&(d=d+"reversed"),t.call(Be.gradient,r,h,d,n.colorscale,"fill")}else e.fillcolor&&t.call(Dr.fill,e.fillcolor)}Be.singleFillStyle=function(t,e){var r=wr.select(t.node()),a=r.data(),i=((a[0]||[])[0]||{}).trace||{};Dw(t,i,e,!1)};Be.fillGroupStyle=function(t,e,r){t.style("stroke-width",0).each(function(a){var i=wr.select(this);a[0].trace&&Dw(i,a[0].trace,e,r)})};var ky=cD();Be.symbolNames=[];Be.symbolFuncs=[];Be.symbolBackOffs=[];Be.symbolNeedLines={};Be.symbolNoDot={};Be.symbolNoFill={};Be.symbolList=[];Object.keys(ky).forEach(function(t){var e=ky[t],r=e.n;Be.symbolList.push(r,String(r),t,r+100,String(r+100),t+"-open"),Be.symbolNames[r]=t,Be.symbolFuncs[r]=e.f,Be.symbolBackOffs[r]=e.backoff||0,e.needLine&&(Be.symbolNeedLines[r]=!0),e.noDot?Be.symbolNoDot[r]=!0:Be.symbolList.push(r+200,String(r+200),t+"-dot",r+300,String(r+300),t+"-open-dot"),e.noFill&&(Be.symbolNoFill[r]=!0)});var wD=Be.symbolNames.length,TD="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";Be.symbolNumber=function(t){if(Tn(t))t=+t;else if(typeof t=="string"){var e=0;t.indexOf("-open")>0&&(e=100,t=t.replace("-open","")),t.indexOf("-dot")>0&&(e+=200,t=t.replace("-dot","")),t=Be.symbolNames.indexOf(t),t>=0&&(t+=e)}return t%100>=wD||t>=400?0:Math.floor(Math.max(t,0))};function Pw(t,e,r,a){var i=t%100;return Be.symbolFuncs[i](e,r,a)+(t>=200?TD:"")}var Ay=uD("~f"),$w={radial:{type:"radial"},radialreversed:{type:"radial",reversed:!0},horizontal:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0}},horizontalreversed:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0},reversed:!0},vertical:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0}},verticalreversed:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0},reversed:!0}};Be.gradient=function(t,e,r,a,i,n){var o=$w[a];return Ew(t,e,r,o.type,i,n,o.start,o.stop,!1,o.reversed)};function Ew(t,e,r,a,i,n,o,l,s,f){var c=i.length,u;a==="linear"?u={node:"linearGradient",attrs:{x1:o.x,y1:o.y,x2:l.x,y2:l.y,gradientUnits:s?"userSpaceOnUse":"objectBoundingBox"},reversed:f}:a==="radial"&&(u={node:"radialGradient",reversed:f});for(var v=new Array(c),p=0;p<c;p++)u.reversed?v[c-1-p]=[Ay((1-i[p][0])*100),i[p][1]]:v[p]=[Ay(i[p][0]*100),i[p][1]];var d=e._fullLayout,h="g"+d._uid+"-"+r,m=d._defs.select(".gradients").selectAll("#"+h).data([a+v.join(";")],Nt.identity);m.exit().remove(),m.enter().append(u.node).each(function(){var y=wr.select(this);u.attrs&&y.attr(u.attrs),y.attr("id",h);var b=y.selectAll("stop").data(v);b.exit().remove(),b.enter().append("stop"),b.each(function(_){var g=jd(_[1]);wr.select(this).attr({offset:_[0]+"%","stop-color":Dr.tinyRGB(g),"stop-opacity":g.getAlpha()})})}),t.style(n,lp(h,e)).style(n+"-opacity",null),t.classed("gradient_filled",!0)}Be.pattern=function(t,e,r,a,i,n,o,l,s,f,c,u){var v=e==="legend";l&&(s==="overlay"?(f=l,c=Dr.contrast(f)):(f=void 0,c=l));var p=r._fullLayout,d="p"+p._uid+"-"+a,h,m,y=function(F,N,z,H,D){return H+(D-H)*(F-N)/(z-N)},b,_,g,x,w={},T=jd(c),A=Dr.tinyRGB(T),M=T.getAlpha(),S=u*M;switch(i){case"/":h=n*Math.sqrt(2),m=n*Math.sqrt(2),b="M-"+h/4+","+m/4+"l"+h/2+",-"+m/2+"M0,"+m+"L"+h+",0M"+h/4*3+","+m/4*5+"l"+h/2+",-"+m/2,_=o*n,x="path",w={d:b,opacity:S,stroke:A,"stroke-width":_+"px"};break;case"\\":h=n*Math.sqrt(2),m=n*Math.sqrt(2),b="M"+h/4*3+",-"+m/4+"l"+h/2+","+m/2+"M0,0L"+h+","+m+"M-"+h/4+","+m/4*3+"l"+h/2+","+m/2,_=o*n,x="path",w={d:b,opacity:S,stroke:A,"stroke-width":_+"px"};break;case"x":h=n*Math.sqrt(2),m=n*Math.sqrt(2),b="M-"+h/4+","+m/4+"l"+h/2+",-"+m/2+"M0,"+m+"L"+h+",0M"+h/4*3+","+m/4*5+"l"+h/2+",-"+m/2+"M"+h/4*3+",-"+m/4+"l"+h/2+","+m/2+"M0,0L"+h+","+m+"M-"+h/4+","+m/4*3+"l"+h/2+","+m/2,_=n-n*Math.sqrt(1-o),x="path",w={d:b,opacity:S,stroke:A,"stroke-width":_+"px"};break;case"|":h=n,m=n,x="path",b="M"+h/2+",0L"+h/2+","+m,_=o*n,x="path",w={d:b,opacity:S,stroke:A,"stroke-width":_+"px"};break;case"-":h=n,m=n,x="path",b="M0,"+m/2+"L"+h+","+m/2,_=o*n,x="path",w={d:b,opacity:S,stroke:A,"stroke-width":_+"px"};break;case"+":h=n,m=n,x="path",b="M"+h/2+",0L"+h/2+","+m+"M0,"+m/2+"L"+h+","+m/2,_=n-n*Math.sqrt(1-o),x="path",w={d:b,opacity:S,stroke:A,"stroke-width":_+"px"};break;case".":h=n,m=n,o<Math.PI/4?g=Math.sqrt(o*n*n/Math.PI):g=y(o,Math.PI/4,1,n/2,n/Math.sqrt(2)),x="circle",w={cx:h/2,cy:m/2,r:g,opacity:S,fill:A};break;default:h=n,m=n,x="path",w={d:i,opacity:S,fill:A};break}var L=[i||"noSh",f||"noBg",c||"noFg",n,o].join(";"),E=p._defs.select(".patterns").selectAll("#"+d).data([L],Nt.identity);E.exit().remove(),E.enter().append("pattern").each(function(){var F=wr.select(this);if(F.attr({id:d,width:h+"px",height:m+"px",patternUnits:"userSpaceOnUse",patternTransform:v?"scale(0.8)":""}),f){var N=jd(f),z=Dr.tinyRGB(N),H=N.getAlpha(),D=F.selectAll("rect").data([0]);D.exit().remove(),D.enter().append("rect").attr({width:h+"px",height:m+"px",fill:z,"fill-opacity":H})}var P=F.selectAll(x).data([0]);P.exit().remove(),P.enter().append(x).attr(w)}),t.style("fill",lp(d,r)).style("fill-opacity",null),t.classed("pattern_filled",!0)};Be.initGradients=function(t){var e=t._fullLayout,r=Nt.ensureSingle(e._defs,"g","gradients");r.selectAll("linearGradient,radialGradient").remove(),wr.select(t).selectAll(".gradient_filled").classed("gradient_filled",!1)};Be.initPatterns=function(t){var e=t._fullLayout,r=Nt.ensureSingle(e._defs,"g","patterns");r.selectAll("pattern").remove(),wr.select(t).selectAll(".pattern_filled").classed("pattern_filled",!1)};Be.getPatternAttr=function(t,e,r){return t&&Nt.isArrayOrTypedArray(t)?e<t.length?t[e]:r:t};Be.pointStyle=function(t,e,r,a){if(t.size()){var i=Be.makePointStyleFns(e);t.each(function(n){Be.singlePointStyle(n,wr.select(this),e,i,r,a)})}};Be.singlePointStyle=function(t,e,r,a,i,n){var o=r.marker,l=o.line;if(n&&n.i>=0&&t.i===void 0&&(t.i=n.i),e.style("opacity",a.selectedOpacityFn?a.selectedOpacityFn(t):t.mo===void 0?o.opacity:t.mo),a.ms2mrc){var s;t.ms==="various"||o.size==="various"?s=3:s=a.ms2mrc(t.ms),t.mrc=s,a.selectedSizeFn&&(s=t.mrc=a.selectedSizeFn(t));var f=Be.symbolNumber(t.mx||o.symbol)||0;t.om=f%200>=100;var c=fp(t,r),u=sp(t,r);e.attr("d",Pw(f,s,c,u))}var v=!1,p,d,h;if(t.so)h=l.outlierwidth,d=l.outliercolor,p=o.outliercolor;else{var m=(l||{}).width;h=(t.mlw+1||m+1||(t.trace?(t.trace.marker.line||{}).width:0)+1)-1||0,"mlc"in t?d=t.mlcc=a.lineScale(t.mlc):Nt.isArrayOrTypedArray(l.color)?d=Dr.defaultLine:d=l.color,Nt.isArrayOrTypedArray(o.color)&&(p=Dr.defaultLine,v=!0),"mc"in t?p=t.mcc=a.markerScale(t.mc):p=o.color||o.colors||"rgba(0,0,0,0)",a.selectedColorFn&&(p=a.selectedColorFn(t))}if(t.om)e.call(Dr.stroke,p).style({"stroke-width":(h||1)+"px",fill:"none"});else{e.style("stroke-width",(t.isBlank?0:h)+"px");var y=o.gradient,b=t.mgt;b?v=!0:b=y&&y.type,Nt.isArrayOrTypedArray(b)&&(b=b[0],$w[b]||(b=0));var _=o.pattern,g=Be.getPatternAttr,x=_&&(g(_.shape,t.i,"")||g(_.path,t.i,""));if(b&&b!=="none"){var w=t.mgc;w?v=!0:w=y.color;var T=r.uid;v&&(T+="-"+t.i),Be.gradient(e,i,T,b,[[0,w],[1,p]],"fill")}else if(x){var A=!1,M=_.fgcolor;!M&&n&&n.color&&(M=n.color,A=!0);var S=g(M,t.i,n&&n.color||null),L=g(_.bgcolor,t.i,null),E=_.fgopacity,F=g(_.size,t.i,8),N=g(_.solidity,t.i,.3);A=A||t.mcc||Nt.isArrayOrTypedArray(_.shape)||Nt.isArrayOrTypedArray(_.path)||Nt.isArrayOrTypedArray(_.bgcolor)||Nt.isArrayOrTypedArray(_.fgcolor)||Nt.isArrayOrTypedArray(_.size)||Nt.isArrayOrTypedArray(_.solidity);var z=r.uid;A&&(z+="-"+t.i),Be.pattern(e,"point",i,z,x,F,N,t.mcc,_.fillmode,L,S,E)}else Nt.isArrayOrTypedArray(p)?Dr.fill(e,p[t.i]):Dr.fill(e,p);h&&Dr.stroke(e,d)}};Be.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=Be.tryColorscale(r,""),e.lineScale=Be.tryColorscale(r,"line"),Kc.traceIs(t,"symbols")&&(e.ms2mrc=mD.isBubble(t)?yD(t):function(){return(r.size||6)/2}),t.selectedpoints&&Nt.extendFlat(e,Be.makeSelectedPointStyleFns(t)),e};Be.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},a=t.unselected||{},i=t.marker||{},n=r.marker||{},o=a.marker||{},l=i.opacity,s=n.opacity,f=o.opacity,c=s!==void 0,u=f!==void 0;(Nt.isArrayOrTypedArray(l)||c||u)&&(e.selectedOpacityFn=function(g){var x=g.mo===void 0?i.opacity:g.mo;return g.selected?c?s:x:u?f:Cw*x});var v=i.color,p=n.color,d=o.color;(p||d)&&(e.selectedColorFn=function(g){var x=g.mcc||v;return g.selected?p||x:d||x});var h=i.size,m=n.size,y=o.size,b=m!==void 0,_=y!==void 0;return Kc.traceIs(t,"symbols")&&(b||_)&&(e.selectedSizeFn=function(g){var x=g.mrc||h/2;return g.selected?b?m/2:x:_?y/2:x}),e};Be.makeSelectedTextStyleFns=function(t){var e={},r=t.selected||{},a=t.unselected||{},i=t.textfont||{},n=r.textfont||{},o=a.textfont||{},l=i.color,s=n.color,f=o.color;return e.selectedTextColorFn=function(c){var u=c.tc||l;return c.selected?s||u:f||(s?u:Dr.addOpacity(u,Cw))},e};Be.selectedPointStyle=function(t,e){if(!(!t.size()||!e.selectedpoints)){var r=Be.makeSelectedPointStyleFns(e),a=e.marker||{},i=[];r.selectedOpacityFn&&i.push(function(n,o){n.style("opacity",r.selectedOpacityFn(o))}),r.selectedColorFn&&i.push(function(n,o){Dr.fill(n,r.selectedColorFn(o))}),r.selectedSizeFn&&i.push(function(n,o){var l=o.mx||a.symbol||0,s=r.selectedSizeFn(o);n.attr("d",Pw(Be.symbolNumber(l),s,fp(o,e),sp(o,e))),o.mrc2=s}),i.length&&t.each(function(n){for(var o=wr.select(this),l=0;l<i.length;l++)i[l](o,n)})}};Be.tryColorscale=function(t,e){var r=e?Nt.nestedProperty(t,e).get():t;if(r){var a=r.color;if((r.colorscale||r._colorAx)&&Nt.isArrayOrTypedArray(a))return vD.makeColorScaleFuncFromTrace(r)}return Nt.identity};var Wu={start:1,end:-1,middle:0,bottom:1,top:-1};function zw(t,e,r,a,i){var n=wr.select(t.node().parentNode),o=e.indexOf("top")!==-1?"top":e.indexOf("bottom")!==-1?"bottom":"middle",l=e.indexOf("left")!==-1?"end":e.indexOf("right")!==-1?"start":"middle",s=a?a/.8+1:0,f=(Qc.lineCount(t)-1)*pD+1,c=Wu[l]*s,u=r*.75+Wu[o]*s+(Wu[o]-1)*f*r/2;t.attr("text-anchor",l),i||n.attr("transform",Vl(c,u))}function Rw(t,e){var r=t.ts||e.textfont.size;return Tn(r)&&r>0?r:0}Be.textPointStyle=function(t,e,r){if(t.size()){var a;if(e.selectedpoints){var i=Be.makeSelectedTextStyleFns(e);a=i.selectedTextColorFn}var n=e.texttemplate,o=r._fullLayout;t.each(function(l){var s=wr.select(this),f=n?Nt.extractOption(l,e,"txt","texttemplate"):Nt.extractOption(l,e,"tx","text");if(!f&&f!==0){s.remove();return}if(n){var c=e._module.formatLabels,u=c?c(l,e,o):{},v={};gD(v,e,l.i);var p=e._meta||{};f=Nt.texttemplateString(f,u,o._d3locale,v,l,p)}var d=l.tp||e.textposition,h=Rw(l,e),m=a?a(l):l.tc||e.textfont.color;s.call(Be.font,{family:l.tf||e.textfont.family,weight:l.tw||e.textfont.weight,style:l.ty||e.textfont.style,variant:l.tv||e.textfont.variant,textcase:l.tC||e.textfont.textcase,lineposition:l.tE||e.textfont.lineposition,shadow:l.tS||e.textfont.shadow,size:h,color:m}).text(f).call(Qc.convertToTspans,r).call(zw,d,h,l.mrc)})}};Be.selectedTextStyle=function(t,e){if(!(!t.size()||!e.selectedpoints)){var r=Be.makeSelectedTextStyleFns(e);t.each(function(a){var i=wr.select(this),n=r.selectedTextColorFn(a),o=a.tp||e.textposition,l=Rw(a,e);Dr.fill(i,n);var s=Kc.traceIs(e,"bar-like");zw(i,o,l,a.mrc2||a.mrc,s)})}};var My=.5;Be.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r="M"+t[0],a=[],i;for(i=1;i<t.length-1;i++)a.push(Rf(t[i-1],t[i],t[i+1],e));for(r+="Q"+a[0][0]+" "+t[1],i=2;i<t.length-1;i++)r+="C"+a[i-2][1]+" "+a[i-1][0]+" "+t[i];return r+="Q"+a[t.length-3][1]+" "+t[t.length-1],r};Be.smoothclosed=function(t,e){if(t.length<3)return"M"+t.join("L")+"Z";var r="M"+t[0],a=t.length-1,i=[Rf(t[a],t[0],t[1],e)],n;for(n=1;n<a;n++)i.push(Rf(t[n-1],t[n],t[n+1],e));for(i.push(Rf(t[a-1],t[a],t[0],e)),n=1;n<=a;n++)r+="C"+i[n-1][1]+" "+i[n][0]+" "+t[n];return r+="C"+i[a][1]+" "+i[0][0]+" "+t[0]+"Z",r};var Iw,Fw;function ho(t,e,r){return r&&(t=Nw(t)),e?yn(t[1]):mn(t[0])}function mn(t){var e=wr.round(t,2);return Iw=e,e}function yn(t){var e=wr.round(t,2);return Fw=e,e}function Rf(t,e,r,a){var i=t[0]-e[0],n=t[1]-e[1],o=r[0]-e[0],l=r[1]-e[1],s=Math.pow(i*i+n*n,My/2),f=Math.pow(o*o+l*l,My/2),c=(f*f*i-s*s*o)*a,u=(f*f*n-s*s*l)*a,v=3*f*(s+f),p=3*s*(s+f);return[[mn(e[0]+(v&&c/v)),yn(e[1]+(v&&u/v))],[mn(e[0]-(p&&c/p)),yn(e[1]-(p&&u/p))]]}var kD={hv:function(t,e,r){return"H"+mn(e[0])+"V"+ho(e,1,r)},vh:function(t,e,r){return"V"+yn(e[1])+"H"+ho(e,0,r)},hvh:function(t,e,r){return"H"+mn((t[0]+e[0])/2)+"V"+yn(e[1])+"H"+ho(e,0,r)},vhv:function(t,e,r){return"V"+yn((t[1]+e[1])/2)+"H"+mn(e[0])+"V"+ho(e,1,r)}},AD=function(t,e,r){return"L"+ho(e,0,r)+","+ho(e,1,r)};Be.steps=function(t){var e=kD[t]||AD;return function(r){for(var a="M"+mn(r[0][0])+","+yn(r[0][1]),i=r.length,n=1;n<i;n++)a+=e(r[n-1],r[n],n===i-1);return a}};function Nw(t,e){var r=t.backoff,a=t.trace,i=t.d,n=t.i;if(r&&a&&a.marker&&a.marker.angle%360===0&&a.line&&a.line.shape!=="spline"){var o=Nt.isArrayOrTypedArray(r),l=t,s=e?e[0]:Iw||0,f=e?e[1]:Fw||0,c=l[0],u=l[1],v=c-s,p=u-f,d=Math.atan2(p,v),h=o?r[n]:r;if(h==="auto"){var m=l.i;a.type==="scatter"&&m--;var y=l.marker,b=y.symbol;Nt.isArrayOrTypedArray(b)&&(b=b[m]);var _=y.size;Nt.isArrayOrTypedArray(_)&&(_=_[m]),h=y?Be.symbolBackOffs[Be.symbolNumber(b)]*_:0,h+=Be.getMarkerStandoff(i[m],a)||0}var g=c-h*Math.cos(d),x=u-h*Math.sin(d);(g<=c&&g>=s||g>=c&&g<=s)&&(x<=u&&x>=f||x>=u&&x<=f)&&(t=[g,x])}return t}Be.applyBackoff=Nw;Be.makeTester=function(){var t=Nt.ensureSingleById(wr.select("body"),"svg","js-plotly-tester",function(r){r.attr(dD.svgAttrs).style({position:"absolute",left:"-10000px",top:"-10000px",width:"9000px",height:"9000px","z-index":"1"})}),e=Nt.ensureSingle(t,"path","js-reference-point",function(r){r.attr("d","M0,0H1V1H0Z").style({"stroke-width":0,fill:"black"})});Be.tester=t,Be.testref=e};Be.savedBBoxes={};var Xu=0,MD=1e4;Be.bBox=function(t,e,r){r||(r=Sy(t));var a;if(r){if(a=Be.savedBBoxes[r],a)return Nt.extendFlat({},a)}else if(t.childNodes.length===1){var i=t.childNodes[0];if(r=Sy(i),r){var n=+i.getAttribute("x")||0,o=+i.getAttribute("y")||0,l=i.getAttribute("transform");if(!l){var s=Be.bBox(i,!1,r);return n&&(s.left+=n,s.right+=n),o&&(s.top+=o,s.bottom+=o),s}if(r+="~"+n+"~"+o+"~"+l,a=Be.savedBBoxes[r],a)return Nt.extendFlat({},a)}}var f,c;e?f=t:(c=Be.tester.node(),f=t.cloneNode(!0),c.appendChild(f)),wr.select(f).attr("transform",null).call(Qc.positionText,0,0);var u=f.getBoundingClientRect(),v=Be.testref.node().getBoundingClientRect();e||c.removeChild(f);var p={height:u.height,width:u.width,left:u.left-v.left,top:u.top-v.top,right:u.right-v.left,bottom:u.bottom-v.top};return Xu>=MD&&(Be.savedBBoxes={},Xu=0),r&&(Be.savedBBoxes[r]=p),Xu++,Nt.extendFlat({},p)};function Sy(t){var e=t.getAttribute("data-unformatted");if(e!==null)return e+t.getAttribute("data-math")+t.getAttribute("text-anchor")+t.getAttribute("style")}Be.setClipUrl=function(t,e,r){t.attr("clip-path",lp(e,r))};function lp(t,e){if(!t)return null;var r=e._context,a=r._exportedPlot?"":r._baseUrl||"";return a?"url('"+a+"#"+t+"')":"url(#"+t+")"}Be.getTranslate=function(t){var e=/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,r=t.attr?"attr":"getAttribute",a=t[r]("transform")||"",i=a.replace(e,function(n,o,l){return[o,l].join(" ")}).split(" ");return{x:+i[0]||0,y:+i[1]||0}};Be.setTranslate=function(t,e,r){var a=/(\btranslate\(.*?\);?)/,i=t.attr?"attr":"getAttribute",n=t.attr?"attr":"setAttribute",o=t[i]("transform")||"";return e=e||0,r=r||0,o=o.replace(a,"").trim(),o+=Vl(e,r),o=o.trim(),t[n]("transform",o),o};Be.getScale=function(t){var e=/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,r=t.attr?"attr":"getAttribute",a=t[r]("transform")||"",i=a.replace(e,function(n,o,l){return[o,l].join(" ")}).split(" ");return{x:+i[0]||1,y:+i[1]||1}};Be.setScale=function(t,e,r){var a=/(\bscale\(.*?\);?)/,i=t.attr?"attr":"getAttribute",n=t.attr?"attr":"setAttribute",o=t[i]("transform")||"";return e=e||1,r=r||1,o=o.replace(a,"").trim(),o+="scale("+e+","+r+")",o=o.trim(),t[n]("transform",o),o};var SD=/\s*sc.*/;Be.setPointGroupScale=function(t,e,r){if(e=e||1,r=r||1,!!t){var a=e===1&&r===1?"":"scale("+e+","+r+")";t.each(function(){var i=(this.getAttribute("transform")||"").replace(SD,"");i+=a,i=i.trim(),this.setAttribute("transform",i)})}};var LD=/translate\([^)]*\)\s*$/;Be.setTextPointsScale=function(t,e,r){t&&t.each(function(){var a,i=wr.select(this),n=i.select("text");if(n.node()){var o=parseFloat(n.attr("x")||0),l=parseFloat(n.attr("y")||0),s=(i.attr("transform")||"").match(LD);e===1&&r===1?a=[]:a=[Vl(o,l),"scale("+e+","+r+")",Vl(-o,-l)],s&&a.push(s),i.attr("transform",a.join(""))}})};function sp(t,e){var r;return t&&(r=t.mf),r===void 0&&(r=e.marker&&e.marker.standoff||0),!e._geo&&!e._xA?-r:r}Be.getMarkerStandoff=sp;var ol=Math.atan2,fn=Math.cos,po=Math.sin;function Ly(t,e){var r=e[0],a=e[1];return[r*fn(t)-a*po(t),r*po(t)+a*fn(t)]}var Cy,Dy,Py,$y,Yu,qu;function fp(t,e){var r=t.ma;r===void 0&&(r=e.marker.angle,(!r||Nt.isArrayOrTypedArray(r))&&(r=0));var a,i,n=e.marker.angleref;if(n==="previous"||n==="north"){if(e._geo){var o=e._geo.project(t.lonlat);a=o[0],i=o[1]}else{var l=e._xA,s=e._yA;if(l&&s)a=l.c2p(t.x),i=s.c2p(t.y);else return 90}if(e._geo){var f=t.lonlat[0],c=t.lonlat[1],u=e._geo.project([f,c+1e-5]),v=e._geo.project([f+1e-5,c]),p=ol(v[1]-i,v[0]-a),d=ol(u[1]-i,u[0]-a),h;if(n==="north")h=r/180*Math.PI;else if(n==="previous"){var m=f/180*Math.PI,y=c/180*Math.PI,b=Cy/180*Math.PI,_=Dy/180*Math.PI,g=b-m,x=fn(_)*po(g),w=po(_)*fn(y)-fn(_)*po(y)*fn(g);h=-ol(x,w)-Math.PI,Cy=f,Dy=c}var T=Ly(p,[fn(h),0]),A=Ly(d,[po(h),0]);r=ol(T[1]+A[1],T[0]+A[0])/Math.PI*180,n==="previous"&&!(qu===e.uid&&t.i===Yu+1)&&(r=null)}if(n==="previous"&&!e._geo)if(qu===e.uid&&t.i===Yu+1&&Tn(a)&&Tn(i)){var M=a-Py,S=i-$y,L=e.line&&e.line.shape||"",E=L.slice(L.length-1);E==="h"&&(S=0),E==="v"&&(M=0),r+=ol(S,M)/Math.PI*180+90}else r=null}return Py=a,$y=i,Yu=t.i,qu=e.uid,r}Be.getMarkerAngle=fp;var Et=fw.exports,On=bt,CD=kt,DD=hr,Zu=ot,on=we,Ey=on.strTranslate,Hs=Et,Os=yt,jn=Tr,zy=hs,PD=Vr.OPPOSITE_SIDE,Ry=/ [XY][0-9]* /,Bd=1.6,Gd=1.6;function $D(t,e,r){var a=t._fullLayout,i=r.propContainer,n=r.propName,o=r.placeholder,l=r.traceIndex,s=r.avoid||{},f=r.attributes,c=r.transform,u=r.containerGroup,v=1,p=i.title,d=(p&&p.text?p.text:"").trim(),h=!1,m=p&&p.font?p.font:{},y=m.family,b=m.size,_=m.color,g=m.weight,x=m.style,w=m.variant,T=m.textcase,A=m.lineposition,M=m.shadow,S=r.subtitlePropName,L=!!S,E=r.subtitlePlaceholder,F=(i.title||{}).subtitle||{text:"",font:{}},N=F.text.trim(),z=!1,H=1,D=F.font,P=D.family,k=D.size,C=D.color,$=D.weight,R=D.style,j=D.variant,G=D.textcase,Y=D.lineposition,O=D.shadow,K;n==="title.text"?K="titleText":n.indexOf("axis")!==-1?K="axisTitleText":n.indexOf("colorbar"!==-1)&&(K="colorbarTitleText");var W=t._context.edits[K];function X(pe,Me){return pe===void 0||Me===void 0?!1:pe.replace(Ry," % ")===Me.replace(Ry," % ")}d===""?v=0:X(d,o)&&(W||(d=""),v=.2,h=!0),L&&(N===""?H=0:X(N,E)&&(W||(N=""),H=.2,z=!0)),r._meta?d=on.templateString(d,r._meta):a._meta&&(d=on.templateString(d,a._meta));var B=d||N||W,ee;u||(u=on.ensureSingle(a._infolayer,"g","g-"+e),ee=a._hColorbarMoveTitle);var ae=u.selectAll("text."+e).data(B?[0]:[]);ae.enter().append("text"),ae.text(d).attr("class",e),ae.exit().remove();var de=null,fe=e+"-subtitle",q=N||W;if(L&&q&&(de=u.selectAll("text."+fe).data(q?[0]:[]),de.enter().append("text"),de.text(N).attr("class",fe),de.exit().remove()),!B)return u;function te(pe,Me){on.syncOrAsync([le,ce],{title:pe,subtitle:Me})}function le(pe){var Me=pe.title,ve=pe.subtitle,ke;!c&&ee&&(c={}),c?(ke="",c.rotate&&(ke+="rotate("+[c.rotate,f.x,f.y]+")"),(c.offset||ee)&&(ke+=Ey(0,(c.offset||0)-(ee||0)))):ke=null,Me.attr("transform",ke);function _e(Pe){if(Pe){var Ee=On.select(Pe.node().parentNode).select("."+fe);if(!Ee.empty()){var Le=Pe.node().getBBox();if(Le.height){var Ae=Le.y+Le.height+Bd*k;Ee.attr("y",Ae)}}}}if(Me.style("opacity",v*Os.opacity(_)).call(Hs.font,{color:Os.rgb(_),size:On.round(b,2),family:y,weight:g,style:x,variant:w,textcase:T,shadow:M,lineposition:A}).attr(f).call(jn.convertToTspans,t,_e),ve){var J=u.select("."+e+"-math-group"),be=Me.node().getBBox(),Z=J.node()?J.node().getBBox():void 0,me=Z?Z.y+Z.height+Bd*k:be.y+be.height+Gd*k,ge=on.extendFlat({},f,{y:me});ve.attr("transform",ke),ve.style("opacity",H*Os.opacity(C)).call(Hs.font,{color:Os.rgb(C),size:On.round(k,2),family:P,weight:$,style:R,variant:j,textcase:G,shadow:O,lineposition:Y}).attr(ge).call(jn.convertToTspans,t)}return DD.previousPromises(t)}function ce(pe){var Me=pe.title,ve=On.select(Me.node().parentNode);if(s&&s.selection&&s.side&&d){ve.attr("transform",null);var ke=PD[s.side],_e=s.side==="left"||s.side==="top"?-1:1,J=CD(s.pad)?s.pad:2,be=Hs.bBox(ve.node()),Z={t:0,b:0,l:0,r:0},me=t._fullLayout._reservedMargin;for(var ge in me)for(var Pe in me[ge]){var Ee=me[ge][Pe];Z[Pe]=Math.max(Z[Pe],Ee)}var Le={left:Z.l,top:Z.t,right:a.width-Z.r,bottom:a.height-Z.b},Ae=s.maxShift||_e*(Le[s.side]-be[s.side]),Oe=0;if(Ae<0)Oe=Ae;else{var $e=s.offsetLeft||0,ze=s.offsetTop||0;be.left-=$e,be.right-=$e,be.top-=ze,be.bottom-=ze,s.selection.each(function(){var at=Hs.bBox(this);on.bBoxIntersect(be,at,J)&&(Oe=Math.max(Oe,_e*(at[s.side]-be[ke])+J))}),Oe=Math.min(Ae,Oe),i._titleScoot=Math.abs(Oe)}if(Oe>0||Ae<0){var je={left:[-Oe,0],right:[Oe,0],top:[0,-Oe],bottom:[0,Oe]}[s.side];ve.attr("transform",Ey(je[0],je[1]))}}}ae.call(te,de);function ye(pe,Me){pe.text(Me).on("mouseover.opacity",function(){On.select(this).transition().duration(zy.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){On.select(this).transition().duration(zy.HIDE_PLACEHOLDER).style("opacity",0)})}if(W&&(d?ae.on(".opacity",null):(ye(ae,o),h=!0),ae.call(jn.makeEditable,{gd:t}).on("edit",function(pe){l!==void 0?Zu.call("_guiRestyle",t,n,pe,l):Zu.call("_guiRelayout",t,n,pe)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(te)}).on("input",function(pe){this.text(pe||" ").call(jn.positionText,f.x,f.y)}),L)){if(L&&!d){var ue=ae.node().getBBox(),oe=ue.y+ue.height+Gd*k;de.attr("y",oe)}N?de.on(".opacity",null):(ye(de,E),z=!0),de.call(jn.makeEditable,{gd:t}).on("edit",function(pe){Zu.call("_guiRelayout",t,"title.subtitle.text",pe)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(te)}).on("input",function(pe){this.text(pe||" ").call(jn.positionText,de.attr("x"),de.attr("y"))})}return ae.classed("js-placeholder",h),de&&de.classed("js-placeholder",z),u}var Jc={draw:$D,SUBTITLE_PADDING_EM:Gd,SUBTITLE_PADDING_MATHJAX_EM:Bd},ED=bt,zD=Gl.utcFormat,jt=we,RD=jt.numberFormat,Ga=kt,_i=jt.cleanNumber,ID=jt.ms2DateTime,Iy=jt.dateTime2ms,Ua=jt.ensureNumber,Fy=jt.isArrayOrTypedArray,ji=fr,js=ji.FP_SAFE,Ma=ji.BADNUM,FD=ji.LOG_CLIP,ND=ji.ONEWEEK,Bs=ji.ONEDAY,Gs=ji.ONEHOUR,Ny=ji.ONEMIN,Hy=ji.ONESEC,Us=cr,tc=Rr,Vs=tc.HOUR_PATTERN,Ws=tc.WEEKDAY_PATTERN;function ll(t){return Math.pow(10,t)}function Ku(t){return t!=null}var cp=function(e,r){r=r||{};var a=e._id||"x",i=a.charAt(0);function n(g,x){if(g>0)return Math.log(g)/Math.LN10;if(g<=0&&x&&e.range&&e.range.length===2){var w=e.range[0],T=e.range[1];return .5*(w+T-2*FD*Math.abs(w-T))}else return Ma}function o(g,x,w,T){if((T||{}).msUTC&&Ga(g))return+g;var A=Iy(g,w||e.calendar);if(A===Ma)if(Ga(g)){g=+g;var M=Math.floor(jt.mod(g+.05,1)*10),S=Math.round(g-M/10);A=Iy(new Date(S))+M/10}else return Ma;return A}function l(g,x,w){return ID(g,x,w||e.calendar)}function s(g){return e._categories[Math.round(g)]}function f(g){if(Ku(g)){if(e._categoriesMap===void 0&&(e._categoriesMap={}),e._categoriesMap[g]!==void 0)return e._categoriesMap[g];e._categories.push(typeof g=="number"?String(g):g);var x=e._categories.length-1;return e._categoriesMap[g]=x,x}return Ma}function c(g,x){for(var w=new Array(x),T=0;T<x;T++){var A=(g[0]||[])[T],M=(g[1]||[])[T];w[T]=u([A,M])}return w}function u(g){if(e._categoriesMap)return e._categoriesMap[g]}function v(g){var x=u(g);if(x!==void 0)return x;if(Ga(g))return+g}function p(g){return Ga(g)?+g:u(g)}function d(g,x,w){return ED.round(w+x*g,2)}function h(g,x,w){return(g-w)/x}var m=function(x){return Ga(x)?d(x,e._m,e._b):Ma},y=function(g){return h(g,e._m,e._b)};if(e.rangebreaks){var b=i==="y";m=function(g){if(!Ga(g))return Ma;var x=e._rangebreaks.length;if(!x)return d(g,e._m,e._b);var w=b;e.range[0]>e.range[1]&&(w=!w);for(var T=w?-1:1,A=T*g,M=0,S=0;S<x;S++){var L=T*e._rangebreaks[S].min,E=T*e._rangebreaks[S].max;if(A<L)break;if(A>E)M=S+1;else{M=A<(L+E)/2?S:S+1;break}}var F=e._B[M]||0;return isFinite(F)?d(g,e._m2,F):0},y=function(g){var x=e._rangebreaks.length;if(!x)return h(g,e._m,e._b);for(var w=0,T=0;T<x&&!(g<e._rangebreaks[T].pmin);T++)g>e._rangebreaks[T].pmax&&(w=T+1);return h(g,e._m2,e._B[w])}}e.c2l=e.type==="log"?n:Ua,e.l2c=e.type==="log"?ll:Ua,e.l2p=m,e.p2l=y,e.c2p=e.type==="log"?function(g,x){return m(n(g,x))}:m,e.p2c=e.type==="log"?function(g){return ll(y(g))}:y,["linear","-"].indexOf(e.type)!==-1?(e.d2r=e.r2d=e.d2c=e.r2c=e.d2l=e.r2l=_i,e.c2d=e.c2r=e.l2d=e.l2r=Ua,e.d2p=e.r2p=function(g){return e.l2p(_i(g))},e.p2d=e.p2r=y,e.cleanPos=Ua):e.type==="log"?(e.d2r=e.d2l=function(g,x){return n(_i(g),x)},e.r2d=e.r2c=function(g){return ll(_i(g))},e.d2c=e.r2l=_i,e.c2d=e.l2r=Ua,e.c2r=n,e.l2d=ll,e.d2p=function(g,x){return e.l2p(e.d2r(g,x))},e.p2d=function(g){return ll(y(g))},e.r2p=function(g){return e.l2p(_i(g))},e.p2r=y,e.cleanPos=Ua):e.type==="date"?(e.d2r=e.r2d=jt.identity,e.d2c=e.r2c=e.d2l=e.r2l=o,e.c2d=e.c2r=e.l2d=e.l2r=l,e.d2p=e.r2p=function(g,x,w){return e.l2p(o(g,0,w))},e.p2d=e.p2r=function(g,x,w){return l(y(g),x,w)},e.cleanPos=function(g){return jt.cleanDate(g,Ma,e.calendar)}):e.type==="category"?(e.d2c=e.d2l=f,e.r2d=e.c2d=e.l2d=s,e.d2r=e.d2l_noadd=v,e.r2c=function(g){var x=p(g);return x!==void 0?x:e.fraction2r(.5)},e.l2r=e.c2r=Ua,e.r2l=p,e.d2p=function(g){return e.l2p(e.r2c(g))},e.p2d=function(g){return s(y(g))},e.r2p=e.d2p,e.p2r=y,e.cleanPos=function(g){return typeof g=="string"&&g!==""?g:Ua(g)}):e.type==="multicategory"&&(e.r2d=e.c2d=e.l2d=s,e.d2r=e.d2l_noadd=v,e.r2c=function(g){var x=v(g);return x!==void 0?x:e.fraction2r(.5)},e.r2c_just_indices=u,e.l2r=e.c2r=Ua,e.r2l=v,e.d2p=function(g){return e.l2p(e.r2c(g))},e.p2d=function(g){return s(y(g))},e.r2p=e.d2p,e.p2r=y,e.cleanPos=function(g){return Array.isArray(g)||typeof g=="string"&&g!==""?g:Ua(g)},e.setupMultiCategory=function(g){var x=e._traceIndices,w,T,A=e._matchGroup;if(A&&e._categories.length===0){for(var M in A)if(M!==a){var S=r[Us.id2name(M)];x=x.concat(S._traceIndices)}}var L=[[0,{}],[0,{}]],E=[];for(w=0;w<x.length;w++){var F=g[x[w]];if(i in F){var N=F[i],z=F._length||jt.minRowLength(N);if(Fy(N[0])&&Fy(N[1]))for(T=0;T<z;T++){var H=N[0][T],D=N[1][T];Ku(H)&&Ku(D)&&(E.push([H,D]),H in L[0][1]||(L[0][1][H]=L[0][0]++),D in L[1][1]||(L[1][1][D]=L[1][0]++))}}}for(E.sort(function(P,k){var C=L[0][1],$=C[P[0]]-C[k[0]];if($)return $;var R=L[1][1];return R[P[1]]-R[k[1]]}),w=0;w<E.length;w++)f(E[w])}),e.fraction2r=function(g){var x=e.r2l(e.range[0]),w=e.r2l(e.range[1]);return e.l2r(x+g*(w-x))},e.r2fraction=function(g){var x=e.r2l(e.range[0]),w=e.r2l(e.range[1]);return(e.r2l(g)-x)/(w-x)},e.limitRange=function(g){var x=e.minallowed,w=e.maxallowed;if(!(x===void 0&&w===void 0)){g||(g="range");var T=jt.nestedProperty(e,g).get(),A=jt.simpleMap(T,e.r2l),M=A[1]<A[0];M&&A.reverse();var S=jt.simpleMap([x,w],e.r2l);if(x!==void 0&&A[0]<S[0]&&(T[M?1:0]=x),w!==void 0&&A[1]>S[1]&&(T[M?0:1]=w),T[0]===T[1]){var L=e.l2r(x),E=e.l2r(w);if(x!==void 0){var F=L+1;w!==void 0&&(F=Math.min(F,E)),T[M?1:0]=F}if(w!==void 0){var N=E+1;x!==void 0&&(N=Math.max(N,L)),T[M?0:1]=N}}}},e.cleanRange=function(g,x){e._cleanRange(g,x),e.limitRange(g)},e._cleanRange=function(g,x){x||(x={}),g||(g="range");var w=jt.nestedProperty(e,g).get(),T,A;if(e.type==="date"?A=jt.dfltRange(e.calendar):i==="y"?A=tc.DFLTRANGEY:e._name==="realaxis"?A=[0,1]:A=x.dfltRange||tc.DFLTRANGEX,A=A.slice(),(e.rangemode==="tozero"||e.rangemode==="nonnegative")&&(A[0]=0),!w||w.length!==2){jt.nestedProperty(e,g).set(A);return}var M=w[0]===null,S=w[1]===null;for(e.type==="date"&&!e.autorange&&(w[0]=jt.cleanDate(w[0],Ma,e.calendar),w[1]=jt.cleanDate(w[1],Ma,e.calendar)),T=0;T<2;T++)if(e.type==="date"){if(!jt.isDateTime(w[T],e.calendar)){e[g]=A;break}if(e.r2l(w[0])===e.r2l(w[1])){var L=jt.constrain(e.r2l(w[0]),jt.MIN_MS+1e3,jt.MAX_MS-1e3);w[0]=e.l2r(L-1e3),w[1]=e.l2r(L+1e3);break}}else{if(!Ga(w[T]))if(!(M||S)&&Ga(w[1-T]))w[T]=w[1-T]*(T?10:.1);else{e[g]=A;break}if(w[T]<-js?w[T]=-js:w[T]>js&&(w[T]=js),w[0]===w[1]){var E=Math.max(1,Math.abs(w[0]*1e-6));w[0]-=E,w[1]+=E}}},e.setScale=function(g){var x=r._size;if(e.overlaying){var w=Us.getFromId({_fullLayout:r},e.overlaying);e.domain=w.domain}var T=g&&e._r?"_r":"range",A=e.calendar;e.cleanRange(T);var M=e.r2l(e[T][0],A),S=e.r2l(e[T][1],A),L=i==="y";if(L?(e._offset=x.t+(1-e.domain[1])*x.h,e._length=x.h*(e.domain[1]-e.domain[0]),e._m=e._length/(M-S),e._b=-e._m*S):(e._offset=x.l+e.domain[0]*x.w,e._length=x.w*(e.domain[1]-e.domain[0]),e._m=e._length/(S-M),e._b=-e._m*M),e._rangebreaks=[],e._lBreaks=0,e._m2=0,e._B=[],e.rangebreaks){var E,F;if(e._rangebreaks=e.locateBreaks(Math.min(M,S),Math.max(M,S)),e._rangebreaks.length){for(E=0;E<e._rangebreaks.length;E++)F=e._rangebreaks[E],e._lBreaks+=Math.abs(F.max-F.min);var N=L;M>S&&(N=!N),N&&e._rangebreaks.reverse();var z=N?-1:1;for(e._m2=z*e._length/(Math.abs(S-M)-e._lBreaks),e._B.push(-e._m2*(L?S:M)),E=0;E<e._rangebreaks.length;E++)F=e._rangebreaks[E],e._B.push(e._B[e._B.length-1]-z*e._m2*(F.max-F.min));for(E=0;E<e._rangebreaks.length;E++)F=e._rangebreaks[E],F.pmin=m(F.min),F.pmax=m(F.max)}}if(!isFinite(e._m)||!isFinite(e._b)||e._length<0)throw r._replotting=!1,new Error("Something went wrong with axis scaling")},e.maskBreaks=function(g){var x=e.rangebreaks||[],w,T,A,M,S;x._cachedPatterns||(x._cachedPatterns=x.map(function(C){return C.enabled&&C.bounds?jt.simpleMap(C.bounds,C.pattern?_i:e.d2c):null})),x._cachedValues||(x._cachedValues=x.map(function(C){return C.enabled&&C.values?jt.simpleMap(C.values,e.d2c).sort(jt.sorterAsc):null}));for(var L=0;L<x.length;L++){var E=x[L];if(E.enabled){if(E.bounds){var F=E.pattern;switch(w=x._cachedPatterns[L],T=w[0],A=w[1],F){case Ws:S=new Date(g),M=S.getUTCDay(),T>A&&(A+=7,M<T&&(M+=7));break;case Vs:S=new Date(g);var N=S.getUTCHours(),z=S.getUTCMinutes(),H=S.getUTCSeconds(),D=S.getUTCMilliseconds();M=N+(z/60+H/3600+D/36e5),T>A&&(A+=24,M<T&&(M+=24));break;case"":M=g;break}if(M>=T&&M<A)return Ma}else for(var P=x._cachedValues[L],k=0;k<P.length;k++)if(T=P[k],A=T+E.dvalue,g>=T&&g<A)return Ma}}return g},e.locateBreaks=function(g,x){var w,T,A,M,S=[];if(!e.rangebreaks)return S;var L=e.rangebreaks.slice().sort(function(R,j){return R.pattern===Ws&&j.pattern===Vs?-1:j.pattern===Ws&&R.pattern===Vs?1:0}),E=function(R,j){if(R=jt.constrain(R,g,x),j=jt.constrain(j,g,x),R!==j){for(var G=!0,Y=0;Y<S.length;Y++){var O=S[Y];R<O.max&&j>=O.min&&(R<O.min&&(O.min=R),j>O.max&&(O.max=j),G=!1)}G&&S.push({min:R,max:j})}};for(w=0;w<L.length;w++){var F=L[w];if(F.enabled)if(F.bounds){var N=g,z=x;F.pattern&&(N=Math.floor(N)),T=jt.simpleMap(F.bounds,F.pattern?_i:e.r2l),A=T[0],M=T[1];var H=new Date(N),D,P;switch(F.pattern){case Ws:P=ND,D=((M<A?7:0)+(M-A))*Bs,N+=A*Bs-(H.getUTCDay()*Bs+H.getUTCHours()*Gs+H.getUTCMinutes()*Ny+H.getUTCSeconds()*Hy+H.getUTCMilliseconds());break;case Vs:P=Bs,D=((M<A?24:0)+(M-A))*Gs,N+=A*Gs-(H.getUTCHours()*Gs+H.getUTCMinutes()*Ny+H.getUTCSeconds()*Hy+H.getUTCMilliseconds());break;default:N=Math.min(T[0],T[1]),z=Math.max(T[0],T[1]),P=z-N,D=P}for(var k=N;k<z;k+=P)E(k,k+D)}else for(var C=jt.simpleMap(F.values,e.d2c),$=0;$<C.length;$++)A=C[$],M=A+F.dvalue,E(A,M)}return S.sort(function(R,j){return R.min-j.min}),S},e.makeCalcdata=function(g,x,w){var T,A,M,S,L=e.type,E=L==="date"&&g[x+"calendar"];if(x in g){if(T=g[x],S=g._length||jt.minRowLength(T),jt.isTypedArray(T)&&(L==="linear"||L==="log")){if(S===T.length)return T;if(T.subarray)return T.subarray(0,S)}if(L==="multicategory")return c(T,S);for(A=new Array(S),M=0;M<S;M++)A[M]=e.d2c(T[M],0,E,w)}else{var F=x+"0"in g?e.d2c(g[x+"0"],0,E):0,N=g["d"+x]?Number(g["d"+x]):1;for(T=g[{x:"y",y:"x"}[x]],S=g._length||T.length,A=new Array(S),M=0;M<S;M++)A[M]=F+M*N}if(e.rangebreaks)for(M=0;M<S;M++)A[M]=e.maskBreaks(A[M]);return A},e.isValidRange=function(g,x){return Array.isArray(g)&&g.length===2&&(x&&g[0]===null||Ga(e.r2l(g[0])))&&(x&&g[1]===null||Ga(e.r2l(g[1])))},e.getAutorangeDflt=function(g,x){var w=!e.isValidRange(g,"nullOk");return w&&x&&x.reverseDflt?w="reversed":g&&(g[0]===null&&g[1]===null?w=!0:g[0]===null&&g[1]!==null?w="min":g[0]!==null&&g[1]===null&&(w="max")),w},e.isReversed=function(){var g=e.autorange;return g==="reversed"||g==="min reversed"||g==="max reversed"},e.isPtWithinRange=function(g,x){var w=e.c2l(g[i],null,x),T=e.r2l(e.range[0]),A=e.r2l(e.range[1]);return T<A?T<=w&&w<=A:A<=w&&w<=T},e._emptyCategories=function(){e._categories=[],e._categoriesMap={}},e.clearCalc=function(){var g=e._matchGroup;if(g){var x=null,w=null;for(var T in g){var A=r[Us.id2name(T)];if(A._categories){x=A._categories,w=A._categoriesMap;break}}x&&w?(e._categories=x,e._categoriesMap=w):e._emptyCategories()}else e._emptyCategories();if(e._initialCategories)for(var M=0;M<e._initialCategories.length;M++)f(e._initialCategories[M])},e.sortByInitialCategories=function(){var g=[];if(e._emptyCategories(),e._initialCategories)for(var x=0;x<e._initialCategories.length;x++)f(e._initialCategories[x]);g=g.concat(e._traceIndices);var w=e._matchGroup;for(var T in w)if(a!==T){var A=r[Us.id2name(T)];A._categories=e._categories,A._categoriesMap=e._categoriesMap,g=g.concat(A._traceIndices)}return g};var _=r._d3locale;e.type==="date"&&(e._dateFormat=_?_.timeFormat:zD,e._extraFormat=r._extraFormat),e._separators=r.separators,e._numFormat=_?_.numberFormat:RD,delete e._minDtick,delete e._forceTick0},Hw=kt,up=we,HD=fr.BADNUM,rc=up.isArrayOrTypedArray,OD=up.isDateTime,jD=up.cleanNumber,Ow=Math.round,jw=function(e,r,a){var i=e,n=a.noMultiCategory;if(rc(i)&&!i.length)return"-";if(!n&&WD(i))return"multicategory";if(n&&Array.isArray(i[0])){for(var o=[],l=0;l<i.length;l++)if(rc(i[l]))for(var s=0;s<i[l].length;s++)o.push(i[l][s]);i=o}if(UD(i,r))return"date";var f=a.autotypenumbers!=="strict";return VD(i,f)?"category":GD(i,f)?"linear":"-"};function BD(t,e){return e?Hw(t):typeof t=="number"}function GD(t,e){for(var r=t.length,a=0;a<r;a++)if(BD(t[a],e))return!0;return!1}function UD(t,e){for(var r=t.length,a=Bw(r),i=0,n=0,o={},l=0;l<r;l+=a){var s=Ow(l),f=t[s],c=String(f);o[c]||(o[c]=1,OD(f,e)&&i++,Hw(f)&&n++)}return i>n*2}function Bw(t){return Math.max(1,(t-1)/1e3)}function VD(t,e){for(var r=t.length,a=Bw(r),i=0,n=0,o={},l=0;l<r;l+=a){var s=Ow(l),f=t[s],c=String(f);if(!o[c]){o[c]=1;var u=typeof f;u==="boolean"?n++:(e?jD(f)!==HD:u==="number")?i++:u==="string"&&n++}}return n>i*2}function WD(t){return rc(t[0])&&rc(t[1])}var XD=bt,Gw=kt,Ei=we,If=fr.FP_SAFE,YD=ot,qD=Et,Uw=cr,ZD=Uw.getFromId,KD=Uw.isLinked,bs={applyAutorangeOptions:Ww,getAutoRange:Ud,makePadFn:Vd,doAutoRange:JD,findExtremes:e5,concatExtremes:vp};function Ud(t,e){var r,a,i=[],n=t._fullLayout,o=Vd(n,e,0),l=Vd(n,e,1),s=vp(t,e),f=s.min,c=s.max;if(f.length===0||c.length===0)return Ei.simpleMap(e.range,e.r2l);var u=f[0].val,v=c[0].val;for(r=1;r<f.length&&u===v;r++)u=Math.min(u,f[r].val);for(r=1;r<c.length&&u===v;r++)v=Math.max(v,c[r].val);var p=e.autorange,d=p==="reversed"||p==="min reversed"||p==="max reversed";if(!d&&e.range){var h=Ei.simpleMap(e.range,e.r2l);d=h[1]<h[0]}e.autorange==="reversed"&&(e.autorange=!0);var m=e.rangemode,y=m==="tozero",b=m==="nonnegative",_=e._length,g=_/10,x=0,w,T,A,M,S,L;for(r=0;r<f.length;r++)for(w=f[r],a=0;a<c.length;a++)T=c[a],L=T.val-w.val-Oy(e,w.val,T.val),L>0&&(S=_-o(w)-l(T),S>g?L/S>x&&(A=w,M=T,x=L/S):L/_>x&&(A={val:w.val,nopad:1},M={val:T.val,nopad:1},x=L/_));function E(D,P){return Math.max(D,l(P))}if(u===v){var F=u-1,N=u+1;if(y)if(u===0)i=[0,1];else{var z=(u>0?c:f).reduce(E,0),H=u/(1-Math.min(.5,z/_));i=u>0?[0,H]:[H,0]}else b?i=[Math.max(0,F),Math.max(1,N)]:i=[F,N]}else y?(A.val>=0&&(A={val:0,nopad:1}),M.val<=0&&(M={val:0,nopad:1})):b&&(A.val-x*o(A)<0&&(A={val:0,nopad:1}),M.val<=0&&(M={val:1,nopad:1})),x=(M.val-A.val-Oy(e,w.val,T.val))/(_-o(A)-l(M)),i=[A.val-x*o(A),M.val+x*l(M)];return i=Ww(i,e),e.limitRange&&e.limitRange(),d&&i.reverse(),Ei.simpleMap(i,e.l2r||Number)}function Oy(t,e,r){var a=0;if(t.rangebreaks)for(var i=t.locateBreaks(e,r),n=0;n<i.length;n++){var o=i[n];a+=o.max-o.min}return a}function Vd(t,e,r){var a=.05*e._length,i=e._anchorAxis||{};if((e.ticklabelposition||"").indexOf("inside")!==-1||(i.ticklabelposition||"").indexOf("inside")!==-1){var n=e.isReversed();if(!n){var o=Ei.simpleMap(e.range,e.r2l);n=o[1]<o[0]}n&&(r=!r)}var l=0;return KD(t,e._id)||(l=QD(t,e,r)),a=Math.max(l,a),e.constrain==="domain"&&e._inputDomain&&(a*=(e._inputDomain[1]-e._inputDomain[0])/(e.domain[1]-e.domain[0])),function(f){return f.nopad?0:f.pad+(f.extrapad?a:l)}}var jy=3;function QD(t,e,r){var a=0,i=e._id.charAt(0)==="x";for(var n in t._plots){var o=t._plots[n];if(!(e._id!==o.xaxis._id&&e._id!==o.yaxis._id)){var l=(i?o.yaxis:o.xaxis)||{};if((l.ticklabelposition||"").indexOf("inside")!==-1&&(!r&&(l.side==="left"||l.side==="bottom")||r&&(l.side==="top"||l.side==="right"))){if(l._vals){var s=Ei.deg2rad(l._tickAngles[l._id+"tick"]||0),f=Math.abs(Math.cos(s)),c=Math.abs(Math.sin(s));if(!l._vals[0].bb){var u=l._id+"tick",v=l._selections[u];v.each(function(b){var _=XD.select(this),g=_.select(".text-math-group");g.empty()&&(b.bb=qD.bBox(_.node()))})}for(var p=0;p<l._vals.length;p++){var d=l._vals[p],h=d.bb;if(h){var m=2*jy+h.width,y=2*jy+h.height;a=Math.max(a,i?Math.max(m*f,y*c):Math.max(y*f,m*c))}}}l.ticks==="inside"&&l.ticklabelposition==="inside"&&(a+=l.ticklen||0)}}}return a}function vp(t,e,r){var a=e._id,i=t._fullData,n=t._fullLayout,o=[],l=[],s,f,c;function u(m,y){for(s=0;s<y.length;s++){var b=m[y[s]],_=(b._extremes||{})[a];if(b.visible===!0&&_){for(f=0;f<_.min.length;f++)c=_.min[f],Wd(o,c.val,c.pad,{extrapad:c.extrapad});for(f=0;f<_.max.length;f++)c=_.max[f],Xd(l,c.val,c.pad,{extrapad:c.extrapad})}}}if(u(i,e._traceIndices),u(n.annotations||[],e._annIndices||[]),u(n.shapes||[],e._shapeIndices||[]),e._matchGroup&&!r){for(var v in e._matchGroup)if(v!==e._id){var p=ZD(t,v),d=vp(t,p,!0),h=e._length/p._length;for(f=0;f<d.min.length;f++)c=d.min[f],Wd(o,c.val,c.pad*h,{extrapad:c.extrapad});for(f=0;f<d.max.length;f++)c=d.max[f],Xd(l,c.val,c.pad*h,{extrapad:c.extrapad})}}return{min:o,max:l}}function JD(t,e,r){if(e.setScale(),e.autorange){e.range=r?r.slice():Ud(t,e),e._r=e.range.slice(),e._rl=Ei.simpleMap(e._r,e.r2l);var a=e._input,i={};i[e._attr+".range"]=e.range,i[e._attr+".autorange"]=e.autorange,YD.call("_storeDirectGUIEdit",t.layout,t._fullLayout._preGUI,i),a.range=e.range.slice(),a.autorange=e.autorange}var n=e._anchorAxis;if(n&&n.rangeslider){var o=n.rangeslider[e._name];o&&o.rangemode==="auto"&&(o.range=Ud(t,e)),n._input.rangeslider[e._name]=Ei.extendFlat({},o)}}function e5(t,e,r){r||(r={}),t._m||t.setScale();var a=[],i=[],n=e.length,o=r.padded||!1,l=r.tozero&&(t.type==="linear"||t.type==="-"),s=t.type==="log",f=!1,c=r.vpadLinearized||!1,u,v,p,d,h,m,y,b,_;function g(E){if(Array.isArray(E))return f=!0,function(N){return Math.max(Number(E[N]||0),0)};var F=Math.max(Number(E||0),0);return function(){return F}}var x=g((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),w=g((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),T=g(r.vpadplus||r.vpad),A=g(r.vpadminus||r.vpad);if(!f){if(b=1/0,_=-1/0,s)for(u=0;u<n;u++)v=e[u],v<b&&v>0&&(b=v),v>_&&v<If&&(_=v);else for(u=0;u<n;u++)v=e[u],v<b&&v>-If&&(b=v),v>_&&v<If&&(_=v);e=[b,_],n=2}var M={tozero:l,extrapad:o};function S(E){p=e[E],Gw(p)&&(m=x(E),y=w(E),c?(d=t.c2l(p)-A(E),h=t.c2l(p)+T(E)):(b=p-A(E),_=p+T(E),s&&b<_/10&&(b=_/10),d=t.c2l(b),h=t.c2l(_)),l&&(d=Math.min(0,d),h=Math.max(0,h)),By(d)&&Wd(a,d,y,M),By(h)&&Xd(i,h,m,M))}var L=Math.min(6,n);for(u=0;u<L;u++)S(u);for(u=n-1;u>=L;u--)S(u);return{min:a,max:i,opts:r}}function Wd(t,e,r,a){Vw(t,e,r,a,t5)}function Xd(t,e,r,a){Vw(t,e,r,a,r5)}function Vw(t,e,r,a,i){for(var n=a.tozero,o=a.extrapad,l=!0,s=0;s<t.length&&l;s++){var f=t[s];if(i(f.val,e)&&f.pad>=r&&(f.extrapad||!o)){l=!1;break}else i(e,f.val)&&f.pad<=r&&(o||!f.extrapad)&&(t.splice(s,1),s--)}if(l){var c=n&&e===0;t.push({val:e,pad:c?0:r,extrapad:c?!1:o})}}function By(t){return Gw(t)&&Math.abs(t)<If}function t5(t,e){return t<=e}function r5(t,e){return t>=e}function a5(t,e){var r=e.autorangeoptions;return r&&r.minallowed!==void 0&&ac(e,r.minallowed,r.maxallowed)?r.minallowed:r&&r.clipmin!==void 0&&ac(e,r.clipmin,r.clipmax)?Math.max(t,e.d2l(r.clipmin)):t}function i5(t,e){var r=e.autorangeoptions;return r&&r.maxallowed!==void 0&&ac(e,r.minallowed,r.maxallowed)?r.maxallowed:r&&r.clipmax!==void 0&&ac(e,r.clipmin,r.clipmax)?Math.min(t,e.d2l(r.clipmax)):t}function ac(t,e,r){return e!==void 0&&r!==void 0?(e=t.d2l(e),r=t.d2l(r),e<r):!0}function Ww(t,e){if(!e||!e.autorangeoptions)return t;var r=t[0],a=t[1],i=e.autorangeoptions.include;if(i!==void 0){var n=e.d2l(r),o=e.d2l(a);Ei.isArrayOrTypedArray(i)||(i=[i]);for(var l=0;l<i.length;l++){var s=e.d2l(i[l]);n>=s&&(n=s,r=s),o<=s&&(o=s,a=s)}}return r=a5(r,e),a=i5(a,e),[r,a]}var ma=bt,dr=kt,wo=hr,Wl=ot,ht=we,Do=ht.strTranslate,cn=Tr,n5=Jc,Xl=yt,oa=Et,o5=ti,Gy=Zc,Pr=fr,l5=Pr.ONEMAXYEAR,ic=Pr.ONEAVGYEAR,nc=Pr.ONEMINYEAR,s5=Pr.ONEMAXQUARTER,Yd=Pr.ONEAVGQUARTER,oc=Pr.ONEMINQUARTER,f5=Pr.ONEMAXMONTH,Po=Pr.ONEAVGMONTH,lc=Pr.ONEMINMONTH,la=Pr.ONEWEEK,Hr=Pr.ONEDAY,zi=Hr/2,Qa=Pr.ONEHOUR,Yl=Pr.ONEMIN,sc=Pr.ONESEC,c5=Pr.ONEMILLI,u5=Pr.ONEMICROSEC,gn=Pr.MINUS_SIGN,eu=Pr.BADNUM,qd={K:"zeroline"},Zd={K:"gridline",L:"path"},Kd={K:"minor-gridline",L:"path"},Xw={K:"tick",L:"path"},Uy={K:"tick",L:"text"},Vy={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},tu=Vr,Cl=tu.MID_SHIFT,bn=tu.CAP_SHIFT,ql=tu.LINE_SPACING,v5=tu.OPPOSITE_SIDE,fc=3,De=sw.exports={};De.setConvert=cp;var d5=jw,hi=cr,h5=hi.idSort,p5=hi.isLinked;De.id2name=hi.id2name;De.name2id=hi.name2id;De.cleanId=hi.cleanId;De.list=hi.list;De.listIds=hi.listIds;De.getFromId=hi.getFromId;De.getFromTrace=hi.getFromTrace;var Yw=bs;De.getAutoRange=Yw.getAutoRange;De.findExtremes=Yw.findExtremes;var m5=1e-4;function dp(t){var e=(t[1]-t[0])*m5;return[t[0]-e,t[1]+e]}De.coerceRef=function(t,e,r,a,i,n){var o=a.charAt(a.length-1),l=r._fullLayout._subplots[o+"axis"],s=a+"ref",f={};return i||(i=l[0]||(typeof n=="string"?n:n[0])),n||(n=i),l=l.concat(l.map(function(c){return c+" domain"})),f[s]={valType:"enumerated",values:l.concat(n?typeof n=="string"?[n]:n:[]),dflt:i},ht.coerce(t,e,f,s)};De.getRefType=function(t){return t===void 0?t:t==="paper"?"paper":t==="pixel"?"pixel":/( domain)$/.test(t)?"domain":"range"};De.coercePosition=function(t,e,r,a,i,n){var o,l,s=De.getRefType(a);if(s!=="range")o=ht.ensureNumber,l=r(i,n);else{var f=De.getFromId(e,a);n=f.fraction2r(n),l=r(i,n),o=f.cleanPos}t[i]=o(l)};De.cleanPosition=function(t,e,r){var a=r==="paper"||r==="pixel"?ht.ensureNumber:De.getFromId(e,r).cleanPos;return a(t)};De.redrawComponents=function(t,e){e=e||De.listIds(t);var r=t._fullLayout;function a(i,n,o,l){for(var s=Wl.getComponentMethod(i,n),f={},c=0;c<e.length;c++)for(var u=r[De.id2name(e[c])],v=u[o],p=0;p<v.length;p++){var d=v[p];if(!f[d]&&(s(t,d),f[d]=1,l))return}}a("annotations","drawOne","_annIndices"),a("shapes","drawOne","_shapeIndices"),a("images","draw","_imgIndices",!0),a("selections","drawOne","_selectionIndices")};var y5=De.getDataConversions=function(t,e,r,a){var i,n=r==="x"||r==="y"||r==="z"?r:a;if(ht.isArrayOrTypedArray(n)){if(i={type:d5(a,void 0,{autotypenumbers:t._fullLayout.autotypenumbers}),_categories:[]},De.setConvert(i),i.type==="category")for(var o=0;o<a.length;o++)i.d2c(a[o])}else i=De.getFromTrace(t,e,n);return i?{d2c:i.d2c,c2d:i.c2d}:n==="ids"?{d2c:Xy,c2d:Xy}:{d2c:Wy,c2d:Wy}};function Wy(t){return+t}function Xy(t){return String(t)}De.getDataToCoordFunc=function(t,e,r,a){return y5(t,e,r,a).d2c};De.counterLetter=function(t){var e=t.charAt(0);if(e==="x")return"y";if(e==="y")return"x"};De.minDtick=function(t,e,r,a){["log","category","multicategory"].indexOf(t.type)!==-1||!a?t._minDtick=0:t._minDtick===void 0?(t._minDtick=e,t._forceTick0=r):t._minDtick&&((t._minDtick/e+1e-6)%1<2e-6&&((r-t._forceTick0)/e%1+1.000001)%1<2e-6?(t._minDtick=e,t._forceTick0=r):((e/t._minDtick+1e-6)%1>2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0))};De.saveRangeInitial=function(t,e){for(var r=De.list(t,"",!0),a=!1,i=0;i<r.length;i++){var n=r[i],o=n._rangeInitial0===void 0&&n._rangeInitial1===void 0,l=o||n.range[0]!==n._rangeInitial0||n.range[1]!==n._rangeInitial1,s=n.autorange;(o&&s!==!0||e&&l)&&(n._rangeInitial0=s==="min"||s==="max reversed"?void 0:n.range[0],n._rangeInitial1=s==="max"||s==="min reversed"?void 0:n.range[1],n._autorangeInitial=s,a=!0)}return a};De.saveShowSpikeInitial=function(t,e){for(var r=De.list(t,"",!0),a=!1,i="on",n=0;n<r.length;n++){var o=r[n],l=o._showSpikeInitial===void 0,s=l||o.showspikes!==o._showspikes;(l||e&&s)&&(o._showSpikeInitial=o.showspikes,a=!0),i==="on"&&!o.showspikes&&(i="off")}return t._fullLayout._cartesianSpikesEnabled=i,a};De.autoBin=function(t,e,r,a,i,n){var o=ht.aggNums(Math.min,null,t),l=ht.aggNums(Math.max,null,t);if(e.type==="category"||e.type==="multicategory")return{start:o-.5,end:l+.5,size:Math.max(1,Math.round(n)||1),_dataSpan:l-o};i||(i=e.calendar);var s;if(e.type==="log"?s={type:"linear",range:[o,l]}:s={type:e.type,range:ht.simpleMap([o,l],e.c2r,0,i),calendar:i},De.setConvert(s),n=n&&Gy.dtick(n,s.type),n)s.dtick=n,s.tick0=Gy.tick0(void 0,s.type,i);else{var f;if(r)f=(l-o)/r;else{var c=ht.distinctVals(t),u=Math.pow(10,Math.floor(Math.log(c.minDiff)/Math.LN10)),v=u*ht.roundUp(c.minDiff/u,[.9,1.9,4.9,9.9],!0);f=Math.max(v,2*ht.stdev(t)/Math.pow(t.length,a?.25:.4)),dr(f)||(f=1)}De.autoTicks(s,f)}var p=s.dtick,d=De.tickIncrement(De.tickFirst(s),p,"reverse",i),h,m;if(typeof p=="number")d=g5(d,t,s,o,l),m=1+Math.floor((l-d)/p),h=d+m*p;else for(s.dtick.charAt(0)==="M"&&(d=b5(d,t,p,o,i)),h=d,m=0;h<=l;)h=De.tickIncrement(h,p,!1,i),m++;return{start:e.c2r(d,0,i),end:e.c2r(h,0,i),size:p,_dataSpan:l-o}};function g5(t,e,r,a,i){var n=0,o=0,l=0,s=0;function f(p){return(1+(p-t)*100/r.dtick)%100<2}for(var c=0;c<e.length;c++)e[c]%1===0?l++:dr(e[c])||s++,f(e[c])&&n++,f(e[c]+r.dtick/2)&&o++;var u=e.length-s;if(l===u&&r.type!=="date")r.dtick<1?t=a-.5*r.dtick:(t-=.5,t+r.dtick<a&&(t+=r.dtick));else if(o<u*.1&&(n>u*.3||f(a)||f(i))){var v=r.dtick/2;t+=t+v<a?v:-v}return t}function b5(t,e,r,a,i){var n=ht.findExactDates(e,i),o=.8;if(n.exactDays>o){var l=Number(r.substr(1));n.exactYears>o&&l%12===0?t=De.tickIncrement(t,"M6","reverse")+Hr*1.5:n.exactMonths>o?t=De.tickIncrement(t,"M1","reverse")+Hr*15.5:t-=zi;var s=De.tickIncrement(t,r);if(s<=a)return s}return t}De.prepMinorTicks=function(t,e,r){if(!e.minor.dtick){delete t.dtick;var a=e.dtick&&dr(e._tmin),i;if(a){var n=De.tickIncrement(e._tmin,e.dtick,!0);i=[e._tmin,n*.99+e._tmin*.01]}else{var o=ht.simpleMap(e.range,e.r2l);i=[o[0],.8*o[0]+.2*o[1]]}if(t.range=ht.simpleMap(i,e.l2r),t._isMinor=!0,De.prepTicks(t,r),a){var l=dr(e.dtick),s=dr(t.dtick),f=l?e.dtick:+e.dtick.substring(1),c=s?t.dtick:+t.dtick.substring(1);l&&s?Qu(f,c)?f===2*la&&c===2*Hr&&(t.dtick=la):f===2*la&&c===3*Hr?t.dtick=la:f===la&&!(e._input.minor||{}).nticks?t.dtick=Hr:Yy(f/c,2.5)?t.dtick=f/2:t.dtick=f:String(e.dtick).charAt(0)==="M"?s?t.dtick="M1":Qu(f,c)?f>=12&&c===2&&(t.dtick="M3"):t.dtick=e.dtick:String(t.dtick).charAt(0)==="L"?String(e.dtick).charAt(0)==="L"?Qu(f,c)||(t.dtick=Yy(f/c,2.5)?e.dtick/2:e.dtick):t.dtick="D1":t.dtick==="D2"&&+e.dtick>1&&(t.dtick=1)}t.range=e.range}e.minor._tick0Init===void 0&&(t.tick0=e.tick0)};function Qu(t,e){return Math.abs((t/e+.5)%1-.5)<.001}function Yy(t,e){return Math.abs(t/e-1)<.001}De.prepTicks=function(t,e){var r=ht.simpleMap(t.range,t.r2l,void 0,void 0,e);if(t.tickmode==="auto"||!t.dtick){var a=t.nticks,i;a||(t.type==="category"||t.type==="multicategory"?(i=t.tickfont?ht.bigFont(t.tickfont.size||12):15,a=t._length/i):(i=t._id.charAt(0)==="y"?40:80,a=ht.constrain(t._length/i,4,9)+1),t._name==="radialaxis"&&(a*=2)),t.minor&&t.minor.tickmode!=="array"||t.tickmode==="array"&&(a*=100),t._roughDTick=Math.abs(r[1]-r[0])/a,De.autoTicks(t,t._roughDTick),t._minDtick>0&&t.dtick<t._minDtick*2&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}t.ticklabelmode==="period"&&x5(t),t.tick0||(t.tick0=t.type==="date"?"2000-01-01":0),t.type==="date"&&t.dtick<.1&&(t.dtick=.1),Qw(t)};function Ju(t){return+t.substring(1)}function x5(t){var e;function r(){return!(dr(t.dtick)||t.dtick.charAt(0)!=="M")}var a=r(),i=De.getTickFormat(t);if(i){var n=t._dtickInit!==t.dtick;/%[fLQsSMX]/.test(i)||(/%[HI]/.test(i)?(e=Qa,n&&!a&&t.dtick<Qa&&(t.dtick=Qa)):/%p/.test(i)?(e=zi,n&&!a&&t.dtick<zi&&(t.dtick=zi)):/%[Aadejuwx]/.test(i)?(e=Hr,n&&!a&&t.dtick<Hr&&(t.dtick=Hr)):/%[UVW]/.test(i)?(e=la,n&&!a&&t.dtick<la&&(t.dtick=la)):/%[Bbm]/.test(i)?(e=Po,n&&(a?Ju(t.dtick)<1:t.dtick<lc)&&(t.dtick="M1")):/%[q]/.test(i)?(e=Yd,n&&(a?Ju(t.dtick)<3:t.dtick<oc)&&(t.dtick="M3")):/%[Yy]/.test(i)&&(e=ic,n&&(a?Ju(t.dtick)<12:t.dtick<nc)&&(t.dtick="M12")))}a=r(),a&&t.tick0===t._dowTick0&&(t.tick0=t._rawTick0),t._definedDelta=e}function _5(t,e,r){for(var a=0;a<t.length;a++){var i=t[a].value,n=a,o=a+1;a<t.length-1?(n=a,o=a+1):a>0?(n=a-1,o=a):(n=a,o=a);var l=t[n].value,s=t[o].value,f=Math.abs(s-l),c=r||f,u=0;c>=nc?f>=nc&&f<=l5?u=f:u=ic:r===Yd&&c>=oc?f>=oc&&f<=s5?u=f:u=Yd:c>=lc?f>=lc&&f<=f5?u=f:u=Po:r===la&&c>=la?u=la:c>=Hr?u=Hr:r===zi&&c>=zi?u=zi:r===Qa&&c>=Qa&&(u=Qa);var v;u>=f&&(u=f,v=!0);var p=i+u;if(e.rangebreaks&&u>0){for(var d=84,h=0,m=0;m<d;m++){var y=(m+.5)/d;e.maskBreaks(i*(1-y)+y*p)!==eu&&h++}u*=h/d,u||(t[a].drop=!0),v&&f>la&&(u=f)}(u>0||a===0)&&(t[a].periodX=i+u/2)}}De.calcTicks=function(e,r){for(var a=e.type,i=e.calendar,n=e.ticklabelstep,o=e.ticklabelmode==="period",l=e.range[0]>e.range[1],s=!e.ticklabelindex||ht.isArrayOrTypedArray(e.ticklabelindex)?e.ticklabelindex:[e.ticklabelindex],f=ht.simpleMap(e.range,e.r2l,void 0,void 0,r),c=f[1]<f[0],u=Math.min(f[0],f[1]),v=Math.max(f[0],f[1]),p=Math.max(1e3,e._length||0),d=[],h=[],m=[],y=[],b=[],_=e.minor&&(e.minor.ticks||e.minor.showgrid),g=1;g>=(_?0:1);g--){var x=!g;g?(e._dtickInit=e.dtick,e._tick0Init=e.tick0):(e.minor._dtickInit=e.minor.dtick,e.minor._tick0Init=e.minor.tick0);var w=g?e:ht.extendFlat({},e,e.minor);if(x?De.prepMinorTicks(w,e,r):De.prepTicks(w,r),w.tickmode==="array"){g?(m=[],d=qy(e,!x)):(y=[],h=qy(e,!x));continue}if(w.tickmode==="sync"){m=[],d=w5(e);continue}var T=dp(f),A=T[0],M=T[1],S=dr(w.dtick),L=a==="log"&&!(S||w.dtick.charAt(0)==="L"),E=De.tickFirst(w,r);if(g){if(e._tmin=E,E<A!==c)break;(a==="category"||a==="multicategory")&&(M=c?Math.max(-.5,M):Math.min(e._categories.length-.5,M))}var F=null,N=E,z;if(g){var H;S?H=e.dtick:a==="date"?typeof e.dtick=="string"&&e.dtick.charAt(0)==="M"&&(H=Po*e.dtick.substring(1)):H=e._roughDTick,z=Math.round((e.r2l(N)-e.r2l(e.tick0))/H)-1}var D=w.dtick;for(w.rangebreaks&&w._tick0Init!==w.tick0&&(N=ev(N,e),c||(N=De.tickIncrement(N,D,!c,i))),g&&o&&(N=De.tickIncrement(N,D,!c,i),z--);c?N>=M:N<=M;N=De.tickIncrement(N,D,c,i)){if(g&&z++,w.rangebreaks&&!c){if(N<A)continue;if(w.maskBreaks(N)===eu&&ev(N,w)>=v)break}if(m.length>p||N===F)break;F=N;var P={value:N};g?(L&&N!==(N|0)&&(P.simpleLabel=!0),n>1&&z%n&&(P.skipLabel=!0),m.push(P)):(P.minor=!0,y.push(P))}}if(!y||y.length<2)s=!1;else{var k=(y[1].value-y[0].value)*(l?-1:1);W5(k,e.tickformat)||(s=!1)}if(!s)b=m;else{var C=m.concat(y);o&&m.length&&(C=C.slice(1)),C=C.sort(function(oe,pe){return oe.value-pe.value}).filter(function(oe,pe,Me){return pe===0||oe.value!==Me[pe-1].value});var $=C.map(function(oe,pe){return oe.minor===void 0&&!oe.skipLabel?pe:null}).filter(function(oe){return oe!==null});$.forEach(function(oe){s.map(function(pe){var Me=oe+pe;Me>=0&&Me<C.length&&ht.pushUnique(b,C[Me])})})}if(_){var R=e.minor.ticks==="inside"&&e.ticks==="outside"||e.minor.ticks==="outside"&&e.ticks==="inside";if(!R){for(var j=m.map(function(oe){return oe.value}),G=[],Y=0;Y<y.length;Y++){var O=y[Y],K=O.value;if(j.indexOf(K)===-1){for(var W=!1,X=0;!W&&X<m.length;X++)1e7+m[X].value===1e7+K&&(W=!0);W||G.push(O)}}y=G}}o&&_5(b,e,e._definedDelta);var B;if(e.rangebreaks){var ee=e._id.charAt(0)==="y",ae=1;e.tickmode==="auto"&&(ae=e.tickfont?e.tickfont.size:12);var de=NaN;for(B=m.length-1;B>-1;B--){if(m[B].drop){m.splice(B,1);continue}m[B].value=ev(m[B].value,e);var fe=e.c2p(m[B].value);(ee?de>fe-ae:de<fe+ae)?m.splice(c?B+1:B,1):de=fe}}mp(e)&&Math.abs(f[1]-f[0])===360&&m.pop(),e._tmax=(m[m.length-1]||{}).value,e._prevDateHead="",e._inCalcTicks=!0;var q,te=function(oe){oe.text="",e._prevDateHead=q};m=m.concat(y);function le(oe,pe){var Me=De.tickText(oe,pe.value,!1,pe.simpleLabel),ve=pe.periodX;return ve!==void 0&&(Me.periodX=ve,(ve>v||ve<u)&&(ve>v&&(Me.periodX=v),ve<u&&(Me.periodX=u),te(Me))),Me}var ce;for(B=0;B<m.length;B++){var ye=m[B].minor,ue=m[B].value;ye?(s&&b.indexOf(m[B])!==-1?ce=le(e,m[B]):ce={x:ue},ce.minor=!0,h.push(ce)):(q=e._prevDateHead,ce=le(e,m[B]),(m[B].skipLabel||s&&b.indexOf(m[B])===-1)&&te(ce),d.push(ce))}return d=d.concat(h),e._inCalcTicks=!1,o&&d.length&&(d[0].noTick=!0),d};function qw(t,e){return t.rangebreaks&&(e=e.filter(function(r){return t.maskBreaks(r.x)!==eu})),e}function w5(t){var e=t._mainAxis,r=[];if(e._vals){for(var a=0;a<e._vals.length;a++)if(!e._vals[a].noTick){var i=e.l2p(e._vals[a].x),n=t.p2l(i),o=De.tickText(t,n);e._vals[a].minor&&(o.minor=!0,o.text=""),r.push(o)}}return r=qw(t,r),r}function qy(t,e){var r=ht.simpleMap(t.range,t.r2l),a=dp(r),i=Math.min(a[0],a[1]),n=Math.max(a[0],a[1]),o=t.type==="category"?t.d2l_noadd:t.d2l;t.type==="log"&&String(t.dtick).charAt(0)!=="L"&&(t.dtick="L"+Math.pow(10,Math.floor(Math.min(t.range[0],t.range[1]))-1));for(var l=[],s=0;s<=1;s++)if(!(e!==void 0&&(e&&s||e===!1&&!s))&&!(s&&!t.minor)){var f=s?t.minor.tickvals:t.tickvals,c=s?[]:t.ticktext;if(f){ht.isArrayOrTypedArray(c)||(c=[]);for(var u=0;u<f.length;u++){var v=o(f[u]);if(v>i&&v<n){var p=De.tickText(t,v,!1,String(c[u]));s&&(p.minor=!0,p.text=""),l.push(p)}}}}return l=qw(t,l),l}var Xs=[2,5,10],Zy=[1,2,3,6,12],Ky=[1,2,5,10,15,30],T5=[1,2,3,7,14],Zw=[-.046,0,.301,.477,.602,.699,.778,.845,.903,.954,1],Kw=[-.301,0,.301,.699,1],k5=[15,30,45,90,180];function Va(t,e,r){return e*ht.roundUp(t/e,r)}De.autoTicks=function(t,e,r){var a;function i(u){return Math.pow(u,Math.floor(Math.log(e)/Math.LN10))}if(t.type==="date"){t.tick0=ht.dateTick0(t.calendar,0);var n=2*e;if(n>ic)e/=ic,a=i(10),t.dtick="M"+12*Va(e,a,Xs);else if(n>Po)e/=Po,t.dtick="M"+Va(e,1,Zy);else if(n>Hr){if(t.dtick=Va(e,Hr,t._hasDayOfWeekBreaks?[1,2,7,14]:T5),!r){var o=De.getTickFormat(t),l=t.ticklabelmode==="period";l&&(t._rawTick0=t.tick0),/%[uVW]/.test(o)?t.tick0=ht.dateTick0(t.calendar,2):t.tick0=ht.dateTick0(t.calendar,1),l&&(t._dowTick0=t.tick0)}}else n>Qa?t.dtick=Va(e,Qa,Zy):n>Yl?t.dtick=Va(e,Yl,Ky):n>sc?t.dtick=Va(e,sc,Ky):(a=i(10),t.dtick=Va(e,a,Xs))}else if(t.type==="log"){t.tick0=0;var s=ht.simpleMap(t.range,t.r2l);if(t._isMinor&&(e*=1.5),e>.7)t.dtick=Math.ceil(e);else if(Math.abs(s[1]-s[0])<1){var f=1.5*Math.abs((s[1]-s[0])/e);e=Math.abs(Math.pow(10,s[1])-Math.pow(10,s[0]))/f,a=i(10),t.dtick="L"+Va(e,a,Xs)}else t.dtick=e>.3?"D2":"D1"}else t.type==="category"||t.type==="multicategory"?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):mp(t)?(t.tick0=0,a=1,t.dtick=Va(e,a,k5)):(t.tick0=0,a=i(10),t.dtick=Va(e,a,Xs));if(t.dtick===0&&(t.dtick=1),!dr(t.dtick)&&typeof t.dtick!="string"){var c=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(c)}};function Qw(t){var e=t.dtick;if(t._tickexponent=0,!dr(e)&&typeof e!="string"&&(e=1),(t.type==="category"||t.type==="multicategory")&&(t._tickround=null),t.type==="date"){var r=t.r2l(t.tick0),a=t.l2r(r).replace(/(^-|i)/g,""),i=a.length;if(String(e).charAt(0)==="M")i>10||a.substr(5)!=="01-01"?t._tickround="d":t._tickround=+e.substr(1)%12===0?"y":"m";else if(e>=Hr&&i<=10||e>=Hr*15)t._tickround="d";else if(e>=Yl&&i<=16||e>=Qa)t._tickround="M";else if(e>=sc&&i<=19||e>=Yl)t._tickround="S";else{var n=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(i,n)-20,t._tickround<0&&(t._tickround=4)}}else if(dr(e)||e.charAt(0)==="L"){var o=t.range.map(t.r2d||Number);dr(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(o[0]),Math.abs(o[1])),s=Math.floor(Math.log(l)/Math.LN10+.01),f=t.minexponent===void 0?3:t.minexponent;Math.abs(s)>f&&(cc(t.exponentformat)&&!hp(s)?t._tickexponent=3*Math.round((s-1)/3):t._tickexponent=s)}else t._tickround=null}De.tickIncrement=function(t,e,r,a){var i=r?-1:1;if(dr(e))return ht.increment(t,i*e);var n=e.charAt(0),o=i*Number(e.substr(1));if(n==="M")return ht.incrementMonth(t,o,a);if(n==="L")return Math.log(Math.pow(10,t)+o)/Math.LN10;if(n==="D"){var l=e==="D2"?Kw:Zw,s=t+i*.01,f=ht.roundUp(ht.mod(s,1),l,r);return Math.floor(s)+Math.log(ma.round(Math.pow(10,f),1))/Math.LN10}throw"unrecognized dtick "+String(e)};De.tickFirst=function(t,e){var r=t.r2l||Number,a=ht.simpleMap(t.range,r,void 0,void 0,e),i=a[1]<a[0],n=i?Math.floor:Math.ceil,o=dp(a)[0],l=t.dtick,s=r(t.tick0);if(dr(l)){var f=n((o-s)/l)*l+s;return(t.type==="category"||t.type==="multicategory")&&(f=ht.constrain(f,0,t._categories.length-1)),f}var c=l.charAt(0),u=Number(l.substr(1));if(c==="M"){for(var v=0,p=s,d,h,m;v<10;){if(d=De.tickIncrement(p,l,i,t.calendar),(d-o)*(p-o)<=0)return i?Math.min(p,d):Math.max(p,d);h=(o-(p+d)/2)/(d-p),m=c+(Math.abs(Math.round(h))||1)*u,p=De.tickIncrement(p,m,h<0?!i:i,t.calendar),v++}return ht.error("tickFirst did not converge",t),p}else{if(c==="L")return Math.log(n((Math.pow(10,o)-s)/u)*u+s)/Math.LN10;if(c==="D"){var y=l==="D2"?Kw:Zw,b=ht.roundUp(ht.mod(o,1),y,i);return Math.floor(o)+Math.log(ma.round(Math.pow(10,b),1))/Math.LN10}else throw"unrecognized dtick "+String(l)}};De.tickText=function(t,e,r,a){var i=Jw(t,e),n=t.tickmode==="array",o=r||n,l=t.type,s=l==="category"?t.d2l_noadd:t.d2l,f,c=function(m){var y=t.l2p(m);return y>=0&&y<=t._length?m:null};if(n&&ht.isArrayOrTypedArray(t.ticktext)){var u=ht.simpleMap(t.range,t.r2l),v=(Math.abs(u[1]-u[0])-(t._lBreaks||0))/1e4;for(f=0;f<t.ticktext.length&&!(Math.abs(e-s(t.tickvals[f]))<v);f++);if(f<t.ticktext.length)return i.text=String(t.ticktext[f]),i.xbnd=[c(i.x-.5),c(i.x+t.dtick-.5)],i}function p(m){if(m===void 0)return!0;if(r)return m==="none";var y={first:t._tmin,last:t._tmax}[m];return m!=="all"&&e!==y}var d=r?"never":t.exponentformat!=="none"&&p(t.showexponent)?"hide":"";if(l==="date"?A5(t,i,r,o):l==="log"?M5(t,i,r,o,d):l==="category"?S5(t,i):l==="multicategory"?L5(t,i,r):mp(t)?D5(t,i,r,o,d):C5(t,i,r,o,d),a||(t.tickprefix&&!p(t.showtickprefix)&&(i.text=t.tickprefix+i.text),t.ticksuffix&&!p(t.showticksuffix)&&(i.text+=t.ticksuffix)),t.labelalias&&t.labelalias.hasOwnProperty(i.text)){var h=t.labelalias[i.text];typeof h=="string"&&(i.text=h)}return(t.tickson==="boundaries"||t.showdividers)&&(i.xbnd=[c(i.x-.5),c(i.x+t.dtick-.5)]),i};De.hoverLabelText=function(t,e,r){r&&(t=ht.extendFlat({},t,{hoverformat:r}));var a=ht.isArrayOrTypedArray(e)?e[0]:e,i=ht.isArrayOrTypedArray(e)?e[1]:void 0;if(i!==void 0&&i!==a)return De.hoverLabelText(t,a,r)+" - "+De.hoverLabelText(t,i,r);var n=t.type==="log"&&a<=0,o=De.tickText(t,t.c2l(n?-a:a),"hover").text;return n?a===0?"0":gn+o:o};function Jw(t,e,r){var a=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||"",fontSize:a.size,font:a.family,fontWeight:a.weight,fontStyle:a.style,fontVariant:a.variant,fontTextcase:a.textcase,fontLineposition:a.lineposition,fontShadow:a.shadow,fontColor:a.color}}function A5(t,e,r,a){var i=t._tickround,n=r&&t.hoverformat||De.getTickFormat(t);a=!n&&a,a&&(dr(i)?i=4:i={y:"m",m:"d",d:"M",M:"S",S:4}[i]);var o=ht.formatDate(e.x,n,i,t._dateFormat,t.calendar,t._extraFormat),l,s=o.indexOf(`
4
- `);if(s!==-1&&(l=o.substr(s+1),o=o.substr(0,s)),a&&(l!==void 0&&(o==="00:00:00"||o==="00:00")?(o=l,l=""):o.length===8&&(o=o.replace(/:00$/,""))),l)if(r)i==="d"?o+=", "+l:o=l+(o?", "+o:"");else if(!t._inCalcTicks||t._prevDateHead!==l)t._prevDateHead=l,o+="<br>"+l;else{var f=Kl(t),c=t._trueSide||t.side;(!f&&c==="top"||f&&c==="bottom")&&(o+="<br> ")}e.text=o}function M5(t,e,r,a,i){var n=t.dtick,o=e.x,l=t.tickformat,s=typeof n=="string"&&n.charAt(0);if(i==="never"&&(i=""),a&&s!=="L"&&(n="L3",s="L"),l||s==="L")e.text=Zl(Math.pow(10,o),t,i,a);else if(dr(n)||s==="D"&&ht.mod(o+.01,1)<.1){var f=Math.round(o),c=Math.abs(f),u=t.exponentformat;u==="power"||cc(u)&&hp(f)?(f===0?e.text=1:f===1?e.text="10":e.text="10<sup>"+(f>1?"":gn)+c+"</sup>",e.fontSize*=1.25):(u==="e"||u==="E")&&c>2?e.text="1"+u+(f>0?"+":gn)+c:(e.text=Zl(Math.pow(10,o),t,"","fakehover"),n==="D1"&&t._id.charAt(0)==="y"&&(e.dy-=e.fontSize/6))}else if(s==="D")e.text=String(Math.round(Math.pow(10,ht.mod(o,1)))),e.fontSize*=.75;else throw"unrecognized dtick "+String(n);if(t.dtick==="D1"){var v=String(e.text).charAt(0);(v==="0"||v==="1")&&(t._id.charAt(0)==="y"?e.dx-=e.fontSize/4:(e.dy+=e.fontSize/2,e.dx+=(t.range[1]>t.range[0]?1:-1)*e.fontSize*(o<0?.5:.25)))}}function S5(t,e){var r=t._categories[Math.round(e.x)];r===void 0&&(r=""),e.text=String(r)}function L5(t,e,r){var a=Math.round(e.x),i=t._categories[a]||[],n=i[1]===void 0?"":String(i[1]),o=i[0]===void 0?"":String(i[0]);r?e.text=o+" - "+n:(e.text=n,e.text2=o)}function C5(t,e,r,a,i){i==="never"?i="":t.showexponent==="all"&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide"),e.text=Zl(e.x,t,i,a)}function D5(t,e,r,a,i){if(t.thetaunit==="radians"&&!r){var n=e.x/180;if(n===0)e.text="0";else{var o=P5(n);if(o[1]>=100)e.text=Zl(ht.deg2rad(e.x),t,i,a);else{var l=e.x<0;o[1]===1?o[0]===1?e.text="π":e.text=o[0]+"π":e.text=["<sup>",o[0],"</sup>","⁄","<sub>",o[1],"</sub>","π"].join(""),l&&(e.text=gn+e.text)}}}else e.text=Zl(e.x,t,i,a)}function P5(t){function e(l,s){return Math.abs(l-s)<=1e-6}function r(l,s){return e(s,0)?l:r(s,l%s)}function a(l){for(var s=1;!e(Math.round(l*s)/s,l);)s*=10;return s}var i=a(t),n=t*i,o=Math.abs(r(n,i));return[Math.round(n/o),Math.round(i/o)]}var $5=["f","p","n","μ","m","","k","M","G","T"];function cc(t){return t==="SI"||t==="B"}function hp(t){return t>14||t<-15}function Zl(t,e,r,a){var i=t<0,n=e._tickround,o=r||e.exponentformat||"B",l=e._tickexponent,s=De.getTickFormat(e),f=e.separatethousands;if(a){var c={exponentformat:o,minexponent:e.minexponent,dtick:e.showexponent==="none"?e.dtick:dr(t)&&Math.abs(t)||1,range:e.showexponent==="none"?e.range.map(e.r2d):[0,t||1]};Qw(c),n=(Number(c._tickround)||0)+4,l=c._tickexponent,e.hoverformat&&(s=e.hoverformat)}if(s)return e._numFormat(s)(t).replace(/-/g,gn);var u=Math.pow(10,-n)/2;if(o==="none"&&(l=0),t=Math.abs(t),t<u)t="0",i=!1;else{if(t+=u,l&&(t*=Math.pow(10,-l),n+=l),n===0)t=String(Math.floor(t));else if(n<0){t=String(Math.round(t)),t=t.substr(0,t.length+n);for(var v=n;v<0;v++)t+="0"}else{t=String(t);var p=t.indexOf(".")+1;p&&(t=t.substr(0,p+n).replace(/\.?0+$/,""))}t=ht.numSeparate(t,e._separators,f)}if(l&&o!=="hide"){cc(o)&&hp(l)&&(o="power");var d;l<0?d=gn+-l:o!=="power"?d="+"+l:d=String(l),o==="e"||o==="E"?t+=o+d:o==="power"?t+="×10<sup>"+d+"</sup>":o==="B"&&l===9?t+="B":cc(o)&&(t+=$5[l/3+5])}return i?gn+t:t}De.getTickFormat=function(t){var e;function r(s){return typeof s!="string"?s:Number(s.replace("M",""))*Po}function a(s,f){var c=["L","D"];if(typeof s==typeof f){if(typeof s=="number")return s-f;var u=c.indexOf(s.charAt(0)),v=c.indexOf(f.charAt(0));return u===v?Number(s.replace(/(L|D)/g,""))-Number(f.replace(/(L|D)/g,"")):u-v}else return typeof s=="number"?1:-1}function i(s,f,c){var u=c||function(d){return d},v=f[0],p=f[1];return(!v&&typeof v!="number"||u(v)<=u(s))&&(!p&&typeof p!="number"||u(p)>=u(s))}function n(s,f){var c=f[0]===null,u=f[1]===null,v=a(s,f[0])>=0,p=a(s,f[1])<=0;return(c||v)&&(u||p)}var o,l;if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":{for(e=0;e<t.tickformatstops.length;e++)if(l=t.tickformatstops[e],l.enabled&&i(t.dtick,l.dtickrange,r)){o=l;break}break}case"log":{for(e=0;e<t.tickformatstops.length;e++)if(l=t.tickformatstops[e],l.enabled&&n(t.dtick,l.dtickrange)){o=l;break}break}}return o?o.value:t.tickformat};De.getSubplots=function(t,e){var r=t._fullLayout._subplots,a=r.cartesian.concat(r.gl2d||[]),i=e?De.findSubplotsWithAxis(a,e):a;return i.sort(function(n,o){var l=n.substr(1).split("y"),s=o.substr(1).split("y");return l[0]===s[0]?+l[1]-+s[1]:+l[0]-+s[0]}),i};De.findSubplotsWithAxis=function(t,e){for(var r=new RegExp(e._id.charAt(0)==="x"?"^"+e._id+"y":e._id+"$"),a=[],i=0;i<t.length;i++){var n=t[i];r.test(n)&&a.push(n)}return a};De.makeClipPaths=function(t){var e=t._fullLayout;if(!e._hasOnlyLargeSploms){var r={_offset:0,_length:e.width,_id:""},a={_offset:0,_length:e.height,_id:""},i=De.list(t,"x",!0),n=De.list(t,"y",!0),o=[],l,s;for(l=0;l<i.length;l++)for(o.push({x:i[l],y:a}),s=0;s<n.length;s++)l===0&&o.push({x:r,y:n[s]}),o.push({x:i[l],y:n[s]});var f=e._clips.selectAll(".axesclip").data(o,function(c){return c.x._id+c.y._id});f.enter().append("clipPath").classed("axesclip",!0).attr("id",function(c){return"clip"+e._uid+c.x._id+c.y._id}).append("rect"),f.exit().remove(),f.each(function(c){ma.select(this).select("rect").attr({x:c.x._offset||0,y:c.y._offset||0,width:c.x._length||1,height:c.y._length||1})})}};De.draw=function(t,e,r){var a=t._fullLayout;e==="redraw"&&a._paper.selectAll("g.subplot").each(function(s){var f=s[0],c=a._plots[f];if(c){var u=c.xaxis,v=c.yaxis;c.xaxislayer.selectAll("."+u._id+"tick").remove(),c.yaxislayer.selectAll("."+v._id+"tick").remove(),c.xaxislayer.selectAll("."+u._id+"tick2").remove(),c.yaxislayer.selectAll("."+v._id+"tick2").remove(),c.xaxislayer.selectAll("."+u._id+"divider").remove(),c.yaxislayer.selectAll("."+v._id+"divider").remove(),c.minorGridlayer&&c.minorGridlayer.selectAll("path").remove(),c.gridlayer&&c.gridlayer.selectAll("path").remove(),c.zerolinelayer&&c.zerolinelayer.selectAll("path").remove(),c.zerolinelayerAbove&&c.zerolinelayerAbove.selectAll("path").remove(),a._infolayer.select(".g-"+u._id+"title").remove(),a._infolayer.select(".g-"+v._id+"title").remove()}});var i=!e||e==="redraw"?De.listIds(t):e,n=De.list(t),o=n.filter(function(s){return s.autoshift}).map(function(s){return s.overlaying});i.map(function(s){var f=De.getFromId(t,s);if(f.tickmode==="sync"&&f.overlaying){var c=i.findIndex(function(u){return u===f.overlaying});c>=0&&i.unshift(i.splice(c,1).shift())}});var l={false:{left:0,right:0}};return ht.syncOrAsync(i.map(function(s){return function(){if(s){var f=De.getFromId(t,s);r||(r={}),r.axShifts=l,r.overlayingShiftedAx=o;var c=De.drawOne(t,f,r);return f._shiftPusher&&eh(f,f._fullDepth||0,l,!0),f._r=f.range.slice(),f._rl=ht.simpleMap(f._r,f.r2l),c}}}))};De.drawOne=function(t,e,r){r=r||{};var a=r.axShifts||{},i=r.overlayingShiftedAx||[],n,o,l;e.setScale();var s=t._fullLayout,f=e._id,c=f.charAt(0),u=De.counterLetter(f),v=s._plots[e._mainSubplot],p=e.zerolinelayer==="above traces";if(!v)return;if(e._shiftPusher=e.autoshift||i.indexOf(e._id)!==-1||i.indexOf(e.overlaying)!==-1,e._shiftPusher&e.anchor==="free"){var d=e.linewidth/2||0;e.ticks==="inside"&&(d+=e.ticklen),eh(e,d,a,!0),eh(e,e.shift||0,a,!1)}(r.skipTitle!==!0||e._shift===void 0)&&(e._shift=V5(e,a));var h=v[c+"axislayer"],m=e._mainLinePosition,y=m+=e._shift,b=e._mainMirrorPosition,_=e._vals=De.calcTicks(e),g=[e.mirror,y,b].join("_");for(n=0;n<_.length;n++)_[n].axInfo=g;e._selections={},e._tickAngles&&(e._prevTickAngles=e._tickAngles),e._tickAngles={},e._depth=null;var x={};function w(ue){var oe=f+(ue||"tick");return x[oe]||(x[oe]=I5(e,oe,y)),x[oe]}if(e.visible){var T=De.makeTransTickFn(e),A=De.makeTransTickLabelFn(e),M,S,L=e.ticks==="inside",E=e.ticks==="outside";if(e.tickson==="boundaries"){var F=E5(e,_);S=De.clipEnds(e,F),M=L?S:F}else S=De.clipEnds(e,_),M=L&&e.ticklabelmode!=="period"?S:_;var N=e._gridVals=S,z=R5(e,_);if(!s._hasOnlyLargeSploms){var H=e._subplotsWith,D={};for(n=0;n<H.length;n++){o=H[n],l=s._plots[o];var P=l[u+"axis"],k=P._mainAxis._id;if(!D[k]){D[k]=1;var C=c==="x"?"M0,"+P._offset+"v"+P._length:"M"+P._offset+",0h"+P._length;De.drawGrid(t,e,{vals:N,counterAxis:P,layer:l.gridlayer.select("."+f),minorLayer:l.minorGridlayer.select("."+f),path:C,transFn:T}),De.drawZeroLine(t,e,{counterAxis:P,layer:p?l.zerolinelayerAbove:l.zerolinelayer,path:C,transFn:T})}}}var $,R=De.getTickSigns(e),j=De.getTickSigns(e,"minor");if(e.ticks||e.minor&&e.minor.ticks){var G=De.makeTickPath(e,y,R[2]),Y=De.makeTickPath(e,y,j[2],{minor:!0}),O,K,W,X;if(e._anchorAxis&&e.mirror&&e.mirror!==!0?(O=De.makeTickPath(e,b,R[3]),K=De.makeTickPath(e,b,j[3],{minor:!0}),W=G+O,X=Y+K):(O="",K="",W=G,X=Y),e.showdividers&&E&&e.tickson==="boundaries"){var B={};for(n=0;n<z.length;n++)B[z[n].x]=1;$=function(ue){return B[ue.x]?O:W}}else $=function(ue){return ue.minor?X:W}}if(De.drawTicks(t,e,{vals:M,layer:h,path:$,transFn:T}),e.mirror==="allticks"){var ee=Object.keys(e._linepositions||{});for(n=0;n<ee.length;n++){o=ee[n],l=s._plots[o];var ae=e._linepositions[o]||[],de=ae[0],fe=ae[1],q=ae[2],te=De.makeTickPath(e,de,q?R[0]:j[0],{minor:q})+De.makeTickPath(e,fe,q?R[1]:j[1],{minor:q});De.drawTicks(t,e,{vals:M,layer:l[c+"axislayer"],path:te,transFn:T})}}var le=[];if(le.push(function(){return De.drawLabels(t,e,{vals:_,layer:h,plotinfo:l,transFn:A,labelFns:De.makeLabelFns(e,y)})}),e.type==="multicategory"){var ce={x:2,y:10}[c];le.push(function(){var ue={x:"height",y:"width"}[c],oe=w()[ue]+ce+(e._tickAngles[f+"tick"]?e.tickfont.size*ql:0);return De.drawLabels(t,e,{vals:z5(e,_),layer:h,cls:f+"tick2",repositionOnUpdate:!0,secondary:!0,transFn:T,labelFns:De.makeLabelFns(e,y+oe*R[4])})}),le.push(function(){return e._depth=R[4]*(w("tick2")[e.side]-y),N5(t,e,{vals:z,layer:h,path:De.makeTickPath(e,y,R[4],{len:e._depth}),transFn:T})})}else e.title.hasOwnProperty("standoff")&&le.push(function(){e._depth=R[4]*(w()[e.side]-y)});var ye=Wl.getComponentMethod("rangeslider","isVisible")(e);return!r.skipTitle&&!(ye&&e.side==="bottom")&&le.push(function(){return H5(t,e)}),le.push(function(){var ue=e.side.charAt(0),oe=v5[e.side].charAt(0),pe=De.getPxPosition(t,e),Me=E?e.ticklen:0,ve,ke,_e,J;(e.automargin||ye||e._shiftPusher)&&(e.type==="multicategory"?ve=w("tick2"):(ve=w(),c==="x"&&ue==="b"&&(e._depth=Math.max(ve.width>0?ve.bottom-pe:0,Me))));var be=0,Z=0;if(e._shiftPusher&&(be=Math.max(Me,ve.height>0?ue==="l"?pe-ve.left:ve.right-pe:0),e.title.text!==s._dfltTitle[c]&&(Z=(e._titleStandoff||0)+(e._titleScoot||0),ue==="l"&&(Z+=Jy(e))),e._fullDepth=Math.max(be,Z)),e.automargin){ke={x:0,y:0,r:0,l:0,t:0,b:0};var me=[0,1],ge=typeof e._shift=="number"?e._shift:0;if(c==="x"){if(ue==="b"?ke[ue]=e._depth:(ke[ue]=e._depth=Math.max(ve.width>0?pe-ve.top:0,Me),me.reverse()),ve.width>0){var Pe=ve.right-(e._offset+e._length);Pe>0&&(ke.xr=1,ke.r=Pe);var Ee=e._offset-ve.left;Ee>0&&(ke.xl=0,ke.l=Ee)}}else if(ue==="l"?(e._depth=Math.max(ve.height>0?pe-ve.left:0,Me),ke[ue]=e._depth-ge):(e._depth=Math.max(ve.height>0?ve.right-pe:0,Me),ke[ue]=e._depth+ge,me.reverse()),ve.height>0){var Le=ve.bottom-(e._offset+e._length);Le>0&&(ke.yb=0,ke.b=Le);var Ae=e._offset-ve.top;Ae>0&&(ke.yt=1,ke.t=Ae)}ke[u]=e.anchor==="free"?e.position:e._anchorAxis.domain[me[0]],e.title.text!==s._dfltTitle[c]&&(ke[ue]+=Jy(e)+(e.title.standoff||0)),e.mirror&&e.anchor!=="free"&&(_e={x:0,y:0,r:0,l:0,t:0,b:0},_e[oe]=e.linewidth,e.mirror&&e.mirror!==!0&&(_e[oe]+=Me),e.mirror===!0||e.mirror==="ticks"?_e[u]=e._anchorAxis.domain[me[1]]:(e.mirror==="all"||e.mirror==="allticks")&&(_e[u]=[e._counterDomainMin,e._counterDomainMax][me[1]]))}ye&&(J=Wl.getComponentMethod("rangeslider","autoMarginOpts")(t,e)),typeof e.automargin=="string"&&(Qy(ke,e.automargin),Qy(_e,e.automargin)),wo.autoMargin(t,pp(e),ke),wo.autoMargin(t,tT(e),_e),wo.autoMargin(t,rT(e),J)}),ht.syncOrAsync(le)}};function Qy(t,e){if(t){var r=Object.keys(Vy).reduce(function(a,i){return e.indexOf(i)!==-1&&Vy[i].forEach(function(n){a[n]=1}),a},{});Object.keys(t).forEach(function(a){r[a]||(a.length===1?t[a]=0:delete t[a])})}}function E5(t,e){var r=[],a,i=function(n,o){var l=n.xbnd[o];l!==null&&r.push(ht.extendFlat({},n,{x:l}))};if(e.length){for(a=0;a<e.length;a++)i(e[a],0);i(e[a-1],1)}return r}function z5(t,e){for(var r=[],a={},i=0;i<e.length;i++){var n=e[i];a[n.text2]?a[n.text2].push(n.x):a[n.text2]=[n.x]}for(var o in a)r.push(Jw(t,ht.interp(a[o],.5),o));return r}function R5(t,e){var r=[],a,i,n=e.length&&e[e.length-1].x<e[0].x,o=function(s,f){var c=s.xbnd[f];c!==null&&r.push(ht.extendFlat({},s,{x:c}))};if(t.showdividers&&e.length){for(a=0;a<e.length;a++){var l=e[a];l.text2!==i&&o(l,n?1:0),i=l.text2}o(e[a-1],n?0:1)}return r}function I5(t,e,r){var a,i,n,o;if(t._selections[e].size())a=1/0,i=-1/0,n=1/0,o=-1/0,t._selections[e].each(function(){var s=Jd(this),f=oa.bBox(s.node().parentNode);a=Math.min(a,f.top),i=Math.max(i,f.bottom),n=Math.min(n,f.left),o=Math.max(o,f.right)});else{var l=De.makeLabelFns(t,r);a=i=l.yFn({dx:0,dy:0,fontSize:0}),n=o=l.xFn({dx:0,dy:0,fontSize:0})}return{top:a,bottom:i,left:n,right:o,height:i-a,width:o-n}}De.getTickSigns=function(t,e){var r=t._id.charAt(0),a={x:"top",y:"right"}[r],i=t.side===a?1:-1,n=[-1,1,i,-i],o=e?(t.minor||{}).ticks:t.ticks;return o!=="inside"==(r==="x")&&(n=n.map(function(l){return-l})),t.side&&n.push({l:-1,t:-1,r:1,b:1}[t.side.charAt(0)]),n};De.makeTransTickFn=function(t){return t._id.charAt(0)==="x"?function(e){return Do(t._offset+t.l2p(e.x),0)}:function(e){return Do(0,t._offset+t.l2p(e.x))}};De.makeTransTickLabelFn=function(t){var e=F5(t),r=t.ticklabelshift||0,a=t.ticklabelstandoff||0,i=e[0],n=e[1],o=t.range[0]>t.range[1],l=t.ticklabelposition&&t.ticklabelposition.indexOf("inside")!==-1,s=!l;if(r){var f=o?-1:1;r=r*f}if(a){var c=t.side,u=l&&(c==="top"||c==="left")||s&&(c==="bottom"||c==="right")?1:-1;a=a*u}return t._id.charAt(0)==="x"?function(v){return Do(i+t._offset+t.l2p(Qd(v))+r,n+a)}:function(v){return Do(n+a,i+t._offset+t.l2p(Qd(v))+r)}};function Qd(t){return t.periodX!==void 0?t.periodX:t.x}function F5(t){var e=t.ticklabelposition||"",r=t.tickson||"",a=function(d){return e.indexOf(d)!==-1},i=a("top"),n=a("left"),o=a("right"),l=a("bottom"),s=a("inside"),f=r!=="boundaries"&&(l||n||i||o);if(!f&&!s)return[0,0];var c=t.side,u=f?(t.tickwidth||0)/2:0,v=fc,p=t.tickfont?t.tickfont.size:12;return(l||i)&&(u+=p*bn,v+=(t.linewidth||0)/2),(n||o)&&(u+=(t.linewidth||0)/2,v+=fc),s&&c==="top"&&(v-=p*(1-bn)),(n||i)&&(u=-u),(c==="bottom"||c==="right")&&(v=-v),[f?u:0,s?v:0]}De.makeTickPath=function(t,e,r,a){a||(a={});var i=a.minor;if(i&&!t.minor)return"";var n=a.len!==void 0?a.len:i?t.minor.ticklen:t.ticklen,o=t._id.charAt(0),l=(t.linewidth||1)/2;return o==="x"?"M0,"+(e+l*r)+"v"+n*r:"M"+(e+l*r)+",0h"+n*r};De.makeLabelFns=function(t,e,r){var a=t.ticklabelposition||"",i=t.tickson||"",n=function(F){return a.indexOf(F)!==-1},o=n("top"),l=n("left"),s=n("right"),f=n("bottom"),c=i!=="boundaries"&&(f||l||o||s),u=n("inside"),v=a==="inside"&&t.ticks==="inside"||!u&&t.ticks==="outside"&&i!=="boundaries",p=0,d=0,h=v?t.ticklen:0;if(u?h*=-1:c&&(h=0),v&&(p+=h,r)){var m=ht.deg2rad(r);p=h*Math.cos(m)+1,d=h*Math.sin(m)}t.showticklabels&&(v||t.showline)&&(p+=.2*t.tickfont.size),p+=(t.linewidth||1)/2*(u?-1:1);var y={labelStandoff:p,labelShift:d},b,_,g,x,w=0,T=t.side,A=t._id.charAt(0),M=t.tickangle,S;if(A==="x")S=!u&&T==="bottom"||u&&T==="top",x=S?1:-1,u&&(x*=-1),b=d*x,_=e+p*x,g=S?1:-.2,Math.abs(M)===90&&(u?g+=Cl:M===-90&&T==="bottom"?g=bn:M===90&&T==="top"?g=Cl:g=.5,w=Cl/2*(M/90)),y.xFn=function(F){return F.dx+b+w*F.fontSize},y.yFn=function(F){return F.dy+_+F.fontSize*g},y.anchorFn=function(F,N){if(c){if(l)return"end";if(s)return"start"}return!dr(N)||N===0||N===180?"middle":N*x<0!==u?"end":"start"},y.heightFn=function(F,N,z){return N<-60||N>60?-.5*z:t.side==="top"!==u?-z:0};else if(A==="y"){if(S=!u&&T==="left"||u&&T==="right",x=S?1:-1,u&&(x*=-1),b=p,_=d*x,g=0,!u&&Math.abs(M)===90&&(M===-90&&T==="left"||M===90&&T==="right"?g=bn:g=.5),u){var L=dr(M)?+M:0;if(L!==0){var E=ht.deg2rad(L);w=Math.abs(Math.sin(E))*bn*x,g=0}}y.xFn=function(F){return F.dx+e-(b+F.fontSize*g)*x+w*F.fontSize},y.yFn=function(F){return F.dy+_+F.fontSize*Cl},y.anchorFn=function(F,N){return dr(N)&&Math.abs(N)===90?"middle":S?"end":"start"},y.heightFn=function(F,N,z){return t.side==="right"&&(N*=-1),N<-30?-z:N<30?-.5*z:0}}return y};function ru(t){return[t.text,t.x,t.axInfo,t.font,t.fontSize,t.fontColor].join("_")}De.drawTicks=function(t,e,r){r=r||{};var a=e._id+"tick",i=[].concat(e.minor&&e.minor.ticks?r.vals.filter(function(o){return o.minor&&!o.noTick}):[]).concat(e.ticks?r.vals.filter(function(o){return!o.minor&&!o.noTick}):[]),n=r.layer.selectAll("path."+a).data(i,ru);n.exit().remove(),n.enter().append("path").classed(a,1).classed("ticks",1).classed("crisp",r.crisp!==!1).each(function(o){return Xl.stroke(ma.select(this),o.minor?e.minor.tickcolor:e.tickcolor)}).style("stroke-width",function(o){return oa.crispRound(t,o.minor?e.minor.tickwidth:e.tickwidth,1)+"px"}).attr("d",r.path).style("display",null),au(e,[Xw]),n.attr("transform",r.transFn)};De.drawGrid=function(t,e,r){if(r=r||{},e.tickmode!=="sync"){var a=e._id+"grid",i=e.minor&&e.minor.showgrid,n=i?r.vals.filter(function(y){return y.minor}):[],o=e.showgrid?r.vals.filter(function(y){return!y.minor}):[],l=r.counterAxis;if(l&&De.shouldShowZeroLine(t,e,l))for(var s=e.tickmode==="array",f=0;f<o.length;f++){var c=o[f].x;if(s?!c:Math.abs(c)<e.dtick/100)if(o=o.slice(0,f).concat(o.slice(f+1)),s)f--;else break}e._gw=oa.crispRound(t,e.gridwidth,1);for(var u=i?oa.crispRound(t,e.minor.gridwidth,1):0,v=r.layer,p=r.minorLayer,d=1;d>=0;d--){var h=d?v:p;if(h){var m=h.selectAll("path."+a).data(d?o:n,ru);m.exit().remove(),m.enter().append("path").classed(a,1).classed("crisp",r.crisp!==!1),m.attr("transform",r.transFn).attr("d",r.path).each(function(y){return Xl.stroke(ma.select(this),y.minor?e.minor.gridcolor:e.gridcolor||"#ddd")}).style("stroke-dasharray",function(y){return oa.dashStyle(y.minor?e.minor.griddash:e.griddash,y.minor?e.minor.gridwidth:e.gridwidth)}).style("stroke-width",function(y){return(y.minor?u:e._gw)+"px"}).style("display",null),typeof r.path=="function"&&m.attr("d",r.path)}}au(e,[Zd,Kd])}};De.drawZeroLine=function(t,e,r){r=r||r;var a=e._id+"zl",i=De.shouldShowZeroLine(t,e,r.counterAxis),n=r.layer.selectAll("path."+a).data(i?[{x:0,id:e._id}]:[]);n.exit().remove(),n.enter().append("path").classed(a,1).classed("zl",1).classed("crisp",r.crisp!==!1).each(function(){r.layer.selectAll("path").sort(function(o,l){return h5(o.id,l.id)})}),n.attr("transform",r.transFn).attr("d",r.path).call(Xl.stroke,e.zerolinecolor||Xl.defaultLine).style("stroke-width",oa.crispRound(t,e.zerolinewidth,e._gw||1)+"px").style("display",null),au(e,[qd])};De.drawLabels=function(t,e,r){r=r||{};var a=t._fullLayout,i=e._id,n=e.zerolinelayer==="above traces",o=r.cls||i+"tick",l=r.vals.filter(function(k){return k.text}),s=r.labelFns,f=r.secondary?0:e.tickangle,c=(e._prevTickAngles||{})[o],u=r.layer.selectAll("g."+o).data(e.showticklabels?l:[],ru),v=[];u.enter().append("g").classed(o,1).append("text").attr("text-anchor","middle").each(function(k){var C=ma.select(this),$=t._promises.length;C.call(cn.positionText,s.xFn(k),s.yFn(k)).call(oa.font,{family:k.font,size:k.fontSize,color:k.fontColor,weight:k.fontWeight,style:k.fontStyle,variant:k.fontVariant,textcase:k.fontTextcase,lineposition:k.fontLineposition,shadow:k.fontShadow}).text(k.text).call(cn.convertToTspans,t),t._promises[$]?v.push(t._promises.pop().then(function(){p(C,f)})):p(C,f)}),au(e,[Uy]),u.exit().remove(),r.repositionOnUpdate&&u.each(function(k){ma.select(this).select("text").call(cn.positionText,s.xFn(k),s.yFn(k))});function p(k,C){k.each(function($){var R=ma.select(this),j=R.select(".text-math-group"),G=s.anchorFn($,C),Y=r.transFn.call(R.node(),$)+(dr(C)&&+C!=0?" rotate("+C+","+s.xFn($)+","+(s.yFn($)-$.fontSize/2)+")":""),O=cn.lineCount(R),K=ql*$.fontSize,W=s.heightFn($,dr(C)?+C:0,(O-1)*K);if(W&&(Y+=Do(0,W)),j.empty()){var X=R.select("text");X.attr({transform:Y,"text-anchor":G}),X.style("opacity",1),e._adjustTickLabelsOverflow&&e._adjustTickLabelsOverflow()}else{var B=oa.bBox(j.node()).width,ee=B*{end:-.5,start:.5}[G];j.attr("transform",Y+Do(ee,0))}})}e._adjustTickLabelsOverflow=function(){var k=e.ticklabeloverflow;if(!(!k||k==="allow")){var C=k.indexOf("hide")!==-1,$=e._id.charAt(0)==="x",R=0,j=$?t._fullLayout.width:t._fullLayout.height;if(k.indexOf("domain")!==-1){var G=ht.simpleMap(e.range,e.r2l);R=e.l2p(G[0])+e._offset,j=e.l2p(G[1])+e._offset}var Y=Math.min(R,j),O=Math.max(R,j),K=e.side,W=1/0,X=-1/0;u.each(function(de){var fe=ma.select(this),q=fe.select(".text-math-group");if(q.empty()){var te=oa.bBox(fe.node()),le=0;$?(te.right>O||te.left<Y)&&(le=1):(te.bottom>O||te.top+(e.tickangle?0:de.fontSize/4)<Y)&&(le=1);var ce=fe.select("text");le?C&&ce.style("opacity",0):(ce.style("opacity",1),K==="bottom"||K==="right"?W=Math.min(W,$?te.top:te.left):W=-1/0,K==="top"||K==="left"?X=Math.max(X,$?te.bottom:te.right):X=1/0)}});for(var B in a._plots){var ee=a._plots[B];if(!(e._id!==ee.xaxis._id&&e._id!==ee.yaxis._id)){var ae=$?ee.yaxis:ee.xaxis;ae&&(ae["_visibleLabelMin_"+e._id]=W,ae["_visibleLabelMax_"+e._id]=X)}}}},e._hideCounterAxisInsideTickLabels=function(k){var C=e._id.charAt(0)==="x",$=[];for(var R in a._plots){var j=a._plots[R];e._id!==j.xaxis._id&&e._id!==j.yaxis._id||$.push(C?j.yaxis:j.xaxis)}$.forEach(function(G,Y){G&&Kl(G)&&(k||[qd,Kd,Zd,Xw,Uy]).forEach(function(O){var K=O.K==="tick"&&O.L==="text"&&e.ticklabelmode==="period",W=a._plots[e._mainSubplot],X;if(O.K===qd.K){var B=n?W.zerolinelayerAbove:W.zerolinelayer;X=B.selectAll("."+e._id+"zl")}else O.K===Kd.K?X=W.minorGridlayer.selectAll("."+e._id):O.K===Zd.K?X=W.gridlayer.selectAll("."+e._id):X=W[e._id.charAt(0)+"axislayer"];X.each(function(){var ee=ma.select(this);O.L&&(ee=ee.selectAll(O.L)),ee.each(function(ae){var de=e.l2p(K?Qd(ae):ae.x)+e._offset,fe=ma.select(this);de<e["_visibleLabelMax_"+G._id]&&de>e["_visibleLabelMin_"+G._id]?fe.style("display","none"):O.K==="tick"&&!Y&&fe.style("display",null)})})})})},p(u,c+1?c:f);function d(){return v.length&&Promise.all(v)}var h=null;function m(){if(p(u,f),l.length&&e.autotickangles&&(e.type!=="log"||String(e.dtick).charAt(0)!=="D")){h=e.autotickangles[0];var k=0,C=[],$,R=1;u.each(function(ke){k=Math.max(k,ke.fontSize);var _e=e.l2p(ke.x),J=Jd(this),be=oa.bBox(J.node());R=Math.max(R,cn.lineCount(J)),C.push({top:0,bottom:10,height:10,left:_e-be.width/2,right:_e+be.width/2+2,width:be.width+2})});var j=(e.tickson==="boundaries"||e.showdividers)&&!r.secondary,G=l.length,Y=Math.abs((l[G-1].x-l[0].x)*e._m)/(G-1),O=j?Y/2:Y,K=j?e.ticklen:k*1.25*R,W=Math.sqrt(Math.pow(O,2)+Math.pow(K,2)),X=O/W,B=e.autotickangles.map(function(ke){return ke*Math.PI/180}),ee=B.find(function(ke){return Math.abs(Math.cos(ke))<=X});ee===void 0&&(ee=B.reduce(function(ke,_e){return Math.abs(Math.cos(ke))<Math.abs(Math.cos(_e))?ke:_e},B[0]));var ae=ee*(180/Math.PI);if(j){var de=2;for(e.ticks&&(de+=e.tickwidth/2),$=0;$<C.length;$++){var fe=l[$].xbnd,q=C[$];if(fe[0]!==null&&q.left-e.l2p(fe[0])<de||fe[1]!==null&&e.l2p(fe[1])-q.right<de){h=ae;break}}}else{var te=e.ticklabelposition||"",le=e.tickson||"",ce=function(ke){return te.indexOf(ke)!==-1},ye=ce("top"),ue=ce("left"),oe=ce("right"),pe=ce("bottom"),Me=le!=="boundaries"&&(pe||ue||ye||oe),ve=Me?(e.tickwidth||0)+2*fc:0;for($=0;$<C.length-1;$++)if(ht.bBoxIntersect(C[$],C[$+1],ve)){h=ae;break}}h&&p(u,h)}}e._selections&&(e._selections[o]=u);var y=[d];e.automargin&&a._redrawFromAutoMarginCount&&c===90?(h=c,y.push(function(){p(u,c)})):y.push(m),e._tickAngles&&y.push(function(){e._tickAngles[o]=h===null?dr(f)?f:0:h});var b=function(){var k=0,C=0;return u.each(function($,R){var j=Jd(this),G=j.select(".text-math-group");if(G.empty()){var Y;e._vals[R]&&(Y=e._vals[R].bb||oa.bBox(j.node()),e._vals[R].bb=Y),k=Math.max(k,Y.width),C=Math.max(C,Y.height)}}),{labelsMaxW:k,labelsMaxH:C}},_=e._anchorAxis;if(_&&(_.autorange||_.insiderange)&&Kl(e)&&!p5(a,e._id)&&(a._insideTickLabelsUpdaterange||(a._insideTickLabelsUpdaterange={}),_.autorange&&(a._insideTickLabelsUpdaterange[_._name+".autorange"]=_.autorange,y.push(b)),_.insiderange)){var g=b(),x=e._id.charAt(0)==="y"?g.labelsMaxW:g.labelsMaxH;x+=2*fc,e.ticklabelposition==="inside"&&(x+=e.ticklen||0);var w=e.side==="right"||e.side==="top"?1:-1,T=w===1?1:0,A=w===1?0:1,M=[];M[A]=_.range[A];var S=_.range,L=_.r2p(S[T]),E=_.r2p(S[A]),F=a._insideTickLabelsUpdaterange[_._name+".range"];if(F){var N=_.r2p(F[T]),z=_.r2p(F[A]),H=w*(e._id.charAt(0)==="y"?1:-1);H*L<H*N&&(L=N,M[T]=S[T]=F[T]),H*E>H*z&&(E=z,M[A]=S[A]=F[A])}var D=Math.abs(E-L);D-x>0?(D-=x,x*=1+x/D):x=0,e._id.charAt(0)!=="y"&&(x=-x),M[T]=_.p2r(_.r2p(S[T])+w*x),_.autorange==="min"||_.autorange==="max reversed"?(M[0]=null,_._rangeInitial0=void 0,_._rangeInitial1=void 0):(_.autorange==="max"||_.autorange==="min reversed")&&(M[1]=null,_._rangeInitial0=void 0,_._rangeInitial1=void 0),a._insideTickLabelsUpdaterange[_._name+".range"]=M}var P=ht.syncOrAsync(y);return P&&P.then&&t._promises.push(P),P};function N5(t,e,r){var a=e._id+"divider",i=r.vals,n=r.layer.selectAll("path."+a).data(i,ru);n.exit().remove(),n.enter().insert("path",":first-child").classed(a,1).classed("crisp",1).call(Xl.stroke,e.dividercolor).style("stroke-width",oa.crispRound(t,e.dividerwidth,1)+"px"),n.attr("transform",r.transFn).attr("d",r.path)}De.getPxPosition=function(t,e){var r=t._fullLayout._size,a=e._id.charAt(0),i=e.side,n;if(e.anchor!=="free"?n=e._anchorAxis:a==="x"?n={_offset:r.t+(1-(e.position||0))*r.h,_length:0}:a==="y"&&(n={_offset:r.l+(e.position||0)*r.w+e._shift,_length:0}),i==="top"||i==="left")return n._offset;if(i==="bottom"||i==="right")return n._offset+n._length};function Jy(t){var e=t.title.font.size,r=(t.title.text.match(cn.BR_TAG_ALL)||[]).length;return t.title.hasOwnProperty("standoff")?e*(bn+r*ql):r?e*(r+1)*ql:e}function H5(t,e){var r=t._fullLayout,a=e._id,i=a.charAt(0),n=e.title.font.size,o,l=(e.title.text.match(cn.BR_TAG_ALL)||[]).length;if(e.title.hasOwnProperty("standoff"))e.side==="bottom"||e.side==="right"?o=e._depth+e.title.standoff+n*bn:(e.side==="top"||e.side==="left")&&(o=e._depth+e.title.standoff+n*(Cl+l*ql));else{var s=Kl(e);if(e.type==="multicategory")o=e._depth;else{var f=1.5*n;s&&(f=.5*n,e.ticks==="outside"&&(f+=e.ticklen)),o=10+f+(e.linewidth?e.linewidth-1:0)}s||(i==="x"?o+=e.side==="top"?n*(e.showticklabels?1:0):n*(e.showticklabels?1.5:.5):o+=e.side==="right"?n*(e.showticklabels?1:.5):n*(e.showticklabels?.5:0))}var c=De.getPxPosition(t,e),u,v,p;i==="x"?(v=e._offset+e._length/2,p=e.side==="top"?c-o:c+o):(p=e._offset+e._length/2,v=e.side==="right"?c+o:c-o,u={rotate:"-90",offset:0});var d;if(e.type!=="multicategory"){var h=e._selections[e._id+"tick"];if(d={selection:h,side:e.side},h&&h.node()&&h.node().parentNode){var m=oa.getTranslate(h.node().parentNode);d.offsetLeft=m.x,d.offsetTop=m.y}e.title.hasOwnProperty("standoff")&&(d.pad=0)}return e._titleStandoff=o,n5.draw(t,a+"title",{propContainer:e,propName:e._name+".title.text",placeholder:r._dfltTitle[i],avoid:d,transform:u,attributes:{x:v,y:p,"text-anchor":"middle"}})}De.shouldShowZeroLine=function(t,e,r){var a=ht.simpleMap(e.range,e.r2l);return a[0]*a[1]<=0&&e.zeroline&&(e.type==="linear"||e.type==="-")&&!(e.rangebreaks&&e.maskBreaks(0)===eu)&&(eT(e,0)||!O5(t,e,r,a)||j5(t,e))};De.clipEnds=function(t,e){return e.filter(function(r){return eT(t,r.x)})};function eT(t,e){var r=t.l2p(e);return r>1&&r<t._length-1}function O5(t,e,r,a){var i=r._mainAxis;if(!i)return;var n=t._fullLayout,o=e._id.charAt(0),l=De.counterLetter(e._id),s=e._offset+(Math.abs(a[0])<Math.abs(a[1])==(o==="x")?0:e._length);function f(d){if(!d.showline||!d.linewidth)return!1;var h=Math.max((d.linewidth+e.zerolinewidth)/2,1);function m(_){return typeof _=="number"&&Math.abs(_-s)<h}if(m(d._mainLinePosition)||m(d._mainMirrorPosition))return!0;var y=d._linepositions||{};for(var b in y)if(m(y[b][0])||m(y[b][1]))return!0}var c=n._plots[r._mainSubplot];if(!(c.mainplotinfo||c).overlays.length)return f(r);for(var u=De.list(t,l),v=0;v<u.length;v++){var p=u[v];if(p._mainAxis===i&&f(p))return!0}}function j5(t,e){for(var r=t._fullData,a=e._mainSubplot,i=e._id.charAt(0),n=0;n<r.length;n++){var o=r[n];if(o.visible===!0&&o.xaxis+o.yaxis===a&&(Wl.traceIs(o,"bar-like")&&o.orientation==={x:"h",y:"v"}[i]||o.fill&&o.fill.charAt(o.fill.length-1)===i))return!0}return!1}function Jd(t){var e=ma.select(t),r=e.select(".text-math-group");return r.empty()?e.select("text"):r}De.allowAutoMargin=function(t){for(var e=De.list(t,"",!0),r=0;r<e.length;r++){var a=e[r];a.automargin&&(wo.allowAutoMargin(t,pp(a)),a.mirror&&wo.allowAutoMargin(t,tT(a))),Wl.getComponentMethod("rangeslider","isVisible")(a)&&wo.allowAutoMargin(t,rT(a))}};function pp(t){return t._id+".automargin"}function tT(t){return pp(t)+".mirror"}function rT(t){return t._id+".rangeslider"}De.swap=function(t,e){for(var r=B5(t,e),a=0;a<r.length;a++)G5(t,r[a].x,r[a].y)};function B5(t,e){var r=[],a,i;for(a=0;a<e.length;a++){var n=[],o=t._fullData[e[a]].xaxis,l=t._fullData[e[a]].yaxis;if(!(!o||!l)){for(i=0;i<r.length;i++)(r[i].x.indexOf(o)!==-1||r[i].y.indexOf(l)!==-1)&&n.push(i);if(!n.length){r.push({x:[o],y:[l]});continue}var s=r[n[0]],f;if(n.length>1)for(i=1;i<n.length;i++)f=r[n[i]],Ys(s.x,f.x),Ys(s.y,f.y);Ys(s.x,[o]),Ys(s.y,[l])}}return r}function Ys(t,e){for(var r=0;r<e.length;r++)t.indexOf(e[r])===-1&&t.push(e[r])}function G5(t,e,r){var a=[],i=[],n=t.layout,o,l;for(o=0;o<e.length;o++)a.push(De.getFromId(t,e[o]));for(o=0;o<r.length;o++)i.push(De.getFromId(t,r[o]));var s=Object.keys(o5),f=["anchor","domain","overlaying","position","side","tickangle","editType"],c=["linear","log"];for(o=0;o<s.length;o++){var u=s[o],v=a[0][u],p=i[0][u],d=!0,h=!1,m=!1;if(!(u.charAt(0)==="_"||typeof v=="function"||f.indexOf(u)!==-1)){for(l=1;l<a.length&&d;l++){var y=a[l][u];u==="type"&&c.indexOf(v)!==-1&&c.indexOf(y)!==-1&&v!==y?h=!0:y!==v&&(d=!1)}for(l=1;l<i.length&&d;l++){var b=i[l][u];u==="type"&&c.indexOf(p)!==-1&&c.indexOf(b)!==-1&&p!==b?m=!0:i[l][u]!==p&&(d=!1)}d&&(h&&(n[a[0]._name].type="linear"),m&&(n[i[0]._name].type="linear"),U5(n,u,a,i,t._fullLayout._dfltTitle))}}for(o=0;o<t._fullLayout.annotations.length;o++){var _=t._fullLayout.annotations[o];e.indexOf(_.xref)!==-1&&r.indexOf(_.yref)!==-1&&ht.swapAttrs(n.annotations[o],["?"])}}function U5(t,e,r,a,i){var n=ht.nestedProperty,o=n(t[r[0]._name],e).get(),l=n(t[a[0]._name],e).get(),s;for(e==="title"&&(o&&o.text===i.x&&(o.text=i.y),l&&l.text===i.y&&(l.text=i.x)),s=0;s<r.length;s++)n(t,r[s]._name+"."+e).set(l);for(s=0;s<a.length;s++)n(t,a[s]._name+"."+e).set(o)}function mp(t){return t._id==="angularaxis"}function ev(t,e){for(var r=e._rangebreaks.length,a=0;a<r;a++){var i=e._rangebreaks[a];if(t>=i.min&&t<i.max)return i.max}return t}function Kl(t){return(t.ticklabelposition||"").indexOf("inside")!==-1}function au(t,e){Kl(t._anchorAxis||{})&&t._hideCounterAxisInsideTickLabels&&t._hideCounterAxisInsideTickLabels(e)}function eh(t,e,r,a){var i=t.anchor!=="free"&&(t.overlaying===void 0||t.overlaying===!1)?t._id:t.overlaying,n;a?n=t.side==="right"?e:-e:n=e,i in r||(r[i]={}),t.side in r[i]||(r[i][t.side]=0),r[i][t.side]+=n}function V5(t,e){return t.autoshift?e[t.overlaying][t.side]:t.shift||0}function W5(t,e){return/%f/.test(e)?t>=u5:/%L/.test(e)?t>=c5:/%[SX]/.test(e)?t>=sc:/%M/.test(e)?t>=Yl:/%[HI]/.test(e)?t>=Qa:/%p/.test(e)?t>=zi:/%[Aadejuwx]/.test(e)?t>=Hr:/%[UVW]/.test(e)?t>=la:/%[Bbm]/.test(e)?t>=lc:/%[q]/.test(e)?t>=oc:/%[Yy]/.test(e)?t>=nc:!0}var Ot=sw.exports,X5=function(e,r,a){var i,n;if(a){var o=r==="reversed"||r==="min reversed"||r==="max reversed";i=a[o?1:0],n=a[o?0:1]}var l=e("autorangeoptions.minallowed",n===null?i:void 0),s=e("autorangeoptions.maxallowed",i===null?n:void 0);l===void 0&&e("autorangeoptions.clipmin"),s===void 0&&e("autorangeoptions.clipmax"),e("autorangeoptions.include")},Y5=X5,aT=function(e,r,a,i){var n=r._template||{},o=r.type||n.type||"-";a("minallowed"),a("maxallowed");var l=a("range");if(!l){var s;!i.noInsiderange&&o!=="log"&&(s=a("insiderange"),s&&(s[0]===null||s[1]===null)&&(r.insiderange=!1,s=void 0),s&&(l=a("range",s)))}var f=r.getAutorangeDflt(l,i),c=a("autorange",f),u;l&&(l[0]===null&&l[1]===null||(l[0]===null||l[1]===null)&&(c==="reversed"||c===!0)||l[0]!==null&&(c==="min"||c==="max reversed")||l[1]!==null&&(c==="max"||c==="min reversed"))&&(l=void 0,delete r.range,r.autorange=!0,u=!0),u||(f=r.getAutorangeDflt(l,i),c=a("autorange",f)),c&&(Y5(a,c,l),(o==="linear"||o==="-")&&a("rangemode")),r.cleanRange()},tv={},iT={exports:{}},q5=function(e,r,a,i,n){var o=(e-a)/(i-a),l=o+r/(i-a),s=(o+l)/2;return n==="left"||n==="bottom"?o:n==="center"||n==="middle"?s:n==="right"||n==="top"?l:o<2/3-s?o:l>4/3-s?l:s},eg=we,Z5=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]],K5=function(e,r,a,i){return a==="left"?e=0:a==="center"?e=1:a==="right"?e=2:e=eg.constrain(Math.floor(e*3),0,2),i==="bottom"?r=0:i==="middle"?r=1:i==="top"?r=2:r=eg.constrain(Math.floor(r*3),0,2),Z5[r][e]},nT={exports:{}},Q5=ms,J5=Xc,e3=Bc.getGraphDiv,t3=Fc,th=nT.exports={};th.wrapped=function(t,e,r){t=e3(t),t._fullLayout&&J5.clear(t._fullLayout._uid+t3.HOVERID),th.raw(t,e,r)};th.raw=function(e,r){var a=e._fullLayout,i=e._hoverdata;r||(r={}),!(r.target&&!e._dragged&&Q5.triggerHandler(e,"plotly_beforehover",r)===!1)&&(a._hoverlayer.selectAll("g").remove(),a._hoverlayer.selectAll("line").remove(),a._hoverlayer.selectAll("circle").remove(),e._hoverdata=void 0,r.target&&i&&e.emit("plotly_unhover",{event:r,points:i}))};var r3=nT.exports,a3=CM,rv=Y1,i3=q1,n3=we.removeElement,o3=Rr,kn=iT.exports={};kn.align=q5;kn.getCursor=K5;var oT=r3;kn.unhover=oT.wrapped;kn.unhoverRaw=oT.raw;kn.init=function(e){var r=e.gd,a=1,i=r._context.doubleClickDelay,n=e.element,o,l,s,f,c,u,v,p;r._mouseDownTime||(r._mouseDownTime=0),n.style.pointerEvents="all",n.onmousedown=m,i3?(n._ontouchstart&&n.removeEventListener("touchstart",n._ontouchstart),n._ontouchstart=m,n.addEventListener("touchstart",m,{passive:!1})):n.ontouchstart=m;function d(_,g,x){return Math.abs(_)<x&&(_=0),Math.abs(g)<x&&(g=0),[_,g]}var h=e.clampFn||d;function m(_){r._dragged=!1,r._dragging=!0;var g=tg(_);o=g[0],l=g[1],v=_.target,u=_,p=_.buttons===2||_.ctrlKey,typeof _.clientX>"u"&&typeof _.clientY>"u"&&(_.clientX=o,_.clientY=l),s=new Date().getTime(),s-r._mouseDownTime<i?a+=1:(a=1,r._mouseDownTime=s),e.prepFn&&e.prepFn(_,o,l),rv&&!p?(c=lT(),c.style.cursor=window.getComputedStyle(n).cursor):rv||(c=document,f=window.getComputedStyle(document.documentElement).cursor,document.documentElement.style.cursor=window.getComputedStyle(n).cursor),document.addEventListener("mouseup",b),document.addEventListener("touchend",b),e.dragmode!==!1&&(_.preventDefault(),document.addEventListener("mousemove",y),document.addEventListener("touchmove",y,{passive:!1}))}function y(_){_.preventDefault();var g=tg(_),x=e.minDrag||o3.MINDRAG,w=h(g[0]-o,g[1]-l,x),T=w[0],A=w[1];(T||A)&&(r._dragged=!0,kn.unhover(r,_)),r._dragged&&e.moveFn&&!p&&(r._dragdata={element:n,dx:T,dy:A},e.moveFn(T,A))}function b(_){if(delete r._dragdata,e.dragmode!==!1&&(_.preventDefault(),document.removeEventListener("mousemove",y),document.removeEventListener("touchmove",y)),document.removeEventListener("mouseup",b),document.removeEventListener("touchend",b),rv?n3(c):f&&(c.documentElement.style.cursor=f,f=null),!r._dragging){r._dragged=!1;return}if(r._dragging=!1,new Date().getTime()-r._mouseDownTime>i&&(a=Math.max(a-1,1)),r._dragged)e.doneFn&&e.doneFn();else{var g;u.target===v?g=u:(g={target:v,srcElement:v,toElement:v},Object.keys(u).concat(Object.keys(u.__proto__)).forEach(x=>{var w=u[x];!g[x]&&typeof w!="function"&&(g[x]=w)})),e.clickFn&&e.clickFn(a,g),p||v.dispatchEvent(new MouseEvent("click",_))}r._dragging=!1,r._dragged=!1}};function lT(){var t=document.createElement("div");t.className="dragcover";var e=t.style;return e.position="fixed",e.left=0,e.right=0,e.top=0,e.bottom=0,e.zIndex=999999999,e.background="none",document.body.appendChild(t),t}kn.coverSlip=lT;function tg(t){return a3(t.changedTouches?t.changedTouches[0]:t,document.body)}var ai=iT.exports,iu={},Bi=function(e,r){(e.attr("class")||"").split(" ").forEach(function(a){a.indexOf("cursor-")===0&&e.classed(a,!1)}),r&&e.classed("cursor-"+r,!0)},av=Bi,sl="data-savedcursor",rg="!!",l3=function(e,r){var a=e.attr(sl);if(r){if(!a){for(var i=(e.attr("class")||"").split(" "),n=0;n<i.length;n++){var o=i[n];o.indexOf("cursor-")===0&&e.attr(sl,o.substr(7)).classed(o,!1)}e.attr(sl)||e.attr(sl,rg)}av(e,r)}else a&&(e.attr(sl,null),a===rg?av(e):av(e,a))},iv=Mr,s3=Or,sT={_isSubplotObj:!0,visible:{valType:"boolean",dflt:!0,editType:"legend",description:["Determines whether or not this legend is visible."].join(" ")},bgcolor:{valType:"color",editType:"legend",description:["Sets the legend background color.","Defaults to `layout.paper_bgcolor`."].join(" ")},bordercolor:{valType:"color",dflt:s3.defaultLine,editType:"legend",description:"Sets the color of the border enclosing the legend."},maxheight:{valType:"number",min:0,editType:"legend",description:["Sets the max height (in px) of the legend, or max height ratio (reference height * ratio) if less than one.","Default value is: 0.5 for horizontal legends; 1 for vertical legends. The minimum allowed height is 30px.","For a ratio of 0.5, the legend will take up to 50% of the reference height before displaying a scrollbar.","The reference height is the full layout height except for vertically oriented legends with",'a `yref` of `"paper"`, where the reference height is the plot height.'].join(" ")},borderwidth:{valType:"number",min:0,dflt:0,editType:"legend",description:"Sets the width (in px) of the border enclosing the legend."},font:iv({editType:"legend",description:"Sets the font used to text the legend items."}),grouptitlefont:iv({editType:"legend",description:["Sets the font for group titles in legend.","Defaults to `legend.font` with its size increased about 10%."].join(" ")}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v",editType:"legend",description:"Sets the orientation of the legend."},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"],editType:"legend",description:["Determines the order at which the legend items are displayed.","If *normal*, the items are displayed top-to-bottom in the same","order as the input data.","If *reversed*, the items are displayed in the opposite order","as *normal*.","If *grouped*, the items are displayed in groups","(when a trace `legendgroup` is provided).","if *grouped+reversed*, the items are displayed in the opposite order","as *grouped*."].join(" ")},tracegroupgap:{valType:"number",min:0,dflt:10,editType:"legend",description:["Sets the amount of vertical space (in px) between legend groups."].join(" ")},entrywidth:{valType:"number",min:0,editType:"legend",description:["Sets the width (in px or fraction) of the legend.","Use 0 to size the entry based on the text width,","when `entrywidthmode` is set to *pixels*."].join(" ")},entrywidthmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"pixels",editType:"legend",description:"Determines what entrywidth means."},indentation:{valType:"number",min:-15,dflt:0,editType:"legend",description:"Sets the indentation (in px) of the legend entries."},itemsizing:{valType:"enumerated",values:["trace","constant"],dflt:"trace",editType:"legend",description:["Determines if the legend items symbols scale with their corresponding *trace* attributes","or remain *constant* independent of the symbol size on the graph."].join(" ")},itemwidth:{valType:"number",min:30,dflt:30,editType:"legend",description:"Sets the width (in px) of the legend item symbols (the part other than the title.text)."},itemclick:{valType:"enumerated",values:["toggle","toggleothers",!1],dflt:"toggle",editType:"legend",description:["Determines the behavior on legend item click.","*toggle* toggles the visibility of the item clicked on the graph.","*toggleothers* makes the clicked item the sole visible item on the graph.","*false* disables legend item click interactions."].join(" ")},itemdoubleclick:{valType:"enumerated",values:["toggle","toggleothers",!1],dflt:"toggleothers",editType:"legend",description:["Determines the behavior on legend item double-click.","*toggle* toggles the visibility of the item clicked on the graph.","*toggleothers* makes the clicked item the sole visible item on the graph.","*false* disables legend item double-click interactions."].join(" ")},groupclick:{valType:"enumerated",values:["toggleitem","togglegroup"],dflt:"togglegroup",editType:"legend",description:["Determines the behavior on legend group item click.","*toggleitem* toggles the visibility of the individual item clicked on the graph.","*togglegroup* toggles the visibility of all items in the same legendgroup as the item clicked on the graph."].join(" ")},x:{valType:"number",editType:"legend",description:["Sets the x position with respect to `xref` (in normalized coordinates) of the legend.","When `xref` is *paper*, defaults to *1.02* for vertical legends and","defaults to *0* for horizontal legends.","When `xref` is *container*, defaults to *1* for vertical legends and","defaults to *0* for horizontal legends.","Must be between *0* and *1* if `xref` is *container*.","and between *-2* and *3* if `xref` is *paper*."].join(" ")},xref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle",description:["Sets the container `x` refers to.","*container* spans the entire `width` of the plot.","*paper* refers to the width of the plotting area only."].join(" ")},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"legend",description:["Sets the legend's horizontal position anchor.","This anchor binds the `x` position to the *left*, *center*","or *right* of the legend.","Value *auto* anchors legends to the right for `x` values greater than or equal to 2/3,","anchors legends to the left for `x` values less than or equal to 1/3 and","anchors legends with respect to their center otherwise."].join(" ")},y:{valType:"number",editType:"legend",description:["Sets the y position with respect to `yref` (in normalized coordinates) of the legend.","When `yref` is *paper*, defaults to *1* for vertical legends,","defaults to *-0.1* for horizontal legends on graphs w/o range sliders and","defaults to *1.1* for horizontal legends on graph with one or multiple range sliders.","When `yref` is *container*, defaults to *1*.","Must be between *0* and *1* if `yref` is *container*","and between *-2* and *3* if `yref` is *paper*."].join(" ")},yref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle",description:["Sets the container `y` refers to.","*container* spans the entire `height` of the plot.","*paper* refers to the height of the plotting area only."].join(" ")},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],editType:"legend",description:["Sets the legend's vertical position anchor","This anchor binds the `y` position to the *top*, *middle*","or *bottom* of the legend.","Value *auto* anchors legends at their bottom for `y` values less than or equal to 1/3,","anchors legends to at their top for `y` values greater than or equal to 2/3 and","anchors legends with respect to their middle otherwise."].join(" ")},uirevision:{valType:"any",editType:"none",description:["Controls persistence of legend-driven changes in trace and pie label","visibility. Defaults to `layout.uirevision`."].join(" ")},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"legend",description:["Sets the vertical alignment of the symbols with respect to their associated text."].join(" ")},title:{text:{valType:"string",dflt:"",editType:"legend",description:["Sets the title of the legend."].join(" ")},font:iv({editType:"legend",description:["Sets this legend's title font.","Defaults to `legend.font` with its size increased about 20%."].join(" ")}),side:{valType:"enumerated",values:["top","left","top left","top center","top right"],editType:"legend",description:["Determines the location of legend's title","with respect to the legend items.","Defaulted to *top* with `orientation` is *h*.","Defaulted to *left* with `orientation` is *v*.","The *top left* options could be used to expand","top center and top right are for horizontal alignment","legend area in both x and y sides."].join(" ")},editType:"legend"},editType:"legend"},Zo={};Zo.isGrouped=function(e){return(e.traceorder||"").indexOf("grouped")!==-1};Zo.isVertical=function(e){return e.orientation!=="h"};Zo.isReversed=function(e){return(e.traceorder||"").indexOf("reversed")!==-1};var nv=ot,na=we,f3=Ht,c3=wa,u3=sT,v3=ps,ov=Zo;function d3(t,e,r,a){var i=e[t]||{},n=f3.newContainer(r,t);function o(D,P){return na.coerce(i,n,u3,D,P)}var l=na.coerceFont(o,"font",r.font);o("bgcolor",r.paper_bgcolor),o("bordercolor");var s=o("visible");if(s){for(var f,c=function(D,P){var k=f._input,C=f;return na.coerce(k,C,c3,D,P)},u=r.font||{},v=na.coerceFont(o,"grouptitlefont",u,{overrideDflt:{size:Math.round(u.size*1.1)}}),p=0,d=!1,h="normal",m=(r.shapes||[]).filter(function(D){return D.showlegend}),y=a.concat(m).filter(function(D){return t===(D.legend||"legend")}),b=0;b<y.length;b++)if(f=y[b],!!f.visible){var _=f._isShape;(f.showlegend||f._dfltShowLegend&&!(f._module&&f._module.attributes&&f._module.attributes.showlegend&&f._module.attributes.showlegend.dflt===!1))&&(p++,f.showlegend&&(d=!0,(!_&&nv.traceIs(f,"pie-like")||f._input.showlegend===!0)&&p++),na.coerceFont(c,"legendgrouptitle.font",v)),(!_&&nv.traceIs(f,"bar")&&r.barmode==="stack"||["tonextx","tonexty"].indexOf(f.fill)!==-1)&&(h=ov.isGrouped({traceorder:h})?"grouped+reversed":"reversed"),f.legendgroup!==void 0&&f.legendgroup!==""&&(h=ov.isReversed({traceorder:h})?"reversed+grouped":"grouped")}var g=na.coerce(e,r,v3,"showlegend",d&&p>(t==="legend"?1:0));if(g===!1&&(r[t]=void 0),!(g===!1&&!i.uirevision)&&(o("uirevision",r.uirevision),g!==!1)){o("borderwidth");var x=o("orientation"),w=o("yref"),T=o("xref"),A=x==="h",M=w==="paper",S=T==="paper",L,E,F,N="left";A?(L=0,nv.getComponentMethod("rangeslider","isVisible")(e.xaxis)?M?(E=1.1,F="bottom"):(E=1,F="top"):M?(E=-.1,F="top"):(E=0,F="bottom")):(E=1,F="auto",S?L=1.02:(L=1,N="right")),na.coerce(i,n,{x:{valType:"number",editType:"legend",min:S?-2:0,max:S?3:1,dflt:L}},"x"),na.coerce(i,n,{y:{valType:"number",editType:"legend",min:M?-2:0,max:M?3:1,dflt:E}},"y"),o("traceorder",h),ov.isGrouped(r[t])&&o("tracegroupgap"),o("entrywidth"),o("entrywidthmode"),o("indentation"),o("itemsizing"),o("itemwidth"),o("itemclick"),o("itemdoubleclick"),o("groupclick"),o("xanchor",N),o("yanchor",F),o("maxheight",A?.5:1),o("valign"),na.noneOrAll(i,n,["x","y"]);var z=o("title.text");if(z){o("title.side",A?"left":"top");var H=na.extendFlat({},l,{size:na.bigFont(l.size)});na.coerceFont(o,"title.font",H)}}}}var fT=function(e,r,a){var i,n=a.slice(),o=r.shapes;if(o)for(i=0;i<o.length;i++){var l=o[i];if(l.showlegend){var s={_input:l._input,visible:l.visible,showlegend:l.showlegend,legend:l.legend};n.push(s)}}var f=["legend"];for(i=0;i<n.length;i++)na.pushUnique(f,n[i].legend);for(r._legends=[],i=0;i<f.length;i++){var c=f[i];d3(c,e,r,n),r[c]&&r[c].visible&&(r[c]._id=c),r._legends.push(c)}},Bn=ot,rh=we,h3=rh.pushUnique,lv=!0,p3=function(e,r,a){var i=r._fullLayout;if(r._dragged||r._editing)return;var n=i.legend.itemclick,o=i.legend.itemdoubleclick,l=i.legend.groupclick;a===1&&n==="toggle"&&o==="toggleothers"&&lv&&r.data&&r._context.showTips&&rh.notifier(rh._(r,"Double-click on legend to isolate one trace"),"long"),lv=!1;var s;if(a===1?s=n:a===2&&(s=o),!s)return;var f=l==="togglegroup",c=i.hiddenlabels?i.hiddenlabels.slice():[],u=e.data()[0][0];if(u.groupTitle&&u.noClick)return;var v=r._fullData,p=(i.shapes||[]).filter(function(oe){return oe.showlegend}),d=v.concat(p),h=u.trace;h._isShape&&(h=h._fullInput);var m=h.legendgroup,y,b,_,g,x,w,T={},A=[],M=[],S=[];function L(oe,pe){var Me=A.indexOf(oe),ve=T.visible;return ve||(ve=T.visible=[]),A.indexOf(oe)===-1&&(A.push(oe),Me=A.length-1),ve[Me]=pe,Me}var E=(i.shapes||[]).map(function(oe){return oe._input}),F=!1;function N(oe,pe){E[oe].visible=pe,F=!0}function z(oe,pe){if(!(u.groupTitle&&!f)){var Me=oe._fullInput||oe,ve=Me._isShape,ke=Me.index;ke===void 0&&(ke=Me._index);var _e=Me.visible===!1?!1:pe;ve?N(ke,_e):L(ke,_e)}}var H=h.legend,D=h._fullInput,P=D&&D._isShape;if(!P&&Bn.traceIs(h,"pie-like")){var k=u.label,C=c.indexOf(k);if(s==="toggle")C===-1?c.push(k):c.splice(C,1);else if(s==="toggleothers"){var $=C!==-1,R=[];for(y=0;y<r.calcdata.length;y++){var j=r.calcdata[y];for(b=0;b<j.length;b++){var G=j[b],Y=G.label;H===j[0].trace.legend&&k!==Y&&(c.indexOf(Y)===-1&&($=!0),h3(c,Y),R.push(Y))}}if(!$)for(var O=0;O<R.length;O++){var K=c.indexOf(R[O]);K!==-1&&c.splice(K,1)}}Bn.call("_guiRelayout",r,"hiddenlabels",c)}else{var W=m&&m.length,X=[],B;if(W)for(y=0;y<d.length;y++)B=d[y],B.visible&&B.legendgroup===m&&X.push(y);if(s==="toggle"){var ee;switch(h.visible){case!0:ee="legendonly";break;case!1:ee=!1;break;case"legendonly":ee=!0;break}if(W)if(f)for(y=0;y<d.length;y++){var ae=d[y];ae.visible!==!1&&ae.legendgroup===m&&z(ae,ee)}else z(h,ee);else z(h,ee)}else if(s==="toggleothers"){var de,fe,q,te,le,ce=!0;for(y=0;y<d.length;y++)if(le=d[y],de=le===h,q=le.showlegend!==!0,!(de||q)&&(fe=W&&le.legendgroup===m,!fe&&le.legend===H&&le.visible===!0&&!Bn.traceIs(le,"notLegendIsolatable"))){ce=!1;break}for(y=0;y<d.length;y++)if(le=d[y],!(le.visible===!1||le.legend!==H)&&!Bn.traceIs(le,"notLegendIsolatable"))switch(h.visible){case"legendonly":z(le,!0);break;case!0:te=ce?!0:"legendonly",de=le===h,q=le.showlegend!==!0&&!le.legendgroup,fe=de||W&&le.legendgroup===m,z(le,fe||q?!0:te);break}}for(y=0;y<M.length;y++)if(_=M[y],!!_){var ye=_.constructUpdate(),ue=Object.keys(ye);for(b=0;b<ue.length;b++)g=ue[b],w=T[g]=T[g]||[],w[S[y]]=ye[g]}for(x=Object.keys(T),y=0;y<x.length;y++)for(g=x[y],b=0;b<A.length;b++)T[g].hasOwnProperty(b)||(T[g][b]=void 0);F?Bn.call("_guiUpdate",r,T,{shapes:E},A):Bn.call("_guiRestyle",r,T,A)}},cT={scrollBarWidth:6,scrollBarMinHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4,scrollBarEnterAttrs:{rx:20,ry:3,width:0,height:0},titlePad:2,itemGap:5},ag=ot,sv=Zo,m3=function(e,r,a){var i=r._inHover,n=sv.isGrouped(r),o=sv.isReversed(r),l={},s=[],f=!1,c={},u=0,v=0,p,d;function h(D,P,k){if(r.visible!==!1&&!(a&&D!==r._id))if(P===""||!sv.isGrouped(r)){var C="~~i"+u;s.push(C),l[C]=[k],u++}else s.indexOf(P)===-1?(s.push(P),f=!0,l[P]=[k]):l[P].push(k)}for(p=0;p<e.length;p++){var m=e[p],y=m[0],b=y.trace,_=b.legend,g=b.legendgroup;if(!(!i&&(!b.visible||!b.showlegend)))if(ag.traceIs(b,"pie-like"))for(c[g]||(c[g]={}),d=0;d<m.length;d++){var x=m[d].label;c[g][x]||(h(_,g,{label:x,color:m[d].color,i:m[d].i,trace:b,pts:m[d].pts}),c[g][x]=!0,v=Math.max(v,(x||"").length))}else h(_,g,y),v=Math.max(v,(b.name||"").length)}if(!s.length)return[];var w=!f||!n,T=[];for(p=0;p<s.length;p++){var A=l[s[p]];w?T.push(A[0]):T.push(A)}for(w&&(T=[T]),p=0;p<T.length;p++){var M=1/0;for(d=0;d<T[p].length;d++){var S=T[p][d].trace.legendrank;M>S&&(M=S)}T[p][0]._groupMinRank=M,T[p][0]._preGroupSort=p}var L=function(D,P){return D[0]._groupMinRank-P[0]._groupMinRank||D[0]._preGroupSort-P[0]._preGroupSort},E=function(D,P){return D.trace.legendrank-P.trace.legendrank||D._preSort-P._preSort};for(T.forEach(function(D,P){D[0]._preGroupSort=P}),T.sort(L),p=0;p<T.length;p++){T[p].forEach(function(D,P){D._preSort=P}),T[p].sort(E);var F=T[p][0].trace,N=null;for(d=0;d<T[p].length;d++){var z=T[p][d].trace.legendgrouptitle;if(z&&z.text){N=z,i&&(z.font=r._groupTitleFont);break}}if(o&&T[p].reverse(),N){var H=!1;for(d=0;d<T[p].length;d++)if(ag.traceIs(T[p][d].trace,"pie-like")){H=!0;break}T[p].unshift({i:-1,groupTitle:N,noClick:H,trace:{showlegend:F.showlegend,legendgroup:F.legendgroup,visible:r.groupclick==="toggleitem"?!0:F.visible}})}for(d=0;d<T[p].length;d++)T[p][d]=[T[p][d]]}return r._lgroupsLength=T.length,r._maxNameLength=v,T},In={};(function(t){var e=we;function r(a){return a.indexOf("e")!==-1?a.replace(/[.]?0+e/,"e"):a.indexOf(".")!==-1?a.replace(/[.]?0+$/,""):a}t.formatPiePercent=function(i,n){var o=r((i*100).toPrecision(3));return e.numSeparate(o,n)+"%"},t.formatPieValue=function(i,n){var o=r(i.toPrecision(10));return e.numSeparate(o,n)},t.getFirstFilled=function(i,n){if(e.isArrayOrTypedArray(i))for(var o=0;o<n.length;o++){var l=i[n[o]];if(l||l===0||l==="")return l}},t.castOption=function(i,n){if(e.isArrayOrTypedArray(i))return t.getFirstFilled(i,n);if(i)return i},t.getRotationAngle=function(a){return(a==="auto"?0:a)*Math.PI/180}})(In);var y3=Et,g3=yt,b3=function(e,r,a,i){var n=a.marker.pattern;n&&n.shape?y3.pointStyle(e,a,i,r):g3.fill(e,r.color)},ig=yt,ng=In.castOption,x3=b3,yp=function(e,r,a,i){var n=a.marker.line,o=ng(n.color,r.pts)||ig.defaultLine,l=ng(n.width,r.pts)||0;e.call(x3,r,a,i).style("stroke-width",l).call(ig.stroke,o)},Ir=bt,fv=ot,Er=we,og=Er.strTranslate,aa=Et,ua=yt,cv=ja.extractOpts,uc=jr,_3=yp,w3=In.castOption,T3=cT,lg=12,sg=5,Ki=2,k3=10,Gn=5,uT=function(e,r,a){var i=r._fullLayout;a||(a=i.legend);var n=a.itemsizing==="constant",o=a.itemwidth,l=(o+T3.itemGap*2)/2,s=og(l,0),f=function(T,A,M,S){var L;if(T+1)L=T;else if(A&&A.width>0)L=A.width;else return 0;return n?S:Math.min(L,M)};e.each(function(T){var A=Ir.select(this),M=Er.ensureSingle(A,"g","layers");M.style("opacity",T[0].trace.opacity);var S=a.indentation,L=a.valign,E=T[0].lineHeight,F=T[0].height;if(L==="middle"&&S===0||!E||!F)M.attr("transform",null);else{var N={top:1,bottom:-1}[L],z=N*(.5*(E-F+3))||0,H=a.indentation;M.attr("transform",og(H,z))}var D=M.selectAll("g.legendfill").data([T]);D.enter().append("g").classed("legendfill",!0);var P=M.selectAll("g.legendlines").data([T]);P.enter().append("g").classed("legendlines",!0);var k=M.selectAll("g.legendsymbols").data([T]);k.enter().append("g").classed("legendsymbols",!0),k.selectAll("g.legendpoints").data([T]).enter().append("g").classed("legendpoints",!0)}).each(w).each(v).each(d).each(p).each(m).each(g).each(_).each(c).each(u).each(y).each(b);function c(T){var A=fg(T),M=A.showFill,S=A.showLine,L=A.showGradientLine,E=A.showGradientFill,F=A.anyFill,N=A.anyLine,z=T[0],H=z.trace,D,P,k=cv(H),C=k.colorscale,$=k.reversescale,R=function(X){if(X.size())if(M)aa.fillGroupStyle(X,r,!0);else{var B="legendfill-"+H.uid;aa.gradient(X,r,B,uv($),C,"fill")}},j=function(X){if(X.size()){var B="legendline-"+H.uid;aa.lineGroupStyle(X),aa.gradient(X,r,B,uv($),C,"stroke")}},G=uc.hasMarkers(H)||!F?"M5,0":N?"M5,-2":"M5,-3",Y=Ir.select(this),O=Y.select(".legendfill").selectAll("path").data(M||E?[T]:[]);if(O.enter().append("path").classed("js-fill",!0),O.exit().remove(),O.attr("d",G+"h"+o+"v6h-"+o+"z").call(R),S||L){var K=f(void 0,H.line,k3,sg);P=Er.minExtend(H,{line:{width:K}}),D=[Er.minExtend(z,{trace:P})]}var W=Y.select(".legendlines").selectAll("path").data(S||L?[D]:[]);W.enter().append("path").classed("js-line",!0),W.exit().remove(),W.attr("d",G+(L?"l"+o+",0.0001":"h"+o)).call(S?aa.lineGroupStyle:j)}function u(T){var A=fg(T),M=A.anyFill,S=A.anyLine,L=A.showLine,E=A.showMarker,F=T[0],N=F.trace,z=!E&&!S&&!M&&uc.hasText(N),H,D;function P(O,K,W,X){var B=Er.nestedProperty(N,O).get(),ee=Er.isArrayOrTypedArray(B)&&K?K(B):B;if(n&&ee&&X!==void 0&&(ee=X),W){if(ee<W[0])return W[0];if(ee>W[1])return W[1]}return ee}function k(O){return F._distinct&&F.index&&O[F.index]?O[F.index]:O[0]}if(E||z||L){var C={},$={};if(E){C.mc=P("marker.color",k),C.mx=P("marker.symbol",k),C.mo=P("marker.opacity",Er.mean,[.2,1]),C.mlc=P("marker.line.color",k),C.mlw=P("marker.line.width",Er.mean,[0,5],Ki),$.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var R=P("marker.size",Er.mean,[2,16],lg);C.ms=R,$.marker.size=R}L&&($.line={width:P("line.width",k,[0,10],sg)}),z&&(C.tx="Aa",C.tp=P("textposition",k),C.ts=10,C.tc=P("textfont.color",k),C.tf=P("textfont.family",k),C.tw=P("textfont.weight",k),C.ty=P("textfont.style",k),C.tv=P("textfont.variant",k),C.tC=P("textfont.textcase",k),C.tE=P("textfont.lineposition",k),C.tS=P("textfont.shadow",k)),H=[Er.minExtend(F,C)],D=Er.minExtend(N,$),D.selectedpoints=null,D.texttemplate=null}var j=Ir.select(this).select("g.legendpoints"),G=j.selectAll("path.scatterpts").data(E?H:[]);G.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",s),G.exit().remove(),G.call(aa.pointStyle,D,r),E&&(H[0].mrc=3);var Y=j.selectAll("g.pointtext").data(z?H:[]);Y.enter().append("g").classed("pointtext",!0).append("text").attr("transform",s),Y.exit().remove(),Y.selectAll("text").call(aa.textPointStyle,D,r)}function v(T){var A=T[0].trace,M=A.type==="waterfall";if(T[0]._distinct&&M){var S=T[0].trace[T[0].dir].marker;return T[0].mc=S.color,T[0].mlw=S.line.width,T[0].mlc=S.line.color,h(T,this,"waterfall")}var L=[];A.visible&&M&&(L=T[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var E=Ir.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(L);E.enter().append("path").classed("legendwaterfall",!0).attr("transform",s).style("stroke-miterlimit",1),E.exit().remove(),E.each(function(F){var N=Ir.select(this),z=A[F[0]].marker,H=f(void 0,z.line,Gn,Ki);N.attr("d",F[1]).style("stroke-width",H+"px").call(ua.fill,z.color),H&&N.call(ua.stroke,z.line.color)})}function p(T){h(T,this)}function d(T){h(T,this,"funnel")}function h(T,A,M){var S=T[0].trace,L=S.marker||{},E=L.line||{},F=L.cornerradius?"M6,3a3,3,0,0,1-3,3H-3a3,3,0,0,1-3-3V-3a3,3,0,0,1,3-3H3a3,3,0,0,1,3,3Z":"M6,6H-6V-6H6Z",N=M?S.visible&&S.type===M:fv.traceIs(S,"bar"),z=Ir.select(A).select("g.legendpoints").selectAll("path.legend"+M).data(N?[T]:[]);z.enter().append("path").classed("legend"+M,!0).attr("d",F).attr("transform",s),z.exit().remove(),z.each(function(H){var D=Ir.select(this),P=H[0],k=f(P.mlw,L.line,Gn,Ki);D.style("stroke-width",k+"px");var C=P.mcc;if(!a._inHover&&"mc"in P){var $=cv(L),R=$.mid;R===void 0&&(R=($.max+$.min)/2),C=aa.tryColorscale(L,"")(R)}var j=C||P.mc||L.color,G=L.pattern,Y=aa.getPatternAttr,O=G&&(Y(G.shape,0,"")||Y(G.path,0,""));if(O){var K=Y(G.bgcolor,0,null),W=Y(G.fgcolor,0,null),X=G.fgopacity,B=cg(G.size,8,10),ee=cg(G.solidity,.5,1),ae="legend-"+S.uid;D.call(aa.pattern,"legend",r,ae,O,B,ee,C,G.fillmode,K,W,X)}else D.call(ua.fill,j);k&&ua.stroke(D,P.mlc||E.color)})}function m(T){var A=T[0].trace,M=Ir.select(this).select("g.legendpoints").selectAll("path.legendbox").data(A.visible&&fv.traceIs(A,"box-violin")?[T]:[]);M.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",s),M.exit().remove(),M.each(function(){var S=Ir.select(this);if((A.boxpoints==="all"||A.points==="all")&&ua.opacity(A.fillcolor)===0&&ua.opacity((A.line||{}).color)===0){var L=Er.minExtend(A,{marker:{size:n?lg:Er.constrain(A.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});M.call(aa.pointStyle,L,r)}else{var E=f(void 0,A.line,Gn,Ki);S.style("stroke-width",E+"px").call(ua.fill,A.fillcolor),E&&ua.stroke(S,A.line.color)}})}function y(T){var A=T[0].trace,M=Ir.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(A.visible&&A.type==="candlestick"?[T,T]:[]);M.enter().append("path").classed("legendcandle",!0).attr("d",function(S,L){return L?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"}).attr("transform",s).style("stroke-miterlimit",1),M.exit().remove(),M.each(function(S,L){var E=Ir.select(this),F=A[L?"increasing":"decreasing"],N=f(void 0,F.line,Gn,Ki);E.style("stroke-width",N+"px").call(ua.fill,F.fillcolor),N&&ua.stroke(E,F.line.color)})}function b(T){var A=T[0].trace,M=Ir.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(A.visible&&A.type==="ohlc"?[T,T]:[]);M.enter().append("path").classed("legendohlc",!0).attr("d",function(S,L){return L?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"}).attr("transform",s).style("stroke-miterlimit",1),M.exit().remove(),M.each(function(S,L){var E=Ir.select(this),F=A[L?"increasing":"decreasing"],N=f(void 0,F.line,Gn,Ki);E.style("fill","none").call(aa.dashLine,F.line.dash,N),N&&ua.stroke(E,F.line.color)})}function _(T){x(T,this,"pie")}function g(T){x(T,this,"funnelarea")}function x(T,A,M){var S=T[0],L=S.trace,E=M?L.visible&&L.type===M:fv.traceIs(L,M),F=Ir.select(A).select("g.legendpoints").selectAll("path.legend"+M).data(E?[T]:[]);if(F.enter().append("path").classed("legend"+M,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",s),F.exit().remove(),F.size()){var N=L.marker||{},z=f(w3(N.line.width,S.pts),N.line,Gn,Ki),H="pieLike",D=Er.minExtend(L,{marker:{line:{width:z}}},H),P=Er.minExtend(S,{trace:D},H);_3(F,P,D,r)}}function w(T){var A=T[0].trace,M,S=[];if(A.visible)switch(A.type){case"histogram2d":case"heatmap":S=[["M-15,-2V4H15V-2Z"]],M=!0;break;case"choropleth":case"choroplethmapbox":case"choroplethmap":S=[["M-6,-6V6H6V-6Z"]],M=!0;break;case"densitymapbox":case"densitymap":S=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],M="radial";break;case"cone":S=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],M=!1;break;case"streamtube":S=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],M=!1;break;case"surface":S=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],M=!0;break;case"mesh3d":S=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],M=!1;break;case"volume":S=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],M=!0;break;case"isosurface":S=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],M=!1;break}var L=Ir.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(S);L.enter().append("path").classed("legend3dandfriends",!0).attr("transform",s).style("stroke-miterlimit",1),L.exit().remove(),L.each(function(E,F){var N=Ir.select(this),z=cv(A),H=z.colorscale,D=z.reversescale,P=function(R){if(R.size()){var j="legendfill-"+A.uid;aa.gradient(R,r,j,uv(D,M==="radial"),H,"fill")}},k;if(H){if(!M){var $=H.length;k=F===0?H[D?$-1:0][1]:F===1?H[D?0:$-1][1]:H[Math.floor(($-1)/2)][1]}}else{var C=A.vertexcolor||A.facecolor||A.color;k=Er.isArrayOrTypedArray(C)?C[F]||C[0]:C}N.attr("d",E[0]),k?N.call(ua.fill,k):N.call(P)})}};function uv(t,e){var r=e?"radial":"horizontal";return r+(t?"":"reversed")}function fg(t){var e=t[0].trace,r=e.contours,a=uc.hasLines(e),i=uc.hasMarkers(e),n=e.visible&&e.fill&&e.fill!=="none",o=!1,l=!1;if(r){var s=r.coloring;s==="lines"?o=!0:a=s==="none"||s==="heatmap"||r.showlines,r.type==="constraint"?n=r._operation!=="=":(s==="fill"||s==="heatmap")&&(l=!0)}return{showMarker:i,showLine:a,showFill:n,showGradientLine:o,showGradientFill:l,anyLine:a||o,anyFill:n||l}}function cg(t,e,r){return t&&Er.isArrayOrTypedArray(t)?e:t>r?r:t}var qr=bt,ur=we,ah=hr,To=ot,ug=ms,vv=ai,vr=Et,Ff=yt,xn=Tr,vg=p3,yr=cT,gp=Vr,vT=gp.LINE_SPACING,mo=gp.FROM_TL,dg=gp.FROM_BR,hg=m3,A3=uT,pg=Zo,so=1,M3=/^legend[0-9]*$/,dT=function(e,r){if(r)mg(e,r);else{var a=e._fullLayout,i=a._legends,n=a._infolayer.selectAll('[class^="legend"]');n.each(function(){var f=qr.select(this),c=f.attr("class"),u=c.split(" ")[0];u.match(M3)&&i.indexOf(u)===-1&&f.remove()});for(var o=0;o<i.length;o++){var l=i[o],s=e._fullLayout[l];mg(e,s)}}};function S3(t,e,r){if(!(e.title.side!=="top center"&&e.title.side!=="top right")){var a=e.title.font,i=a.size*vT,n=0,o=t.node(),l=vr.bBox(o).width;e.title.side==="top center"?n=.5*(e._width-2*r-2*yr.titlePad-l):e.title.side==="top right"&&(n=e._width-2*r-2*yr.titlePad-l),xn.positionText(t,r+yr.titlePad+n,r+i)}}function mg(t,e){var r=e||{},a=t._fullLayout,i=nu(r),n,o,l=r._inHover;if(l?(o=r.layer,n="hover"):(o=a._infolayer,n=i),!!o){n+=a._uid,t._legendMouseDownTime||(t._legendMouseDownTime=0);var s;if(l){if(!r.entries)return;s=hg(r.entries,r)}else{for(var f=(t.calcdata||[]).slice(),c=a.shapes,u=0;u<c.length;u++){var v=c[u];if(v.showlegend){var p={_isShape:!0,_fullInput:v,index:v._index,name:v.name||v.label.text||"shape "+v._index,legend:v.legend,legendgroup:v.legendgroup,legendgrouptitle:v.legendgrouptitle,legendrank:v.legendrank,legendwidth:v.legendwidth,showlegend:v.showlegend,visible:v.visible,opacity:v.opacity,mode:v.type==="line"?"lines":"markers",line:v.line,marker:{line:v.line,color:v.fillcolor,size:12,symbol:v.type==="rect"?"square":v.type==="circle"?"circle":"hexagon2"}};f.push([{trace:p}])}}s=a.showlegend&&hg(f,r,a._legends.length>1)}var d=a.hiddenlabels||[];if(!l&&(!a.showlegend||!s.length))return o.selectAll("."+i).remove(),a._topdefs.select("#"+n).remove(),ah.autoMargin(t,i);var h=ur.ensureSingle(o,"g",i,function(A){l||A.attr("pointer-events","all")}),m=ur.ensureSingleById(a._topdefs,"clipPath",n,function(A){A.append("rect")}),y=ur.ensureSingle(h,"rect","bg",function(A){A.attr("shape-rendering","crispEdges")});y.call(Ff.stroke,r.bordercolor).call(Ff.fill,r.bgcolor).style("stroke-width",r.borderwidth+"px");var b=ur.ensureSingle(h,"g","scrollbox"),_=r.title;r._titleWidth=0,r._titleHeight=0;var g;_.text?(g=ur.ensureSingle(b,"text",i+"titletext"),g.attr("text-anchor","start").call(vr.font,_.font).text(_.text),Nf(g,b,t,r,so)):b.selectAll("."+i+"titletext").remove();var x=ur.ensureSingle(h,"rect","scrollbar",function(A){A.attr(yr.scrollBarEnterAttrs).call(Ff.fill,yr.scrollBarColor)}),w=b.selectAll("g.groups").data(s);w.enter().append("g").attr("class","groups"),w.exit().remove();var T=w.selectAll("g.traces").data(ur.identity);T.enter().append("g").attr("class","traces"),T.exit().remove(),T.style("opacity",function(A){var M=A[0].trace;return To.traceIs(M,"pie-like")?d.indexOf(A[0].label)!==-1?.5:1:M.visible==="legendonly"?.5:1}).each(function(){qr.select(this).call(L3,t,r)}).call(A3,t,r).each(function(){l||qr.select(this).call(C3,t,i)}),ur.syncOrAsync([ah.previousPromises,function(){return $3(t,w,T,r)},function(){var A=a._size,M=r.borderwidth,S=r.xref==="paper",L=r.yref==="paper";if(_.text&&S3(g,r,M),!l){var E,F;S?E=A.l+A.w*r.x-mo[vc(r)]*r._width:E=a.width*r.x-mo[vc(r)]*r._width,L?F=A.t+A.h*(1-r.y)-mo[dc(r)]*r._effHeight:F=a.height*(1-r.y)-mo[dc(r)]*r._effHeight;var N=E3(t,i,E,F);if(N)return;if(a.margin.autoexpand){var z=E,H=F;E=S?ur.constrain(E,0,a.width-r._width):z,F=L?ur.constrain(F,0,a.height-r._effHeight):H,E!==z&&ur.log("Constrain "+i+".x to make legend fit inside graph"),F!==H&&ur.log("Constrain "+i+".y to make legend fit inside graph")}vr.setTranslate(h,E,F)}if(x.on(".drag",null),h.on("wheel",null),l||r._height<=r._maxHeight||t._context.staticPlot){var D=r._effHeight;l&&(D=r._height),y.attr({width:r._width-M,height:D-M,x:M/2,y:M/2}),vr.setTranslate(b,0,0),m.select("rect").attr({width:r._width-2*M,height:D-2*M,x:M,y:M}),vr.setClipUrl(b,n,t),vr.setRect(x,0,0,0,0),delete r._scrollY}else{var P=Math.max(yr.scrollBarMinHeight,r._effHeight*r._effHeight/r._height),k=r._effHeight-P-2*yr.scrollBarMargin,C=r._height-r._effHeight,$=k/C,R=Math.min(r._scrollY||0,C);y.attr({width:r._width-2*M+yr.scrollBarWidth+yr.scrollBarMargin,height:r._effHeight-M,x:M/2,y:M/2}),m.select("rect").attr({width:r._width-2*M+yr.scrollBarWidth+yr.scrollBarMargin,height:r._effHeight-2*M,x:M,y:M+R}),vr.setClipUrl(b,n,t),B(R,P,$),h.on("wheel",function(){R=ur.constrain(r._scrollY+qr.event.deltaY/k*C,0,C),B(R,P,$),R!==0&&R!==C&&qr.event.preventDefault()});var j,G,Y,O=function(q,te,le){var ce=(le-te)/$+q;return ur.constrain(ce,0,C)},K=function(q,te,le){var ce=(te-le)/$+q;return ur.constrain(ce,0,C)},W=qr.behavior.drag().on("dragstart",function(){var q=qr.event.sourceEvent;q.type==="touchstart"?j=q.changedTouches[0].clientY:j=q.clientY,Y=R}).on("drag",function(){var q=qr.event.sourceEvent;q.buttons===2||q.ctrlKey||(q.type==="touchmove"?G=q.changedTouches[0].clientY:G=q.clientY,R=O(Y,j,G),B(R,P,$))});x.call(W);var X=qr.behavior.drag().on("dragstart",function(){var q=qr.event.sourceEvent;q.type==="touchstart"&&(j=q.changedTouches[0].clientY,Y=R)}).on("drag",function(){var q=qr.event.sourceEvent;q.type==="touchmove"&&(G=q.changedTouches[0].clientY,R=K(Y,j,G),B(R,P,$))});b.call(X)}function B(q,te,le){r._scrollY=t._fullLayout[i]._scrollY=q,vr.setTranslate(b,0,-q),vr.setRect(x,r._width,yr.scrollBarMargin+q*le,yr.scrollBarWidth,te),m.select("rect").attr("y",M+q)}if(t._context.edits.legendPosition){var ee,ae,de,fe;h.classed("cursor-move",!0),vv.init({element:h.node(),gd:t,prepFn:function(q){if(q.target!==x.node()){var te=vr.getTranslate(h);de=te.x,fe=te.y}},moveFn:function(q,te){if(de!==void 0&&fe!==void 0){var le=de+q,ce=fe+te;vr.setTranslate(h,le,ce),ee=vv.align(le,r._width,A.l,A.l+A.w,r.xanchor),ae=vv.align(ce+r._height,-r._height,A.t+A.h,A.t,r.yanchor)}},doneFn:function(){if(ee!==void 0&&ae!==void 0){var q={};q[i+".x"]=ee,q[i+".y"]=ae,To.call("_guiRelayout",t,q)}},clickFn:function(q,te){var le=o.selectAll("g.traces").filter(function(){var ce=this.getBoundingClientRect();return te.clientX>=ce.left&&te.clientX<=ce.right&&te.clientY>=ce.top&&te.clientY<=ce.bottom});le.size()>0&&hT(t,h,le,q,te)}})}}],t)}}function qs(t,e,r){var a=t[0],i=a.width,n=e.entrywidthmode,o=a.trace.legendwidth||e.entrywidth;return n==="fraction"?e._maxWidth*o:r+(o||i)}function hT(t,e,r,a,i){var n=r.data()[0][0].trace,o={event:i,node:r.node(),curveNumber:n.index,expandedIndex:n.index,data:t.data,layout:t.layout,frames:t._transitionData._frames,config:t._context,fullData:t._fullData,fullLayout:t._fullLayout};n._group&&(o.group=n._group),To.traceIs(n,"pie-like")&&(o.label=r.datum()[0].label);var l=ug.triggerHandler(t,"plotly_legendclick",o);if(a===1){if(l===!1)return;e._clickTimeout=setTimeout(function(){t._fullLayout&&vg(r,t,a)},t._context.doubleClickDelay)}else if(a===2){e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0;var s=ug.triggerHandler(t,"plotly_legenddoubleclick",o);s!==!1&&l!==!1&&vg(r,t,a)}}function L3(t,e,r){var a=nu(r),i=t.data()[0][0],n=i.trace,o=To.traceIs(n,"pie-like"),l=!r._inHover&&e._context.edits.legendText&&!o,s=r._maxNameLength,f,c;i.groupTitle?(f=i.groupTitle.text,c=i.groupTitle.font):(c=r.font,r.entries?f=i.text:(f=o?i.label:n.name,n._meta&&(f=ur.templateString(f,n._meta))));var u=ur.ensureSingle(t,"text",a+"text");u.attr("text-anchor","start").call(vr.font,c).text(l?yg(f,s):f);var v=r.indentation+r.itemwidth+yr.itemGap*2;xn.positionText(u,v,0),l?u.call(xn.makeEditable,{gd:e,text:f}).call(Nf,t,e,r).on("edit",function(p){this.text(yg(p,s)).call(Nf,t,e,r);var d=i.trace._fullInput||{},h={};return h.name=p,d._isShape?To.call("_guiRelayout",e,"shapes["+n.index+"].name",h.name):To.call("_guiRestyle",e,h,n.index)}):Nf(u,t,e,r)}function yg(t,e){var r=Math.max(4,e);if(t&&t.trim().length>=r/2)return t;t=t||"";for(var a=r-t.length;a>0;a--)t+=" ";return t}function C3(t,e,r){var a=e._context.doubleClickDelay,i,n=1,o=ur.ensureSingle(t,"rect",r+"toggle",function(l){e._context.staticPlot||l.style("cursor","pointer").attr("pointer-events","all"),l.call(Ff.fill,"rgba(0,0,0,0)")});e._context.staticPlot||(o.on("mousedown",function(){i=new Date().getTime(),i-e._legendMouseDownTime<a?n+=1:(n=1,e._legendMouseDownTime=i)}),o.on("mouseup",function(){if(!(e._dragged||e._editing)){var l=e._fullLayout[r];new Date().getTime()-e._legendMouseDownTime>a&&(n=Math.max(n-1,1)),hT(e,l,t,n,qr.event)}}))}function Nf(t,e,r,a,i){a._inHover&&t.attr("data-notex",!0),xn.convertToTspans(t,r,function(){D3(e,r,a,i)})}function D3(t,e,r,a){var i=t.data()[0][0];if(!r._inHover&&i&&!i.trace.showlegend){t.remove();return}var n=t.select("g[class*=math-group]"),o=n.node(),l=nu(r);r||(r=e._fullLayout[l]);var s=r.borderwidth,f;a===so?f=r.title.font:i.groupTitle?f=i.groupTitle.font:f=r.font;var c=f.size*vT,u,v;if(o){var p=vr.bBox(o);u=p.height,v=p.width,a===so?vr.setTranslate(n,s,s+u*.75):vr.setTranslate(n,0,u*.25)}else{var d="."+l+(a===so?"title":"")+"text",h=t.select(d),m=xn.lineCount(h),y=h.node();if(u=c*m,v=y?vr.bBox(y).width:0,a===so)r.title.side==="left"&&(v+=yr.itemGap*2),xn.positionText(h,s+yr.titlePad,s+c);else{var b=yr.itemGap*2+r.indentation+r.itemwidth;i.groupTitle&&(b=yr.itemGap,v-=r.indentation+r.itemwidth),xn.positionText(h,b,-c*((m-1)/2-.3))}}a===so?(r._titleWidth=v,r._titleHeight=u):(i.lineHeight=c,i.height=Math.max(u,16)+3,i.width=v)}function P3(t){var e=0,r=0,a=t.title.side;return a&&(a.indexOf("left")!==-1&&(e=t._titleWidth),a.indexOf("top")!==-1&&(r=t._titleHeight)),[e,r]}function $3(t,e,r,a){var i=t._fullLayout,n=nu(a);a||(a=i[n]);var o=i._size,l=pg.isVertical(a),s=pg.isGrouped(a),f=a.entrywidthmode==="fraction",c=a.borderwidth,u=2*c,v=yr.itemGap,p=a.indentation+a.itemwidth+v*2,d=2*(c+v),h=dc(a),m=a.y<0||a.y===0&&h==="top",y=a.y>1||a.y===1&&h==="bottom",b=a.tracegroupgap,_={},{maxheight:g,orientation:x,yref:w}=a,T=x==="v"&&w==="paper"?o.h:i.height;a._maxHeight=Math.max(g>1?g:g*T,30);var A=0;a._width=0,a._height=0;var M=P3(a);if(l)r.each(function(X){var B=X[0].height;vr.setTranslate(this,c+M[0],c+M[1]+a._height+B/2+v),a._height+=B,a._width=Math.max(a._width,X[0].width)}),A=p+a._width,a._width+=v+p+u,a._height+=d,s&&(e.each(function(X,B){vr.setTranslate(this,0,B*a.tracegroupgap)}),a._height+=(a._lgroupsLength-1)*a.tracegroupgap);else{var S=vc(a),L=a.x<0||a.x===0&&S==="right",E=a.x>1||a.x===1&&S==="left",F=y||m,N=i.width/2;a._maxWidth=Math.max(L?F&&S==="left"?o.l+o.w:N:E?F&&S==="right"?o.r+o.w:N:o.w,2*p);var z=0,H=0;r.each(function(X){var B=qs(X,a,p);z=Math.max(z,B),H+=B}),A=null;var D=0;if(s){var P=0,k=0,C=0;e.each(function(){var X=0,B=0;qr.select(this).selectAll("g.traces").each(function(ae){var de=qs(ae,a,p),fe=ae[0].height;vr.setTranslate(this,M[0],M[1]+c+v+fe/2+B),B+=fe,X=Math.max(X,de),_[ae[0].trace.legendgroup]=X});var ee=X+v;k>0&&ee+c+k>a._maxWidth?(D=Math.max(D,k),k=0,C+=P+b,P=B):P=Math.max(P,B),vr.setTranslate(this,k,C),k+=ee}),a._width=Math.max(D,k)+c,a._height=C+P+d}else{var $=r.size(),R=H+u+($-1)*v<a._maxWidth,j=0,G=0,Y=0,O=0;r.each(function(X){var B=X[0].height,ee=qs(X,a,p),ae=R?ee:z;f||(ae+=v),ae+c+G-v>=a._maxWidth&&(D=Math.max(D,O),G=0,Y+=j,a._height+=j,j=0),vr.setTranslate(this,M[0]+c+G,M[1]+c+Y+B/2+v),O=G+ee+v,G+=ae,j=Math.max(j,B)}),R?(a._width=G+u,a._height=j+d):(a._width=Math.max(D,O)+u,a._height+=j+d)}}a._width=Math.ceil(Math.max(a._width+M[0],a._titleWidth+2*(c+yr.titlePad))),a._height=Math.ceil(Math.max(a._height+M[1],a._titleHeight+2*(c+yr.itemGap))),a._effHeight=Math.min(a._height,a._maxHeight);var K=t._context.edits,W=K.legendText||K.legendPosition;r.each(function(X){var B=qr.select(this).select("."+n+"toggle"),ee=X[0].height,ae=X[0].trace.legendgroup,de=qs(X,a,p);s&&ae!==""&&(de=_[ae]);var fe=W?p:A||de;!l&&!f&&(fe+=v/2),vr.setRect(B,0,-ee/2,fe,ee)})}function E3(t,e,r,a){var i=t._fullLayout,n=i[e],o=vc(n),l=dc(n),s=n.xref==="paper",f=n.yref==="paper";t._fullLayout._reservedMargin[e]={};var c=n.y<.5?"b":"t",u=n.x<.5?"l":"r",v={r:i.width-r,l:r+n._width,b:i.height-a,t:a+n._effHeight};if(s&&f)return ah.autoMargin(t,e,{x:n.x,y:n.y,l:n._width*mo[o],r:n._width*dg[o],b:n._effHeight*dg[l],t:n._effHeight*mo[l]});s?t._fullLayout._reservedMargin[e][c]=v[c]:f||n.orientation==="v"?t._fullLayout._reservedMargin[e][u]=v[u]:t._fullLayout._reservedMargin[e][c]=v[c]}function vc(t){return ur.isRightAnchor(t)?"right":ur.isCenterAnchor(t)?"center":"left"}function dc(t){return ur.isBottomAnchor(t)?"bottom":ur.isMiddleAnchor(t)?"middle":"top"}function nu(t){return t._id||"legend"}var vn=bt,si=kt,gg=_a,or=we,z3=or.pushUnique,dv=or.strTranslate,R3=or.strRotate,I3=ms,da=Tr,F3=l3,qa=Et,xr=yt,Zs=ai,Za=Ot,N3=Rr.zindexSeparator,$o=ot,Ca=Ta,An=Fc,H3=fT,O3=dT,pT=An.YANGLE,bp=Math.PI*pT/180,j3=1/Math.sin(bp),B3=Math.cos(bp),G3=Math.sin(bp),qt=An.HOVERARROWSIZE,St=An.HOVERTEXTPAD,bg={box:!0,ohlc:!0,violin:!0,candlestick:!0},U3={scatter:!0,scattergl:!0,splom:!0};function xg(t,e){return t.distance-e.distance}iu.hover=function(e,r,a,i){e=or.getGraphDiv(e);var n=r.target;or.throttle(e._fullLayout._uid+An.HOVERID,An.HOVERMINTIME,function(){V3(e,r,a,i,n)})};iu.loneHover=function(e,r){var a=!0;Array.isArray(e)||(a=!1,e=[e]);var i=r.gd,n=xT(i),o=_T(i),l=e.map(function(m){var y=m._x0||m.x0||m.x||0,b=m._x1||m.x1||m.x||0,_=m._y0||m.y0||m.y||0,g=m._y1||m.y1||m.y||0,x=m.eventData;if(x){var w=Math.min(y,b),T=Math.max(y,b),A=Math.min(_,g),M=Math.max(_,g),S=m.trace;if($o.traceIs(S,"gl3d")){var L=i._fullLayout[S.scene]._scene.container,E=L.offsetLeft,F=L.offsetTop;w+=E,T+=E,A+=F,M+=F}x.bbox={x0:w+o,x1:T+o,y0:A+n,y1:M+n},r.inOut_bbox&&r.inOut_bbox.push(x.bbox)}else x=!1;return{color:m.color||xr.defaultLine,x0:m.x0||m.x||0,x1:m.x1||m.x||0,y0:m.y0||m.y||0,y1:m.y1||m.y||0,xLabel:m.xLabel,yLabel:m.yLabel,zLabel:m.zLabel,text:m.text,name:m.name,idealAlign:m.idealAlign,borderColor:m.borderColor,fontFamily:m.fontFamily,fontSize:m.fontSize,fontColor:m.fontColor,fontWeight:m.fontWeight,fontStyle:m.fontStyle,fontVariant:m.fontVariant,nameLength:m.nameLength,textAlign:m.textAlign,trace:m.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:m.hovertemplate||!1,hovertemplateLabels:m.hovertemplateLabels||!1,eventData:x}}),s=!1,f=yT(l,{gd:i,hovermode:"closest",rotateLabels:s,bgColor:r.bgColor||xr.background,container:vn.select(r.container),outerContainer:r.outerContainer||r.container}),c=f.hoverLabels,u=5,v=0,p=0;c.sort(function(m,y){return m.y0-y.y0}).each(function(m,y){var b=m.y0-m.by/2;b-u<v?m.offset=v-b+u:m.offset=0,v=b+m.by+m.offset,y===r.anchorIndex&&(p=m.offset)}).each(function(m){m.offset-=p});var d=i._fullLayout._invScaleX,h=i._fullLayout._invScaleY;return bT(c,s,d,h),a?c:c.node()};function V3(t,e,r,a,i){r||(r="xy"),typeof r=="string"&&(r=r.split(N3)[0]);var n=Array.isArray(r)?r:[r],o,l=t._fullLayout,s=l.hoversubplots,f=l._plots||[],c=f[r],u=l._has("cartesian"),v=e.hovermode||l.hovermode,p=(v||"").charAt(0)==="x",d=(v||"").charAt(0)==="y",h,m;if(u&&(p||d)&&s==="axis"){for(var y=n.length,b=0;b<y;b++)if(o=n[b],f[o]){h=Za.getFromId(t,o,"x"),m=Za.getFromId(t,o,"y");var _=(p?h:m)._subplotsWith;if(_&&_.length)for(var g=0;g<_.length;g++)z3(n,_[g])}}if(c&&s!=="single"){var x=c.overlays.map(function(Fe){return Fe.id});n=n.concat(x)}for(var w=n.length,T=new Array(w),A=new Array(w),M=!1,S=0;S<w;S++)if(o=n[S],f[o])M=!0,T[S]=f[o].xaxis,A[S]=f[o].yaxis;else if(l[o]&&l[o]._subplot){var L=l[o]._subplot;T[S]=L.xaxis,A[S]=L.yaxis}else{or.warn("Unrecognized subplot: "+o);return}if(v&&!M&&(v="closest"),["x","y","closest","x unified","y unified"].indexOf(v)===-1||!t.calcdata||t.querySelector(".zoombox")||t._dragging)return Zs.unhoverRaw(t,e);var E=l.hoverdistance;E===-1&&(E=1/0);var F=l.spikedistance;F===-1&&(F=1/0);var N=[],z=[],H,D,P,k,C,$,R,j,G,Y,O,K,W,X={hLinePoint:null,vLinePoint:null},B=!1;if(Array.isArray(e))for(v="array",P=0;P<e.length;P++)C=t.calcdata[e[P].curveNumber||0],C&&($=C[0].trace,C[0].trace.hoverinfo!=="skip"&&(z.push(C),$.orientation==="h"&&(B=!0)));else{var ee=t.calcdata.slice();for(ee.sort(function(Fe,tt){var st=Fe[0].trace.zorder||0,Ve=tt[0].trace.zorder||0;return st-Ve}),k=0;k<ee.length;k++)C=ee[k],$=C[0].trace,$.hoverinfo!=="skip"&&Ca.isTraceInSubplots($,n)&&(z.push(C),$.orientation==="h"&&(B=!0));var ae=!i,de,fe;if(ae)"xpx"in e?de=e.xpx:de=T[0]._length/2,"ypx"in e?fe=e.ypx:fe=A[0]._length/2;else{if(I3.triggerHandler(t,"plotly_beforehover",e)===!1)return;var q=i.getBoundingClientRect();de=e.clientX-q.left,fe=e.clientY-q.top,l._calcInverseTransform(t);var te=or.apply3DTransform(l._invTransform)(de,fe);if(de=te[0],fe=te[1],de<0||de>T[0]._length||fe<0||fe>A[0]._length)return Zs.unhoverRaw(t,e)}if(e.pointerX=de+T[0]._offset,e.pointerY=fe+A[0]._offset,"xval"in e?H=Ca.flat(n,e.xval):H=Ca.p2c(T,de),"yval"in e?D=Ca.flat(n,e.yval):D=Ca.p2c(A,fe),!si(H[0])||!si(D[0]))return or.warn("Fx.hover failed",e,t),Zs.unhoverRaw(t,e)}var le=1/0;function ce(Fe,tt){for(k=0;k<z.length;k++)if(C=z[k],!(!C||!C[0]||!C[0].trace)&&($=C[0].trace,!($.visible!==!0||$._length===0)&&["carpet","contourcarpet"].indexOf($._module.name)===-1)){if(G=v,Ca.isUnifiedHover(G)&&(G=G.charAt(0)),$.type==="splom"?(j=0,R=n[j]):(R=Ca.getSubplot($),j=n.indexOf(R)),K={cd:C,trace:$,xa:T[j],ya:A[j],maxHoverDistance:E,maxSpikeDistance:F,index:!1,distance:Math.min(le,E),spikeDistance:1/0,xSpike:void 0,ySpike:void 0,color:xr.defaultLine,name:$.name,x0:void 0,x1:void 0,y0:void 0,y1:void 0,xLabelVal:void 0,yLabelVal:void 0,zLabelVal:void 0,text:void 0},l[R]&&(K.subplot=l[R]._subplot),l._splomScenes&&l._splomScenes[$.uid]&&(K.scene=l._splomScenes[$.uid]),G==="array"){var st=e[k];"pointNumber"in st?(K.index=st.pointNumber,G="closest"):(G="","xval"in st&&(Y=st.xval,G="x"),"yval"in st&&(O=st.yval,G=G?"closest":"y"))}else Fe!==void 0&&tt!==void 0?(Y=Fe,O=tt):(Y=H[j],O=D[j]);if(W=N.length,E!==0)if($._module&&$._module.hoverPoints){var Ve=$._module.hoverPoints(K,Y,O,G,{finiteRange:!0,hoverLayer:l._hoverlayer,hoversubplots:s,gd:t});if(Ve)for(var Lt,ft=0;ft<Ve.length;ft++)Lt=Ve[ft],si(Lt.x0)&&si(Lt.y0)&&N.push(q3(Lt,v))}else or.log("Unrecognized trace type in hover:",$);if(v==="closest"&&N.length>W&&(N.splice(0,W),le=N[0].distance),u&&F!==0&&N.length===0){K.distance=F,K.index=!1;var Ze=$._module.hoverPoints(K,Y,O,"closest",{hoverLayer:l._hoverlayer});if(Ze&&(Ze=Ze.filter(function(it){return it.spikeDistance<=F})),Ze&&Ze.length){var gt,wt=Ze.filter(function(it){return it.xa.showspikes&&it.xa.spikesnap!=="hovered data"});if(wt.length){var lt=wt[0];si(lt.x0)&&si(lt.y0)&&(gt=ue(lt),(!X.vLinePoint||X.vLinePoint.spikeDistance>gt.spikeDistance)&&(X.vLinePoint=gt))}var ct=Ze.filter(function(it){return it.ya.showspikes&&it.ya.spikesnap!=="hovered data"});if(ct.length){var Ke=ct[0];si(Ke.x0)&&si(Ke.y0)&&(gt=ue(Ke),(!X.hLinePoint||X.hLinePoint.spikeDistance>gt.spikeDistance)&&(X.hLinePoint=gt))}}}}}ce();function ye(Fe,tt,st){for(var Ve=null,Lt=1/0,ft,Ze=0;Ze<Fe.length;Ze++)h&&h._id!==Fe[Ze].xa._id||m&&m._id!==Fe[Ze].ya._id||(ft=Fe[Ze].spikeDistance,st&&Ze===0&&(ft=-1/0),ft<=Lt&&ft<=tt&&(Ve=Fe[Ze],Lt=ft));return Ve}function ue(Fe){return Fe?{xa:Fe.xa,ya:Fe.ya,x:Fe.xSpike!==void 0?Fe.xSpike:(Fe.x0+Fe.x1)/2,y:Fe.ySpike!==void 0?Fe.ySpike:(Fe.y0+Fe.y1)/2,distance:Fe.distance,spikeDistance:Fe.spikeDistance,curveNumber:Fe.trace.index,color:Fe.color,pointNumber:Fe.index}:null}var oe={fullLayout:l,container:l._hoverlayer,event:e};t._spikepoints;var pe={vLinePoint:X.vLinePoint,hLinePoint:X.hLinePoint};t._spikepoints=pe;var Me=function(){var Fe=N.filter(function(st){return h&&h._id===st.xa._id&&m&&m._id===st.ya._id}),tt=N.filter(function(st){return!(h&&h._id===st.xa._id&&m&&m._id===st.ya._id)});Fe.sort(xg),tt.sort(xg),N=Fe.concat(tt),N=K3(N,v)};Me();var ve=v.charAt(0),ke=(ve==="x"||ve==="y")&&N[0]&&U3[N[0].trace.type];if(u&&F!==0&&N.length!==0){var _e=N.filter(function(Fe){return Fe.ya.showspikes}),J=ye(_e,F,ke);X.hLinePoint=ue(J);var be=N.filter(function(Fe){return Fe.xa.showspikes}),Z=ye(be,F,ke);X.vLinePoint=ue(Z)}if(N.length===0){var me=Zs.unhoverRaw(t,e);return u&&(X.hLinePoint!==null||X.vLinePoint!==null)&&Tg()&&wg(t,X,oe),me}if(u&&Tg()&&wg(t,X,oe),Ca.isXYhover(G)&&N[0].length!==0&&N[0].trace.type!=="splom"){var ge=N[0];bg[ge.trace.type]?N=N.filter(function(Fe){return Fe.trace.index===ge.trace.index}):N=[ge];var Pe=N.length,Ee=Ag("x",ge,l),Le=Ag("y",ge,l);ce(Ee,Le);var Ae=[],Oe={},$e=0,ze=function(Fe){var tt=bg[Fe.trace.type]?mT(Fe):Fe.trace.index;if(!Oe[tt])$e++,Oe[tt]=$e,Ae.push(Fe);else{var st=Oe[tt]-1,Ve=Ae[st];st>0&&Math.abs(Fe.distance)<Math.abs(Ve.distance)&&(Ae[st]=Fe)}},je;for(je=0;je<Pe;je++)ze(N[je]);for(je=N.length-1;je>Pe-1;je--)ze(N[je]);N=Ae,Me()}var at=t._hoverdata,xe=[],We=xT(t),Xe=_T(t);for(P=0;P<N.length;P++){var Re=N[P],et=Ca.makeEventData(Re,Re.trace,Re.cd);if(Re.hovertemplate!==!1){var Ue=!1;Re.cd[Re.index]&&Re.cd[Re.index].ht&&(Ue=Re.cd[Re.index].ht),Re.hovertemplate=Ue||Re.trace.hovertemplate||!1}if(Re.xa&&Re.ya){var I=Re.x0+Re.xa._offset,U=Re.x1+Re.xa._offset,V=Re.y0+Re.ya._offset,Q=Re.y1+Re.ya._offset,se=Math.min(I,U),re=Math.max(I,U),Ce=Math.min(V,Q),Se=Math.max(V,Q);et.bbox={x0:se+Xe,x1:re+Xe,y0:Ce+We,y1:Se+We}}Re.eventData=[et],xe.push(et)}t._hoverdata=xe;var he=v==="y"&&(z.length>1||N.length>1)||v==="closest"&&B&&N.length>1,ne=xr.combine(l.plot_bgcolor||xr.background,l.paper_bgcolor),Te=yT(N,{gd:t,hovermode:v,rotateLabels:he,bgColor:ne,container:l._hoverlayer,outerContainer:l._paper.node(),commonLabelOpts:l.hoverlabel,hoverdistance:l.hoverdistance}),Ie=Te.hoverLabels;if(Ca.isUnifiedHover(v)||(X3(Ie,he,l,Te.commonLabelBoundingBox),bT(Ie,he,l._invScaleX,l._invScaleY)),i&&i.tagName){var Ge=$o.getComponentMethod("annotations","hasClickToShow")(t,xe);F3(vn.select(i),Ge?"pointer":"")}!i||a||!Z3(t,e,at)||(at&&t.emit("plotly_unhover",{event:e,points:at}),t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:T,yaxes:A,xvals:H,yvals:D}))}function mT(t){return[t.trace.index,t.index,t.x0,t.y0,t.name,t.attr,t.xa?t.xa._id:"",t.ya?t.ya._id:""].join(",")}var W3=/<extra>([\s\S]*)<\/extra>/;function yT(t,e){var r=e.gd,a=r._fullLayout,i=e.hovermode,n=e.rotateLabels,o=e.bgColor,l=e.container,s=e.outerContainer,f=e.commonLabelOpts||{};if(t.length===0)return[[]];var c=e.fontFamily||An.HOVERFONT,u=e.fontSize||An.HOVERFONTSIZE,v=e.fontWeight||a.font.weight,p=e.fontStyle||a.font.style,d=e.fontVariant||a.font.variant,h=e.fontTextcase||a.font.textcase,m=e.fontLineposition||a.font.lineposition,y=e.fontShadow||a.font.shadow,b=t[0],_=b.xa,g=b.ya,x=i.charAt(0),w=x+"Label",T=b[w];if(T===void 0&&_.type==="multicategory")for(var A=0;A<t.length&&(T=t[A][w],T===void 0);A++);var M=Un(r,s),S=M.top,L=M.width,E=M.height,F=T!==void 0&&b.distance<=e.hoverdistance&&(i==="x"||i==="y");if(F){var N=!0,z,H;for(z=0;z<t.length;z++)if(N&&t[z].zLabel===void 0&&(N=!1),H=t[z].hoverinfo||t[z].trace.hoverinfo,H){var D=Array.isArray(H)?H:H.split("+");if(D.indexOf("all")===-1&&D.indexOf(i)===-1){F=!1;break}}N&&(F=!1)}var P=l.selectAll("g.axistext").data(F?[0]:[]);P.enter().append("g").classed("axistext",!0),P.exit().remove();var k={minX:0,maxX:0,minY:0,maxY:0};if(P.each(function(){var Z=vn.select(this),me=or.ensureSingle(Z,"path","",function(re){re.style({"stroke-width":"1px"})}),ge=or.ensureSingle(Z,"text","",function(re){re.attr("data-notex",1)}),Pe=f.bgcolor||xr.defaultLine,Ee=f.bordercolor||xr.contrast(Pe),Le=xr.contrast(Pe),Ae=f.font,Oe={weight:Ae.weight||v,style:Ae.style||p,variant:Ae.variant||d,textcase:Ae.textcase||h,lineposition:Ae.lineposition||m,shadow:Ae.shadow||y,family:Ae.family||c,size:Ae.size||u,color:Ae.color||Le};me.style({fill:Pe,stroke:Ee}),ge.text(T).call(qa.font,Oe).call(da.positionText,0,0).call(da.convertToTspans,r),Z.attr("transform","");var $e=Un(r,ge.node()),ze,je;if(i==="x"){var at=_.side==="top"?"-":"";ge.attr("text-anchor","middle").call(da.positionText,0,_.side==="top"?S-$e.bottom-qt-St:S-$e.top+qt+St),ze=_._offset+(b.x0+b.x1)/2,je=g._offset+(_.side==="top"?0:g._length);var xe=$e.width/2+St,We=ze;ze<xe?We=xe:ze>a.width-xe&&(We=a.width-xe),me.attr("d","M"+(ze-We)+",0L"+(ze-We+qt)+","+at+qt+"H"+xe+"v"+at+(St*2+$e.height)+"H"+-xe+"V"+at+qt+"H"+(ze-We-qt)+"Z"),ze=We,k.minX=ze-xe,k.maxX=ze+xe,_.side==="top"?(k.minY=je-(St*2+$e.height),k.maxY=je-St):(k.minY=je+St,k.maxY=je+(St*2+$e.height))}else{var Xe,Re,et;g.side==="right"?(Xe="start",Re=1,et="",ze=_._offset+_._length):(Xe="end",Re=-1,et="-",ze=_._offset),je=g._offset+(b.y0+b.y1)/2,ge.attr("text-anchor",Xe),me.attr("d","M0,0L"+et+qt+","+qt+"V"+(St+$e.height/2)+"h"+et+(St*2+$e.width)+"V-"+(St+$e.height/2)+"H"+et+qt+"V-"+qt+"Z"),k.minY=je-(St+$e.height/2),k.maxY=je+(St+$e.height/2),g.side==="right"?(k.minX=ze+qt,k.maxX=ze+qt+(St*2+$e.width)):(k.minX=ze-qt-(St*2+$e.width),k.maxX=ze-qt);var Ue=$e.height/2,I=S-$e.top-Ue,U="clip"+a._uid+"commonlabel"+g._id,V;if(ze<$e.width+2*St+qt){V="M-"+(qt+St)+"-"+Ue+"h-"+($e.width-St)+"V"+Ue+"h"+($e.width-St)+"Z";var Q=$e.width-ze+St;da.positionText(ge,Q,I),Xe==="end"&&ge.selectAll("tspan").each(function(){var re=vn.select(this),Ce=qa.tester.append("text").text(re.text()).call(qa.font,Oe),Se=Un(r,Ce.node());Math.round(Se.width)<Math.round($e.width)&&re.attr("x",Q-Se.width),Ce.remove()})}else da.positionText(ge,Re*(St+qt),I),V=null;var se=a._topclips.selectAll("#"+U).data(V?[0]:[]);se.enter().append("clipPath").attr("id",U).append("path"),se.exit().remove(),se.select("path").attr("d",V),qa.setClipUrl(ge,V?U:null,r)}Z.attr("transform",dv(ze,je))}),Ca.isUnifiedHover(i)){l.selectAll("g.hovertext").remove();var C=t.filter(function(Z){return Z.hoverinfo!=="none"});if(C.length===0)return[];var $=a.hoverlabel,R=$.font,j={showlegend:!0,legend:{title:{text:T,font:R},font:R,bgcolor:$.bgcolor,bordercolor:$.bordercolor,borderwidth:1,tracegroupgap:7,traceorder:a.legend?a.legend.traceorder:void 0,orientation:"v"}},G={font:R};H3(j,G,r._fullData);var Y=G.legend;Y.entries=[];for(var O=0;O<C.length;O++){var K=C[O];if(K.hoverinfo!=="none"){var W=_g(K,!0,i,a,T),X=W[0],B=W[1];K.name=B,B!==""?K.text=B+" : "+X:K.text=X;var ee=K.cd[K.index];ee&&(ee.mc&&(K.mc=ee.mc),ee.mcc&&(K.mc=ee.mcc),ee.mlc&&(K.mlc=ee.mlc),ee.mlcc&&(K.mlc=ee.mlcc),ee.mlw&&(K.mlw=ee.mlw),ee.mrc&&(K.mrc=ee.mrc),ee.dir&&(K.dir=ee.dir)),K._distinct=!0,Y.entries.push([K])}}Y.entries.sort(function(Z,me){return Z[0].trace.index-me[0].trace.index}),Y.layer=l,Y._inHover=!0,Y._groupTitleFont=$.grouptitlefont,O3(r,Y);var ae=l.select("g.legend"),de=Un(r,ae.node()),fe=de.width+2*St,q=de.height+2*St,te=C[0],le=(te.x0+te.x1)/2,ce=(te.y0+te.y1)/2,ye=!($o.traceIs(te.trace,"bar-like")||$o.traceIs(te.trace,"box-violin")),ue,oe;x==="y"?ye?(oe=ce-St,ue=ce+St):(oe=Math.min.apply(null,C.map(function(Z){return Math.min(Z.y0,Z.y1)})),ue=Math.max.apply(null,C.map(function(Z){return Math.max(Z.y0,Z.y1)}))):oe=ue=or.mean(C.map(function(Z){return(Z.y0+Z.y1)/2}))-q/2;var pe,Me;x==="x"?ye?(pe=le+St,Me=le-St):(pe=Math.max.apply(null,C.map(function(Z){return Math.max(Z.x0,Z.x1)})),Me=Math.min.apply(null,C.map(function(Z){return Math.min(Z.x0,Z.x1)}))):pe=Me=or.mean(C.map(function(Z){return(Z.x0+Z.x1)/2}))-fe/2;var ve=_._offset,ke=g._offset;ue+=ke,pe+=ve,Me+=ve-fe,oe+=ke-q;var _e,J;return pe+fe<L&&pe>=0?_e=pe:Me+fe<L&&Me>=0?_e=Me:ve+fe<L?_e=ve:pe-le<le-Me+fe?_e=L-fe:_e=0,_e+=St,ue+q<E&&ue>=0?J=ue:oe+q<E&&oe>=0?J=oe:ke+q<E?J=ke:ue-ce<ce-oe+q?J=E-q:J=0,J+=St,ae.attr("transform",dv(_e-1,J-1)),ae}var be=l.selectAll("g.hovertext").data(t,function(Z){return mT(Z)});return be.enter().append("g").classed("hovertext",!0).each(function(){var Z=vn.select(this);Z.append("rect").call(xr.fill,xr.addOpacity(o,.8)),Z.append("text").classed("name",!0),Z.append("path").style("stroke-width","1px"),Z.append("text").classed("nums",!0).call(qa.font,{weight:v,style:p,variant:d,textcase:h,lineposition:m,shadow:y,family:c,size:u})}),be.exit().remove(),be.each(function(Z){var me=vn.select(this).attr("transform",""),ge=Z.color;Array.isArray(ge)&&(ge=ge[Z.eventData[0].pointNumber]);var Pe=Z.bgcolor||ge,Ee=xr.combine(xr.opacity(Pe)?Pe:xr.defaultLine,o),Le=xr.combine(xr.opacity(ge)?ge:xr.defaultLine,o),Ae=Z.borderColor||xr.contrast(Ee),Oe=_g(Z,F,i,a,T,me),$e=Oe[0],ze=Oe[1],je=me.select("text.nums").call(qa.font,{family:Z.fontFamily||c,size:Z.fontSize||u,color:Z.fontColor||Ae,weight:Z.fontWeight||v,style:Z.fontStyle||p,variant:Z.fontVariant||d,textcase:Z.fontTextcase||h,lineposition:Z.fontLineposition||m,shadow:Z.fontShadow||y}).text($e).attr("data-notex",1).call(da.positionText,0,0).call(da.convertToTspans,r),at=me.select("text.name"),xe=0,We=0;if(ze&&ze!==$e){at.call(qa.font,{family:Z.fontFamily||c,size:Z.fontSize||u,color:Le,weight:Z.fontWeight||v,style:Z.fontStyle||p,variant:Z.fontVariant||d,textcase:Z.fontTextcase||h,lineposition:Z.fontLineposition||m,shadow:Z.fontShadow||y}).text(ze).attr("data-notex",1).call(da.positionText,0,0).call(da.convertToTspans,r);var Xe=Un(r,at.node());xe=Xe.width+2*St,We=Xe.height+2*St}else at.remove(),me.select("rect").remove();me.select("path").style({fill:Ee,stroke:Ae});var Re=Z.xa._offset+(Z.x0+Z.x1)/2,et=Z.ya._offset+(Z.y0+Z.y1)/2,Ue=Math.abs(Z.x1-Z.x0),I=Math.abs(Z.y1-Z.y0),U=Un(r,je.node()),V=U.width/a._invScaleX,Q=U.height/a._invScaleY;Z.ty0=(S-U.top)/a._invScaleY,Z.bx=V+2*St,Z.by=Math.max(Q+2*St,We),Z.anchor="start",Z.txwidth=V,Z.tx2width=xe,Z.offset=0;var se=(V+qt+St+xe)*a._invScaleX,re,Ce;if(n)Z.pos=Re,re=et+I/2+se<=E,Ce=et-I/2-se>=0,(Z.idealAlign==="top"||!re)&&Ce?(et-=I/2,Z.anchor="end"):re?(et+=I/2,Z.anchor="start"):Z.anchor="middle",Z.crossPos=et;else{if(Z.pos=et,re=Re+Ue/2+se<=L,Ce=Re-Ue/2-se>=0,(Z.idealAlign==="left"||!re)&&Ce)Re-=Ue/2,Z.anchor="end";else if(re)Re+=Ue/2,Z.anchor="start";else{Z.anchor="middle";var Se=se/2,he=Re+Se-L,ne=Re-Se;he>0&&(Re-=he),ne<0&&(Re+=-ne)}Z.crossPos=Re}je.attr("text-anchor",Z.anchor),xe&&at.attr("text-anchor",Z.anchor),me.attr("transform",dv(Re,et)+(n?R3(pT):""))}),{hoverLabels:be,commonLabelBoundingBox:k}}function _g(t,e,r,a,i,n){var o="",l="";t.nameOverride!==void 0&&(t.name=t.nameOverride),t.name&&(t.trace._meta&&(t.name=or.templateString(t.name,t.trace._meta)),o=kg(t.name,t.nameLength));var s=r.charAt(0),f=s==="x"?"y":"x";t.zLabel!==void 0?(t.xLabel!==void 0&&(l+="x: "+t.xLabel+"<br>"),t.yLabel!==void 0&&(l+="y: "+t.yLabel+"<br>"),t.trace.type!=="choropleth"&&t.trace.type!=="choroplethmapbox"&&t.trace.type!=="choroplethmap"&&(l+=(l?"z: ":"")+t.zLabel)):e&&t[s+"Label"]===i?l=t[f+"Label"]||"":t.xLabel===void 0?t.yLabel!==void 0&&t.trace.type!=="scattercarpet"&&(l=t.yLabel):t.yLabel===void 0?l=t.xLabel:l="("+t.xLabel+", "+t.yLabel+")",(t.text||t.text===0)&&!Array.isArray(t.text)&&(l+=(l?"<br>":"")+t.text),t.extraText!==void 0&&(l+=(l?"<br>":"")+t.extraText),n&&l===""&&!t.hovertemplate&&(o===""&&n.remove(),l=o);var c=t.hovertemplate||!1;if(c){var u=t.hovertemplateLabels||t;t[s+"Label"]!==i&&(u[s+"other"]=u[s+"Val"],u[s+"otherLabel"]=u[s+"Label"]),l=or.hovertemplateString(c,u,a._d3locale,t.eventData[0]||{},t.trace._meta),l=l.replace(W3,function(v,p){return o=kg(p,t.nameLength),""})}return[l,o]}function X3(t,e,r,a){var i=e?"xa":"ya",n=e?"ya":"xa",o=0,l=1,s=t.size(),f=new Array(s),c=0,u=a.minX,v=a.maxX,p=a.minY,d=a.maxY,h=function(H){return H*r._invScaleX},m=function(H){return H*r._invScaleY};t.each(function(H){var D=H[i],P=H[n],k=D._id.charAt(0)==="x",C=D.range;c===0&&C&&C[0]>C[1]!==k&&(l=-1);var $=0,R=k?r.width:r.height;if(r.hovermode==="x"||r.hovermode==="y"){var j=gT(H,e),G=H.anchor,Y=G==="end"?-1:1,O,K;if(G==="middle")O=H.crossPos+(k?m(j.y-H.by/2):h(H.bx/2+H.tx2width/2)),K=O+(k?m(H.by):h(H.bx));else if(k)O=H.crossPos+m(qt+j.y)-m(H.by/2-qt),K=O+m(H.by);else{var W=h(Y*qt+j.x),X=W+h(Y*H.bx);O=H.crossPos+Math.min(W,X),K=H.crossPos+Math.max(W,X)}k?p!==void 0&&d!==void 0&&Math.min(K,d)-Math.max(O,p)>1&&(P.side==="left"?($=P._mainLinePosition,R=r.width):R=P._mainLinePosition):u!==void 0&&v!==void 0&&Math.min(K,v)-Math.max(O,u)>1&&(P.side==="top"?($=P._mainLinePosition,R=r.height):R=P._mainLinePosition)}f[c++]=[{datum:H,traceIndex:H.trace.index,dp:0,pos:H.pos,posref:H.posref,size:H.by*(k?j3:1)/2,pmin:$,pmax:R}]}),f.sort(function(H,D){return H[0].posref-D[0].posref||l*(D[0].traceIndex-H[0].traceIndex)});var y,b,_,g,x,w,T;function A(H){var D=H[0],P=H[H.length-1];if(b=D.pmin-D.pos-D.dp+D.size,_=P.pos+P.dp+P.size-D.pmax,b>.01){for(x=H.length-1;x>=0;x--)H[x].dp+=b;y=!1}if(!(_<.01)){if(b<-.01){for(x=H.length-1;x>=0;x--)H[x].dp-=_;y=!1}if(y){var k=0;for(g=0;g<H.length;g++)w=H[g],w.pos+w.dp+w.size>D.pmax&&k++;for(g=H.length-1;g>=0&&!(k<=0);g--)w=H[g],w.pos>D.pmax-1&&(w.del=!0,k--);for(g=0;g<H.length&&!(k<=0);g++)if(w=H[g],w.pos<D.pmin+1)for(w.del=!0,k--,_=w.size*2,x=H.length-1;x>=0;x--)H[x].dp-=_;for(g=H.length-1;g>=0&&!(k<=0);g--)w=H[g],w.pos+w.dp+w.size>D.pmax&&(w.del=!0,k--)}}}for(;!y&&o<=s;){for(o++,y=!0,g=0;g<f.length-1;){var M=f[g],S=f[g+1],L=M[M.length-1],E=S[0];if(b=L.pos+L.dp+L.size-E.pos-E.dp+E.size,b>.01){for(x=S.length-1;x>=0;x--)S[x].dp+=b;for(M.push.apply(M,S),f.splice(g+1,1),T=0,x=M.length-1;x>=0;x--)T+=M[x].dp;for(_=T/M.length,x=M.length-1;x>=0;x--)M[x].dp-=_;y=!1}else g++}f.forEach(A)}for(g=f.length-1;g>=0;g--){var F=f[g];for(x=F.length-1;x>=0;x--){var N=F[x],z=N.datum;z.offset=N.dp,z.del=N.del}}}function gT(t,e){var r=0,a=t.offset;return e&&(a*=-G3,r=t.offset*B3),{x:r,y:a}}function Y3(t){var e={start:1,end:-1,middle:0}[t.anchor],r=e*(qt+St),a=r+e*(t.txwidth+St),i=t.anchor==="middle";return i&&(r-=t.tx2width/2,a+=t.txwidth/2+St),{alignShift:e,textShiftX:r,text2ShiftX:a}}function bT(t,e,r,a){var i=function(o){return o*r},n=function(o){return o*a};t.each(function(o){var l=vn.select(this);if(o.del)return l.remove();var s=l.select("text.nums"),f=o.anchor,c=f==="end"?-1:1,u=Y3(o),v=gT(o,e),p=v.x,d=v.y,h=f==="middle";l.select("path").attr("d",h?"M-"+i(o.bx/2+o.tx2width/2)+","+n(d-o.by/2)+"h"+i(o.bx)+"v"+n(o.by)+"h-"+i(o.bx)+"Z":"M0,0L"+i(c*qt+p)+","+n(qt+d)+"v"+n(o.by/2-qt)+"h"+i(c*o.bx)+"v-"+n(o.by)+"H"+i(c*qt+p)+"V"+n(d-qt)+"Z");var m=p+u.textShiftX,y=d+o.ty0-o.by/2+St,b=o.textAlign||"auto";b!=="auto"&&(b==="left"&&f!=="start"?(s.attr("text-anchor","start"),m=h?-o.bx/2-o.tx2width/2+St:-o.bx-St):b==="right"&&f!=="end"&&(s.attr("text-anchor","end"),m=h?o.bx/2-o.tx2width/2-St:o.bx+St)),s.call(da.positionText,i(m),n(y)),o.tx2width&&(l.select("text.name").call(da.positionText,i(u.text2ShiftX+u.alignShift*St+p),n(d+o.ty0-o.by/2+St)),l.select("rect").call(qa.setRect,i(u.text2ShiftX+(u.alignShift-1)*o.tx2width/2+p),n(d-o.by/2-1),i(o.tx2width),n(o.by+2)))})}function q3(t,e){var r=t.index,a=t.trace||{},i=t.cd[0],n=t.cd[r]||{};function o(v){return v||si(v)&&v===0}var l=Array.isArray(r)?function(v,p){var d=or.castOption(i,r,v);return o(d)?d:or.extractOption({},a,"",p)}:function(v,p){return or.extractOption(n,a,v,p)};function s(v,p,d){var h=l(p,d);o(h)&&(t[v]=h)}if(s("hoverinfo","hi","hoverinfo"),s("bgcolor","hbg","hoverlabel.bgcolor"),s("borderColor","hbc","hoverlabel.bordercolor"),s("fontFamily","htf","hoverlabel.font.family"),s("fontSize","hts","hoverlabel.font.size"),s("fontColor","htc","hoverlabel.font.color"),s("fontWeight","htw","hoverlabel.font.weight"),s("fontStyle","hty","hoverlabel.font.style"),s("fontVariant","htv","hoverlabel.font.variant"),s("nameLength","hnl","hoverlabel.namelength"),s("textAlign","hta","hoverlabel.align"),t.posref=e==="y"||e==="closest"&&a.orientation==="h"?t.xa._offset+(t.x0+t.x1)/2:t.ya._offset+(t.y0+t.y1)/2,t.x0=or.constrain(t.x0,0,t.xa._length),t.x1=or.constrain(t.x1,0,t.xa._length),t.y0=or.constrain(t.y0,0,t.ya._length),t.y1=or.constrain(t.y1,0,t.ya._length),t.xLabelVal!==void 0&&(t.xLabel="xLabel"in t?t.xLabel:Za.hoverLabelText(t.xa,t.xLabelVal,a.xhoverformat),t.xVal=t.xa.c2d(t.xLabelVal)),t.yLabelVal!==void 0&&(t.yLabel="yLabel"in t?t.yLabel:Za.hoverLabelText(t.ya,t.yLabelVal,a.yhoverformat),t.yVal=t.ya.c2d(t.yLabelVal)),t.zLabelVal!==void 0&&t.zLabel===void 0&&(t.zLabel=String(t.zLabelVal)),!isNaN(t.xerr)&&!(t.xa.type==="log"&&t.xerr<=0)){var f=Za.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;t.xerrneg!==void 0?t.xLabel+=" +"+f+" / -"+Za.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" ± "+f,e==="x"&&(t.distance+=1)}if(!isNaN(t.yerr)&&!(t.ya.type==="log"&&t.yerr<=0)){var c=Za.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;t.yerrneg!==void 0?t.yLabel+=" +"+c+" / -"+Za.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" ± "+c,e==="y"&&(t.distance+=1)}var u=t.hoverinfo||t.trace.hoverinfo;return u&&u!=="all"&&(u=Array.isArray(u)?u:u.split("+"),u.indexOf("x")===-1&&(t.xLabel=void 0),u.indexOf("y")===-1&&(t.yLabel=void 0),u.indexOf("z")===-1&&(t.zLabel=void 0),u.indexOf("text")===-1&&(t.text=void 0),u.indexOf("name")===-1&&(t.name=void 0)),t}function wg(t,e,r){var a=r.container,i=r.fullLayout,n=i._size,o=r.event,l=!!e.hLinePoint,s=!!e.vLinePoint,f,c;if(a.selectAll(".spikeline").remove(),!!(s||l)){var u=xr.combine(i.plot_bgcolor,i.paper_bgcolor);if(l){var v=e.hLinePoint,p,d;f=v&&v.xa,c=v&&v.ya;var h=c.spikesnap;h==="cursor"?(p=o.pointerX,d=o.pointerY):(p=f._offset+v.x,d=c._offset+v.y);var m=gg.readability(v.color,u)<1.5?xr.contrast(u):v.color,y=c.spikemode,b=c.spikethickness,_=c.spikecolor||m,g=Za.getPxPosition(t,c),x,w;if(y.indexOf("toaxis")!==-1||y.indexOf("across")!==-1){if(y.indexOf("toaxis")!==-1&&(x=g,w=p),y.indexOf("across")!==-1){var T=c._counterDomainMin,A=c._counterDomainMax;c.anchor==="free"&&(T=Math.min(T,c.position),A=Math.max(A,c.position)),x=n.l+T*n.w,w=n.l+A*n.w}a.insert("line",":first-child").attr({x1:x,x2:w,y1:d,y2:d,"stroke-width":b,stroke:_,"stroke-dasharray":qa.dashStyle(c.spikedash,b)}).classed("spikeline",!0).classed("crisp",!0),a.insert("line",":first-child").attr({x1:x,x2:w,y1:d,y2:d,"stroke-width":b+2,stroke:u}).classed("spikeline",!0).classed("crisp",!0)}y.indexOf("marker")!==-1&&a.insert("circle",":first-child").attr({cx:g+(c.side!=="right"?b:-b),cy:d,r:b,fill:_}).classed("spikeline",!0)}if(s){var M=e.vLinePoint,S,L;f=M&&M.xa,c=M&&M.ya;var E=f.spikesnap;E==="cursor"?(S=o.pointerX,L=o.pointerY):(S=f._offset+M.x,L=c._offset+M.y);var F=gg.readability(M.color,u)<1.5?xr.contrast(u):M.color,N=f.spikemode,z=f.spikethickness,H=f.spikecolor||F,D=Za.getPxPosition(t,f),P,k;if(N.indexOf("toaxis")!==-1||N.indexOf("across")!==-1){if(N.indexOf("toaxis")!==-1&&(P=D,k=L),N.indexOf("across")!==-1){var C=f._counterDomainMin,$=f._counterDomainMax;f.anchor==="free"&&(C=Math.min(C,f.position),$=Math.max($,f.position)),P=n.t+(1-$)*n.h,k=n.t+(1-C)*n.h}a.insert("line",":first-child").attr({x1:S,x2:S,y1:P,y2:k,"stroke-width":z,stroke:H,"stroke-dasharray":qa.dashStyle(f.spikedash,z)}).classed("spikeline",!0).classed("crisp",!0),a.insert("line",":first-child").attr({x1:S,x2:S,y1:P,y2:k,"stroke-width":z+2,stroke:u}).classed("spikeline",!0).classed("crisp",!0)}N.indexOf("marker")!==-1&&a.insert("circle",":first-child").attr({cx:S,cy:D-(f.side!=="top"?z:-z),r:z,fill:H}).classed("spikeline",!0)}}}function Z3(t,e,r){if(!r||r.length!==t._hoverdata.length)return!0;for(var a=r.length-1;a>=0;a--){var i=r[a],n=t._hoverdata[a];if(i.curveNumber!==n.curveNumber||String(i.pointNumber)!==String(n.pointNumber)||String(i.pointNumbers)!==String(n.pointNumbers))return!0}return!1}function Tg(t,e){return!0}function kg(t,e){return da.plainText(t||"",{len:e,allowedTags:["br","sub","sup","b","i","em","s","u"]})}function K3(t,e){for(var r=e.charAt(0),a=[],i=[],n=[],o=0;o<t.length;o++){var l=t[o];$o.traceIs(l.trace,"bar-like")||$o.traceIs(l.trace,"box-violin")?n.push(l):l.trace[r+"period"]?i.push(l):a.push(l)}return a.concat(i).concat(n)}function Ag(t,e,r){var a=e[t+"a"],i=e[t+"Val"],n=e.cd[0];if(a.type==="category"||a.type==="multicategory")i=a._categoriesMap[i];else if(a.type==="date"){var o=e.trace[t+"periodalignment"];if(o){var l=e.cd[e.index],s=l[t+"Start"];s===void 0&&(s=l[t]);var f=l[t+"End"];f===void 0&&(f=l[t]);var c=f-s;o==="end"?i+=c:o==="middle"&&(i+=c/2)}i=a.d2c(i)}return n&&n.t&&n.t.posLetter===a._id&&(r.boxmode==="group"||r.violinmode==="group")&&(i+=n.t.dPos),i}function xT(t){return t.offsetTop+t.clientTop}function _T(t){return t.offsetLeft+t.clientLeft}function Un(t,e){var r=t._fullLayout,a=e.getBoundingClientRect(),i=a.left,n=a.top,o=i+a.width,l=n+a.height,s=or.apply3DTransform(r._invTransform)(i,n),f=or.apply3DTransform(r._invTransform)(o,l),c=s[0],u=s[1],v=f[0],p=f[1];return{x:c,y:u,width:v-c,height:p-u,top:Math.min(u,p),left:Math.min(c,v),right:Math.max(c,v),bottom:Math.max(u,p)}}var Q3=we,J3=yt,eP=Ta.isUnifiedHover,xp=function(e,r,a,i){i=i||{};var n=r.legend;function o(l){i.font[l]||(i.font[l]=n?r.legend.font[l]:r.font[l])}r&&eP(r.hovermode)&&(i.font||(i.font={}),o("size"),o("family"),o("color"),o("weight"),o("style"),o("variant"),n?(i.bgcolor||(i.bgcolor=J3.combine(r.legend.bgcolor,r.paper_bgcolor)),i.bordercolor||(i.bordercolor=r.legend.bordercolor)):i.bgcolor||(i.bgcolor=r.paper_bgcolor)),a("hoverlabel.bgcolor",i.bgcolor),a("hoverlabel.bordercolor",i.bordercolor),a("hoverlabel.namelength",i.namelength),Q3.coerceFont(a,"hoverlabel.font",i.font),a("hoverlabel.align",i.align)},tP=we,rP=xp,aP=ds,iP=function(e,r){function a(i,n){return tP.coerce(e,r,aP,i,n)}rP(e,r,a)},Mg=we,nP=Nc,oP=xp,lP=function(e,r,a,i){function n(l,s){return Mg.coerce(e,r,nP,l,s)}var o=Mg.extendFlat({},i.hoverlabel);r.hovertemplate&&(o.namelength=-1),oP(e,r,n,o)},sP=we,fP=ds,wT=function(e,r){function a(i,n){return r[i]!==void 0?r[i]:sP.coerce(e,r,fP,i,n)}return a("clickmode"),a("hoversubplots"),a("hovermode")},Sg=we,cP=ds,uP=wT,vP=xp,dP=function(e,r){function a(c,u){return Sg.coerce(e,r,cP,c,u)}var i=uP(e,r);i&&(a("hoverdistance"),a("spikedistance"));var n=a("dragmode");n==="select"&&a("selectdirection");var o=r._has("mapbox"),l=r._has("map"),s=r._has("geo"),f=r._basePlotModules.length;r.dragmode==="zoom"&&((o||l||s)&&f===1||(o||l)&&s&&f===2)&&(r.dragmode="pan"),vP(e,r,a),Sg.coerceFont(a,"hoverlabel.grouptitlefont",r.hoverlabel.font)},ih=we,Lg=ot,hP=function(e){var r=e.calcdata,a=e._fullLayout;function i(f){return function(c){return ih.coerceHoverinfo({hoverinfo:c},{_module:f._module},a)}}for(var n=0;n<r.length;n++){var o=r[n],l=o[0].trace;if(!Lg.traceIs(l,"pie-like")){var s=Lg.traceIs(l,"2dMap")?pP:ih.fillArray;s(l.hoverinfo,o,"hi",i(l)),l.hovertemplate&&s(l.hovertemplate,o,"ht"),l.hoverlabel&&(s(l.hoverlabel.bgcolor,o,"hbg"),s(l.hoverlabel.bordercolor,o,"hbc"),s(l.hoverlabel.font.size,o,"hts"),s(l.hoverlabel.font.color,o,"htc"),s(l.hoverlabel.font.family,o,"htf"),s(l.hoverlabel.font.weight,o,"htw"),s(l.hoverlabel.font.style,o,"hty"),s(l.hoverlabel.font.variant,o,"htv"),s(l.hoverlabel.namelength,o,"hnl"),s(l.hoverlabel.align,o,"hta"))}}};function pP(t,e,r,a){a=a||ih.identity,Array.isArray(t)&&(e[0][r]=a(t))}var mP=ot,yP=iu.hover,gP=function(e,r,a){var i=mP.getComponentMethod("annotations","onClick")(e,e._hoverdata);a!==void 0&&yP(e,r,a,!0);function n(){e.emit("plotly_click",{points:e._hoverdata,event:r})}e._hoverdata&&r&&r.target&&(i&&i.then?i.then(n):n(),r.stopImmediatePropagation&&r.stopImmediatePropagation())},bP=bt,hc=we,xP=ai,fl=Ta,Cg=ds,Dg=iu,Na={moduleType:"component",name:"fx",constants:Fc,schema:{layout:Cg},attributes:Nc,layoutAttributes:Cg,supplyLayoutGlobalDefaults:iP,supplyDefaults:lP,supplyLayoutDefaults:dP,calc:hP,getDistanceFunction:fl.getDistanceFunction,getClosest:fl.getClosest,inbox:fl.inbox,quadrature:fl.quadrature,appendArrayPointValue:fl.appendArrayPointValue,castHoverOption:wP,castHoverinfo:TP,hover:Dg.hover,unhover:xP.unhover,loneHover:Dg.loneHover,loneUnhover:_P,click:gP};function _P(t){var e=hc.isD3Selection(t)?t:bP.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()}function wP(t,e,r){return hc.castOption(t,e,"hoverlabel."+r)}function TP(t,e,r){function a(i){return hc.coerceHoverinfo({hoverinfo:i},{_module:t._module},e)}return hc.castOption(t,r,"hoverinfo",a)}var Fn={};(function(t){t.selectMode=function(e){return e==="lasso"||e==="select"},t.drawMode=function(e){return e==="drawclosedpath"||e==="drawopenpath"||e==="drawline"||e==="drawrect"||e==="drawcircle"},t.openMode=function(e){return e==="drawline"||e==="drawopenpath"},t.rectMode=function(e){return e==="select"||e==="drawline"||e==="drawrect"||e==="drawcircle"},t.freeMode=function(e){return e==="lasso"||e==="drawclosedpath"||e==="drawopenpath"},t.selectingOrDrawing=function(e){return t.freeMode(e)||t.rectMode(e)}})(Fn);var _p=function(e){var r=e._fullLayout;r._glcanvas&&r._glcanvas.size()&&r._glcanvas.each(function(a){a.regl&&a.regl.clear({color:!0,depth:!0})})},ou={},TT={exports:{}},wp={undo:{width:857.1,height:1e3,path:"m857 350q0-87-34-166t-91-137-137-92-166-34q-96 0-183 41t-147 114q-4 6-4 13t5 11l76 77q6 5 14 5 9-1 13-7 41-53 100-82t126-29q58 0 110 23t92 61 61 91 22 111-22 111-61 91-92 61-110 23q-55 0-105-20t-90-57l77-77q17-16 8-38-10-23-33-23h-250q-15 0-25 11t-11 25v250q0 24 22 33 22 10 39-8l72-72q60 57 137 88t159 31q87 0 166-34t137-92 91-137 34-166z",transform:"matrix(1 0 0 -1 0 850)"},home:{width:928.6,height:1e3,path:"m786 296v-267q0-15-11-26t-25-10h-214v214h-143v-214h-214q-15 0-25 10t-11 26v267q0 1 0 2t0 2l321 264 321-264q1-1 1-4z m124 39l-34-41q-5-5-12-6h-2q-7 0-12 3l-386 322-386-322q-7-4-13-4-7 2-12 7l-35 41q-4 5-3 13t6 12l401 334q18 15 42 15t43-15l136-114v109q0 8 5 13t13 5h107q8 0 13-5t5-13v-227l122-102q5-5 6-12t-4-13z",transform:"matrix(1 0 0 -1 0 850)"},"camera-retro":{width:1e3,height:1e3,path:"m518 386q0 8-5 13t-13 5q-37 0-63-27t-26-63q0-8 5-13t13-5 12 5 5 13q0 23 16 38t38 16q8 0 13 5t5 13z m125-73q0-59-42-101t-101-42-101 42-42 101 42 101 101 42 101-42 42-101z m-572-320h858v71h-858v-71z m643 320q0 89-62 152t-152 62-151-62-63-152 63-151 151-63 152 63 62 151z m-571 358h214v72h-214v-72z m-72-107h858v143h-462l-36-71h-360v-72z m929 143v-714q0-30-21-51t-50-21h-858q-29 0-50 21t-21 51v714q0 30 21 51t50 21h858q29 0 50-21t21-51z",transform:"matrix(1 0 0 -1 0 850)"},zoombox:{width:1e3,height:1e3,path:"m1000-25l-250 251c40 63 63 138 63 218 0 224-182 406-407 406-224 0-406-182-406-406s183-406 407-406c80 0 155 22 218 62l250-250 125 125z m-812 250l0 438 437 0 0-438-437 0z m62 375l313 0 0-312-313 0 0 312z",transform:"matrix(1 0 0 -1 0 850)"},pan:{width:1e3,height:1e3,path:"m1000 350l-187 188 0-125-250 0 0 250 125 0-188 187-187-187 125 0 0-250-250 0 0 125-188-188 186-187 0 125 252 0 0-250-125 0 187-188 188 188-125 0 0 250 250 0 0-126 187 188z",transform:"matrix(1 0 0 -1 0 850)"},zoom_plus:{width:875,height:1e3,path:"m1 787l0-875 875 0 0 875-875 0z m687-500l-187 0 0-187-125 0 0 187-188 0 0 125 188 0 0 187 125 0 0-187 187 0 0-125z",transform:"matrix(1 0 0 -1 0 850)"},zoom_minus:{width:875,height:1e3,path:"m0 788l0-876 875 0 0 876-875 0z m688-500l-500 0 0 125 500 0 0-125z",transform:"matrix(1 0 0 -1 0 850)"},autoscale:{width:1e3,height:1e3,path:"m250 850l-187 0-63 0 0-62 0-188 63 0 0 188 187 0 0 62z m688 0l-188 0 0-62 188 0 0-188 62 0 0 188 0 62-62 0z m-875-938l0 188-63 0 0-188 0-62 63 0 187 0 0 62-187 0z m875 188l0-188-188 0 0-62 188 0 62 0 0 62 0 188-62 0z m-125 188l-1 0-93-94-156 156 156 156 92-93 2 0 0 250-250 0 0-2 93-92-156-156-156 156 94 92 0 2-250 0 0-250 0 0 93 93 157-156-157-156-93 94 0 0 0-250 250 0 0 0-94 93 156 157 156-157-93-93 0 0 250 0 0 250z",transform:"matrix(1 0 0 -1 0 850)"},tooltip_basic:{width:1500,height:1e3,path:"m375 725l0 0-375-375 375-374 0-1 1125 0 0 750-1125 0z",transform:"matrix(1 0 0 -1 0 850)"},tooltip_compare:{width:1125,height:1e3,path:"m187 786l0 2-187-188 188-187 0 0 937 0 0 373-938 0z m0-499l0 1-187-188 188-188 0 0 937 0 0 376-938-1z",transform:"matrix(1 0 0 -1 0 850)"},plotlylogo:{width:1542,height:1e3,path:"m0-10h182v-140h-182v140z m228 146h183v-286h-183v286z m225 714h182v-1000h-182v1000z m225-285h182v-715h-182v715z m225 142h183v-857h-183v857z m231-428h182v-429h-182v429z m225-291h183v-138h-183v138z",transform:"matrix(1 0 0 -1 0 850)"},"z-axis":{width:1e3,height:1e3,path:"m833 5l-17 108v41l-130-65 130-66c0 0 0 38 0 39 0-1 36-14 39-25 4-15-6-22-16-30-15-12-39-16-56-20-90-22-187-23-279-23-261 0-341 34-353 59 3 60 228 110 228 110-140-8-351-35-351-116 0-120 293-142 474-142 155 0 477 22 477 142 0 50-74 79-163 96z m-374 94c-58-5-99-21-99-40 0-24 65-43 144-43 79 0 143 19 143 43 0 19-42 34-98 40v216h87l-132 135-133-135h88v-216z m167 515h-136v1c16 16 31 34 46 52l84 109v54h-230v-71h124v-1c-16-17-28-32-44-51l-89-114v-51h245v72z",transform:"matrix(1 0 0 -1 0 850)"},"3d_rotate":{width:1e3,height:1e3,path:"m922 660c-5 4-9 7-14 11-359 263-580-31-580-31l-102 28 58-400c0 1 1 1 2 2 118 108 351 249 351 249s-62 27-100 42c88 83 222 183 347 122 16-8 30-17 44-27-2 1-4 2-6 4z m36-329c0 0 64 229-88 296-62 27-124 14-175-11 157-78 225-208 249-266 8-19 11-31 11-31 2 5 6 15 11 32-5-13-8-20-8-20z m-775-239c70-31 117-50 198-32-121 80-199 346-199 346l-96-15-58-12c0 0 55-226 155-287z m603 133l-317-139c0 0 4-4 19-14 7-5 24-15 24-15s-177-147-389 4c235-287 536-112 536-112l31-22 100 299-4-1z m-298-153c6-4 14-9 24-15 0 0-17 10-24 15z",transform:"matrix(1 0 0 -1 0 850)"},camera:{width:1e3,height:1e3,path:"m500 450c-83 0-150-67-150-150 0-83 67-150 150-150 83 0 150 67 150 150 0 83-67 150-150 150z m400 150h-120c-16 0-34 13-39 29l-31 93c-6 15-23 28-40 28h-340c-16 0-34-13-39-28l-31-94c-6-15-23-28-40-28h-120c-55 0-100-45-100-100v-450c0-55 45-100 100-100h800c55 0 100 45 100 100v450c0 55-45 100-100 100z m-400-550c-138 0-250 112-250 250 0 138 112 250 250 250 138 0 250-112 250-250 0-138-112-250-250-250z m365 380c-19 0-35 16-35 35 0 19 16 35 35 35 19 0 35-16 35-35 0-19-16-35-35-35z",transform:"matrix(1 0 0 -1 0 850)"},movie:{width:1e3,height:1e3,path:"m938 413l-188-125c0 37-17 71-44 94 64 38 107 107 107 187 0 121-98 219-219 219-121 0-219-98-219-219 0-61 25-117 66-156h-115c30 33 49 76 49 125 0 103-84 187-187 187s-188-84-188-187c0-57 26-107 65-141-38-22-65-62-65-109v-250c0-70 56-126 125-126h500c69 0 125 56 125 126l188-126c34 0 62 28 62 63v375c0 35-28 63-62 63z m-750 0c-69 0-125 56-125 125s56 125 125 125 125-56 125-125-56-125-125-125z m406-1c-87 0-157 70-157 157 0 86 70 156 157 156s156-70 156-156-70-157-156-157z",transform:"matrix(1 0 0 -1 0 850)"},question:{width:857.1,height:1e3,path:"m500 82v107q0 8-5 13t-13 5h-107q-8 0-13-5t-5-13v-107q0-8 5-13t13-5h107q8 0 13 5t5 13z m143 375q0 49-31 91t-77 65-95 23q-136 0-207-119-9-14 4-24l74-55q4-4 10-4 9 0 14 7 30 38 48 51 19 14 48 14 27 0 48-15t21-33q0-21-11-34t-38-25q-35-16-65-48t-29-70v-20q0-8 5-13t13-5h107q8 0 13 5t5 13q0 10 12 27t30 28q18 10 28 16t25 19 25 27 16 34 7 45z m214-107q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z",transform:"matrix(1 0 0 -1 0 850)"},disk:{width:857.1,height:1e3,path:"m214-7h429v214h-429v-214z m500 0h72v500q0 8-6 21t-11 20l-157 156q-5 6-19 12t-22 5v-232q0-22-15-38t-38-16h-322q-22 0-37 16t-16 38v232h-72v-714h72v232q0 22 16 38t37 16h465q22 0 38-16t15-38v-232z m-214 518v178q0 8-5 13t-13 5h-107q-7 0-13-5t-5-13v-178q0-8 5-13t13-5h107q7 0 13 5t5 13z m357-18v-518q0-22-15-38t-38-16h-750q-23 0-38 16t-16 38v750q0 22 16 38t38 16h517q23 0 50-12t42-26l156-157q16-15 27-42t11-49z",transform:"matrix(1 0 0 -1 0 850)"},drawopenpath:{width:70,height:70,path:"M33.21,85.65a7.31,7.31,0,0,1-2.59-.48c-8.16-3.11-9.27-19.8-9.88-41.3-.1-3.58-.19-6.68-.35-9-.15-2.1-.67-3.48-1.43-3.79-2.13-.88-7.91,2.32-12,5.86L3,32.38c1.87-1.64,11.55-9.66,18.27-6.9,2.13.87,4.75,3.14,5.17,9,.17,2.43.26,5.59.36,9.25a224.17,224.17,0,0,0,1.5,23.4c1.54,10.76,4,12.22,4.48,12.4.84.32,2.79-.46,5.76-3.59L43,80.07C41.53,81.57,37.68,85.64,33.21,85.65ZM74.81,69a11.34,11.34,0,0,0,6.09-6.72L87.26,44.5,74.72,32,56.9,38.35c-2.37.86-5.57,3.42-6.61,6L38.65,72.14l8.42,8.43ZM55,46.27a7.91,7.91,0,0,1,3.64-3.17l14.8-5.3,8,8L76.11,60.6l-.06.19a6.37,6.37,0,0,1-3,3.43L48.25,74.59,44.62,71Zm16.57,7.82A6.9,6.9,0,1,0,64.64,61,6.91,6.91,0,0,0,71.54,54.09Zm-4.05,0a2.85,2.85,0,1,1-2.85-2.85A2.86,2.86,0,0,1,67.49,54.09Zm-4.13,5.22L60.5,56.45,44.26,72.7l2.86,2.86ZM97.83,35.67,84.14,22l-8.57,8.57L89.26,44.24Zm-13.69-8,8,8-2.85,2.85-8-8Z",transform:"matrix(1 0 0 1 -15 -15)"},drawclosedpath:{width:90,height:90,path:"M88.41,21.12a26.56,26.56,0,0,0-36.18,0l-2.07,2-2.07-2a26.57,26.57,0,0,0-36.18,0,23.74,23.74,0,0,0,0,34.8L48,90.12a3.22,3.22,0,0,0,4.42,0l36-34.21a23.73,23.73,0,0,0,0-34.79ZM84,51.24,50.16,83.35,16.35,51.25a17.28,17.28,0,0,1,0-25.47,20,20,0,0,1,27.3,0l4.29,4.07a3.23,3.23,0,0,0,4.44,0l4.29-4.07a20,20,0,0,1,27.3,0,17.27,17.27,0,0,1,0,25.46ZM66.76,47.68h-33v6.91h33ZM53.35,35H46.44V68h6.91Z",transform:"matrix(1 0 0 1 -5 -5)"},lasso:{width:1031,height:1e3,path:"m1018 538c-36 207-290 336-568 286-277-48-473-256-436-463 10-57 36-108 76-151-13-66 11-137 68-183 34-28 75-41 114-42l-55-70 0 0c-2-1-3-2-4-3-10-14-8-34 5-45 14-11 34-8 45 4 1 1 2 3 2 5l0 0 113 140c16 11 31 24 45 40 4 3 6 7 8 11 48-3 100 0 151 9 278 48 473 255 436 462z m-624-379c-80 14-149 48-197 96 42 42 109 47 156 9 33-26 47-66 41-105z m-187-74c-19 16-33 37-39 60 50-32 109-55 174-68-42-25-95-24-135 8z m360 75c-34-7-69-9-102-8 8 62-16 128-68 170-73 59-175 54-244-5-9 20-16 40-20 61-28 159 121 317 333 354s407-60 434-217c28-159-121-318-333-355z",transform:"matrix(1 0 0 -1 0 850)"},selectbox:{width:1e3,height:1e3,path:"m0 850l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-285l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z",transform:"matrix(1 0 0 -1 0 850)"},drawline:{width:70,height:70,path:"M60.64,62.3a11.29,11.29,0,0,0,6.09-6.72l6.35-17.72L60.54,25.31l-17.82,6.4c-2.36.86-5.57,3.41-6.6,6L24.48,65.5l8.42,8.42ZM40.79,39.63a7.89,7.89,0,0,1,3.65-3.17l14.79-5.31,8,8L61.94,54l-.06.19a6.44,6.44,0,0,1-3,3.43L34.07,68l-3.62-3.63Zm16.57,7.81a6.9,6.9,0,1,0-6.89,6.9A6.9,6.9,0,0,0,57.36,47.44Zm-4,0a2.86,2.86,0,1,1-2.85-2.85A2.86,2.86,0,0,1,53.32,47.44Zm-4.13,5.22L46.33,49.8,30.08,66.05l2.86,2.86ZM83.65,29,70,15.34,61.4,23.9,75.09,37.59ZM70,21.06l8,8-2.84,2.85-8-8ZM87,80.49H10.67V87H87Z",transform:"matrix(1 0 0 1 -15 -15)"},drawrect:{width:80,height:80,path:"M78,22V79H21V22H78m9-9H12V88H87V13ZM68,46.22H31V54H68ZM53,32H45.22V69H53Z",transform:"matrix(1 0 0 1 -10 -10)"},drawcircle:{width:80,height:80,path:"M50,84.72C26.84,84.72,8,69.28,8,50.3S26.84,15.87,50,15.87,92,31.31,92,50.3,73.16,84.72,50,84.72Zm0-60.59c-18.6,0-33.74,11.74-33.74,26.17S31.4,76.46,50,76.46,83.74,64.72,83.74,50.3,68.6,24.13,50,24.13Zm17.15,22h-34v7.11h34Zm-13.8-13H46.24v34h7.11Z",transform:"matrix(1 0 0 1 -10 -10)"},eraseshape:{width:80,height:80,path:"M82.77,78H31.85L6,49.57,31.85,21.14H82.77a8.72,8.72,0,0,1,8.65,8.77V69.24A8.72,8.72,0,0,1,82.77,78ZM35.46,69.84H82.77a.57.57,0,0,0,.49-.6V29.91a.57.57,0,0,0-.49-.61H35.46L17,49.57Zm32.68-34.7-24,24,5,5,24-24Zm-19,.53-5,5,24,24,5-5Z",transform:"matrix(1 0 0 1 -10 -10)"},spikeline:{width:1e3,height:1e3,path:"M512 409c0-57-46-104-103-104-57 0-104 47-104 104 0 57 47 103 104 103 57 0 103-46 103-103z m-327-39l92 0 0 92-92 0z m-185 0l92 0 0 92-92 0z m370-186l92 0 0 93-92 0z m0-184l92 0 0 92-92 0z",transform:"matrix(1.5 0 0 -1.5 0 850)"},pencil:{width:1792,height:1792,path:"M491 1536l91-91-235-235-91 91v107h128v128h107zm523-928q0-22-22-22-10 0-17 7l-542 542q-7 7-7 17 0 22 22 22 10 0 17-7l542-542q7-7 7-17zm-54-192l416 416-832 832h-416v-416zm683 96q0 53-37 90l-166 166-416-416 166-165q36-38 90-38 53 0 91 38l235 234q37 39 37 91z",transform:"matrix(1 0 0 1 0 1)"},newplotlylogo:{name:"newplotlylogo",svg:["<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 132 132'>"," <title>plotly-logomark</title>"," <g id='symbol'>"," <rect fill='#000' x='0' y='0' width='132' height='132' rx='18' ry='18'/>"," <circle fill='#9EF' cx='102' cy='30' r='6'/>"," <circle fill='#BAC' cx='78' cy='30' r='6'/>"," <circle fill='#BAC' cx='78' cy='54' r='6'/>"," <circle fill='#D69' cx='54' cy='30' r='6'/>"," <circle fill='#F26' cx='30' cy='30' r='6'/>"," <circle fill='#F26' cx='30' cy='54' r='6'/>"," <path fill='#FFF' d='M30,72a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V78A6,6,0,0,0,30,72Z'/>"," <path fill='#FFF' d='M78,72a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V78A6,6,0,0,0,78,72Z'/>"," <path fill='#FFF' d='M54,48a6,6,0,0,0-6,6v48a6,6,0,0,0,12,0V54A6,6,0,0,0,54,48Z'/>"," <path fill='#FFF' d='M102,48a6,6,0,0,0-6,6v48a6,6,0,0,0,12,0V54A6,6,0,0,0,102,48Z'/>"," </g>","</svg>"].join("")}},Gi={},Ks=32,Tp={CIRCLE_SIDES:Ks,i000:0,i090:Ks/4,i180:Ks/2,i270:Ks/4*3,cos45:Math.cos(Math.PI/4),sin45:Math.sin(Math.PI/4),SQRT2:Math.sqrt(2)},kP=we.strTranslate;function kT(t,e){switch(t.type){case"log":return t.p2d(e);case"date":return t.p2r(e,0,t.calendar);default:return t.p2r(e)}}function AP(t,e){switch(t.type){case"log":return t.d2p(e);case"date":return t.r2p(e,0,t.calendar);default:return t.r2p(e)}}function MP(t){var e=t._id.charAt(0)==="y"?1:0;return function(r){return kT(t,r[e])}}function SP(t){return kP(t.xaxis._offset,t.yaxis._offset)}var kp={p2r:kT,r2p:AP,axValue:MP,getTransform:SP};(function(t){var e=X1,r=Tp,a=r.CIRCLE_SIDES,i=r.SQRT2,n=kp,o=n.p2r,l=n.r2p,s=[0,3,4,5,6,1,2],f=[0,3,4,1,2];t.writePaths=function(v){var p=v.length;if(!p)return"M0,0Z";for(var d="",h=0;h<p;h++)for(var m=v[h].length,y=0;y<m;y++){var b=v[h][y][0];if(b==="Z")d+="Z";else for(var _=v[h][y].length,g=0;g<_;g++){var x=g;b==="Q"||b==="S"?x=f[g]:b==="C"&&(x=s[g]),d+=v[h][y][x],g>0&&g<_-1&&(d+=",")}}return d},t.readPaths=function(v,p,d,h){var m=e(v),y=[],b=-1,_=function(){b++,y[b]=[]},g,x=0,w=0,T,A,M=function(){T=x,A=w};M();for(var S=0;S<m.length;S++){var L=[],E,F,N,z,H=m[S][0],D=H;switch(H){case"M":_(),x=+m[S][1],w=+m[S][2],L.push([D,x,w]),M();break;case"Q":case"S":E=+m[S][1],N=+m[S][2],x=+m[S][3],w=+m[S][4],L.push([D,x,w,E,N]);break;case"C":E=+m[S][1],N=+m[S][2],F=+m[S][3],z=+m[S][4],x=+m[S][5],w=+m[S][6],L.push([D,x,w,E,N,F,z]);break;case"T":case"L":x=+m[S][1],w=+m[S][2],L.push([D,x,w]);break;case"H":D="L",x=+m[S][1],L.push([D,x,w]);break;case"V":D="L",w=+m[S][1],L.push([D,x,w]);break;case"A":D="L";var P=+m[S][1],k=+m[S][2];+m[S][4]||(P=-P,k=-k);var C=x-P,$=w;for(g=1;g<=a/2;g++){var R=2*Math.PI*g/a;L.push([D,C+P*Math.cos(R),$+k*Math.sin(R)])}break;case"Z":(x!==T||w!==A)&&(x=T,w=A,L.push([D,x,w]));break}for(var j=(d||{}).domain,G=p._fullLayout._size,Y=d&&d.xsizemode==="pixel",O=d&&d.ysizemode==="pixel",K=h===!1,W=0;W<L.length;W++){for(g=0;g+2<7;g+=2){var X=L[W][g+1],B=L[W][g+2];X===void 0||B===void 0||(x=X,w=B,d&&(d.xaxis&&d.xaxis.p2r?(K&&(X-=d.xaxis._offset),Y?X=l(d.xaxis,d.xanchor)+X:X=o(d.xaxis,X)):(K&&(X-=G.l),j?X=j.x[0]+X/G.w:X=X/G.w),d.yaxis&&d.yaxis.p2r?(K&&(B-=d.yaxis._offset),O?B=l(d.yaxis,d.yanchor)-B:B=o(d.yaxis,B)):(K&&(B-=G.t),j?B=j.y[1]-B/G.h:B=1-B/G.h)),L[W][g+1]=X,L[W][g+2]=B)}y[b].push(L[W].slice())}}return y};function c(v,p){return Math.abs(v-p)<=1e-6}function u(v,p){var d=p[1]-v[1],h=p[2]-v[2];return Math.sqrt(d*d+h*h)}t.pointsOnRectangle=function(v){var p=v.length;if(p!==5)return!1;for(var d=1;d<3;d++){var h=v[0][d]-v[1][d],m=v[3][d]-v[2][d];if(!c(h,m))return!1;var y=v[0][d]-v[3][d],b=v[1][d]-v[2][d];if(!c(y,b))return!1}return!c(v[0][1],v[1][1])&&!c(v[0][1],v[3][1])?!1:!!(u(v[0],v[1])*u(v[0],v[3]))},t.pointsOnEllipse=function(v){var p=v.length;if(p!==a+1)return!1;p=a;for(var d=0;d<p;d++){var h=(p*2-d)%p,m=(p/2+h)%p,y=(p/2+d)%p;if(!c(u(v[d],v[y]),u(v[h],v[m])))return!1}return!0},t.handleEllipse=function(v,p,d){if(!v)return[p,d];var h=t.ellipseOver({x0:p[0],y0:p[1],x1:d[0],y1:d[1]}),m=(h.x1+h.x0)/2,y=(h.y1+h.y0)/2,b=(h.x1-h.x0)/2,_=(h.y1-h.y0)/2;b||(b=_=_/i),_||(_=b=b/i);for(var g=[],x=0;x<a;x++){var w=x*2*Math.PI/a;g.push([m+b*Math.cos(w),y+_*Math.sin(w)])}return g},t.ellipseOver=function(v){var p=v.x0,d=v.y0,h=v.x1,m=v.y1,y=h-p,b=m-d;p-=y,d-=b;var _=(p+h)/2,g=(d+m)/2,x=i;return y*=x,b*=x,{x0:_-y,y0:g-b,x1:_+y,y1:g+b}},t.fixDatesForPaths=function(v,p,d){var h=p.type==="date",m=d.type==="date";if(!h&&!m)return v;for(var y=0;y<v.length;y++)for(var b=0;b<v[y].length;b++)for(var _=0;_+2<v[y][b].length;_+=2)h&&(v[y][b][_+1]=v[y][b][_+1].replace(" ","_")),m&&(v[y][b][_+2]=v[y][b][_+2].replace(" ","_"));return v}})(Gi);var AT=Fn,LP=AT.drawMode,CP=AT.openMode,Ko=Tp,Pg=Ko.i000,$g=Ko.i090,Eg=Ko.i180,zg=Ko.i270,DP=Ko.cos45,PP=Ko.sin45,MT=kp,Qs=MT.p2r,wi=MT.r2p,$P=zn,EP=$P.clearOutline,lu=Gi,zP=lu.readPaths,RP=lu.writePaths,IP=lu.ellipseOver,FP=lu.fixDatesForPaths;function NP(t,e){if(t.length){var r=t[0][0];if(r){var a=e.gd,i=e.isActiveShape,n=e.dragmode,o=(a.layout||{}).shapes||[];if(!LP(n)&&i!==void 0){var l=a._fullLayout._activeShapeIndex;if(l<o.length)switch(a._fullLayout.shapes[l].type){case"rect":n="drawrect";break;case"circle":n="drawcircle";break;case"line":n="drawline";break;case"path":var s=o[l].path||"";s[s.length-1]==="Z"?n="drawclosedpath":n="drawopenpath";break}}var f=ST(t,e,n);EP(a);for(var c=e.editHelpers,u=(c||{}).modifyItem,v=[],p=0;p<o.length;p++){var d=a._fullLayout.shapes[p];if(v[p]=d._input,i!==void 0&&p===a._fullLayout._activeShapeIndex){var h=f;switch(d.type){case"line":case"rect":case"circle":u("x0",h.x0-(d.x0shift||0)),u("x1",h.x1-(d.x1shift||0)),u("y0",h.y0-(d.y0shift||0)),u("y1",h.y1-(d.y1shift||0));break;case"path":u("path",h.path);break}}}return i===void 0?(v.push(f),v):c?c.getUpdateObj():{}}}}function ST(t,e,r){var a=t[0][0],i=e.gd,n=a.getAttribute("d"),o=i._fullLayout.newshape,l=e.plotinfo,s=e.isActiveShape,f=l.xaxis,c=l.yaxis,u=!!l.domain||!l.xaxis,v=!!l.domain||!l.yaxis,p=CP(r),d=zP(n,i,l,s),h={editable:!0,visible:o.visible,name:o.name,showlegend:o.showlegend,legend:o.legend,legendwidth:o.legendwidth,legendgroup:o.legendgroup,legendgrouptitle:{text:o.legendgrouptitle.text,font:o.legendgrouptitle.font},legendrank:o.legendrank,label:o.label,xref:u?"paper":f._id,yref:v?"paper":c._id,layer:o.layer,opacity:o.opacity,line:{color:o.line.color,width:o.line.width,dash:o.line.dash}};p||(h.fillcolor=o.fillcolor,h.fillrule=o.fillrule);var m;if(d.length===1&&(m=d[0]),m&&m.length===5&&r==="drawrect")h.type="rect",h.x0=m[0][1],h.y0=m[0][2],h.x1=m[2][1],h.y1=m[2][2];else if(m&&r==="drawline")h.type="line",h.x0=m[0][1],h.y0=m[0][2],h.x1=m[1][1],h.y1=m[1][2];else if(m&&r==="drawcircle"){h.type="circle";var y=m[Pg][1],b=m[$g][1],_=m[Eg][1],g=m[zg][1],x=m[Pg][2],w=m[$g][2],T=m[Eg][2],A=m[zg][2],M=l.xaxis&&(l.xaxis.type==="date"||l.xaxis.type==="log"),S=l.yaxis&&(l.yaxis.type==="date"||l.yaxis.type==="log");M&&(y=wi(l.xaxis,y),b=wi(l.xaxis,b),_=wi(l.xaxis,_),g=wi(l.xaxis,g)),S&&(x=wi(l.yaxis,x),w=wi(l.yaxis,w),T=wi(l.yaxis,T),A=wi(l.yaxis,A));var L=(b+g)/2,E=(x+T)/2,F=(g-b+_-y)/2,N=(A-w+T-x)/2,z=IP({x0:L,y0:E,x1:L+F*DP,y1:E+N*PP});M&&(z.x0=Qs(l.xaxis,z.x0),z.x1=Qs(l.xaxis,z.x1)),S&&(z.y0=Qs(l.yaxis,z.y0),z.y1=Qs(l.yaxis,z.y1)),h.x0=z.x0,h.y0=z.y0,h.x1=z.x1,h.y1=z.y1}else h.type="path",f&&c&&FP(d,f,c),h.path=RP(d),m=null;return h}var Ap={newShapes:NP,createShapeObj:ST},HP=Fn,OP=HP.selectMode,jP=zn,BP=jP.clearOutline,Mp=Gi,GP=Mp.readPaths,UP=Mp.writePaths,VP=Mp.fixDatesForPaths,LT=function(e,r){if(e.length){var a=e[0][0];if(a){var i=a.getAttribute("d"),n=r.gd,o=n._fullLayout.newselection,l=r.plotinfo,s=l.xaxis,f=l.yaxis,c=r.isActiveSelection,u=r.dragmode,v=(n.layout||{}).selections||[];if(!OP(u)&&c!==void 0){var p=n._fullLayout._activeSelectionIndex;if(p<v.length)switch(n._fullLayout.selections[p].type){case"rect":u="select";break;case"path":u="lasso";break}}var d=GP(i,n,l,c),h={xref:s._id,yref:f._id,opacity:o.opacity,line:{color:o.line.color,width:o.line.width,dash:o.line.dash}},m;d.length===1&&(m=d[0]),m&&m.length===5&&u==="select"?(h.type="rect",h.x0=m[0][1],h.y0=m[0][2],h.x1=m[2][1],h.y1=m[2][2]):(h.type="path",s&&f&&VP(d,s,f),h.path=UP(d),m=null),BP(n);for(var y=r.editHelpers,b=(y||{}).modifyItem,_=[],g=0;g<v.length;g++){var x=n._fullLayout.selections[g];if(!x){_[g]=x;continue}if(_[g]=x._input,c!==void 0&&g===n._fullLayout._activeSelectionIndex){var w=h;switch(x.type){case"rect":b("x0",w.x0),b("x1",w.x1),b("y0",w.y0),b("y1",w.y1);break;case"path":b("path",w.path);break}}}return c===void 0?(_.push(h),_):y?y.getUpdateObj():{}}}},Ui={},su={segmentRE:/[MLHVQCTSZ][^MLHVQCTSZ]*/g,paramRE:/[^\s,]+/g,paramIsX:{M:{0:!0,drawn:0},L:{0:!0,drawn:0},H:{0:!0,drawn:0},V:{},Q:{0:!0,2:!0,drawn:2},C:{0:!0,2:!0,4:!0,drawn:4},T:{0:!0,drawn:0},S:{0:!0,2:!0,drawn:2},Z:{}},paramIsY:{M:{1:!0,drawn:1},L:{1:!0,drawn:1},H:{},V:{0:!0,drawn:0},Q:{1:!0,3:!0,drawn:3},C:{1:!0,3:!0,5:!0,drawn:5},T:{1:!0,drawn:1},S:{1:!0,3:!0,drawn:5},Z:{}},numParams:{M:2,L:2,H:1,V:1,Q:4,C:6,T:2,S:4,Z:0}};(function(t){var e=su,r=we,a=Ot;t.rangeToShapePosition=function(o){return o.type==="log"?o.r2d:function(l){return l}},t.shapePositionToRange=function(o){return o.type==="log"?o.d2r:function(l){return l}},t.decodeDate=function(o){return function(l){return l.replace&&(l=l.replace("_"," ")),o(l)}},t.encodeDate=function(o){return function(l){return o(l).replace(" ","_")}},t.extractPathCoords=function(o,l,s){var f=[],c=o.match(e.segmentRE);return c.forEach(function(u){var v=l[u.charAt(0)].drawn;if(v!==void 0){var p=u.substr(1).match(e.paramRE);if(!(!p||p.length<v)){var d=p[v],h=s?d:r.cleanNumber(d);f.push(h)}}}),f},t.getDataToPixel=function(o,l,s,f,c){var u=o._fullLayout._size,v;if(l)if(c==="domain")v=function(d){return l._length*(f?1-d:d)+l._offset};else{var p=t.shapePositionToRange(l);v=function(d){var h=n(l,s);return l._offset+l.r2p(p(d,!0))+h},l.type==="date"&&(v=t.decodeDate(v))}else f?v=function(d){return u.t+u.h*(1-d)}:v=function(d){return u.l+u.w*d};return v},t.getPixelToData=function(o,l,s,f){var c=o._fullLayout._size,u;if(l)if(f==="domain")u=function(p){var d=(p-l._offset)/l._length;return s?1-d:d};else{var v=t.rangeToShapePosition(l);u=function(p){return v(l.p2r(p-l._offset))}}else s?u=function(p){return 1-(p-c.t)/c.h}:u=function(p){return(p-c.l)/c.w};return u},t.roundPositionForSharpStrokeRendering=function(o,l){var s=Math.round(l%2)===1,f=Math.round(o);return s?f+.5:f},t.makeShapesOptionsAndPlotinfo=function(o,l){var s=o._fullLayout.shapes[l]||{},f=o._fullLayout._plots[s.xref+s.yref],c=!!f;return c?f._hadPlotinfo=!0:(f={},s.xref&&s.xref!=="paper"&&(f.xaxis=o._fullLayout[s.xref+"axis"]),s.yref&&s.yref!=="paper"&&(f.yaxis=o._fullLayout[s.yref+"axis"])),f.xsizemode=s.xsizemode,f.ysizemode=s.ysizemode,f.xanchor=s.xanchor,f.yanchor=s.yanchor,{options:s,plotinfo:f}},t.makeSelectionsOptionsAndPlotinfo=function(o,l){var s=o._fullLayout.selections[l]||{},f=o._fullLayout._plots[s.xref+s.yref],c=!!f;return c?f._hadPlotinfo=!0:(f={},s.xref&&(f.xaxis=o._fullLayout[s.xref+"axis"]),s.yref&&(f.yaxis=o._fullLayout[s.yref+"axis"])),{options:s,plotinfo:f}},t.getPathString=function(o,l){var s=l.type,f=a.getRefType(l.xref),c=a.getRefType(l.yref),u=a.getFromId(o,l.xref),v=a.getFromId(o,l.yref),p=o._fullLayout._size,d,h,m,y,b=n(u,l.x0shift),_=n(u,l.x1shift),g=n(v,l.y0shift),x=n(v,l.y1shift),w,T,A,M;if(u?f==="domain"?h=function(k){return u._offset+u._length*k}:(d=t.shapePositionToRange(u),h=function(k){return u._offset+u.r2p(d(k,!0))}):h=function(k){return p.l+p.w*k},v?c==="domain"?y=function(k){return v._offset+v._length*(1-k)}:(m=t.shapePositionToRange(v),y=function(k){return v._offset+v.r2p(m(k,!0))}):y=function(k){return p.t+p.h*(1-k)},s==="path")return u&&u.type==="date"&&(h=t.decodeDate(h)),v&&v.type==="date"&&(y=t.decodeDate(y)),i(l,h,y);if(l.xsizemode==="pixel"){var S=h(l.xanchor);w=S+l.x0+b,T=S+l.x1+_}else w=h(l.x0)+b,T=h(l.x1)+_;if(l.ysizemode==="pixel"){var L=y(l.yanchor);A=L-l.y0+g,M=L-l.y1+x}else A=y(l.y0)+g,M=y(l.y1)+x;if(s==="line")return"M"+w+","+A+"L"+T+","+M;if(s==="rect")return"M"+w+","+A+"H"+T+"V"+M+"H"+w+"Z";var E=(w+T)/2,F=(A+M)/2,N=Math.abs(E-w),z=Math.abs(F-A),H="A"+N+","+z,D=E+N+","+F,P=E+","+(F-z);return"M"+D+H+" 0 1,1 "+P+H+" 0 0,1 "+D+"Z"};function i(o,l,s){var f=o.path,c=o.xsizemode,u=o.ysizemode,v=o.xanchor,p=o.yanchor;return f.replace(e.segmentRE,function(d){var h=0,m=d.charAt(0),y=e.paramIsX[m],b=e.paramIsY[m],_=e.numParams[m],g=d.substr(1).replace(e.paramRE,function(x){return y[h]?c==="pixel"?x=l(v)+Number(x):x=l(x):b[h]&&(u==="pixel"?x=s(p)-Number(x):x=s(x)),h++,h>_&&(x="X"),x});return h>_&&(g=g.replace(/[\s,]*X.*/,""),r.log("Ignoring extra params in segment "+d)),m+g})}function n(o,l){l=l||0;var s=0;return l&&o&&(o.type==="category"||o.type==="multicategory")&&(s=(o.r2p(1)-o.r2p(0))*l),s}})(Ui);var WP=we,Vn=Ot,Rg=Tr,Ig=Et,XP=Gi.readPaths,nh=Ui,YP=nh.getPathString,Fg=Vh,qP=Vr.FROM_TL,CT=function(e,r,a,i){if(i.selectAll(".shape-label").remove(),!!(a.label.text||a.label.texttemplate)){var n;if(a.label.texttemplate){var o={};if(a.type!=="path"){var l=Vn.getFromId(e,a.xref),s=Vn.getFromId(e,a.yref);for(var f in Fg){var c=Fg[f](a,l,s);c!==void 0&&(o[f]=c)}}n=WP.texttemplateStringForShapes(a.label.texttemplate,{},e._fullLayout._d3locale,o)}else n=a.label.text;var u={"data-index":r},v=a.label.font,p={"data-notex":1},d=i.append("g").attr(u).classed("shape-label",!0),h=d.append("text").attr(p).classed("shape-label-text",!0).text(n),m,y,b,_;if(a.path){var g=YP(e,a),x=XP(g,e);m=1/0,b=1/0,y=-1/0,_=-1/0;for(var w=0;w<x.length;w++)for(var T=0;T<x[w].length;T++)for(var A=x[w][T],M=1;M<A.length;M+=2){var S=A[M],L=A[M+1];m=Math.min(m,S),y=Math.max(y,S),b=Math.min(b,L),_=Math.max(_,L)}}else{var E=Vn.getFromId(e,a.xref),F=a.x0shift,N=a.x1shift,z=Vn.getRefType(a.xref),H=Vn.getFromId(e,a.yref),D=a.y0shift,P=a.y1shift,k=Vn.getRefType(a.yref),C=function(W,X){var B=nh.getDataToPixel(e,E,X,!1,z);return B(W)},$=function(W,X){var B=nh.getDataToPixel(e,H,X,!0,k);return B(W)};m=C(a.x0,F),y=C(a.x1,N),b=$(a.y0,D),_=$(a.y1,P)}var R=a.label.textangle;R==="auto"&&(a.type==="line"?R=ZP(m,b,y,_):R=0),h.call(function(W){return W.call(Ig.font,v).attr({}),Rg.convertToTspans(W,e),W});var j=Ig.bBox(h.node()),G=KP(m,b,y,_,a,R,j),Y=G.textx,O=G.texty,K=G.xanchor;h.attr({"text-anchor":{left:"start",center:"middle",right:"end"}[K],y:O,x:Y,transform:"rotate("+R+","+Y+","+O+")"}).call(Rg.positionText,Y,O)}};function ZP(t,e,r,a){var i,n;return n=Math.abs(r-t),r>=t?i=e-a:i=a-e,-180/Math.PI*Math.atan2(i,n)}function KP(t,e,r,a,i,n,o){var l=i.label.textposition,s=i.label.textangle,f=i.label.padding,c=i.type,u=Math.PI/180*n,v=Math.sin(u),p=Math.cos(u),d=i.label.xanchor,h=i.label.yanchor,m,y,b,_;if(c==="line"){l==="start"?(m=t,y=e):l==="end"?(m=r,y=a):(m=(t+r)/2,y=(e+a)/2),d==="auto"&&(l==="start"?s==="auto"?r>t?d="left":r<t?d="right":d="center":r>t?d="right":r<t?d="left":d="center":l==="end"?s==="auto"?r>t?d="right":r<t?d="left":d="center":r>t?d="left":r<t?d="right":d="center":d="center");var g={left:1,center:0,right:-1},x={bottom:-1,middle:0,top:1};if(s==="auto"){var w=x[h];b=-f*v*w,_=f*p*w}else{var T=g[d],A=x[h];b=f*T,_=f*A}m=m+b,y=y+_}else b=f+3,l.indexOf("right")!==-1?(m=Math.max(t,r)-b,d==="auto"&&(d="right")):l.indexOf("left")!==-1?(m=Math.min(t,r)+b,d==="auto"&&(d="left")):(m=(t+r)/2,d==="auto"&&(d="center")),l.indexOf("top")!==-1?y=Math.min(e,a):l.indexOf("bottom")!==-1?y=Math.max(e,a):y=(e+a)/2,_=f,h==="bottom"?y=y-_:h==="top"&&(y=y+_);var M=qP[h],S=i.label.font.size,L=o.height,E=(L*M-S)*v,F=-(L*M-S)*p;return{textx:m+E,texty:y+F,xanchor:d}}var QP=we,JP=QP.strTranslate,Ng=ai,DT=Fn,e$=DT.drawMode,PT=DT.selectMode,$T=ot,Hg=yt,fu=Tp,t$=fu.i000,r$=fu.i090,a$=fu.i180,i$=fu.i270,n$=zn,ET=n$.clearOutlineControllers,Sp=Gi,Js=Sp.pointsOnRectangle,hv=Sp.pointsOnEllipse,o$=Sp.writePaths,l$=Ap.newShapes,s$=Ap.createShapeObj,f$=LT,c$=CT,Lp=function t(e,r,a,i){i||(i=0);var n=a.gd;function o(){t(e,r,a,i++),(hv(e[0])||a.hasText)&&l({redrawing:!0})}function l(D){var P={};a.isActiveShape!==void 0&&(a.isActiveShape=!1,P=l$(r,a)),a.isActiveSelection!==void 0&&(a.isActiveSelection=!1,P=f$(r,a),n._fullLayout._reselect=!0),Object.keys(P).length&&$T.call((D||{}).redrawing?"relayout":"_guiRelayout",n,P)}var s=n._fullLayout,f=s._zoomlayer,c=a.dragmode,u=e$(c),v=PT(c);(u||v)&&(n._fullLayout._outlining=!0),ET(n),r.attr("d",o$(e));var p,d,h,m,y;if(!i&&(a.isActiveShape||a.isActiveSelection)){y=u$([],e);var b=f.append("g").attr("class","outline-controllers");S(b),H()}if(u&&a.hasText){var _=f.select(".label-temp"),g=s$(r,a,a.dragmode);c$(n,"label-temp",g,_)}function x(D){h=+D.srcElement.getAttribute("data-i"),m=+D.srcElement.getAttribute("data-j"),p[h][m].moveFn=w}function w(D,P){if(e.length){var k=y[h][m][1],C=y[h][m][2],$=e[h],R=$.length;if(Js($)){var j=D,G=P;if(a.isActiveSelection){var Y=Og($,m);Y[1]===$[m][1]?G=0:j=0}for(var O=0;O<R;O++)if(O!==m){var K=$[O];K[1]===$[m][1]&&(K[1]=k+j),K[2]===$[m][2]&&(K[2]=C+G)}if($[m][1]=k+j,$[m][2]=C+G,!Js($))for(var W=0;W<R;W++)for(var X=0;X<$[W].length;X++)$[W][X]=y[h][W][X]}else $[m][1]=k+D,$[m][2]=C+P;o()}}function T(){l()}function A(){if(e.length&&e[h]&&e[h].length){for(var D=[],P=0;P<e[h].length;P++)P!==m&&D.push(e[h][P]);D.length>1&&!(D.length===2&&D[1][0]==="Z")&&(m===0&&(D[0][0]="M"),e[h]=D,o(),l())}}function M(D,P){if(D===2){h=+P.srcElement.getAttribute("data-i"),m=+P.srcElement.getAttribute("data-j");var k=e[h];!Js(k)&&!hv(k)&&A()}}function S(D){p=[];for(var P=0;P<e.length;P++){var k=e[P],C=Js(k),$=!C&&hv(k);p[P]=[];for(var R=k.length,j=0;j<R;j++)if(k[j][0]!=="Z"&&!($&&j!==t$&&j!==r$&&j!==a$&&j!==i$)){var G=C&&a.isActiveSelection,Y;G&&(Y=Og(k,j));var O=k[j][1],K=k[j][2],W=D.append(G?"rect":"circle").attr("data-i",P).attr("data-j",j).style({fill:Hg.background,stroke:Hg.defaultLine,"stroke-width":1,"shape-rendering":"crispEdges"});if(G){var X=Y[1]-O,B=Y[2]-K,ee=B?5:Math.max(Math.min(25,Math.abs(X)-5),5),ae=X?5:Math.max(Math.min(25,Math.abs(B)-5),5);W.classed(B?"cursor-ew-resize":"cursor-ns-resize",!0).attr("width",ee).attr("height",ae).attr("x",O-ee/2).attr("y",K-ae/2).attr("transform",JP(X/2,B/2))}else W.classed("cursor-grab",!0).attr("r",5).attr("cx",O).attr("cy",K);p[P][j]={element:W.node(),gd:n,prepFn:x,doneFn:T,clickFn:M},Ng.init(p[P][j])}}}function L(D,P){if(e.length)for(var k=0;k<e.length;k++)for(var C=0;C<e[k].length;C++)for(var $=0;$+2<e[k][C].length;$+=2)e[k][C][$+1]=y[k][C][$+1]+D,e[k][C][$+2]=y[k][C][$+2]+P}function E(D,P){L(D,P),o()}function F(D){h=+D.srcElement.getAttribute("data-i"),h||(h=0),d[h].moveFn=E}function N(){l()}function z(D){D===2&&v$(n)}function H(){if(d=[],!!e.length){var D=0;d[D]={element:r[0][0],gd:n,prepFn:F,doneFn:N,clickFn:z},Ng.init(d[D])}}};function u$(t,e){for(var r=0;r<e.length;r++){var a=e[r];t[r]=[];for(var i=0;i<a.length;i++){t[r][i]=[];for(var n=0;n<a[i].length;n++)t[r][i][n]=a[i][n]}}return t}function Og(t,e){var r=t[e][1],a=t[e][2],i=t.length,n,o,l;return n=(e+1)%i,o=t[n][1],l=t[n][2],o===r&&l===a&&(n=(e+2)%i,o=t[n][1],l=t[n][2]),[n,o,l]}function v$(t){if(PT(t._fullLayout.dragmode)){ET(t);var e=t._fullLayout._activeSelectionIndex,r=(t.layout||{}).selections||[];if(e<r.length){for(var a=[],i=0;i<r.length;i++)i!==e&&a.push(r[i]);delete t._fullLayout._activeSelectionIndex;var n=t._fullLayout.selections[e];t._fullLayout._deselect={xref:n.xref,yref:n.yref},$T.call("_guiRelayout",t,{selections:a})}}}var d$=bt,zT=ot,jg=we,Wn=Ot,h$=Gi.readPaths,p$=Lp,pc=CT,RT=zn.clearOutlineControllers,pv=yt,Cp=Et,m$=Ht.arrayEditor,Bg=ai,Gg=Bi,un=su,Yr=Ui,oh=Yr.getPathString,Dp={draw:Pp,drawOne:IT,eraseActiveShape:b$,drawLabel:pc};function Pp(t){var e=t._fullLayout;e._shapeUpperLayer.selectAll("path").remove(),e._shapeLowerLayer.selectAll("path").remove(),e._shapeUpperLayer.selectAll("text").remove(),e._shapeLowerLayer.selectAll("text").remove();for(var r in e._plots){var a=e._plots[r].shapelayer;a&&(a.selectAll("path").remove(),a.selectAll("text").remove())}for(var i=0;i<e.shapes.length;i++)e.shapes[i].visible===!0&&IT(t,i)}function ef(t){return!!t._fullLayout._outlining}function cu(t){return!t._context.edits.shapePosition}function IT(t,e){t._fullLayout._paperdiv.selectAll('.shapelayer [data-index="'+e+'"]').remove();var r=Yr.makeShapesOptionsAndPlotinfo(t,e),a=r.options,i=r.plotinfo;if(!a._input||a.visible!==!0)return;if(a.layer==="above")o(t._fullLayout._shapeUpperLayer);else if(a.xref==="paper"||a.yref==="paper")o(t._fullLayout._shapeLowerLayer);else if(a.layer==="between")o(i.shapelayerBetween);else if(i._hadPlotinfo){var n=i.mainplotinfo||i;o(n.shapelayer)}else o(t._fullLayout._shapeLowerLayer);function o(l){var s=oh(t,a),f={"data-index":e,"fill-rule":a.fillrule,d:s},c=a.opacity,u=a.fillcolor,v=a.line.width?a.line.color:"rgba(0,0,0,0)",p=a.line.width,d=a.line.dash;!p&&a.editable===!0&&(p=5,d="solid");var h=s[s.length-1]!=="Z",m=cu(t)&&a.editable&&t._fullLayout._activeShapeIndex===e;m&&(u=h?"rgba(0,0,0,0)":t._fullLayout.activeshape.fillcolor,c=t._fullLayout.activeshape.opacity);var y=l.append("g").classed("shape-group",!0).attr({"data-index":e}),b=y.append("path").attr(f).style("opacity",c).call(pv.stroke,v).call(pv.fill,u).call(Cp.dashLine,d,p);FT(y,t,a),pc(t,e,a,y);var _;if((m||t._context.edits.shapePosition)&&(_=m$(t.layout,"shapes",a)),m){b.style({cursor:"move"});var g={element:b.node(),plotinfo:i,gd:t,editHelpers:_,hasText:a.label.text||a.label.texttemplate,isActiveShape:!0},x=h$(s,t);p$(x,b,g)}else t._context.edits.shapePosition?y$(t,b,a,e,l,_):a.editable===!0&&b.style("pointer-events",h||pv.opacity(u)*c<=.5?"stroke":"all");b.node().addEventListener("click",function(){return g$(t,b)})}}function FT(t,e,r){var a=(r.xref+r.yref).replace(/paper/g,"").replace(/[xyz][1-9]* *domain/g,"");Cp.setClipUrl(t,a?"clip"+e._fullLayout._uid+a:null,e)}function y$(t,e,r,a,i,n){var o=10,l=10,s=r.xsizemode==="pixel",f=r.ysizemode==="pixel",c=r.type==="line",u=r.type==="path",v=n.modifyItem,p,d,h,m,y,b,_,g,x,w,T,A,M,S,L,E=d$.select(e.node().parentNode),F=Wn.getFromId(t,r.xref),N=Wn.getRefType(r.xref),z=Wn.getFromId(t,r.yref),H=Wn.getRefType(r.yref),D=r.x0shift,P=r.x1shift,k=r.y0shift,C=r.y1shift,$=function(ye,ue){var oe=Yr.getDataToPixel(t,F,ue,!1,N);return oe(ye)},R=function(ye,ue){var oe=Yr.getDataToPixel(t,z,ue,!0,H);return oe(ye)},j=Yr.getPixelToData(t,F,!1,N),G=Yr.getPixelToData(t,z,!0,H),Y=W(),O={element:Y.node(),gd:t,prepFn:ee,doneFn:ae,clickFn:de},K;Bg.init(O),Y.node().onmousemove=B;function W(){return c?X():e}function X(){var ye=10,ue=Math.max(r.line.width,ye),oe=i.append("g").attr("data-index",a).attr("drag-helper",!0);oe.append("path").attr("d",e.attr("d")).style({cursor:"move","stroke-width":ue,"stroke-opacity":"0"});var pe={"fill-opacity":"0"},Me=Math.max(ue/2,ye);return oe.append("circle").attr({"data-line-point":"start-point",cx:s?$(r.xanchor)+r.x0:$(r.x0,D),cy:f?R(r.yanchor)-r.y0:R(r.y0,k),r:Me}).style(pe).classed("cursor-grab",!0),oe.append("circle").attr({"data-line-point":"end-point",cx:s?$(r.xanchor)+r.x1:$(r.x1,P),cy:f?R(r.yanchor)-r.y1:R(r.y1,C),r:Me}).style(pe).classed("cursor-grab",!0),oe}function B(ye){if(ef(t)){K=null;return}if(c)ye.target.tagName==="path"?K="move":K=ye.target.attributes["data-line-point"].value==="start-point"?"resize-over-start-point":"resize-over-end-point";else{var ue=O.element.getBoundingClientRect(),oe=ue.right-ue.left,pe=ue.bottom-ue.top,Me=ye.clientX-ue.left,ve=ye.clientY-ue.top,ke=!u&&oe>o&&pe>l&&!ye.shiftKey?Bg.getCursor(Me/oe,1-ve/pe):"move";Gg(e,ke),K=ke.split("-")[0]}}function ee(ye){ef(t)||(s&&(y=$(r.xanchor)),f&&(b=R(r.yanchor)),r.type==="path"?L=r.path:(p=s?r.x0:$(r.x0),d=f?r.y0:R(r.y0),h=s?r.x1:$(r.x1),m=f?r.y1:R(r.y1)),p<h?(x=p,M="x0",w=h,S="x1"):(x=h,M="x1",w=p,S="x0"),!f&&d<m||f&&d>m?(_=d,T="y0",g=m,A="y1"):(_=m,T="y1",g=d,A="y0"),B(ye),te(i,r),ce(e,r,t),O.moveFn=K==="move"?fe:q,O.altKey=ye.altKey)}function ae(){ef(t)||(Gg(e),le(i),FT(e,t,r),zT.call("_guiRelayout",t,n.getUpdateObj()))}function de(){ef(t)||le(i)}function fe(ye,ue){if(r.type==="path"){var oe=function(ve){return ve},pe=oe,Me=oe;s?v("xanchor",r.xanchor=j(y+ye)):(pe=function(ke){return j($(ke)+ye)},F&&F.type==="date"&&(pe=Yr.encodeDate(pe))),f?v("yanchor",r.yanchor=G(b+ue)):(Me=function(ke){return G(R(ke)+ue)},z&&z.type==="date"&&(Me=Yr.encodeDate(Me))),v("path",r.path=Ug(L,pe,Me))}else s?v("xanchor",r.xanchor=j(y+ye)):(v("x0",r.x0=j(p+ye)),v("x1",r.x1=j(h+ye))),f?v("yanchor",r.yanchor=G(b+ue)):(v("y0",r.y0=G(d+ue)),v("y1",r.y1=G(m+ue)));e.attr("d",oh(t,r)),te(i,r),pc(t,a,r,E)}function q(ye,ue){if(u){var oe=function($e){return $e},pe=oe,Me=oe;s?v("xanchor",r.xanchor=j(y+ye)):(pe=function(ze){return j($(ze)+ye)},F&&F.type==="date"&&(pe=Yr.encodeDate(pe))),f?v("yanchor",r.yanchor=G(b+ue)):(Me=function(ze){return G(R(ze)+ue)},z&&z.type==="date"&&(Me=Yr.encodeDate(Me))),v("path",r.path=Ug(L,pe,Me))}else if(c){if(K==="resize-over-start-point"){var ve=p+ye,ke=f?d-ue:d+ue;v("x0",r.x0=s?ve:j(ve)),v("y0",r.y0=f?ke:G(ke))}else if(K==="resize-over-end-point"){var _e=h+ye,J=f?m-ue:m+ue;v("x1",r.x1=s?_e:j(_e)),v("y1",r.y1=f?J:G(J))}}else{var be=function($e){return K.indexOf($e)!==-1},Z=be("n"),me=be("s"),ge=be("w"),Pe=be("e"),Ee=Z?_+ue:_,Le=me?g+ue:g,Ae=ge?x+ye:x,Oe=Pe?w+ye:w;f&&(Z&&(Ee=_-ue),me&&(Le=g-ue)),(!f&&Le-Ee>l||f&&Ee-Le>l)&&(v(T,r[T]=f?Ee:G(Ee)),v(A,r[A]=f?Le:G(Le))),Oe-Ae>o&&(v(M,r[M]=s?Ae:j(Ae)),v(S,r[S]=s?Oe:j(Oe)))}e.attr("d",oh(t,r)),te(i,r),pc(t,a,r,E)}function te(ye,ue){(s||f)&&oe();function oe(){var pe=ue.type!=="path",Me=ye.selectAll(".visual-cue").data([0]),ve=1;Me.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":ve}).classed("visual-cue",!0);var ke=$(s?ue.xanchor:jg.midRange(pe?[ue.x0,ue.x1]:Yr.extractPathCoords(ue.path,un.paramIsX))),_e=R(f?ue.yanchor:jg.midRange(pe?[ue.y0,ue.y1]:Yr.extractPathCoords(ue.path,un.paramIsY)));if(ke=Yr.roundPositionForSharpStrokeRendering(ke,ve),_e=Yr.roundPositionForSharpStrokeRendering(_e,ve),s&&f){var J="M"+(ke-1-ve)+","+(_e-1-ve)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";Me.attr("d",J)}else if(s){var be="M"+(ke-1-ve)+","+(_e-9-ve)+"v18 h2 v-18 Z";Me.attr("d",be)}else{var Z="M"+(ke-9-ve)+","+(_e-1-ve)+"h18 v2 h-18 Z";Me.attr("d",Z)}}}function le(ye){ye.selectAll(".visual-cue").remove()}function ce(ye,ue,oe){var pe=ue.xref,Me=ue.yref,ve=Wn.getFromId(oe,pe),ke=Wn.getFromId(oe,Me),_e="";pe!=="paper"&&!ve.autorange&&(_e+=pe),Me!=="paper"&&!ke.autorange&&(_e+=Me),Cp.setClipUrl(ye,_e?"clip"+oe._fullLayout._uid+_e:null,oe)}}function Ug(t,e,r){return t.replace(un.segmentRE,function(a){var i=0,n=a.charAt(0),o=un.paramIsX[n],l=un.paramIsY[n],s=un.numParams[n],f=a.substr(1).replace(un.paramRE,function(c){return i>=s||(o[i]?c=e(c):l[i]&&(c=r(c)),i++),c});return n+f})}function g$(t,e){if(cu(t)){var r=e.node(),a=+r.getAttribute("data-index");if(a>=0){if(a===t._fullLayout._activeShapeIndex){Vg(t);return}t._fullLayout._activeShapeIndex=a,t._fullLayout._deactivateShape=Vg,Pp(t)}}}function Vg(t){if(cu(t)){var e=t._fullLayout._activeShapeIndex;e>=0&&(RT(t),delete t._fullLayout._activeShapeIndex,Pp(t))}}function b$(t){if(cu(t)){RT(t);var e=t._fullLayout._activeShapeIndex,r=(t.layout||{}).shapes||[];if(e<r.length){for(var a=[],i=0;i<r.length;i++)i!==e&&a.push(r[i]);return delete t._fullLayout._activeShapeIndex,zT.call("_guiRelayout",t,{shapes:a})}}}var ka=ot,NT=hr,HT=cr,Dt=wp,x$=Dp.eraseActiveShape,Hf=we,Mt=Hf._,Pt=TT.exports={};Pt.toImage={name:"toImage",title:function(t){var e=t._context.toImageButtonOptions||{},r=e.format||"png";return r==="png"?Mt(t,"Download plot as a PNG"):Mt(t,"Download plot")},icon:Dt.camera,click:function(t){var e=t._context.toImageButtonOptions,r={format:e.format||"png"};Hf.notifier(Mt(t,"Taking snapshot - this may take a few seconds"),"long"),["filename","width","height","scale"].forEach(function(a){a in e&&(r[a]=e[a])}),ka.call("downloadImage",t,r).then(function(a){Hf.notifier(Mt(t,"Snapshot succeeded")+" - "+a,"long")}).catch(function(){Hf.notifier(Mt(t,"Sorry, there was a problem downloading your snapshot!"),"long")})}};Pt.sendDataToCloud={name:"sendDataToCloud",title:function(t){return Mt(t,"Edit in Chart Studio")},icon:Dt.disk,click:function(t){NT.sendDataToCloud(t)}};Pt.editInChartStudio={name:"editInChartStudio",title:function(t){return Mt(t,"Edit in Chart Studio")},icon:Dt.pencil,click:function(t){NT.sendDataToCloud(t)}};Pt.zoom2d={name:"zoom2d",_cat:"zoom",title:function(t){return Mt(t,"Zoom")},attr:"dragmode",val:"zoom",icon:Dt.zoombox,click:Br};Pt.pan2d={name:"pan2d",_cat:"pan",title:function(t){return Mt(t,"Pan")},attr:"dragmode",val:"pan",icon:Dt.pan,click:Br};Pt.select2d={name:"select2d",_cat:"select",title:function(t){return Mt(t,"Box Select")},attr:"dragmode",val:"select",icon:Dt.selectbox,click:Br};Pt.lasso2d={name:"lasso2d",_cat:"lasso",title:function(t){return Mt(t,"Lasso Select")},attr:"dragmode",val:"lasso",icon:Dt.lasso,click:Br};Pt.drawclosedpath={name:"drawclosedpath",title:function(t){return Mt(t,"Draw closed freeform")},attr:"dragmode",val:"drawclosedpath",icon:Dt.drawclosedpath,click:Br};Pt.drawopenpath={name:"drawopenpath",title:function(t){return Mt(t,"Draw open freeform")},attr:"dragmode",val:"drawopenpath",icon:Dt.drawopenpath,click:Br};Pt.drawline={name:"drawline",title:function(t){return Mt(t,"Draw line")},attr:"dragmode",val:"drawline",icon:Dt.drawline,click:Br};Pt.drawrect={name:"drawrect",title:function(t){return Mt(t,"Draw rectangle")},attr:"dragmode",val:"drawrect",icon:Dt.drawrect,click:Br};Pt.drawcircle={name:"drawcircle",title:function(t){return Mt(t,"Draw circle")},attr:"dragmode",val:"drawcircle",icon:Dt.drawcircle,click:Br};Pt.eraseshape={name:"eraseshape",title:function(t){return Mt(t,"Erase active shape")},icon:Dt.eraseshape,click:x$};Pt.zoomIn2d={name:"zoomIn2d",_cat:"zoomin",title:function(t){return Mt(t,"Zoom in")},attr:"zoom",val:"in",icon:Dt.zoom_plus,click:Br};Pt.zoomOut2d={name:"zoomOut2d",_cat:"zoomout",title:function(t){return Mt(t,"Zoom out")},attr:"zoom",val:"out",icon:Dt.zoom_minus,click:Br};Pt.autoScale2d={name:"autoScale2d",_cat:"autoscale",title:function(t){return Mt(t,"Autoscale")},attr:"zoom",val:"auto",icon:Dt.autoscale,click:Br};Pt.resetScale2d={name:"resetScale2d",_cat:"resetscale",title:function(t){return Mt(t,"Reset axes")},attr:"zoom",val:"reset",icon:Dt.home,click:Br};Pt.hoverClosestCartesian={name:"hoverClosestCartesian",_cat:"hoverclosest",title:function(t){return Mt(t,"Show closest data on hover")},attr:"hovermode",val:"closest",icon:Dt.tooltip_basic,gravity:"ne",click:Br};Pt.hoverCompareCartesian={name:"hoverCompareCartesian",_cat:"hoverCompare",title:function(t){return Mt(t,"Compare data on hover")},attr:"hovermode",val:function(t){return t._fullLayout._isHoriz?"y":"x"},icon:Dt.tooltip_compare,gravity:"ne",click:Br};function Br(t,e){var r=e.currentTarget,a=r.getAttribute("data-attr"),i=r.getAttribute("data-val")||!0,n=t._fullLayout,o={},l=HT.list(t,null,!0),s=n._cartesianSpikesEnabled,f,c;if(a==="zoom"){var u=i==="in"?.5:2,v=(1+u)/2,p=(1-u)/2,d;for(c=0;c<l.length;c++)if(f=l[c],!f.fixedrange)if(d=f._name,i==="auto")o[d+".autorange"]=!0;else if(i==="reset")f._rangeInitial0===void 0&&f._rangeInitial1===void 0?o[d+".autorange"]=!0:f._rangeInitial0===void 0?(o[d+".autorange"]=f._autorangeInitial,o[d+".range"]=[null,f._rangeInitial1]):f._rangeInitial1===void 0?(o[d+".range"]=[f._rangeInitial0,null],o[d+".autorange"]=f._autorangeInitial):o[d+".range"]=[f._rangeInitial0,f._rangeInitial1],f._showSpikeInitial!==void 0&&(o[d+".showspikes"]=f._showSpikeInitial,s==="on"&&!f._showSpikeInitial&&(s="off"));else{var h=[f.r2l(f.range[0]),f.r2l(f.range[1])],m=[v*h[0]+p*h[1],v*h[1]+p*h[0]];o[d+".range[0]"]=f.l2r(m[0]),o[d+".range[1]"]=f.l2r(m[1])}}else a==="hovermode"&&(i==="x"||i==="y")&&(i=n._isHoriz?"y":"x",r.setAttribute("data-val",i)),o[a]=i;n._cartesianSpikesEnabled=s,ka.call("_guiRelayout",t,o)}Pt.zoom3d={name:"zoom3d",_cat:"zoom",title:function(t){return Mt(t,"Zoom")},attr:"scene.dragmode",val:"zoom",icon:Dt.zoombox,click:uu};Pt.pan3d={name:"pan3d",_cat:"pan",title:function(t){return Mt(t,"Pan")},attr:"scene.dragmode",val:"pan",icon:Dt.pan,click:uu};Pt.orbitRotation={name:"orbitRotation",title:function(t){return Mt(t,"Orbital rotation")},attr:"scene.dragmode",val:"orbit",icon:Dt["3d_rotate"],click:uu};Pt.tableRotation={name:"tableRotation",title:function(t){return Mt(t,"Turntable rotation")},attr:"scene.dragmode",val:"turntable",icon:Dt["z-axis"],click:uu};function uu(t,e){for(var r=e.currentTarget,a=r.getAttribute("data-attr"),i=r.getAttribute("data-val")||!0,n=t._fullLayout._subplots.gl3d||[],o={},l=a.split("."),s=0;s<n.length;s++)o[n[s]+"."+l[1]]=i;var f=i==="pan"?i:"zoom";o.dragmode=f,ka.call("_guiRelayout",t,o)}Pt.resetCameraDefault3d={name:"resetCameraDefault3d",_cat:"resetCameraDefault",title:function(t){return Mt(t,"Reset camera to default")},attr:"resetDefault",icon:Dt.home,click:$p};Pt.resetCameraLastSave3d={name:"resetCameraLastSave3d",_cat:"resetCameraLastSave",title:function(t){return Mt(t,"Reset camera to last save")},attr:"resetLastSave",icon:Dt.movie,click:$p};function $p(t,e){for(var r=e.currentTarget,a=r.getAttribute("data-attr"),i=a==="resetLastSave",n=a==="resetDefault",o=t._fullLayout,l=o._subplots.gl3d||[],s={},f=0;f<l.length;f++){var c=l[f],u=c+".camera",v=c+".aspectratio",p=c+".aspectmode",d=o[c]._scene,h;i?(s[u+".up"]=d.viewInitial.up,s[u+".eye"]=d.viewInitial.eye,s[u+".center"]=d.viewInitial.center,h=!0):n&&(s[u+".up"]=null,s[u+".eye"]=null,s[u+".center"]=null,h=!0),h&&(s[v+".x"]=d.viewInitial.aspectratio.x,s[v+".y"]=d.viewInitial.aspectratio.y,s[v+".z"]=d.viewInitial.aspectratio.z,s[p]=d.viewInitial.aspectmode)}ka.call("_guiRelayout",t,s)}Pt.hoverClosest3d={name:"hoverClosest3d",_cat:"hoverclosest",title:function(t){return Mt(t,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:Dt.tooltip_basic,gravity:"ne",click:_$};function OT(t,e){var r=e.currentTarget,a=r._previousVal,i=t._fullLayout,n=i._subplots.gl3d||[],o=["xaxis","yaxis","zaxis"],l={},s={};if(a)s=a,r._previousVal=null;else{for(var f=0;f<n.length;f++){var c=n[f],u=i[c],v=c+".hovermode";l[v]=u.hovermode,s[v]=!1;for(var p=0;p<3;p++){var d=o[p],h=c+"."+d+".showspikes";s[h]=!1,l[h]=u[d].showspikes}}r._previousVal=l}return s}function _$(t,e){var r=OT(t,e);ka.call("_guiRelayout",t,r)}Pt.zoomInGeo={name:"zoomInGeo",_cat:"zoomin",title:function(t){return Mt(t,"Zoom in")},attr:"zoom",val:"in",icon:Dt.zoom_plus,click:Ep};Pt.zoomOutGeo={name:"zoomOutGeo",_cat:"zoomout",title:function(t){return Mt(t,"Zoom out")},attr:"zoom",val:"out",icon:Dt.zoom_minus,click:Ep};Pt.resetGeo={name:"resetGeo",_cat:"reset",title:function(t){return Mt(t,"Reset")},attr:"reset",val:null,icon:Dt.autoscale,click:Ep};Pt.hoverClosestGeo={name:"hoverClosestGeo",_cat:"hoverclosest",title:function(t){return Mt(t,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:Dt.tooltip_basic,gravity:"ne",click:BT};function Ep(t,e){for(var r=e.currentTarget,a=r.getAttribute("data-attr"),i=r.getAttribute("data-val")||!0,n=t._fullLayout,o=n._subplots.geo||[],l=0;l<o.length;l++){var s=o[l],f=n[s];if(a==="zoom"){var c=f.projection.scale,u=i==="in"?2*c:.5*c;ka.call("_guiRelayout",t,s+".projection.scale",u)}}a==="reset"&&ko(t,"geo")}Pt.hoverClosestPie={name:"hoverClosestPie",_cat:"hoverclosest",title:function(t){return Mt(t,"Toggle show closest data on hover")},attr:"hovermode",val:"closest",icon:Dt.tooltip_basic,gravity:"ne",click:BT};function jT(t){var e=t._fullLayout;return e.hovermode?!1:e._has("cartesian")?e._isHoriz?"y":"x":"closest"}function BT(t){var e=jT(t);ka.call("_guiRelayout",t,"hovermode",e)}Pt.resetViewSankey={name:"resetSankeyGroup",title:function(t){return Mt(t,"Reset view")},icon:Dt.home,click:function(t){for(var e={"node.groups":[],"node.x":[],"node.y":[]},r=0;r<t._fullData.length;r++){var a=t._fullData[r]._viewInitial;e["node.groups"].push(a.node.groups.slice()),e["node.x"].push(a.node.x.slice()),e["node.y"].push(a.node.y.slice())}ka.call("restyle",t,e)}};Pt.toggleHover={name:"toggleHover",title:function(t){return Mt(t,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:Dt.tooltip_basic,gravity:"ne",click:function(t,e){var r=OT(t,e);r.hovermode=jT(t),ka.call("_guiRelayout",t,r)}};Pt.resetViews={name:"resetViews",title:function(t){return Mt(t,"Reset views")},icon:Dt.home,click:function(t,e){var r=e.currentTarget;r.setAttribute("data-attr","zoom"),r.setAttribute("data-val","reset"),Br(t,e),r.setAttribute("data-attr","resetLastSave"),$p(t,e),ko(t,"geo"),ko(t,"mapbox"),ko(t,"map")}};Pt.toggleSpikelines={name:"toggleSpikelines",title:function(t){return Mt(t,"Toggle Spike Lines")},icon:Dt.spikeline,attr:"_cartesianSpikesEnabled",val:"on",click:function(t){var e=t._fullLayout,r=e._cartesianSpikesEnabled;e._cartesianSpikesEnabled=r==="on"?"off":"on",ka.call("_guiRelayout",t,w$(t))}};function w$(t){for(var e=t._fullLayout,r=e._cartesianSpikesEnabled==="on",a=HT.list(t,null,!0),i={},n=0;n<a.length;n++){var o=a[n];i[o._name+".showspikes"]=r?!0:o._showSpikeInitial}return i}Pt.resetViewMapbox={name:"resetViewMapbox",_cat:"resetView",title:function(t){return Mt(t,"Reset view")},attr:"reset",icon:Dt.home,click:function(t){ko(t,"mapbox")}};Pt.resetViewMap={name:"resetViewMap",_cat:"resetView",title:function(t){return Mt(t,"Reset view")},attr:"reset",icon:Dt.home,click:function(t){ko(t,"map")}};Pt.zoomInMapbox={name:"zoomInMapbox",_cat:"zoomin",title:function(t){return Mt(t,"Zoom in")},attr:"zoom",val:"in",icon:Dt.zoom_plus,click:GT};Pt.zoomInMap={name:"zoomInMap",_cat:"zoomin",title:function(t){return Mt(t,"Zoom in")},attr:"zoom",val:"in",icon:Dt.zoom_plus,click:UT};Pt.zoomOutMapbox={name:"zoomOutMapbox",_cat:"zoomout",title:function(t){return Mt(t,"Zoom out")},attr:"zoom",val:"out",icon:Dt.zoom_minus,click:GT};Pt.zoomOutMap={name:"zoomOutMap",_cat:"zoomout",title:function(t){return Mt(t,"Zoom out")},attr:"zoom",val:"out",icon:Dt.zoom_minus,click:UT};function GT(t,e){VT(t,e,"mapbox")}function UT(t,e){VT(t,e,"map")}function VT(t,e,r){for(var a=e.currentTarget,i=a.getAttribute("data-val"),n=t._fullLayout,o=n._subplots[r]||[],l=1.05,s={},f=0;f<o.length;f++){var c=o[f],u=n[c].zoom,v=i==="in"?l*u:u/l;s[c+".zoom"]=v}ka.call("_guiRelayout",t,s)}function ko(t,e){for(var r=t._fullLayout,a=r._subplots[e]||[],i={},n=0;n<a.length;n++)for(var o=a[n],l=r[o]._subplot,s=l.viewInitial,f=Object.keys(s),c=0;c<f.length;c++){var u=f[c];i[o+"."+u]=s[u]}ka.call("_guiRelayout",t,i)}var WT=TT.exports,XT=WT,T$=Object.keys(XT),YT=["drawline","drawopenpath","drawclosedpath","drawcircle","drawrect","eraseshape"],qT=["v1hovermode","hoverclosest","hovercompare","togglehover","togglespikelines"].concat(YT),yo=[],k$=function(t){if(qT.indexOf(t._cat||t.name)===-1){var e=t.name,r=(t._cat||t.name).toLowerCase();yo.indexOf(e)===-1&&yo.push(e),yo.indexOf(r)===-1&&yo.push(r)}};T$.forEach(function(t){k$(XT[t])});yo.sort();var ZT={DRAW_MODES:YT,backButtons:qT,foreButtons:yo},Wg=ZT,KT={editType:"modebar",orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"modebar",description:"Sets the orientation of the modebar."},bgcolor:{valType:"color",editType:"modebar",description:"Sets the background color of the modebar."},color:{valType:"color",editType:"modebar",description:"Sets the color of the icons in the modebar."},activecolor:{valType:"color",editType:"modebar",description:"Sets the color of the active or hovered on icons in the modebar."},uirevision:{valType:"any",editType:"none",description:["Controls persistence of user-driven changes related to the modebar,","including `hovermode`, `dragmode`, and `showspikes` at both the","root level and inside subplots. Defaults to `layout.uirevision`."].join(" ")},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar",description:["Determines which predefined modebar buttons to add.","Please note that these buttons will only be shown if they are","compatible with all trace types used in a graph.","Similar to `config.modeBarButtonsToAdd` option.","This may include *"+Wg.backButtons.join("*, *")+"*."].join(" ")},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar",description:["Determines which predefined modebar buttons to remove.","Similar to `config.modeBarButtonsToRemove` option.","This may include *"+Wg.foreButtons.join("*, *")+"*."].join(" ")}},A$=we,cl=yt,M$=Ht,S$=KT,L$=function(e,r){var a=e.modebar||{},i=M$.newContainer(r,"modebar");function n(l,s){return A$.coerce(a,i,S$,l,s)}n("orientation"),n("bgcolor",cl.addOpacity(r.paper_bgcolor,.5));var o=cl.contrast(cl.rgb(r.modebar.bgcolor));n("color",cl.addOpacity(o,.3)),n("activecolor",cl.addOpacity(o,.7)),n("uirevision",r.uirevision),n("add"),n("remove")},zp=bt,C$=kt,vu=we,QT=wp,D$=Ic.version,P$=new DOMParser;function JT(t){this.container=t.container,this.element=document.createElement("div"),this.update(t.graphInfo,t.buttons),this.container.appendChild(this.element)}var ii=JT.prototype;ii.update=function(t,e){this.graphInfo=t;var r=this.graphInfo._context,a=this.graphInfo._fullLayout,i="modebar-"+a._uid;this.element.setAttribute("id",i),this._uid=i,this.element.className="modebar",r.displayModeBar==="hover"&&(this.element.className+=" modebar--hover ease-bg"),a.modebar.orientation==="v"&&(this.element.className+=" vertical",e=e.reverse());var n=a.modebar,o="#"+i+" .modebar-group";document.querySelectorAll(o).forEach(function(u){u.style.backgroundColor=n.bgcolor});var l=!this.hasButtons(e),s=this.hasLogo!==r.displaylogo,f=this.locale!==r.locale;if(this.locale=r.locale,(l||s||f)&&(this.removeAllButtons(),this.updateButtons(e),r.watermark||r.displaylogo)){var c=this.getLogo();r.watermark&&(c.className=c.className+" watermark"),a.modebar.orientation==="v"?this.element.insertBefore(c,this.element.childNodes[0]):this.element.appendChild(c),this.hasLogo=!0}this.updateActiveButton(),vu.setStyleOnHover("#"+i+" .modebar-btn",".active",".icon path","fill: "+n.activecolor,"fill: "+n.color,this.element)};ii.updateButtons=function(t){var e=this;this.buttons=t,this.buttonElements=[],this.buttonsNames=[],this.buttons.forEach(function(r){var a=e.createGroup();r.forEach(function(i){var n=i.name;if(!n)throw new Error("must provide button 'name' in button config");if(e.buttonsNames.indexOf(n)!==-1)throw new Error("button name '"+n+"' is taken");e.buttonsNames.push(n);var o=e.createButton(i);e.buttonElements.push(o),a.appendChild(o)}),e.element.appendChild(a)})};ii.createGroup=function(){var t=document.createElement("div");t.className="modebar-group";var e=this.graphInfo._fullLayout.modebar;return t.style.backgroundColor=e.bgcolor,t};ii.createButton=function(t){var e=this,r=document.createElement("a");r.setAttribute("rel","tooltip"),r.className="modebar-btn";var a=t.title;a===void 0?a=t.name:typeof a=="function"&&(a=a(this.graphInfo)),(a||a===0)&&r.setAttribute("data-title",a),t.attr!==void 0&&r.setAttribute("data-attr",t.attr);var i=t.val;i!==void 0&&(typeof i=="function"&&(i=i(this.graphInfo)),r.setAttribute("data-val",i));var n=t.click;if(typeof n!="function")throw new Error("must provide button 'click' function in button config");r.addEventListener("click",function(l){t.click(e.graphInfo,l),e.updateActiveButton(l.currentTarget)}),r.setAttribute("data-toggle",t.toggle||!1),t.toggle&&zp.select(r).classed("active",!0);var o=t.icon;return typeof o=="function"?r.appendChild(o()):r.appendChild(this.createIcon(o||QT.question)),r.setAttribute("data-gravity",t.gravity||"n"),r};ii.createIcon=function(t){var e=C$(t.height)?Number(t.height):t.ascent-t.descent,r="http://www.w3.org/2000/svg",a;if(t.path){a=document.createElementNS(r,"svg"),a.setAttribute("viewBox",[0,0,t.width,e].join(" ")),a.setAttribute("class","icon");var i=document.createElementNS(r,"path");i.setAttribute("d",t.path),t.transform?i.setAttribute("transform",t.transform):t.ascent!==void 0&&i.setAttribute("transform","matrix(1 0 0 -1 0 "+t.ascent+")"),a.appendChild(i)}if(t.svg){var n=P$.parseFromString(t.svg,"application/xml");a=n.childNodes[0]}return a.setAttribute("height","1em"),a.setAttribute("width","1em"),a};ii.updateActiveButton=function(t){var e=this.graphInfo._fullLayout,r=t!==void 0?t.getAttribute("data-attr"):null;this.buttonElements.forEach(function(a){var i=a.getAttribute("data-val")||!0,n=a.getAttribute("data-attr"),o=a.getAttribute("data-toggle")==="true",l=zp.select(a),s=function(u,v){var p=e.modebar,d=u.querySelector(".icon path");d&&(v||u.matches(":hover")?d.style.fill=p.activecolor:d.style.fill=p.color)};if(o){if(n===r){var f=!l.classed("active");l.classed("active",f),s(a,f)}}else{var c=n===null?n:vu.nestedProperty(e,n).get();l.classed("active",c===i),s(a,c===i)}})};ii.hasButtons=function(t){var e=this.buttons;if(!e||t.length!==e.length)return!1;for(var r=0;r<t.length;++r){if(t[r].length!==e[r].length)return!1;for(var a=0;a<t[r].length;a++)if(t[r][a].name!==e[r][a].name)return!1}return!0};function $$(t){return t+" (v"+D$+")"}ii.getLogo=function(){var t=this.createGroup(),e=document.createElement("a");return e.href="https://plotly.com/",e.target="_blank",e.setAttribute("data-title",$$(vu._(this.graphInfo,"Produced with Plotly.js"))),e.className="modebar-btn plotlyjsicon modebar-btn--logo",e.appendChild(this.createIcon(QT.newplotlylogo)),t.appendChild(e),t};ii.removeAllButtons=function(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.hasLogo=!1};ii.destroy=function(){vu.removeElement(this.container.querySelector(".modebar"))};function E$(t,e){var r=t._fullLayout,a=new JT({graphInfo:t,container:r._modebardiv.node(),buttons:e});return r._privateplot&&zp.select(a.element).append("span").classed("badge-private float--left",!0).text("PRIVATE"),a}var z$=E$,R$=cr,Xg=jr,lh=ot,I$=Ta.isUnifiedHover,F$=z$,mc=WT,N$=ZT.DRAW_MODES,H$=we.extendDeep,O$=function(e){var r=e._fullLayout,a=e._context,i=r._modeBar;if(!a.displayModeBar&&!a.watermark){i&&(i.destroy(),delete r._modeBar);return}if(!Array.isArray(a.modeBarButtonsToRemove))throw new Error(["*modeBarButtonsToRemove* configuration options","must be an array."].join(" "));if(!Array.isArray(a.modeBarButtonsToAdd))throw new Error(["*modeBarButtonsToAdd* configuration options","must be an array."].join(" "));var n=a.modeBarButtons,o;Array.isArray(n)&&n.length?o=W$(n):!a.displayModeBar&&a.watermark?o=[]:o=j$(e),i?i.update(e,o):r._modeBar=F$(e,o)};function j$(t){var e=t._fullLayout,r=t._fullData,a=t._context;function i(P,k){if(typeof k=="string"){if(k.toLowerCase()===P.toLowerCase())return!0}else{var C=k.name,$=k._cat||k.name;if(C===P||$===P.toLowerCase())return!0}return!1}var n=e.modebar.add;typeof n=="string"&&(n=[n]);var o=e.modebar.remove;typeof o=="string"&&(o=[o]);var l=a.modeBarButtonsToAdd.concat(n.filter(function(P){for(var k=0;k<a.modeBarButtonsToRemove.length;k++)if(i(P,a.modeBarButtonsToRemove[k]))return!1;return!0})),s=a.modeBarButtonsToRemove.concat(o.filter(function(P){for(var k=0;k<a.modeBarButtonsToAdd.length;k++)if(i(P,a.modeBarButtonsToAdd[k]))return!1;return!0})),f=e._has("cartesian"),c=e._has("gl3d"),u=e._has("geo"),v=e._has("pie"),p=e._has("funnelarea"),d=e._has("ternary"),h=e._has("mapbox"),m=e._has("map"),y=e._has("polar"),b=e._has("smith"),_=e._has("sankey"),g=B$(e),x=I$(e.hovermode),w=[];function T(P){if(P.length){for(var k=[],C=0;C<P.length;C++){for(var $=P[C],R=mc[$],j=R.name.toLowerCase(),G=(R._cat||R.name).toLowerCase(),Y=!1,O=0;O<s.length;O++){var K=s[O].toLowerCase();if(K===j||K===G){Y=!0;break}}Y||k.push(mc[$])}w.push(k)}}var A=["toImage"];a.showEditInChartStudio?A.push("editInChartStudio"):a.showSendToCloud&&A.push("sendDataToCloud"),T(A);var M=[],S=[],L=[],E=[];(f||v||p||d)+u+c+h+m+y+b>1?(S=["toggleHover"],L=["resetViews"]):u?(M=["zoomInGeo","zoomOutGeo"],S=["hoverClosestGeo"],L=["resetGeo"]):c?(S=["hoverClosest3d"],L=["resetCameraDefault3d","resetCameraLastSave3d"]):h?(M=["zoomInMapbox","zoomOutMapbox"],S=["toggleHover"],L=["resetViewMapbox"]):m?(M=["zoomInMap","zoomOutMap"],S=["toggleHover"],L=["resetViewMap"]):v?S=["hoverClosestPie"]:_?(S=["hoverClosestCartesian","hoverCompareCartesian"],L=["resetViewSankey"]):S=["toggleHover"],f&&S.push("toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"),(U$(r)||x)&&(S=[]),f&&!g&&(M=["zoomIn2d","zoomOut2d","autoScale2d"],L[0]!=="resetViews"&&(L=["resetScale2d"])),c?E=["zoom3d","pan3d","orbitRotation","tableRotation"]:f&&!g||d?E=["zoom2d","pan2d"]:h||m||u?E=["pan2d"]:y&&(E=["zoom2d"]),G$(r)&&E.push("select2d","lasso2d");var F=[],N=function(P){F.indexOf(P)===-1&&S.indexOf(P)!==-1&&F.push(P)};if(Array.isArray(l)){for(var z=[],H=0;H<l.length;H++){var D=l[H];typeof D=="string"?(D=D.toLowerCase(),N$.indexOf(D)!==-1?(e._has("mapbox")||e._has("map")||e._has("cartesian"))&&E.push(D):D==="togglespikelines"?N("toggleSpikelines"):D==="togglehover"?N("toggleHover"):D==="hovercompare"?N("hoverCompareCartesian"):D==="hoverclosest"?(N("hoverClosestCartesian"),N("hoverClosestGeo"),N("hoverClosest3d"),N("hoverClosestPie")):D==="v1hovermode"&&(N("hoverClosestCartesian"),N("hoverCompareCartesian"),N("hoverClosestGeo"),N("hoverClosest3d"),N("hoverClosestPie"))):z.push(D)}l=z}return T(E),T(M.concat(L)),T(F),V$(w,l)}function B$(t){for(var e=R$.list({_fullLayout:t},null,!0),r=0;r<e.length;r++)if(!e[r].fixedrange)return!1;return!0}function G$(t){for(var e=!1,r=0;r<t.length&&!e;r++){var a=t[r];!a._module||!a._module.selectPoints||(lh.traceIs(a,"scatter-like")?(Xg.hasMarkers(a)||Xg.hasText(a))&&(e=!0):lh.traceIs(a,"box-violin")?(a.boxpoints==="all"||a.points==="all")&&(e=!0):e=!0)}return e}function U$(t){for(var e=0;e<t.length;e++)if(!lh.traceIs(t[e],"noHover"))return!1;return!0}function V$(t,e){if(e.length)if(Array.isArray(e[0]))for(var r=0;r<e.length;r++)t.push(e[r]);else t.push(e);return t}function W$(t){for(var e=H$([],t),r=0;r<e.length;r++)for(var a=e[r],i=0;i<a.length;i++){var n=a[i];if(typeof n=="string")if(mc[n]!==void 0)e[r][i]=mc[n];else throw new Error(["*modeBarButtons* configuration options","invalid button name"].join(" "))}return e}var e2={moduleType:"component",name:"modebar",layoutAttributes:KT,supplyLayoutDefaults:L$,manage:O$},pi={},X$=Vr.FROM_BL,t2=function(e,r,a){a===void 0&&(a=X$[e.constraintoward||"center"]);var i=[e.r2l(e.range[0]),e.r2l(e.range[1])],n=i[0]+(i[1]-i[0])*a;e.range=e._input.range=[e.l2r(n+(i[0]-n)*r),e.l2r(n+(i[1]-n)*r)],e.setScale()},ln=we,mv=bs,$a=cr.id2name,Y$=ti,Yg=t2,q$=cp,Z$=fr.ALMOST_EQUAL,K$=Vr.FROM_BL;pi.handleDefaults=function(t,e,r){var a=r.axIds,i=r.axHasImage,n=e._axisConstraintGroups=[],o=e._axisMatchGroups=[],l,s,f,c,u,v,p,d;for(l=0;l<a.length;l++)c=$a(a[l]),u=t[c],v=e[c],Q$(u,v,{axIds:a,layoutOut:e,hasImage:i[c]});function h(A,M){for(l=0;l<A.length;l++){s=A[l];for(f in s)e[$a(f)][M]=s}}for(h(o,"_matchGroup"),l=0;l<n.length;l++){s=n[l];for(f in s)if(v=e[$a(f)],v.fixedrange){for(var m in s){var y=$a(m);(t[y]||{}).fixedrange===!1&&ln.warn("fixedrange was specified as false for axis "+y+" but was overridden because another axis in its constraint group has fixedrange true"),e[y].fixedrange=!0}break}}for(l=0;l<n.length;){s=n[l];for(f in s){v=e[$a(f)],v._matchGroup&&Object.keys(v._matchGroup).length===Object.keys(s).length&&(n.splice(l,1),l--);break}l++}h(n,"_constraintGroup");var b=["constrain","range","autorange","rangemode","rangebreaks","categoryorder","categoryarray"],_=!1,g=!1;function x(){d=v[p],p==="rangebreaks"&&(g=v._hasDayOfWeekBreaks)}for(l=0;l<o.length;l++){s=o[l];for(var w=0;w<b.length;w++){p=b[w],d=null;var T;for(f in s)if(c=$a(f),u=t[c],v=e[c],p in v){if(!v.matches&&(T=v,p in u)){x();break}d===null&&p in u&&x()}if(p==="range"&&d&&u.range&&u.range.length===2&&u.range[0]!==null&&u.range[1]!==null&&(_=!0),p==="autorange"&&d===null&&_&&(d=!1),d===null&&p in T&&(d=T[p]),d!==null)for(f in s)v=e[$a(f)],v[p]=p==="range"?d.slice():d,p==="rangebreaks"&&(v._hasDayOfWeekBreaks=g,q$(v,e))}}};function Q$(t,e,r){var a=r.axIds,i=r.layoutOut,n=r.hasImage,o=i._axisConstraintGroups,l=i._axisMatchGroups,s=e._id,f=s.charAt(0),c=((i._splomAxes||{})[f]||{})[s]||{},u=e._id,v=u.charAt(0)==="x";e._matchGroup=null,e._constraintGroup=null;function p(E,F){return ln.coerce(t,e,Y$,E,F)}p("constrain",n?"domain":"range"),ln.coerce(t,e,{constraintoward:{valType:"enumerated",values:v?["left","center","right"]:["bottom","middle","top"],dflt:v?"center":"middle"}},"constraintoward");var d=e.type,h,m,y=[];for(h=0;h<a.length;h++)if(m=a[h],m!==u){var b=i[$a(m)];b.type===d&&y.push(m)}var _=r2(o,u);if(_){var g=[];for(h=0;h<y.length;h++)m=y[h],_[m]||g.push(m);y=g}var x=y.length,w,T;x&&(t.matches||c.matches)&&(w=ln.coerce(t,e,{matches:{valType:"enumerated",values:y,dflt:y.indexOf(c.matches)!==-1?c.matches:void 0}},"matches"));var A=n&&!v?e.anchor:void 0;if(x&&!w&&(t.scaleanchor||A)&&(T=ln.coerce(t,e,{scaleanchor:{valType:"enumerated",values:y.concat([!1])}},"scaleanchor",A)),w){e._matchGroup=yv(l,u,w,1);var M=i[$a(w)],S=qg(i,e)/qg(i,M);v!==(w.charAt(0)==="x")&&(S=(v?"x":"y")+S),yv(o,u,w,S)}else t.matches&&a.indexOf(t.matches)!==-1&&ln.warn("ignored "+e._name+'.matches: "'+t.matches+'" to avoid an infinite loop');if(T){var L=p("scaleratio");L||(L=e.scaleratio=1),yv(o,u,T,L)}else t.scaleanchor&&a.indexOf(t.scaleanchor)!==-1&&ln.warn("ignored "+e._name+'.scaleanchor: "'+t.scaleanchor+'" to avoid either an infinite loop and possibly inconsistent scaleratios, or because this axis declares a *matches* constraint.')}function qg(t,e){var r=e.domain;return r||(r=t[$a(e.overlaying)].domain),r[1]-r[0]}function r2(t,e){for(var r=0;r<t.length;r++)if(t[r][e])return t[r];return null}function yv(t,e,r,a){var i,n,o,l,s,f=r2(t,e);f===null?(f={},f[e]=1,s=t.length,t.push(f)):s=t.indexOf(f);var c=Object.keys(f);for(i=0;i<t.length;i++)if(o=t[i],i!==s&&o[r]){var u=o[r];for(n=0;n<c.length;n++)l=c[n],o[l]=gv(u,gv(a,f[l]));t.splice(s,1);return}if(a!==1)for(n=0;n<c.length;n++){var v=c[n];f[v]=gv(a,f[v])}f[r]=1}function gv(t,e){var r="",a="",i,n;typeof t=="string"&&(r=t.match(/^[xy]*/)[0],i=r.length,t=+t.substr(i)),typeof e=="string"&&(a=e.match(/^[xy]*/)[0],n=a.length,e=+e.substr(n));var o=t*e;return!i&&!n?o:!i||!n||r.charAt(0)===a.charAt(0)?r+a+t*e:i===n?o:(i>n?r.substr(n):a.substr(i))+o}function J$(t,e){for(var r=e._size,a=r.h/r.w,i={},n=Object.keys(t),o=0;o<n.length;o++){var l=n[o],s=t[l];if(typeof s=="string"){var f=s.match(/^[xy]*/)[0],c=f.length;s=+s.substr(c);for(var u=f.charAt(0)==="y"?a:1/a,v=0;v<c;v++)s*=u}i[l]=s}return i}pi.enforce=function(e){var r=e._fullLayout,a=r._axisConstraintGroups||[],i,n,o,l,s,f,c,u;for(i=0;i<a.length;i++){o=J$(a[i],r);var v=Object.keys(o),p=1/0,d=0,h=1/0,m={},y={},b=!1;for(n=0;n<v.length;n++)l=v[n],y[l]=s=r[$a(l)],s._inputDomain?s.domain=s._inputDomain.slice():s._inputDomain=s.domain.slice(),s._inputRange||(s._inputRange=s.range.slice()),s.setScale(),m[l]=f=Math.abs(s._m)/o[l],p=Math.min(p,f),(s.constrain==="domain"||!s._constraintShrinkable)&&(h=Math.min(h,f)),delete s._constraintShrinkable,d=Math.max(d,f),s.constrain==="domain"&&(b=!0);if(!(p>Z$*d&&!b)){for(n=0;n<v.length;n++)if(l=v[n],f=m[l],s=y[l],c=s.constrain,f!==h||c==="domain")if(u=f/h,c==="range")Yg(s,u);else{var _=s._inputDomain,g=(s.domain[1]-s.domain[0])/(_[1]-_[0]),x=(s.r2l(s.range[1])-s.r2l(s.range[0]))/(s.r2l(s._inputRange[1])-s.r2l(s._inputRange[0]));if(u/=g,u*x<1){s.domain=s._input.domain=_.slice(),Yg(s,u);continue}if(x<1&&(s.range=s._input.range=s._inputRange.slice(),u*=x),s.autorange){var w=s.r2l(s.range[0]),T=s.r2l(s.range[1]),A=(w+T)/2,M=A,S=A,L=Math.abs(T-A),E=A-L*u*1.0001,F=A+L*u*1.0001,N=mv.makePadFn(r,s,0),z=mv.makePadFn(r,s,1);Zg(s,u);var H=Math.abs(s._m),D=mv.concatExtremes(e,s),P=D.min,k=D.max,C,$;for($=0;$<P.length;$++)C=P[$].val-N(P[$])/H,C>E&&C<M&&(M=C);for($=0;$<k.length;$++)C=k[$].val+z(k[$])/H,C<F&&C>S&&(S=C);var R=(S-M)/(2*L);u/=R,M=s.l2r(M),S=s.l2r(S),s.range=s._input.range=w<T?[M,S]:[S,M]}Zg(s,u)}}}};pi.getAxisGroup=function(e,r){for(var a=e._axisMatchGroups,i=0;i<a.length;i++){var n=a[i];if(n[r])return"g"+i}return r};pi.clean=function(e,r){if(r._inputDomain){for(var a=!1,i=r._id,n=e._fullLayout._axisConstraintGroups,o=0;o<n.length;o++)if(n[o][i]){a=!0;break}(!a||r.constrain!=="domain")&&(r._input.domain=r.domain=r._inputDomain,delete r._inputDomain)}};function Zg(t,e){var r=t._inputDomain,a=K$[t.constraintoward],i=r[0]+(r[1]-r[0])*a;t.domain=t._input.domain=[i+(r[0]-i)/e,i+(r[1]-i)/e],t.setScale()}(function(t){var e=bt,r=ot,a=hr,i=we,n=Tr,o=_p,l=yt,s=Et,f=Jc,c=e2,u=Ot,v=Vr,p=pi,d=p.enforce,h=p.clean,m=bs.doAutoRange,y="start",b="middle",_="end",g=Rr.zindexSeparator;t.layoutStyles=function(k){return i.syncOrAsync([a.doAutoMargin,w],k)};function x(k,C,$){for(var R=0;R<$.length;R++){var j=$[R][0],G=$[R][1];if(!(j[0]>=k[1]||j[1]<=k[0])&&G[0]<C[1]&&G[1]>C[0])return!0}return!1}function w(k){var C=k._fullLayout,$=C._size,R=$.p,j=u.list(k,"",!0),G,Y,O,K,W,X;if(C._paperdiv.style({width:k._context.responsive&&C.autosize&&!k._context._hasZeroWidth&&!k.layout.width?"100%":C.width+"px",height:k._context.responsive&&C.autosize&&!k._context._hasZeroHeight&&!k.layout.height?"100%":C.height+"px"}).selectAll(".main-svg").call(s.setSize,C.width,C.height),k._context.setBackground(k,C.paper_bgcolor),t.drawMainTitle(k),c.manage(k),!C._has("cartesian"))return a.previousPromises(k);function B(Ue,I,U){var V=Ue._lw/2;if(Ue._id.charAt(0)==="x"){if(I){if(U==="top")return I._offset-R-V}else return $.t+$.h*(1-(Ue.position||0))+V%1;return I._offset+I._length+R+V}if(I){if(U==="right")return I._offset+I._length+R+V}else return $.l+$.w*(Ue.position||0)+V%1;return I._offset-R-V}for(G=0;G<j.length;G++){K=j[G];var ee=K._anchorAxis;K._linepositions={},K._lw=s.crispRound(k,K.linewidth,1),K._mainLinePosition=B(K,ee,K.side),K._mainMirrorPosition=K.mirror&&ee?B(K,ee,v.OPPOSITE_SIDE[K.side]):null}var ae=[],de=[],fe=[],q=l.opacity(C.paper_bgcolor)===1&&l.opacity(C.plot_bgcolor)===1&&C.paper_bgcolor===C.plot_bgcolor;for(Y in C._plots)if(O=C._plots[Y],O.mainplot)O.bg&&O.bg.remove(),O.bg=void 0;else{var te=O.xaxis.domain,le=O.yaxis.domain,ce=O.plotgroup;if(x(te,le,fe)&&Y.indexOf(g)===-1){var ye=ce.node(),ue=O.bg=i.ensureSingle(ce,"rect","bg");ye.insertBefore(ue.node(),ye.childNodes[0]),de.push(Y)}else ce.select("rect.bg").remove(),fe.push([te,le]),q||(ae.push(Y),de.push(Y))}var oe=C._bgLayer.selectAll(".bg").data(ae);for(oe.enter().append("rect").classed("bg",!0),oe.exit().remove(),oe.each(function(Ue){C._plots[Ue].bg=e.select(this)}),G=0;G<de.length;G++)O=C._plots[de[G]],W=O.xaxis,X=O.yaxis,O.bg&&W._offset!==void 0&&X._offset!==void 0&&O.bg.call(s.setRect,W._offset-R,X._offset-R,W._length+2*R,X._length+2*R).call(l.fill,C.plot_bgcolor).style("stroke-width",0);if(!C._hasOnlyLargeSploms)for(Y in C._plots){O=C._plots[Y],W=O.xaxis,X=O.yaxis;var pe=O.clipId="clip"+C._uid+Y+"plot",Me=i.ensureSingleById(C._clips,"clipPath",pe,function(Ue){Ue.classed("plotclip",!0).append("rect")});O.clipRect=Me.select("rect").attr({width:W._length,height:X._length}),s.setTranslate(O.plot,W._offset,X._offset);var ve,ke;O._hasClipOnAxisFalse?(ve=null,ke=pe):(ve=pe,ke=null),s.setClipUrl(O.plot,ve,k),O.layerClipId=ke}var _e,J,be,Z,me,ge,Pe,Ee,Le,Ae,Oe,$e,ze;function je(Ue){return"M"+_e+","+Ue+"H"+J}function at(Ue){return"M"+W._offset+","+Ue+"h"+W._length}function xe(Ue){return"M"+Ue+","+Ee+"V"+Pe}function We(Ue){return X._shift!==void 0&&(Ue+=X._shift),"M"+Ue+","+X._offset+"v"+X._length}function Xe(Ue,I,U){if(!Ue.showline||Y!==Ue._mainSubplot)return"";if(!Ue._anchorAxis)return U(Ue._mainLinePosition);var V=I(Ue._mainLinePosition);return Ue.mirror&&(V+=I(Ue._mainMirrorPosition)),V}for(Y in C._plots){O=C._plots[Y],W=O.xaxis,X=O.yaxis;var Re="M0,0";T(W,Y)&&(me=M(W,"left",X,j),_e=W._offset-(me?R+me:0),ge=M(W,"right",X,j),J=W._offset+W._length+(ge?R+ge:0),be=B(W,X,"bottom"),Z=B(W,X,"top"),ze=!W._anchorAxis||Y!==W._mainSubplot,ze&&(W.mirror==="allticks"||W.mirror==="all")&&(W._linepositions[Y]=[be,Z]),Re=Xe(W,je,at),ze&&W.showline&&(W.mirror==="all"||W.mirror==="allticks")&&(Re+=je(be)+je(Z)),O.xlines.style("stroke-width",W._lw+"px").call(l.stroke,W.showline?W.linecolor:"rgba(0,0,0,0)")),O.xlines.attr("d",Re);var et="M0,0";T(X,Y)&&(Oe=M(X,"bottom",W,j),Pe=X._offset+X._length+(Oe?R:0),$e=M(X,"top",W,j),Ee=X._offset-($e?R:0),Le=B(X,W,"left"),Ae=B(X,W,"right"),ze=!X._anchorAxis||Y!==X._mainSubplot,ze&&(X.mirror==="allticks"||X.mirror==="all")&&(X._linepositions[Y]=[Le,Ae]),et=Xe(X,xe,We),ze&&X.showline&&(X.mirror==="all"||X.mirror==="allticks")&&(et+=xe(Le)+xe(Ae)),O.ylines.style("stroke-width",X._lw+"px").call(l.stroke,X.showline?X.linecolor:"rgba(0,0,0,0)")),O.ylines.attr("d",et)}return u.makeClipPaths(k),a.previousPromises(k)}function T(k,C){return(k.ticks||k.showline)&&(C===k._mainSubplot||k.mirror==="all"||k.mirror==="allticks")}function A(k,C,$){if(!$.showline||!$._lw)return!1;if($.mirror==="all"||$.mirror==="allticks")return!0;var R=$._anchorAxis;if(!R)return!1;var j=v.FROM_BL[C];return $.side===C?R.domain[j]===k.domain[j]:$.mirror&&R.domain[1-j]===k.domain[1-j]}function M(k,C,$,R){if(A(k,C,$))return $._lw;for(var j=0;j<R.length;j++){var G=R[j];if(G._mainAxis===$._mainAxis&&A(k,C,G))return G._lw}return 0}t.drawMainTitle=function(k){var C=k._fullLayout.title,$=k._fullLayout,R=D($),j=P($),G=z($,j),Y=N($,R);if(f.draw(k,"gtitle",{propContainer:$,propName:"title.text",subtitlePropName:"title.subtitle.text",placeholder:$._dfltTitle.plot,subtitlePlaceholder:$._dfltTitle.subtitle,attributes:{x:Y,y:G,"text-anchor":R,dy:j}}),C.text&&C.automargin){var O=e.selectAll(".gtitle"),K=s.bBox(e.selectAll(".g-gtitle").node()).height,W=E(k,C,K);if(W>0){F(k,G,W,K),O.attr({x:Y,y:G,"text-anchor":R,dy:H(C.yanchor)}).call(n.positionText,Y,G);var X=(C.text.match(n.BR_TAG_ALL)||[]).length;if(X){var B=v.LINE_SPACING*X+v.MID_SHIFT;C.y===0&&(B=-B),O.selectAll(".line").each(function(){var q=+this.getAttribute("dy").slice(0,-2)-B+"em";this.setAttribute("dy",q)})}var ee=e.selectAll(".gtitle-subtitle");if(ee.node()){var ae=O.node().getBBox(),de=ae.y+ae.height,fe=de+f.SUBTITLE_PADDING_EM*C.subtitle.font.size;ee.attr({x:Y,y:fe,"text-anchor":R,dy:H(C.yanchor)}).call(n.positionText,Y,fe)}}}};function S(k,C,$,R,j){var G=C.yref==="paper"?k._fullLayout._size.h:k._fullLayout.height,Y=i.isTopAnchor(C)?R:R-j,O=$==="b"?G-Y:Y;return i.isTopAnchor(C)&&$==="t"||i.isBottomAnchor(C)&&$==="b"?!1:O<j}function L(k,C,$,R,j){var G=0;return $==="middle"&&(G+=j/2),k==="t"?($==="top"&&(G+=j),G+=R-C*R):($==="bottom"&&(G+=j),G+=C*R),G}function E(k,C,$){var R=C.y,j=C.yanchor,G=R>.5?"t":"b",Y=k._fullLayout.margin[G],O=0;return C.yref==="paper"?O=$+C.pad.t+C.pad.b:C.yref==="container"&&(O=L(G,R,j,k._fullLayout.height,$)+C.pad.t+C.pad.b),O>Y?O:0}function F(k,C,$,R){var j="title.automargin",G=k._fullLayout.title,Y=G.y>.5?"t":"b",O={x:G.x,y:G.y,t:0,b:0},K={};G.yref==="paper"&&S(k,G,Y,C,R)?O[Y]=$:G.yref==="container"&&(K[Y]=$,k._fullLayout._reservedMargin[j]=K),a.allowAutoMargin(k,j),a.autoMargin(k,j,O)}function N(k,C){var $=k.title,R=k._size,j=0;switch(C===y?j=$.pad.l:C===_&&(j=-$.pad.r),$.xref){case"paper":return R.l+R.w*$.x+j;case"container":default:return k.width*$.x+j}}function z(k,C){var $=k.title,R=k._size,j=0;if(C==="0em"||!C?j=-$.pad.b:C===v.CAP_SHIFT+"em"&&(j=$.pad.t),$.y==="auto")return R.t/2;switch($.yref){case"paper":return R.t+R.h-R.h*$.y+j;case"container":default:return k.height-k.height*$.y+j}}function H(k){return k==="top"?v.CAP_SHIFT+.3+"em":k==="bottom"?"-0.3em":v.MID_SHIFT+"em"}function D(k){var C=k.title,$=b;return i.isRightAnchor(C)?$=_:i.isLeftAnchor(C)&&($=y),$}function P(k){var C=k.title,$="0em";return i.isTopAnchor(C)?$=v.CAP_SHIFT+"em":i.isMiddleAnchor(C)&&($=v.MID_SHIFT+"em"),$}t.doTraceStyle=function(k){var C=k.calcdata,$=[],R;for(R=0;R<C.length;R++){var j=C[R],G=j[0]||{},Y=G.trace||{},O=Y._module||{},K=O.arraysToCalcdata;K&&K(j,Y);var W=O.editStyle;W&&$.push({fn:W,cd0:G})}if($.length){for(R=0;R<$.length;R++){var X=$[R];X.fn(k,X.cd0)}o(k),t.redrawReglTraces(k)}return a.style(k),r.getComponentMethod("legend","draw")(k),a.previousPromises(k)},t.doColorBars=function(k){return r.getComponentMethod("colorbar","draw")(k),a.previousPromises(k)},t.layoutReplot=function(k){var C=k.layout;return k.layout=void 0,r.call("_doPlot",k,"",C)},t.doLegend=function(k){return r.getComponentMethod("legend","draw")(k),a.previousPromises(k)},t.doTicksRelayout=function(k){return u.draw(k,"redraw"),k._fullLayout._hasOnlyLargeSploms&&(r.subplotsRegistry.splom.updateGrid(k),o(k),t.redrawReglTraces(k)),t.drawMainTitle(k),a.previousPromises(k)},t.doModeBar=function(k){var C=k._fullLayout;c.manage(k);for(var $=0;$<C._basePlotModules.length;$++){var R=C._basePlotModules[$].updateFx;R&&R(k)}return a.previousPromises(k)},t.doCamera=function(k){for(var C=k._fullLayout,$=C._subplots.gl3d,R=0;R<$.length;R++){var j=C[$[R]],G=j._scene;G.setViewport(j)}},t.drawData=function(k){var C=k._fullLayout;o(k);for(var $=C._basePlotModules,R=0;R<$.length;R++)$[R].plot(k);return t.redrawReglTraces(k),a.style(k),r.getComponentMethod("selections","draw")(k),r.getComponentMethod("shapes","draw")(k),r.getComponentMethod("annotations","draw")(k),r.getComponentMethod("images","draw")(k),C._replotting=!1,a.previousPromises(k)},t.redrawReglTraces=function(k){var C=k._fullLayout;if(C._has("regl")){var $=k._fullData,R=[],j=[],G,Y;for(C._hasOnlyLargeSploms&&C._splomGrid.draw(),G=0;G<$.length;G++){var O=$[G];O.visible===!0&&O._length!==0&&(O.type==="splom"?C._splomScenes[O.uid].draw():O.type==="scattergl"?i.pushUnique(R,O.xaxis+O.yaxis):O.type==="scatterpolargl"&&i.pushUnique(j,O.subplot))}for(G=0;G<R.length;G++)Y=C._plots[R[G]],Y._scene&&Y._scene.draw();for(G=0;G<j.length;G++)Y=C[j[G]]._subplot,Y._scene&&Y._scene.draw()}},t.doAutoRangeAndConstraints=function(k){for(var C=u.list(k,"",!0),$,R={},j=0;j<C.length;j++)if($=C[j],!R[$._id]){R[$._id]=1,h(k,$),m(k,$);var G=$._matchGroup;if(G)for(var Y in G){var O=u.getFromId(k,Y);m(k,O,$.range),R[Y]=1}}d(k)},t.finalDraw=function(k){r.getComponentMethod("rangeslider","draw")(k),r.getComponentMethod("rangeselector","draw")(k)},t.drawMarginPushers=function(k){r.getComponentMethod("legend","draw")(k),r.getComponentMethod("rangeselector","draw")(k),r.getComponentMethod("sliders","draw")(k),r.getComponentMethod("updatemenus","draw")(k),r.getComponentMethod("colorbar","draw")(k)}})(ou);var eE=Gi.readPaths,tE=Lp,a2=zn.clearOutlineControllers,bv=yt,i2=Et,rE=Ht.arrayEditor,n2=Ui,aE=n2.getPathString,o2={draw:du,drawOne:l2,activateLastSelection:oE};function du(t){var e=t._fullLayout;a2(t),e._selectionLayer.selectAll("path").remove();for(var r in e._plots){var a=e._plots[r].selectionLayer;a&&a.selectAll("path").remove()}for(var i=0;i<e.selections.length;i++)l2(t,i)}function hu(t){return t._context.editSelection}function l2(t,e){t._fullLayout._paperdiv.selectAll('.selectionlayer [data-index="'+e+'"]').remove();var r=n2.makeSelectionsOptionsAndPlotinfo(t,e),a=r.options,i=r.plotinfo;if(!a._input)return;n(t._fullLayout._selectionLayer);function n(o){var l=aE(t,a),s={"data-index":e,"fill-rule":"evenodd",d:l},f=a.opacity,c="rgba(0,0,0,0)",u=a.line.color||bv.contrast(t._fullLayout.plot_bgcolor),v=a.line.width,p=a.line.dash;v||(v=5,p="solid");var d=hu(t)&&t._fullLayout._activeSelectionIndex===e;d&&(c=t._fullLayout.activeselection.fillcolor,f=t._fullLayout.activeselection.opacity);for(var h=[],m=1;m>=0;m--){var y=o.append("path").attr(s).style("opacity",m?.1:f).call(bv.stroke,u).call(bv.fill,c).call(i2.dashLine,m?"solid":p,m?4+v:v);if(iE(y,t,a),d){var b=rE(t.layout,"selections",a);y.style({cursor:"move"});var _={element:y.node(),plotinfo:i,gd:t,editHelpers:b,isActiveSelection:!0},g=eE(l,t);tE(g,y,_)}else y.style("pointer-events",m?"all":"none");h[m]=y}var x=h[0],w=h[1];w.node().addEventListener("click",function(){return nE(t,x)})}}function iE(t,e,r){var a=r.xref+r.yref;i2.setClipUrl(t,"clip"+e._fullLayout._uid+a,e)}function nE(t,e){if(hu(t)){var r=e.node(),a=+r.getAttribute("data-index");if(a>=0){if(a===t._fullLayout._activeSelectionIndex){sh(t);return}t._fullLayout._activeSelectionIndex=a,t._fullLayout._deactivateSelection=sh,du(t)}}}function oE(t){if(hu(t)){var e=t._fullLayout.selections.length-1;t._fullLayout._activeSelectionIndex=e,t._fullLayout._deactivateSelection=sh,du(t)}}function sh(t){if(hu(t)){var e=t._fullLayout._activeSelectionIndex;e>=0&&(a2(t),delete t._fullLayout._activeSelectionIndex,du(t))}}var s2={exports:{}},xv=jc.dot,tf=fr.BADNUM,yc=s2.exports={};yc.tester=function(e){var r=e.slice(),a=r[0][0],i=a,n=r[0][1],o=n,l;for((r[r.length-1][0]!==r[0][0]||r[r.length-1][1]!==r[0][1])&&r.push(r[0]),l=1;l<r.length;l++)a=Math.min(a,r[l][0]),i=Math.max(i,r[l][0]),n=Math.min(n,r[l][1]),o=Math.max(o,r[l][1]);var s=!1,f;r.length===5&&(r[0][0]===r[1][0]?r[2][0]===r[3][0]&&r[0][1]===r[3][1]&&r[1][1]===r[2][1]&&(s=!0,f=function(d){return d[0]===r[0][0]}):r[0][1]===r[1][1]&&r[2][1]===r[3][1]&&r[0][0]===r[3][0]&&r[1][0]===r[2][0]&&(s=!0,f=function(d){return d[1]===r[0][1]}));function c(d,h){var m=d[0],y=d[1];return!(m===tf||m<a||m>i||y===tf||y<n||y>o||h&&f(d))}function u(d,h){var m=d[0],y=d[1];if(m===tf||m<a||m>i||y===tf||y<n||y>o)return!1;var b=r.length,_=r[0][0],g=r[0][1],x=0,w,T,A,M,S;for(w=1;w<b;w++)if(T=_,A=g,_=r[w][0],g=r[w][1],M=Math.min(T,_),!(m<M||m>Math.max(T,_)||y>Math.max(A,g)))if(y<Math.min(A,g))m!==M&&x++;else{if(_===T?S=y:S=A+(m-T)*(g-A)/(_-T),y===S)return!(w===1&&h);y<=S&&m!==M&&x++}return x%2===1}var v=!0,p=r[0];for(l=1;l<r.length;l++)if(p[0]!==r[l][0]||p[1]!==r[l][1]){v=!1;break}return{xmin:a,xmax:i,ymin:n,ymax:o,pts:r,contains:s?c:u,isRect:s,degenerate:v}};yc.isSegmentBent=function(e,r,a,i){var n=e[r],o=[e[a][0]-n[0],e[a][1]-n[1]],l=xv(o,o),s=Math.sqrt(l),f=[-o[1]/s,o[0]/s],c,u,v;for(c=r+1;c<a;c++)if(u=[e[c][0]-n[0],e[c][1]-n[1]],v=xv(u,o),v<0||v>l||Math.abs(xv(u,f))>i)return!0;return!1};yc.filter=function(e,r){var a=[e[0]],i=0,n=0;function o(s){e.push(s);var f=a.length,c=i;a.splice(n+1);for(var u=c+1;u<e.length;u++)(u===e.length-1||yc.isSegmentBent(e,c,u+1,r))&&(a.push(e[u]),a.length<f-2&&(i=u,n=a.length-1),c=u)}if(e.length>1){var l=e.pop();o(l)}return{addPt:o,raw:e,filtered:a}};var f2=s2.exports,lE={BENDPX:1.5,MINSELECT:12,SELECTDELAY:100,SELECTID:"-select"},Kg=DM,sE=PM,Ql=ot,fE=Et.dashStyle,ul=yt,cE=Na,uE=Ta.makeEventData,xs=Fn,vE=xs.freeMode,dE=xs.rectMode,Jl=xs.drawMode,Rp=xs.openMode,Ip=xs.selectMode,Qg=Ui,Jg=su,c2=Lp,u2=zn.clearOutline,v2=Gi,_v=v2.handleEllipse,hE=v2.readPaths,pE=Ap.newShapes,mE=LT,yE=o2.activateLastSelection,Of=we,gE=Of.sorterAsc,d2=f2,vl=Xc,ya=cr.getFromId,bE=_p,xE=ou.redrawReglTraces,jf=lE,Wa=jf.MINSELECT,_E=d2.filter,Fp=d2.tester,Np=kp,e0=Np.p2r,wE=Np.axValue,TE=Np.getTransform;function Hp(t){return t.subplot!==void 0}function kE(t,e,r,a,i){var n=!Hp(a),o=vE(i),l=dE(i),s=Rp(i),f=Jl(i),c=Ip(i),u=i==="drawline",v=i==="drawcircle",p=u||v,d=a.gd,h=d._fullLayout,m=c&&h.newselection.mode==="immediate"&&n,y=h._zoomlayer,b=a.element.getBoundingClientRect(),_=a.plotinfo,g=TE(_),x=e-b.left,w=r-b.top;h._calcInverseTransform(d);var T=Of.apply3DTransform(h._invTransform)(x,w);x=T[0],w=T[1];var A=h._invScaleX,M=h._invScaleY,S=x,L=w,E="M"+x+","+w,F=a.xaxes[0],N=a.yaxes[0],z=F._length,H=N._length,D=t.altKey&&!(Jl(i)&&s),P,k,C,$,R,j,G;p2(t,d,a),o&&(P=_E([[x,w]],jf.BENDPX));var Y=y.selectAll("path.select-outline-"+_.id).data([1]),O=f?h.newshape:h.newselection;f&&(a.hasText=O.label.text||O.label.texttemplate);var K=f&&!s?O.fillcolor:"rgba(0,0,0,0)",W=O.line.color||(n?ul.contrast(d._fullLayout.plot_bgcolor):"#7f7f7f");Y.enter().append("path").attr("class","select-outline select-outline-"+_.id).style({opacity:f?O.opacity/2:1,"stroke-dasharray":fE(O.line.dash,O.line.width),"stroke-width":O.line.width+"px","shape-rendering":"crispEdges"}).call(ul.stroke,W).call(ul.fill,K).attr("fill-rule","evenodd").classed("cursor-move",!!f).attr("transform",g).attr("d",E+"Z");var X=y.append("path").attr("class","zoombox-corners").style({fill:ul.background,stroke:ul.defaultLine,"stroke-width":1}).attr("transform",g).attr("d","M0,0Z");if(f&&a.hasText){var B=y.select(".label-temp");B.empty()&&(B=y.append("g").classed("label-temp",!0).classed("select-outline",!0).style({opacity:.8}))}var ee=h._uid+jf.SELECTID,ae=[],de=pu(d,a.xaxes,a.yaxes,a.subplot);m&&!t.shiftKey&&(a._clearSubplotSelections=function(){if(n){var q=F._id,te=N._id;x2(d,q,te,de);for(var le=(d.layout||{}).selections||[],ce=[],ye=!1,ue=0;ue<le.length;ue++){var oe=h.selections[ue];!oe||oe.xref!==q||oe.yref!==te?ce.push(le[ue]):ye=!0}ye&&(d._fullLayout._noEmitSelectedAtStart=!0,Ql.call("_guiRelayout",d,{selections:ce}))}});var fe=NE(a);a.moveFn=function(q,te){a._clearSubplotSelections&&(a._clearSubplotSelections(),a._clearSubplotSelections=void 0),S=Math.max(0,Math.min(z,A*q+x)),L=Math.max(0,Math.min(H,M*te+w));var le=Math.abs(S-x),ce=Math.abs(L-w);if(l){var ye,ue,oe;if(c){var pe=h.selectdirection;switch(pe==="any"?ce<Math.min(le*.6,Wa)?ye="h":le<Math.min(ce*.6,Wa)?ye="v":ye="d":ye=pe,ye){case"h":ue=v?H/2:0,oe=H;break;case"v":ue=v?z/2:0,oe=z;break}}if(f)switch(h.newshape.drawdirection){case"vertical":ye="h",ue=v?H/2:0,oe=H;break;case"horizontal":ye="v",ue=v?z/2:0,oe=z;break;case"ortho":le<ce?(ye="h",ue=w,oe=L):(ye="v",ue=x,oe=S);break;default:ye="d"}ye==="h"?($=p?_v(v,[S,ue],[S,oe]):[[x,ue],[x,oe],[S,oe],[S,ue]],$.xmin=p?S:Math.min(x,S),$.xmax=p?S:Math.max(x,S),$.ymin=Math.min(ue,oe),$.ymax=Math.max(ue,oe),X.attr("d","M"+$.xmin+","+(w-Wa)+"h-4v"+2*Wa+"h4ZM"+($.xmax-1)+","+(w-Wa)+"h4v"+2*Wa+"h-4Z")):ye==="v"?($=p?_v(v,[ue,L],[oe,L]):[[ue,w],[ue,L],[oe,L],[oe,w]],$.xmin=Math.min(ue,oe),$.xmax=Math.max(ue,oe),$.ymin=p?L:Math.min(w,L),$.ymax=p?L:Math.max(w,L),X.attr("d","M"+(x-Wa)+","+$.ymin+"v-4h"+2*Wa+"v4ZM"+(x-Wa)+","+($.ymax-1)+"v4h"+2*Wa+"v-4Z")):ye==="d"&&($=p?_v(v,[x,w],[S,L]):[[x,w],[x,L],[S,L],[S,w]],$.xmin=Math.min(x,S),$.xmax=Math.max(x,S),$.ymin=Math.min(w,L),$.ymax=Math.max(w,L),X.attr("d","M0,0Z"))}else o&&(P.addPt([S,L]),$=P.filtered);if(a.selectionDefs&&a.selectionDefs.length?(C=m2(a.mergedPolygons,$,D),$.subtract=D,k=Op(a.selectionDefs.concat([$]))):(C=[$],k=Fp($)),c2(g2(C,s),Y,a),c){var Me=fh(d,!1),ve=Me.eventData?Me.eventData.points.slice():[];Me=fh(d,!1,k,de,a),k=Me.selectionTesters,G=Me.eventData;var ke;P?ke=P.filtered:ke=_2(C),vl.throttle(ee,jf.SELECTDELAY,function(){ae=b2(k,de);for(var _e=ae.slice(),J=0;J<ve.length;J++){for(var be=ve[J],Z=!1,me=0;me<_e.length;me++)if(_e[me].curveNumber===be.curveNumber&&_e[me].pointNumber===be.pointNumber){Z=!0;break}Z||_e.push(be)}_e.length&&(G||(G={}),G.points=_e),fe(G,ke),HE(d,G)})}},a.clickFn=function(q,te){if(X.remove(),d._fullLayout._activeShapeIndex>=0){d._fullLayout._deactivateShape(d);return}if(!f){var le=h.clickmode;vl.done(ee).then(function(){if(vl.clear(ee),q===2){for(Y.remove(),R=0;R<de.length;R++)j=de[R],j._module.selectPoints(j,!1);if(ts(d,de),es(a),Bp(d),de.length){var ce=de[0].xaxis,ye=de[0].yaxis;if(ce&&ye){for(var ue=[],oe=d._fullLayout.selections,pe=0;pe<oe.length;pe++){var Me=oe[pe];Me&&(Me.xref!==ce._id||Me.yref!==ye._id)&&ue.push(Me)}ue.length<oe.length&&(d._fullLayout._noEmitSelectedAtStart=!0,Ql.call("_guiRelayout",d,{selections:ue}))}}}else le.indexOf("select")>-1&&h2(te,d,a.xaxes,a.yaxes,a.subplot,a,Y),le==="event"&&rs(d,void 0);cE.click(d,te,_.id)}).catch(Of.error)}},a.doneFn=function(){X.remove(),vl.done(ee).then(function(){vl.clear(ee),!m&&$&&a.selectionDefs&&($.subtract=D,a.selectionDefs.push($),a.mergedPolygons.length=0,[].push.apply(a.mergedPolygons,C)),(m||f)&&es(a,m),a.doneFnCompleted&&a.doneFnCompleted(ae),c&&rs(d,G)}).catch(Of.error)}}function h2(t,e,r,a,i,n,o){var l=e._hoverdata,s=e._fullLayout,f=s.clickmode,c=f.indexOf("event")>-1,u=[],v,p,d,h,m,y,b,_,g,x;if(CE(l)){p2(t,e,n),v=pu(e,r,a,i);var w=DE(l,v),T=w.pointNumbers.length>0;if(T?PE(v,w):$E(v)&&(b=r0(w))){for(o&&o.remove(),x=0;x<v.length;x++)p=v[x],p._module.selectPoints(p,!1);ts(e,v),es(n),c&&Bp(e)}else{_=t.shiftKey&&(b!==void 0?b:r0(w)),d=AE(w.pointNumber,w.searchInfo,_);var A=n.selectionDefs.concat([d]);for(h=Op(A),x=0;x<v.length;x++)if(m=v[x]._module.selectPoints(v[x],h),y=y2(m,v[x]),u.length)for(var M=0;M<y.length;M++)u.push(y[M]);else u=y;if(g={points:u},ts(e,v,g),d&&n&&n.selectionDefs.push(d),o){var S=n.mergedPolygons,L=Rp(n.dragmode);c2(g2(S,L),o,n)}c&&rs(e,g)}}}function AE(t,e,r){return{pointNumber:t,searchInfo:e,subtract:!!r}}function wv(t){return"pointNumber"in t&&"searchInfo"in t}function ME(t){return{xmin:0,xmax:0,ymin:0,ymax:0,pts:[],contains:function(e,r,a,i){var n=t.searchInfo.cd[0].trace.index,o=i.cd[0].trace.index;return o===n&&a===t.pointNumber},isRect:!1,degenerate:!1,subtract:!!t.subtract}}function Op(t){if(!t.length)return;for(var e=[],r=wv(t[0])?0:t[0][0][0],a=r,i=wv(t[0])?0:t[0][0][1],n=i,o=0;o<t.length;o++)if(wv(t[o]))e.push(ME(t[o]));else{var l=Fp(t[o]);l.subtract=!!t[o].subtract,e.push(l),r=Math.min(r,l.xmin),a=Math.max(a,l.xmax),i=Math.min(i,l.ymin),n=Math.max(n,l.ymax)}function s(f,c,u,v){for(var p=!1,d=0;d<e.length;d++)e[d].contains(f,c,u,v)&&(p=!e[d].subtract);return p}return{xmin:r,xmax:a,ymin:i,ymax:n,pts:[],contains:s,isRect:!1,degenerate:!1}}function p2(t,e,r){var a=e._fullLayout,i=r.plotinfo,n=r.dragmode,o=a._lastSelectedSubplot&&a._lastSelectedSubplot===i.id,l=(t.shiftKey||t.altKey)&&!(Jl(n)&&Rp(n));o&&l&&i.selection&&i.selection.selectionDefs&&!r.selectionDefs?(r.selectionDefs=i.selection.selectionDefs,r.mergedPolygons=i.selection.mergedPolygons):(!l||!i.selection)&&es(r),o||(u2(e),a._lastSelectedSubplot=i.id)}function SE(t){return t._fullLayout._activeShapeIndex>=0}function LE(t){return t._fullLayout._activeSelectionIndex>=0}function es(t,e){var r=t.dragmode,a=t.plotinfo,i=t.gd;SE(i)&&i._fullLayout._deactivateShape(i),LE(i)&&i._fullLayout._deactivateSelection(i);var n=i._fullLayout,o=n._zoomlayer,l=Jl(r),s=Ip(r);if(l||s){var f=o.selectAll(".select-outline-"+a.id);if(f&&i._fullLayout._outlining){var c;l&&(c=pE(f,t)),c&&Ql.call("_guiRelayout",i,{shapes:c});var u;s&&!Hp(t)&&(u=mE(f,t)),u&&(i._fullLayout._noEmitSelectedAtStart=!0,Ql.call("_guiRelayout",i,{selections:u}).then(function(){e&&yE(i)})),i._fullLayout._outlining=!1}}a.selection={},a.selection.selectionDefs=t.selectionDefs=[],a.selection.mergedPolygons=t.mergedPolygons=[]}function t0(t){return t._id}function pu(t,e,r,a){if(!t.calcdata)return[];var i=[],n=e.map(t0),o=r.map(t0),l,s,f;for(f=0;f<t.calcdata.length;f++)if(l=t.calcdata[f],s=l[0].trace,!(s.visible!==!0||!s._module||!s._module.selectPoints))if(Hp({subplot:a})&&(s.subplot===a||s.geo===a))i.push(rf(s._module,l,e[0],r[0]));else if(s.type==="splom"){if(s._xaxes[n[0]]&&s._yaxes[o[0]]){var c=rf(s._module,l,e[0],r[0]);c.scene=t._fullLayout._splomScenes[s.uid],i.push(c)}}else if(s.type==="sankey"){var u=rf(s._module,l,e[0],r[0]);i.push(u)}else{if(n.indexOf(s.xaxis)===-1&&(!s._xA||!s._xA.overlaying)||o.indexOf(s.yaxis)===-1&&(!s._yA||!s._yA.overlaying))continue;i.push(rf(s._module,l,ya(t,s.xaxis),ya(t,s.yaxis)))}return i}function rf(t,e,r,a){return{_module:t,cd:e,xaxis:r,yaxis:a}}function CE(t){return t&&Array.isArray(t)&&t[0].hoverOnBox!==!0}function DE(t,e){var r=t[0],a=-1,i=[],n,o;for(o=0;o<e.length;o++)if(n=e[o],r.fullData.index===n.cd[0].trace.index){if(r.hoverOnBox===!0)break;r.pointNumber!==void 0?a=r.pointNumber:r.binNumber!==void 0&&(a=r.binNumber,i=r.pointNumbers);break}return{pointNumber:a,pointNumbers:i,searchInfo:n}}function r0(t){var e=t.searchInfo.cd[0].trace,r=t.pointNumber,a=t.pointNumbers,i=a.length>0,n=i?a[0]:r;return e.selectedpoints?e.selectedpoints.indexOf(n)>-1:!1}function PE(t,e){var r=[],a,i,n,o;for(o=0;o<t.length;o++)a=t[o],a.cd[0].trace.selectedpoints&&a.cd[0].trace.selectedpoints.length>0&&r.push(a);if(r.length===1&&(n=r[0]===e.searchInfo,n&&(i=e.searchInfo.cd[0].trace,i.selectedpoints.length===e.pointNumbers.length))){for(o=0;o<e.pointNumbers.length;o++)if(i.selectedpoints.indexOf(e.pointNumbers[o])<0)return!1;return!0}return!1}function $E(t){var e=0,r,a,i;for(i=0;i<t.length;i++)if(r=t[i],a=r.cd[0].trace,a.selectedpoints&&(a.selectedpoints.length>1||(e+=a.selectedpoints.length,e>1)))return!1;return e===1}function ts(t,e,r){var a;for(a=0;a<e.length;a++){var i=e[a].cd[0].trace._fullInput,n=t._fullLayout._tracePreGUI[i.uid]||{};n.selectedpoints===void 0&&(n.selectedpoints=i._input.selectedpoints||null)}var o;if(r){var l=r.points||[];for(a=0;a<e.length;a++)o=e[a].cd[0].trace,o._input.selectedpoints=o._fullInput.selectedpoints=[],o._fullInput!==o&&(o.selectedpoints=[]);for(var s=0;s<l.length;s++){var f=l[s],c=f.data,u=f.fullData,v=f.pointIndex,p=f.pointIndices;p?([].push.apply(c.selectedpoints,p),o._fullInput!==o&&[].push.apply(u.selectedpoints,p)):(c.selectedpoints.push(v),o._fullInput!==o&&u.selectedpoints.push(v))}}else for(a=0;a<e.length;a++)o=e[a].cd[0].trace,delete o.selectedpoints,delete o._input.selectedpoints,o._fullInput!==o&&delete o._fullInput.selectedpoints;EE(t,e)}function EE(t,e){for(var r=!1,a=0;a<e.length;a++){var i=e[a],n=i.cd;Ql.traceIs(n[0].trace,"regl")&&(r=!0);var o=i._module,l=o.styleOnSelect||o.style;l&&(l(t,n,n[0].node3),n[0].nodeRangePlot3&&l(t,n,n[0].nodeRangePlot3))}r&&(bE(t),xE(t))}function m2(t,e,r){for(var a=r?Kg.difference:Kg.union,i=a({regions:t},{regions:[e]}),n=i.regions.reverse(),o=0;o<n.length;o++){var l=n[o];l.subtract=jp(l,n.slice(0,o))}return n}function y2(t,e){if(Array.isArray(t))for(var r=e.cd,a=e.cd[0].trace,i=0;i<t.length;i++)t[i]=uE(t[i],a,r);return t}function g2(t,e){for(var r=[],a=0;a<t.length;a++){r[a]=[];for(var i=0;i<t[a].length;i++){r[a][i]=[],r[a][i][0]=i?"L":"M";for(var n=0;n<t[a][i].length;n++)r[a][i].push(t[a][i][n])}e||r[a].push(["Z",r[a][0][1],r[a][0][2]])}return r}function b2(t,e){for(var r=[],a,i,n=0;n<e.length;n++){var o=e[n];i=o._module.selectPoints(o,t),a=y2(i,o),r=r.concat(a)}return r}function fh(t,e,r,a,i){var n=!!a,o,l,s;i&&(o=i.plotinfo,l=i.xaxes[0]._id,s=i.yaxes[0]._id);var f=[],c=[],u=a0(t),v=t._fullLayout;if(o){var p=v._zoomlayer,d=v.dragmode,h=Jl(d),m=Ip(d);if(h||m){var y=ya(t,l,"x"),b=ya(t,s,"y");if(y&&b){var _=p.selectAll(".select-outline-"+o.id);if(_&&t._fullLayout._outlining&&_.length){for(var g=_[0][0],x=g.getAttribute("d"),w=hE(x,t,o),T=[],A=0;A<w.length;A++){for(var M=w[A],S=[],L=0;L<M.length;L++)S.push([Si(y,M[L][1]),Si(b,M[L][2])]);S.xref=l,S.yref=s,S.subtract=jp(S,T),T.push(S)}u=u.concat(T)}}}}var E=l&&s?[l+s]:v._subplots.cartesian;zE(t);for(var F={},N=0;N<E.length;N++){var z=E[N],H=z.indexOf("y"),D=z.slice(0,H),P=z.slice(H),k=l&&s?r:void 0;if(k=IE(u,D,P,k),k){var C=a;if(!n){var $=ya(t,D,"x"),R=ya(t,P,"y");C=pu(t,[$],[R],z);for(var j=0;j<C.length;j++){var G=C[j],Y=G.cd[0],O=Y.trace;if(G._module.name==="scattergl"&&!Y.t.xpx){var K=O.x,W=O.y,X=O._length;Y.t.xpx=[],Y.t.ypx=[];for(var B=0;B<X;B++)Y.t.xpx[B]=$.c2p(K[B]),Y.t.ypx[B]=R.c2p(W[B])}G._module.name==="splom"&&(F[O.uid]||(F[O.uid]=!0))}}var ee=b2(k,C);f=f.concat(ee),c=c.concat(C)}}var ae={points:f};ts(t,c,ae);var de=v.clickmode,fe=de.indexOf("event")>-1&&e;if(!o&&e){var q=a0(t,!0);if(q.length){var te=q[0].xref,le=q[0].yref;if(te&&le){var ce=_2(q),ye=w2([ya(t,te,"x"),ya(t,le,"y")]);ye(ae,ce)}}t._fullLayout._noEmitSelectedAtStart?t._fullLayout._noEmitSelectedAtStart=!1:fe&&rs(t,ae),v._reselect=!1}if(!o&&v._deselect){var ue=v._deselect;l=ue.xref,s=ue.yref,RE(l,s,c)||x2(t,l,s,a),fe&&(ae.points.length?rs(t,ae):Bp(t)),v._deselect=!1}return{eventData:ae,selectionTesters:r}}function zE(t){var e=t.calcdata;if(e)for(var r=0;r<e.length;r++){var a=e[r][0],i=a.trace,n=t._fullLayout._splomScenes;if(n){var o=n[i.uid];o&&(o.selectBatch=[])}}}function RE(t,e,r){for(var a=0;a<r.length;a++){var i=r[a];if(i.xaxis&&i.xaxis._id===t&&i.yaxis&&i.yaxis._id===e)return!0}return!1}function x2(t,e,r,a){a=pu(t,[ya(t,e,"x")],[ya(t,r,"y")],e+r);for(var i=0;i<a.length;i++){var n=a[i];n._module.selectPoints(n,!1)}ts(t,a)}function IE(t,e,r,a){for(var i,n=0;n<t.length;n++){var o=t[n];if(!(e!==o.xref||r!==o.yref))if(i){var l=!!o.subtract;i=m2(i,o,l),a=Op(i)}else i=[o],a=Fp(o)}return a}function a0(t,e){for(var r=[],a=t._fullLayout,i=a.selections,n=i.length,o=0;o<n;o++)if(!(e&&o!==a._activeSelectionIndex)){var l=i[o];if(l){var s=l.xref,f=l.yref,c=ya(t,s,"x"),u=ya(t,f,"y"),v,p,d,h,m;if(l.type==="rect"){m=[];var y=Si(c,l.x0),b=Si(c,l.x1),_=Si(u,l.y0),g=Si(u,l.y1);m=[[y,_],[y,g],[b,g],[b,_]],v=Math.min(y,b),p=Math.max(y,b),d=Math.min(_,g),h=Math.max(_,g),m.xmin=v,m.xmax=p,m.ymin=d,m.ymax=h,m.xref=s,m.yref=f,m.subtract=!1,m.isRect=!0,r.push(m)}else if(l.type==="path")for(var x=l.path.split("Z"),w=[],T=0;T<x.length;T++){var A=x[T];if(A){A+="Z";var M=Qg.extractPathCoords(A,Jg.paramIsX,"raw"),S=Qg.extractPathCoords(A,Jg.paramIsY,"raw");v=1/0,p=-1/0,d=1/0,h=-1/0,m=[];for(var L=0;L<M.length;L++){var E=Si(c,M[L]),F=Si(u,S[L]);m.push([E,F]),v=Math.min(E,v),p=Math.max(E,p),d=Math.min(F,d),h=Math.max(F,h)}m.xmin=v,m.xmax=p,m.ymin=d,m.ymax=h,m.xref=s,m.yref=f,m.subtract=jp(m,w),w.push(m),r.push(m)}}}}return r}function jp(t,e){for(var r=!1,a=0;a<e.length;a++)for(var i=e[a],n=0;n<t.length;n++)if(sE(t[n],i)){r=!r;break}return r}function Si(t,e){return t.type==="date"&&(e=e.replace("_"," ")),t.type==="log"?t.c2p(e):t.r2p(e,null,t.calendar)}function _2(t){for(var e=t.length,r=[],a=0;a<e;a++){var i=t[a];r=r.concat(i),r=r.concat([i[0]])}return FE(r)}function FE(t){return t.isRect=t.length===5&&t[0][0]===t[4][0]&&t[0][1]===t[4][1]&&t[0][0]===t[1][0]&&t[2][0]===t[3][0]&&t[0][1]===t[3][1]&&t[1][1]===t[2][1]||t[0][1]===t[1][1]&&t[2][1]===t[3][1]&&t[0][0]===t[3][0]&&t[1][0]===t[2][0],t.isRect&&(t.xmin=Math.min(t[0][0],t[2][0]),t.xmax=Math.max(t[0][0],t[2][0]),t.ymin=Math.min(t[0][1],t[2][1]),t.ymax=Math.max(t[0][1],t[2][1])),t}function w2(t){return function(e,r){for(var a,i,n=0;n<t.length;n++){var o=t[n],l=o._id,s=l.charAt(0);if(r.isRect){a||(a={});var f=r[s+"min"],c=r[s+"max"];f!==void 0&&c!==void 0&&(a[l]=[e0(o,f),e0(o,c)].sort(gE))}else i||(i={}),i[l]=r.map(wE(o))}a&&(e.range=a),i&&(e.lassoPoints=i)}}function NE(t){var e=t.plotinfo;return e.fillRangeItems||w2(t.xaxes.concat(t.yaxes))}function HE(t,e){t.emit("plotly_selecting",e)}function rs(t,e){e&&(e.selections=(t.layout||{}).selections||[]),t.emit("plotly_selected",e)}function Bp(t){t.emit("plotly_deselect",null)}var OE={reselect:fh,prepSelect:kE,clearOutline:u2,clearSelectionsCache:es,selectOnClick:h2},T2=[{path:"",backoff:0},{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}],mu={axisRefDescription:function(t,e,r){return["If set to a",t,"axis id (e.g. *"+t+"* or","*"+t+"2*), the `"+t+"` position refers to a",t,"coordinate. If set to *paper*, the `"+t+"`","position refers to the distance from the",e,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",e,"("+r+"). If set to a",t,"axis ID followed by","*domain* (separated by a space), the position behaves like for","*paper*, but refers to the distance in fractions of the domain","length from the",e,"of the domain of that axis: e.g.,","*"+t+"2 domain* refers to the domain of the second",t," axis and a",t,"position of 0.5 refers to the","point between the",e,"and the",r,"of the domain of the","second",t,"axis."].join(" ")}},i0=T2,n0=Mr,af=Rr,jE=Ht.templatedArray,nf=mu;function o0(t){return["In order for absolute positioning of the arrow to work, *a"+t+"ref* must be exactly the same as *"+t+"ref*, otherwise *a"+t+"ref* will revert to *pixel* (explained next).","For relative positioning, *a"+t+"ref* can be set to *pixel*,","in which case the *a"+t+"* value is specified in pixels","relative to *"+t+"*.","Absolute positioning is useful","for trendline annotations which should continue to indicate","the correct trend when zoomed. Relative positioning is useful","for specifying the text offset for an annotated point."].join(" ")}function l0(t,e,r){return["Sets the",t,"component of the arrow tail about the arrow head.","If `a"+t+"ref` is `pixel`, a positive (negative)","component corresponds to an arrow pointing","from",r,"to",e,"("+e,"to",r+").","If `a"+t+"ref` is not `pixel` and is exactly the same as `"+t+"ref`,","this is an absolute value on that axis,","like `"+t+"`, specified in the same coordinates as `"+t+"ref`."].join(" ")}var _s=jE("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw",description:["Determines whether or not this annotation is visible."].join(" ")},text:{valType:"string",editType:"calc+arraydraw",description:["Sets the text associated with this annotation.","Plotly uses a subset of HTML tags to do things like","newline (<br>), bold (<b></b>), italics (<i></i>),","hyperlinks (<a href='...'></a>). Tags <em>, <sup>, <sub>, <s>, <u>","<span> are also supported."].join(" ")},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw",description:["Sets the angle at which the `text` is drawn","with respect to the horizontal."].join(" ")},font:n0({editType:"calc+arraydraw",colorEditType:"arraydraw",description:"Sets the annotation text font."}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw",description:["Sets an explicit width for the text box. null (default) lets the","text set the box width. Wider text will be clipped.","There is no automatic wrapping; use <br> to start a new line."].join(" ")},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw",description:["Sets an explicit height for the text box. null (default) lets the","text set the box height. Taller text will be clipped."].join(" ")},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw",description:"Sets the opacity of the annotation (text + arrow)."},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw",description:["Sets the horizontal alignment of the `text` within the box.","Has an effect only if `text` spans two or more lines","(i.e. `text` contains one or more <br> HTML tags) or if an","explicit width is set to override the text width."].join(" ")},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw",description:["Sets the vertical alignment of the `text` within the box.","Has an effect only if an explicit height is set to override","the text height."].join(" ")},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw",description:"Sets the background color of the annotation."},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw",description:["Sets the color of the border enclosing the annotation `text`."].join(" ")},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw",description:["Sets the padding (in px) between the `text`","and the enclosing border."].join(" ")},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw",description:["Sets the width (in px) of the border enclosing","the annotation `text`."].join(" ")},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw",description:["Determines whether or not the annotation is drawn with an arrow.","If *true*, `text` is placed near the arrow's tail.","If *false*, `text` lines up with the `x` and `y` provided."].join(" ")},arrowcolor:{valType:"color",editType:"arraydraw",description:"Sets the color of the annotation arrow."},arrowhead:{valType:"integer",min:0,max:i0.length,dflt:1,editType:"arraydraw",description:"Sets the end annotation arrow head style."},startarrowhead:{valType:"integer",min:0,max:i0.length,dflt:1,editType:"arraydraw",description:"Sets the start annotation arrow head style."},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw",description:"Sets the annotation arrow head position."},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw",description:["Sets the size of the end annotation arrow head, relative to `arrowwidth`.","A value of 1 (default) gives a head about 3x as wide as the line."].join(" ")},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw",description:["Sets the size of the start annotation arrow head, relative to `arrowwidth`.","A value of 1 (default) gives a head about 3x as wide as the line."].join(" ")},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw",description:"Sets the width (in px) of annotation arrow line."},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw",description:["Sets a distance, in pixels, to move the end arrowhead away from the","position it is pointing at, for example to point at the edge of","a marker independent of zoom. Note that this shortens the arrow","from the `ax` / `ay` vector, in contrast to `xshift` / `yshift`","which moves everything by this amount."].join(" ")},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw",description:["Sets a distance, in pixels, to move the start arrowhead away from the","position it is pointing at, for example to point at the edge of","a marker independent of zoom. Note that this shortens the arrow","from the `ax` / `ay` vector, in contrast to `xshift` / `yshift`","which moves everything by this amount."].join(" ")},ax:{valType:"any",editType:"calc+arraydraw",description:[l0("x","left","right")].join(" ")},ay:{valType:"any",editType:"calc+arraydraw",description:[l0("y","top","bottom")].join(" ")},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",af.idRegex.x.toString()],editType:"calc",description:["Indicates in what coordinates the tail of the","annotation (ax,ay) is specified.",nf.axisRefDescription("x","left","right"),o0("x")].join(" ")},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",af.idRegex.y.toString()],editType:"calc",description:["Indicates in what coordinates the tail of the","annotation (ax,ay) is specified.",nf.axisRefDescription("y","bottom","top"),o0("y")].join(" ")},xref:{valType:"enumerated",values:["paper",af.idRegex.x.toString()],editType:"calc",description:["Sets the annotation's x coordinate axis.",nf.axisRefDescription("x","left","right")].join(" ")},x:{valType:"any",editType:"calc+arraydraw",description:["Sets the annotation's x position.","If the axis `type` is *log*, then you must take the","log of your desired range.","If the axis `type` is *date*, it should be date strings,","like date data, though Date objects and unix milliseconds","will be accepted and converted to strings.","If the axis `type` is *category*, it should be numbers,","using the scale where each category is assigned a serial","number from zero in the order it appears."].join(" ")},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw",description:["Sets the text box's horizontal position anchor","This anchor binds the `x` position to the *left*, *center*","or *right* of the annotation.","For example, if `x` is set to 1, `xref` to *paper* and","`xanchor` to *right* then the right-most portion of the","annotation lines up with the right-most edge of the","plotting area.","If *auto*, the anchor is equivalent to *center* for","data-referenced annotations or if there is an arrow,","whereas for paper-referenced with no arrow, the anchor picked","corresponds to the closest side."].join(" ")},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw",description:["Shifts the position of the whole annotation and arrow to the","right (positive) or left (negative) by this many pixels."].join(" ")},yref:{valType:"enumerated",values:["paper",af.idRegex.y.toString()],editType:"calc",description:["Sets the annotation's y coordinate axis.",nf.axisRefDescription("y","bottom","top")].join(" ")},y:{valType:"any",editType:"calc+arraydraw",description:["Sets the annotation's y position.","If the axis `type` is *log*, then you must take the","log of your desired range.","If the axis `type` is *date*, it should be date strings,","like date data, though Date objects and unix milliseconds","will be accepted and converted to strings.","If the axis `type` is *category*, it should be numbers,","using the scale where each category is assigned a serial","number from zero in the order it appears."].join(" ")},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw",description:["Sets the text box's vertical position anchor","This anchor binds the `y` position to the *top*, *middle*","or *bottom* of the annotation.","For example, if `y` is set to 1, `yref` to *paper* and","`yanchor` to *top* then the top-most portion of the","annotation lines up with the top-most edge of the","plotting area.","If *auto*, the anchor is equivalent to *middle* for","data-referenced annotations or if there is an arrow,","whereas for paper-referenced with no arrow, the anchor picked","corresponds to the closest side."].join(" ")},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw",description:["Shifts the position of the whole annotation and arrow up","(positive) or down (negative) by this many pixels."].join(" ")},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw",description:["Makes this annotation respond to clicks on the plot.","If you click a data point that exactly matches the `x` and `y`","values of this annotation, and it is hidden (visible: false),","it will appear. In *onoff* mode, you must click the same point","again to make it disappear, so if you click multiple points,","you can show multiple annotations. In *onout* mode, a click","anywhere else in the plot (on another data point or not) will","hide this annotation.","If you need to show/hide this annotation in response to different","`x` or `y` values, you can set `xclick` and/or `yclick`. This is","useful for example to label the side of a bar. To label markers","though, `standoff` is preferred over `xclick` and `yclick`."].join(" ")},xclick:{valType:"any",editType:"arraydraw",description:["Toggle this annotation when clicking a data point whose `x` value","is `xclick` rather than the annotation's `x` value."].join(" ")},yclick:{valType:"any",editType:"arraydraw",description:["Toggle this annotation when clicking a data point whose `y` value","is `yclick` rather than the annotation's `y` value."].join(" ")},hovertext:{valType:"string",editType:"arraydraw",description:["Sets text to appear when hovering over this annotation.","If omitted or blank, no hover label will appear."].join(" ")},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw",description:["Sets the background color of the hover label.","By default uses the annotation's `bgcolor` made opaque,","or white if it was transparent."].join(" ")},bordercolor:{valType:"color",editType:"arraydraw",description:["Sets the border color of the hover label.","By default uses either dark grey or white, for maximum","contrast with `hoverlabel.bgcolor`."].join(" ")},font:n0({editType:"arraydraw",description:["Sets the hover label text font.","By default uses the global hover font and size,","with color from `hoverlabel.bordercolor`."].join(" ")}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw",description:["Determines whether the annotation text box captures mouse move","and click events, or allows those events to pass through to data","points in the plot that may be behind the annotation. By default","`captureevents` is *false* unless `hovertext` is provided.","If you use the event `plotly_clickannotation` without `hovertext`","you must explicitly enable `captureevents`."].join(" ")},editType:"calc"}),yu={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20,eventDataKeys:[]},k2=function(e){return{valType:"color",editType:"style",anim:!0,description:["Sets the fill color.","Defaults to a half-transparent variant of the line color,","marker color, or marker line color, whichever is available."+(e?" If fillgradient is specified, fillcolor is ignored except for setting the background color of the hover label, if any.":"")].join(" ")}},s0=qo.axisHoverFormat,BE=zr.texttemplateAttrs,GE=zr.hovertemplateAttrs,f0=Rn,UE=Mr,VE=ta.dash,WE=ta.pattern,XE=Et,c0=yu,of=Xt.extendFlat,YE=k2;function u0(t){return{valType:"any",dflt:0,editType:"calc",description:["Only relevant when the axis `type` is *date*.","Sets the period positioning in milliseconds or *M<n>* on the "+t+" axis.","Special values in the form of *M<n>* could be used to declare","the number of months. In this case `n` must be a positive integer."].join(" ")}}function v0(t){return{valType:"any",editType:"calc",description:["Only relevant when the axis `type` is *date*.","Sets the base for period positioning in milliseconds or date string on the "+t+" axis.","When `"+t+"period` is round number of weeks,","the `"+t+"period0` by default would be on a Sunday i.e. 2000-01-02,","otherwise it would be at 2000-01-01."].join(" ")}}function d0(t){return{valType:"enumerated",values:["start","middle","end"],dflt:"middle",editType:"calc",description:["Only relevant when the axis `type` is *date*.","Sets the alignment of data points on the "+t+" axis."].join(" ")}}var Vi={x:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0,description:"Sets the x coordinates."},x0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",anim:!0,description:["Alternate to `x`.","Builds a linear space of x coordinates.","Use with `dx`","where `x0` is the starting coordinate and `dx` the step."].join(" ")},dx:{valType:"number",dflt:1,editType:"calc",anim:!0,description:["Sets the x coordinate step.","See `x0` for more info."].join(" ")},y:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0,description:"Sets the y coordinates."},y0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",anim:!0,description:["Alternate to `y`.","Builds a linear space of y coordinates.","Use with `dy`","where `y0` is the starting coordinate and `dy` the step."].join(" ")},dy:{valType:"number",dflt:1,editType:"calc",anim:!0,description:["Sets the y coordinate step.","See `y0` for more info."].join(" ")},xperiod:u0("x"),yperiod:u0("y"),xperiod0:v0("x0"),yperiod0:v0("y0"),xperiodalignment:d0("x"),yperiodalignment:d0("y"),xhoverformat:s0("x"),yhoverformat:s0("y"),offsetgroup:{valType:"string",dflt:"",editType:"calc",description:["Set several traces linked to the same position axis","or matching axes to the same","offsetgroup where bars of the same position coordinate will line up."].join(" ")},alignmentgroup:{valType:"string",dflt:"",editType:"calc",description:["Set several traces linked to the same position axis","or matching axes to the same","alignmentgroup. This controls whether bars compute their positional","range dependently or independently."].join(" ")},stackgroup:{valType:"string",dflt:"",editType:"calc",description:["Set several scatter traces (on the same subplot) to the same","stackgroup in order to add their y values (or their x values if","`orientation` is *h*). If blank or omitted this trace will not be","stacked. Stacking also turns `fill` on by default, using *tonexty*","(*tonextx*) if `orientation` is *h* (*v*) and sets the default","`mode` to *lines* irrespective of point count.","You can only stack on a numeric (linear or log) axis.","Traces in a `stackgroup` will only fill to (or be filled to) other","traces in the same group. With multiple `stackgroup`s or some","traces stacked and some not, if fill-linked traces are not already","consecutive, the later ones will be pushed down in the drawing order."].join(" ")},orientation:{valType:"enumerated",values:["v","h"],editType:"calc",description:["Only relevant in the following cases:","1. when `scattermode` is set to *group*.","2. when `stackgroup` is used, and only the first","`orientation` found in the `stackgroup` will be used - including","if `visible` is *legendonly* but not if it is `false`. Sets the","stacking direction. With *v* (*h*), the y (x) values of subsequent","traces are added. Also affects the default value of `fill`."].join(" ")},groupnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc",description:["Only relevant when `stackgroup` is used, and only the first","`groupnorm` found in the `stackgroup` will be used - including","if `visible` is *legendonly* but not if it is `false`.","Sets the normalization for the sum of this `stackgroup`.","With *fraction*, the value of each trace at each location is","divided by the sum of all trace values at that location.","*percent* is the same but multiplied by 100 to show percentages.","If there are multiple subplots, or multiple `stackgroup`s on one","subplot, each will be normalized within its own set."].join(" ")},stackgaps:{valType:"enumerated",values:["infer zero","interpolate"],dflt:"infer zero",editType:"calc",description:["Only relevant when `stackgroup` is used, and only the first","`stackgaps` found in the `stackgroup` will be used - including","if `visible` is *legendonly* but not if it is `false`.","Determines how we handle locations at which other traces in this","group have data but this one does not.","With *infer zero* we insert a zero at these locations.","With *interpolate* we linearly interpolate between existing","values, and extrapolate a constant beyond the existing values."].join(" ")},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc",description:["Sets text elements associated with each (x,y) pair.","If a single string, the same string appears over","all the data points.","If an array of string, the items are mapped in order to the","this trace's (x,y) coordinates.","If trace `hoverinfo` contains a *text* flag and *hovertext* is not set,","these elements will be seen in the hover labels."].join(" ")},texttemplate:BE({},{}),hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style",description:["Sets hover text elements associated with each (x,y) pair.","If a single string, the same string appears over","all the data points.","If an array of string, the items are mapped in order to the","this trace's (x,y) coordinates.","To be seen, trace `hoverinfo` must contain a *text* flag."].join(" ")},mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"],editType:"calc",description:["Determines the drawing mode for this scatter trace.","If the provided `mode` includes *text* then the `text` elements","appear at the coordinates. Otherwise, the `text` elements","appear on hover.","If there are less than "+c0.PTS_LINESONLY+" points","and the trace is not stacked","then the default is *lines+markers*. Otherwise, *lines*."].join(" ")},hoveron:{valType:"flaglist",flags:["points","fills"],editType:"style",description:["Do the hover effects highlight individual points (markers or","line points) or do they highlight filled regions?","If the fill is *toself* or *tonext* and there are no markers","or text, then the default is *fills*, otherwise it is *points*."].join(" ")},hovertemplate:GE({},{keys:c0.eventDataKeys}),line:{color:{valType:"color",editType:"style",anim:!0,description:"Sets the line color."},width:{valType:"number",min:0,dflt:2,editType:"style",anim:!0,description:"Sets the line width (in px)."},shape:{valType:"enumerated",values:["linear","spline","hv","vh","hvh","vhv"],dflt:"linear",editType:"plot",description:["Determines the line shape.","With *spline* the lines are drawn using spline interpolation.","The other available values correspond to step-wise line shapes."].join(" ")},smoothing:{valType:"number",min:0,max:1.3,dflt:1,editType:"plot",description:["Has an effect only if `shape` is set to *spline*","Sets the amount of smoothing.","*0* corresponds to no smoothing (equivalent to a *linear* shape)."].join(" ")},dash:of({},VE,{editType:"style"}),backoff:{valType:"number",min:0,dflt:"auto",arrayOk:!0,editType:"plot",description:["Sets the line back off from the end point of the nth line segment (in px).","This option is useful e.g. to avoid overlap with arrowhead markers.","With *auto* the lines would trim before markers if `marker.angleref` is set to *previous*."].join(" ")},simplify:{valType:"boolean",dflt:!0,editType:"plot",description:["Simplifies lines by removing nearly-collinear points. When transitioning","lines, it may be desirable to disable this so that the number of points","along the resulting SVG path is unaffected."].join(" ")},editType:"plot"},connectgaps:{valType:"boolean",dflt:!1,editType:"calc",description:["Determines whether or not gaps","(i.e. {nan} or missing values)","in the provided data arrays are connected."].join(" ")},cliponaxis:{valType:"boolean",dflt:!0,editType:"plot",description:["Determines whether or not markers and text nodes","are clipped about the subplot axes.","To show markers and text nodes above axis lines and tick labels,","make sure to set `xaxis.layer` and `yaxis.layer` to *below traces*."].join(" ")},fill:{valType:"enumerated",values:["none","tozeroy","tozerox","tonexty","tonextx","toself","tonext"],editType:"calc",description:["Sets the area to fill with a solid color.","Defaults to *none* unless this trace is stacked, then it gets","*tonexty* (*tonextx*) if `orientation` is *v* (*h*)","Use with `fillcolor` if not *none*.","*tozerox* and *tozeroy* fill to x=0 and y=0 respectively.","*tonextx* and *tonexty* fill between the endpoints of this","trace and the endpoints of the trace before it, connecting those","endpoints with straight lines (to make a stacked area graph);","if there is no trace before it, they behave like *tozerox* and","*tozeroy*.","*toself* connects the endpoints of the trace (or each segment","of the trace if it has gaps) into a closed shape.","*tonext* fills the space between two traces if one completely","encloses the other (eg consecutive contour lines), and behaves like","*toself* if there is no trace before it. *tonext* should not be","used if one trace does not enclose the other.","Traces in a `stackgroup` will only fill to (or be filled to) other","traces in the same group. With multiple `stackgroup`s or some","traces stacked and some not, if fill-linked traces are not already","consecutive, the later ones will be pushed down in the drawing order."].join(" ")},fillcolor:YE(!0),fillgradient:of({type:{valType:"enumerated",values:["radial","horizontal","vertical","none"],dflt:"none",editType:"calc",description:["Sets the type/orientation of the color gradient for the fill.","Defaults to *none*."].join(" ")},start:{valType:"number",editType:"calc",description:["Sets the gradient start value.","It is given as the absolute position on the axis determined by","the orientiation. E.g., if orientation is *horizontal*, the","gradient will be horizontal and start from the x-position","given by start. If omitted, the gradient starts at the lowest","value of the trace along the respective axis.","Ignored if orientation is *radial*."].join(" ")},stop:{valType:"number",editType:"calc",description:["Sets the gradient end value.","It is given as the absolute position on the axis determined by","the orientiation. E.g., if orientation is *horizontal*, the","gradient will be horizontal and end at the x-position","given by end. If omitted, the gradient ends at the highest","value of the trace along the respective axis.","Ignored if orientation is *radial*."].join(" ")},colorscale:{valType:"colorscale",editType:"style",description:["Sets the fill gradient colors as a color scale.","The color scale is interpreted as a gradient","applied in the direction specified by *orientation*,","from the lowest to the highest value of the scatter","plot along that axis, or from the center to the most","distant point from it, if orientation is *radial*."].join(" ")},editType:"calc",description:["Sets a fill gradient.","If not specified, the fillcolor is used instead."].join(" ")}),fillpattern:WE,marker:of({symbol:{valType:"enumerated",values:XE.symbolList,dflt:"circle",arrayOk:!0,editType:"style",description:["Sets the marker symbol type.","Adding 100 is equivalent to appending *-open* to a symbol name.","Adding 200 is equivalent to appending *-dot* to a symbol name.","Adding 300 is equivalent to appending *-open-dot*","or *dot-open* to a symbol name."].join(" ")},opacity:{valType:"number",min:0,max:1,arrayOk:!0,editType:"style",anim:!0,description:"Sets the marker opacity."},angle:{valType:"angle",dflt:0,arrayOk:!0,editType:"plot",anim:!1,description:["Sets the marker angle in respect to `angleref`."].join(" ")},angleref:{valType:"enumerated",values:["previous","up"],dflt:"up",editType:"plot",anim:!1,description:["Sets the reference for marker angle.","With *previous*, angle 0 points along the line from the previous point to this one.","With *up*, angle 0 points toward the top of the screen."].join(" ")},standoff:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"plot",anim:!0,description:["Moves the marker away from the data point in the direction of `angle` (in px).","This can be useful for example if you have another marker at this","location and you want to point an arrowhead marker at it."].join(" ")},size:{valType:"number",min:0,dflt:6,arrayOk:!0,editType:"calc",anim:!0,description:"Sets the marker size (in px)."},maxdisplayed:{valType:"number",min:0,dflt:0,editType:"plot",description:["Sets a maximum number of points to be drawn on the graph.","*0* corresponds to no limit."].join(" ")},sizeref:{valType:"number",dflt:1,editType:"calc",description:["Has an effect only if `marker.size` is set to a numerical array.","Sets the scale factor used to determine the rendered size of","marker points. Use with `sizemin` and `sizemode`."].join(" ")},sizemin:{valType:"number",min:0,dflt:0,editType:"calc",description:["Has an effect only if `marker.size` is set to a numerical array.","Sets the minimum size (in px) of the rendered marker points."].join(" ")},sizemode:{valType:"enumerated",values:["diameter","area"],dflt:"diameter",editType:"calc",description:["Has an effect only if `marker.size` is set to a numerical array.","Sets the rule for which the data in `size` is converted","to pixels."].join(" ")},line:of({width:{valType:"number",min:0,arrayOk:!0,editType:"style",anim:!0,description:"Sets the width (in px) of the lines bounding the marker points."},editType:"calc"},f0("marker.line",{anim:!0})),gradient:{type:{valType:"enumerated",values:["radial","horizontal","vertical","none"],arrayOk:!0,dflt:"none",editType:"calc",description:["Sets the type of gradient used to fill the markers"].join(" ")},color:{valType:"color",arrayOk:!0,editType:"calc",description:["Sets the final color of the gradient fill:","the center color for radial, the right for horizontal,","or the bottom for vertical."].join(" ")},editType:"calc"},editType:"calc"},f0("marker",{anim:!0})),selected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style",description:"Sets the marker opacity of selected points."},color:{valType:"color",editType:"style",description:"Sets the marker color of selected points."},size:{valType:"number",min:0,editType:"style",description:"Sets the marker size of selected points."},editType:"style"},textfont:{color:{valType:"color",editType:"style",description:"Sets the text font color of selected points."},editType:"style"},editType:"style"},unselected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style",description:"Sets the marker opacity of unselected points, applied only when a selection exists."},color:{valType:"color",editType:"style",description:"Sets the marker color of unselected points, applied only when a selection exists."},size:{valType:"number",min:0,editType:"style",description:"Sets the marker size of unselected points, applied only when a selection exists."},editType:"style"},textfont:{color:{valType:"color",editType:"style",description:"Sets the text font color of unselected points, applied only when a selection exists."},editType:"style"},editType:"style"},textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"middle center",arrayOk:!0,editType:"calc",description:["Sets the positions of the `text` elements","with respects to the (x,y) coordinates."].join(" ")},textfont:UE({editType:"calc",colorEditType:"style",arrayOk:!0,description:"Sets the text font."}),zorder:{valType:"integer",dflt:0,editType:"plot",description:["Sets the layer on which this trace is displayed, relative to","other SVG traces on the same subplot. SVG traces with higher `zorder`","appear in front of those with lower `zorder`."].join(" ")}},h0=_s,p0=Vi.line,qE=ta.dash,lf=Xt.extendFlat,ZE=Ja.overrideAll,KE=Ht.templatedArray,m0=mu,A2=ZE(KE("selection",{type:{valType:"enumerated",values:["rect","path"],description:["Specifies the selection type to be drawn.","If *rect*, a rectangle is drawn linking","(`x0`,`y0`), (`x1`,`y0`), (`x1`,`y1`) and (`x0`,`y1`).","If *path*, draw a custom SVG path using `path`."].join(" ")},xref:lf({},h0.xref,{description:["Sets the selection's x coordinate axis.",m0.axisRefDescription("x","left","right")].join(" ")}),yref:lf({},h0.yref,{description:["Sets the selection's x coordinate axis.",m0.axisRefDescription("y","bottom","top")].join(" ")}),x0:{valType:"any",description:"Sets the selection's starting x position."},x1:{valType:"any",description:"Sets the selection's end x position."},y0:{valType:"any",description:"Sets the selection's starting y position."},y1:{valType:"any",description:"Sets the selection's end y position."},path:{valType:"string",editType:"arraydraw",description:["For `type` *path* - a valid SVG path similar to `shapes.path` in data coordinates.","Allowed segments are: M, L and Z."].join(" ")},opacity:{valType:"number",min:0,max:1,dflt:.7,editType:"arraydraw",description:"Sets the opacity of the selection."},line:{color:p0.color,width:lf({},p0.width,{min:1,dflt:1}),dash:lf({},qE,{dflt:"dot"})}}),"arraydraw","from-root"),y0=we,sf=Ot,QE=ri,JE=A2,g0=Ui,ez=function(e,r){QE(e,r,{name:"selections",handleItemDefaults:tz});for(var a=r.selections,i=0;i<a.length;i++){var n=a[i];n&&n.path===void 0&&(n.x0===void 0||n.x1===void 0||n.y0===void 0||n.y1===void 0)&&(r.selections[i]=null)}};function tz(t,e,r){function a(w,T){return y0.coerce(t,e,JE,w,T)}var i=a("path"),n=i?"path":"rect",o=a("type",n),l=o!=="path";l&&delete e.path,a("opacity"),a("line.color"),a("line.width"),a("line.dash");for(var s=["x","y"],f=0;f<2;f++){var c=s[f],u={_fullLayout:r},v,p,d,h=sf.coerceRef(t,e,u,c);if(v=sf.getFromId(u,h),v._selectionIndices.push(e._index),d=g0.rangeToShapePosition(v),p=g0.shapePositionToRange(v),l){var m=c+"0",y=c+"1",b=t[m],_=t[y];t[m]=p(t[m],!0),t[y]=p(t[y],!0),sf.coercePosition(e,u,a,h,m),sf.coercePosition(e,u,a,h,y);var g=e[m],x=e[y];g!==void 0&&x!==void 0&&(e[m]=d(g),e[y]=d(x),t[m]=b,t[y]=_)}}l&&y0.noneOrAll(t,e,["x0","x1","y0","y1"])}var rz=function(e,r,a){a("newselection.mode");var i=a("newselection.line.width");i&&(a("newselection.line.color"),a("newselection.line.dash")),a("activeselection.fillcolor"),a("activeselection.opacity")},az=ot,b0=we,x0=cr,gu=function(e){return function(a,i){var n=a[e];if(Array.isArray(n))for(var o=az.subplotsRegistry.cartesian,l=o.idRegex,s=i._subplots,f=s.xaxis,c=s.yaxis,u=s.cartesian,v=i._has("cartesian"),p=0;p<n.length;p++){var d=n[p];if(b0.isPlainObject(d)){var h=x0.cleanId(d.xref,"x",!1),m=x0.cleanId(d.yref,"y",!1),y=l.x.test(h),b=l.y.test(m);if(y||b){v||b0.pushUnique(i._basePlotModules,o);var _=!1;y&&f.indexOf(h)===-1&&(f.push(h),_=!0),b&&c.indexOf(m)===-1&&(c.push(m),_=!0),_&&y&&b&&u.push(h+m)}}}}},_0=o2,dl=OE,Rl={moduleType:"component",name:"selections",layoutAttributes:A2,supplyLayoutDefaults:ez,supplyDrawNewSelectionDefaults:rz,includeBasePlot:gu("selections"),draw:_0.draw,drawOne:_0.drawOne,reselect:dl.reselect,prepSelect:dl.prepSelect,clearOutline:dl.clearOutline,clearSelectionsCache:dl.clearSelectionsCache,selectOnClick:dl.selectOnClick},Tv,w0;function iz(){if(w0)return Tv;w0=1;var t=bt,e=we,r=e.numberFormat,a=_a,i=q1,n=ot,o=e.strTranslate,l=Tr,s=yt,f=Et,c=Na,u=Ot,v=Bi,p=ai,d=Fn,h=d.selectingOrDrawing,m=d.freeMode,y=Vr.FROM_TL,b=_p,_=ou.redrawReglTraces,g=hr,x=cr.getFromId,w=Rl.prepSelect,T=Rl.clearOutline,A=Rl.selectOnClick,M=t2,S=Rr,L=S.MINDRAG,E=S.MINZOOM,F=!0;function N(q,te,le,ce,ye,ue,oe,pe){var Me=q._fullLayout._zoomlayer,ve=oe+pe==="nsew",ke=(oe+pe).length===1,_e,J,be,Z,me,ge,Pe,Ee,Le,Ae,Oe,$e,ze,je,at,xe,We,Xe,Re,et,Ue,I,U;le+=te.yaxis._shift;function V(){if(_e=te.xaxis,J=te.yaxis,Le=_e._length,Ae=J._length,Pe=_e._offset,Ee=J._offset,be={},be[_e._id]=_e,Z={},Z[J._id]=J,oe&&pe)for(var Ye=te.overlays,Ne=0;Ne<Ye.length;Ne++){var nt=Ye[Ne].xaxis;be[nt._id]=nt;var vt=Ye[Ne].yaxis;Z[vt._id]=vt}me=fe(be),ge=fe(Z),ze=D(me,pe),je=D(ge,oe),at=!je&&!ze,$e=ae(q,q._fullLayout._axisMatchGroups,be,Z),Oe=ae(q,q._fullLayout._axisConstraintGroups,be,Z,$e);var Je=Oe.isSubplotConstrained||$e.isSubplotConstrained;xe=pe||Je,We=oe||Je;var rt=q._fullLayout;Xe=rt._has("scattergl"),Re=rt._has("splom"),et=rt._has("svg")}V();var Q=R(je+ze,q._fullLayout.dragmode,ve),se=H(te,oe+pe+"drag",Q,le,ce,ye,ue);if(at&&!ve)return se.onmousedown=null,se.style.pointerEvents="none",se;var re={element:se,gd:q,plotinfo:te};re.prepFn=function(Ye,Ne,nt){var vt=re.dragmode,Je=q._fullLayout.dragmode;Je!==vt&&(re.dragmode=Je),V(),I=q._fullLayout._invScaleX,U=q._fullLayout._invScaleY,at||(ve?Ye.shiftKey?Je==="pan"?Je="zoom":h(Je)||(Je="pan"):Ye.ctrlKey&&(Je="pan"):Je="pan"),m(Je)?re.minDrag=1:re.minDrag=void 0,h(Je)?(re.xaxes=me,re.yaxes=ge,w(Ye,Ne,nt,re,Je)):(re.clickFn=Se,h(vt)&&Ce(),at||(Je==="zoom"?(re.moveFn=Ze,re.doneFn=wt,re.minDrag=1,ft(Ye,Ne,nt)):Je==="pan"&&(re.moveFn=Tt,re.doneFn=Sr))),q._fullLayout._redrag=function(){var rt=q._dragdata;if(rt&&rt.element===se){var ut=q._fullLayout.dragmode;h(ut)||(V(),rr([0,0,Le,Ae]),re.moveFn(rt.dx,rt.dy))}}};function Ce(){re.plotinfo.selection=!1,T(q)}function Se(Ye,Ne){var nt=re.gd;if(nt._fullLayout._activeShapeIndex>=0){nt._fullLayout._deactivateShape(nt);return}var vt=nt._fullLayout.clickmode;if(K(nt),Ye===2&&!ke&&It(),ve)vt.indexOf("select")>-1&&A(Ne,nt,me,ge,te.id,re),vt.indexOf("event")>-1&&c.click(nt,Ne,te.id);else if(Ye===1&&ke){var Je=oe?J:_e,rt=oe==="s"||pe==="w"?0:1,ut=Je._name+".range["+rt+"]",xt=P(Je,rt),Ct="left",Vt="middle";if(Je.fixedrange)return;oe?(Vt=oe==="n"?"top":"bottom",Je.side==="right"&&(Ct="right")):pe==="e"&&(Ct="right"),nt._context.showAxisRangeEntryBoxes&&t.select(se).call(l.makeEditable,{gd:nt,immediate:!0,background:nt._fullLayout.paper_bgcolor,text:String(xt),fill:Je.tickfont?Je.tickfont.color:"#444",horizontalAlign:Ct,verticalAlign:Vt}).on("edit",function(Gt){var Qt=Je.d2r(Gt);Qt!==void 0&&n.call("_guiRelayout",nt,ut,Qt)})}}p.init(re);var he,ne,Te,Ie,Ge,Fe,tt,st,Ve,Lt;function ft(Ye,Ne,nt){var vt=se.getBoundingClientRect();he=Ne-vt.left,ne=nt-vt.top,q._fullLayout._calcInverseTransform(q);var Je=e.apply3DTransform(q._fullLayout._invTransform)(he,ne);he=Je[0],ne=Je[1],Te={l:he,r:he,w:0,t:ne,b:ne,h:0},Ie=q._hmpixcount?q._hmlumcount/q._hmpixcount:a(q._fullLayout.plot_bgcolor).getLuminance(),Ge="M0,0H"+Le+"V"+Ae+"H0V0",Fe=!1,tt="xy",Lt=!1,st=j(Me,Ie,Pe,Ee,Ge),Ve=G(Me,Pe,Ee)}function Ze(Ye,Ne){if(q._transitioningWithDuration)return!1;var nt=Math.max(0,Math.min(Le,I*Ye+he)),vt=Math.max(0,Math.min(Ae,U*Ne+ne)),Je=Math.abs(nt-he),rt=Math.abs(vt-ne);Te.l=Math.min(he,nt),Te.r=Math.max(he,nt),Te.t=Math.min(ne,vt),Te.b=Math.max(ne,vt);function ut(){tt="",Te.r=Te.l,Te.t=Te.b,Ve.attr("d","M0,0Z")}if(Oe.isSubplotConstrained)Je>E||rt>E?(tt="xy",Je/Le>rt/Ae?(rt=Je*Ae/Le,ne>vt?Te.t=ne-rt:Te.b=ne+rt):(Je=rt*Le/Ae,he>nt?Te.l=he-Je:Te.r=he+Je),Ve.attr("d",ee(Te))):ut();else if($e.isSubplotConstrained)if(Je>E||rt>E){tt="xy";var xt=Math.min(Te.l/Le,(Ae-Te.b)/Ae),Ct=Math.max(Te.r/Le,(Ae-Te.t)/Ae);Te.l=xt*Le,Te.r=Ct*Le,Te.b=(1-xt)*Ae,Te.t=(1-Ct)*Ae,Ve.attr("d",ee(Te))}else ut();else!je||rt<Math.min(Math.max(Je*.6,L),E)?Je<L||!ze?ut():(Te.t=0,Te.b=Ae,tt="x",Ve.attr("d",X(Te,ne))):!ze||Je<Math.min(rt*.6,E)?(Te.l=0,Te.r=Le,tt="y",Ve.attr("d",B(Te,he))):(tt="xy",Ve.attr("d",ee(Te)));Te.w=Te.r-Te.l,Te.h=Te.b-Te.t,tt&&(Lt=!0),q._dragged=Lt,Y(st,Ve,Te,Ge,Fe,Ie),gt(),q.emit("plotly_relayouting",Ue),Fe=!0}function gt(){Ue={},(tt==="xy"||tt==="x")&&(k(me,Te.l/Le,Te.r/Le,Ue,Oe.xaxes),Qe("x",Ue)),(tt==="xy"||tt==="y")&&(k(ge,(Ae-Te.b)/Ae,(Ae-Te.t)/Ae,Ue,Oe.yaxes),Qe("y",Ue))}function wt(){gt(),K(q),Sr(),W(q)}var lt=[0,0,Le,Ae],ct=null,Ke=S.REDRAWDELAY,it=te.mainplot?q._fullLayout._plots[te.mainplot]:te;function pt(Ye){if(!q._context._scrollZoom.cartesian&&!q._fullLayout._enablescrollzoom)return;if(Ce(),q._transitioningWithDuration){Ye.preventDefault(),Ye.stopPropagation();return}V(),clearTimeout(ct);var Ne=-Ye.deltaY;if(isFinite(Ne)||(Ne=Ye.wheelDelta/10),!isFinite(Ne)){e.log("Did not find wheel motion attributes: ",Ye);return}var nt=Math.exp(-Math.min(Math.max(Ne,-20),20)/200),vt=it.draglayer.select(".nsewdrag").node().getBoundingClientRect(),Je=(Ye.clientX-vt.left)/vt.width,rt=(vt.bottom-Ye.clientY)/vt.height,ut;function xt(Ct,Vt,Gt){if(Ct.fixedrange)return;var Qt=e.simpleMap(Ct.range,Ct.r2l),Ft=Qt[0]+(Qt[1]-Qt[0])*Vt;function ar(Rt){return Ct.l2r(Ft+(Rt-Ft)*Gt)}Ct.range=Qt.map(ar)}if(xe){for(pe||(Je=.5),ut=0;ut<me.length;ut++)xt(me[ut],Je,nt);Qe("x"),lt[2]*=nt,lt[0]+=lt[2]*Je*(1/nt-1)}if(We){for(oe||(rt=.5),ut=0;ut<ge.length;ut++)xt(ge[ut],rt,nt);Qe("y"),lt[3]*=nt,lt[1]+=lt[3]*(1-rt)*(1/nt-1)}rr(lt),At(),q.emit("plotly_relayouting",Ue),ct=setTimeout(function(){q._fullLayout&&(lt=[0,0,Le,Ae],Sr())},Ke),Ye.preventDefault()}oe.length*pe.length!==1&&de(se,pt);function Tt(Ye,Ne){if(Ye=Ye*I,Ne=Ne*U,q._transitioningWithDuration)return;if(q._fullLayout._replotting=!0,ze==="ew"||je==="ns"){var nt=ze?-Ye:0,vt=je?-Ne:0;if($e.isSubplotConstrained){if(ze&&je){var Je=(Ye/Le-Ne/Ae)/2;Ye=Je*Le,Ne=-Je*Ae,nt=-Ye,vt=-Ne}je?nt=-vt*Le/Ae:vt=-nt*Ae/Le}ze&&(C(me,Ye),Qe("x")),je&&(C(ge,Ne),Qe("y")),rr([nt,vt,Le,Ae]),At(),q.emit("plotly_relayouting",Ue);return}function rt(ar,Rt,Ut){for(var $r=1-Rt,Jt,Wr,gi=0;gi<ar.length;gi++){var Ba=ar[gi];if(!Ba.fixedrange){Jt=Ba,Wr=Ba._rl[$r]+(Ba._rl[Rt]-Ba._rl[$r])/$(Ut/Ba._length);var Du=Ba.l2r(Wr);Du!==!1&&Du!==void 0&&(Ba.range[Rt]=Du)}}return Jt._length*(Jt._rl[Rt]-Wr)/(Jt._rl[Rt]-Jt._rl[$r])}var ut=ze==="w"==(je==="n")?1:-1;if(ze&&je&&(Oe.isSubplotConstrained||$e.isSubplotConstrained)){var xt=(Ye/Le+ut*Ne/Ae)/2;Ye=xt*Le,Ne=ut*xt*Ae}var Ct,Vt;if(ze==="w"?Ye=rt(me,0,Ye):ze==="e"?Ye=rt(me,1,-Ye):ze||(Ye=0),je==="n"?Ne=rt(ge,1,Ne):je==="s"?Ne=rt(ge,0,-Ne):je||(Ne=0),Ct=ze==="w"?Ye:0,Vt=je==="n"?Ne:0,Oe.isSubplotConstrained&&!$e.isSubplotConstrained||$e.isSubplotConstrained&&ze&&je&&ut>0){var Gt;if($e.isSubplotConstrained||!ze&&je.length===1){for(Gt=0;Gt<me.length;Gt++)me[Gt].range=me[Gt]._r.slice(),M(me[Gt],1-Ne/Ae);Ye=Ne*Le/Ae,Ct=Ye/2}if($e.isSubplotConstrained||!je&&ze.length===1){for(Gt=0;Gt<ge.length;Gt++)ge[Gt].range=ge[Gt]._r.slice(),M(ge[Gt],1-Ye/Le);Ne=Ye*Ae/Le,Vt=Ne/2}}(!$e.isSubplotConstrained||!je)&&Qe("x"),(!$e.isSubplotConstrained||!ze)&&Qe("y");var Qt=Le-Ye,Ft=Ae-Ne;$e.isSubplotConstrained&&!(ze&&je)&&(ze?(Vt=Ct?0:Ye*Ae/Le,Ft=Qt*Ae/Le):(Ct=Vt?0:Ne*Le/Ae,Qt=Ft*Le/Ae)),rr([Ct,Vt,Qt,Ft]),At(),q.emit("plotly_relayouting",Ue)}function Qe(Ye,Ne){for(var nt=$e.isSubplotConstrained?{x:ge,y:me}[Ye]:$e[Ye+"axes"],vt=$e.isSubplotConstrained?{x:me,y:ge}[Ye]:[],Je=0;Je<nt.length;Je++){var rt=nt[Je],ut=rt._id,xt=$e.xLinks[ut]||$e.yLinks[ut],Ct=vt[0]||be[xt]||Z[xt];Ct&&(Ne?(Ne[rt._name+".range[0]"]=Ne[Ct._name+".range[0]"],Ne[rt._name+".range[1]"]=Ne[Ct._name+".range[1]"]):rt.range=Ct.range.slice())}}function At(){var Ye=[],Ne;function nt(ut){for(Ne=0;Ne<ut.length;Ne++)ut[Ne].fixedrange||Ye.push(ut[Ne]._id)}function vt(ut,xt){for(Ne=0;Ne<ut.length;Ne++){var Ct=ut[Ne],Vt=Ct[xt];!Ct.fixedrange&&Vt.tickmode==="sync"&&Ye.push(Vt._id)}}for(xe&&(nt(me),nt(Oe.xaxes),nt($e.xaxes),vt(te.overlays,"xaxis")),We&&(nt(ge),nt(Oe.yaxes),nt($e.yaxes),vt(te.overlays,"yaxis")),Ue={},Ne=0;Ne<Ye.length;Ne++){var Je=Ye[Ne],rt=x(q,Je);u.drawOne(q,rt,{skipTitle:!0}),Ue[rt._name+".range[0]"]=rt.range[0],Ue[rt._name+".range[1]"]=rt.range[1]}u.redrawComponents(q,Ye)}function It(){if(!q._transitioningWithDuration){var Ye=q._context.doubleClick,Ne=[];ze&&(Ne=Ne.concat(me)),je&&(Ne=Ne.concat(ge)),$e.xaxes&&(Ne=Ne.concat($e.xaxes)),$e.yaxes&&(Ne=Ne.concat($e.yaxes));var nt={},vt,Je;if(Ye==="reset+autosize")for(Ye="autosize",Je=0;Je<Ne.length;Je++){vt=Ne[Je];var rt=vt._rangeInitial0,ut=vt._rangeInitial1,xt=rt!==void 0||ut!==void 0;if(xt&&(rt!==void 0&&rt!==vt.range[0]||ut!==void 0&&ut!==vt.range[1])||!xt&&vt.autorange!==!0){Ye="reset";break}}if(Ye==="autosize")for(Je=0;Je<Ne.length;Je++)vt=Ne[Je],vt.fixedrange||(nt[vt._name+".autorange"]=!0);else if(Ye==="reset"){for((ze||Oe.isSubplotConstrained)&&(Ne=Ne.concat(Oe.xaxes)),je&&!Oe.isSubplotConstrained&&(Ne=Ne.concat(Oe.yaxes)),Oe.isSubplotConstrained&&(ze?je||(Ne=Ne.concat(ge)):Ne=Ne.concat(me)),Je=0;Je<Ne.length;Je++)if(vt=Ne[Je],!vt.fixedrange){var Ct=vt._name,Vt=vt._autorangeInitial;vt._rangeInitial0===void 0&&vt._rangeInitial1===void 0?nt[Ct+".autorange"]=!0:vt._rangeInitial0===void 0?(nt[Ct+".autorange"]=Vt,nt[Ct+".range"]=[null,vt._rangeInitial1]):vt._rangeInitial1===void 0?(nt[Ct+".range"]=[vt._rangeInitial0,null],nt[Ct+".autorange"]=Vt):nt[Ct+".range"]=[vt._rangeInitial0,vt._rangeInitial1]}}q.emit("plotly_doubleclick",null),n.call("_guiRelayout",q,nt)}}function Sr(){rr([0,0,Le,Ae]),e.syncOrAsync([g.previousPromises,function(){q._fullLayout._replotting=!1,n.call("_guiRelayout",q,Ue)}],q)}function rr(Ye){var Ne=q._fullLayout,nt=Ne._plots,vt=Ne._subplots.cartesian,Je,rt,ut,xt;if(Re&&n.subplotsRegistry.splom.drag(q),Xe){for(Je=0;Je<vt.length;Je++)if(rt=nt[vt[Je]],ut=rt.xaxis,xt=rt.yaxis,rt._scene){ut.limitRange&&ut.limitRange(),xt.limitRange&&xt.limitRange();var Ct=e.simpleMap(ut.range,ut.r2l),Vt=e.simpleMap(xt.range,xt.r2l);rt._scene.update({range:[Ct[0],Vt[0],Ct[1],Vt[1]]})}}if((Re||Xe)&&(b(q),_(q)),et){var Gt=Ye[2]/_e._length,Qt=Ye[3]/J._length;for(Je=0;Je<vt.length;Je++){rt=nt[vt[Je]],ut=rt.xaxis,xt=rt.yaxis;var Ft=(xe||$e.isSubplotConstrained)&&!ut.fixedrange&&be[ut._id],ar=(We||$e.isSubplotConstrained)&&!xt.fixedrange&&Z[xt._id],Rt,Ut,$r,Jt;if(Ft?(Rt=Gt,$r=pe||$e.isSubplotConstrained?Ye[0]:Aa(ut,Rt)):$e.xaHash[ut._id]?(Rt=Gt,$r=Ye[0]*ut._length/_e._length):$e.yaHash[ut._id]?(Rt=Qt,$r=je==="ns"?-Ye[1]*ut._length/J._length:Aa(ut,Rt,{n:"top",s:"bottom"}[je])):(Rt=Gr(ut,Gt,Qt),$r=Ur(ut,Rt)),Rt>1&&(ut.maxallowed!==void 0&&xe===(ut.range[0]<ut.range[1]?"e":"w")||ut.minallowed!==void 0&&xe===(ut.range[0]<ut.range[1]?"w":"e"))&&(Rt=1,$r=0),ar?(Ut=Qt,Jt=oe||$e.isSubplotConstrained?Ye[1]:Aa(xt,Ut)):$e.yaHash[xt._id]?(Ut=Qt,Jt=Ye[1]*xt._length/J._length):$e.xaHash[xt._id]?(Ut=Gt,Jt=ze==="ew"?-Ye[0]*xt._length/_e._length:Aa(xt,Ut,{e:"right",w:"left"}[ze])):(Ut=Gr(xt,Gt,Qt),Jt=Ur(xt,Ut)),Ut>1&&(xt.maxallowed!==void 0&&We===(xt.range[0]<xt.range[1]?"n":"s")||xt.minallowed!==void 0&&We===(xt.range[0]<xt.range[1]?"s":"n"))&&(Ut=1,Jt=0),!(!Rt&&!Ut)){Rt||(Rt=1),Ut||(Ut=1);var Wr=ut._offset-$r/Rt,gi=xt._offset-Jt/Ut;rt.clipRect.call(f.setTranslate,$r,Jt).call(f.setScale,Rt,Ut),rt.plot.call(f.setTranslate,Wr,gi).call(f.setScale,1/Rt,1/Ut),(Rt!==rt.xScaleFactor||Ut!==rt.yScaleFactor)&&(f.setPointGroupScale(rt.zoomScalePts,Rt,Ut),f.setTextPointsScale(rt.zoomScaleTxt,Rt,Ut)),f.hideOutsideRangePoints(rt.clipOnAxisFalseTraces,rt),rt.xScaleFactor=Rt,rt.yScaleFactor=Ut}}}}function Gr(Ye,Ne,nt){return Ye.fixedrange?0:xe&&Oe.xaHash[Ye._id]?Ne:We&&(Oe.isSubplotConstrained?Oe.xaHash:Oe.yaHash)[Ye._id]?nt:0}function Ur(Ye,Ne){return Ne?(Ye.range=Ye._r.slice(),M(Ye,Ne),Aa(Ye,Ne)):0}function Aa(Ye,Ne,nt){return Ye._length*(1-Ne)*y[nt||Ye.constraintoward||"middle"]}return se}function z(q,te,le,ce){var ye=e.ensureSingle(q.draglayer,te,le,function(ue){ue.classed("drag",!0).style({fill:"transparent","stroke-width":0}).attr("data-subplot",q.id)});return ye.call(v,ce),ye.node()}function H(q,te,le,ce,ye,ue,oe){var pe=z(q,"rect",te,le);return t.select(pe).call(f.setRect,ce,ye,ue,oe),pe}function D(q,te){for(var le=0;le<q.length;le++)if(!q[le].fixedrange)return te;return""}function P(q,te){var le=q.range[te],ce=Math.abs(le-q.range[1-te]),ye;return q.type==="date"?le:q.type==="log"?(ye=Math.ceil(Math.max(0,-Math.log(ce)/Math.LN10))+3,r("."+ye+"g")(Math.pow(10,le))):(ye=Math.floor(Math.log(Math.abs(le))/Math.LN10)-Math.floor(Math.log(ce)/Math.LN10)+4,r("."+String(ye)+"g")(le))}function k(q,te,le,ce,ye){for(var ue=0;ue<q.length;ue++){var oe=q[ue];if(!oe.fixedrange)if(oe.rangebreaks){var pe=oe._id.charAt(0)==="y",Me=pe?1-te:te,ve=pe?1-le:le;ce[oe._name+".range[0]"]=oe.l2r(oe.p2l(Me*oe._length)),ce[oe._name+".range[1]"]=oe.l2r(oe.p2l(ve*oe._length))}else{var ke=oe._rl[0],_e=oe._rl[1]-ke;ce[oe._name+".range[0]"]=oe.l2r(ke+_e*te),ce[oe._name+".range[1]"]=oe.l2r(ke+_e*le)}}if(ye&&ye.length){var J=(te+(1-le))/2;k(ye,J,1-J,ce,[])}}function C(q,te){for(var le=0;le<q.length;le++){var ce=q[le];if(!ce.fixedrange){if(ce.rangebreaks){var ye=0,ue=ce._length,oe=ce.p2l(ye+te)-ce.p2l(ye),pe=ce.p2l(ue+te)-ce.p2l(ue),Me=(oe+pe)/2;ce.range=[ce.l2r(ce._rl[0]-Me),ce.l2r(ce._rl[1]-Me)]}else ce.range=[ce.l2r(ce._rl[0]-te/ce._m),ce.l2r(ce._rl[1]-te/ce._m)];ce.limitRange&&ce.limitRange()}}}function $(q){return 1-(q>=0?Math.min(q,.9):1/(1/Math.max(q,-.3)+3.222))}function R(q,te,le){return q?q==="nsew"?le?"":te==="pan"?"move":"crosshair":q.toLowerCase()+"-resize":"pointer"}function j(q,te,le,ce,ye){return q.append("path").attr("class","zoombox").style({fill:te>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",o(le,ce)).attr("d",ye+"Z")}function G(q,te,le){return q.append("path").attr("class","zoombox-corners").style({fill:s.background,stroke:s.defaultLine,"stroke-width":1,opacity:0}).attr("transform",o(te,le)).attr("d","M0,0Z")}function Y(q,te,le,ce,ye,ue){q.attr("d",ce+"M"+le.l+","+le.t+"v"+le.h+"h"+le.w+"v-"+le.h+"h-"+le.w+"Z"),O(q,te,ye,ue)}function O(q,te,le,ce){le||(q.transition().style("fill",ce>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),te.transition().style("opacity",1).duration(200))}function K(q){t.select(q).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function W(q){F&&q.data&&q._context.showTips&&(e.notifier(e._(q,"Double-click to zoom back out"),"long"),F=!1)}function X(q,te){return"M"+(q.l-.5)+","+(te-E-.5)+"h-3v"+(2*E+1)+"h3ZM"+(q.r+.5)+","+(te-E-.5)+"h3v"+(2*E+1)+"h-3Z"}function B(q,te){return"M"+(te-E-.5)+","+(q.t-.5)+"v-3h"+(2*E+1)+"v3ZM"+(te-E-.5)+","+(q.b+.5)+"v3h"+(2*E+1)+"v-3Z"}function ee(q){var te=Math.floor(Math.min(q.b-q.t,q.r-q.l,E)/2);return"M"+(q.l-3.5)+","+(q.t-.5+te)+"h3v"+-te+"h"+te+"v-3h-"+(te+3)+"ZM"+(q.r+3.5)+","+(q.t-.5+te)+"h-3v"+-te+"h"+-te+"v-3h"+(te+3)+"ZM"+(q.r+3.5)+","+(q.b+.5-te)+"h-3v"+te+"h"+-te+"v3h"+(te+3)+"ZM"+(q.l-3.5)+","+(q.b+.5-te)+"h3v"+te+"h"+te+"v3h-"+(te+3)+"Z"}function ae(q,te,le,ce,ye){for(var ue=!1,oe={},pe={},Me,ve,ke,_e,J=(ye||{}).xaHash,be=(ye||{}).yaHash,Z=0;Z<te.length;Z++){var me=te[Z];for(Me in le)if(me[Me]){for(ke in me)!(ye&&(J[ke]||be[ke]))&&!(ke.charAt(0)==="x"?le:ce)[ke]&&(oe[ke]=Me);for(ve in ce)!(ye&&(J[ve]||be[ve]))&&me[ve]&&(ue=!0)}for(ve in ce)if(me[ve])for(_e in me)!(ye&&(J[_e]||be[_e]))&&!(_e.charAt(0)==="x"?le:ce)[_e]&&(pe[_e]=ve)}ue&&(e.extendFlat(oe,pe),pe={});var ge={},Pe=[];for(ke in oe){var Ee=x(q,ke);Pe.push(Ee),ge[Ee._id]=Ee}var Le={},Ae=[];for(_e in pe){var Oe=x(q,_e);Ae.push(Oe),Le[Oe._id]=Oe}return{xaHash:ge,yaHash:Le,xaxes:Pe,yaxes:Ae,xLinks:oe,yLinks:pe,isSubplotConstrained:ue}}function de(q,te){if(!i)q.onwheel!==void 0?q.onwheel=te:q.onmousewheel!==void 0?q.onmousewheel=te:q.isAddedWheelEvent||(q.isAddedWheelEvent=!0,q.addEventListener("wheel",te,{passive:!1}));else{var le=q.onwheel!==void 0?"wheel":"mousewheel";q._onwheel&&q.removeEventListener(le,q._onwheel),q._onwheel=te,q.addEventListener(le,te,{passive:!1})}}function fe(q){var te=[];for(var le in q)te.push(q[le]);return te}return Tv={makeDragBox:N,makeDragger:z,makeRectDragger:H,makeZoombox:j,makeCorners:G,updateZoombox:Y,xyCorners:ee,transitionZoombox:O,removeZoombox:K,showDoubleClickNotifier:W,attachWheelEventHandler:de},Tv}var T0;function M2(){return T0||(T0=1,function(t){var e=bt,r=Na,a=ai,i=Bi,n=iz().makeDragBox,o=Rr.DRAGGERSIZE;t.initInteractions=function(s){var f=s._fullLayout;if(s._context.staticPlot){e.select(s).selectAll(".drag").remove();return}if(!(!f._has("cartesian")&&!f._has("splom"))){var c=Object.keys(f._plots||{}).sort(function(v,p){if((f._plots[v].mainplot&&!0)===(f._plots[p].mainplot&&!0)){var d=v.split("y"),h=p.split("y");return d[0]===h[0]?Number(d[1]||1)-Number(h[1]||1):Number(d[0]||1)-Number(h[0]||1)}return f._plots[v].mainplot?1:-1});c.forEach(function(v){var p=f._plots[v],d=p.xaxis,h=p.yaxis;if(!p.mainplot){var m=n(s,p,d._offset,h._offset,d._length,h._length,"ns","ew");m.onmousemove=function(_){s._fullLayout._rehover=function(){s._fullLayout._hoversubplot===v&&s._fullLayout._plots[v]&&r.hover(s,_,v)},r.hover(s,_,v),s._fullLayout._lasthover=m,s._fullLayout._hoversubplot=v},m.onmouseout=function(_){s._dragging||(s._fullLayout._hoversubplot=null,a.unhover(s,_))},s._context.showAxisDragHandles&&(n(s,p,d._offset-o,h._offset-o,o,o,"n","w"),n(s,p,d._offset+d._length,h._offset-o,o,o,"n","e"),n(s,p,d._offset-o,h._offset+h._length,o,o,"s","w"),n(s,p,d._offset+d._length,h._offset+h._length,o,o,"s","e"))}if(s._context.showAxisDragHandles){if(v===d._mainSubplot){var y=d._mainLinePosition;d.side==="top"&&(y-=o),n(s,p,d._offset+d._length*.1,y,d._length*.8,o,"","ew"),n(s,p,d._offset,y,d._length*.1,o,"","w"),n(s,p,d._offset+d._length*.9,y,d._length*.1,o,"","e")}if(v===h._mainSubplot){var b=h._mainLinePosition;h.side!=="right"&&(b-=o),n(s,p,b,h._offset+h._length*.1,o,h._length*.8,"ns",""),n(s,p,b,h._offset+h._length*.9,o,h._length*.1,"s",""),n(s,p,b,h._offset,o,h._length*.1,"n","")}}});var u=f._hoverlayer.node();u.onmousemove=function(v){v.target=s._fullLayout._lasthover,r.hover(s,v,f._hoversubplot)},u.onclick=function(v){v.target=s._fullLayout._lasthover,r.click(s,v)},u.onmousedown=function(v){s._fullLayout._lasthover.onmousedown(v)},t.updateFx(s)}},t.updateFx=function(l){var s=l._fullLayout,f=s.dragmode==="pan"?"move":"crosshair";i(s._draggers,f)}}(tv)),tv}var ws={},k0=ot,nz=function(e){for(var r=k0.layoutArrayContainers,a=k0.layoutArrayRegexes,i=e.split("[")[0],n,o,l=0;l<a.length;l++)if(o=e.match(a[l]),o&&o.index===0){n=o[0];break}if(n||(n=r[r.indexOf(i)]),!n)return!1;var s=e.substr(n.length);return s?(o=s.match(/^\[(0|[1-9][0-9]*)\](\.(.+))?$/),o?{array:n,index:Number(o[1]),property:o[3]||""}:!1):{array:n,index:"",property:""}},oz=Dn,kv=Gh,hl=Uo,lz=Xh.sorterAsc,Av=ot;ws.containerArrayMatch=nz;var sz=ws.isAddVal=function(e){return e==="add"||oz(e)},A0=ws.isRemoveVal=function(e){return e===null||e==="remove"};ws.applyContainerArrayChanges=function(e,r,a,i,n){var o=r.astr,l=Av.getComponentMethod(o,"supplyLayoutDefaults"),s=Av.getComponentMethod(o,"draw"),f=Av.getComponentMethod(o,"drawOne"),c=i.replot||i.recalc||l===kv||s===kv,u=e.layout,v=e._fullLayout;if(a[""]){Object.keys(a).length>1&&hl.warn("Full array edits are incompatible with other edits",o);var p=a[""][""];if(A0(p))r.set(null);else if(Array.isArray(p))r.set(p);else return hl.warn("Unrecognized full array edit value",o,p),!0;return c?!1:(l(u,v),s(e),!0)}var d=Object.keys(a).map(Number).sort(lz),h=r.get(),m=h||[],y=n(v,o).get(),b=[],_=-1,g=m.length,x,w,T,A,M,S,L,E;for(x=0;x<d.length;x++){if(T=d[x],A=a[T],M=Object.keys(A),S=A[""],L=sz(S),T<0||T>m.length-(L?0:1)){hl.warn("index out of range",o,T);continue}if(S!==void 0)M.length>1&&hl.warn("Insertion & removal are incompatible with edits to the same index.",o,T),A0(S)?b.push(T):L?(S==="add"&&(S={}),m.splice(T,0,S),y&&y.splice(T,0,{})):hl.warn("Unrecognized full object edit value",o,T,S),_===-1&&(_=T);else for(w=0;w<M.length;w++)E=o+"["+T+"].",n(m[T],M[w],E).set(A[M[w]])}for(x=b.length-1;x>=0;x--)m.splice(b[x],1),y&&y.splice(b[x],1);if(m.length?h||r.set(m):r.set(null),c)return!1;if(l(u,v),f!==kv){var F;if(_===-1)F=d;else{for(g=Math.max(m.length,g),F=[],x=0;x<d.length&&(T=d[x],!(T>=_));x++)F.push(T);for(x=_;x<g;x++)F.push(x)}for(x=0;x<F.length;x++)f(e,F[x])}else s(e);return!0};var S2={};(function(t){var e=kt,r=ot,a=we,i=hr,n=cr,o=yt,l=n.cleanId,s=n.getFromTrace,f=r.traceIs;t.clearPromiseQueue=function(b){Array.isArray(b._promises)&&b._promises.length>0&&a.log("Clearing previous rejected promises from queue."),b._promises=[]},t.cleanLayout=function(b){var _;b||(b={}),b.xaxis1&&(b.xaxis||(b.xaxis=b.xaxis1),delete b.xaxis1),b.yaxis1&&(b.yaxis||(b.yaxis=b.yaxis1),delete b.yaxis1),b.scene1&&(b.scene||(b.scene=b.scene1),delete b.scene1);var g=(i.subplotsRegistry.cartesian||{}).attrRegex;(i.subplotsRegistry.polar||{}).attrRegex,(i.subplotsRegistry.ternary||{}).attrRegex,(i.subplotsRegistry.gl3d||{}).attrRegex;var x=Object.keys(b);for(_=0;_<x.length;_++){var w=x[_];if(g&&g.test(w)){var T=b[w];T.anchor&&T.anchor!=="free"&&(T.anchor=l(T.anchor)),T.overlaying&&(T.overlaying=l(T.overlaying)),T.type||(T.isdate?T.type="date":T.islog?T.type="log":T.isdate===!1&&T.islog===!1&&(T.type="linear")),(T.autorange==="withzero"||T.autorange==="tozero")&&(T.autorange=!0,T.rangemode="tozero"),T.insiderange&&delete T.range,delete T.islog,delete T.isdate,delete T.categories,d(T,"domain")&&delete T.domain}}var A=Array.isArray(b.annotations)?b.annotations.length:0;for(_=0;_<A;_++){var M=b.annotations[_];a.isPlainObject(M)&&(c(M,"xref"),c(M,"yref"))}var S=Array.isArray(b.shapes)?b.shapes.length:0;for(_=0;_<S;_++){var L=b.shapes[_];a.isPlainObject(L)&&(c(L,"xref"),c(L,"yref"))}var E=Array.isArray(b.images)?b.images.length:0;for(_=0;_<E;_++){var F=b.images[_];a.isPlainObject(F)&&(c(F,"xref"),c(F,"yref"))}var N=b.legend;return N&&(N.x>3?(N.x=1.02,N.xanchor="left"):N.x<-2&&(N.x=-.02,N.xanchor="right"),N.y>3?(N.y=1.02,N.yanchor="bottom"):N.y<-2&&(N.y=-.02,N.yanchor="top")),b.dragmode==="rotate"&&(b.dragmode="orbit"),o.clean(b),b.template&&b.template.layout&&t.cleanLayout(b.template.layout),b};function c(b,_){var g=b[_],x=_.charAt(0);g&&g!=="paper"&&(b[_]=l(g,x,!0))}t.cleanData=function(b){for(var _=0;_<b.length;_++){var g=b[_],x;if(g.type==="histogramy"&&"xbins"in g&&!("ybins"in g)&&(g.ybins=g.xbins,delete g.xbins),g.type==="histogramy"&&t.swapXYData(g),(g.type==="histogramx"||g.type==="histogramy")&&(g.type="histogram"),"scl"in g&&!("colorscale"in g)&&(g.colorscale=g.scl,delete g.scl),"reversescl"in g&&!("reversescale"in g)&&(g.reversescale=g.reversescl,delete g.reversescl),g.xaxis&&(g.xaxis=l(g.xaxis,"x")),g.yaxis&&(g.yaxis=l(g.yaxis,"y")),f(g,"gl3d")&&g.scene&&(g.scene=i.subplotsRegistry.gl3d.cleanId(g.scene)),!f(g,"pie-like")&&!f(g,"bar-like"))if(Array.isArray(g.textposition))for(x=0;x<g.textposition.length;x++)g.textposition[x]=p(g.textposition[x]);else g.textposition&&(g.textposition=p(g.textposition));var w=r.getModule(g);if(w&&w.colorbar){var T=w.colorbar.container,A=T?g[T]:g;A&&A.colorscale&&(A.colorscale==="YIGnBu"&&(A.colorscale="YlGnBu"),A.colorscale==="YIOrRd"&&(A.colorscale="YlOrRd"))}if(g.type==="surface"&&a.isPlainObject(g.contours)){var M=["x","y","z"];for(x=0;x<M.length;x++){var S=g.contours[M[x]];a.isPlainObject(S)&&(S.highlightColor&&(S.highlightcolor=S.highlightColor,delete S.highlightColor),S.highlightWidth&&(S.highlightwidth=S.highlightWidth,delete S.highlightWidth))}}if(g.type==="candlestick"||g.type==="ohlc"){var L=(g.increasing||{}).showlegend!==!1,E=(g.decreasing||{}).showlegend!==!1,F=u(g.increasing),N=u(g.decreasing);if(F!==!1&&N!==!1){var z=v(F,N,L,E);z&&(g.name=z)}else(F||N)&&!g.name&&(g.name=F||N)}d(g,"line")&&delete g.line,"marker"in g&&(d(g.marker,"line")&&delete g.marker.line,d(g,"marker")&&delete g.marker),o.clean(g),g.autobinx&&(delete g.autobinx,delete g.xbins),g.autobiny&&(delete g.autobiny,delete g.ybins)}};function u(b){if(!a.isPlainObject(b))return!1;var _=b.name;return delete b.name,delete b.showlegend,(typeof _=="string"||typeof _=="number")&&String(_)}function v(b,_,g,x){if(g&&!x)return b;if(x&&!g||!b.trim())return _;if(!_.trim())return b;var w=Math.min(b.length,_.length),T;for(T=0;T<w&&b.charAt(T)===_.charAt(T);T++);var A=b.substr(0,T);return A.trim()}function p(b){var _="middle",g="center";return typeof b=="string"&&(b.indexOf("top")!==-1?_="top":b.indexOf("bottom")!==-1&&(_="bottom"),b.indexOf("left")!==-1?g="left":b.indexOf("right")!==-1&&(g="right")),_+" "+g}function d(b,_){return _ in b&&typeof b[_]=="object"&&Object.keys(b[_]).length===0}t.swapXYData=function(b){var _;if(a.swapAttrs(b,["?","?0","d?","?bins","nbins?","autobin?","?src","error_?"]),Array.isArray(b.z)&&Array.isArray(b.z[0])&&(b.transpose?delete b.transpose:b.transpose=!0),b.error_x&&b.error_y){var g=b.error_y,x="copy_ystyle"in g?g.copy_ystyle:!(g.color||g.thickness||g.width);a.swapAttrs(b,["error_?.copy_ystyle"]),x&&a.swapAttrs(b,["error_?.color","error_?.thickness","error_?.width"])}if(typeof b.hoverinfo=="string"){var w=b.hoverinfo.split("+");for(_=0;_<w.length;_++)w[_]==="x"?w[_]="y":w[_]==="y"&&(w[_]="x");b.hoverinfo=w.join("+")}},t.coerceTraceIndices=function(b,_){if(e(_))return[_];if(!Array.isArray(_)||!_.length)return b.data.map(function(w,T){return T});if(Array.isArray(_)){for(var g=[],x=0;x<_.length;x++)a.isIndex(_[x],b.data.length)?g.push(_[x]):a.warn("trace index (",_[x],") is not a number or is out of bounds");return g}return _},t.manageArrayContainers=function(b,_,g){var x=b.obj,w=b.parts,T=w.length,A=w[T-1],M=e(A);if(M&&_===null){var S=w.slice(0,T-1).join("."),L=a.nestedProperty(x,S).get();L.splice(A,1)}else M&&b.get()===void 0&&b.get()===void 0&&(g[b.astr]=null),b.set(_)};var h=/(\.[^\[\]\.]+|\[[^\[\]\.]+\])$/;function m(b){var _=b.search(h);if(_>0)return b.substr(0,_)}t.hasParent=function(b,_){for(var g=m(_);g;){if(g in b)return!0;g=m(g)}return!1};var y=["x","y","z"];t.clearAxisTypes=function(b,_,g){for(var x=0;x<_.length;x++)for(var w=b._fullData[x],T=0;T<3;T++){var A=s(b,w,y[T]);if(A&&A.type!=="log"){var M=A._name,S=A._id.substr(1);if(S.substr(0,5)==="scene"){if(g[S]!==void 0)continue;M=S+"."+M}var L=M+".type";g[M]===void 0&&g[L]===void 0&&a.nestedProperty(b.layout,L).set(null)}}}})(S2);(function(t){var e=bt,r=kt,a=Y1,i=we,n=i.nestedProperty,o=ms,l=WL,s=ot,f=Xo,c=hr,u=Ot,v=aT,p=ti,d=Et,h=yt,m=M2().initInteractions,y=Yo,b=Rl.clearOutline,_=Go.dfltConfig,g=ws,x=S2,w=ou,T=Ja,A=Rr.AX_NAME_PATTERN,M=0,S=5;function L(I,U,V,Q){var se;if(I=i.getGraphDiv(I),o.init(I),i.isPlainObject(U)){var re=U;U=re.data,V=re.layout,Q=re.config,se=re.frames}var Ce=o.triggerHandler(I,"plotly_beforeplot",[U,V,Q]);if(Ce===!1)return Promise.reject();!U&&!V&&!i.isPlotDiv(I)&&i.warn("Calling _doPlot as if redrawing but this container doesn't yet have a plot.",I);function Se(){if(se)return t.addFrames(I,se)}H(I,Q),V||(V={}),e.select(I).classed("js-plotly-plot",!0),d.makeTester(),Array.isArray(I._promises)||(I._promises=[]);var he=(I.data||[]).length===0&&Array.isArray(U);Array.isArray(U)&&(x.cleanData(U),he?I.data=U:I.data.push.apply(I.data,U),I.empty=!1),(!I.layout||he)&&(I.layout=x.cleanLayout(V)),c.supplyDefaults(I);var ne=I._fullLayout,Te=ne._has("cartesian");ne._replotting=!0,(he||ne._shouldCreateBgLayer)&&(Ue(I),ne._shouldCreateBgLayer&&delete ne._shouldCreateBgLayer),d.initGradients(I),d.initPatterns(I),he&&u.saveShowSpikeInitial(I);var Ie=!I.calcdata||I.calcdata.length!==(I._fullData||[]).length;Ie&&c.doCalcdata(I);for(var Ge=0;Ge<I.calcdata.length;Ge++)I.calcdata[Ge][0].trace=I._fullData[Ge];I._context.responsive?I._responsiveChartHandler||(I._responsiveChartHandler=function(){i.isHidden(I)||c.resize(I)},window.addEventListener("resize",I._responsiveChartHandler)):i.clearResponsive(I);var Fe=i.extendFlat({},ne._size),tt=0;function st(){for(var ct=ne._basePlotModules,Ke=0;Ke<ct.length;Ke++)ct[Ke].drawFramework&&ct[Ke].drawFramework(I);!ne._glcanvas&&ne._has("gl")&&(ne._glcanvas=ne._glcontainer.selectAll(".gl-canvas").data([{key:"contextLayer",context:!0,pick:!1},{key:"focusLayer",context:!1,pick:!1},{key:"pickLayer",context:!1,pick:!0}],function(Qe){return Qe.key}),ne._glcanvas.enter().append("canvas").attr("class",function(Qe){return"gl-canvas gl-canvas-"+Qe.key.replace("Layer","")}).style({position:"absolute",top:0,left:0,overflow:"visible","pointer-events":"none"}));var it=I._context.plotGlPixelRatio;if(ne._glcanvas){ne._glcanvas.attr("width",ne.width*it).attr("height",ne.height*it).style("width",ne.width+"px").style("height",ne.height+"px");var pt=ne._glcanvas.data()[0].regl;if(pt&&(Math.floor(ne.width*it)!==pt._gl.drawingBufferWidth||Math.floor(ne.height*it)!==pt._gl.drawingBufferHeight)){var Tt="WebGL context buffer and canvas dimensions do not match due to browser/WebGL bug.";if(tt)i.error(Tt);else return i.log(Tt+" Clearing graph and plotting again."),c.cleanPlot([],{},I._fullData,ne),c.supplyDefaults(I),ne=I._fullLayout,c.doCalcdata(I),tt++,st()}}return ne.modebar.orientation==="h"?ne._modebardiv.style("height",null).style("width","100%"):ne._modebardiv.style("width",null).style("height",ne.height+"px"),c.previousPromises(I)}function Ve(){if(c.clearAutoMarginIds(I),w.drawMarginPushers(I),u.allowAutoMargin(I),I._fullLayout.title.text&&I._fullLayout.title.automargin&&c.allowAutoMargin(I,"title.automargin"),ne._has("pie"))for(var ct=I._fullData,Ke=0;Ke<ct.length;Ke++){var it=ct[Ke];it.type==="pie"&&it.automargin&&c.allowAutoMargin(I,"pie."+it.uid+".automargin")}return c.doAutoMargin(I),c.previousPromises(I)}function Lt(){if(c.didMarginChange(Fe,ne._size))return i.syncOrAsync([Ve,w.layoutStyles],I)}function ft(){if(!Ie){Ze();return}return i.syncOrAsync([s.getComponentMethod("shapes","calcAutorange"),s.getComponentMethod("annotations","calcAutorange"),Ze],I)}function Ze(){I._transitioning||(w.doAutoRangeAndConstraints(I),he&&u.saveRangeInitial(I),s.getComponentMethod("rangeslider","calcAutorange")(I))}function gt(){return u.draw(I,he?"":"redraw")}var wt=[c.previousPromises,Se,st,Ve,Lt];Te&&wt.push(ft),wt.push(w.layoutStyles),Te&&wt.push(gt,function(Ke){var it=Ke._fullLayout._insideTickLabelsUpdaterange;if(it)return Ke._fullLayout._insideTickLabelsUpdaterange=void 0,ce(Ke,it).then(function(){u.saveRangeInitial(Ke,!0)})}),wt.push(w.drawData,w.finalDraw,m,c.addLinks,c.rehover,c.redrag,c.reselect,c.doAutoMargin,c.previousPromises);var lt=i.syncOrAsync(wt,I);return(!lt||!lt.then)&&(lt=Promise.resolve()),lt.then(function(){return E(I),I})}function E(I){var U=I._fullLayout;U._redrawFromAutoMarginCount?U._redrawFromAutoMarginCount--:I.emit("plotly_afterplot")}function F(I){return i.extendFlat(_,I)}function N(I,U){try{I._fullLayout._paper.style("background",U)}catch(V){i.error(V)}}function z(I,U){var V=h.combine(U,"white");N(I,V)}function H(I,U){if(!I._context){I._context=i.extendDeep({},_);var V=e.select("base");I._context._baseUrl=V.size()&&V.attr("href")?window.location.href.split("#")[0]:""}var Q=I._context,se,re,Ce;if(U){for(re=Object.keys(U),se=0;se<re.length;se++)Ce=re[se],!(Ce==="editable"||Ce==="edits")&&Ce in Q&&(Ce==="setBackground"&&U[Ce]==="opaque"?Q[Ce]=z:Q[Ce]=U[Ce]);var Se=U.editable;if(Se!==void 0)for(Q.editable=Se,re=Object.keys(Q.edits),se=0;se<re.length;se++)Q.edits[re[se]]=Se;if(U.edits)for(re=Object.keys(U.edits),se=0;se<re.length;se++)Ce=re[se],Ce in Q.edits&&(Q.edits[Ce]=U.edits[Ce]);Q._exportedPlot=U._exportedPlot}Q.staticPlot&&(Q.editable=!1,Q.edits={},Q.autosizable=!1,Q.scrollZoom=!1,Q.doubleClick=!1,Q.showTips=!1,Q.showLink=!1,Q.displayModeBar=!1),Q.displayModeBar==="hover"&&!a&&(Q.displayModeBar=!0),(Q.setBackground==="transparent"||typeof Q.setBackground!="function")&&(Q.setBackground=N),Q._hasZeroHeight=Q._hasZeroHeight||I.clientHeight===0,Q._hasZeroWidth=Q._hasZeroWidth||I.clientWidth===0;var he=Q.scrollZoom,ne=Q._scrollZoom={};if(he===!0)ne.cartesian=1,ne.gl3d=1,ne.geo=1,ne.mapbox=1,ne.map=1;else if(typeof he=="string"){var Te=he.split("+");for(se=0;se<Te.length;se++)ne[Te[se]]=1}else he!==!1&&(ne.gl3d=1,ne.geo=1,ne.mapbox=1,ne.map=1)}function D(I){if(I=i.getGraphDiv(I),!i.isPlotDiv(I))throw new Error("This element is not a Plotly plot: "+I);return x.cleanData(I.data),x.cleanLayout(I.layout),I.calcdata=void 0,t._doPlot(I).then(function(){return I.emit("plotly_redraw"),I})}function P(I,U,V,Q){return I=i.getGraphDiv(I),c.cleanPlot([],{},I._fullData||[],I._fullLayout||{}),c.purge(I),t._doPlot(I,U,V,Q)}function k(I,U){var V=U+1,Q=[],se,re;for(se=0;se<I.length;se++)re=I[se],re<0?Q.push(V+re):Q.push(re);return Q}function C(I,U,V){var Q,se;for(Q=0;Q<U.length;Q++){if(se=U[Q],se!==parseInt(se,10))throw new Error("all values in "+V+" must be integers");if(se>=I.data.length||se<-I.data.length)throw new Error(V+" must be valid indices for gd.data.");if(U.indexOf(se,Q+1)>-1||se>=0&&U.indexOf(-I.data.length+se)>-1||se<0&&U.indexOf(I.data.length+se)>-1)throw new Error("each index in "+V+" must be unique.")}}function $(I,U,V){if(!Array.isArray(I.data))throw new Error("gd.data must be an array.");if(typeof U>"u")throw new Error("currentIndices is a required argument.");if(Array.isArray(U)||(U=[U]),C(I,U,"currentIndices"),typeof V<"u"&&!Array.isArray(V)&&(V=[V]),typeof V<"u"&&C(I,V,"newIndices"),typeof V<"u"&&U.length!==V.length)throw new Error("current and new indices must be of equal length.")}function R(I,U,V){var Q,se;if(!Array.isArray(I.data))throw new Error("gd.data must be an array.");if(typeof U>"u")throw new Error("traces must be defined.");for(Array.isArray(U)||(U=[U]),Q=0;Q<U.length;Q++)if(se=U[Q],typeof se!="object"||Array.isArray(se)||se===null)throw new Error("all values in traces array must be non-array objects");if(typeof V<"u"&&!Array.isArray(V)&&(V=[V]),typeof V<"u"&&V.length!==U.length)throw new Error("if indices is specified, traces.length must equal indices.length")}function j(I,U,V,Q){var se=i.isPlainObject(Q);if(!Array.isArray(I.data))throw new Error("gd.data must be an array");if(!i.isPlainObject(U))throw new Error("update must be a key:value object");if(typeof V>"u")throw new Error("indices must be an integer or array of integers");C(I,V,"indices");for(var re in U){if(!Array.isArray(U[re])||U[re].length!==V.length)throw new Error("attribute "+re+" must be an array of length equal to indices array length");if(se&&(!(re in Q)||!Array.isArray(Q[re])||Q[re].length!==U[re].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}function G(I,U,V,Q){var se=i.isPlainObject(Q),re=[],Ce,Se,he,ne,Te;Array.isArray(V)||(V=[V]),V=k(V,I.data.length-1);for(var Ie in U)for(var Ge=0;Ge<V.length;Ge++){if(Ce=I.data[V[Ge]],he=n(Ce,Ie),Se=he.get(),ne=U[Ie][Ge],!i.isArrayOrTypedArray(ne))throw new Error("attribute: "+Ie+" index: "+Ge+" must be an array");if(!i.isArrayOrTypedArray(Se))throw new Error("cannot extend missing or non-array attribute: "+Ie);if(Se.constructor!==ne.constructor)throw new Error("cannot extend array with an array of a different type: "+Ie);Te=se?Q[Ie][Ge]:Q,r(Te)||(Te=-1),re.push({prop:he,target:Se,insert:ne,maxp:Math.floor(Te)})}return re}function Y(I,U,V,Q,se){j(I,U,V,Q);for(var re=G(I,U,V,Q),Ce={},Se={},he=0;he<re.length;he++){var ne=re[he].prop,Te=re[he].maxp,Ie=se(re[he].target,re[he].insert,Te);ne.set(Ie[0]),Array.isArray(Ce[ne.astr])||(Ce[ne.astr]=[]),Ce[ne.astr].push(Ie[1]),Array.isArray(Se[ne.astr])||(Se[ne.astr]=[]),Se[ne.astr].push(re[he].target.length)}return{update:Ce,maxPoints:Se}}function O(I,U){var V=new I.constructor(I.length+U.length);return V.set(I),V.set(U,I.length),V}function K(I,U,V,Q){I=i.getGraphDiv(I);function se(he,ne,Te){var Ie,Ge;if(i.isTypedArray(he))if(Te<0){var Fe=new he.constructor(0),tt=O(he,ne);Te<0?(Ie=tt,Ge=Fe):(Ie=Fe,Ge=tt)}else if(Ie=new he.constructor(Te),Ge=new he.constructor(he.length+ne.length-Te),Te===ne.length)Ie.set(ne),Ge.set(he);else if(Te<ne.length){var st=ne.length-Te;Ie.set(ne.subarray(st)),Ge.set(he),Ge.set(ne.subarray(0,st),he.length)}else{var Ve=Te-ne.length,Lt=he.length-Ve;Ie.set(he.subarray(Lt)),Ie.set(ne,Ve),Ge.set(he.subarray(0,Lt))}else Ie=he.concat(ne),Ge=Te>=0&&Te<Ie.length?Ie.splice(0,Ie.length-Te):[];return[Ie,Ge]}var re=Y(I,U,V,Q,se),Ce=t.redraw(I),Se=[I,re.update,V,re.maxPoints];return l.add(I,t.prependTraces,Se,K,arguments),Ce}function W(I,U,V,Q){I=i.getGraphDiv(I);function se(he,ne,Te){var Ie,Ge;if(i.isTypedArray(he))if(Te<=0){var Fe=new he.constructor(0),tt=O(ne,he);Te<0?(Ie=tt,Ge=Fe):(Ie=Fe,Ge=tt)}else if(Ie=new he.constructor(Te),Ge=new he.constructor(he.length+ne.length-Te),Te===ne.length)Ie.set(ne),Ge.set(he);else if(Te<ne.length){var st=ne.length-Te;Ie.set(ne.subarray(0,st)),Ge.set(ne.subarray(st)),Ge.set(he,st)}else{var Ve=Te-ne.length;Ie.set(ne),Ie.set(he.subarray(0,Ve),ne.length),Ge.set(he.subarray(Ve))}else Ie=ne.concat(he),Ge=Te>=0&&Te<Ie.length?Ie.splice(Te,Ie.length):[];return[Ie,Ge]}var re=Y(I,U,V,Q,se),Ce=t.redraw(I),Se=[I,re.update,V,re.maxPoints];return l.add(I,t.extendTraces,Se,W,arguments),Ce}function X(I,U,V){I=i.getGraphDiv(I);var Q=[],se=t.deleteTraces,re=X,Ce=[I,Q],Se=[I,U],he,ne;for(R(I,U,V),Array.isArray(U)||(U=[U]),U=U.map(function(Te){return i.extendFlat({},Te)}),x.cleanData(U),he=0;he<U.length;he++)I.data.push(U[he]);for(he=0;he<U.length;he++)Q.push(-U.length+he);if(typeof V>"u")return ne=t.redraw(I),l.add(I,se,Ce,re,Se),ne;Array.isArray(V)||(V=[V]);try{$(I,Q,V)}catch(Te){throw I.data.splice(I.data.length-U.length,U.length),Te}return l.startSequence(I),l.add(I,se,Ce,re,Se),ne=t.moveTraces(I,Q,V),l.stopSequence(I),ne}function B(I,U){I=i.getGraphDiv(I);var V=[],Q=t.addTraces,se=B,re=[I,V,U],Ce=[I,U],Se,he;if(typeof U>"u")throw new Error("indices must be an integer or array of integers.");for(Array.isArray(U)||(U=[U]),C(I,U,"indices"),U=k(U,I.data.length-1),U.sort(i.sorterDes),Se=0;Se<U.length;Se+=1)he=I.data.splice(U[Se],1)[0],V.push(he);var ne=t.redraw(I);return l.add(I,Q,re,se,Ce),ne}function ee(I,U,V){I=i.getGraphDiv(I);var Q=[],se=[],re=ee,Ce=ee,Se=[I,V,U],he=[I,U,V],ne;if($(I,U,V),U=Array.isArray(U)?U:[U],typeof V>"u")for(V=[],ne=0;ne<U.length;ne++)V.push(-U.length+ne);for(V=Array.isArray(V)?V:[V],U=k(U,I.data.length-1),V=k(V,I.data.length-1),ne=0;ne<I.data.length;ne++)U.indexOf(ne)===-1&&Q.push(I.data[ne]);for(ne=0;ne<U.length;ne++)se.push({newIndex:V[ne],trace:I.data[U[ne]]});for(se.sort(function(Ie,Ge){return Ie.newIndex-Ge.newIndex}),ne=0;ne<se.length;ne+=1)Q.splice(se[ne].newIndex,0,se[ne].trace);I.data=Q;var Te=t.redraw(I);return l.add(I,re,Se,Ce,he),Te}function ae(I,U,V,Q){I=i.getGraphDiv(I),x.clearPromiseQueue(I);var se={};if(typeof U=="string")se[U]=V;else if(i.isPlainObject(U))se=i.extendFlat({},U),Q===void 0&&(Q=V);else return i.warn("Restyle fail.",U,V,Q),Promise.reject();Object.keys(se).length&&(I.changed=!0);var re=x.coerceTraceIndices(I,Q),Ce=le(I,se,re),Se=Ce.flags;Se.calc&&(I.calcdata=void 0),Se.clearAxisTypes&&x.clearAxisTypes(I,re,{});var he=[];Se.fullReplot?he.push(t._doPlot):(he.push(c.previousPromises),c.supplyDefaults(I),Se.markerSize&&(c.doCalcdata(I),ue(he)),Se.style&&he.push(w.doTraceStyle),Se.colorbars&&he.push(w.doColorBars),he.push(E)),he.push(c.rehover,c.redrag,c.reselect),l.add(I,ae,[I,Ce.undoit,Ce.traces],ae,[I,Ce.redoit,Ce.traces]);var ne=i.syncOrAsync(he,I);return(!ne||!ne.then)&&(ne=Promise.resolve()),ne.then(function(){return I.emit("plotly_restyle",Ce.eventData),I})}function de(I){return I===void 0?null:I}function fe(I,U){return U?function(V,Q,se){var re=n(V,Q),Ce=re.set;return re.set=function(Se){var he=(se||"")+Q;q(he,re.get(),Se,I),Ce(Se)},re}:n}function q(I,U,V,Q){if(Array.isArray(U)||Array.isArray(V))for(var se=Array.isArray(U)?U:[],re=Array.isArray(V)?V:[],Ce=Math.max(se.length,re.length),Se=0;Se<Ce;Se++)q(I+"["+Se+"]",se[Se],re[Se],Q);else if(i.isPlainObject(U)||i.isPlainObject(V)){var he=i.isPlainObject(U)?U:{},ne=i.isPlainObject(V)?V:{},Te=i.extendFlat({},he,ne);for(var Ie in Te)q(I+"."+Ie,he[Ie],ne[Ie],Q)}else Q[I]===void 0&&(Q[I]=de(U))}function te(I,U,V){for(var Q in V){var se=n(I,Q);q(Q,se.get(),V[Q],U)}}function le(I,U,V){var Q=I._fullLayout,se=I._fullData,re=I.data,Ce=Q._guiEditing,Se=fe(Q._preGUI,Ce),he=i.extendDeepAll({},U),ne,Te=T.traceFlags(),Ie={},Ge={},Fe;function tt(){return V.map(function(){})}function st(Ft){var ar=u.id2name(Ft);Fe.indexOf(ar)===-1&&Fe.push(ar)}function Ve(Ft){return"LAYOUT"+Ft+".autorange"}function Lt(Ft){return"LAYOUT"+Ft+".range"}function ft(Ft){for(var ar=Ft;ar<se.length;ar++)if(se[ar]._input===re[Ft])return se[ar]}function Ze(Ft,ar,Rt){if(Array.isArray(Ft)){Ft.forEach(function(Wr){Ze(Wr,ar,Rt)});return}if(!(Ft in U||x.hasParent(U,Ft))){var Ut;if(Ft.substr(0,6)==="LAYOUT")Ut=Se(I.layout,Ft.replace("LAYOUT",""));else{var $r=V[Rt],Jt=Q._tracePreGUI[ft($r)._fullInput.uid];Ut=fe(Jt,Ce)(re[$r],Ft)}Ft in Ge||(Ge[Ft]=tt()),Ge[Ft][Rt]===void 0&&(Ge[Ft][Rt]=de(Ut.get())),ar!==void 0&&Ut.set(ar)}}function gt(Ft){return function(ar){return se[ar][Ft]}}function wt(Ft){return function(ar,Rt){return ar===!1?se[V[Rt]][Ft]:null}}for(var lt in U){if(x.hasParent(U,lt))throw new Error("cannot set "+lt+" and a parent attribute simultaneously");var ct=U[lt],Ke,it,pt,Tt,Qe,At;if((lt==="autobinx"||lt==="autobiny")&&(lt=lt.charAt(lt.length-1)+"bins",Array.isArray(ct)?ct=ct.map(wt(lt)):ct===!1?ct=V.map(gt(lt)):ct=null),Ie[lt]=ct,lt.substr(0,6)==="LAYOUT"){pt=Se(I.layout,lt.replace("LAYOUT","")),Ge[lt]=[de(pt.get())],pt.set(Array.isArray(ct)?ct[0]:ct),Te.calc=!0;continue}for(Ge[lt]=tt(),ne=0;ne<V.length;ne++){Ke=re[V[ne]],it=ft(V[ne]);var It=Q._tracePreGUI[it._fullInput.uid];if(pt=fe(It,Ce)(Ke,lt),Tt=pt.get(),Qe=Array.isArray(ct)?ct[ne%ct.length]:ct,Qe!==void 0){var Sr=pt.parts[pt.parts.length-1],rr=lt.substr(0,lt.length-Sr.length-1),Gr=rr?rr+".":"",Ur=rr?n(it,rr).get():it;if(At=f.getTraceValObject(it,pt.parts),At&&At.impliedEdits&&Qe!==null)for(var Aa in At.impliedEdits)Ze(i.relativeAttr(lt,Aa),At.impliedEdits[Aa],ne);else if((Sr==="thicknessmode"||Sr==="lenmode")&&Tt!==Qe&&(Qe==="fraction"||Qe==="pixels")&&Ur){var Ye=Q._size,Ne=Ur.orient,nt=Ne==="top"||Ne==="bottom";if(Sr==="thicknessmode"){var vt=nt?Ye.h:Ye.w;Ze(Gr+"thickness",Ur.thickness*(Qe==="fraction"?1/vt:vt),ne)}else{var Je=nt?Ye.w:Ye.h;Ze(Gr+"len",Ur.len*(Qe==="fraction"?1/Je:Je),ne)}}else if(lt==="type"&&(Qe==="pie"!=(Tt==="pie")||Qe==="funnelarea"!=(Tt==="funnelarea"))){var rt="x",ut="y";(Qe==="bar"||Tt==="bar")&&Ke.orientation==="h"&&(rt="y",ut="x"),i.swapAttrs(Ke,["?","?src"],"labels",rt),i.swapAttrs(Ke,["d?","?0"],"label",rt),i.swapAttrs(Ke,["?","?src"],"values",ut),Tt==="pie"||Tt==="funnelarea"?(n(Ke,"marker.color").set(n(Ke,"marker.colors").get()),Q._pielayer.selectAll("g.trace").remove()):s.traceIs(Ke,"cartesian")&&n(Ke,"marker.colors").set(n(Ke,"marker.color").get())}Ge[lt][ne]=de(Tt);var xt=["swapxy","swapxyaxes","orientation","orientationaxes"];if(xt.indexOf(lt)!==-1){if(lt==="orientation"){pt.set(Qe);var Ct=Ke.x&&!Ke.y?"h":"v";if((pt.get()||Ct)===it.orientation)continue}else lt==="orientationaxes"&&(Ke.orientation={v:"h",h:"v"}[it.orientation]);x.swapXYData(Ke),Te.calc=Te.clearAxisTypes=!0}else c.dataArrayContainers.indexOf(pt.parts[0])!==-1?(x.manageArrayContainers(pt,Qe,Ge),Te.calc=!0):(At?At.arrayOk&&!s.traceIs(it,"regl")&&(i.isArrayOrTypedArray(Qe)||i.isArrayOrTypedArray(Tt))?Te.calc=!0:T.update(Te,At):Te.calc=!0,pt.set(Qe))}}if(["swapxyaxes","orientationaxes"].indexOf(lt)!==-1&&u.swap(I,V),lt==="orientationaxes"){var Vt=n(I.layout,"hovermode"),Gt=Vt.get();Gt==="x"?Vt.set("y"):Gt==="y"?Vt.set("x"):Gt==="x unified"?Vt.set("y unified"):Gt==="y unified"&&Vt.set("x unified")}if(["orientation","type"].indexOf(lt)!==-1){for(Fe=[],ne=0;ne<V.length;ne++){var Qt=re[V[ne]];s.traceIs(Qt,"cartesian")&&(st(Qt.xaxis||"x"),st(Qt.yaxis||"y"))}Ze(Fe.map(Ve),!0,0),Ze(Fe.map(Lt),[0,1],0)}}return(Te.calc||Te.plot)&&(Te.fullReplot=!0),{flags:Te,undoit:Ge,redoit:Ie,traces:V,eventData:i.extendDeepNoArrays([],[he,V])}}function ce(I,U,V){I=i.getGraphDiv(I),x.clearPromiseQueue(I);var Q={};if(typeof U=="string")Q[U]=V;else if(i.isPlainObject(U))Q=i.extendFlat({},U);else return i.warn("Relayout fail.",U,V),Promise.reject();Object.keys(Q).length&&(I.changed=!0);var se=ve(I,Q),re=se.flags;re.calc&&(I.calcdata=void 0);var Ce=[c.previousPromises];re.layoutReplot?Ce.push(w.layoutReplot):Object.keys(Q).length&&(ye(I,re,se)||c.supplyDefaults(I),re.legend&&Ce.push(w.doLegend),re.layoutstyle&&Ce.push(w.layoutStyles),re.axrange&&ue(Ce,se.rangesAltered),re.ticks&&Ce.push(w.doTicksRelayout),re.modebar&&Ce.push(w.doModeBar),re.camera&&Ce.push(w.doCamera),re.colorbars&&Ce.push(w.doColorBars),Ce.push(E)),Ce.push(c.rehover,c.redrag,c.reselect),l.add(I,ce,[I,se.undoit],ce,[I,se.redoit]);var Se=i.syncOrAsync(Ce,I);return(!Se||!Se.then)&&(Se=Promise.resolve(I)),Se.then(function(){return I.emit("plotly_relayout",se.eventData),I})}function ye(I,U,V){var Q=I._fullLayout;if(!U.axrange)return!1;for(var se in U)if(se!=="axrange"&&U[se])return!1;var re,Ce,Se=function(Fe,tt){return i.coerce(re,Ce,p,Fe,tt)},he={};for(var ne in V.rangesAltered){var Te=u.id2name(ne);if(re=I.layout[Te],Ce=Q[Te],v(re,Ce,Se,he),Ce._matchGroup){for(var Ie in Ce._matchGroup)if(Ie!==ne){var Ge=Q[u.id2name(Ie)];Ge.autorange=Ce.autorange,Ge.range=Ce.range.slice(),Ge._input.range=Ce.range.slice()}}}return!0}function ue(I,U){var V=U?function(Q){var se=[],re=!0;for(var Ce in U){var Se=u.getFromId(Q,Ce);if(se.push(Ce),(Se.ticklabelposition||"").indexOf("inside")!==-1&&Se._anchorAxis&&se.push(Se._anchorAxis._id),Se._matchGroup)for(var he in Se._matchGroup)U[he]||se.push(he)}return u.draw(Q,se,{skipTitle:re})}:function(Q){return u.draw(Q,"redraw")};I.push(b,w.doAutoRangeAndConstraints,V,w.drawData,w.finalDraw)}var oe=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,pe=/^[xyz]axis[0-9]*\.autorange$/,Me=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function ve(I,U){var V=I.layout,Q=I._fullLayout,se=Q._guiEditing,re=fe(Q._preGUI,se),Ce=Object.keys(U),Se=u.list(I),he=i.extendDeepAll({},U),ne={},Te,Ie,Ge;for(Ce=Object.keys(U),Ie=0;Ie<Ce.length;Ie++)if(Ce[Ie].indexOf("allaxes")===0){for(Ge=0;Ge<Se.length;Ge++){var Fe=Se[Ge]._id.substr(1),tt=Fe.indexOf("scene")!==-1?Fe+".":"",st=Ce[Ie].replace("allaxes",tt+Se[Ge]._name);U[st]||(U[st]=U[Ce[Ie]])}delete U[Ce[Ie]]}var Ve=T.layoutFlags(),Lt={},ft={};function Ze(Jt,Wr){if(Array.isArray(Jt)){Jt.forEach(function(Ba){Ze(Ba,Wr)});return}if(!(Jt in U||x.hasParent(U,Jt))){var gi=re(V,Jt);Jt in ft||(ft[Jt]=de(gi.get())),Wr!==void 0&&gi.set(Wr)}}var gt={},wt;function lt(Jt){var Wr=u.name2id(Jt.split(".")[0]);return gt[Wr]=1,Wr}for(var ct in U){if(x.hasParent(U,ct))throw new Error("cannot set "+ct+" and a parent attribute simultaneously");for(var Ke=re(V,ct),it=U[ct],pt=Ke.parts.length,Tt=pt-1;Tt>0&&typeof Ke.parts[Tt]!="string";)Tt--;var Qe=Ke.parts[Tt],At=Ke.parts[Tt-1]+"."+Qe,It=Ke.parts.slice(0,Tt).join("."),Sr=n(I.layout,It).get(),rr=n(Q,It).get(),Gr=Ke.get();if(it!==void 0){Lt[ct]=it,ft[ct]=Qe==="reverse"?it:de(Gr);var Ur=f.getLayoutValObject(Q,Ke.parts);if(Ur&&Ur.impliedEdits&&it!==null)for(var Aa in Ur.impliedEdits)Ze(i.relativeAttr(ct,Aa),Ur.impliedEdits[Aa]);if(["width","height"].indexOf(ct)!==-1)if(it){Ze("autosize",null);var Ye=ct==="height"?"width":"height";Ze(Ye,Q[Ye])}else Q[ct]=I._initialAutoSize[ct];else if(ct==="autosize")Ze("width",it?null:Q.width),Ze("height",it?null:Q.height);else if(At.match(oe))lt(At),n(Q,It+"._inputRange").set(null);else if(At.match(pe)){lt(At),n(Q,It+"._inputRange").set(null);var Ne=n(Q,It).get();Ne._inputDomain&&(Ne._input.domain=Ne._inputDomain.slice())}else At.match(Me)&&n(Q,It+"._inputDomain").set(null);if(Qe==="type"){wt=Sr;var nt=rr.type==="linear"&&it==="log",vt=rr.type==="log"&&it==="linear";if(nt||vt){if(!wt||!wt.range)Ze(It+".autorange",!0);else if(rr.autorange)nt&&(wt.range=wt.range[1]>wt.range[0]?[1,2]:[2,1]);else{var Je=wt.range[0],rt=wt.range[1];nt?(Je<=0&&rt<=0&&Ze(It+".autorange",!0),Je<=0?Je=rt/1e6:rt<=0&&(rt=Je/1e6),Ze(It+".range[0]",Math.log(Je)/Math.LN10),Ze(It+".range[1]",Math.log(rt)/Math.LN10)):(Ze(It+".range[0]",Math.pow(10,Je)),Ze(It+".range[1]",Math.pow(10,rt)))}Array.isArray(Q._subplots.polar)&&Q._subplots.polar.length&&Q[Ke.parts[0]]&&Ke.parts[1]==="radialaxis"&&delete Q[Ke.parts[0]]._subplot.viewInitial["radialaxis.range"],s.getComponentMethod("annotations","convertCoords")(I,rr,it,Ze),s.getComponentMethod("images","convertCoords")(I,rr,it,Ze)}else Ze(It+".autorange",!0),Ze(It+".range",null);n(Q,It+"._inputRange").set(null)}else if(Qe.match(A)){var ut=n(Q,ct).get(),xt=(it||{}).type;(!xt||xt==="-")&&(xt="linear"),s.getComponentMethod("annotations","convertCoords")(I,ut,xt,Ze),s.getComponentMethod("images","convertCoords")(I,ut,xt,Ze)}var Ct=g.containerArrayMatch(ct);if(Ct){Te=Ct.array,Ie=Ct.index;var Vt=Ct.property,Gt=Ur||{editType:"calc"};Ie!==""&&Vt===""&&(g.isAddVal(it)?ft[ct]=null:g.isRemoveVal(it)?ft[ct]=(n(V,Te).get()||[])[Ie]:i.warn("unrecognized full object value",U)),T.update(Ve,Gt),ne[Te]||(ne[Te]={});var Qt=ne[Te][Ie];Qt||(Qt=ne[Te][Ie]={}),Qt[Vt]=it,delete U[ct]}else Qe==="reverse"?(Sr.range?Sr.range.reverse():(Ze(It+".autorange",!0),Sr.range=[1,0]),rr.autorange?Ve.calc=!0:Ve.plot=!0):(ct==="dragmode"&&(it===!1&&Gr!==!1||it!==!1&&Gr===!1)||Q._has("scatter-like")&&Q._has("regl")&&ct==="dragmode"&&(it==="lasso"||it==="select")&&!(Gr==="lasso"||Gr==="select")?Ve.plot=!0:Ur?T.update(Ve,Ur):Ve.calc=!0,Ke.set(it))}}for(Te in ne){var Ft=g.applyContainerArrayChanges(I,re(V,Te),ne[Te],Ve,re);Ft||(Ve.plot=!0)}for(var ar in gt){wt=u.getFromId(I,ar);var Rt=wt&&wt._constraintGroup;if(Rt){Ve.calc=!0;for(var Ut in Rt)gt[Ut]||(u.getFromId(I,Ut)._constraintShrinkable=!0)}}(ke(I)||U.height||U.width)&&(Ve.plot=!0);var $r=Q.shapes;for(Ie=0;Ie<$r.length;Ie++)if($r[Ie].showlegend){Ve.calc=!0;break}return(Ve.plot||Ve.calc)&&(Ve.layoutReplot=!0),{flags:Ve,rangesAltered:gt,undoit:ft,redoit:Lt,eventData:he}}function ke(I){var U=I._fullLayout,V=U.width,Q=U.height;return I.layout.autosize&&c.plotAutoSize(I,I.layout,U),U.width!==V||U.height!==Q}function _e(I,U,V,Q){I=i.getGraphDiv(I),x.clearPromiseQueue(I),i.isPlainObject(U)||(U={}),i.isPlainObject(V)||(V={}),Object.keys(U).length&&(I.changed=!0),Object.keys(V).length&&(I.changed=!0);var se=x.coerceTraceIndices(I,Q),re=le(I,i.extendFlat({},U),se),Ce=re.flags,Se=ve(I,i.extendFlat({},V)),he=Se.flags;(Ce.calc||he.calc)&&(I.calcdata=void 0),Ce.clearAxisTypes&&x.clearAxisTypes(I,se,V);var ne=[];he.layoutReplot?ne.push(w.layoutReplot):Ce.fullReplot?ne.push(t._doPlot):(ne.push(c.previousPromises),ye(I,he,Se)||c.supplyDefaults(I),Ce.style&&ne.push(w.doTraceStyle),(Ce.colorbars||he.colorbars)&&ne.push(w.doColorBars),he.legend&&ne.push(w.doLegend),he.layoutstyle&&ne.push(w.layoutStyles),he.axrange&&ue(ne,Se.rangesAltered),he.ticks&&ne.push(w.doTicksRelayout),he.modebar&&ne.push(w.doModeBar),he.camera&&ne.push(w.doCamera),ne.push(E)),ne.push(c.rehover,c.redrag,c.reselect),l.add(I,_e,[I,re.undoit,Se.undoit,re.traces],_e,[I,re.redoit,Se.redoit,re.traces]);var Te=i.syncOrAsync(ne,I);return(!Te||!Te.then)&&(Te=Promise.resolve(I)),Te.then(function(){return I.emit("plotly_update",{data:re.eventData,layout:Se.eventData}),I})}function J(I){return function(V){V._fullLayout._guiEditing=!0;var Q=I.apply(null,arguments);return V._fullLayout._guiEditing=!1,Q}}var be=[{pattern:/^hiddenlabels/,attr:"legend.uirevision"},{pattern:/^((x|y)axis\d*)\.((auto)?range|title\.text)/},{pattern:/axis\d*\.showspikes$/,attr:"modebar.uirevision"},{pattern:/(hover|drag)mode$/,attr:"modebar.uirevision"},{pattern:/^(scene\d*)\.camera/},{pattern:/^(geo\d*)\.(projection|center|fitbounds)/},{pattern:/^(ternary\d*\.[abc]axis)\.(min|title\.text)$/},{pattern:/^(polar\d*\.radialaxis)\.((auto)?range|angle|title\.text)/},{pattern:/^(polar\d*\.angularaxis)\.rotation/},{pattern:/^(mapbox\d*)\.(center|zoom|bearing|pitch)/},{pattern:/^(map\d*)\.(center|zoom|bearing|pitch)/},{pattern:/^legend\.(x|y)$/,attr:"editrevision"},{pattern:/^(shapes|annotations)/,attr:"editrevision"},{pattern:/^title\.text$/,attr:"editrevision"}],Z=[{pattern:/^selectedpoints$/,attr:"selectionrevision"},{pattern:/(^|value\.)visible$/,attr:"legend.uirevision"},{pattern:/^dimensions\[\d+\]\.constraintrange/},{pattern:/^node\.(x|y|groups)/},{pattern:/^level$/},{pattern:/(^|value\.)name$/},{pattern:/colorbar\.title\.text$/},{pattern:/colorbar\.(x|y)$/,attr:"editrevision"}];function me(I,U){for(var V=0;V<U.length;V++){var Q=U[V],se=I.match(Q.pattern);if(se){var re=se[1]||"";return{head:re,tail:I.substr(re.length+1),attr:Q.attr}}}}function ge(I,U){var V=n(U,I).get();if(V!==void 0)return V;var Q=I.split(".");for(Q.pop();Q.length>1;)if(Q.pop(),V=n(U,Q.join(".")+".uirevision").get(),V!==void 0)return V;return U.uirevision}function Pe(I,U){for(var V=0;V<U.length;V++)if(U[V]._fullInput.uid===I)return V;return-1}function Ee(I,U,V){for(var Q=0;Q<U.length;Q++)if(U[Q].uid===I)return Q;return!U[V]||U[V].uid?-1:V}function Le(I,U){var V=i.isPlainObject(I),Q=Array.isArray(I);return V||Q?(V&&i.isPlainObject(U)||Q&&Array.isArray(U))&&JSON.stringify(I)===JSON.stringify(U):I===U}function Ae(I,U,V,Q){var se=Q._preGUI,re,Ce,Se,he,ne,Te,Ie,Ge,Fe,tt,st=[],Ve={},Lt={};for(re in se){if(ne=me(re,be),ne){if(Fe=ne.head,tt=ne.tail,Ce=ne.attr||Fe+".uirevision",Se=n(Q,Ce).get(),he=Se&&ge(Ce,U),he&&he===Se){if(Te=se[re],Te===null&&(Te=void 0),Ie=n(U,re),Ge=Ie.get(),Le(Ge,Te)){Ge===void 0&&tt==="autorange"&&st.push(Fe),Ie.set(de(n(Q,re).get()));continue}else if(tt==="autorange"||tt.substr(0,6)==="range["){var ft=se[Fe+".range[0]"],Ze=se[Fe+".range[1]"],gt=se[Fe+".autorange"];if(gt||gt===null&&ft===null&&Ze===null){if(!(Fe in Ve)){var wt=n(U,Fe).get();Ve[Fe]=wt&&(wt.autorange||wt.autorange!==!1&&(!wt.range||wt.range.length!==2))}if(Ve[Fe]){Ie.set(de(n(Q,re).get()));continue}}}}}else i.warn("unrecognized GUI edit: "+re);delete se[re],ne&&ne.tail.substr(0,6)==="range["&&(Lt[ne.head]=1)}for(var lt=0;lt<st.length;lt++){var ct=st[lt];if(Lt[ct]){var Ke=n(U,ct).get();Ke&&delete Ke.autorange}}var it=Q._tracePreGUI;for(var pt in it){var Tt=it[pt],Qe=null,At;for(re in Tt){if(!Qe){var It=Pe(pt,V);if(It<0){delete it[pt];break}var Sr=V[It];At=Sr._fullInput;var rr=Ee(pt,I,At.index);if(rr<0){delete it[pt];break}Qe=I[rr]}if(ne=me(re,Z),ne){if(ne.attr?(Se=n(Q,ne.attr).get(),he=Se&&ge(ne.attr,U)):(Se=At.uirevision,he=Qe.uirevision,he===void 0&&(he=U.uirevision)),he&&he===Se&&(Te=Tt[re],Te===null&&(Te=void 0),Ie=n(Qe,re),Ge=Ie.get(),Le(Ge,Te))){Ie.set(de(n(At,re).get()));continue}}else i.warn("unrecognized GUI edit: "+re+" in trace uid "+pt);delete Tt[re]}}}function Oe(I,U,V,Q){var se,re;function Ce(){return t.addFrames(I,se)}I=i.getGraphDiv(I),x.clearPromiseQueue(I);var Se=I._fullData,he=I._fullLayout;if(!i.isPlotDiv(I)||!Se||!he)re=t.newPlot(I,U,V,Q);else{if(i.isPlainObject(U)){var ne=U;U=ne.data,V=ne.layout,Q=ne.config,se=ne.frames}var Te=!1;if(Q){var Ie=i.extendDeep({},I._context);I._context=void 0,H(I,Q),Te=at(Ie,I._context)}I.data=U||[],x.cleanData(I.data),I.layout=V||{},x.cleanLayout(I.layout),Ae(I.data,I.layout,Se,he),c.supplyDefaults(I,{skipUpdateCalc:!0});var Ge=I._fullData,Fe=I._fullLayout,tt=Fe.datarevision===void 0,st=Fe.transition,Ve=ze(I,he,Fe,tt,st),Lt=Ve.newDataRevision,ft=$e(I,Se,Ge,tt,st,Lt);if(ke(I)&&(Ve.layoutReplot=!0),ft.calc||Ve.calc){I.calcdata=void 0;for(var Ze=Object.getOwnPropertyNames(Fe),gt=0;gt<Ze.length;gt++){var wt=Ze[gt],lt=wt.substring(0,5);if(lt==="xaxis"||lt==="yaxis"){var ct=Fe[wt]._emptyCategories;ct&&ct()}}}else c.supplyDefaultsUpdateCalc(I.calcdata,Ge);var Ke=[];if(se&&(I._transitionData={},c.createTransitionData(I),Ke.push(Ce)),Fe.transition&&!Te&&(ft.anim||Ve.anim))Ve.ticks&&Ke.push(w.doTicksRelayout),c.doCalcdata(I),w.doAutoRangeAndConstraints(I),Ke.push(function(){return c.transitionFromReact(I,ft,Ve,he)});else if(ft.fullReplot||Ve.layoutReplot||Te)I._fullLayout._skipDefaults=!0,Ke.push(t._doPlot);else{for(var it in Ve.arrays){var pt=Ve.arrays[it];if(pt.length){var Tt=s.getComponentMethod(it,"drawOne");if(Tt!==i.noop)for(var Qe=0;Qe<pt.length;Qe++)Tt(I,pt[Qe]);else{var At=s.getComponentMethod(it,"draw");if(At===i.noop)throw new Error("cannot draw components: "+it);At(I)}}}Ke.push(c.previousPromises),ft.style&&Ke.push(w.doTraceStyle),(ft.colorbars||Ve.colorbars)&&Ke.push(w.doColorBars),Ve.legend&&Ke.push(w.doLegend),Ve.layoutstyle&&Ke.push(w.layoutStyles),Ve.axrange&&ue(Ke),Ve.ticks&&Ke.push(w.doTicksRelayout),Ve.modebar&&Ke.push(w.doModeBar),Ve.camera&&Ke.push(w.doCamera),Ke.push(E)}Ke.push(c.rehover,c.redrag,c.reselect),re=i.syncOrAsync(Ke,I),(!re||!re.then)&&(re=Promise.resolve(I))}return re.then(function(){return I.emit("plotly_react",{data:U,layout:V}),I})}function $e(I,U,V,Q,se,re){var Ce=U.length===V.length;if(!se&&!Ce)return{fullReplot:!0,calc:!0};var Se=T.traceFlags();Se.arrays={},Se.nChanges=0,Se.nChangesAnim=0;var he,ne;function Te(Fe){var tt=f.getTraceValObject(ne,Fe);return!ne._module.animatable&&tt.anim&&(tt.anim=!1),tt}var Ie={getValObject:Te,flags:Se,immutable:Q,transition:se,newDataRevision:re,gd:I},Ge={};for(he=0;he<U.length;he++)if(V[he]){if(ne=V[he]._fullInput,Ge[ne.uid])continue;Ge[ne.uid]=1,je(U[he]._fullInput,ne,[],Ie)}return(Se.calc||Se.plot)&&(Se.fullReplot=!0),se&&Se.nChanges&&Se.nChangesAnim&&(Se.anim=Se.nChanges===Se.nChangesAnim&&Ce?"all":"some"),Se}function ze(I,U,V,Q,se){var re=T.layoutFlags();re.arrays={},re.rangesAltered={},re.nChanges=0,re.nChangesAnim=0;function Ce(Ge){return f.getLayoutValObject(V,Ge)}for(var Se in V)if(!(!Se.startsWith("xaxis")&&!Se.startsWith("yaxis"))&&U[Se]){var he=V[Se].domain,ne=U[Se].domain,Te=U[Se]._inputDomain;U[Se]._inputDomain&&(he[0]===Te[0]&&he[1]===Te[1]?V[Se].domain=U[Se].domain:(he[0]!==ne[0]||he[1]!==ne[1])&&(V[Se]._inputDomain=null))}var Ie={getValObject:Ce,flags:re,immutable:Q,transition:se,gd:I};return je(U,V,[],Ie),(re.plot||re.calc)&&(re.layoutReplot=!0),se&&re.nChanges&&re.nChangesAnim&&(re.anim=re.nChanges===re.nChangesAnim?"all":"some"),re}function je(I,U,V,Q){var se,re,Ce,Se=Q.getValObject,he=Q.flags,ne=Q.immutable,Te=Q.inArray,Ie=Q.arrayIndex;function Ge(){var It=se.editType;if(Te&&It.indexOf("arraydraw")!==-1){i.pushUnique(he.arrays[Te],Ie);return}T.update(he,se),It!=="none"&&he.nChanges++,Q.transition&&se.anim&&he.nChangesAnim++,(oe.test(Ce)||pe.test(Ce))&&(he.rangesAltered[V[0]]=1),re==="datarevision"&&(he.newDataRevision=1)}function Fe(It){return It.valType==="data_array"||It.arrayOk}for(re in I){if(he.calc&&!Q.transition)return;var tt=I[re],st=U[re],Ve=V.concat(re);if(Ce=Ve.join("."),!(re.charAt(0)==="_"||typeof tt=="function"||tt===st)){if((re==="tick0"||re==="dtick")&&V[0]!=="geo"){var Lt=U.tickmode;if(Lt==="auto"||Lt==="array"||!Lt)continue}if(!(re==="range"&&U.autorange)&&!((re==="zmin"||re==="zmax")&&U.type==="contourcarpet")&&(se=Se(Ve),!!se&&!(se._compareAsJSON&&JSON.stringify(tt)===JSON.stringify(st)))){var ft=se.valType,Ze,gt=Fe(se),wt=Array.isArray(tt),lt=Array.isArray(st);if(wt&&lt){var ct="_input_"+re,Ke=I[ct],it=U[ct];if(Array.isArray(Ke)&&Ke===it)continue}if(st===void 0)gt&&wt?he.calc=!0:Ge();else if(se._isLinkedToArray){var pt=[],Tt=!1;Te||(he.arrays[re]=pt);var Qe=Math.min(tt.length,st.length),At=Math.max(tt.length,st.length);if(Qe!==At)if(se.editType==="arraydraw")Tt=!0;else{Ge();continue}for(Ze=0;Ze<Qe;Ze++)je(tt[Ze],st[Ze],Ve.concat(Ze),i.extendFlat({inArray:re,arrayIndex:Ze},Q));if(Tt)for(Ze=Qe;Ze<At;Ze++)pt.push(Ze)}else!ft&&i.isPlainObject(tt)?je(tt,st,Ve,Q):gt?wt&&lt?(ne&&(he.calc=!0),(ne||Q.newDataRevision)&&Ge()):wt!==lt?he.calc=!0:Ge():wt&&lt?(tt.length!==st.length||String(tt)!==String(st))&&Ge():Ge()}}}for(re in U)if(!(re in I||re.charAt(0)==="_"||typeof U[re]=="function"))if(se=Se(V.concat(re)),Fe(se)&&Array.isArray(U[re])){he.calc=!0;return}else Ge()}function at(I,U){var V;for(V in I)if(V.charAt(0)!=="_"){var Q=I[V],se=U[V];if(Q!==se)if(i.isPlainObject(Q)&&i.isPlainObject(se)){if(at(Q,se))return!0}else if(Array.isArray(Q)&&Array.isArray(se)){if(Q.length!==se.length)return!0;for(var re=0;re<Q.length;re++)if(Q[re]!==se[re])if(i.isPlainObject(Q[re])&&i.isPlainObject(se[re])){if(at(Q[re],se[re]))return!0}else return!0}else return!0}}function xe(I,U,V){if(I=i.getGraphDiv(I),!i.isPlotDiv(I))throw new Error("This element is not a Plotly plot: "+I+". It's likely that you've failed to create a plot before animating it. For more details, see https://plotly.com/javascript/animations/");var Q=I._transitionData;Q._frameQueue||(Q._frameQueue=[]),V=c.supplyAnimationDefaults(V);var se=V.transition,re=V.frame;Q._frameWaitingCnt===void 0&&(Q._frameWaitingCnt=0);function Ce(ne){return Array.isArray(se)?ne>=se.length?se[0]:se[ne]:se}function Se(ne){return Array.isArray(re)?ne>=re.length?re[0]:re[ne]:re}function he(ne,Te){var Ie=0;return function(){if(ne&&++Ie===Te)return ne()}}return new Promise(function(ne,Te){function Ie(){if(Q._frameQueue.length!==0){for(;Q._frameQueue.length;){var Qe=Q._frameQueue.pop();Qe.onInterrupt&&Qe.onInterrupt()}I.emit("plotly_animationinterrupted",[])}}function Ge(Qe){if(Qe.length!==0){for(var At=0;At<Qe.length;At++){var It;Qe[At].type==="byname"?It=c.computeFrame(I,Qe[At].name):It=Qe[At].data;var Sr=Se(At),rr=Ce(At);rr.duration=Math.min(rr.duration,Sr.duration);var Gr={frame:It,name:Qe[At].name,frameOpts:Sr,transitionOpts:rr};At===Qe.length-1&&(Gr.onComplete=he(ne,2),Gr.onInterrupt=Te),Q._frameQueue.push(Gr)}V.mode==="immediate"&&(Q._lastFrameAt=-1/0),Q._animationRaf||st()}}function Fe(){I.emit("plotly_animated"),window.cancelAnimationFrame(Q._animationRaf),Q._animationRaf=null}function tt(){Q._currentFrame&&Q._currentFrame.onComplete&&Q._currentFrame.onComplete();var Qe=Q._currentFrame=Q._frameQueue.shift();if(Qe){var At=Qe.name?Qe.name.toString():null;I._fullLayout._currentFrame=At,Q._lastFrameAt=Date.now(),Q._timeToNext=Qe.frameOpts.duration,c.transition(I,Qe.frame.data,Qe.frame.layout,x.coerceTraceIndices(I,Qe.frame.traces),Qe.frameOpts,Qe.transitionOpts).then(function(){Qe.onComplete&&Qe.onComplete()}),I.emit("plotly_animatingframe",{name:At,frame:Qe.frame,animation:{frame:Qe.frameOpts,transition:Qe.transitionOpts}})}else Fe()}function st(){I.emit("plotly_animating"),Q._lastFrameAt=-1/0,Q._timeToNext=0,Q._runningTransitions=0,Q._currentFrame=null;var Qe=function(){Q._animationRaf=window.requestAnimationFrame(Qe),Date.now()-Q._lastFrameAt>Q._timeToNext&&tt()};Qe()}var Ve=0;function Lt(Qe){return Array.isArray(se)?Ve>=se.length?Qe.transitionOpts=se[Ve]:Qe.transitionOpts=se[0]:Qe.transitionOpts=se,Ve++,Qe}var ft,Ze,gt=[],wt=U==null,lt=Array.isArray(U),ct=!wt&&!lt&&i.isPlainObject(U);if(ct)gt.push({type:"object",data:Lt(i.extendFlat({},U))});else if(wt||["string","number"].indexOf(typeof U)!==-1)for(ft=0;ft<Q._frames.length;ft++)Ze=Q._frames[ft],Ze&&(wt||String(Ze.group)===String(U))&&gt.push({type:"byname",name:String(Ze.name),data:Lt({name:Ze.name})});else if(lt)for(ft=0;ft<U.length;ft++){var Ke=U[ft];["number","string"].indexOf(typeof Ke)!==-1?(Ke=String(Ke),gt.push({type:"byname",name:Ke,data:Lt({name:Ke})})):i.isPlainObject(Ke)&&gt.push({type:"object",data:Lt(i.extendFlat({},Ke))})}for(ft=0;ft<gt.length;ft++)if(Ze=gt[ft],Ze.type==="byname"&&!Q._frameHash[Ze.data.name]){i.warn('animate failure: frame not found: "'+Ze.data.name+'"'),Te();return}["next","immediate"].indexOf(V.mode)!==-1&&Ie(),V.direction==="reverse"&&gt.reverse();var it=I._fullLayout._currentFrame;if(it&&V.fromcurrent){var pt=-1;for(ft=0;ft<gt.length;ft++)if(Ze=gt[ft],Ze.type==="byname"&&Ze.name===it){pt=ft;break}if(pt>0&&pt<gt.length-1){var Tt=[];for(ft=0;ft<gt.length;ft++)Ze=gt[ft],(gt[ft].type!=="byname"||ft>pt)&&Tt.push(Ze);gt=Tt}}gt.length>0?Ge(gt):(I.emit("plotly_animated"),ne())})}function We(I,U,V){if(I=i.getGraphDiv(I),U==null)return Promise.resolve();if(!i.isPlotDiv(I))throw new Error("This element is not a Plotly plot: "+I+". It's likely that you've failed to create a plot before adding frames. For more details, see https://plotly.com/javascript/animations/");var Q,se,re,Ce,Se=I._transitionData._frames,he=I._transitionData._frameHash;if(!Array.isArray(U))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+U);var ne=Se.length+U.length*2,Te=[],Ie={};for(Q=U.length-1;Q>=0;Q--)if(i.isPlainObject(U[Q])){var Ge=U[Q].name,Fe=(he[Ge]||Ie[Ge]||{}).name,tt=U[Q].name,st=he[Fe]||Ie[Fe];Fe&&tt&&typeof tt=="number"&&st&&M<S&&(M++,i.warn('addFrames: overwriting frame "'+(he[Fe]||Ie[Fe]).name+'" with a frame whose name of type "number" also equates to "'+Fe+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),M===S&&i.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),Ie[Ge]={name:Ge},Te.push({frame:c.supplyFrameDefaults(U[Q]),index:V&&V[Q]!==void 0&&V[Q]!==null?V[Q]:ne+Q})}Te.sort(function(ct,Ke){return ct.index>Ke.index?-1:ct.index<Ke.index?1:0});var Ve=[],Lt=[],ft=Se.length;for(Q=Te.length-1;Q>=0;Q--){if(se=Te[Q].frame,typeof se.name=="number"&&i.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!se.name)for(;he[se.name="frame "+I._transitionData._counter++];);if(he[se.name]){for(re=0;re<Se.length&&(Se[re]||{}).name!==se.name;re++);Ve.push({type:"replace",index:re,value:se}),Lt.unshift({type:"replace",index:re,value:Se[re]})}else Ce=Math.max(0,Math.min(Te[Q].index,ft)),Ve.push({type:"insert",index:Ce,value:se}),Lt.unshift({type:"delete",index:Ce}),ft++}var Ze=c.modifyFrames,gt=c.modifyFrames,wt=[I,Lt],lt=[I,Ve];return l&&l.add(I,Ze,wt,gt,lt),c.modifyFrames(I,Ve)}function Xe(I,U){if(I=i.getGraphDiv(I),!i.isPlotDiv(I))throw new Error("This element is not a Plotly plot: "+I);var V,Q,se=I._transitionData._frames,re=[],Ce=[];if(!U)for(U=[],V=0;V<se.length;V++)U.push(V);for(U=U.slice(),U.sort(),V=U.length-1;V>=0;V--)Q=U[V],re.push({type:"delete",index:Q}),Ce.unshift({type:"insert",index:Q,value:se[Q]});var Se=c.modifyFrames,he=c.modifyFrames,ne=[I,Ce],Te=[I,re];return l&&l.add(I,Se,ne,he,Te),c.modifyFrames(I,re)}function Re(I){I=i.getGraphDiv(I);var U=I._fullLayout||{},V=I._fullData||[];return c.cleanPlot([],{},V,U),c.purge(I),o.purge(I),U._container&&U._container.remove(),delete I._context,I}function et(I){var U=I._fullLayout,V=I.getBoundingClientRect();if(!i.equalDomRects(V,U._lastBBox)){var Q=U._invTransform=i.inverseTransformMatrix(i.getFullTransformMatrix(I));U._invScaleX=Math.sqrt(Q[0][0]*Q[0][0]+Q[0][1]*Q[0][1]+Q[0][2]*Q[0][2]),U._invScaleY=Math.sqrt(Q[1][0]*Q[1][0]+Q[1][1]*Q[1][1]+Q[1][2]*Q[1][2]),U._lastBBox=V}}function Ue(I){var U=e.select(I),V=I._fullLayout;if(V._calcInverseTransform=et,V._calcInverseTransform(I),V._container=U.selectAll(".plot-container").data([0]),V._container.enter().insert("div",":first-child").classed("plot-container",!0).classed("plotly",!0).style({width:"100%",height:"100%"}),V._paperdiv=V._container.selectAll(".svg-container").data([0]),V._paperdiv.enter().append("div").classed("user-select-none",!0).classed("svg-container",!0).style("position","relative"),V._glcontainer=V._paperdiv.selectAll(".gl-container").data([{}]),V._glcontainer.enter().append("div").classed("gl-container",!0),V._paperdiv.selectAll(".main-svg").remove(),V._paperdiv.select(".modebar-container").remove(),V._paper=V._paperdiv.insert("svg",":first-child").classed("main-svg",!0),V._toppaper=V._paperdiv.append("svg").classed("main-svg",!0),V._modebardiv=V._paperdiv.append("div"),delete V._modeBar,V._hoverpaper=V._paperdiv.append("svg").classed("main-svg",!0),!V._uid){var Q={};e.selectAll("defs").each(function(){this.id&&(Q[this.id.split("-")[1]]=1)}),V._uid=i.randstr(Q)}V._paperdiv.selectAll(".main-svg").attr(y.svgAttrs),V._defs=V._paper.append("defs").attr("id","defs-"+V._uid),V._clips=V._defs.append("g").classed("clips",!0),V._topdefs=V._toppaper.append("defs").attr("id","topdefs-"+V._uid),V._topclips=V._topdefs.append("g").classed("clips",!0),V._bgLayer=V._paper.append("g").classed("bglayer",!0),V._draggers=V._paper.append("g").classed("draglayer",!0);var se=V._paper.append("g").classed("layer-below",!0);V._imageLowerLayer=se.append("g").classed("imagelayer",!0),V._shapeLowerLayer=se.append("g").classed("shapelayer",!0),V._cartesianlayer=V._paper.append("g").classed("cartesianlayer",!0),V._polarlayer=V._paper.append("g").classed("polarlayer",!0),V._smithlayer=V._paper.append("g").classed("smithlayer",!0),V._ternarylayer=V._paper.append("g").classed("ternarylayer",!0),V._geolayer=V._paper.append("g").classed("geolayer",!0),V._funnelarealayer=V._paper.append("g").classed("funnelarealayer",!0),V._pielayer=V._paper.append("g").classed("pielayer",!0),V._iciclelayer=V._paper.append("g").classed("iciclelayer",!0),V._treemaplayer=V._paper.append("g").classed("treemaplayer",!0),V._sunburstlayer=V._paper.append("g").classed("sunburstlayer",!0),V._indicatorlayer=V._toppaper.append("g").classed("indicatorlayer",!0),V._glimages=V._paper.append("g").classed("glimages",!0);var re=V._toppaper.append("g").classed("layer-above",!0);V._imageUpperLayer=re.append("g").classed("imagelayer",!0),V._shapeUpperLayer=re.append("g").classed("shapelayer",!0),V._selectionLayer=V._toppaper.append("g").classed("selectionlayer",!0),V._infolayer=V._toppaper.append("g").classed("infolayer",!0),V._menulayer=V._toppaper.append("g").classed("menulayer",!0),V._zoomlayer=V._toppaper.append("g").classed("zoomlayer",!0),V._hoverlayer=V._hoverpaper.append("g").classed("hoverlayer",!0),V._modebardiv.classed("modebar-container",!0).style("position","absolute").style("top","0px").style("right","0px"),I.emit("plotly_framework")}t.animate=xe,t.addFrames=We,t.deleteFrames=Xe,t.addTraces=X,t.deleteTraces=B,t.extendTraces=K,t.moveTraces=ee,t.prependTraces=W,t.newPlot=P,t._doPlot=L,t.purge=Re,t.react=Oe,t.redraw=D,t.relayout=ce,t.restyle=ae,t.setPlotConfig=F,t.update=_e,t._guiRelayout=J(ce),t._guiRestyle=J(ae),t._guiUpdate=J(_e),t._storeDirectGUIEdit=te})(ep);var ra={},fz=ot;ra.getDelay=function(t){return t._has&&(t._has("gl3d")||t._has("mapbox")||t._has("map"))?500:0};ra.getRedrawFunc=function(t){return function(){fz.getComponentMethod("colorbar","draw")(t)}};ra.encodeSVG=function(t){return"data:image/svg+xml,"+encodeURIComponent(t)};ra.encodeJSON=function(t){return"data:application/json,"+encodeURIComponent(t)};var L2=window.URL||window.webkitURL;ra.createObjectURL=function(t){return L2.createObjectURL(t)};ra.revokeObjectURL=function(t){return L2.revokeObjectURL(t)};ra.createBlob=function(t,e){if(e==="svg")return new window.Blob([t],{type:"image/svg+xml;charset=utf-8"});if(e==="full-json")return new window.Blob([t],{type:"application/json;charset=utf-8"});var r=cz(window.atob(t));return new window.Blob([r],{type:"image/"+e})};ra.octetStream=function(t){document.location.href="data:application/octet-stream"+t};function cz(t){for(var e=t.length,r=new ArrayBuffer(e),a=new Uint8Array(r),i=0;i<e;i++)a[i]=t.charCodeAt(i);return r}ra.IMAGE_URL_PREFIX=/^data:image\/\w+;base64,/;var ch=bt,uz=Et,vz=yt,Mv=/"/g,Il="TOBESTRIPPED",dz=new RegExp('("'+Il+")|("+Il+'")',"g");function hz(t){var e=ch.select("body").append("div").style({display:"none"}).html(""),r=t.replace(/(&[^;]*;)/gi,function(a){return a==="&lt;"?"&#60;":a==="&rt;"?"&#62;":a.indexOf("<")!==-1||a.indexOf(">")!==-1?"":e.html(a).text()});return e.remove(),r}function pz(t){return t.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&amp;")}var Gp=function(e,r,a){var i=e._fullLayout,n=i._paper,o=i._toppaper,l=i.width,s=i.height,f;n.insert("rect",":first-child").call(uz.setRect,0,0,l,s).call(vz.fill,i.paper_bgcolor);var c=i._basePlotModules||[];for(f=0;f<c.length;f++){var u=c[f];u.toSVG&&u.toSVG(e)}if(o){var v=o.node().childNodes,p=Array.prototype.slice.call(v);for(f=0;f<p.length;f++){var d=p[f];d.childNodes.length&&n.node().appendChild(d)}}i._draggers&&i._draggers.remove(),n.node().style.background="",n.selectAll("text").attr({"data-unformatted":null,"data-math":null}).each(function(){var m=ch.select(this);if(this.style.visibility==="hidden"||this.style.display==="none"){m.remove();return}else m.style({visibility:null,display:null});var y=this.style.fontFamily;y&&y.indexOf('"')!==-1&&m.style("font-family",y.replace(Mv,Il));var b=this.style.fontWeight;b&&(b==="normal"||b==="400")&&m.style("font-weight",void 0);var _=this.style.fontStyle;_&&_==="normal"&&m.style("font-style",void 0);var g=this.style.fontVariant;g&&g==="normal"&&m.style("font-variant",void 0)}),n.selectAll(".gradient_filled,.pattern_filled").each(function(){var m=ch.select(this),y=this.style.fill;y&&y.indexOf("url(")!==-1&&m.style("fill",y.replace(Mv,Il));var b=this.style.stroke;b&&b.indexOf("url(")!==-1&&m.style("stroke",b.replace(Mv,Il))}),(r==="pdf"||r==="eps")&&n.selectAll("#MathJax_SVG_glyphs path").attr("stroke-width",0),r==="svg"&&a&&(n.attr("width",a*l),n.attr("height",a*s),n.attr("viewBox","0 0 "+l+" "+s));var h=new window.XMLSerializer().serializeToString(n.node());return h=hz(h),h=pz(h),h=h.replace(dz,"'"),h},mz=we,yz=Eh.EventEmitter,pl=ra;function gz(t){var e=t.emitter||new yz,r=new Promise(function(a,i){var n=window.Image,o=t.svg,l=t.format||"png",s=t.canvas,f=t.scale||1,c=t.width||300,u=t.height||150,v=f*c,p=f*u,d=s.getContext("2d",{willReadFrequently:!0}),h=new n,m,y;l==="svg"||mz.isSafari()?y=pl.encodeSVG(o):(m=pl.createBlob(o,"svg"),y=pl.createObjectURL(m)),s.width=v,s.height=p,h.onload=function(){var b;switch(m=null,pl.revokeObjectURL(y),l!=="svg"&&d.drawImage(h,0,0,v,p),l){case"jpeg":b=s.toDataURL("image/jpeg");break;case"png":b=s.toDataURL("image/png");break;case"webp":b=s.toDataURL("image/webp");break;case"svg":b=y;break;default:var _="Image format is not jpeg, png, svg or webp.";if(i(new Error(_)),!t.promise)return e.emit("error",_)}a(b),t.promise||e.emit("success",b)},h.onerror=function(b){if(m=null,pl.revokeObjectURL(y),i(b),!t.promise)return e.emit("error",b)},h.src=y});return t.promise?r:e}var Up=gz,M0=kt,S0=ep,bz=hr,Xa=we,ml=ra,xz=Gp,_z=Up,wz=Ic.version,Sv={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png",description:"Sets the format of exported image."},width:{valType:"number",min:1,description:["Sets the exported image width.","Defaults to the value found in `layout.width`","If set to *null*, the exported image width will match the current graph width."].join(" ")},height:{valType:"number",min:1,description:["Sets the exported image height.","Defaults to the value found in `layout.height`","If set to *null*, the exported image height will match the current graph height."].join(" ")},scale:{valType:"number",min:0,dflt:1,description:["Sets a scaling for the generated image.","If set, all features of a graphs (e.g. text, line width)","are scaled, unlike simply setting","a bigger *width* and *height*."].join(" ")},setBackground:{valType:"any",dflt:!1,description:["Sets the image background mode.","By default, the image background is determined by `layout.paper_bgcolor`,","the *transparent* mode.","One might consider setting `setBackground` to *opaque*","when exporting a *jpeg* image as JPEGs do not support opacity."].join(" ")},imageDataOnly:{valType:"boolean",dflt:!1,description:["Determines whether or not the return value is prefixed by","the image format's corresponding 'data:image;' spec."].join(" ")}};function Tz(t,e){e=e||{};var r,a,i,n;Xa.isPlainObject(t)?(r=t.data||[],a=t.layout||{},i=t.config||{},n={}):(t=Xa.getGraphDiv(t),r=Xa.extendDeep([],t.data),a=Xa.extendDeep({},t.layout),i=t._context,n=t._fullLayout||{});function o(w){return!(w in e)||Xa.validate(e[w],Sv[w])}if(!o("width")&&e.width!==null||!o("height")&&e.height!==null)throw new Error("Height and width should be pixel values.");if(!o("format"))throw new Error("Export format is not "+Xa.join2(Sv.format.values,", "," or ")+".");var l={};function s(w,T){return Xa.coerce(e,l,Sv,w,T)}var f=s("format"),c=s("width"),u=s("height"),v=s("scale"),p=s("setBackground"),d=s("imageDataOnly"),h=document.createElement("div");h.style.position="absolute",h.style.left="-5000px",document.body.appendChild(h);var m=Xa.extendFlat({},a);c?m.width=c:e.width===null&&M0(n.width)&&(m.width=n.width),u?m.height=u:e.height===null&&M0(n.height)&&(m.height=n.height);var y=Xa.extendFlat({},i,{_exportedPlot:!0,staticPlot:!0,setBackground:p}),b=ml.getRedrawFunc(h);function _(){return new Promise(function(w){setTimeout(w,ml.getDelay(h._fullLayout))})}function g(){return new Promise(function(w,T){var A=xz(h,f,v),M=h._fullLayout.width,S=h._fullLayout.height;function L(){S0.purge(h),document.body.removeChild(h)}if(f==="full-json"){var E=bz.graphJson(h,!1,"keepdata","object",!0,!0);return E.version=wz,E=JSON.stringify(E),L(),w(d?E:ml.encodeJSON(E))}if(L(),f==="svg")return w(d?A:ml.encodeSVG(A));var F=document.createElement("canvas");F.id=Xa.randstr(),_z({format:f,width:M,height:S,scale:v,canvas:F,svg:A,promise:!0}).then(w).catch(T)})}function x(w){return d?w.replace(ml.IMAGE_URL_PREFIX,""):w}return new Promise(function(w,T){S0.newPlot(h,r,m,y).then(b).then(_).then(g).then(function(A){w(x(A))}).catch(function(A){T(A)})})}var C2=Tz,ba=we,kz=hr,Az=Xo,Mz=Go.dfltConfig,Pa=ba.isPlainObject,_n=Array.isArray,Lv=ba.isArrayOrTypedArray,Sz=function(e,r){e===void 0&&(e=[]),r===void 0&&(r={});var a=Az.get(),i=[],n={_context:ba.extendFlat({},Mz)},o,l;_n(e)?(n.data=ba.extendDeep([],e),o=e):(n.data=[],o=[],i.push(br("array","data"))),Pa(r)?(n.layout=ba.extendDeep({},r),l=r):(n.layout={},l={},arguments.length>1&&i.push(br("object","layout"))),kz.supplyDefaults(n);for(var s=n._fullData,f=o.length,c=0;c<f;c++){var u=o[c],v=["data",c];if(!Pa(u)){i.push(br("object",v));continue}var p=s[c],d=p.type,h=a.traces[d].attributes;h.type={valType:"enumerated",values:[d]},p.visible===!1&&u.visible!==!1&&i.push(br("invisible",v)),gc(u,p,h,i,v)}var m=n._fullLayout,y=Lz(a,s);return gc(l,m,y,i,"layout"),i.length===0?void 0:i};function gc(t,e,r,a,i,n){n=n||[];for(var o=Object.keys(t),l=0;l<o.length;l++){var s=o[l],f=n.slice();f.push(s);var c=t[s],u=e[s],v=Pz(r,s),p=(v||{}).valType,d=p==="info_array",h=p==="colorscale",m=(v||{}).items;if(!Dz(r,s))a.push(br("schema",i,f));else if(Pa(c)&&Pa(u)&&p!=="any")gc(c,u,v,a,i,f);else if(d&&_n(c)){c.length>u.length&&a.push(br("unused",i,f.concat(u.length)));var y=u.length,b=Array.isArray(m);b&&(y=Math.min(y,m.length));var _,g,x,w,T;if(v.dimensions===2)for(g=0;g<y;g++)if(_n(c[g])){c[g].length>u[g].length&&a.push(br("unused",i,f.concat(g,u[g].length)));var A=u[g].length;for(_=0;_<(b?Math.min(A,m[g].length):A);_++)x=b?m[g][_]:m,w=c[g][_],T=u[g][_],ba.validate(w,x)?T!==w&&T!==+w&&a.push(br("dynamic",i,f.concat(g,_),w,T)):a.push(br("value",i,f.concat(g,_),w))}else a.push(br("array",i,f.concat(g),c[g]));else for(g=0;g<y;g++)x=b?m[g]:m,w=c[g],T=u[g],ba.validate(w,x)?T!==w&&T!==+w&&a.push(br("dynamic",i,f.concat(g),w,T)):a.push(br("value",i,f.concat(g),w))}else if(v.items&&!d&&_n(c)){var M=m[Object.keys(m)[0]],S=[],L,E;for(L=0;L<u.length;L++){var F=u[L]._index||L;if(E=f.slice(),E.push(F),Pa(c[F])&&Pa(u[L])){S.push(F);var N=c[F],z=u[L];Pa(N)&&N.visible!==!1&&z.visible===!1?a.push(br("invisible",i,E)):gc(N,z,M,a,i,E)}}for(L=0;L<c.length;L++)E=f.slice(),E.push(L),Pa(c[L])?S.indexOf(L)===-1&&a.push(br("unused",i,E)):a.push(br("object",i,E,c[L]))}else!Pa(c)&&Pa(u)?a.push(br("object",i,f,c)):!Lv(c)&&Lv(u)&&!d&&!h?a.push(br("array",i,f,c)):s in e?ba.validate(c,v)?v.valType==="enumerated"&&(v.coerceNumber&&c!==+u||!Lv(c)&&c!==u||String(c)!==String(u))&&a.push(br("dynamic",i,f,c,u)):a.push(br("value",i,f,c)):a.push(br("unused",i,f,c))}return a}function Lz(t,e){for(var r=t.layout.layoutAttributes,a=0;a<e.length;a++){var i=e[a],n=t.traces[i.type],o=n.layoutAttributes;o&&(i.subplot?ba.extendFlat(r[n.attributes.subplot.dflt],o):ba.extendFlat(r,o))}return r}var Cz={object:function(t,e){var r;return t==="layout"&&e===""?r="The layout argument":t[0]==="data"&&e===""?r="Trace "+t[1]+" in the data argument":r=Qi(t)+"key "+e,r+" must be linked to an object container"},array:function(t,e){var r;return t==="data"?r="The data argument":r=Qi(t)+"key "+e,r+" must be linked to an array container"},schema:function(t,e){return Qi(t)+"key "+e+" is not part of the schema"},unused:function(t,e,r){var a=Pa(r)?"container":"key";return Qi(t)+a+" "+e+" did not get coerced"},dynamic:function(t,e,r,a){return[Qi(t)+"key",e,"(set to '"+r+"')","got reset to","'"+a+"'","during defaults."].join(" ")},invisible:function(t,e){return(e?Qi(t)+"item "+e:"Trace "+t[1])+" got defaulted to be not visible"},value:function(t,e,r){return[Qi(t)+"key "+e,"is set to an invalid value ("+r+")"].join(" ")}};function Qi(t){return _n(t)?"In data trace "+t[1]+", ":"In "+t+", "}function br(t,e,r,a,i){r=r||"";var n,o;_n(e)?(n=e[0],o=e[1]):(n=e,o=null);var l=Ez(r),s=Cz[t](e,l,a,i);return ba.log(s),{code:t,container:n,trace:o,path:r,astr:l,msg:s}}function Dz(t,e){var r=D2(e),a=r.keyMinusId,i=r.id;return a in t&&t[a]._isSubplotObj&&i?!0:e in t}function Pz(t,e){if(e in t)return t[e];var r=D2(e);return t[r.keyMinusId]}var $z=ba.counterRegex("([a-z]+)");function D2(t){var e=t.match($z);return{keyMinusId:e&&e[1],id:e&&e[2]}}function Ez(t){if(!_n(t))return String(t);for(var e="",r=0;r<t.length;r++){var a=t[r];typeof a=="number"?e=e.substr(0,e.length-1)+"["+a+"]":e+=a,r<t.length-1&&(e+=".")}return e}var zz=we,ff=ra;function Rz(t,e,r){var a=document.createElement("a"),i="download"in a,n=new Promise(function(o,l){var s,f;if(i)return s=ff.createBlob(t,r),f=ff.createObjectURL(s),a.href=f,a.download=e,document.body.appendChild(a),a.click(),document.body.removeChild(a),ff.revokeObjectURL(f),s=null,o(e);if(zz.isSafari()){var c=r==="svg"?",":";base64,";return ff.octetStream(c+encodeURIComponent(t)),o(e)}l(new Error("download error"))});return n}var Iz=Rz,L0=we,Fz=C2,Nz=Iz;function Hz(t,e){var r;return L0.isPlainObject(t)||(r=L0.getGraphDiv(t)),e=e||{},e.format=e.format||"png",e.width=e.width||null,e.height=e.height||null,e.imageDataOnly=!0,new Promise(function(a,i){r&&r._snapshotInProgress&&i(new Error("Snapshotting already in progress.")),r&&(r._snapshotInProgress=!0);var n=Fz(t,e),o=e.filename||t.fn||"newplot";o+="."+e.format.replace("-","."),n.then(function(l){return r&&(r._snapshotInProgress=!1),Nz(l,o,e.format)}).then(function(l){a(l)}).catch(function(l){r&&(r._snapshotInProgress=!1),i(l)})})}var P2=Hz,Vp={},Qr=we,Jr=Qr.isPlainObject,$2=Xo,E2=hr,Oz=wa,z2=Ht,R2=Go.dfltConfig;Vp.makeTemplate=function(t){t=Qr.isPlainObject(t)?t:Qr.getGraphDiv(t),t=Qr.extendDeep({_context:R2},{data:t.data,layout:t.layout}),E2.supplyDefaults(t);var e=t.data||[],r=t.layout||{};r._basePlotModules=t._fullLayout._basePlotModules,r._modules=t._fullLayout._modules;var a={data:{},layout:{}};e.forEach(function(p){var d={};Fl(p,d,Bz.bind(null,p));var h=Qr.coerce(p,{},Oz,"type"),m=a.data[h];m||(m=a.data[h]=[]),m.push(d)}),Fl(r,a.layout,jz.bind(null,r)),delete a.layout.template;var i=r.template;if(Jr(i)){var n=i.layout,o,l,s,f,c,u;Jr(n)&&bc(n,a.layout);var v=i.data;if(Jr(v)){for(l in a.data)if(s=v[l],Array.isArray(s)){for(c=a.data[l],u=c.length,f=s.length,o=0;o<u;o++)bc(s[o%f],c[o]);for(o=u;o<f;o++)c.push(Qr.extendDeep({},s[o]))}for(l in v)l in a.data||(a.data[l]=Qr.extendDeep([],v[l]))}}return a};function bc(t,e){t=Qr.extendDeep({},t);var r=Object.keys(t).sort(),a,i;function n(c,u,v){if(Jr(u)&&Jr(c))bc(c,u);else if(Array.isArray(u)&&Array.isArray(c)){var p=z2.arrayTemplater({_template:t},v);for(i=0;i<u.length;i++){var d=u[i],h=p.newItem(d)._template;h&&bc(h,d)}var m=p.defaultItems();for(i=0;i<m.length;i++)u.push(m[i]._template);for(i=0;i<u.length;i++)delete u[i].templateitemname}}for(a=0;a<r.length;a++){var o=r[a],l=t[o];if(o in e?n(l,e[o],o):e[o]=l,xc(o)===o)for(var s in e){var f=xc(s);s!==f&&f===o&&!(s in t)&&n(l,e[s],o)}}}function xc(t){return t.replace(/[0-9]+$/,"")}function Fl(t,e,r,a,i){var n=i&&r(i);for(var o in t){var l=t[o],s=ha(t,o,a),f=ha(t,o,i),c=r(f);if(!c){var u=xc(o);u!==o&&(f=ha(t,u,i),c=r(f))}if(!(n&&n===c)&&!(!c||c._noTemplating||c.valType==="data_array"||c.arrayOk&&Array.isArray(l)))if(!c.valType&&Jr(l))Fl(l,e,r,s,f);else if(c._isLinkedToArray&&Array.isArray(l))for(var v=!1,p=0,d={},h=0;h<l.length;h++){var m=l[h];if(Jr(m)){var y=m.name;if(y)d[y]||(Fl(m,e,r,ha(l,p,s),ha(l,p,f)),p++,d[y]=1);else if(!v){var b=z2.arrayDefaultKey(o),_=ha(t,b,a),g=ha(l,p,s);Fl(m,e,r,g,ha(l,p,f));var x=Qr.nestedProperty(e,g),w=Qr.nestedProperty(e,_);w.set(x.get()),x.set(null),v=!0}}}else{var T=Qr.nestedProperty(e,s);T.set(l)}}}function jz(t,e){return $2.getLayoutValObject(t,Qr.nestedProperty({},e).parts)}function Bz(t,e){return $2.getTraceValObject(t,Qr.nestedProperty({},e).parts)}function ha(t,e,r){var a;return r?Array.isArray(t)?a=r+"["+e+"]":a=r+"."+e:a=e,a}Vp.validateTemplate=function(t,e){var r=Qr.extendDeep({},{_context:R2,data:t.data,layout:t.layout}),a=r.layout||{};Jr(e)||(e=a.template||{});var i=e.layout,n=e.data,o=[];r.layout=a,r.layout.template=e,E2.supplyDefaults(r);var l=r._fullLayout,s=r._fullData,f={};function c(_,g){for(var x in _)if(x.charAt(0)!=="_"&&Jr(_[x])){var w=xc(x),T=[],A;for(A=0;A<g.length;A++)T.push(ha(_,x,g[A])),w!==x&&T.push(ha(_,w,g[A]));for(A=0;A<T.length;A++)f[T[A]]=1;c(_[x],T)}}function u(_,g){for(var x in _)if(x.indexOf("defaults")===-1&&Jr(_[x])){var w=ha(_,x,g);f[w]?u(_[x],w):o.push({code:"unused",path:w})}}if(Jr(i)?(c(l,["layout"]),u(i,"layout")):o.push({code:"layout"}),!Jr(n))o.push({code:"data"});else{for(var v={},p,d=0;d<s.length;d++){var h=s[d];p=h.type,v[p]=(v[p]||0)+1,h._fullInput._template||o.push({code:"missing",index:h.index,traceType:p})}for(p in n){var m=n[p].length,y=v[p]||0;m>y?o.push({code:"unused",traceType:p,templateCount:m,dataCount:y}):y>m&&o.push({code:"reused",traceType:p,templateCount:m,dataCount:y})}}function b(_,g){for(var x in _)if(x.charAt(0)!=="_"){var w=_[x],T=ha(_,x,g);Jr(w)?(Array.isArray(_)&&w._template===!1&&w.templateitemname&&o.push({code:"missing",path:T,templateitemname:w.templateitemname}),b(w,T)):Array.isArray(w)&&Gz(w)&&b(w,T)}}if(b({data:s,layout:l},""),o.length)return o.map(Uz)};function Gz(t){for(var e=0;e<t.length;e++)if(Jr(t[e]))return!0}function Uz(t){var e;switch(t.code){case"data":e="The template has no key data.";break;case"layout":e="The template has no key layout.";break;case"missing":t.path?e="There are no templates for item "+t.path+" with name "+t.templateitemname:e="There are no templates for trace "+t.index+", of type "+t.traceType+".";break;case"unused":t.path?e="The template item at "+t.path+" was not used in constructing the plot.":t.dataCount?e="Some of the templates of type "+t.traceType+" were not used. The template has "+t.templateCount+" traces, the data only has "+t.dataCount+" of this type.":e="The template has "+t.templateCount+" traces of type "+t.traceType+" but there are none in the data.";break;case"reused":e="Some of the templates of type "+t.traceType+" were used more than once. The template has "+t.templateCount+" traces, the data has "+t.dataCount+" of this type.";break}return t.msg=e,t}var gr=ep;Yt._doPlot=gr._doPlot;Yt.newPlot=gr.newPlot;Yt.restyle=gr.restyle;Yt.relayout=gr.relayout;Yt.redraw=gr.redraw;Yt.update=gr.update;Yt._guiRestyle=gr._guiRestyle;Yt._guiRelayout=gr._guiRelayout;Yt._guiUpdate=gr._guiUpdate;Yt._storeDirectGUIEdit=gr._storeDirectGUIEdit;Yt.react=gr.react;Yt.extendTraces=gr.extendTraces;Yt.prependTraces=gr.prependTraces;Yt.addTraces=gr.addTraces;Yt.deleteTraces=gr.deleteTraces;Yt.moveTraces=gr.moveTraces;Yt.purge=gr.purge;Yt.addFrames=gr.addFrames;Yt.deleteFrames=gr.deleteFrames;Yt.animate=gr.animate;Yt.setPlotConfig=gr.setPlotConfig;var Vz=Bc.getGraphDiv,Wz=Dp.eraseActiveShape;Yt.deleteActiveShape=function(t){return Wz(Vz(t))};Yt.toImage=C2;Yt.validate=Sz;Yt.downloadImage=P2;var I2=Vp;Yt.makeTemplate=I2.makeTemplate;Yt.validateTemplate=I2.validateTemplate;var Cv=we,Xz=ot,Wp=function(e,r,a,i){var n=i("x"),o=i("y"),l,s=Xz.getComponentMethod("calendars","handleTraceDefaults");if(s(e,r,["x","y"],a),n){var f=Cv.minRowLength(n);o?l=Math.min(f,Cv.minRowLength(o)):(l=f,i("y0"),i("dy"))}else{if(!o)return 0;l=Cv.minRowLength(o),i("x0"),i("dx")}return r._length=l,l},C0=we.dateTick0,Yz=fr,qz=Yz.ONEWEEK;function D0(t,e){return t%qz===0?C0(e,1):C0(e,0)}var bu=function(e,r,a,i,n){if(n||(n={x:!0,y:!0}),n.x){var o=i("xperiod");o&&(i("xperiod0",D0(o,r.xcalendar)),i("xperiodalignment"))}if(n.y){var l=i("yperiod");l&&(i("yperiod0",D0(l,r.ycalendar)),i("yperiodalignment"))}},P0=["orientation","groupnorm","stackgaps"],Zz=function(e,r,a,i){var n=a._scatterStackOpts,o=i("stackgroup");if(o){var l=r.xaxis+r.yaxis,s=n[l];s||(s=n[l]={});var f=s[o],c=!1;f?f.traces.push(r):(f=s[o]={traceIndices:[],traces:[r]},c=!0);for(var u={orientation:r.x&&!r.y?"h":"v"},v=0;v<P0.length;v++){var p=P0[v],d=p+"Found";if(!f[d]){var h=e[p]!==void 0,m=p==="orientation";if((h||c)&&(f[p]=i(p,u[p]),m&&(f.fillDflt=f[p]==="h"?"tonextx":"tonexty"),h&&(f[d]=!0,!c&&(delete f.traces[0][p],m))))for(var y=0;y<f.traces.length-1;y++){var b=f.traces[y];b._input.fill!==b.fill&&(b.fill=f.fillDflt)}}}return f}},$0=yt,E0=ja.hasColorscale,z0=gs,Kz=jr,F2=function(e,r,a,i,n,o){var l=Kz.isBubble(e),s=(e.line||{}).color,f;if(o=o||{},s&&(a=s),n("marker.symbol"),n("marker.opacity",l?.7:1),n("marker.size"),o.noAngle||(n("marker.angle"),o.noAngleRef||n("marker.angleref"),o.noStandOff||n("marker.standoff")),n("marker.color",a),E0(e,"marker")&&z0(e,r,i,n,{prefix:"marker.",cLetter:"c"}),o.noSelect||(n("selected.marker.color"),n("unselected.marker.color"),n("selected.marker.size"),n("unselected.marker.size")),o.noLine||(s&&!Array.isArray(s)&&r.marker.color!==s?f=s:l?f=$0.background:f=$0.defaultLine,n("marker.line.color",f),E0(e,"marker.line")&&z0(e,r,i,n,{prefix:"marker.line.",cLetter:"c"}),n("marker.line.width",l?1:0)),l&&(n("marker.sizeref"),n("marker.sizemin"),n("marker.sizemode")),o.gradient){var c=n("marker.gradient.type");c!=="none"&&n("marker.gradient.color")}},Qz=we.isArrayOrTypedArray,Jz=ja.hasColorscale,eR=gs,N2=function(e,r,a,i,n,o){o||(o={});var l=(e.marker||{}).color;if(l&&l._inputArray&&(l=l._inputArray),n("line.color",a),Jz(e,"line"))eR(e,r,i,n,{prefix:"line.",cLetter:"c"});else{var s=(Qz(l)?!1:l)||a;n("line.color",s)}n("line.width"),o.noDash||n("line.dash"),o.backoff&&n("line.backoff")},tR=function(e,r,a){var i=a("line.shape");i==="spline"&&a("line.smoothing")},rR=we,H2=function(t,e,r,a,i){i=i||{},a("textposition"),rR.coerceFont(a,"textfont",i.font||r.font,i),i.noSelect||(a("selected.textfont.color"),a("unselected.textfont.color"))},Bf=yt,R0=we.isArrayOrTypedArray;function aR(t){for(var e=Bf.interpolate(t[0][1],t[1][1],.5),r=2;r<t.length;r++){var a=Bf.interpolate(t[r-1][1],t[r][1],.5);e=Bf.interpolate(e,a,t[r-1][0]/t[r][0])}return e}var O2=function(e,r,a,i,n){n||(n={});var o=!1;if(r.marker){var l=r.marker.color,s=(r.marker.line||{}).color;l&&!R0(l)?o=l:s&&!R0(s)&&(o=s)}var f;if(n.moduleHasFillgradient){var c=i("fillgradient.type");if(c!=="none"){i("fillgradient.start"),i("fillgradient.stop");var u=i("fillgradient.colorscale");u&&(f=aR(u))}}i("fillcolor",Bf.addOpacity((r.line||{}).color||o||f||a,.5))},I0=we,iR=ot,nR=Vi,oR=yu,Xn=jr,lR=Wp,sR=bu,fR=Zz,cR=F2,uR=N2,F0=tR,vR=H2,dR=O2,hR=we.coercePattern,pR=function(e,r,a,i){function n(p,d){return I0.coerce(e,r,nR,p,d)}var o=lR(e,r,i,n);if(o||(r.visible=!1),!!r.visible){sR(e,r,i,n),n("xhoverformat"),n("yhoverformat"),n("zorder");var l=fR(e,r,i,n);i.scattermode==="group"&&r.orientation===void 0&&n("orientation","v");var s=!l&&o<oR.PTS_LINESONLY?"lines+markers":"lines";n("text"),n("hovertext"),n("mode",s),Xn.hasMarkers(r)&&cR(e,r,a,i,n,{gradient:!0}),Xn.hasLines(r)&&(uR(e,r,a,i,n,{backoff:!0}),F0(e,r,n),n("connectgaps"),n("line.simplify")),Xn.hasText(r)&&(n("texttemplate"),vR(e,r,i,n));var f=[];(Xn.hasMarkers(r)||Xn.hasText(r))&&(n("cliponaxis"),n("marker.maxdisplayed"),f.push("points")),n("fill",l?l.fillDflt:"none"),r.fill!=="none"&&(dR(e,r,a,n,{moduleHasFillgradient:!0}),Xn.hasLines(r)||F0(e,r,n),hR(n,"fillpattern",r.fillcolor,!1));var c=(r.line||{}).color,u=(r.marker||{}).color;(r.fill==="tonext"||r.fill==="toself")&&f.push("fills"),n("hoveron",f.join("+")||"points"),r.hoveron!=="fills"&&n("hovertemplate");var v=iR.getComponentMethod("errorbars","supplyDefaults");v(e,r,c||u||a,{axis:"y"}),v(e,r,c||u||a,{axis:"x",inherit:"y"}),I0.coerceSelectionMarkerOpacity(r,n)}},mR=pi.getAxisGroup,Xp=function(e,r,a,i,n){var o=r.orientation,l=r[{v:"x",h:"y"}[o]+"axis"],s=mR(a,l)+o,f=a._alignmentOpts||{},c=i("alignmentgroup"),u=f[s];u||(u=f[s]={});var v=u[c];v?v.traces.push(r):v=u[c]={traces:[r],alignmentIndex:Object.keys(u).length,offsetGroups:{}};var p=i("offsetgroup")||"",d=v.offsetGroups,h=d[p];r._offsetIndex=0,(n!=="group"||p)&&(h||(h=d[p]={offsetIndex:Object.keys(d).length}),r._offsetIndex=h.offsetIndex)},yR=we,gR=Xp,bR=Vi,j2=function(e,r){var a,i,n,o=r.scattermode;function l(v){return yR.coerce(i._input,i,bR,v)}if(r.scattermode==="group")for(n=0;n<e.length;n++)i=e[n],i.type==="scatter"&&(a=i._input,gR(a,i,r,l,o));for(n=0;n<e.length;n++){var s=e[n];if(s.type==="scatter"){var f=s.fill;if(!(f==="none"||f==="toself")&&(s.opacity=void 0,f==="tonexty"||f==="tonextx"))for(var c=n-1;c>=0;c--){var u=e[c];if(u.type==="scatter"&&u.xaxis===s.xaxis&&u.yaxis===s.yaxis){u.opacity=void 0;break}}}}},xR=we,_R=tp,wR=function(t,e){function r(i,n){return xR.coerce(t,e,_R,i,n)}var a=e.barmode==="group";e.scattermode==="group"&&r("scattergap",a?e.bargap:.2)},TR=kt,B2=we,kR=B2.dateTime2ms,cf=B2.incrementMonth,AR=fr,MR=AR.ONEAVGMONTH,xu=function(e,r,a,i){if(r.type!=="date")return{vals:i};var n=e[a+"periodalignment"];if(!n)return{vals:i};var o=e[a+"period"],l;if(TR(o)){if(o=+o,o<=0)return{vals:i}}else if(typeof o=="string"&&o.charAt(0)==="M"){var s=+o.substring(1);if(s>0&&Math.round(s)===s)l=s;else return{vals:i}}for(var f=r.calendar,c=n==="start",u=n==="end",v=e[a+"period0"],p=kR(v,f)||0,d=[],h=[],m=[],y=i.length,b=0;b<y;b++){var _=i[b],g,x,w;if(l){for(g=Math.round((_-p)/(l*MR)),w=cf(p,l*g,f);w>_;)w=cf(w,-l,f);for(;w<=_;)w=cf(w,l,f);x=cf(w,-l,f)}else{for(g=Math.round((_-p)/o),w=p+g*o;w>_;)w-=o;for(;w<=_;)w+=o;x=w-o}d[b]=c?x:u?w:(x+w)/2,h[b]=x,m[b]=w}return{vals:d,starts:h,ends:m}},Dv=ja.hasColorscale,Pv=op,N0=jr,G2=function(e,r){N0.hasLines(r)&&Dv(r,"line")&&Pv(e,r,{vals:r.line.color,containerStr:"line",cLetter:"c"}),N0.hasMarkers(r)&&(Dv(r,"marker")&&Pv(e,r,{vals:r.marker.color,containerStr:"marker",cLetter:"c"}),Dv(r,"marker.line")&&Pv(e,r,{vals:r.marker.line.color,containerStr:"marker.line",cLetter:"c"}))},ir=we,U2=function(e,r){for(var a=0;a<e.length;a++)e[a].i=a;ir.mergeArray(r.text,e,"tx"),ir.mergeArray(r.texttemplate,e,"txt"),ir.mergeArray(r.hovertext,e,"htx"),ir.mergeArray(r.customdata,e,"data"),ir.mergeArray(r.textposition,e,"tp"),r.textfont&&(ir.mergeArrayCastPositive(r.textfont.size,e,"ts"),ir.mergeArray(r.textfont.color,e,"tc"),ir.mergeArray(r.textfont.family,e,"tf"),ir.mergeArray(r.textfont.weight,e,"tw"),ir.mergeArray(r.textfont.style,e,"ty"),ir.mergeArray(r.textfont.variant,e,"tv"),ir.mergeArray(r.textfont.textcase,e,"tC"),ir.mergeArray(r.textfont.lineposition,e,"tE"),ir.mergeArray(r.textfont.shadow,e,"tS"));var i=r.marker;if(i){ir.mergeArrayCastPositive(i.size,e,"ms"),ir.mergeArrayCastPositive(i.opacity,e,"mo"),ir.mergeArray(i.symbol,e,"mx"),ir.mergeArray(i.angle,e,"ma"),ir.mergeArray(i.standoff,e,"mf"),ir.mergeArray(i.color,e,"mc");var n=i.line;i.line&&(ir.mergeArray(n.color,e,"mlc"),ir.mergeArrayCastPositive(n.width,e,"mlw"));var o=i.gradient;o&&o.type!=="none"&&(ir.mergeArray(o.type,e,"mgt"),ir.mergeArray(o.color,e,"mgc"))}},H0=we,V2=function(e,r){H0.isArrayOrTypedArray(r.selectedpoints)&&H0.tagSelected(e,r)},O0=kt,uh=we,as=Ot,j0=xu,$v=fr.BADNUM,vh=jr,SR=G2,LR=U2,CR=V2;function DR(t,e){var r=t._fullLayout,a=e._xA=as.getFromId(t,e.xaxis||"x","x"),i=e._yA=as.getFromId(t,e.yaxis||"y","y"),n=a.makeCalcdata(e,"x"),o=i.makeCalcdata(e,"y"),l=j0(e,a,"x",n),s=j0(e,i,"y",o),f=l.vals,c=s.vals,u=e._length,v=new Array(u),p=e.ids,d=Yp(e,r,a,i),h=!1,m,y,b,_,g,x;Y2(r,e);var w="x",T="y",A;if(d)uh.pushUnique(d.traceIndices,e.index),m=d.orientation==="v",m?(T="s",A="x"):(w="s",A="y"),g=d.stackgaps==="interpolate";else{var M=X2(e,u);W2(t,e,a,i,f,c,M)}var S=!!e.xperiodalignment,L=!!e.yperiodalignment;for(y=0;y<u;y++){var E=v[y]={},F=O0(f[y]),N=O0(c[y]);F&&N?(E[w]=f[y],E[T]=c[y],S&&(E.orig_x=n[y],E.xEnd=l.ends[y],E.xStart=l.starts[y]),L&&(E.orig_y=o[y],E.yEnd=s.ends[y],E.yStart=s.starts[y])):d&&(m?F:N)?(E[A]=m?f[y]:c[y],E.gap=!0,g?(E.s=$v,h=!0):E.s=0):E[w]=E[T]=$v,p&&(E.id=String(p[y]))}if(LR(v,e),SR(t,e),CR(v,e),d){for(y=0;y<v.length;)v[y][A]===$v?v.splice(y,1):y++;if(uh.sort(v,function(P,k){return P[A]-k[A]||P.i-k.i}),h){for(y=0;y<v.length-1&&v[y].gap;)y++;for(x=v[y].s,x||(x=v[y].s=0),b=0;b<y;b++)v[b].s=x;for(_=v.length-1;_>y&&v[_].gap;)_--;for(x=v[_].s,b=v.length-1;b>_;b--)v[b].s=x;for(;y<_;)if(y++,v[y].gap){for(b=y+1;v[b].gap;)b++;for(var z=v[y-1][A],H=v[y-1].s,D=(v[b].s-H)/(v[b][A]-z);y<b;)v[y].s=H+(v[y][A]-z)*D,y++}}}return v}function W2(t,e,r,a,i,n,o){var l=e._length,s=t._fullLayout,f=r._id,c=a._id,u=s._firstScatter[q2(e)]===e.uid,v=(Yp(e,s,r,a)||{}).orientation,p=e.fill;r._minDtick=0,a._minDtick=0;var d={padded:!0},h={padded:!0};o&&(d.ppad=h.ppad=o);var m=l<2||i[0]!==i[l-1]||n[0]!==n[l-1];m&&(p==="tozerox"||p==="tonextx"&&(u||v==="h"))?d.tozero=!0:!(e.error_y||{}).visible&&(p==="tonexty"||p==="tozeroy"||!vh.hasMarkers(e)&&!vh.hasText(e))&&(d.padded=!1,d.ppad=0),m&&(p==="tozeroy"||p==="tonexty"&&(u||v==="v"))?h.tozero=!0:(p==="tonextx"||p==="tozerox")&&(h.padded=!1),f&&(e._extremes[f]=as.findExtremes(r,i,d)),c&&(e._extremes[c]=as.findExtremes(a,n,h))}function X2(t,e){if(vh.hasMarkers(t)){var r=t.marker,a=1.6*(t.marker.sizeref||1),i;if(t.marker.sizemode==="area"?i=function(f){return Math.max(Math.sqrt((f||0)/a),3)}:i=function(f){return Math.max((f||0)/a,3)},uh.isArrayOrTypedArray(r.size)){var n={type:"linear"};as.setConvert(n);for(var o=n.makeCalcdata(t.marker,"size"),l=new Array(e),s=0;s<e;s++)l[s]=i(o[s]);return l}else return i(r.size)}}function Y2(t,e){var r=q2(e),a=t._firstScatter;a[r]||(a[r]=e.uid)}function q2(t){var e=t.stackgroup;return t.xaxis+t.yaxis+t.type+(e?"-"+e:"")}function Yp(t,e,r,a){var i=t.stackgroup;if(i){var n=e._scatterStackOpts[r._id+a._id][i],o=n.orientation==="v"?a:r;if(o.type==="linear"||o.type==="log")return n}}var qp={calc:DR,calcMarkerSize:X2,calcAxisExpansion:W2,setFirstScatter:Y2,getStackOpts:Yp},PR=_u,$R=we.distinctVals;function _u(t,e){this.traces=t,this.sepNegVal=e.sepNegVal,this.overlapNoMerge=e.overlapNoMerge;for(var r=1/0,a=e.posAxis._id.charAt(0),i=[],n=0;n<t.length;n++){for(var o=t[n],l=0;l<o.length;l++){var s=o[l],f=s.p;f===void 0&&(f=s[a]),f!==void 0&&i.push(f)}o[0]&&o[0].width1&&(r=Math.min(o[0].width1,r))}this.positions=i;var c=$R(i);this.distinctPositions=c.vals,c.vals.length===1&&r!==1/0?this.minDiff=r:this.minDiff=Math.min(c.minDiff,r);var u=(e.posAxis||{}).type;(u==="category"||u==="multicategory")&&(this.minDiff=1),this.binWidth=this.minDiff,this.bins={}}_u.prototype.put=function(e,r,a){var i=this.getLabel(e,r,a),n=this.bins[i]||0;return this.bins[i]=n+a,n};_u.prototype.get=function(e,r,a){var i=this.getLabel(e,r,a);return this.bins[i]||0};_u.prototype.getLabel=function(e,r,a){var i=a<0&&this.sepNegVal?"v":"^",n=this.overlapNoMerge?e:Math.round(e/this.binWidth);return i+n+"g"+r};var xa=kt,Ii=we.isArrayOrTypedArray,Eo=fr.BADNUM,ER=ot,is=Ot,zR=pi.getAxisGroup,wu=PR;function RR(t,e){for(var r=e.xaxis,a=e.yaxis,i=t._fullLayout,n=t._fullData,o=t.calcdata,l=[],s=[],f=0;f<n.length;f++){var c=n[f];if(c.visible===!0&&ER.traceIs(c,"bar")&&c.xaxis===r._id&&c.yaxis===a._id&&(c.orientation==="h"?l.push(o[f]):s.push(o[f]),c._computePh))for(var u=t.calcdata[f],v=0;v<u.length;v++)typeof u[v].ph0=="function"&&(u[v].ph0=u[v].ph0()),typeof u[v].ph1=="function"&&(u[v].ph1=u[v].ph1())}var p={xCat:r.type==="category"||r.type==="multicategory",yCat:a.type==="category"||a.type==="multicategory",mode:i.barmode,norm:i.barnorm,gap:i.bargap,groupgap:i.bargroupgap};dh(t,r,a,s,p),dh(t,a,r,l,p)}function dh(t,e,r,a,i){if(a.length){var n,o,l,s,f;switch(NR(r,a),i.mode){case"overlay":Ev(t,e,r,a,i);break;case"group":for(n=[],o=[],l=0;l<a.length;l++)s=a[l],f=s[0].trace,f.offset===void 0?o.push(s):n.push(s);o.length&&HR(t,e,r,o,i),n.length&&Ev(t,e,r,n,i);break;case"stack":case"relative":for(n=[],o=[],l=0;l<a.length;l++)s=a[l],f=s[0].trace,f.base===void 0?o.push(s):n.push(s);FR(o),o.length&&OR(t,e,r,o,i),n.length&&Ev(t,e,r,n,i);break}IR(a),WR(a,e)}}function IR(t){var e,r,a,i,n,o,l;for(e=0;e<t.length;e++)r=t[e],a=r[0].trace,i=r[0].t,i.cornerradiusvalue===void 0&&(n=a.marker?a.marker.cornerradius:void 0,n!==void 0&&(o=xa(n)?+n:+n.slice(0,-1),l=xa(n)?"px":"%",i.cornerradiusvalue=o,i.cornerradiusform=l))}function FR(t){if(!(t.length<2)){var e,r,a,i,n,o,l;for(e=0;e<t.length&&(r=t[e],a=r[0].trace,n=a.marker?a.marker.cornerradius:void 0,n===void 0);e++);if(n!==void 0)for(o=xa(n)?+n:+n.slice(0,-1),l=xa(n)?"px":"%",e=0;e<t.length;e++)r=t[e],i=r[0].t,i.cornerradiusvalue=o,i.cornerradiusform=l}}function NR(t,e){var r,a;for(r=0;r<e.length;r++){var i=e[r],n=i[0].trace,o=n.type==="funnel"?n._base:n.base,l,s=n.orientation==="h"?n.xcalendar:n.ycalendar,f=t.type==="category"||t.type==="multicategory"?function(){return null}:t.d2c;if(Ii(o)){for(a=0;a<Math.min(o.length,i.length);a++)l=f(o[a],0,s),xa(l)?(i[a].b=+l,i[a].hasB=1):i[a].b=0;for(;a<i.length;a++)i[a].b=0}else{l=f(o,0,s);var c=xa(l);for(l=c?l:0,a=0;a<i.length;a++)i[a].b=l,c&&(i[a].hasB=1)}}}function Ev(t,e,r,a,i){for(var n=0;n<a.length;n++){var o=a[n],l=new wu([o],{posAxis:e,sepNegVal:!1,overlapNoMerge:!i.norm});Zp(t,e,l,i),i.norm?(K2(l),Kp(r,l,i)):Z2(r,l)}}function HR(t,e,r,a,i){var n=new wu(a,{posAxis:e,sepNegVal:!1,overlapNoMerge:!i.norm});Zp(t,e,n,i),UR(n,e),i.norm?(K2(n),Kp(r,n,i)):Z2(r,n)}function OR(t,e,r,a,i){var n=new wu(a,{posAxis:e,sepNegVal:i.mode==="relative",overlapNoMerge:!(i.norm||i.mode==="stack"||i.mode==="relative")});Zp(t,e,n,i),GR(r,n,i);for(var o=0;o<a.length;o++)for(var l=a[o],s=l[0].t.offsetindex,f=0;f<l.length;f++){var c=l[f];if(c.s!==Eo){var u=c.b+c.s===n.get(c.p,s,c.s);u&&(c._outmost=!0)}}i.norm&&Kp(r,n,i)}function Zp(t,e,r,a){var i=t._fullLayout,n=r.positions,o=r.distinctPositions,l=r.minDiff,s=r.traces,f=s.length,c=n.length!==o.length,u=l*(1-a.gap),v,p,d,h;if(e._id==="angularaxis")v=u,p=v*(1-(a.groupgap||0)),d=-p/2;else{var m=zR(i,e._id)+s[0][0].trace.orientation;h=i._alignmentOpts[m]||{}}for(var y=0;y<f;y++){var b=s[y],_=b[0].trace;if(e._id!=="angularaxis"){var g=h[_.alignmentgroup]||{},x=Object.keys(g.offsetGroups||{}).length;x?v=u/x:v=c?u/f:u,p=v*(1-(a.groupgap||0)),x?d=((2*_._offsetIndex+1-x)*v-p)/2:d=c?((2*y+1-f)*v-p)/2:-p/2}var w=b[0].t;w.barwidth=p,w.offsetindex=_._offsetIndex||0,w.poffset=d,w.bargroupwidth=u,w.bardelta=l}r.binWidth=s[0][0].t.barwidth/100,jR(r),BR(e,r),e._id==="angularaxis"?B0(e,r):B0(e,r,c)}function jR(t){var e=t.traces,r,a;for(r=0;r<e.length;r++){var i=e[r],n=i[0],o=n.trace,l=n.t,s=o._offset||o.offset,f=l.poffset,c;if(Ii(s)){for(c=Array.prototype.slice.call(s,0,i.length),a=0;a<c.length;a++)xa(c[a])||(c[a]=f);for(a=c.length;a<i.length;a++)c.push(f);l.poffset=c}else s!==void 0&&(l.poffset=s);var u=o._width||o.width,v=l.barwidth;if(Ii(u)){var p=Array.prototype.slice.call(u,0,i.length);for(a=0;a<p.length;a++)xa(p[a])||(p[a]=v);for(a=p.length;a<i.length;a++)p.push(v);if(l.barwidth=p,s===void 0){for(c=[],a=0;a<i.length;a++)c.push(f+(v-p[a])/2);l.poffset=c}}else u!==void 0&&(l.barwidth=u,s===void 0&&(l.poffset=f+(v-u)/2))}}function BR(t,e){for(var r=e.traces,a=Qo(t),i=0;i<r.length;i++)for(var n=r[i],o=n[0].t,l=o.poffset,s=Ii(l),f=o.barwidth,c=Ii(f),u=0;u<n.length;u++){var v=n[u],p=v.w=c?f[u]:f;v.p===void 0&&(v.p=v[a],v["orig_"+a]=v[a]);var d=(s?l[u]:l)+p/2;v[a]=v.p+d}}function B0(t,e,r){var a=e.traces,i=e.minDiff,n=i/2;is.minDtick(t,e.minDiff,e.distinctPositions[0],r);for(var o=0;o<a.length;o++){var l=a[o],s=l[0],f=s.trace,c=[],u,v,p,d;for(d=0;d<l.length;d++)u=l[d],v=u.p-n,p=u.p+n,c.push(v,p);if(f.width||f.offset){var h=s.t,m=h.poffset,y=h.barwidth,b=Ii(m),_=Ii(y);for(d=0;d<l.length;d++){u=l[d];var g=b?m[d]:m,x=_?y[d]:y;v=u.p+g,p=v+x,c.push(v,p)}}f._extremes[t._id]=is.findExtremes(t,c,{padded:!1})}}function Z2(t,e){for(var r=e.traces,a=Qo(t),i=0;i<r.length;i++){for(var n=r[i],o=n[0].trace,l=o.type==="scatter",s=o.orientation==="v",f=[],c=!1,u=0;u<n.length;u++){var v=n[u],p=l?0:v.b,d=l?s?v.y:v.x:p+v.s;v[a]=d,f.push(d),v.hasB&&f.push(p),(!v.hasB||!v.b)&&(c=!0)}o._extremes[t._id]=is.findExtremes(t,f,{tozero:c,padded:!0})}}function GR(t,e,r){var a=Qo(t),i=e.traces,n,o,l,s,f,c,u;for(s=0;s<i.length;s++)if(n=i[s],o=n[0].trace,o.type==="funnel")for(u=n[0].t.offsetindex,f=0;f<n.length;f++)c=n[f],c.s!==Eo&&e.put(c.p,u,-.5*c.s);for(s=0;s<i.length;s++){n=i[s],o=n[0].trace,l=o.type==="funnel",u=o.type==="barpolar"?0:n[0].t.offsetindex;var v=[];for(f=0;f<n.length;f++)if(c=n[f],c.s!==Eo){var p;l?p=c.s:p=c.s+c.b;var d=e.put(c.p,u,p),h=d+p;c.b=d,c[a]=h,r.norm||(v.push(h),c.hasB&&v.push(d))}r.norm||(o._extremes[t._id]=is.findExtremes(t,v,{tozero:!0,padded:!0}))}}function K2(t){for(var e=t.traces,r=0;r<e.length;r++)for(var a=e[r],i=a[0].t.offsetindex,n=0;n<a.length;n++){var o=a[n];o.s!==Eo&&t.put(o.p,i,o.b+o.s)}}function UR(t,e){for(var r=t.traces,a=0;a<r.length;a++){var i=r[a],n=i[0].trace,o=i[0].t.offsetindex;if(n.base===void 0)for(var l=new wu([i],{posAxis:e,sepNegVal:!0,overlapNoMerge:!0}),s=0;s<i.length;s++){var f=i[s];if(f.p!==Eo){var c=l.put(f.p,o,f.b+f.s);c&&(f.b=c)}}}}function Kp(t,e,r){var a=e.traces,i=Qo(t),n=r.norm==="fraction"?1:100,o=n/1e9,l=t.l2c(t.c2l(0)),s=r.mode==="stack"?n:l;function f(w){return xa(t.c2l(w))&&(w<l-o||w>s+o||!xa(l))}for(var c=0;c<a.length;c++){for(var u=a[c],v=u[0].t.offsetindex,p=u[0].trace,d=[],h=!1,m=!1,y=0;y<u.length;y++){var b=u[y];if(b.s!==Eo){var _=Math.abs(n/e.get(b.p,v,b.s));b.b*=_,b.s*=_;var g=b.b,x=g+b.s;b[i]=x,d.push(x),m=m||f(x),b.hasB&&(d.push(g),m=m||f(g)),(!b.hasB||!b.b)&&(h=!0)}}p._extremes[t._id]=is.findExtremes(t,d,{tozero:h,padded:m})}}function VR(t,e,r,a){for(var i=Qo(a),n=0;n<t.length;n++)for(var o=t[n],l=0;l<o.length;l++){var s=o[l],f=s[i];s._sMin=e[f],s._sMax=r[f]}}function WR(t,e){var r=Qo(e),a={},i,n,o,l=1/0,s=-1/0;for(i=0;i<t.length;i++)for(o=t[i],n=0;n<o.length;n++){var f=o[n].p;xa(f)&&(l=Math.min(l,f),s=Math.max(s,f))}var c=1e4/(s-l),u=a.round=function(A){return String(Math.round(c*(A-l)))},v={},p={},d=t.some(function(A){var M=A[0].trace;return"marker"in M&&M.marker.cornerradius});for(i=0;i<t.length;i++){o=t[i],o[0].t.extents=a;var h=o[0].t.poffset,m=Ii(h);for(n=0;n<o.length;n++){var y=o[n],b=y[r]-y.w/2;if(xa(b)){var _=y[r]+y.w/2,g=u(y.p);a[g]?a[g]=[Math.min(b,a[g][0]),Math.max(_,a[g][1])]:a[g]=[b,_]}if(y.p0=y.p+(m?h[n]:h),y.p1=y.p0+y.w,y.s0=y.b,y.s1=y.s0+y.s,d){var x=Math.min(y.s0,y.s1)||0,w=Math.max(y.s0,y.s1)||0,T=y[r];v[T]=T in v?Math.min(v[T],x):x,p[T]=T in p?Math.max(p[T],w):w}}}d&&VR(t,v,p,e)}function Qo(t){return t._id.charAt(0)}var Qp={crossTraceCalc:RR,setGroupPositions:dh},G0=qp,U0=Qp.setGroupPositions;function XR(t,e){for(var r=e.xaxis,a=e.yaxis,i=t._fullLayout,n=t._fullData,o=t.calcdata,l=[],s=[],f=0;f<n.length;f++){var c=n[f];c.visible===!0&&c.type==="scatter"&&c.xaxis===r._id&&c.yaxis===a._id&&(c.orientation==="h"?l.push(o[f]):c.orientation==="v"&&s.push(o[f]))}var u={mode:i.scattermode,gap:i.scattergap};U0(t,r,a,s,u),U0(t,a,r,l,u)}var YR=function(e,r){e._fullLayout.scattermode==="group"&&XR(e,r);var a=r.xaxis,i=r.yaxis,n=a._id+i._id,o=e._fullLayout._scatterStackOpts[n];if(o){var l=e.calcdata,s,f,c,u,v,p,d,h,m,y,b,_,g,x,w;for(var T in o){y=o[T];var A=y.traceIndices;if(A.length){for(b=y.stackgaps==="interpolate",_=y.groupnorm,y.orientation==="v"?(g="x",x="y"):(g="y",x="x"),w=new Array(A.length),s=0;s<w.length;s++)w[s]=!1;p=l[A[0]];var M=new Array(p.length);for(s=0;s<p.length;s++)M[s]=p[s][g];for(s=1;s<A.length;s++){for(v=l[A[s]],f=c=0;f<v.length;f++){for(d=v[f][g];d>M[c]&&c<M.length;c++)zv(v,f,M[c],s,w,b,g),f++;if(d!==M[c]){for(u=0;u<s;u++)zv(l[A[u]],c,d,u,w,b,g);M.splice(c,0,d)}c++}for(;c<M.length;c++)zv(v,f,M[c],s,w,b,g),f++}var S=M.length;for(f=0;f<p.length;f++){for(h=p[f][x]=p[f].s,s=1;s<A.length;s++)v=l[A[s]],v[0].trace._rawLength=v[0].trace._length,v[0].trace._length=S,h+=v[f].s,v[f][x]=h;if(_)for(m=(_==="fraction"?h:h/100)||1,s=0;s<A.length;s++){var L=l[A[s]][f];L[x]/=m,L.sNorm=L.s/m}}for(s=0;s<A.length;s++){v=l[A[s]];var E=v[0].trace,F=G0.calcMarkerSize(E,E._rawLength),N=Array.isArray(F);if(F&&w[s]||N){var z=F;for(F=new Array(S),f=0;f<S;f++)F[f]=v[f].gap?0:N?z[v[f].i]:z}var H=new Array(S),D=new Array(S);for(f=0;f<S;f++)H[f]=v[f].x,D[f]=v[f].y;G0.calcAxisExpansion(e,E,a,i,H,D,F),v[0].t.orientation=y.orientation}}}}};function zv(t,e,r,a,i,n,o){i[a]=!0;var l={i:null,gap:!0,s:0};if(l[o]=r,t.splice(e,0,l),e&&r===t[e-1][o]){var s=t[e-1];l.s=s.s,l.i=s.i,l.gap=s.gap}else n&&(l.s=qR(t,e,r,o));e||(t[0].t=t[1].t,t[0].trace=t[1].trace,delete t[1].t,delete t[1].trace)}function qR(t,e,r,a){var i=t[e-1],n=t[e+1];return n?i?i.s+(n.s-i.s)*(r-i[a])/(n[a]-i[a]):n.s:i.s}var ZR=Et,Q2=fr,yl=Q2.BADNUM,J2=Q2.LOG_CLIP,V0=J2+.5,W0=J2-.5,_c=we,KR=_c.segmentsIntersect,X0=_c.constrain,Rv=yu,QR=function(e,r){var a=r.trace||{},i=r.xaxis,n=r.yaxis,o=i.type==="log",l=n.type==="log",s=i._length,f=n._length,c=r.backoff,u=a.marker,v=r.connectGaps,p=r.baseTolerance,d=r.shape,h=d==="linear",m=a.fill&&a.fill!=="none",y=[],b=Rv.minTolerance,_=e.length,g=new Array(_),x=0,w,T,A,M,S,L,E,F,N,z,H,D,P,k,C,$;function R(xe){var We=e[xe];if(!We)return!1;var Xe=r.linearized?i.l2p(We.x):i.c2p(We.x),Re=r.linearized?n.l2p(We.y):n.c2p(We.y);if(Xe===yl){if(o&&(Xe=i.c2p(We.x,!0)),Xe===yl)return!1;l&&Re===yl&&(Xe*=Math.abs(i._m*f*(i._m>0?V0:W0)/(n._m*s*(n._m>0?V0:W0)))),Xe*=1e3}if(Re===yl){if(l&&(Re=n.c2p(We.y,!0)),Re===yl)return!1;Re*=1e3}return[Xe,Re]}function j(xe,We,Xe,Re){var et=Xe-xe,Ue=Re-We,I=.5-xe,U=.5-We,V=et*et+Ue*Ue,Q=et*I+Ue*U;if(Q>0&&Q<V){var se=I*Ue-U*et;if(se*se<V)return!0}}var G,Y;function O(xe,We){var Xe=xe[0]/s,Re=xe[1]/f,et=Math.max(0,-Xe,Xe-1,-Re,Re-1);return et&&G!==void 0&&j(Xe,Re,G,Y)&&(et=0),et&&We&&j(Xe,Re,We[0]/s,We[1]/f)&&(et=0),(1+Rv.toleranceGrowth*et)*p}function K(xe,We){var Xe=xe[0]-We[0],Re=xe[1]-We[1];return Math.sqrt(Xe*Xe+Re*Re)}var W=Rv.maxScreensAway,X=-s*W,B=s*(1+W),ee=-f*W,ae=f*(1+W),de=[[X,ee,B,ee],[B,ee,B,ae],[B,ae,X,ae],[X,ae,X,ee]],fe,q,te,le,ce,ye;function ue(xe,We){for(var Xe=[],Re=0,et=0;et<4;et++){var Ue=de[et],I=KR(xe[0],xe[1],We[0],We[1],Ue[0],Ue[1],Ue[2],Ue[3]);I&&(!Re||Math.abs(I.x-Xe[0][0])>1||Math.abs(I.y-Xe[0][1])>1)&&(I=[I.x,I.y],Re&&K(I,xe)<K(Xe[0],xe)?Xe.unshift(I):Xe.push(I),Re++)}return Xe}function oe(xe){if(xe[0]<X||xe[0]>B||xe[1]<ee||xe[1]>ae)return[X0(xe[0],X,B),X0(xe[1],ee,ae)]}function pe(xe,We){if(xe[0]===We[0]&&(xe[0]===X||xe[0]===B)||xe[1]===We[1]&&(xe[1]===ee||xe[1]===ae))return!0}function Me(xe,We){var Xe=[],Re=oe(xe),et=oe(We);return Re&&et&&pe(Re,et)||(Re&&Xe.push(Re),et&&Xe.push(et)),Xe}function ve(xe,We,Xe){return function(Re,et){var Ue=oe(Re),I=oe(et),U=[];if(Ue&&I&&pe(Ue,I))return U;Ue&&U.push(Ue),I&&U.push(I);var V=2*_c.constrain((Re[xe]+et[xe])/2,We,Xe)-((Ue||Re)[xe]+(I||et)[xe]);if(V){var Q;Ue&&I?Q=V>0==Ue[xe]>I[xe]?Ue:I:Q=Ue||I,Q[xe]+=V}return U}}var ke;d==="linear"||d==="spline"?ke=ue:d==="hv"||d==="vh"?ke=Me:d==="hvh"?ke=ve(0,X,B):d==="vhv"&&(ke=ve(1,ee,ae));function _e(xe,We){var Xe=We[0]-xe[0],Re=(We[1]-xe[1])/Xe,et=(xe[1]*We[0]-We[1]*xe[0])/Xe;return et>0?[Re>0?X:B,ae]:[Re>0?B:X,ee]}function J(xe){var We=xe[0],Xe=xe[1],Re=We===g[x-1][0],et=Xe===g[x-1][1];if(!(Re&&et))if(x>1){var Ue=We===g[x-2][0],I=Xe===g[x-2][1];Re&&(We===X||We===B)&&Ue?I?x--:g[x-1]=xe:et&&(Xe===ee||Xe===ae)&&I?Ue?x--:g[x-1]=xe:g[x++]=xe}else g[x++]=xe}function be(xe){g[x-1][0]!==xe[0]&&g[x-1][1]!==xe[1]&&J([te,le]),J(xe),ce=null,te=le=0}var Z=_c.isArrayOrTypedArray(u);function me(xe){if(xe&&c&&(xe.i=w,xe.d=e,xe.trace=a,xe.marker=Z?u[xe.i]:u,xe.backoff=c),G=xe[0]/s,Y=xe[1]/f,fe=xe[0]<X?X:xe[0]>B?B:0,q=xe[1]<ee?ee:xe[1]>ae?ae:0,fe||q){if(!x)g[x++]=[fe||xe[0],q||xe[1]];else if(ce){var We=ke(ce,xe);We.length>1&&(be(We[0]),g[x++]=We[1])}else ye=ke(g[x-1],xe)[0],g[x++]=ye;var Xe=g[x-1];fe&&q&&(Xe[0]!==fe||Xe[1]!==q)?(ce&&(te!==fe&&le!==q?J(te&&le?_e(ce,xe):[te||fe,le||q]):te&&le&&J([te,le])),J([fe,q])):te-fe&&le-q&&J([fe||te,q||le]),ce=xe,te=fe,le=q}else ce&&be(ke(ce,xe)[0]),g[x++]=xe}for(w=0;w<_;w++)if(T=R(w),!!T){for(x=0,ce=null,me(T),w++;w<_;w++){if(M=R(w),!M){if(v)continue;break}if(!h||!r.simplify){me(M);continue}var ge=R(w+1);if(z=K(M,T),!(!(m&&(x===0||x===_-1))&&z<O(M,ge)*b)){for(F=[(M[0]-T[0])/z,(M[1]-T[1])/z],S=T,H=z,D=k=C=0,E=!1,A=M,w++;w<e.length;w++){if(L=ge,ge=R(w+1),!L){if(v)continue;break}if(N=[L[0]-T[0],L[1]-T[1]],$=N[0]*F[1]-N[1]*F[0],k=Math.min(k,$),C=Math.max(C,$),C-k>O(L,ge))break;A=L,P=N[0]*F[0]+N[1]*F[1],P>H?(H=P,M=L,E=!1):P<D&&(D=P,S=L,E=!0)}if(E?(me(M),A!==S&&me(S)):(S!==T&&me(S),A!==M&&me(M)),me(A),w>=e.length||!L)break;me(L),T=L}}ce&&J([te||ce[0],le||ce[1]]),y.push(g.slice(0,x))}var Pe=d.slice(d.length-1);if(c&&Pe!=="h"&&Pe!=="v"){for(var Ee=!1,Le=-1,Ae=[],Oe=0;Oe<y.length;Oe++)for(var $e=0;$e<y[Oe].length-1;$e++){var ze=y[Oe][$e],je=y[Oe][$e+1],at=ZR.applyBackoff(je,ze);(at[0]!==je[0]||at[1]!==je[1])&&(Ee=!0),Ae[Le+1]||(Le++,Ae[Le]=[ze,[at[0],at[1]]])}return Ee?Ae:y}return y},Y0={tonextx:1,tonexty:1,tonext:1},ek=function(e,r,a){var i,n,o,l,s,f={},c=!1,u=-1,v=0,p=-1;for(n=0;n<a.length;n++)i=a[n][0].trace,o=i.stackgroup||"",o?o in f?s=f[o]:(s=f[o]=v,v++):i.fill in Y0&&p>=0?s=p:(s=p=v,v++),s<u&&(c=!0),i._groupIndex=u=s;var d=a.slice();c&&d.sort(function(m,y){var b=m[0].trace,_=y[0].trace;return b._groupIndex-_._groupIndex||b.index-_.index});var h={};for(n=0;n<d.length;n++)i=d[n][0].trace,o=i.stackgroup||"",i.visible===!0?(i._nexttrace=null,i.fill in Y0&&(l=h[o],i._prevtrace=l||null,l&&(l._nexttrace=i)),i._ownfill=i.fill&&(i.fill.substr(0,6)==="tozero"||i.fill==="toself"||i.fill.substr(0,2)==="to"&&!i._prevtrace),h[o]=i):i._prevtrace=i._nexttrace=i._ownfill=null;return d},Ea=bt,JR=ot,ns=we,go=ns.ensureSingle,tk=ns.identity,nr=Et,bo=jr,eI=QR,tI=ek,uf=f2.tester,rI=function(e,r,a,i,n,o){var l,s,f=!n,c=!!n&&n.duration>0,u=tI(e,r,a);if(l=i.selectAll("g.trace").data(u,function(p){return p[0].trace.uid}),l.enter().append("g").attr("class",function(p){return"trace scatter trace"+p[0].trace.uid}).style("stroke-miterlimit",2),l.order(),aI(e,l,r),c){o&&(s=o());var v=Ea.transition().duration(n.duration).ease(n.easing).each("end",function(){s&&s()}).each("interrupt",function(){s&&s()});v.each(function(){i.selectAll("g.trace").each(function(p,d){q0(e,d,r,p,u,this,n)})})}else l.each(function(p,d){q0(e,d,r,p,u,this,n)});f&&l.exit().remove(),i.selectAll("path:not([d])").remove()};function aI(t,e,r){e.each(function(a){var i=go(Ea.select(this),"g","fills");nr.setClipUrl(i,r.layerClipId,t);var n=a[0].trace,o=[];n._ownfill&&o.push("_ownFill"),n._nexttrace&&o.push("_nextFill");var l=i.selectAll("g").data(o,tk);l.enter().append("g"),l.exit().each(function(s){n[s]=null}).remove(),l.order().each(function(s){n[s]=go(Ea.select(this),"path","js-fill")})})}function q0(t,e,r,a,i,n,o){var l=t._context.staticPlot,s;iI(t,e,r,a,i);var f=!!o&&o.duration>0;function c(ve){return f?ve.transition():ve}var u=r.xaxis,v=r.yaxis,p=a[0].trace,d=p.line,h=Ea.select(n),m=go(h,"g","errorbars"),y=go(h,"g","lines"),b=go(h,"g","points"),_=go(h,"g","text");if(JR.getComponentMethod("errorbars","plot")(t,m,r,o),p.visible!==!0)return;c(h).style("opacity",p.opacity);var g,x,w=p.fill.charAt(p.fill.length-1);w!=="x"&&w!=="y"&&(w="");var T,A;w==="y"?(T=1,A=v.c2p(0,!0)):w==="x"&&(T=0,A=u.c2p(0,!0)),a[0][r.isRangePlot?"nodeRangePlot3":"node3"]=h;var M="",S=[],L=p._prevtrace,E=null,F=null;L&&(M=L._prevRevpath||"",x=L._nextFill,S=L._ownPolygons,E=L._fillsegments,F=L._fillElement);var N,z,H="",D="",P,k,C,$,R,j,G=[];p._polygons=[];var Y=[],O=[],K=ns.noop;if(g=p._ownFill,bo.hasLines(p)||p.fill!=="none"){x&&x.datum(a),["hv","vh","hvh","vhv"].indexOf(d.shape)!==-1?(P=nr.steps(d.shape),k=nr.steps(d.shape.split("").reverse().join(""))):d.shape==="spline"?P=k=function(ve){var ke=ve[ve.length-1];return ve.length>1&&ve[0][0]===ke[0]&&ve[0][1]===ke[1]?nr.smoothclosed(ve.slice(1),d.smoothing):nr.smoothopen(ve,d.smoothing)}:P=k=function(ve){return"M"+ve.join("L")},C=function(ve){return k(ve.reverse())},O=eI(a,{xaxis:u,yaxis:v,trace:p,connectGaps:p.connectgaps,baseTolerance:Math.max(d.width||1,3)/4,shape:d.shape,backoff:d.backoff,simplify:d.simplify,fill:p.fill}),Y=new Array(O.length);var W=0;for(s=0;s<O.length;s++){var X,B=O[s];!X||!w?(X=B.slice(),Y[W]=X,W++):X.push.apply(X,B)}p._fillElement=null,p._fillExclusionElement=F,p._fillsegments=Y.slice(0,W),Y=p._fillsegments,O.length&&($=O[0][0].slice(),R=O[O.length-1],j=R[R.length-1].slice()),K=function(ve){return function(ke){if(N=P(ke),z=C(ke),H?w?(H+="L"+N.substr(1),D=z+("L"+D.substr(1))):(H+="Z"+N,D=z+"Z"+D):(H=N,D=z),bo.hasLines(p)){var _e=Ea.select(this);if(_e.datum(a),ve)c(_e.style("opacity",0).attr("d",N).call(nr.lineGroupStyle)).style("opacity",1);else{var J=c(_e);J.attr("d",N),nr.singleLineStyle(a,J)}}}}}var ee=y.selectAll(".js-line").data(O);c(ee.exit()).style("opacity",0).remove(),ee.each(K(!1)),ee.enter().append("path").classed("js-line",!0).style("vector-effect",l?"none":"non-scaling-stroke").call(nr.lineGroupStyle).each(K(!0)),nr.setClipUrl(ee,r.layerClipId,t);function ae(ve){c(ve).attr("d","M0,0Z")}var de=function(){var ve=new Array(Y.length);for(s=0;s<Y.length;s++)ve[s]=uf(Y[s]);return ve},fe=function(ve){var ke,_e;if(!ve||ve.length===0)for(ke=new Array(Y.length),_e=0;_e<Y.length;_e++){var J=Y[_e][0].slice(),be=Y[_e][Y[_e].length-1].slice();J[T]=be[T]=A;var Z=[be,J],me=Z.concat(Y[_e]);ke[_e]=uf(me)}else{for(ke=new Array(ve.length-1+Y.length),_e=0;_e<ve.length-1;_e++)ke[_e]=uf(ve[_e]);var ge=ve[ve.length-1].slice();for(ge.reverse(),_e=0;_e<Y.length;_e++)ke[ve.length-1+_e]=uf(Y[_e].concat(ge))}return ke};O.length?(g?(g.datum(a),$&&j&&(w?($[T]=j[T]=A,c(g).attr("d","M"+j+"L"+$+"L"+H.substr(1)).call(nr.singleFillStyle,t),G=fe(null)):(c(g).attr("d",H+"Z").call(nr.singleFillStyle,t),G=de())),p._polygons=G,p._fillElement=g):x&&(p.fill.substr(0,6)==="tonext"&&H&&M?(p.fill==="tonext"?(c(x).attr("d",H+"Z"+M+"Z").call(nr.singleFillStyle,t),G=de(),p._polygons=G.concat(S)):(c(x).attr("d",H+"L"+M.substr(1)+"Z").call(nr.singleFillStyle,t),G=fe(E),p._polygons=G),p._fillElement=x):ae(x)),p._prevRevpath=D):(g?ae(g):x&&ae(x),p._prevRevpath=null),p._ownPolygons=G;function q(ve){return ve.filter(function(ke){return!ke.gap&&ke.vis})}function te(ve){return ve.filter(function(ke){return ke.vis})}function le(ve){return ve.filter(function(ke){return!ke.gap})}function ce(ve){return ve.id}function ye(ve){if(ve.ids)return ce}function ue(){return!1}function oe(ve,ke,_e){var J,be,Z,me=_e[0].trace,ge=bo.hasMarkers(me),Pe=bo.hasText(me),Ee=ye(me),Le=ue,Ae=ue;if(ge||Pe){var Oe=tk,$e=me.stackgroup,ze=$e&&t._fullLayout._scatterStackOpts[u._id+v._id][$e].stackgaps==="infer zero";me.marker.maxdisplayed||me._needsCull?Oe=ze?te:q:$e&&!ze&&(Oe=le),ge&&(Le=Oe),Pe&&(Ae=Oe)}be=ve.selectAll("path.point"),J=be.data(Le,Ee);var je=J.enter().append("path").classed("point",!0);f&&je.call(nr.pointStyle,me,t).call(nr.translatePoints,u,v).style("opacity",0).transition().style("opacity",1),J.order();var at;ge&&(at=nr.makePointStyleFns(me)),J.each(function(xe){var We=Ea.select(this),Xe=c(We);Z=nr.translatePoint(xe,Xe,u,v),Z?(nr.singlePointStyle(xe,Xe,me,at,t),r.layerClipId&&nr.hideOutsideRangePoint(xe,Xe,u,v,me.xcalendar,me.ycalendar),me.customdata&&We.classed("plotly-customdata",xe.data!==null&&xe.data!==void 0)):Xe.remove()}),f?J.exit().transition().style("opacity",0).remove():J.exit().remove(),be=ke.selectAll("g"),J=be.data(Ae,Ee),J.enter().append("g").classed("textpoint",!0).append("text"),J.order(),J.each(function(xe){var We=Ea.select(this),Xe=c(We.select("text"));Z=nr.translatePoint(xe,Xe,u,v),Z?r.layerClipId&&nr.hideOutsideRangePoint(xe,We,u,v,me.xcalendar,me.ycalendar):We.remove()}),J.selectAll("text").call(nr.textPointStyle,me,t).each(function(xe){var We=u.c2p(xe.x),Xe=v.c2p(xe.y);Ea.select(this).selectAll("tspan.line").each(function(){c(Ea.select(this)).attr({x:We,y:Xe})})}),J.exit().remove()}b.datum(a),_.datum(a),oe(b,_,a);var pe=p.cliponaxis===!1,Me=pe?null:r.layerClipId;nr.setClipUrl(b,Me,t),nr.setClipUrl(_,Me,t)}function iI(t,e,r,a,i){var n=r.xaxis,o=r.yaxis,l=Ea.extent(ns.simpleMap(n.range,n.r2c)),s=Ea.extent(ns.simpleMap(o.range,o.r2c)),f=a[0].trace;if(bo.hasMarkers(f)){var c=f.marker.maxdisplayed;if(c!==0){var u=a.filter(function(h){return h.x>=l[0]&&h.x<=l[1]&&h.y>=s[0]&&h.y<=s[1]}),v=Math.ceil(u.length/c),p=0;i.forEach(function(h,m){var y=h[0].trace;bo.hasMarkers(y)&&y.marker.maxdisplayed>0&&m<e&&p++});var d=Math.round(p*v/3+Math.floor(p/3)*v/7.1);a.forEach(function(h){delete h.vis}),u.forEach(function(h,m){Math.round((m+d)%v)===0&&(h.vis=!0)})}}}var Ts={container:"marker",min:"cmin",max:"cmax"},vf=Ot,rk=function(e,r,a){var i={},n={_fullLayout:a},o=vf.getFromTrace(n,r,"x"),l=vf.getFromTrace(n,r,"y"),s=e.orig_x;s===void 0&&(s=e.x);var f=e.orig_y;return f===void 0&&(f=e.y),i.xLabel=vf.tickText(o,o.c2l(s),!0).text,i.yLabel=vf.tickText(l,l.c2l(f),!0).text,i},Iv=bt,zo=Et,nI=ot;function oI(t){var e=Iv.select(t).selectAll("g.trace.scatter");e.style("opacity",function(r){return r[0].trace.opacity}),e.selectAll("g.points").each(function(r){var a=Iv.select(this),i=r.trace||r[0].trace;Jp(a,i,t)}),e.selectAll("g.text").each(function(r){var a=Iv.select(this),i=r.trace||r[0].trace;em(a,i,t)}),e.selectAll("g.trace path.js-line").call(zo.lineGroupStyle),e.selectAll("g.trace path.js-fill").call(zo.fillGroupStyle,t,!1),nI.getComponentMethod("errorbars","style")(e)}function Jp(t,e,r){zo.pointStyle(t.selectAll("path.point"),e,r)}function em(t,e,r){zo.textPointStyle(t.selectAll("text"),e,r)}function lI(t,e,r){var a=e[0].trace;a.selectedpoints?(zo.selectedPointStyle(r.selectAll("path.point"),a),zo.selectedTextStyle(r.selectAll("text"),a)):(Jp(r,a,t),em(r,a,t))}var Z0={style:oI,stylePoints:Jp,styleText:em,styleOnSelect:lI},Yn=yt,sI=jr,ak=function(e,r){var a,i;if(e.mode==="lines")return a=e.line.color,a&&Yn.opacity(a)?a:e.fillcolor;if(e.mode==="none")return e.fill?e.fillcolor:"";var n=r.mcc||(e.marker||{}).color,o=r.mlcc||((e.marker||{}).line||{}).color;return i=n&&Yn.opacity(n)?n:o&&Yn.opacity(o)&&(r.mlw||((e.marker||{}).line||{}).width)?o:"",i?Yn.opacity(i)<.3?Yn.addOpacity(i,.3):i:(a=(e.line||{}).color,a&&Yn.opacity(a)&&sI.hasLines(e)&&e.line.width?a:e.fillcolor)},Gf=we,K0=Na,fI=ot,cI=ak,Fv=yt,uI=Gf.fillText,vI=function(e,r,a,i){var n=e.cd,o=n[0].trace,l=e.xa,s=e.ya,f=l.c2p(r),c=s.c2p(a),u=[f,c],v=o.hoveron||"",p=o.mode.indexOf("markers")!==-1?3:.5,d=!!o.xperiodalignment,h=!!o.yperiodalignment;if(v.indexOf("points")!==-1){var m=function(D){if(d){var P=l.c2p(D.xStart),k=l.c2p(D.xEnd);return f>=Math.min(P,k)&&f<=Math.max(P,k)?0:1/0}var C=Math.max(3,D.mrc||0),$=1-1/C,R=Math.abs(l.c2p(D.x)-f);return R<C?$*R/C:R-C+$},y=function(D){if(h){var P=s.c2p(D.yStart),k=s.c2p(D.yEnd);return c>=Math.min(P,k)&&c<=Math.max(P,k)?0:1/0}var C=Math.max(3,D.mrc||0),$=1-1/C,R=Math.abs(s.c2p(D.y)-c);return R<C?$*R/C:R-C+$},b=function(D){var P=Math.max(p,D.mrc||0),k=l.c2p(D.x)-f,C=s.c2p(D.y)-c;return Math.max(Math.sqrt(k*k+C*C)-P,1-p/P)},_=K0.getDistanceFunction(i,m,y,b);if(K0.getClosest(n,_,e),e.index!==!1){var g=n[e.index],x=l.c2p(g.x,!0),w=s.c2p(g.y,!0),T=g.mrc||1;e.index=g.i;var A=n[0].t.orientation,M=A&&(g.sNorm||g.s),S=A==="h"?M:g.orig_x!==void 0?g.orig_x:g.x,L=A==="v"?M:g.orig_y!==void 0?g.orig_y:g.y;return Gf.extendFlat(e,{color:cI(o,g),x0:x-T,x1:x+T,xLabelVal:S,y0:w-T,y1:w+T,yLabelVal:L,spikeDistance:b(g),hovertemplate:o.hovertemplate}),uI(g,o,e),fI.getComponentMethod("errorbars","hoverInfo")(g,o,e),[e]}}function E(D){if(!D)return!1;var P=D.node();try{var k=new DOMPoint(u[0],u[1]);return P.isPointInFill(k)}catch{var C=P.ownerSVGElement.createSVGPoint();return C.x=u[0],C.y=u[1],P.isPointInFill(C)}}function F(D){var P,k=[],C=1/0,$=-1/0,R=1/0,j=-1/0,G;for(P=0;P<D.length;P++){var Y=D[P];Y.contains(u)&&(k.push(Y),R=Math.min(R,Y.ymin),j=Math.max(j,Y.ymax))}if(k.length===0)return null;R=Math.max(R,0),j=Math.min(j,s._length),G=(R+j)/2;var O,K,W,X,B,ee,ae;for(P=0;P<k.length;P++)for(K=k[P].pts,O=1;O<K.length;O++)ee=K[O-1][1],ae=K[O][1],ee>G!=ae>=G&&(X=K[O-1][0],B=K[O][0],ae-ee&&(W=X+(B-X)*(G-ee)/(ae-ee),C=Math.min(C,W),$=Math.max($,W)));return C=Math.max(C,0),$=Math.min($,l._length),{x0:C,x1:$,y0:G,y1:G}}if(v.indexOf("fills")!==-1&&o._fillElement){var N=E(o._fillElement)&&!E(o._fillExclusionElement);if(N){var z=F(o._polygons);z===null&&(z={x0:u[0],x1:u[0],y0:u[1],y1:u[1]});var H=Fv.defaultLine;return Fv.opacity(o.fillcolor)?H=o.fillcolor:Fv.opacity((o.line||{}).color)&&(H=o.line.color),Gf.extendFlat(e,{distance:e.maxHoverDistance,x0:z.x0,x1:z.x1,y0:z.y0,y1:z.y1,color:H,hovertemplate:!1}),delete e.index,o.text&&!Gf.isArrayOrTypedArray(o.text)?e.text=String(o.text):e.text=o.name,[e]}}},Q0=jr,dI=function(e,r){var a=e.cd,i=e.xaxis,n=e.yaxis,o=[],l=a[0].trace,s,f,c,u,v=!Q0.hasMarkers(l)&&!Q0.hasText(l);if(v)return[];if(r===!1)for(s=0;s<a.length;s++)a[s].selected=0;else for(s=0;s<a.length;s++)f=a[s],c=i.c2p(f.x),u=n.c2p(f.y),f.i!==null&&r.contains([c,u],!1,s,e)?(o.push({pointNumber:f.i,x:i.c2d(f.x),y:n.c2d(f.y)}),f.selected=1):f.selected=0;return o},pr={},Nv,J0;function hI(){return J0||(J0=1,Nv={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes",description:["Sets a reference between this trace's x coordinates and","a 2D cartesian x axis.","If *x* (the default value), the x coordinates refer to","`layout.xaxis`.","If *x2*, the x coordinates refer to `layout.xaxis2`, and so on."].join(" ")},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes",description:["Sets a reference between this trace's y coordinates and","a 2D cartesian y axis.","If *y* (the default value), the y coordinates refer to","`layout.yaxis`.","If *y2*, the y coordinates refer to `layout.yaxis2`, and so on."].join(" ")}}),Nv}var Hv,eb;function pI(){if(eb)return Hv;eb=1;var t=ot.traceIs,e=jw;Hv=function(l,s,f,c){f("autotypenumbers",c.autotypenumbersDflt);var u=f("type",(c.splomStash||{}).type);u==="-"&&(r(s,c.data),s.type==="-"?s.type="linear":l.type=s.type)};function r(o,l){if(o.type==="-"){var s=o._id,f=s.charAt(0),c;s.indexOf("scene")!==-1&&(s=f);var u=a(l,s,f);if(u){if(u.type==="histogram"&&f==={v:"y",h:"x"}[u.orientation||"v"]){o.type="linear";return}var v=f+"calendar",p=u[v],d={noMultiCategory:!t(u,"cartesian")||t(u,"noMultiCategory")};if(u.type==="box"&&u._hasPreCompStats&&f==={h:"x",v:"y"}[u.orientation||"v"]&&(d.noMultiCategory=!0),d.autotypenumbers=o.autotypenumbers,n(u,f)){var h=i(u),m=[];for(c=0;c<l.length;c++){var y=l[c];!t(y,"box-violin")||(y[f+"axis"]||f)!==s||(y[h]!==void 0?m.push(y[h][0]):y.name!==void 0?m.push(y.name):m.push("text"),y[v]!==p&&(p=void 0))}o.type=e(m,p,d)}else if(u.type==="splom"){var b=u.dimensions,_=b[u._axesDim[s]];_.visible&&(o.type=e(_.values,p,d))}else o.type=e(u[f]||[u[f+"0"]],p,d)}}}function a(o,l,s){for(var f=0;f<o.length;f++){var c=o[f];if(c.type==="splom"&&c._length>0&&(c["_"+s+"axes"]||{})[l])return c;if((c[s+"axis"]||s)===l){if(n(c,s))return c;if((c[s]||[]).length||c[s+"0"])return c}}}function i(o){return{v:"x",h:"y"}[o.orientation||"v"]}function n(o,l){var s=i(o),f=t(o,"box-violin"),c=t(o._fullInput||{},"candlestick");return f&&!c&&l===s&&o[s]===void 0&&o[s+"0"]===void 0}return Hv}var mI=sr.isTypedArraySpec;function yI(t,e){var r=e.dataAttr||t._id.charAt(0),a={},i,n,o;if(e.axData)i=e.axData;else for(i=[],n=0;n<e.data.length;n++){var l=e.data[n];l[r+"axis"]===t._id&&i.push(l)}for(n=0;n<i.length;n++){var s=i[n][r];for(o=0;o<s.length;o++){var f=s[o];f!=null&&(a[f]=1)}}return Object.keys(a)}var gI=function(e,r,a,i){if(r.type==="category"){var n=e.categoryarray,o=Array.isArray(n)&&n.length>0||mI(n),l;o&&(l="array");var s=a("categoryorder",l),f;s==="array"&&(f=a("categoryarray")),!o&&s==="array"&&(s=r.categoryorder="trace"),s==="trace"?r._initialCategories=[]:s==="array"?r._initialCategories=f.slice():(f=yI(r,i).sort(),s==="category ascending"?r._initialCategories=f:s==="category descending"&&(r._initialCategories=f.reverse()))}},tb=_a.mix,bI=Or,xI=we,_I=function(e,r,a,i){i=i||{};var n=i.dfltColor;function o(T,A){return xI.coerce2(e,r,i.attributes,T,A)}var l=o("linecolor",n),s=o("linewidth"),f=a("showline",i.showLine||!!l||!!s);f||(delete r.linecolor,delete r.linewidth);var c=tb(n,i.bgColor,i.blend||bI.lightFraction).toRgbString(),u=o("gridcolor",c),v=o("gridwidth"),p=o("griddash"),d=a("showgrid",i.showGrid||!!u||!!v||!!p);if(d||(delete r.gridcolor,delete r.gridwidth,delete r.griddash),i.hasMinor){var h=tb(r.gridcolor,i.bgColor,67).toRgbString(),m=o("minor.gridcolor",h),y=o("minor.gridwidth",r.gridwidth||1),b=o("minor.griddash",r.griddash||"solid"),_=a("minor.showgrid",!!m||!!y||!!b);_||(delete r.minor.gridcolor,delete r.minor.gridwidth,delete r.minor.griddash)}if(!i.noZeroLine){o("zerolinelayer");var g=o("zerolinecolor",n),x=o("zerolinewidth"),w=a("zeroline",i.showGrid||!!g||!!x);w||(delete r.zerolinelayer,delete r.zerolinecolor,delete r.zerolinewidth)}},rb=kt,wI=ot,Dl=we,TI=Ht,kI=ri,hh=ti,ab=_w,ib=ww,AI=Aw,MI=Mw,SI=gI,LI=_I,CI=aT,nb=cp,Uf=Rr.WEEKDAY_PATTERN,DI=Rr.HOUR_PATTERN,ik=function(e,r,a,i,n){var o=i.letter,l=i.font||{},s=i.splomStash||{},f=a("visible",!i.visibleDflt),c=r._template||{},u=r.type||c.type||"-",v;if(u==="date"){var p=wI.getComponentMethod("calendars","handleDefaults");p(e,r,"calendar",i.calendar),i.noTicklabelmode||(v=a("ticklabelmode"))}!i.noTicklabelindex&&(u==="date"||u==="linear")&&a("ticklabelindex");var d="";(!i.noTicklabelposition||u==="multicategory")&&(d=Dl.coerce(e,r,{ticklabelposition:{valType:"enumerated",dflt:"outside",values:v==="period"?["outside","inside"]:o==="x"?["outside","inside","outside left","inside left","outside right","inside right"]:["outside","inside","outside top","inside top","outside bottom","inside bottom"]}},"ticklabelposition")),i.noTicklabeloverflow||a("ticklabeloverflow",d.indexOf("inside")!==-1?"hide past domain":u==="category"||u==="multicategory"?"allow":"hide past div"),nb(r,n),CI(e,r,a,i),SI(e,r,a,i),u!=="category"&&!i.noHover&&a("hoverformat");var h=a("color"),m=h!==hh.color.dflt?h:l.color,y=s.label||n._dfltTitle[o];if(MI(e,r,a,u,i),!f)return r;a("title.text",y),Dl.coerceFont(a,"title.font",l,{overrideDflt:{size:Dl.bigFont(l.size),color:m}}),ab(e,r,a,u);var b=i.hasMinor;if(b&&(TI.newContainer(r,"minor"),ab(e,r,a,u,{isMinor:!0})),AI(e,r,a,u,i),ib(e,r,a,i),b){var _=i.isMinor;i.isMinor=!0,ib(e,r,a,i),i.isMinor=_}LI(e,r,a,{dfltColor:h,bgColor:i.bgColor,showGrid:i.showGrid,hasMinor:b,attributes:hh}),b&&!r.minor.ticks&&!r.minor.showgrid&&delete r.minor,(r.showline||r.ticks)&&a("mirror");var g=u==="multicategory";if(!i.noTickson&&(u==="category"||g)&&(r.ticks||r.showgrid)&&(g?(a("tickson","boundaries"),delete r.ticklabelposition):a("tickson")),g){var x=a("showdividers");x&&(a("dividercolor"),a("dividerwidth"))}if(u==="date")if(kI(e,r,{name:"rangebreaks",inclusionAttr:"enabled",handleItemDefaults:PI}),!r.rangebreaks.length)delete r.rangebreaks;else{for(var w=0;w<r.rangebreaks.length;w++)if(r.rangebreaks[w].pattern===Uf){r._hasDayOfWeekBreaks=!0;break}if(nb(r,n),n._has("scattergl")||n._has("splom"))for(var T=0;T<i.data.length;T++){var A=i.data[T];(A.type==="scattergl"||A.type==="splom")&&(A.visible=!1,Dl.warn(A.type+" traces do not work on axes with rangebreaks. Setting trace "+A.index+" to `visible: false`."))}}return r};function PI(t,e,r){function a(v,p){return Dl.coerce(t,e,hh.rangebreaks,v,p)}var i=a("enabled");if(i){var n=a("bounds");if(n&&n.length>=2){var o="",l,s;if(n.length===2){for(l=0;l<2;l++)if(s=ob(n[l]),s){o=Uf;break}}var f=a("pattern",o);if(f===Uf)for(l=0;l<2;l++)s=ob(n[l]),s&&(e.bounds[l]=n[l]=s-1);if(f)for(l=0;l<2;l++)switch(s=n[l],f){case Uf:if(!rb(s)){e.enabled=!1;return}if(s=+s,s!==Math.floor(s)||s<0||s>=7){e.enabled=!1;return}e.bounds[l]=n[l]=s;break;case DI:if(!rb(s)){e.enabled=!1;return}if(s=+s,s<0||s>24){e.enabled=!1;return}e.bounds[l]=n[l]=s;break}if(r.autorange===!1){var c=r.range;if(c[0]<c[1]){if(n[0]<c[0]&&n[1]>c[1]){e.enabled=!1;return}}else if(n[0]>c[0]&&n[1]<c[1]){e.enabled=!1;return}}}else{var u=a("values");if(u&&u.length)a("dvalue");else{e.enabled=!1;return}}}}var $I={sun:1,mon:2,tue:3,wed:4,thu:5,fri:6,sat:7};function ob(t){if(typeof t=="string")return $I[t.substr(0,3).toLowerCase()]}var EI=kt,df=we,nk=function(e,r,a,i){var n=i.counterAxes||[],o=i.overlayableAxes||[],l=i.letter,s=i.grid,f=i.overlayingDomain,c,u,v,p,d,h;s&&(u=s._domains[l][s._axisMap[r._id]],c=s._anchors[r._id],u&&(v=s[l+"side"].split(" ")[0],p=s.domain[l][v==="right"||v==="top"?1:0])),u=u||[0,1],c=c||(EI(e.position)?"free":n[0]||"free"),v=v||(l==="x"?"bottom":"left"),p=p||0,d=0,h=!1;var m=df.coerce(e,r,{anchor:{valType:"enumerated",values:["free"].concat(n),dflt:c}},"anchor"),y=df.coerce(e,r,{side:{valType:"enumerated",values:l==="x"?["bottom","top"]:["left","right"],dflt:v}},"side");if(m==="free"){if(l==="y"){var b=a("autoshift");b&&(p=y==="left"?f[0]:f[1],h=r.automargin?r.automargin:!0,d=y==="left"?-3:3),a("shift",d)}a("position",p)}a("automargin",h);var _=!1;if(o.length&&(_=df.coerce(e,r,{overlaying:{valType:"enumerated",values:[!1].concat(o),dflt:!1}},"overlaying")),!_){var g=a("domain",u);g[0]>g[1]-1/4096&&(r.domain=u),df.noneOrAll(e.domain,r.domain,u),r.tickmode==="sync"&&(r.tickmode="auto")}return a("layer"),r},Ov,lb;function zI(){if(lb)return Ov;lb=1;var t=we,e=yt,r=Ta.isUnifiedHover,a=wT,i=Ht,n=ps,o=ti,l=pI(),s=ik,f=pi,c=nk,u=cr,v=u.id2name,p=u.name2id,d=Rr.AX_ID_PATTERN,h=ot,m=h.traceIs,y=h.getComponentMethod;function b(_,g,x){Array.isArray(_[g])?_[g].push(x):_[g]=[x]}return Ov=function(g,x,w){var T=x.autotypenumbers,A={},M={},S={},L={},E={},F={},N={},z={},H={},D={},P,k;for(P=0;P<w.length;P++){var C=w[P];if(m(C,"cartesian")){var $;if(C.xaxis)$=v(C.xaxis),b(A,$,C);else if(C.xaxes)for(k=0;k<C.xaxes.length;k++)b(A,v(C.xaxes[k]),C);var R;if(C.yaxis)R=v(C.yaxis),b(A,R,C);else if(C.yaxes)for(k=0;k<C.yaxes.length;k++)b(A,v(C.yaxes[k]),C);if(C.type==="funnel"?C.orientation==="h"?($&&(M[$]=!0),R&&(N[R]=!0)):R&&(S[R]=!0):C.type==="image"?(R&&(z[R]=!0),$&&(z[$]=!0)):(R&&(E[R]=!0,F[R]=!0),(!m(C,"carpet")||C.type==="carpet"&&!C._cheater)&&$&&(L[$]=!0)),C.type==="carpet"&&C._cheater&&$&&(M[$]=!0),m(C,"2dMap")&&(H[$]=!0,H[R]=!0),m(C,"oriented")){var j=C.orientation==="h"?R:$;D[j]=!0}}}var G=x._subplots,Y=G.xaxis,O=G.yaxis,K=t.simpleMap(Y,v),W=t.simpleMap(O,v),X=K.concat(W),B=e.background;Y.length&&O.length&&(B=t.coerce(g,x,n,"plot_bgcolor"));var ee=e.combine(B,x.paper_bgcolor),ae,de,fe,q,te;function le(){var I=A[ae]||[];te._traceIndices=I.map(function(U){return U.index}),te._annIndices=[],te._shapeIndices=[],te._selectionIndices=[],te._imgIndices=[],te._subplotsWith=[],te._counterAxes=[],te._name=te._attr=ae,te._id=de}function ce(I,U){return t.coerce(q,te,o,I,U)}function ye(I,U){return t.coerce2(q,te,o,I,U)}function ue(I){return I==="x"?O:Y}function oe(I,U){for(var V=I==="x"?K:W,Q=[],se=0;se<V.length;se++){var re=V[se];re!==U&&!(g[re]||{}).overlaying&&Q.push(p(re))}return Q}var pe={x:ue("x"),y:ue("y")},Me=pe.x.concat(pe.y),ve={},ke=[];function _e(){var I=q.matches;d.test(I)&&Me.indexOf(I)===-1&&(ve[I]=q.type,ke=Object.keys(ve))}var J=a(g,x),be=r(J);for(P=0;P<X.length;P++){ae=X[P],de=p(ae),fe=ae.charAt(0),t.isPlainObject(g[ae])||(g[ae]={}),q=g[ae],te=i.newContainer(x,ae,fe+"axis"),le();var Z=fe==="x"&&!L[ae]&&M[ae]||fe==="y"&&!E[ae]&&S[ae],me=fe==="y"&&(!F[ae]&&N[ae]||z[ae]),ge={hasMinor:!0,letter:fe,font:x.font,outerTicks:H[ae],showGrid:!D[ae],data:A[ae]||[],bgColor:ee,calendar:x.calendar,automargin:!0,visibleDflt:Z,reverseDflt:me,autotypenumbersDflt:T,splomStash:((x._splomAxes||{})[fe]||{})[de],noAutotickangles:fe==="y"};ce("uirevision",x.uirevision),l(q,te,ce,ge),s(q,te,ce,ge,x);var Pe=be&&fe===J.charAt(0),Ee=ye("spikecolor",be?te.color:void 0),Le=ye("spikethickness",be?1.5:void 0),Ae=ye("spikedash",be?"dot":void 0),Oe=ye("spikemode",be?"across":void 0),$e=ye("spikesnap"),ze=ce("showspikes",!!Pe||!!Ee||!!Le||!!Ae||!!Oe||!!$e);ze||(delete te.spikecolor,delete te.spikethickness,delete te.spikedash,delete te.spikemode,delete te.spikesnap);var je=v(q.overlaying),at=[0,1];if(x[je]!==void 0){var xe=v(x[je].anchor);x[xe]!==void 0&&(at=x[xe].domain)}c(q,te,ce,{letter:fe,counterAxes:pe[fe],overlayableAxes:oe(fe,ae),grid:x.grid,overlayingDomain:at}),ce("title.standoff"),_e(),te._input=q}for(P=0;P<ke.length;){de=ke[P++],ae=v(de),fe=ae.charAt(0),t.isPlainObject(g[ae])||(g[ae]={}),q=g[ae],te=i.newContainer(x,ae,fe+"axis"),le();var We={letter:fe,font:x.font,outerTicks:H[ae],showGrid:!D[ae],data:[],bgColor:ee,calendar:x.calendar,automargin:!0,visibleDflt:!1,reverseDflt:!1,autotypenumbersDflt:T,splomStash:((x._splomAxes||{})[fe]||{})[de]};ce("uirevision",x.uirevision),te.type=ve[de]||"linear",s(q,te,ce,We,x),c(q,te,ce,{letter:fe,counterAxes:pe[fe],overlayableAxes:oe(fe,ae),grid:x.grid}),ce("fixedrange"),_e(),te._input=q}var Xe=y("rangeslider","handleDefaults"),Re=y("rangeselector","handleDefaults");for(P=0;P<K.length;P++)ae=K[P],q=g[ae],te=x[ae],Xe(g,x,ae),te.type==="date"&&Re(q,te,x,W,te.calendar),ce("fixedrange");for(P=0;P<W.length;P++){ae=W[P],q=g[ae],te=x[ae];var et=x[v(te.anchor)],Ue=y("rangeslider","isVisible")(et);ce("fixedrange",Ue)}f.handleDefaults(g,x,{axIds:Me.concat(ke).sort(u.idSort),axHasImage:z})},Ov}var jv,sb;function RI(){if(sb)return jv;sb=1;var t=bt,e=ot,r=we,a=Et,i=Ot;return jv=function(o,l,s,f){var c=o._fullLayout;if(l.length===0){i.redrawComponents(o);return}function u(x){var w=x.xaxis,T=x.yaxis;c._defs.select("#"+x.clipId+"> rect").call(a.setTranslate,0,0).call(a.setScale,1,1),x.plot.call(a.setTranslate,w._offset,T._offset).call(a.setScale,1,1);var A=x.plot.selectAll(".scatterlayer .trace");A.selectAll(".point").call(a.setPointGroupScale,1,1),A.selectAll(".textpoint").call(a.setTextPointsScale,1,1),A.call(a.hideOutsideRangePoints,x)}function v(x,w){var T=x.plotinfo,A=T.xaxis,M=T.yaxis,S=A._length,L=M._length,E=!!x.xr1,F=!!x.yr1,N=[];if(E){var z=r.simpleMap(x.xr0,A.r2l),H=r.simpleMap(x.xr1,A.r2l),D=z[1]-z[0],P=H[1]-H[0];N[0]=(z[0]*(1-w)+w*H[0]-z[0])/(z[1]-z[0])*S,N[2]=S*(1-w+w*P/D),A.range[0]=A.l2r(z[0]*(1-w)+w*H[0]),A.range[1]=A.l2r(z[1]*(1-w)+w*H[1])}else N[0]=0,N[2]=S;if(F){var k=r.simpleMap(x.yr0,M.r2l),C=r.simpleMap(x.yr1,M.r2l),$=k[1]-k[0],R=C[1]-C[0];N[1]=(k[1]*(1-w)+w*C[1]-k[1])/(k[0]-k[1])*L,N[3]=L*(1-w+w*R/$),M.range[0]=A.l2r(k[0]*(1-w)+w*C[0]),M.range[1]=M.l2r(k[1]*(1-w)+w*C[1])}else N[1]=0,N[3]=L;i.drawOne(o,A,{skipTitle:!0}),i.drawOne(o,M,{skipTitle:!0}),i.redrawComponents(o,[A._id,M._id]);var j=E?S/N[2]:1,G=F?L/N[3]:1,Y=E?N[0]:0,O=F?N[1]:0,K=E?N[0]/N[2]*S:0,W=F?N[1]/N[3]*L:0,X=A._offset-K,B=M._offset-W;T.clipRect.call(a.setTranslate,Y,O).call(a.setScale,1/j,1/G),T.plot.call(a.setTranslate,X,B).call(a.setScale,j,G),a.setPointGroupScale(T.zoomScalePts,1/j,1/G),a.setTextPointsScale(T.zoomScaleTxt,1/j,1/G)}var p;f&&(p=f());function d(){for(var x={},w=0;w<l.length;w++){var T=l[w],A=T.plotinfo.xaxis,M=T.plotinfo.yaxis;T.xr1&&(x[A._name+".range"]=T.xr1.slice()),T.yr1&&(x[M._name+".range"]=T.yr1.slice())}return p&&p(),e.call("relayout",o,x).then(function(){for(var S=0;S<l.length;S++)u(l[S].plotinfo)})}function h(){for(var x={},w=0;w<l.length;w++){var T=l[w],A=T.plotinfo.xaxis,M=T.plotinfo.yaxis;T.xr0&&(x[A._name+".range"]=T.xr0.slice()),T.yr0&&(x[M._name+".range"]=T.yr0.slice())}return e.call("relayout",o,x).then(function(){for(var S=0;S<l.length;S++)u(l[S].plotinfo)})}var m,y,b,_=t.ease(s.easing);o._transitionData._interruptCallbacks.push(function(){return window.cancelAnimationFrame(b),b=null,h()});function g(){y=Date.now();for(var x=Math.min(1,(y-m)/s.duration),w=_(x),T=0;T<l.length;T++)v(l[T],w);y-m>s.duration?(d(),b=window.cancelAnimationFrame(g)):b=window.requestAnimationFrame(g)}return m=Date.now(),b=window.requestAnimationFrame(g),Promise.resolve()},jv}var Tu=bt,fb=ot,Mn=we,II=hr,FI=Et,cb=ys.getModuleCalcData,$i=cr,Fa=Rr,NI=Yo,zt=Mn.ensureSingle;function hf(t,e,r){return Mn.ensureSingle(t,e,r,function(a){a.datum(r)})}var Sn=Fa.zindexSeparator;pr.name="cartesian";pr.attr=["xaxis","yaxis"];pr.idRoot=["x","y"];pr.idRegex=Fa.idRegex;pr.attrRegex=Fa.attrRegex;pr.attributes=hI();pr.layoutAttributes=ti;pr.supplyLayoutDefaults=zI();pr.transitionAxes=RI();pr.finalizeSubplots=function(t,e){var r=e._subplots,a=r.xaxis,i=r.yaxis,n=r.cartesian,o=n,l={},s={},f,c,u;for(f=0;f<o.length;f++){var v=o[f].split("y");l[v[0]]=1,s["y"+v[1]]=1}for(f=0;f<a.length;f++)c=a[f],l[c]||(u=(t[$i.id2name(c)]||{}).anchor,Fa.idRegex.y.test(u)||(u="y"),n.push(c+u),o.push(c+u),s[u]||(s[u]=1,Mn.pushUnique(i,u)));for(f=0;f<i.length;f++)u=i[f],s[u]||(c=(t[$i.id2name(u)]||{}).anchor,Fa.idRegex.x.test(c)||(c="x"),n.push(c+u),o.push(c+u),l[c]||(l[c]=1,Mn.pushUnique(a,c)));if(!o.length){c="",u="";for(var p in t)if(Fa.attrRegex.test(p)){var d=p.charAt(0);d==="x"?(!c||+p.substr(5)<+c.substr(5))&&(c=p):(!u||+p.substr(5)<+u.substr(5))&&(u=p)}c=c?$i.name2id(c):"x",u=u?$i.name2id(u):"y",a.push(c),i.push(u),n.push(c+u)}};pr.plot=function(t,e,r,a){var i=t._fullLayout,n=i._subplots.cartesian,o=t.calcdata,l;if(!Array.isArray(e))for(e=[],l=0;l<o.length;l++)e.push(l);for(var s=i._zindices,f=0;f<s.length;f++){var c=s[f];for(l=0;l<n.length;l++){var u=n[l],v=i._plots[u];if(f>0){var p=v.id;if(p.indexOf(Sn)!==-1)continue;p+=Sn+(f+1),v=Mn.extendFlat({},v,{id:p,plot:i._cartesianlayer.selectAll(".subplot").select("."+p)})}for(var d=[],h,m=0;m<o.length;m++){var y=o[m],b=y[0].trace;c===(b.zorder||0)&&b.xaxis+b.yaxis===u&&((e.indexOf(b.index)!==-1||b.carpet)&&(h&&h[0].trace.xaxis+h[0].trace.yaxis===u&&["tonextx","tonexty","tonext"].indexOf(b.fill)!==-1&&d.indexOf(h)===-1&&d.push(h),d.push(y)),h=y)}ok(t,v,d,r,a)}}};function ok(t,e,r,a,i){for(var n=Fa.traceLayerClasses,o=t._fullLayout,l=o._zindices,s=o._modules,f,c,u,v=[],p=[],d=0;d<l.length;d++)for(var h=l[d],m=0;m<s.length;m++){f=s[m];var y=f.name,b=fb.modules[y].categories;if(b.svg){var _=f.layerName||y+"layer",g=_+(d?Number(d)+1:""),x=f.plot;c=cb(r,x,h),u=c[0],r=c[1],u.length&&v.push({i:n.indexOf(_),zindex:d,className:g,plotMethod:x,cdModule:u}),b.zoomScale&&p.push("."+g)}}v.sort(function(A,M){return(A.zindex||0)-(M.zindex||0)||A.i-M.i});var w=e.plot.selectAll("g.mlayer").data(v,function(A){return A.className});if(w.enter().append("g").attr("class",function(A){return A.className}).classed("mlayer",!0).classed("rangeplot",e.isRangePlot),w.exit().remove(),w.order(),w.each(function(A){var M=Tu.select(this),S=A.className;A.plotMethod(t,e,A.cdModule,M,a,i),Fa.clipOnAxisFalseQuery.indexOf("."+S)===-1&&FI.setClipUrl(M,e.layerClipId,t)}),o._has("scattergl")&&(f=fb.getModule("scattergl"),u=cb(r,f)[0],f.plot(t,e,u)),!t._context.staticPlot&&(e._hasClipOnAxisFalse&&(e.clipOnAxisFalseTraces=e.plot.selectAll(Fa.clipOnAxisFalseQuery.join(",")).selectAll(".trace")),p.length)){var T=e.plot.selectAll(p.join(",")).selectAll(".trace");e.zoomScalePts=T.selectAll("path.point"),e.zoomScaleTxt=T.selectAll(".textpoint")}}pr.clean=function(t,e,r,a){var i=a._plots||{},n=e._plots||{},o=a._subplots||{},l,s,f;if(a._hasOnlyLargeSploms&&!e._hasOnlyLargeSploms)for(f in i)l=i[f],l.plotgroup&&l.plotgroup.remove();var c=a._has&&a._has("gl"),u=e._has&&e._has("gl");if(c&&!u)for(f in i)l=i[f],l._scene&&l._scene.destroy();if(o.xaxis&&o.yaxis){var v=$i.listIds({_fullLayout:a});for(s=0;s<v.length;s++){var p=v[s];e[$i.id2name(p)]||a._infolayer.selectAll(".g-"+p+"title").remove()}}var d=a._has&&a._has("cartesian"),h=e._has&&e._has("cartesian");if(d&&!h)sk(a._cartesianlayer.selectAll(".subplot"),a),a._defs.selectAll(".axesclip").remove(),delete a._axisConstraintGroups,delete a._axisMatchGroups;else if(o.cartesian)for(s=0;s<o.cartesian.length;s++){var m=o.cartesian[s];if(m.indexOf(Sn)===-1&&!n[m]){var y="."+m+",."+m+"-x,."+m+"-y";a._cartesianlayer.selectAll(y).remove(),fk(m,a)}}};pr.drawFramework=function(t){var e=t._fullLayout,r=t.calcdata,a,i={};for(a=0;a<r.length;a++){var n=r[a][0],o=n.trace,l=o.zorder||0;i[l]||(i[l]=[]),i[l].push(n)}var s=Object.keys(i).map(Number).sort(Mn.sorterAsc);s.length||(s=[0]),e._zindices=s;var f=HI(t),c=f.length,u=[];for(a=0;a<c;a++)u[a]=f[a].slice();for(var v=1;v<s.length;v++){var p=[];for(a=0;a<c;a++)p[a]=f[a].slice(),p[a][0]+=Sn+(v+1);u=u.concat(p)}var d=e._cartesianlayer.selectAll(".subplot").data(u,String);d.enter().append("g").attr("class",function(h){return"subplot "+h[0]}),d.order(),d.exit().call(sk,e),d.each(function(h){var m=h[0],y=m.indexOf(Sn),b=y!==-1,_=b?m.slice(0,y):m,g=e._plots[m];g||(g=Mn.extendFlat({},e._plots[_]),g&&(g.id=m,e._plots[m]=g,e._subplots.cartesian.push(m))),g&&(g.plotgroup=Tu.select(this),lk(t,g),b||(g.draglayer=zt(e._draggers,"g",m)))})};pr.rangePlot=function(t,e,r){lk(t,e),ok(t,e,r),II.style(t)};function HI(t){var e=t._fullLayout,r=e._zindices.length,a=e._subplots.cartesian,i=a.length,n,o,l,s,f,c,u=[],v=[];for(n=0;n<i;n++){l=a[n],s=e._plots[l],f=s.xaxis,c=s.yaxis;var p=f._mainAxis,d=c._mainAxis,h=p._id+d._id,m=e._plots[h];s.overlays=[],h!==l&&m?(s.mainplot=h,s.mainplotinfo=m,v.push(l)):(s.mainplot=void 0,s.mainplotinfo=void 0,u.push(l))}for(n=0;n<v.length;n++)l=v[n],s=e._plots[l],s.mainplotinfo.overlays.push(s);var y=u.concat(v),b=[];for(n=0;n<i;n++){l=y[n],s=e._plots[l],f=s.xaxis,c=s.yaxis;for(var _=[],g=1;g<=r;g++){var x="";for(g>1&&(x+=Sn+g),_.push(l+x),o=0;o<s.overlays.length;o++)_.push(s.overlays[o].id+x)}_=_.concat([f.layer,c.layer,f.overlaying||"",c.overlaying||""]),b.push(_)}return b}function lk(t,e){var r=t._fullLayout,a=e.plotgroup,i=e.id,n=i.indexOf(Sn),o=n!==-1,l=Fa.layerValue2layerClass[e.xaxis.layer],s=Fa.layerValue2layerClass[e.yaxis.layer],f=r._hasOnlyLargeSploms,c=r._zindices.length>1,u=e.mainplotinfo;if(!e.mainplot||c)if(f)e.xlines=zt(a,"path","xlines-above"),e.ylines=zt(a,"path","ylines-above"),e.xaxislayer=zt(a,"g","xaxislayer-above"),e.yaxislayer=zt(a,"g","yaxislayer-above");else{if(!o){var v=zt(a,"g","layer-subplot");e.shapelayer=zt(v,"g","shapelayer"),e.imagelayer=zt(v,"g","imagelayer"),u&&c?(e.minorGridlayer=u.minorGridlayer,e.gridlayer=u.gridlayer,e.zerolinelayer=u.zerolinelayer):(e.minorGridlayer=zt(a,"g","minor-gridlayer"),e.gridlayer=zt(a,"g","gridlayer"),e.zerolinelayer=zt(a,"g","zerolinelayer"));var p=zt(a,"g","layer-between");e.shapelayerBetween=zt(p,"g","shapelayer"),e.imagelayerBetween=zt(p,"g","imagelayer"),zt(a,"path","xlines-below"),zt(a,"path","ylines-below"),e.overlinesBelow=zt(a,"g","overlines-below"),zt(a,"g","xaxislayer-below"),zt(a,"g","yaxislayer-below"),e.overaxesBelow=zt(a,"g","overaxes-below")}e.overplot=zt(a,"g","overplot"),e.plot=zt(e.overplot,"g",i),u&&c?e.zerolinelayerAbove=u.zerolinelayerAbove:e.zerolinelayerAbove=zt(a,"g","zerolinelayer-above"),o||(e.xlines=zt(a,"path","xlines-above"),e.ylines=zt(a,"path","ylines-above"),e.overlinesAbove=zt(a,"g","overlines-above"),zt(a,"g","xaxislayer-above"),zt(a,"g","yaxislayer-above"),e.overaxesAbove=zt(a,"g","overaxes-above"),e.xlines=a.select(".xlines-"+l),e.ylines=a.select(".ylines-"+s),e.xaxislayer=a.select(".xaxislayer-"+l),e.yaxislayer=a.select(".yaxislayer-"+s))}else{var d=u.plotgroup,h=i+"-x",m=i+"-y";e.minorGridlayer=u.minorGridlayer,e.gridlayer=u.gridlayer,e.zerolinelayer=u.zerolinelayer,e.zerolinelayerAbove=u.zerolinelayerAbove,zt(u.overlinesBelow,"path",h),zt(u.overlinesBelow,"path",m),zt(u.overaxesBelow,"g",h),zt(u.overaxesBelow,"g",m),e.plot=zt(u.overplot,"g",i),zt(u.overlinesAbove,"path",h),zt(u.overlinesAbove,"path",m),zt(u.overaxesAbove,"g",h),zt(u.overaxesAbove,"g",m),e.xlines=d.select(".overlines-"+l).select("."+h),e.ylines=d.select(".overlines-"+s).select("."+m),e.xaxislayer=d.select(".overaxes-"+l).select("."+h),e.yaxislayer=d.select(".overaxes-"+s).select("."+m)}o||(f||(hf(e.minorGridlayer,"g",e.xaxis._id),hf(e.minorGridlayer,"g",e.yaxis._id),e.minorGridlayer.selectAll("g").map(function(y){return y[0]}).sort($i.idSort),hf(e.gridlayer,"g",e.xaxis._id),hf(e.gridlayer,"g",e.yaxis._id),e.gridlayer.selectAll("g").map(function(y){return y[0]}).sort($i.idSort)),e.xlines.style("fill","none").classed("crisp",!0),e.ylines.style("fill","none").classed("crisp",!0))}function sk(t,e){if(t){var r={};t.each(function(s){var f=s[0],c=Tu.select(this);c.remove(),fk(f,e),r[f]=!0});for(var a in e._plots)for(var i=e._plots[a],n=i.overlays||[],o=0;o<n.length;o++){var l=n[o];r[l.id]&&l.plot.selectAll(".trace").remove()}}}function fk(t,e){e._draggers.selectAll("g."+t).remove(),e._defs.select("#clip"+e._uid+t+"plot").remove()}pr.toSVG=function(t){var e=t._fullLayout._glimages,r=Tu.select(t).selectAll(".svg-container"),a=r.filter(function(n,o){return o===r.size()-1}).selectAll(".gl-canvas-context, .gl-canvas-focus");function i(){var n=this,o=n.toDataURL("image/png"),l=e.append("svg:image");l.attr({xmlns:NI.svg,"xlink:href":o,preserveAspectRatio:"none",x:0,y:0,width:n.style.width,height:n.style.height})}a.each(i)};pr.updateFx=M2().updateFx;var pf=jr,OI={hasLines:pf.hasLines,hasMarkers:pf.hasMarkers,hasText:pf.hasText,isBubble:pf.isBubble,attributes:Vi,layoutAttributes:tp,supplyDefaults:pR,crossTraceDefaults:j2,supplyLayoutDefaults:wR,calc:qp.calc,crossTraceCalc:YR,arraysToCalcdata:U2,plot:rI,colorbar:Ts,formatLabels:rk,style:Z0.style,styleOnSelect:Z0.styleOnSelect,hoverPoints:vI,selectPoints:dI,animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:pr,categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{description:["The scatter trace type encompasses line charts, scatter charts, text charts, and bubble charts.","The data visualized as scatter point or lines is set in `x` and `y`.","Text (appearing either on the chart or on hover only) is via `text`.","Bubble charts are achieved by setting `marker.size` and/or `marker.color`","to numerical arrays."].join(" ")}},jI=bt,BI=yt,ub=T2,tm=we,GI=tm.strScale,UI=tm.strRotate,VI=tm.strTranslate,WI=function(e,r,a){var i=e.node(),n=ub[a.arrowhead||0],o=ub[a.startarrowhead||0],l=(a.arrowwidth||1)*(a.arrowsize||1),s=(a.arrowwidth||1)*(a.startarrowsize||1),f=r.indexOf("start")>=0,c=r.indexOf("end")>=0,u=n.backoff*l+a.standoff,v=o.backoff*s+a.startstandoff,p,d,h,m;if(i.nodeName==="line"){p={x:+e.attr("x1"),y:+e.attr("y1")},d={x:+e.attr("x2"),y:+e.attr("y2")};var y=p.x-d.x,b=p.y-d.y;if(h=Math.atan2(b,y),m=h+Math.PI,u&&v&&u+v>Math.sqrt(y*y+b*b)){N();return}if(u){if(u*u>y*y+b*b){N();return}var _=u*Math.cos(h),g=u*Math.sin(h);d.x+=_,d.y+=g,e.attr({x2:d.x,y2:d.y})}if(v){if(v*v>y*y+b*b){N();return}var x=v*Math.cos(h),w=v*Math.sin(h);p.x-=x,p.y-=w,e.attr({x1:p.x,y1:p.y})}}else if(i.nodeName==="path"){var T=i.getTotalLength(),A="";if(T<u+v){N();return}var M=i.getPointAtLength(0),S=i.getPointAtLength(.1);h=Math.atan2(M.y-S.y,M.x-S.x),p=i.getPointAtLength(Math.min(v,T)),A="0px,"+v+"px,";var L=i.getPointAtLength(T),E=i.getPointAtLength(T-.1);m=Math.atan2(L.y-E.y,L.x-E.x),d=i.getPointAtLength(Math.max(0,T-u));var F=A?v+u:u;A+=T-F+"px,"+T+"px",e.style("stroke-dasharray",A)}function N(){e.style("stroke-dasharray","0px,100px")}function z(H,D,P,k){H.path&&(H.noRotate&&(P=0),jI.select(i.parentNode).append("path").attr({class:e.attr("class"),d:H.path,transform:VI(D.x,D.y)+UI(P*180/Math.PI)+GI(k)}).style({fill:BI.rgb(a.arrowcolor),"stroke-width":0}))}f&&z(o,p,h,s),c&&z(n,d,m,l)},vb=bt,Bv=ot,XI=hr,Ai=we,Gv=Ai.strTranslate,os=Ot,Ji=yt,ni=Et,db=Na,Uv=Tr,Vv=Bi,gl=ai,YI=Ht.arrayEditor,qI=WI,rm={draw:ZI,drawOne:ck,drawRaw:uk};function ZI(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r<e.annotations.length;r++)e.annotations[r].visible&&ck(t,r);return XI.previousPromises(t)}function ck(t,e){var r=t._fullLayout,a=r.annotations[e]||{},i=os.getFromId(t,a.xref),n=os.getFromId(t,a.yref);i&&i.setScale(),n&&n.setScale(),uk(t,a,e,!1,i,n)}function Ti(t,e,r,a,i){var n=i[r],o=i[r+"ref"],l=r.indexOf("y")!==-1,s=os.getRefType(o)==="domain",f=l?a.h:a.w;return t?s?n+(l?-e:e)/t._length:t.p2r(t.r2p(n)+e):n+(l?-e:e)/f}function uk(t,e,r,a,i,n){var o=t._fullLayout,l=t._fullLayout._size,s=t._context.edits,f,c;a?(f="annotation-"+a,c=a+".annotations"):(f="annotation",c="annotations");var u=YI(t.layout,c,e),v=u.modifyBase,p=u.modifyItem,d=u.getUpdateObj;o._infolayer.selectAll("."+f+'[data-index="'+r+'"]').remove();var h="clip"+o._uid+"_ann"+r;if(!e._input||e.visible===!1){vb.selectAll("#"+h).remove();return}var m={x:{},y:{}},y=+e.textangle||0,b=o._infolayer.append("g").classed(f,!0).attr("data-index",String(r)).style("opacity",e.opacity),_=b.append("g").classed("annotation-text-g",!0),g=s[e.showarrow?"annotationTail":"annotationPosition"],x=e.captureevents||s.annotationText||g;function w(k){var C={index:r,annotation:e._input,fullAnnotation:e,event:k};return a&&(C.subplotId=a),C}var T=_.append("g").style("pointer-events",x?"all":null).call(Vv,"pointer").on("click",function(){t._dragging=!1,t.emit("plotly_clickannotation",w(vb.event))});e.hovertext&&T.on("mouseover",function(){var k=e.hoverlabel,C=k.font,$=this.getBoundingClientRect(),R=t.getBoundingClientRect();db.loneHover({x0:$.left-R.left,x1:$.right-R.left,y:($.top+$.bottom)/2-R.top,text:e.hovertext,color:k.bgcolor,borderColor:k.bordercolor,fontFamily:C.family,fontSize:C.size,fontColor:C.color,fontWeight:C.weight,fontStyle:C.style,fontVariant:C.variant,fontShadow:C.fontShadow,fontLineposition:C.fontLineposition,fontTextcase:C.fontTextcase},{container:o._hoverlayer.node(),outerContainer:o._paper.node(),gd:t})}).on("mouseout",function(){db.loneUnhover(o._hoverlayer.node())});var A=e.borderwidth,M=e.borderpad,S=A+M,L=T.append("rect").attr("class","bg").style("stroke-width",A+"px").call(Ji.stroke,e.bordercolor).call(Ji.fill,e.bgcolor),E=e.width||e.height,F=o._topclips.selectAll("#"+h).data(E?[0]:[]);F.enter().append("clipPath").classed("annclip",!0).attr("id",h).append("rect"),F.exit().remove();var N=e.font,z=o._meta?Ai.templateString(e.text,o._meta):e.text,H=T.append("text").classed("annotation-text",!0).text(z);function D(k){return k.call(ni.font,N).attr({"text-anchor":{left:"start",right:"end"}[e.align]||"middle"}),Uv.convertToTspans(k,t,P),k}function P(){var k=H.selectAll("a");if(k.size()===1&&k.text()===H.text()){var C=T.insert("a",":first-child").attr({"xlink:xlink:href":k.attr("xlink:href"),"xlink:xlink:show":k.attr("xlink:show")}).style({cursor:"pointer"});C.node().appendChild(L.node())}var $=T.select(".annotation-text-math-group"),R=!$.empty(),j=ni.bBox((R?$:H).node()),G=j.width,Y=j.height,O=e.width||G,K=e.height||Y,W=Math.round(O+2*S),X=Math.round(K+2*S);function B(Re,et){return et==="auto"&&(Re<1/3?et="left":Re>2/3?et="right":et="center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[et]}for(var ee=!1,ae=["x","y"],de=0;de<ae.length;de++){var fe=ae[de],q=e[fe+"ref"]||fe,te=e["a"+fe+"ref"],le={x:i,y:n}[fe],ce=(y+(fe==="x"?0:-90))*Math.PI/180,ye=W*Math.cos(ce),ue=X*Math.sin(ce),oe=Math.abs(ye)+Math.abs(ue),pe=e[fe+"anchor"],Me=e[fe+"shift"]*(fe==="x"?1:-1),ve=m[fe],ke,_e,J,be,Z,me=os.getRefType(q);if(le&&me!=="domain"){var ge=le.r2fraction(e[fe]);(ge<0||ge>1)&&(te===q?(ge=le.r2fraction(e["a"+fe]),(ge<0||ge>1)&&(ee=!0)):ee=!0),ke=le._offset+le.r2p(e[fe]),be=.5}else{var Pe=me==="domain";fe==="x"?(J=e[fe],ke=Pe?le._offset+le._length*J:ke=l.l+l.w*J):(J=1-e[fe],ke=Pe?le._offset+le._length*J:ke=l.t+l.h*J),be=e.showarrow?.5:J}if(e.showarrow){ve.head=ke;var Ee=e["a"+fe];if(Z=ye*B(.5,e.xanchor)-ue*B(.5,e.yanchor),te===q){var Le=os.getRefType(te);Le==="domain"?(fe==="y"&&(Ee=1-Ee),ve.tail=le._offset+le._length*Ee):Le==="paper"?fe==="y"?(Ee=1-Ee,ve.tail=l.t+l.h*Ee):ve.tail=l.l+l.w*Ee:ve.tail=le._offset+le.r2p(Ee),_e=Z}else ve.tail=ke+Ee,_e=Z+Ee;ve.text=ve.tail+Z;var Ae=o[fe==="x"?"width":"height"];if(q==="paper"&&(ve.head=Ai.constrain(ve.head,1,Ae-1)),te==="pixel"){var Oe=-Math.max(ve.tail-3,ve.text),$e=Math.min(ve.tail+3,ve.text)-Ae;Oe>0?(ve.tail+=Oe,ve.text+=Oe):$e>0&&(ve.tail-=$e,ve.text-=$e)}ve.tail+=Me,ve.head+=Me}else Z=oe*B(be,pe),_e=Z,ve.text=ke+Z;ve.text+=Me,Z+=Me,_e+=Me,e["_"+fe+"padplus"]=oe/2+_e,e["_"+fe+"padminus"]=oe/2-_e,e["_"+fe+"size"]=oe,e["_"+fe+"shift"]=Z}if(ee){T.remove();return}var ze=0,je=0;if(e.align!=="left"&&(ze=(O-G)*(e.align==="center"?.5:1)),e.valign!=="top"&&(je=(K-Y)*(e.valign==="middle"?.5:1)),R)$.select("svg").attr({x:S+ze-1,y:S+je}).call(ni.setClipUrl,E?h:null,t);else{var at=S+je-j.top,xe=S+ze-j.left;H.call(Uv.positionText,xe,at).call(ni.setClipUrl,E?h:null,t)}F.select("rect").call(ni.setRect,S,S,O,K),L.call(ni.setRect,A/2,A/2,W-A,X-A),T.call(ni.setTranslate,Math.round(m.x.text-W/2),Math.round(m.y.text-X/2)),_.attr({transform:"rotate("+y+","+m.x.text+","+m.y.text+")"});var We=function(Re,et){b.selectAll(".annotation-arrow-g").remove();var Ue=m.x.head,I=m.y.head,U=m.x.tail+Re,V=m.y.tail+et,Q=m.x.text+Re,se=m.y.text+et,re=Ai.rotationXYMatrix(y,Q,se),Ce=Ai.apply2DTransform(re),Se=Ai.apply2DTransform2(re),he=+L.attr("width"),ne=+L.attr("height"),Te=Q-.5*he,Ie=Te+he,Ge=se-.5*ne,Fe=Ge+ne,tt=[[Te,Ge,Te,Fe],[Te,Fe,Ie,Fe],[Ie,Fe,Ie,Ge],[Ie,Ge,Te,Ge]].map(Se);if(!tt.reduce(function(pt,Tt){return pt^!!Ai.segmentsIntersect(Ue,I,Ue+1e6,I+1e6,Tt[0],Tt[1],Tt[2],Tt[3])},!1)){tt.forEach(function(pt){var Tt=Ai.segmentsIntersect(U,V,Ue,I,pt[0],pt[1],pt[2],pt[3]);Tt&&(U=Tt.x,V=Tt.y)});var st=e.arrowwidth,Ve=e.arrowcolor,Lt=e.arrowside,ft=b.append("g").style({opacity:Ji.opacity(Ve)}).classed("annotation-arrow-g",!0),Ze=ft.append("path").attr("d","M"+U+","+V+"L"+Ue+","+I).style("stroke-width",st+"px").call(Ji.stroke,Ji.rgb(Ve));if(qI(Ze,Lt,e),s.annotationPosition&&Ze.node().parentNode&&!a){var gt=Ue,wt=I;if(e.standoff){var lt=Math.sqrt(Math.pow(Ue-U,2)+Math.pow(I-V,2));gt+=e.standoff*(U-Ue)/lt,wt+=e.standoff*(V-I)/lt}var ct=ft.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(U-gt)+","+(V-wt),transform:Gv(gt,wt)}).style("stroke-width",st+6+"px").call(Ji.stroke,"rgba(0,0,0,0)").call(Ji.fill,"rgba(0,0,0,0)"),Ke,it;gl.init({element:ct.node(),gd:t,prepFn:function(){var pt=ni.getTranslate(T);Ke=pt.x,it=pt.y,i&&i.autorange&&v(i._name+".autorange",!0),n&&n.autorange&&v(n._name+".autorange",!0)},moveFn:function(pt,Tt){var Qe=Ce(Ke,it),At=Qe[0]+pt,It=Qe[1]+Tt;T.call(ni.setTranslate,At,It),p("x",Ti(i,pt,"x",l,e)),p("y",Ti(n,Tt,"y",l,e)),e.axref===e.xref&&p("ax",Ti(i,pt,"ax",l,e)),e.ayref===e.yref&&p("ay",Ti(n,Tt,"ay",l,e)),ft.attr("transform",Gv(pt,Tt)),_.attr({transform:"rotate("+y+","+At+","+It+")"})},doneFn:function(){Bv.call("_guiRelayout",t,d());var pt=document.querySelector(".js-notes-box-panel");pt&&pt.redraw(pt.selectedObj)}})}}};if(e.showarrow&&We(0,0),g){var Xe;gl.init({element:T.node(),gd:t,prepFn:function(){Xe=_.attr("transform")},moveFn:function(Re,et){var Ue="pointer";if(e.showarrow)e.axref===e.xref?p("ax",Ti(i,Re,"ax",l,e)):p("ax",e.ax+Re),e.ayref===e.yref?p("ay",Ti(n,et,"ay",l.w,e)):p("ay",e.ay+et),We(Re,et);else{if(a)return;var I,U;if(i)I=Ti(i,Re,"x",l,e);else{var V=e._xsize/l.w,Q=e.x+(e._xshift-e.xshift)/l.w-V/2;I=gl.align(Q+Re/l.w,V,0,1,e.xanchor)}if(n)U=Ti(n,et,"y",l,e);else{var se=e._ysize/l.h,re=e.y-(e._yshift+e.yshift)/l.h-se/2;U=gl.align(re-et/l.h,se,0,1,e.yanchor)}p("x",I),p("y",U),(!i||!n)&&(Ue=gl.getCursor(i?.5:I,n?.5:U,e.xanchor,e.yanchor))}_.attr({transform:Gv(Re,et)+Xe}),Vv(T,Ue)},clickFn:function(Re,et){e.captureevents&&t.emit("plotly_clickannotation",w(et))},doneFn:function(){Vv(T),Bv.call("_guiRelayout",t,d());var Re=document.querySelector(".js-notes-box-panel");Re&&Re.redraw(Re.selectedObj)}})}}s.annotationText?H.call(Uv.makeEditable,{delegate:T,gd:t}).call(D).on("edit",function(k){e.text=k,this.call(D),p("text",k),i&&i.autorange&&v(i._name+".autorange",!0),n&&n.autorange&&v(n._name+".autorange",!0),Bv.call("_guiRelayout",t,d())}):H.call(D)}var hb=we,KI=ot,pb=Ht.arrayEditor,QI={hasClickToShow:JI,onClick:eF};function JI(t,e){var r=vk(t,e);return r.on.length>0||r.explicitOff.length>0}function eF(t,e){var r=vk(t,e),a=r.on,i=r.off.concat(r.explicitOff),n={},o=t._fullLayout.annotations,l,s;if(a.length||i.length){for(l=0;l<a.length;l++)s=pb(t.layout,"annotations",o[a[l]]),s.modifyItem("visible",!0),hb.extendFlat(n,s.getUpdateObj());for(l=0;l<i.length;l++)s=pb(t.layout,"annotations",o[i[l]]),s.modifyItem("visible",!1),hb.extendFlat(n,s.getUpdateObj());return KI.call("update",t,{},n)}}function vk(t,e){var r=t._fullLayout.annotations,a=[],i=[],n=[],o=(e||[]).length,l,s,f,c,u,v,p,d;for(l=0;l<r.length;l++)if(f=r[l],c=f.clicktoshow,c){for(s=0;s<o;s++)if(u=e[s],v=u.xaxis,p=u.yaxis,v._id===f.xref&&p._id===f.yref&&v.d2r(u.x)===mb(f._xclick,v)&&p.d2r(u.y)===mb(f._yclick,p)){f.visible?c==="onout"?d=i:d=n:d=a,d.push(l);break}s===o&&f.visible&&c==="onout"&&i.push(l)}return{on:a,off:i,explicitOff:n}}function mb(t,e){return e.type==="log"?e.l2r(t):e.d2r(t)}var Wv=we,qn=yt,dk=function(e,r,a,i){i("opacity");var n=i("bgcolor"),o=i("bordercolor"),l=qn.opacity(o);i("borderpad");var s=i("borderwidth"),f=i("showarrow");i("text",f?" ":a._dfltTitle.annotation),i("textangle"),Wv.coerceFont(i,"font",a.font),i("width"),i("align");var c=i("height");if(c&&i("valign"),f){var u=i("arrowside"),v,p;u.indexOf("end")!==-1&&(v=i("arrowhead"),p=i("arrowsize")),u.indexOf("start")!==-1&&(i("startarrowhead",v),i("startarrowsize",p)),i("arrowcolor",l?r.bordercolor:qn.defaultLine),i("arrowwidth",(l&&s||1)*2),i("standoff"),i("startstandoff")}var d=i("hovertext"),h=a.hoverlabel||{};if(d){var m=i("hoverlabel.bgcolor",h.bgcolor||(qn.opacity(n)?qn.rgb(n):qn.defaultLine)),y=i("hoverlabel.bordercolor",h.bordercolor||qn.contrast(m)),b=Wv.extendFlat({},h.font);b.color||(b.color=y),Wv.coerceFont(i,"hoverlabel.font",b)}i("captureevents",!!d)},Xv=we,en=Ot,tF=ri,rF=dk,aF=_s,iF=function(e,r){tF(e,r,{name:"annotations",handleItemDefaults:nF})};function nF(t,e,r){function a(_,g){return Xv.coerce(t,e,aF,_,g)}var i=a("visible"),n=a("clicktoshow");if(i||n){rF(t,e,r,a);for(var o=e.showarrow,l=["x","y"],s=[-10,-30],f={_fullLayout:r},c=0;c<2;c++){var u=l[c],v=en.coerceRef(t,e,f,u,"","paper");if(v!=="paper"){var p=en.getFromId(f,v);p._annIndices.push(e._index)}if(en.coercePosition(e,f,a,v,u,.5),o){var d="a"+u,h=en.coerceRef(t,e,f,d,"pixel",["pixel","paper"]);h!=="pixel"&&h!==v&&(h=e[d]="pixel");var m=h==="pixel"?s[c]:.4;en.coercePosition(e,f,a,h,d,m)}a(u+"anchor"),a(u+"shift")}if(Xv.noneOrAll(t,e,["x","y"]),o&&Xv.noneOrAll(t,e,["ax","ay"]),n){var y=a("xclick"),b=a("yclick");e._xclick=y===void 0?e.x:en.cleanPosition(y,f,e.xref),e._yclick=b===void 0?e.y:en.cleanPosition(b,f,e.yref)}}}var ph=we,dn=Ot,oF=rm.draw,lF=function(e){var r=e._fullLayout,a=ph.filterVisible(r.annotations);if(a.length&&e._fullData.length)return ph.syncOrAsync([oF,sF],e)};function sF(t){var e=t._fullLayout;ph.filterVisible(e.annotations).forEach(function(r){var a=dn.getFromId(t,r.xref),i=dn.getFromId(t,r.yref),n=dn.getRefType(r.xref),o=dn.getRefType(r.yref);r._extremes={},n==="range"&&yb(r,a),o==="range"&&yb(r,i)})}function yb(t,e){var r=e._id,a=r.charAt(0),i=t[a],n=t["a"+a],o=t[a+"ref"],l=t["a"+a+"ref"],s=t["_"+a+"padplus"],f=t["_"+a+"padminus"],c={x:1,y:-1}[a]*t[a+"shift"],u=3*t.arrowsize*t.arrowwidth||0,v=u+c,p=u-c,d=3*t.startarrowsize*t.arrowwidth||0,h=d+c,m=d-c,y;if(l===o){var b=dn.findExtremes(e,[e.r2c(i)],{ppadplus:v,ppadminus:p}),_=dn.findExtremes(e,[e.r2c(n)],{ppadplus:Math.max(s,h),ppadminus:Math.max(f,m)});y={min:[b.min[0],_.min[0]],max:[b.max[0],_.max[0]]}}else h=n?h+n:h,m=n?m-n:m,y=dn.findExtremes(e,[e.r2c(i)],{ppadplus:Math.max(s,v,h),ppadminus:Math.max(f,p,m)});t._extremes[r]=y}var fF=kt,cF=Hh,uF=function(e,r,a,i){r=r||{};var n=a==="log"&&r.type==="linear",o=a==="linear"&&r.type==="log";if(!(n||o))return;var l=e._fullLayout.annotations,s=r._id.charAt(0),f,c;function u(p){var d=f[p],h=null;n?h=cF(d,r.range):h=Math.pow(10,d),fF(h)||(h=null),i(c+p,h)}for(var v=0;v<l.length;v++)f=l[v],c="annotations["+v+"].",f[s+"ref"]===r._id&&u(s),f["a"+s+"ref"]===r._id&&u("a"+s)},Yv=rm,gb=QI,vF={moduleType:"component",name:"annotations",layoutAttributes:_s,supplyLayoutDefaults:iF,includeBasePlot:gu("annotations"),calcAutorange:lF,draw:Yv.draw,drawOne:Yv.drawOne,drawRaw:Yv.drawRaw,hasClickToShow:gb.hasClickToShow,onClick:gb.onClick,convertCoords:uF},Bt=_s,dF=Ja.overrideAll,hF=Ht.templatedArray,mh=dF(hF("annotation",{visible:Bt.visible,x:{valType:"any",description:["Sets the annotation's x position."].join(" ")},y:{valType:"any",description:["Sets the annotation's y position."].join(" ")},z:{valType:"any",description:["Sets the annotation's z position."].join(" ")},ax:{valType:"number",description:["Sets the x component of the arrow tail about the arrow head (in pixels)."].join(" ")},ay:{valType:"number",description:["Sets the y component of the arrow tail about the arrow head (in pixels)."].join(" ")},xanchor:Bt.xanchor,xshift:Bt.xshift,yanchor:Bt.yanchor,yshift:Bt.yshift,text:Bt.text,textangle:Bt.textangle,font:Bt.font,width:Bt.width,height:Bt.height,opacity:Bt.opacity,align:Bt.align,valign:Bt.valign,bgcolor:Bt.bgcolor,bordercolor:Bt.bordercolor,borderpad:Bt.borderpad,borderwidth:Bt.borderwidth,showarrow:Bt.showarrow,arrowcolor:Bt.arrowcolor,arrowhead:Bt.arrowhead,startarrowhead:Bt.startarrowhead,arrowside:Bt.arrowside,arrowsize:Bt.arrowsize,startarrowsize:Bt.startarrowsize,arrowwidth:Bt.arrowwidth,standoff:Bt.standoff,startstandoff:Bt.startstandoff,hovertext:Bt.hovertext,hoverlabel:Bt.hoverlabel,captureevents:Bt.captureevents}),"calc","from-root"),qv=we,pF=Ot,mF=ri,yF=dk,gF=mh,bF=function(e,r,a){mF(e,r,{name:"annotations",handleItemDefaults:xF,fullLayout:a.fullLayout})};function xF(t,e,r,a){function i(l,s){return qv.coerce(t,e,gF,l,s)}function n(l){var s=l+"axis",f={_fullLayout:{}};return f._fullLayout[s]=r[s],pF.coercePosition(e,f,i,l,l,.5)}var o=i("visible");o&&(yF(t,e,a.fullLayout,i),n("x"),n("y"),n("z"),qv.noneOrAll(t,e,["x","y","z"]),e.xref="x",e.yref="y",e.zref="z",i("xanchor"),i("yanchor"),i("xshift"),i("yshift"),e.showarrow&&(e.axref="pixel",e.ayref="pixel",i("ax",-10),i("ay",-30),qv.noneOrAll(t,e,["ax","ay"])))}var bb=we,xb=Ot,_F=function(e){for(var r=e.fullSceneLayout,a=r.annotations,i=0;i<a.length;i++)wF(a[i],e);e.fullLayout._infolayer.selectAll(".annotation-"+e.id).remove()};function wF(t,e){var r=e.fullSceneLayout,a=r.domain,i=e.fullLayout._size,n={pdata:null,type:"linear",autorange:!1,range:[-1/0,1/0]};t._xa={},bb.extendFlat(t._xa,n),xb.setConvert(t._xa),t._xa._offset=i.l+a.x[0]*i.w,t._xa.l2p=function(){return .5*(1+t._pdata[0]/t._pdata[3])*i.w*(a.x[1]-a.x[0])},t._ya={},bb.extendFlat(t._ya,n),xb.setConvert(t._ya),t._ya._offset=i.t+(1-a.y[1])*i.h,t._ya.l2p=function(){return .5*(1-t._pdata[1]/t._pdata[3])*i.h*(a.y[1]-a.y[0])}}function Zv(t,e){var r=[0,0,0,0],a,i;for(a=0;a<4;++a)for(i=0;i<4;++i)r[i]+=t[4*a+i]*e[a];return r}function TF(t,e){var r=Zv(t.projection,Zv(t.view,Zv(t.model,[e[0],e[1],e[2],1])));return r}var kF=TF,AF=rm.drawRaw,MF=kF,SF=["x","y","z"],LF=function(e){for(var r=e.fullSceneLayout,a=e.dataScale,i=r.annotations,n=0;n<i.length;n++){for(var o=i[n],l=!1,s=0;s<3;s++){var f=SF[s],c=o[f],u=r[f+"axis"],v=u.r2fraction(c);if(v<0||v>1){l=!0;break}}l?e.fullLayout._infolayer.select(".annotation-"+e.id+'[data-index="'+n+'"]').remove():(o._pdata=MF(e.glplot.cameraParams,[r.xaxis.r2l(o.x)*a[0],r.yaxis.r2l(o.y)*a[1],r.zaxis.r2l(o.z)*a[2]]),AF(e.graphDiv,o,n,e.id,o._xa,o._ya))}},CF=ot,_b=we,DF={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:mh}}},layoutAttributes:mh,handleDefaults:bF,includeBasePlot:PF,convert:_F,draw:LF};function PF(t,e){var r=CF.subplotsRegistry.gl3d;if(r)for(var a=r.attrRegex,i=Object.keys(t),n=0;n<i.length;n++){var o=i[n];a.test(o)&&(t[o].annotations||[]).length&&(_b.pushUnique(e._basePlotModules,r),_b.pushUnique(e._subplots.gl3d,o))}}var wb=_s,Tb=Mr,kb=Vi.line,$F=ta.dash,Sa=Xt.extendFlat,EF=Ht.templatedArray,Ab=mu,Zn=wa,zF=zr.shapeTexttemplateAttrs,RF=Vh,hk=EF("shape",{visible:Sa({},Zn.visible,{editType:"calc+arraydraw",description:["Determines whether or not this shape is visible.","If *legendonly*, the shape is not drawn,","but can appear as a legend item","(provided that the legend itself is visible)."].join(" ")}),showlegend:{valType:"boolean",dflt:!1,editType:"calc+arraydraw",description:["Determines whether or not this","shape is shown in the legend."].join(" ")},legend:Sa({},Zn.legend,{editType:"calc+arraydraw",description:["Sets the reference to a legend to show this shape in.","References to these legends are *legend*, *legend2*, *legend3*, etc.","Settings for these legends are set in the layout, under","`layout.legend`, `layout.legend2`, etc."].join(" ")}),legendgroup:Sa({},Zn.legendgroup,{editType:"calc+arraydraw",description:["Sets the legend group for this shape.","Traces and shapes part of the same legend group hide/show at the same time","when toggling legend items."].join(" ")}),legendgrouptitle:{text:Sa({},Zn.legendgrouptitle.text,{editType:"calc+arraydraw"}),font:Tb({editType:"calc+arraydraw",description:["Sets this legend group's title font."].join(" ")}),editType:"calc+arraydraw"},legendrank:Sa({},Zn.legendrank,{editType:"calc+arraydraw",description:["Sets the legend rank for this shape.","Items and groups with smaller ranks are presented on top/left side while","with *reversed* `legend.traceorder` they are on bottom/right side.","The default legendrank is 1000,","so that you can use ranks less than 1000 to place certain items before all unranked items,","and ranks greater than 1000 to go after all unranked items.","When having unranked or equal rank items shapes would be displayed after traces","i.e. according to their order in data and layout."].join(" ")}),legendwidth:Sa({},Zn.legendwidth,{editType:"calc+arraydraw",description:"Sets the width (in px or fraction) of the legend for this shape."}),type:{valType:"enumerated",values:["circle","rect","path","line"],editType:"calc+arraydraw",description:["Specifies the shape type to be drawn.","If *line*, a line is drawn from (`x0`,`y0`) to (`x1`,`y1`)","with respect to the axes' sizing mode.","If *circle*, a circle is drawn from","((`x0`+`x1`)/2, (`y0`+`y1`)/2))","with radius","(|(`x0`+`x1`)/2 - `x0`|, |(`y0`+`y1`)/2 -`y0`)|)","with respect to the axes' sizing mode.","If *rect*, a rectangle is drawn linking","(`x0`,`y0`), (`x1`,`y0`), (`x1`,`y1`), (`x0`,`y1`), (`x0`,`y0`)","with respect to the axes' sizing mode.","If *path*, draw a custom SVG path using `path`.","with respect to the axes' sizing mode."].join(" ")},layer:{valType:"enumerated",values:["below","above","between"],dflt:"above",editType:"arraydraw",description:["Specifies whether shapes are drawn below gridlines (*below*),","between gridlines and traces (*between*) or above traces (*above*)."].join(" ")},xref:Sa({},wb.xref,{description:["Sets the shape's x coordinate axis.",Ab.axisRefDescription("x","left","right")].join(" ")}),xsizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw",description:["Sets the shapes's sizing mode along the x axis.","If set to *scaled*, `x0`, `x1` and x coordinates within `path` refer to","data values on the x axis or a fraction of the plot area's width","(`xref` set to *paper*).","If set to *pixel*, `xanchor` specifies the x position in terms","of data or plot fraction but `x0`, `x1` and x coordinates within `path`","are pixels relative to `xanchor`. This way, the shape can have","a fixed width while maintaining a position relative to data or","plot fraction."].join(" ")},xanchor:{valType:"any",editType:"calc+arraydraw",description:["Only relevant in conjunction with `xsizemode` set to *pixel*.","Specifies the anchor point on the x axis to which `x0`, `x1`","and x coordinates within `path` are relative to.","E.g. useful to attach a pixel sized shape to a certain data value.","No effect when `xsizemode` not set to *pixel*."].join(" ")},x0:{valType:"any",editType:"calc+arraydraw",description:["Sets the shape's starting x position.","See `type` and `xsizemode` for more info."].join(" ")},x1:{valType:"any",editType:"calc+arraydraw",description:["Sets the shape's end x position.","See `type` and `xsizemode` for more info."].join(" ")},x0shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc",description:["Shifts `x0` away from the center of the category when `xref` is a *category* or","*multicategory* axis. -0.5 corresponds to the start of the category and 0.5","corresponds to the end of the category."].join(" ")},x1shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc",description:["Shifts `x1` away from the center of the category when `xref` is a *category* or","*multicategory* axis. -0.5 corresponds to the start of the category and 0.5","corresponds to the end of the category."].join(" ")},yref:Sa({},wb.yref,{description:["Sets the shape's y coordinate axis.",Ab.axisRefDescription("y","bottom","top")].join(" ")}),ysizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw",description:["Sets the shapes's sizing mode along the y axis.","If set to *scaled*, `y0`, `y1` and y coordinates within `path` refer to","data values on the y axis or a fraction of the plot area's height","(`yref` set to *paper*).","If set to *pixel*, `yanchor` specifies the y position in terms","of data or plot fraction but `y0`, `y1` and y coordinates within `path`","are pixels relative to `yanchor`. This way, the shape can have","a fixed height while maintaining a position relative to data or","plot fraction."].join(" ")},yanchor:{valType:"any",editType:"calc+arraydraw",description:["Only relevant in conjunction with `ysizemode` set to *pixel*.","Specifies the anchor point on the y axis to which `y0`, `y1`","and y coordinates within `path` are relative to.","E.g. useful to attach a pixel sized shape to a certain data value.","No effect when `ysizemode` not set to *pixel*."].join(" ")},y0:{valType:"any",editType:"calc+arraydraw",description:["Sets the shape's starting y position.","See `type` and `ysizemode` for more info."].join(" ")},y1:{valType:"any",editType:"calc+arraydraw",description:["Sets the shape's end y position.","See `type` and `ysizemode` for more info."].join(" ")},y0shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc",description:["Shifts `y0` away from the center of the category when `yref` is a *category* or","*multicategory* axis. -0.5 corresponds to the start of the category and 0.5","corresponds to the end of the category."].join(" ")},y1shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc",description:["Shifts `y1` away from the center of the category when `yref` is a *category* or","*multicategory* axis. -0.5 corresponds to the start of the category and 0.5","corresponds to the end of the category."].join(" ")},path:{valType:"string",editType:"calc+arraydraw",description:["For `type` *path* - a valid SVG path with the pixel values","replaced by data values in `xsizemode`/`ysizemode` being *scaled*","and taken unmodified as pixels relative to `xanchor` and `yanchor`","in case of *pixel* size mode.","There are a few restrictions / quirks","only absolute instructions, not relative. So the allowed segments","are: M, L, H, V, Q, C, T, S, and Z","arcs (A) are not allowed because radius rx and ry are relative.","In the future we could consider supporting relative commands,","but we would have to decide on how to handle date and log axes.","Note that even as is, Q and C Bezier paths that are smooth on","linear axes may not be smooth on log, and vice versa.",'no chained "polybezier" commands - specify the segment type for',"each one.","On category axes, values are numbers scaled to the serial numbers","of categories because using the categories themselves there would","be no way to describe fractional positions","On data axes: because space and T are both normal components of path","strings, we can't use either to separate date from time parts.","Therefore we'll use underscore for this purpose:","2015-02-21_13:45:56.789"].join(" ")},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw",description:"Sets the opacity of the shape."},line:{color:Sa({},kb.color,{editType:"arraydraw"}),width:Sa({},kb.width,{editType:"calc+arraydraw"}),dash:Sa({},$F,{editType:"arraydraw"}),editType:"calc+arraydraw"},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw",description:["Sets the color filling the shape's interior. Only applies to closed shapes."].join(" ")},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd",editType:"arraydraw",description:["Determines which regions of complex paths constitute the interior.","For more info please visit https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill-rule"].join(" ")},editable:{valType:"boolean",dflt:!1,editType:"calc+arraydraw",description:["Determines whether the shape could be activated for edit or not.","Has no effect when the older editable shapes mode is enabled via","`config.editable` or `config.edits.shapePosition`."].join(" ")},label:{text:{valType:"string",dflt:"",editType:"arraydraw",description:["Sets the text to display with shape.","It is also used for legend item if `name` is not provided."].join(" ")},texttemplate:zF({},{keys:Object.keys(RF)}),font:Tb({editType:"calc+arraydraw",colorEditType:"arraydraw",description:"Sets the shape label text font."}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right","start","middle","end"],editType:"arraydraw",description:["Sets the position of the label text relative to the shape.","Supported values for rectangles, circles and paths are","*top left*, *top center*, *top right*, *middle left*,","*middle center*, *middle right*, *bottom left*, *bottom center*,","and *bottom right*.","Supported values for lines are *start*, *middle*, and *end*.","Default: *middle center* for rectangles, circles, and paths; *middle* for lines."].join(" ")},textangle:{valType:"angle",dflt:"auto",editType:"calc+arraydraw",description:["Sets the angle at which the label text is drawn","with respect to the horizontal. For lines, angle *auto*","is the same angle as the line. For all other shapes,","angle *auto* is horizontal."].join(" ")},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw",description:["Sets the label's horizontal position anchor","This anchor binds the specified `textposition` to the *left*, *center*","or *right* of the label text.","For example, if `textposition` is set to *top right* and","`xanchor` to *right* then the right-most portion of the","label text lines up with the right-most edge of the","shape."].join(" ")},yanchor:{valType:"enumerated",values:["top","middle","bottom"],editType:"calc+arraydraw",description:["Sets the label's vertical position anchor","This anchor binds the specified `textposition` to the *top*, *middle*","or *bottom* of the label text.","For example, if `textposition` is set to *top right* and","`yanchor` to *top* then the top-most portion of the","label text lines up with the top-most edge of the","shape."].join(" ")},padding:{valType:"number",dflt:3,min:0,editType:"arraydraw",description:"Sets padding (in px) between edge of label and edge of shape."},editType:"arraydraw"},editType:"arraydraw"}),bl=we,Kn=Ot,IF=ri,FF=hk,Mb=Ui,NF=function(e,r){IF(e,r,{name:"shapes",handleItemDefaults:OF})};function HF(t,e){return t?"bottom":e.indexOf("top")!==-1?"top":e.indexOf("bottom")!==-1?"bottom":"middle"}function OF(t,e,r){function a(k,C){return bl.coerce(t,e,FF,k,C)}e._isShape=!0;var i=a("visible");if(i){var n=a("showlegend");n&&(a("legend"),a("legendwidth"),a("legendgroup"),a("legendgrouptitle.text"),bl.coerceFont(a,"legendgrouptitle.font"),a("legendrank"));var o=a("path"),l=o?"path":"rect",s=a("type",l),f=s!=="path";f&&delete e.path,a("editable"),a("layer"),a("opacity"),a("fillcolor"),a("fillrule");var c=a("line.width");c&&(a("line.color"),a("line.dash"));for(var u=a("xsizemode"),v=a("ysizemode"),p=["x","y"],d=0;d<2;d++){var h=p[d],m=h+"anchor",y=h==="x"?u:v,b={_fullLayout:r},_,g,x,w=Kn.coerceRef(t,e,b,h,void 0,"paper"),T=Kn.getRefType(w);if(T==="range"?(_=Kn.getFromId(b,w),_._shapeIndices.push(e._index),x=Mb.rangeToShapePosition(_),g=Mb.shapePositionToRange(_),(_.type==="category"||_.type==="multicategory")&&(a(h+"0shift"),a(h+"1shift"))):g=x=bl.identity,f){var A=.25,M=.75,S=h+"0",L=h+"1",E=t[S],F=t[L];t[S]=g(t[S],!0),t[L]=g(t[L],!0),y==="pixel"?(a(S,0),a(L,10)):(Kn.coercePosition(e,b,a,w,S,A),Kn.coercePosition(e,b,a,w,L,M)),e[S]=x(e[S]),e[L]=x(e[L]),t[S]=E,t[L]=F}if(y==="pixel"){var N=t[m];t[m]=g(t[m],!0),Kn.coercePosition(e,b,a,w,m,.25),e[m]=x(e[m]),t[m]=N}}f&&bl.noneOrAll(t,e,["x0","x1","y0","y1"]);var z=s==="line",H,D;if(f&&(H=a("label.texttemplate")),H||(D=a("label.text")),D||H){a("label.textangle");var P=a("label.textposition",z?"middle":"middle center");a("label.xanchor"),a("label.yanchor",HF(z,P)),a("label.padding"),bl.coerceFont(a,"label.font",r.font)}}}var jF=yt,Sb=we;function BF(t,e){return t?"bottom":e.indexOf("top")!==-1?"top":e.indexOf("bottom")!==-1?"bottom":"middle"}var GF=function(e,r,a){a("newshape.visible"),a("newshape.name"),a("newshape.showlegend"),a("newshape.legend"),a("newshape.legendwidth"),a("newshape.legendgroup"),a("newshape.legendgrouptitle.text"),Sb.coerceFont(a,"newshape.legendgrouptitle.font"),a("newshape.legendrank"),a("newshape.drawdirection"),a("newshape.layer"),a("newshape.fillcolor"),a("newshape.fillrule"),a("newshape.opacity");var i=a("newshape.line.width");if(i){var n=(e||{}).plot_bgcolor||"#FFF";a("newshape.line.color",jF.contrast(n)),a("newshape.line.dash")}var o=e.dragmode==="drawline",l=a("newshape.label.text"),s=a("newshape.label.texttemplate");if(l||s){a("newshape.label.textangle");var f=a("newshape.label.textposition",o?"middle":"middle center");a("newshape.label.xanchor"),a("newshape.label.yanchor",BF(o,f)),a("newshape.label.padding"),Sb.coerceFont(a,"newshape.label.font",r.font)}a("activeshape.fillcolor"),a("activeshape.opacity")},yh=we,Qn=Ot,Ro=su,pk=Ui,UF=function(e){var r=e._fullLayout,a=yh.filterVisible(r.shapes);if(!(!a.length||!e._fullData.length))for(var i=0;i<a.length;i++){var n=a[i];n._extremes={};var o,l,s=Qn.getRefType(n.xref),f=Qn.getRefType(n.yref);n.xref!=="paper"&&s!=="domain"&&(o=Qn.getFromId(e,n.xref),l=Lb(o,n,Ro.paramIsX),l&&(n._extremes[o._id]=Qn.findExtremes(o,l,VF(n)))),n.yref!=="paper"&&f!=="domain"&&(o=Qn.getFromId(e,n.yref),l=Lb(o,n,Ro.paramIsY),l&&(n._extremes[o._id]=Qn.findExtremes(o,l,WF(n))))}};function VF(t){return mk(t.line.width,t.xsizemode,t.x0,t.x1,t.path,!1)}function WF(t){return mk(t.line.width,t.ysizemode,t.y0,t.y1,t.path,!0)}function mk(t,e,r,a,i,n){var o=t/2,l=n;if(e==="pixel"){var s=i?pk.extractPathCoords(i,n?Ro.paramIsY:Ro.paramIsX):[r,a],f=yh.aggNums(Math.max,null,s),c=yh.aggNums(Math.min,null,s),u=c<0?Math.abs(c)+o:o,v=f>0?f+o:o;return{ppad:o,ppadplus:l?u:v,ppadminus:l?v:u}}else return{ppad:o}}function Lb(t,e,r){var a=t._id.charAt(0)==="x"?"x":"y",i=t.type==="category"||t.type==="multicategory",n,o,l=0,s=0,f=i?t.r2c:t.d2c,c=e[a+"sizemode"]==="scaled";if(c?(n=e[a+"0"],o=e[a+"1"],i&&(l=e[a+"0shift"],s=e[a+"1shift"])):(n=e[a+"anchor"],o=e[a+"anchor"]),n!==void 0)return[f(n)+l,f(o)+s];if(e.path){var u=1/0,v=-1/0,p=e.path.match(Ro.segmentRE),d,h,m,y,b;for(t.type==="date"&&(f=pk.decodeDate(f)),d=0;d<p.length;d++)h=p[d],m=r[h.charAt(0)].drawn,m!==void 0&&(y=p[d].substr(1).match(Ro.paramRE),!(!y||y.length<m)&&(b=f(y[m]),b<u&&(u=b),b>v&&(v=b)));if(v>=u)return[u,v]}}var Cb=Dp,XF={moduleType:"component",name:"shapes",layoutAttributes:hk,supplyLayoutDefaults:NF,supplyDrawNewShapeDefaults:GF,includeBasePlot:gu("shapes"),calcAutorange:UF,draw:Cb.draw,drawOne:Cb.drawOne},Db=Rr,YF=Ht.templatedArray,Pb=mu,yk=YF("image",{visible:{valType:"boolean",dflt:!0,editType:"arraydraw",description:["Determines whether or not this image is visible."].join(" ")},source:{valType:"string",editType:"arraydraw",description:["Specifies the URL of the image to be used.","The URL must be accessible from the domain where the","plot code is run, and can be either relative or absolute."].join(" ")},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw",description:["Specifies whether images are drawn below or above traces.","When `xref` and `yref` are both set to `paper`,","image is drawn below the entire plot area."].join(" ")},sizex:{valType:"number",dflt:0,editType:"arraydraw",description:["Sets the image container size horizontally.","The image will be sized based on the `position` value.","When `xref` is set to `paper`, units are sized relative","to the plot width.","When `xref` ends with ` domain`, units are sized relative","to the axis width."].join(" ")},sizey:{valType:"number",dflt:0,editType:"arraydraw",description:["Sets the image container size vertically.","The image will be sized based on the `position` value.","When `yref` is set to `paper`, units are sized relative","to the plot height.","When `yref` ends with ` domain`, units are sized relative","to the axis height."].join(" ")},sizing:{valType:"enumerated",values:["fill","contain","stretch"],dflt:"contain",editType:"arraydraw",description:["Specifies which dimension of the image to constrain."].join(" ")},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw",description:"Sets the opacity of the image."},x:{valType:"any",dflt:0,editType:"arraydraw",description:["Sets the image's x position.","When `xref` is set to `paper`, units are sized relative","to the plot height.","See `xref` for more info"].join(" ")},y:{valType:"any",dflt:0,editType:"arraydraw",description:["Sets the image's y position.","When `yref` is set to `paper`, units are sized relative","to the plot height.","See `yref` for more info"].join(" ")},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left",editType:"arraydraw",description:"Sets the anchor for the x position"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"top",editType:"arraydraw",description:"Sets the anchor for the y position."},xref:{valType:"enumerated",values:["paper",Db.idRegex.x.toString()],dflt:"paper",editType:"arraydraw",description:["Sets the images's x coordinate axis.",Pb.axisRefDescription("x","left","right")].join(" ")},yref:{valType:"enumerated",values:["paper",Db.idRegex.y.toString()],dflt:"paper",editType:"arraydraw",description:["Sets the images's y coordinate axis.",Pb.axisRefDescription("y","bottom","top")].join(" ")},editType:"arraydraw"}),qF=we,Kv=Ot,ZF=ri,KF=yk,QF="images",JF=function(e,r){var a={name:QF,handleItemDefaults:eN};ZF(e,r,a)};function eN(t,e,r){function a(v,p){return qF.coerce(t,e,KF,v,p)}var i=a("source"),n=a("visible",!!i);if(!n)return e;a("layer"),a("xanchor"),a("yanchor"),a("sizex"),a("sizey"),a("sizing"),a("opacity");for(var o={_fullLayout:r},l=["x","y"],s=0;s<2;s++){var f=l[s],c=Kv.coerceRef(t,e,o,f,"paper",void 0);if(c!=="paper"){var u=Kv.getFromId(o,c);u._imgIndices.push(e._index)}Kv.coercePosition(e,o,a,c,f,0)}return e}var $b=bt,tN=Et,Jn=Ot,Eb=cr,rN=Yo,aN=function(e){var r=e._fullLayout,a=[],i={},n=[],o,l;for(l=0;l<r.images.length;l++){var s=r.images[l];if(s.visible)if(s.layer==="below"&&s.xref!=="paper"&&s.yref!=="paper"){o=Eb.ref2id(s.xref)+Eb.ref2id(s.yref);var f=r._plots[o];if(!f){n.push(s);continue}f.mainplot&&(o=f.mainplot.id),i[o]||(i[o]=[]),i[o].push(s)}else s.layer==="above"?a.push(s):n.push(s)}var c={x:{left:{sizing:"xMin",offset:0},center:{sizing:"xMid",offset:-1/2},right:{sizing:"xMax",offset:-1}},y:{top:{sizing:"YMin",offset:0},middle:{sizing:"YMid",offset:-1/2},bottom:{sizing:"YMax",offset:-1}}};function u(g){var x=$b.select(this);if(this._imgSrc!==g.source)if(x.attr("xmlns",rN.svg),!e._context.staticPlot||g.source&&g.source.slice(0,5)==="data:")x.attr("xlink:href",g.source),this._imgSrc=g.source;else{var w=new Promise((function(T){var A=new Image;this.img=A,A.setAttribute("crossOrigin","anonymous"),A.onerror=M,A.onload=function(){var S=document.createElement("canvas");S.width=this.width,S.height=this.height;var L=S.getContext("2d",{willReadFrequently:!0});L.drawImage(this,0,0);var E=S.toDataURL("image/png");x.attr("xlink:href",E),T()},x.on("error",M),A.src=g.source,this._imgSrc=g.source;function M(){x.remove(),T()}}).bind(this));e._promises.push(w)}}function v(g){var x=$b.select(this),w=Jn.getFromId(e,g.xref),T=Jn.getFromId(e,g.yref),A=Jn.getRefType(g.xref)==="domain",M=Jn.getRefType(g.yref)==="domain",S=r._size,L,E;w!==void 0?L=typeof g.xref=="string"&&A?w._length*g.sizex:Math.abs(w.l2p(g.sizex)-w.l2p(0)):L=g.sizex*S.w,T!==void 0?E=typeof g.yref=="string"&&M?T._length*g.sizey:Math.abs(T.l2p(g.sizey)-T.l2p(0)):E=g.sizey*S.h;var F=L*c.x[g.xanchor].offset,N=E*c.y[g.yanchor].offset,z=c.x[g.xanchor].sizing+c.y[g.yanchor].sizing,H,D;switch(w!==void 0?H=typeof g.xref=="string"&&A?w._length*g.x+w._offset:w.r2p(g.x)+w._offset:H=g.x*S.w+S.l,H+=F,T!==void 0?D=typeof g.yref=="string"&&M?T._length*(1-g.y)+T._offset:T.r2p(g.y)+T._offset:D=S.h-g.y*S.h+S.t,D+=N,g.sizing){case"fill":z+=" slice";break;case"stretch":z="none";break}x.attr({x:H,y:D,width:L,height:E,preserveAspectRatio:z,opacity:g.opacity});var P=w&&Jn.getRefType(g.xref)!=="domain"?w._id:"",k=T&&Jn.getRefType(g.yref)!=="domain"?T._id:"",C=P+k;tN.setClipUrl(x,C?"clip"+r._uid+C:null,e)}function p(g){return[g.xref,g.x,g.sizex,g.yref,g.y,g.sizey].join("_")}function d(g,x){return g._index-x._index}var h=r._imageLowerLayer.selectAll("image").data(n,p),m=r._imageUpperLayer.selectAll("image").data(a,p);h.enter().append("image"),m.enter().append("image"),h.exit().remove(),m.exit().remove(),h.each(function(g){u.bind(this)(g),v.bind(this)(g)}),m.each(function(g){u.bind(this)(g),v.bind(this)(g)}),h.sort(d),m.sort(d);var y=Object.keys(r._plots);for(l=0;l<y.length;l++){o=y[l];var b=r._plots[o];if(b.imagelayer){var _=b.imagelayer.selectAll("image").data(i[o]||[],p);_.enter().append("image"),_.exit().remove(),_.each(function(g){u.bind(this)(g),v.bind(this)(g)}),_.sort(d)}}},zb=kt,iN=Hh,nN=function(e,r,a,i){r=r||{};var n=a==="log"&&r.type==="linear",o=a==="linear"&&r.type==="log";if(n||o){for(var l=e._fullLayout.images,s=r._id.charAt(0),f,c,u=0;u<l.length;u++)if(f=l[u],c="images["+u+"].",f[s+"ref"]===r._id){var v=f[s],p=f["size"+s],d=null,h=null;if(n){d=iN(v,r.range);var m=p/Math.pow(10,d)/2;h=2*Math.log(m+Math.sqrt(1+m*m))/Math.LN10}else d=Math.pow(10,v),h=d*(Math.pow(10,p/2)-Math.pow(10,-p/2));zb(d)?zb(h)||(h=null):(d=null,h=null),i(c+s,d),i(c+"size"+s,h)}}},oN={moduleType:"component",name:"images",layoutAttributes:yk,supplyLayoutDefaults:JF,includeBasePlot:gu("images"),draw:aN,convertCoords:nN},am={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"◄",right:"►",up:"▲",down:"▼"}},lN=Mr,sN=Or,fN=Xt.extendFlat,cN=Ja.overrideAll,uN=Wh,gk=Ht.templatedArray,vN=gk("button",{visible:{valType:"boolean",description:"Determines whether or not this button is visible."},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle",description:["Sets the Plotly method to be called on click.","If the `skip` method is used, the API updatemenu will function as normal","but will perform no API calls and will not bind automatically to state","updates. This may be used to create a component interface and attach to","updatemenu events manually via JavaScript."].join(" ")},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}],description:["Sets the arguments values to be passed to the Plotly","method set in `method` on click."].join(" ")},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}],description:["Sets a 2nd set of `args`,","these arguments values are passed to the Plotly","method set in `method` when clicking this button while in the active state.","Use this to create toggle buttons."].join(" ")},label:{valType:"string",dflt:"",description:"Sets the text label to appear on the button."},execute:{valType:"boolean",dflt:!0,description:["When true, the API method is executed. When false, all other behaviors are the same","and command execution is skipped. This may be useful when hooking into, for example,","the `plotly_buttonclicked` method and executing the API command manually without losing","the benefit of the updatemenu automatically binding to the state of the plot through the","specification of `method` and `args`."].join(" ")}}),bk=cN(gk("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean",description:["Determines whether or not the update menu is visible."].join(" ")},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown",description:["Determines whether the buttons are accessible via a dropdown menu","or whether the buttons are stacked horizontally or vertically"].join(" ")},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down",description:["Determines the direction in which the buttons are laid out, whether","in a dropdown menu or a row/column of buttons. For `left` and `up`,","the buttons will still appear in left-to-right or top-to-bottom order","respectively."].join(" ")},active:{valType:"integer",min:-1,dflt:0,description:["Determines which button (by index starting from 0) is","considered active."].join(" ")},showactive:{valType:"boolean",dflt:!0,description:"Highlights active dropdown item or active button if true."},buttons:vN,x:{valType:"number",min:-2,max:3,dflt:-.05,description:"Sets the x position (in normalized coordinates) of the update menu."},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right",description:["Sets the update menu's horizontal position anchor.","This anchor binds the `x` position to the *left*, *center*","or *right* of the range selector."].join(" ")},y:{valType:"number",min:-2,max:3,dflt:1,description:"Sets the y position (in normalized coordinates) of the update menu."},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top",description:["Sets the update menu's vertical position anchor","This anchor binds the `y` position to the *top*, *middle*","or *bottom* of the range selector."].join(" ")},pad:fN(uN({editType:"arraydraw"}),{description:"Sets the padding around the buttons or dropdown menu."}),font:lN({description:"Sets the font of the update menu button text."}),bgcolor:{valType:"color",description:"Sets the background color of the update menu buttons."},bordercolor:{valType:"color",dflt:sN.borderLine,description:"Sets the color of the border enclosing the update menu."},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw",description:"Sets the width (in px) of the border enclosing the update menu."}}),"arraydraw","from-root"),Vf=we,xk=ri,_k=bk,dN=am,hN=dN.name,pN=_k.buttons,mN=function(e,r){var a={name:hN,handleItemDefaults:yN};xk(e,r,a)};function yN(t,e,r){function a(o,l){return Vf.coerce(t,e,_k,o,l)}var i=xk(t,e,{name:"buttons",handleItemDefaults:gN}),n=a("visible",i.length>0);n&&(a("active"),a("direction"),a("type"),a("showactive"),a("x"),a("y"),Vf.noneOrAll(t,e,["x","y"]),a("xanchor"),a("yanchor"),a("pad.t"),a("pad.r"),a("pad.b"),a("pad.l"),Vf.coerceFont(a,"font",r.font),a("bgcolor",r.paper_bgcolor),a("bordercolor"),a("borderwidth"))}function gN(t,e){function r(i,n){return Vf.coerce(t,e,pN,i,n)}var a=r("visible",t.method==="skip"||Array.isArray(t.args));a&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}var bN=Kt,za=bt,Rb=yt,Ao=Et,wc=we;function Kt(t,e,r){this.gd=t,this.container=e,this.id=r,this.position=null,this.translateX=null,this.translateY=null,this.hbar=null,this.vbar=null,this.bg=this.container.selectAll("rect.scrollbox-bg").data([0]),this.bg.exit().on(".drag",null).on("wheel",null).remove(),this.bg.enter().append("rect").classed("scrollbox-bg",!0).style("pointer-events","all").attr({opacity:0,x:0,y:0,width:0,height:0})}Kt.barWidth=2;Kt.barLength=20;Kt.barRadius=2;Kt.barPad=1;Kt.barColor="#808BA4";Kt.prototype.enable=function(e,r,a){var i=this.gd._fullLayout,n=i.width,o=i.height;this.position=e;var l=this.position.l,s=this.position.w,f=this.position.t,c=this.position.h,u=this.position.direction,v=u==="down",p=u==="left",d=u==="right",h=u==="up",m=s,y=c,b,_,g,x;!v&&!p&&!d&&!h&&(this.position.direction="down",v=!0);var w=v||h;w?(b=l,_=b+m,v?(g=f,x=Math.min(g+y,o),y=x-g):(x=f+y,g=Math.max(x-y,0),y=x-g)):(g=f,x=g+y,p?(_=l+m,b=Math.max(_-m,0),m=_-b):(b=l,_=Math.min(b+m,n),m=_-b)),this._box={l:b,t:g,w:m,h:y};var T=s>m,A=Kt.barLength+2*Kt.barPad,M=Kt.barWidth+2*Kt.barPad,S=l,L=f+c;L+M>o&&(L=o-M);var E=this.container.selectAll("rect.scrollbar-horizontal").data(T?[0]:[]);E.exit().on(".drag",null).remove(),E.enter().append("rect").classed("scrollbar-horizontal",!0).call(Rb.fill,Kt.barColor),T?(this.hbar=E.attr({rx:Kt.barRadius,ry:Kt.barRadius,x:S,y:L,width:A,height:M}),this._hbarXMin=S+A/2,this._hbarTranslateMax=m-A):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var F=c>y,N=Kt.barWidth+2*Kt.barPad,z=Kt.barLength+2*Kt.barPad,H=l+s,D=f;H+N>n&&(H=n-N);var P=this.container.selectAll("rect.scrollbar-vertical").data(F?[0]:[]);P.exit().on(".drag",null).remove(),P.enter().append("rect").classed("scrollbar-vertical",!0).call(Rb.fill,Kt.barColor),F?(this.vbar=P.attr({rx:Kt.barRadius,ry:Kt.barRadius,x:H,y:D,width:N,height:z}),this._vbarYMin=D+z/2,this._vbarTranslateMax=y-z):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var k=this.id,C=b-.5,$=F?_+N+.5:_+.5,R=g-.5,j=T?x+M+.5:x+.5,G=i._topdefs.selectAll("#"+k).data(T||F?[0]:[]);if(G.exit().remove(),G.enter().append("clipPath").attr("id",k).append("rect"),T||F?(this._clipRect=G.select("rect").attr({x:Math.floor(C),y:Math.floor(R),width:Math.ceil($)-Math.floor(C),height:Math.ceil(j)-Math.floor(R)}),this.container.call(Ao.setClipUrl,k,this.gd),this.bg.attr({x:l,y:f,width:s,height:c})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(Ao.setClipUrl,null),delete this._clipRect),T||F){var Y=za.behavior.drag().on("dragstart",function(){za.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(Y);var O=za.behavior.drag().on("dragstart",function(){za.event.sourceEvent.preventDefault(),za.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));T&&this.hbar.on(".drag",null).call(O),F&&this.vbar.on(".drag",null).call(O)}this.setTranslate(r,a)};Kt.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(Ao.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)};Kt.prototype._onBoxDrag=function(){var e=this.translateX,r=this.translateY;this.hbar&&(e-=za.event.dx),this.vbar&&(r-=za.event.dy),this.setTranslate(e,r)};Kt.prototype._onBoxWheel=function(){var e=this.translateX,r=this.translateY;this.hbar&&(e+=za.event.deltaY),this.vbar&&(r+=za.event.deltaY),this.setTranslate(e,r)};Kt.prototype._onBarDrag=function(){var e=this.translateX,r=this.translateY;if(this.hbar){var a=e+this._hbarXMin,i=a+this._hbarTranslateMax,n=wc.constrain(za.event.x,a,i),o=(n-a)/(i-a),l=this.position.w-this._box.w;e=o*l}if(this.vbar){var s=r+this._vbarYMin,f=s+this._vbarTranslateMax,c=wc.constrain(za.event.y,s,f),u=(c-s)/(f-s),v=this.position.h-this._box.h;r=u*v}this.setTranslate(e,r)};Kt.prototype.setTranslate=function(e,r){var a=this.position.w-this._box.w,i=this.position.h-this._box.h;if(e=wc.constrain(e||0,0,a),r=wc.constrain(r||0,0,i),this.translateX=e,this.translateY=r,this.container.call(Ao.setTranslate,this._box.l-this.position.l-e,this._box.t-this.position.t-r),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+e-.5),y:Math.floor(this.position.t+r-.5)}),this.hbar){var n=e/a;this.hbar.call(Ao.setTranslate,e+n*this._hbarTranslateMax,r)}if(this.vbar){var o=r/i;this.vbar.call(Ao.setTranslate,e,r+o*this._vbarTranslateMax)}};var Io=bt,ls=hr,ss=yt,Fo=Et,sa=we,Tc=Tr,xN=Ht.arrayEditor,wk=Vr.LINE_SPACING,dt=am,_N=bN,wN=function(e){var r=e._fullLayout,a=sa.filterVisible(r[dt.name]);function i(v){ls.autoMargin(e,Sk(v))}var n=r._menulayer.selectAll("g."+dt.containerClassName).data(a.length>0?[0]:[]);if(n.enter().append("g").classed(dt.containerClassName,!0).style("cursor","pointer"),n.exit().each(function(){Io.select(this).selectAll("g."+dt.headerGroupClassName).each(i)}).remove(),a.length!==0){var o=n.selectAll("g."+dt.headerGroupClassName).data(a,TN);o.enter().append("g").classed(dt.headerGroupClassName,!0);for(var l=sa.ensureSingle(n,"g",dt.dropdownButtonGroupClassName,function(v){v.style("pointer-events","all")}),s=0;s<a.length;s++){var f=a[s];CN(e,f)}var c="updatemenus"+r._uid,u=new _N(e,l,c);o.enter().size()&&(l.node().parentNode.appendChild(l.node()),l.call(bh)),o.exit().each(function(v){l.call(bh),i(v)}).remove(),o.each(function(v){var p=Io.select(this),d=v.type==="dropdown"?l:null;ls.manageCommandObserver(e,v,v.buttons,function(h){gh(e,v,v.buttons[h.index],p,d,u,h.index,!0)}),v.type==="dropdown"?(kk(e,p,l,u,v),Tk(l,v)&&fs(e,p,l,u,v)):fs(e,p,null,null,v)})}};function TN(t){return t._index}function kN(t){return+t.attr(dt.menuIndexAttrName)==-1}function Tk(t,e){return+t.attr(dt.menuIndexAttrName)===e._index}function gh(t,e,r,a,i,n,o,l){e.active=o,xN(t.layout,dt.name,e).applyUpdate("active",o),e.type==="buttons"?fs(t,a,null,null,e):e.type==="dropdown"&&(i.attr(dt.menuIndexAttrName,"-1"),kk(t,a,i,n,e),l||fs(t,a,i,n,e))}function kk(t,e,r,a,i){var n=sa.ensureSingle(e,"g",dt.headerClassName,function(v){v.style("pointer-events","all")}),o=i._dims,l=i.active,s=i.buttons[l]||dt.blankHeaderOpts,f={y:i.pad.t,yPad:0,x:i.pad.l,xPad:0,index:0},c={width:o.headerWidth,height:o.headerHeight};n.call(im,i,s,t).call(Lk,i,f,c);var u=sa.ensureSingle(e,"text",dt.headerArrowClassName,function(v){v.attr("text-anchor","end").call(Fo.font,i.font).text(dt.arrowSymbol[i.direction])});u.attr({x:o.headerWidth-dt.arrowOffsetX+i.pad.l,y:o.headerHeight/2+dt.textOffsetY+i.pad.t}),n.on("click",function(){r.call(bh,String(Tk(r,i)?-1:i._index)),fs(t,e,r,a,i)}),n.on("mouseover",function(){n.call(Ak)}),n.on("mouseout",function(){n.call(Mk,i)}),Fo.setTranslate(e,o.lx,o.ly)}function fs(t,e,r,a,i){r||(r=e,r.attr("pointer-events","all"));var n=!kN(r)||i.type==="buttons"?i.buttons:[],o=i.type==="dropdown"?dt.dropdownButtonClassName:dt.buttonClassName,l=r.selectAll("g."+o).data(sa.filterVisible(n)),s=l.enter().append("g").classed(o,!0),f=l.exit();i.type==="dropdown"?(s.attr("opacity","0").transition().attr("opacity","1"),f.transition().attr("opacity","0").remove()):f.remove();var c=0,u=0,v=i._dims,p=["up","down"].indexOf(i.direction)!==-1;i.type==="dropdown"&&(p?u=v.headerHeight+dt.gapButtonHeader:c=v.headerWidth+dt.gapButtonHeader),i.type==="dropdown"&&i.direction==="up"&&(u=-dt.gapButtonHeader+dt.gapButton-v.openHeight),i.type==="dropdown"&&i.direction==="left"&&(c=-dt.gapButtonHeader+dt.gapButton-v.openWidth);var d={x:v.lx+c+i.pad.l,y:v.ly+u+i.pad.t,yPad:dt.gapButton,xPad:dt.gapButton,index:0},h={l:d.x+i.borderwidth,t:d.y+i.borderwidth};l.each(function(m,y){var b=Io.select(this);b.call(im,i,m,t).call(Lk,i,d),b.on("click",function(){Io.event.defaultPrevented||(m.execute&&(m.args2&&i.active===y?(gh(t,i,m,e,r,a,-1),ls.executeAPICommand(t,m.method,m.args2)):(gh(t,i,m,e,r,a,y),ls.executeAPICommand(t,m.method,m.args))),t.emit("plotly_buttonclicked",{menu:i,button:m,active:i.active}))}),b.on("mouseover",function(){b.call(Ak)}),b.on("mouseout",function(){b.call(Mk,i),l.call(Ib,i)})}),l.call(Ib,i),p?(h.w=Math.max(v.openWidth,v.headerWidth),h.h=d.y-h.t):(h.w=d.x-h.l,h.h=Math.max(v.openHeight,v.headerHeight)),h.direction=i.direction,a&&(l.size()?AN(t,e,r,a,i,h):MN(a))}function AN(t,e,r,a,i,n){var o=i.direction,l=o==="up"||o==="down",s=i._dims,f=i.active,c,u,v;if(l)for(u=0,v=0;v<f;v++)u+=s.heights[v]+dt.gapButton;else for(c=0,v=0;v<f;v++)c+=s.widths[v]+dt.gapButton;a.enable(n,c,u),a.hbar&&a.hbar.attr("opacity","0").transition().attr("opacity","1"),a.vbar&&a.vbar.attr("opacity","0").transition().attr("opacity","1")}function MN(t){var e=!!t.hbar,r=!!t.vbar;e&&t.hbar.transition().attr("opacity","0").each("end",function(){e=!1,r||t.disable()}),r&&t.vbar.transition().attr("opacity","0").each("end",function(){r=!1,e||t.disable()})}function im(t,e,r,a){t.call(SN,e).call(LN,e,r,a)}function SN(t,e){var r=sa.ensureSingle(t,"rect",dt.itemRectClassName,function(a){a.attr({rx:dt.rx,ry:dt.ry,"shape-rendering":"crispEdges"})});r.call(ss.stroke,e.bordercolor).call(ss.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px")}function LN(t,e,r,a){var i=sa.ensureSingle(t,"text",dt.itemTextClassName,function(l){l.attr({"text-anchor":"start","data-notex":1})}),n=r.label,o=a._fullLayout._meta;o&&(n=sa.templateString(n,o)),i.call(Fo.font,e.font).text(n).call(Tc.convertToTspans,a)}function Ib(t,e){var r=e.active;t.each(function(a,i){var n=Io.select(this);i===r&&e.showactive&&n.select("rect."+dt.itemRectClassName).call(ss.fill,dt.activeColor)})}function Ak(t){t.select("rect."+dt.itemRectClassName).call(ss.fill,dt.hoverColor)}function Mk(t,e){t.select("rect."+dt.itemRectClassName).call(ss.fill,e.bgcolor)}function CN(t,e){var r=e._dims={width1:0,height1:0,heights:[],widths:[],totalWidth:0,totalHeight:0,openWidth:0,openHeight:0,lx:0,ly:0},a=Fo.tester.selectAll("g."+dt.dropdownButtonClassName).data(sa.filterVisible(e.buttons));a.enter().append("g").classed(dt.dropdownButtonClassName,!0);var i=["up","down"].indexOf(e.direction)!==-1;a.each(function(c,u){var v=Io.select(this);v.call(im,e,c,t);var p=v.select("."+dt.itemTextClassName),d=p.node()&&Fo.bBox(p.node()).width,h=Math.max(d+dt.textPadX,dt.minWidth),m=e.font.size*wk,y=Tc.lineCount(p),b=Math.max(m*y,dt.minHeight)+dt.textOffsetY;b=Math.ceil(b),h=Math.ceil(h),r.widths[u]=h,r.heights[u]=b,r.height1=Math.max(r.height1,b),r.width1=Math.max(r.width1,h),i?(r.totalWidth=Math.max(r.totalWidth,h),r.openWidth=r.totalWidth,r.totalHeight+=b+dt.gapButton,r.openHeight+=b+dt.gapButton):(r.totalWidth+=h+dt.gapButton,r.openWidth+=h+dt.gapButton,r.totalHeight=Math.max(r.totalHeight,b),r.openHeight=r.totalHeight)}),i?r.totalHeight-=dt.gapButton:r.totalWidth-=dt.gapButton,r.headerWidth=r.width1+dt.arrowPadX,r.headerHeight=r.height1,e.type==="dropdown"&&(i?(r.width1+=dt.arrowPadX,r.totalHeight=r.height1):r.totalWidth=r.width1,r.totalWidth+=dt.arrowPadX),a.remove();var n=r.totalWidth+e.pad.l+e.pad.r,o=r.totalHeight+e.pad.t+e.pad.b,l=t._fullLayout._size;r.lx=l.l+l.w*e.x,r.ly=l.t+l.h*(1-e.y);var s="left";sa.isRightAnchor(e)&&(r.lx-=n,s="right"),sa.isCenterAnchor(e)&&(r.lx-=n/2,s="center");var f="top";sa.isBottomAnchor(e)&&(r.ly-=o,f="bottom"),sa.isMiddleAnchor(e)&&(r.ly-=o/2,f="middle"),r.totalWidth=Math.ceil(r.totalWidth),r.totalHeight=Math.ceil(r.totalHeight),r.lx=Math.round(r.lx),r.ly=Math.round(r.ly),ls.autoMargin(t,Sk(e),{x:e.x,y:e.y,l:n*({right:1,center:.5}[s]||0),r:n*({left:1,center:.5}[s]||0),b:o*({top:1,middle:.5}[f]||0),t:o*({bottom:1,middle:.5}[f]||0)})}function Sk(t){return dt.autoMarginIdRoot+t._index}function Lk(t,e,r,a){a=a||{};var i=t.select("."+dt.itemRectClassName),n=t.select("."+dt.itemTextClassName),o=e.borderwidth,l=r.index,s=e._dims;Fo.setTranslate(t,o+r.x,o+r.y);var f=["up","down"].indexOf(e.direction)!==-1,c=a.height||(f?s.heights[l]:s.height1);i.attr({x:0,y:0,width:a.width||(f?s.width1:s.widths[l]),height:c});var u=e.font.size*wk,v=Tc.lineCount(n),p=(v-1)*u/2;Tc.positionText(n,dt.textOffsetX,c/2-p+dt.textOffsetY),f?r.y+=s.heights[l]+r.yPad:r.x+=s.widths[l]+r.xPad,r.index++}function bh(t,e){t.attr(dt.menuIndexAttrName,e||"-1").selectAll("g."+dt.dropdownButtonClassName).remove()}var DN=am,PN={moduleType:"component",name:DN.name,layoutAttributes:bk,supplyLayoutDefaults:mN,draw:wN},ku={name:"sliders",containerClassName:"slider-container",groupClassName:"slider-group",inputAreaClass:"slider-input-area",railRectClass:"slider-rail-rect",railTouchRectClass:"slider-rail-touch-rect",gripRectClass:"slider-grip-rect",tickRectClass:"slider-tick-rect",inputProxyClass:"slider-input-proxy",labelsClass:"slider-labels",labelGroupClass:"slider-label-group",labelClass:"slider-label",currentValueClass:"slider-current-value",railHeight:5,menuIndexAttrName:"slider-active-index",autoMarginIdRoot:"slider-",minWidth:30,minHeight:30,textPadX:40,arrowOffsetX:4,railRadius:2,railWidth:5,railBorder:4,railBorderWidth:1,railBorderColor:"#bec8d9",railBgColor:"#f8fafc",railInset:8,stepInset:10,gripRadius:10,gripWidth:20,gripHeight:20,gripBorder:20,gripBorderWidth:1,gripBorderColor:"#bec8d9",gripBgColor:"#f6f8fa",gripBgActiveColor:"#dbdde0",labelPadding:8,labelOffset:0,tickWidth:1,tickColor:"#333",tickOffset:25,tickLength:7,minorTickOffset:25,minorTickColor:"#333",minorTickLength:4,currentValuePadding:8,currentValueInset:0},Fb=Mr,$N=Wh,EN=Xt.extendDeepAll,zN=Ja.overrideAll,RN=Gc,Ck=Ht.templatedArray,tn=ku,IN=Ck("step",{visible:{valType:"boolean",dflt:!0,description:["Determines whether or not this step is included in the slider."].join(" ")},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle",description:["Sets the Plotly method to be called when the slider value is changed.","If the `skip` method is used, the API slider will function as normal","but will perform no API calls and will not bind automatically to state","updates. This may be used to create a component interface and attach to","slider events manually via JavaScript."].join(" ")},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}],description:["Sets the arguments values to be passed to the Plotly","method set in `method` on slide."].join(" ")},label:{valType:"string",description:"Sets the text label to appear on the slider"},value:{valType:"string",description:["Sets the value of the slider step, used to refer to the step programatically.","Defaults to the slider label if not provided."].join(" ")},execute:{valType:"boolean",dflt:!0,description:["When true, the API method is executed. When false, all other behaviors are the same","and command execution is skipped. This may be useful when hooking into, for example,","the `plotly_sliderchange` method and executing the API command manually without losing","the benefit of the slider automatically binding to the state of the plot through the","specification of `method` and `args`."].join(" ")}}),Dk=zN(Ck("slider",{visible:{valType:"boolean",dflt:!0,description:["Determines whether or not the slider is visible."].join(" ")},active:{valType:"number",min:0,dflt:0,description:["Determines which button (by index starting from 0) is","considered active."].join(" ")},steps:IN,lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction",description:["Determines whether this slider length","is set in units of plot *fraction* or in *pixels.","Use `len` to set the value."].join(" ")},len:{valType:"number",min:0,dflt:1,description:["Sets the length of the slider","This measure excludes the padding of both ends.","That is, the slider's length is this length minus the","padding on both ends."].join(" ")},x:{valType:"number",min:-2,max:3,dflt:0,description:"Sets the x position (in normalized coordinates) of the slider."},pad:EN($N({editType:"arraydraw"}),{description:"Set the padding of the slider component along each side."},{t:{dflt:20}}),xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",description:["Sets the slider's horizontal position anchor.","This anchor binds the `x` position to the *left*, *center*","or *right* of the range selector."].join(" ")},y:{valType:"number",min:-2,max:3,dflt:0,description:"Sets the y position (in normalized coordinates) of the slider."},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top",description:["Sets the slider's vertical position anchor","This anchor binds the `y` position to the *top*, *middle*","or *bottom* of the range selector."].join(" ")},transition:{duration:{valType:"number",min:0,dflt:150,description:"Sets the duration of the slider transition"},easing:{valType:"enumerated",values:RN.transition.easing.values,dflt:"cubic-in-out",description:"Sets the easing function of the slider transition"}},currentvalue:{visible:{valType:"boolean",dflt:!0,description:["Shows the currently-selected value above the slider."].join(" ")},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left",description:["The alignment of the value readout relative to the length of the slider."].join(" ")},offset:{valType:"number",dflt:10,description:["The amount of space, in pixels, between the current value label","and the slider."].join(" ")},prefix:{valType:"string",description:"When currentvalue.visible is true, this sets the prefix of the label."},suffix:{valType:"string",description:"When currentvalue.visible is true, this sets the suffix of the label."},font:Fb({description:"Sets the font of the current value label text."})},font:Fb({description:"Sets the font of the slider step labels."}),activebgcolor:{valType:"color",dflt:tn.gripBgActiveColor,description:["Sets the background color of the slider grip","while dragging."].join(" ")},bgcolor:{valType:"color",dflt:tn.railBgColor,description:"Sets the background color of the slider."},bordercolor:{valType:"color",dflt:tn.railBorderColor,description:"Sets the color of the border enclosing the slider."},borderwidth:{valType:"number",min:0,dflt:tn.railBorderWidth,description:"Sets the width (in px) of the border enclosing the slider."},ticklen:{valType:"number",min:0,dflt:tn.tickLength,description:"Sets the length in pixels of step tick marks"},tickcolor:{valType:"color",dflt:tn.tickColor,description:"Sets the color of the border enclosing the slider."},tickwidth:{valType:"number",min:0,dflt:1,description:"Sets the tick width (in px)."},minorticklen:{valType:"number",min:0,dflt:tn.minorTickLength,description:"Sets the length in pixels of minor step tick marks"}}),"arraydraw","from-root"),fo=we,Pk=ri,$k=Dk,FN=ku,NN=FN.name,HN=$k.steps,ON=function(e,r){Pk(e,r,{name:NN,handleItemDefaults:jN})};function jN(t,e,r){function a(u,v){return fo.coerce(t,e,$k,u,v)}for(var i=Pk(t,e,{name:"steps",handleItemDefaults:BN}),n=0,o=0;o<i.length;o++)i[o].visible&&n++;var l;if(n<2?l=e.visible=!1:l=a("visible"),!!l){e._stepCount=n;var s=e._visibleSteps=fo.filterVisible(i),f=a("active");(i[f]||{}).visible||(e.active=s[0]._index),a("x"),a("y"),fo.noneOrAll(t,e,["x","y"]),a("xanchor"),a("yanchor"),a("len"),a("lenmode"),a("pad.t"),a("pad.r"),a("pad.b"),a("pad.l"),fo.coerceFont(a,"font",r.font);var c=a("currentvalue.visible");c&&(a("currentvalue.xanchor"),a("currentvalue.prefix"),a("currentvalue.suffix"),a("currentvalue.offset"),fo.coerceFont(a,"currentvalue.font",e.font)),a("transition.duration"),a("transition.easing"),a("bgcolor"),a("activebgcolor"),a("bordercolor"),a("borderwidth"),a("ticklen"),a("tickwidth"),a("tickcolor"),a("minorticklen")}}function BN(t,e){function r(n,o){return fo.coerce(t,e,HN,n,o)}var a;if(t.method!=="skip"&&!Array.isArray(t.args)?a=e.visible=!1:a=r("visible"),a){r("method"),r("args");var i=r("label","step-"+e._index);r("value",i),r("execute")}}var Ra=bt,kc=hr,Fi=yt,Ia=Et,fa=we,GN=fa.strTranslate,Nl=Tr,UN=Ht.arrayEditor,_t=ku,nm=Vr,Ek=nm.LINE_SPACING,Qv=nm.FROM_TL,Jv=nm.FROM_BR,VN=function(e){var r=e._context.staticPlot,a=e._fullLayout,i=WN(a,e),n=a._infolayer.selectAll("g."+_t.containerClassName).data(i.length>0?[0]:[]);n.enter().append("g").classed(_t.containerClassName,!0).style("cursor",r?null:"ew-resize");function o(c){c._commandObserver&&(c._commandObserver.remove(),delete c._commandObserver),kc.autoMargin(e,zk(c))}if(n.exit().each(function(){Ra.select(this).selectAll("g."+_t.groupClassName).each(o)}).remove(),i.length!==0){var l=n.selectAll("g."+_t.groupClassName).data(i,XN);l.enter().append("g").classed(_t.groupClassName,!0),l.exit().each(o).remove();for(var s=0;s<i.length;s++){var f=i[s];YN(e,f)}l.each(function(c){var u=Ra.select(this);JN(c),kc.manageCommandObserver(e,c,c._visibleSteps,function(v){var p=u.data()[0];p.active!==v.index&&(p._dragging||Ik(e,u,p,v.index,!1,!0))}),qN(e,Ra.select(this),c)})}};function zk(t){return _t.autoMarginIdRoot+t._index}function WN(t,e){for(var r=t[_t.name],a=[],i=0;i<r.length;i++){var n=r[i];n.visible&&(n._gd=e,a.push(n))}return a}function XN(t){return t._index}function YN(t,e){var r=Ia.tester.selectAll("g."+_t.labelGroupClass).data(e._visibleSteps);r.enter().append("g").classed(_t.labelGroupClass,!0);var a=0,i=0;r.each(function(d){var h=Ra.select(this),m=Rk(h,{step:d},e),y=m.node();if(y){var b=Ia.bBox(y);i=Math.max(i,b.height),a=Math.max(a,b.width)}}),r.remove();var n=e._dims={};n.inputAreaWidth=Math.max(_t.railWidth,_t.gripHeight);var o=t._fullLayout._size;n.lx=o.l+o.w*e.x,n.ly=o.t+o.h*(1-e.y),e.lenmode==="fraction"?n.outerLength=Math.round(o.w*e.len):n.outerLength=e.len,n.inputAreaStart=0,n.inputAreaLength=Math.round(n.outerLength-e.pad.l-e.pad.r);var l=n.inputAreaLength-2*_t.stepInset,s=l/(e._stepCount-1),f=a+_t.labelPadding;if(n.labelStride=Math.max(1,Math.ceil(f/s)),n.labelHeight=i,n.currentValueMaxWidth=0,n.currentValueHeight=0,n.currentValueTotalHeight=0,n.currentValueMaxLines=1,e.currentvalue.visible){var c=Ia.tester.append("g");r.each(function(d){var h=Ac(c,e,d.label),m=h.node()&&Ia.bBox(h.node())||{width:0,height:0},y=Nl.lineCount(h);n.currentValueMaxWidth=Math.max(n.currentValueMaxWidth,Math.ceil(m.width)),n.currentValueHeight=Math.max(n.currentValueHeight,Math.ceil(m.height)),n.currentValueMaxLines=Math.max(n.currentValueMaxLines,y)}),n.currentValueTotalHeight=n.currentValueHeight+e.currentvalue.offset,c.remove()}n.height=n.currentValueTotalHeight+_t.tickOffset+e.ticklen+_t.labelOffset+n.labelHeight+e.pad.t+e.pad.b;var u="left";fa.isRightAnchor(e)&&(n.lx-=n.outerLength,u="right"),fa.isCenterAnchor(e)&&(n.lx-=n.outerLength/2,u="center");var v="top";fa.isBottomAnchor(e)&&(n.ly-=n.height,v="bottom"),fa.isMiddleAnchor(e)&&(n.ly-=n.height/2,v="middle"),n.outerLength=Math.ceil(n.outerLength),n.height=Math.ceil(n.height),n.lx=Math.round(n.lx),n.ly=Math.round(n.ly);var p={y:e.y,b:n.height*Jv[v],t:n.height*Qv[v]};e.lenmode==="fraction"?(p.l=0,p.xl=e.x-e.len*Qv[u],p.r=0,p.xr=e.x+e.len*Jv[u]):(p.x=e.x,p.l=n.outerLength*Qv[u],p.r=n.outerLength*Jv[u]),kc.autoMargin(t,zk(e),p)}function qN(t,e,r){(r.steps[r.active]||{}).visible||(r.active=r._visibleSteps[0]._index),e.call(Ac,r).call(t4,r).call(KN,r).call(QN,r).call(e4,t,r).call(ZN,t,r);var a=r._dims;Ia.setTranslate(e,a.lx+r.pad.l,a.ly+r.pad.t),e.call(Nk,r,!1),e.call(Ac,r)}function Ac(t,e,r){if(e.currentvalue.visible){var a=e._dims,i,n;switch(e.currentvalue.xanchor){case"right":i=a.inputAreaLength-_t.currentValueInset-a.currentValueMaxWidth,n="left";break;case"center":i=a.inputAreaLength*.5,n="middle";break;default:i=_t.currentValueInset,n="left"}var o=fa.ensureSingle(t,"text",_t.labelClass,function(v){v.attr({"text-anchor":n,"data-notex":1})}),l=e.currentvalue.prefix?e.currentvalue.prefix:"";if(typeof r=="string")l+=r;else{var s=e.steps[e.active].label,f=e._gd._fullLayout._meta;f&&(s=fa.templateString(s,f)),l+=s}e.currentvalue.suffix&&(l+=e.currentvalue.suffix),o.call(Ia.font,e.currentvalue.font).text(l).call(Nl.convertToTspans,e._gd);var c=Nl.lineCount(o),u=(a.currentValueMaxLines+1-c)*e.currentvalue.font.size*Ek;return Nl.positionText(o,i,u),o}}function ZN(t,e,r){var a=fa.ensureSingle(t,"rect",_t.gripRectClass,function(i){i.call(Fk,e,t,r).style("pointer-events","all")});a.attr({width:_t.gripWidth,height:_t.gripHeight,rx:_t.gripRadius,ry:_t.gripRadius}).call(Fi.stroke,r.bordercolor).call(Fi.fill,r.bgcolor).style("stroke-width",r.borderwidth+"px")}function Rk(t,e,r){var a=fa.ensureSingle(t,"text",_t.labelClass,function(o){o.attr({"text-anchor":"middle","data-notex":1})}),i=e.step.label,n=r._gd._fullLayout._meta;return n&&(i=fa.templateString(i,n)),a.call(Ia.font,r.font).text(i).call(Nl.convertToTspans,r._gd),a}function KN(t,e){var r=fa.ensureSingle(t,"g",_t.labelsClass),a=e._dims,i=r.selectAll("g."+_t.labelGroupClass).data(a.labelSteps);i.enter().append("g").classed(_t.labelGroupClass,!0),i.exit().remove(),i.each(function(n){var o=Ra.select(this);o.call(Rk,n,e),Ia.setTranslate(o,om(e,n.fraction),_t.tickOffset+e.ticklen+e.font.size*Ek+_t.labelOffset+a.currentValueTotalHeight)})}function Nb(t,e,r,a,i){var n=Math.round(a*(r._stepCount-1)),o=r._visibleSteps[n]._index;o!==r.active&&Ik(t,e,r,o,!0,i)}function Ik(t,e,r,a,i,n){var o=r.active;r.active=a,UN(t.layout,_t.name,r).applyUpdate("active",a);var l=r.steps[r.active];e.call(Nk,r,n),e.call(Ac,r),t.emit("plotly_sliderchange",{slider:r,step:r.steps[r.active],interaction:i,previousActive:o}),l&&l.method&&i&&(e._nextMethod?(e._nextMethod.step=l,e._nextMethod.doCallback=i,e._nextMethod.doTransition=n):(e._nextMethod={step:l,doCallback:i,doTransition:n},e._nextMethodRaf=window.requestAnimationFrame(function(){var s=e._nextMethod.step;s.method&&(s.execute&&kc.executeAPICommand(t,s.method,s.args),e._nextMethod=null,e._nextMethodRaf=null)})))}function Fk(t,e,r){if(e._context.staticPlot)return;var a=r.node(),i=Ra.select(e);function n(){return r.data()[0]}function o(){var l=n();e.emit("plotly_sliderstart",{slider:l});var s=r.select("."+_t.gripRectClass);Ra.event.stopPropagation(),Ra.event.preventDefault(),s.call(Fi.fill,l.activebgcolor);var f=Hb(l,Ra.mouse(a)[0]);Nb(e,r,l,f,!0),l._dragging=!0;function c(){var v=n(),p=Hb(v,Ra.mouse(a)[0]);Nb(e,r,v,p,!1)}i.on("mousemove",c),i.on("touchmove",c);function u(){var v=n();v._dragging=!1,s.call(Fi.fill,v.bgcolor),i.on("mouseup",null),i.on("mousemove",null),i.on("touchend",null),i.on("touchmove",null),e.emit("plotly_sliderend",{slider:v,step:v.steps[v.active]})}i.on("mouseup",u),i.on("touchend",u)}t.on("mousedown",o),t.on("touchstart",o)}function QN(t,e){var r=t.selectAll("rect."+_t.tickRectClass).data(e._visibleSteps),a=e._dims;r.enter().append("rect").classed(_t.tickRectClass,!0),r.exit().remove(),r.attr({width:e.tickwidth+"px","shape-rendering":"crispEdges"}),r.each(function(i,n){var o=n%a.labelStride===0,l=Ra.select(this);l.attr({height:o?e.ticklen:e.minorticklen}).call(Fi.fill,e.tickcolor),Ia.setTranslate(l,om(e,n/(e._stepCount-1))-.5*e.tickwidth,(o?_t.tickOffset:_t.minorTickOffset)+a.currentValueTotalHeight)})}function JN(t){var e=t._dims;e.labelSteps=[];for(var r=t._stepCount,a=0;a<r;a+=e.labelStride)e.labelSteps.push({fraction:a/(r-1),step:t._visibleSteps[a]})}function Nk(t,e,r){for(var a=t.select("rect."+_t.gripRectClass),i=0,n=0;n<e._stepCount;n++)if(e._visibleSteps[n]._index===e.active){i=n;break}var o=om(e,i/(e._stepCount-1));if(!e._invokingCommand){var l=a;r&&e.transition.duration>0&&(l=l.transition().duration(e.transition.duration).ease(e.transition.easing)),l.attr("transform",GN(o-_t.gripWidth*.5,e._dims.currentValueTotalHeight))}}function om(t,e){var r=t._dims;return r.inputAreaStart+_t.stepInset+(r.inputAreaLength-2*_t.stepInset)*Math.min(1,Math.max(0,e))}function Hb(t,e){var r=t._dims;return Math.min(1,Math.max(0,(e-_t.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*_t.stepInset-2*r.inputAreaStart)))}function e4(t,e,r){var a=r._dims,i=fa.ensureSingle(t,"rect",_t.railTouchRectClass,function(n){n.call(Fk,e,t,r).style("pointer-events","all")});i.attr({width:a.inputAreaLength,height:Math.max(a.inputAreaWidth,_t.tickOffset+r.ticklen+a.labelHeight)}).call(Fi.fill,r.bgcolor).attr("opacity",0),Ia.setTranslate(i,0,a.currentValueTotalHeight)}function t4(t,e){var r=e._dims,a=r.inputAreaLength-_t.railInset*2,i=fa.ensureSingle(t,"rect",_t.railRectClass);i.attr({width:a,height:_t.railWidth,rx:_t.railRadius,ry:_t.railRadius,"shape-rendering":"crispEdges"}).call(Fi.stroke,e.bordercolor).call(Fi.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),Ia.setTranslate(i,_t.railInset,(r.inputAreaWidth-_t.railWidth)*.5+r.currentValueTotalHeight)}var r4=ku,a4={moduleType:"component",name:r4.name,layoutAttributes:Dk,supplyLayoutDefaults:ON,draw:VN},Ob=Or,lm={bgcolor:{valType:"color",dflt:Ob.background,editType:"plot",description:"Sets the background color of the range slider."},bordercolor:{valType:"color",dflt:Ob.defaultLine,editType:"plot",description:"Sets the border color of the range slider."},borderwidth:{valType:"integer",dflt:0,min:0,editType:"plot",description:"Sets the border width of the range slider."},autorange:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"range[0]":void 0,"range[1]":void 0},description:["Determines whether or not the range slider range is","computed in relation to the input data.","If `range` is provided, then `autorange` is set to *false*."].join(" ")},range:{valType:"info_array",items:[{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}}],editType:"calc",impliedEdits:{autorange:!1},description:["Sets the range of the range slider.","If not set, defaults to the full xaxis range.","If the axis `type` is *log*, then you must take the","log of your desired range.","If the axis `type` is *date*, it should be date strings,","like date data, though Date objects and unix milliseconds","will be accepted and converted to strings.","If the axis `type` is *category*, it should be numbers,","using the scale where each category is assigned a serial","number from zero in the order it appears."].join(" ")},thickness:{valType:"number",dflt:.15,min:0,max:1,editType:"plot",description:["The height of the range slider as a fraction of the","total plot area height."].join(" ")},visible:{valType:"boolean",dflt:!0,editType:"calc",description:["Determines whether or not the range slider will be visible.","If visible, perpendicular axes will be set to `fixedrange`"].join(" ")},editType:"calc"},Hk={_isSubplotObj:!0,rangemode:{valType:"enumerated",values:["auto","fixed","match"],dflt:"match",editType:"calc",description:["Determines whether or not the range of this axis in","the rangeslider use the same value than in the main plot","when zooming in/out.","If *auto*, the autorange will be used.","If *fixed*, the `range` is used.","If *match*, the current range of the corresponding y-axis on the main subplot is used."].join(" ")},range:{valType:"info_array",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot",description:["Sets the range of this axis for the rangeslider."].join(" ")},editType:"calc"},Au={},sm={name:"rangeslider",containerClassName:"rangeslider-container",bgClassName:"rangeslider-bg",rangePlotClassName:"rangeslider-rangeplot",maskMinClassName:"rangeslider-mask-min",maskMaxClassName:"rangeslider-mask-max",slideBoxClassName:"rangeslider-slidebox",grabberMinClassName:"rangeslider-grabber-min",grabAreaMinClassName:"rangeslider-grabarea-min",handleMinClassName:"rangeslider-handle-min",grabberMaxClassName:"rangeslider-grabber-max",grabAreaMaxClassName:"rangeslider-grabarea-max",handleMaxClassName:"rangeslider-handle-max",maskMinOppAxisClassName:"rangeslider-mask-min-opp-axis",maskMaxOppAxisClassName:"rangeslider-mask-max-opp-axis",maskColor:"rgba(0,0,0,0.4)",maskOppAxisColor:"rgba(0,0,0,0.2)",slideBoxFill:"transparent",slideBoxCursor:"ew-resize",grabAreaFill:"transparent",grabAreaCursor:"col-resize",grabAreaWidth:10,handleWidth:4,handleRadius:1,handleStrokeWidth:1,extraPad:15},i4=cr,n4=Tr,Ok=sm,o4=Vr.LINE_SPACING,Mc=Ok.name;function jk(t){var e=t&&t[Mc];return e&&e.visible}Au.isVisible=jk;Au.makeData=function(t){for(var e=i4.list({_fullLayout:t},"x",!0),r=t.margin,a=[],i=0;i<e.length;i++){var n=e[i];if(jk(n)){a.push(n);var o=n[Mc];o._id=Mc+n._id,o._height=(t.height-r.b-r.t)*o.thickness,o._offsetShift=Math.floor(o.borderwidth/2)}}t._rangeSliderData=a};Au.autoMarginOpts=function(t,e){var r=t._fullLayout,a=e[Mc],i=e._id.charAt(0),n=0,o=0;if(e.side==="bottom"&&(n=e._depth,e.title.text!==r._dfltTitle[i])){o=1.5*e.title.font.size+10+a._offsetShift;var l=(e.title.text.match(n4.BR_TAG_ALL)||[]).length;o+=l*e.title.font.size*o4}return{x:0,y:e._counterDomainMin,l:0,r:0,t:0,b:a._height+n+Math.max(r.margin.b,o),pad:Ok.extraPad+a._offsetShift*2}};var ed,jb;function l4(){if(jb)return ed;jb=1;var t=we,e=Ht,r=cr,a=lm,i=Hk;return ed=function(o,l,s){var f=o[s],c=l[s];if(!(f.rangeslider||l._requestRangeslider[c._id]))return;t.isPlainObject(f.rangeslider)||(f.rangeslider={});var u=f.rangeslider,v=e.newContainer(c,"rangeslider");function p(S,L){return t.coerce(u,v,a,S,L)}var d,h;function m(S,L){return t.coerce(d,h,i,S,L)}var y=p("visible");if(y){p("bgcolor",l.plot_bgcolor),p("bordercolor"),p("borderwidth"),p("thickness"),p("autorange",!c.isValidRange(u.range)),p("range");var b=l._subplots;if(b)for(var _=b.cartesian.filter(function(S){return S.substr(0,S.indexOf("y"))===r.name2id(s)}).map(function(S){return S.substr(S.indexOf("y"),S.length)}),g=t.simpleMap(_,r.id2name),x=0;x<g.length;x++){var w=g[x];d=u[w]||{},h=e.newContainer(v,w,"yaxis");var T=l[w],A;d.range&&T.isValidRange(d.range)&&(A="fixed");var M=m("rangemode",A);M!=="match"&&m("range",T.range.slice())}v._input=u}},ed}var td,Bb;function s4(){if(Bb)return td;Bb=1;var t=cr.list,e=bs.getAutoRange,r=sm;return td=function(i){for(var n=t(i,"x",!0),o=0;o<n.length;o++){var l=n[o],s=l[r.name];s&&s.visible&&s.autorange&&(s._input.autorange=!0,s._input.range=s.range=e(i,l))}},td}var rd,Gb;function f4(){if(Gb)return rd;Gb=1;var t=bt,e=ot,r=hr,a=we,i=a.strTranslate,n=Et,o=yt,l=Jc,s=pr,f=cr,c=ai,u=Bi,v=sm;rd=function(A){for(var M=A._fullLayout,S=M._rangeSliderData,L=0;L<S.length;L++){var E=S[L][v.name];E._clipId=E._id+"-"+M._uid}function F(z){return z._name}var N=M._infolayer.selectAll("g."+v.containerClassName).data(S,F);N.exit().each(function(z){var H=z[v.name];M._topdefs.select("#"+H._clipId).remove()}).remove(),S.length!==0&&(N.enter().append("g").classed(v.containerClassName,!0).attr("pointer-events","all"),N.each(function(z){var H=t.select(this),D=z[v.name],P=M[f.id2name(z.anchor)],k=D[f.id2name(z.anchor)];if(D.range){var C=a.simpleMap(D.range,z.r2l),$=a.simpleMap(z.range,z.r2l),R;$[0]<$[1]?R=[Math.min(C[0],$[0]),Math.max(C[1],$[1])]:R=[Math.max(C[0],$[0]),Math.min(C[1],$[1])],D.range=D._input.range=a.simpleMap(R,z.l2r)}z.cleanRange("rangeslider.range");var j=M._size,G=z.domain;D._width=j.w*(G[1]-G[0]);var Y=Math.round(j.l+j.w*G[0]),O=Math.round(j.t+j.h*(1-z._counterDomainMin)+(z.side==="bottom"?z._depth:0)+D._offsetShift+v.extraPad);H.attr("transform",i(Y,O)),D._rl=a.simpleMap(D.range,z.r2l);var K=D._rl[0],W=D._rl[1],X=W-K;if(D.p2d=function(ye){return ye/D._width*X+K},D.d2p=function(ye){return(ye-K)/X*D._width},z.rangebreaks){var B=z.locateBreaks(K,W);if(B.length){var ee,ae,de=0;for(ee=0;ee<B.length;ee++)ae=B[ee],de+=ae.max-ae.min;var fe=D._width/(W-K-de),q=[-fe*K];for(ee=0;ee<B.length;ee++)ae=B[ee],q.push(q[q.length-1]-fe*(ae.max-ae.min));for(D.d2p=function(ye){for(var ue=q[0],oe=0;oe<B.length;oe++){var pe=B[oe];if(ye>=pe.max)ue=q[oe+1];else if(ye<pe.min)break}return ue+fe*ye},ee=0;ee<B.length;ee++)ae=B[ee],ae.pmin=D.d2p(ae.min),ae.pmax=D.d2p(ae.max);D.p2d=function(ye){for(var ue=q[0],oe=0;oe<B.length;oe++){var pe=B[oe];if(ye>=pe.pmax)ue=q[oe+1];else if(ye<pe.pmin)break}return(ye-ue)/fe}}}if(k.rangemode!=="match"){var te=P.r2l(k.range[0]),le=P.r2l(k.range[1]),ce=le-te;D.d2pOppAxis=function(ye){return(ye-te)/ce*D._height}}H.call(y,A,z,D).call(b,A,z,D).call(_,A,z,D).call(x,A,z,D,k).call(w,A,z,D).call(T,A,z,D),d(H,A,z,D),m(H,A,z,D,P,k),z.side==="bottom"&&l.draw(A,z._id+"title",{propContainer:z,propName:z._name+".title",placeholder:M._dfltTitle.x,attributes:{x:z._offset+z._length/2,y:O+D._height+D._offsetShift+10+1.5*z.title.font.size,"text-anchor":"middle"}})}))};function p(A){return typeof A.clientX=="number"?A.clientX:A.touches&&A.touches.length>0?A.touches[0].clientX:0}function d(A,M,S,L){if(M._context.staticPlot)return;var E=A.select("rect."+v.slideBoxClassName).node(),F=A.select("rect."+v.grabAreaMinClassName).node(),N=A.select("rect."+v.grabAreaMaxClassName).node();function z(){var H=t.event,D=H.target,P=p(H),k=P-A.node().getBoundingClientRect().left,C=L.d2p(S._rl[0]),$=L.d2p(S._rl[1]),R=c.coverSlip();this.addEventListener("touchmove",j),this.addEventListener("touchend",G),R.addEventListener("mousemove",j),R.addEventListener("mouseup",G);function j(Y){var O=p(Y),K=+O-P,W,X,B;switch(D){case E:if(B="ew-resize",C+K>S._length||$+K<0)return;W=C+K,X=$+K;break;case F:if(B="col-resize",C+K>S._length)return;W=C+K,X=$;break;case N:if(B="col-resize",$+K<0)return;W=C,X=$+K;break;default:B="ew-resize",W=k,X=k+K;break}if(X<W){var ee=X;X=W,W=ee}L._pixelMin=W,L._pixelMax=X,u(t.select(R),B),h(A,M,S,L)}function G(){R.removeEventListener("mousemove",j),R.removeEventListener("mouseup",G),this.removeEventListener("touchmove",j),this.removeEventListener("touchend",G),a.removeElement(R)}}A.on("mousedown",z),A.on("touchstart",z)}function h(A,M,S,L){function E(z){return S.l2r(a.constrain(z,L._rl[0],L._rl[1]))}var F=E(L.p2d(L._pixelMin)),N=E(L.p2d(L._pixelMax));window.requestAnimationFrame(function(){e.call("_guiRelayout",M,S._name+".range",[F,N])})}function m(A,M,S,L,E,F){var N=v.handleWidth/2;function z(Y){return a.constrain(Y,0,L._width)}function H(Y){return a.constrain(Y,0,L._height)}function D(Y){return a.constrain(Y,-N,L._width+N)}var P=z(L.d2p(S._rl[0])),k=z(L.d2p(S._rl[1]));if(A.select("rect."+v.slideBoxClassName).attr("x",P).attr("width",k-P),A.select("rect."+v.maskMinClassName).attr("width",P),A.select("rect."+v.maskMaxClassName).attr("x",k).attr("width",L._width-k),F.rangemode!=="match"){var C=L._height-H(L.d2pOppAxis(E._rl[1])),$=L._height-H(L.d2pOppAxis(E._rl[0]));A.select("rect."+v.maskMinOppAxisClassName).attr("x",P).attr("height",C).attr("width",k-P),A.select("rect."+v.maskMaxOppAxisClassName).attr("x",P).attr("y",$).attr("height",L._height-$).attr("width",k-P),A.select("rect."+v.slideBoxClassName).attr("y",C).attr("height",$-C)}var R=.5,j=Math.round(D(P-N))-R,G=Math.round(D(k-N))+R;A.select("g."+v.grabberMinClassName).attr("transform",i(j,R)),A.select("g."+v.grabberMaxClassName).attr("transform",i(G,R))}function y(A,M,S,L){var E=a.ensureSingle(A,"rect",v.bgClassName,function(H){H.attr({x:0,y:0,"shape-rendering":"crispEdges"})}),F=L.borderwidth%2===0?L.borderwidth:L.borderwidth-1,N=-L._offsetShift,z=n.crispRound(M,L.borderwidth);E.attr({width:L._width+F,height:L._height+F,transform:i(N,N),"stroke-width":z}).call(o.stroke,L.bordercolor).call(o.fill,L.bgcolor)}function b(A,M,S,L){var E=M._fullLayout,F=a.ensureSingleById(E._topdefs,"clipPath",L._clipId,function(N){N.append("rect").attr({x:0,y:0})});F.select("rect").attr({width:L._width,height:L._height})}function _(A,M,S,L){var E=M.calcdata,F=A.selectAll("g."+v.rangePlotClassName).data(S._subplotsWith,a.identity);F.enter().append("g").attr("class",function(z){return v.rangePlotClassName+" "+z}).call(n.setClipUrl,L._clipId,M),F.order(),F.exit().remove();var N;F.each(function(z,H){var D=t.select(this),P=H===0,k=f.getFromId(M,z,"y"),C=k._name,$=L[C],R={data:[],layout:{xaxis:{type:S.type,domain:[0,1],range:L.range.slice(),calendar:S.calendar},width:L._width,height:L._height,margin:{t:0,b:0,l:0,r:0}},_context:M._context};S.rangebreaks&&(R.layout.xaxis.rangebreaks=S.rangebreaks),R.layout[C]={type:k.type,domain:[0,1],range:$.rangemode!=="match"?$.range.slice():k.range.slice(),calendar:k.calendar},k.rangebreaks&&(R.layout[C].rangebreaks=k.rangebreaks),r.supplyDefaults(R);var j=R._fullLayout.xaxis,G=R._fullLayout[C];j.clearCalc(),j.setScale(),G.clearCalc(),G.setScale();var Y={id:z,plotgroup:D,xaxis:j,yaxis:G,isRangePlot:!0};P?N=Y:(Y.mainplot="xy",Y.mainplotinfo=N),s.rangePlot(M,Y,g(E,z))})}function g(A,M){for(var S=[],L=0;L<A.length;L++){var E=A[L],F=E[0].trace;F.xaxis+F.yaxis===M&&S.push(E)}return S}function x(A,M,S,L,E){var F=a.ensureSingle(A,"rect",v.maskMinClassName,function(D){D.attr({x:0,y:0,"shape-rendering":"crispEdges"})});F.attr("height",L._height).call(o.fill,v.maskColor);var N=a.ensureSingle(A,"rect",v.maskMaxClassName,function(D){D.attr({y:0,"shape-rendering":"crispEdges"})});if(N.attr("height",L._height).call(o.fill,v.maskColor),E.rangemode!=="match"){var z=a.ensureSingle(A,"rect",v.maskMinOppAxisClassName,function(D){D.attr({y:0,"shape-rendering":"crispEdges"})});z.attr("width",L._width).call(o.fill,v.maskOppAxisColor);var H=a.ensureSingle(A,"rect",v.maskMaxOppAxisClassName,function(D){D.attr({y:0,"shape-rendering":"crispEdges"})});H.attr("width",L._width).style("border-top",v.maskOppBorder).call(o.fill,v.maskOppAxisColor)}}function w(A,M,S,L){if(!M._context.staticPlot){var E=a.ensureSingle(A,"rect",v.slideBoxClassName,function(F){F.attr({y:0,cursor:v.slideBoxCursor,"shape-rendering":"crispEdges"})});E.attr({height:L._height,fill:v.slideBoxFill})}}function T(A,M,S,L){var E=a.ensureSingle(A,"g",v.grabberMinClassName),F=a.ensureSingle(A,"g",v.grabberMaxClassName),N={x:0,width:v.handleWidth,rx:v.handleRadius,fill:o.background,stroke:o.defaultLine,"stroke-width":v.handleStrokeWidth,"shape-rendering":"crispEdges"},z={y:Math.round(L._height/4),height:Math.round(L._height/2)},H=a.ensureSingle(E,"rect",v.handleMinClassName,function($){$.attr(N)});H.attr(z);var D=a.ensureSingle(F,"rect",v.handleMaxClassName,function($){$.attr(N)});D.attr(z);var P={width:v.grabAreaWidth,x:0,y:0,fill:v.grabAreaFill,cursor:M._context.staticPlot?void 0:v.grabAreaCursor},k=a.ensureSingle(E,"rect",v.grabAreaMinClassName,function($){$.attr(P)});k.attr("height",L._height);var C=a.ensureSingle(F,"rect",v.grabAreaMaxClassName,function($){$.attr(P)});C.attr("height",L._height)}return rd}var c4=we,u4=lm,v4=Hk,ad=Au,d4={moduleType:"component",name:"rangeslider",schema:{subplots:{xaxis:{rangeslider:c4.extendFlat({},u4,{yaxis:v4})}}},layoutAttributes:lm,handleDefaults:l4(),calcAutorange:s4(),draw:f4(),isVisible:ad.isVisible,makeData:ad.makeData,autoMarginOpts:ad.autoMarginOpts},h4=Mr,Ub=Or,p4=Ht.templatedArray,m4=p4("button",{visible:{valType:"boolean",dflt:!0,editType:"plot",description:"Determines whether or not this button is visible."},step:{valType:"enumerated",values:["month","year","day","hour","minute","second","all"],dflt:"month",editType:"plot",description:["The unit of measurement that the `count` value will set the range by."].join(" ")},stepmode:{valType:"enumerated",values:["backward","todate"],dflt:"backward",editType:"plot",description:["Sets the range update mode.","If *backward*, the range update shifts the start of range","back *count* times *step* milliseconds.","If *todate*, the range update shifts the start of range","back to the first timestamp from *count* times","*step* milliseconds back.","For example, with `step` set to *year* and `count` set to *1*","the range update shifts the start of the range back to","January 01 of the current year.","Month and year *todate* are currently available only","for the built-in (Gregorian) calendar."].join(" ")},count:{valType:"number",min:0,dflt:1,editType:"plot",description:["Sets the number of steps to take to update the range.","Use with `step` to specify the update interval."].join(" ")},label:{valType:"string",editType:"plot",description:"Sets the text label to appear on the button."},editType:"plot",description:["Sets the specifications for each buttons.","By default, a range selector comes with no buttons."].join(" ")}),xh={visible:{valType:"boolean",editType:"plot",description:["Determines whether or not this range selector is visible.","Note that range selectors are only available for x axes of","`type` set to or auto-typed to *date*."].join(" ")},buttons:m4,x:{valType:"number",min:-2,max:3,editType:"plot",description:"Sets the x position (in normalized coordinates) of the range selector."},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"plot",description:["Sets the range selector's horizontal position anchor.","This anchor binds the `x` position to the *left*, *center*","or *right* of the range selector."].join(" ")},y:{valType:"number",min:-2,max:3,editType:"plot",description:"Sets the y position (in normalized coordinates) of the range selector."},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"bottom",editType:"plot",description:["Sets the range selector's vertical position anchor","This anchor binds the `y` position to the *top*, *middle*","or *bottom* of the range selector."].join(" ")},font:h4({editType:"plot",description:"Sets the font of the range selector button text."}),bgcolor:{valType:"color",dflt:Ub.lightLine,editType:"plot",description:"Sets the background color of the range selector buttons."},activecolor:{valType:"color",editType:"plot",description:"Sets the background color of the active range selector button."},bordercolor:{valType:"color",dflt:Ub.defaultLine,editType:"plot",description:"Sets the color of the border enclosing the range selector."},borderwidth:{valType:"number",min:0,dflt:0,editType:"plot",description:"Sets the width (in px) of the border enclosing the range selector."},editType:"plot"},Bk={yPad:.02,minButtonWidth:30,rx:3,ry:3,lightAmount:25,darkAmount:10},Wf=we,y4=yt,g4=Ht,b4=ri,Gk=xh,_h=Bk,x4=function(e,r,a,i,n){var o=e.rangeselector||{},l=g4.newContainer(r,"rangeselector");function s(p,d){return Wf.coerce(o,l,Gk,p,d)}var f=b4(o,l,{name:"buttons",handleItemDefaults:_4,calendar:n}),c=s("visible",f.length>0);if(c){var u=w4(r,a,i);s("x",u[0]),s("y",u[1]),Wf.noneOrAll(e,r,["x","y"]),s("xanchor"),s("yanchor"),Wf.coerceFont(s,"font",a.font);var v=s("bgcolor");s("activecolor",y4.contrast(v,_h.lightAmount,_h.darkAmount)),s("bordercolor"),s("borderwidth")}};function _4(t,e,r,a){var i=a.calendar;function n(s,f){return Wf.coerce(t,e,Gk.buttons,s,f)}var o=n("visible");if(o){var l=n("step");l!=="all"&&(i&&i!=="gregorian"&&(l==="month"||l==="year")?e.stepmode="backward":n("stepmode"),n("count")),n("label")}}function w4(t,e,r){for(var a=r.filter(function(l){return e[l].anchor===t._id}),i=0,n=0;n<a.length;n++){var o=e[a[n]].domain;o&&(i=Math.max(o[1],i))}return[t.domain[0],i+_h.yPad]}var T4=$M,k4=we.titleCase,A4=function(e,r){var a=e._name,i={};if(r.step==="all")i[a+".autorange"]=!0;else{var n=M4(e,r);i[a+".range[0]"]=n[0],i[a+".range[1]"]=n[1]}return i};function M4(t,e){var r=t.range,a=new Date(t.r2l(r[1])),i=e.step,n=T4["utc"+k4(i)],o=e.count,l;switch(e.stepmode){case"backward":l=t.l2r(+n.offset(a,-o));break;case"todate":var s=n.offset(a,-o);l=t.l2r(+n.ceil(s));break}var f=r[1];return[l,f]}var Sc=bt,S4=ot,L4=hr,Vb=yt,Uk=Et,ui=we,Wb=ui.strTranslate,Xf=Tr,C4=cr,fm=Vr,Xb=fm.LINE_SPACING,Yb=fm.FROM_TL,qb=fm.FROM_BR,wh=Bk,D4=A4,P4=function(e){var r=e._fullLayout,a=r._infolayer.selectAll(".rangeselector").data($4(e),E4);a.enter().append("g").classed("rangeselector",!0),a.exit().remove(),a.style({cursor:"pointer","pointer-events":"all"}),a.each(function(i){var n=Sc.select(this),o=i,l=o.rangeselector,s=n.selectAll("g.button").data(ui.filterVisible(l.buttons));s.enter().append("g").classed("button",!0),s.exit().remove(),s.each(function(f){var c=Sc.select(this),u=D4(o,f);f._isActive=z4(o,f,u),c.call(id,l,f),c.call(I4,l,f,e),c.on("click",function(){e._dragged||S4.call("_guiRelayout",e,u)}),c.on("mouseover",function(){f._isHovered=!0,c.call(id,l,f)}),c.on("mouseout",function(){f._isHovered=!1,c.call(id,l,f)})}),N4(e,s,l,o._name,n)})};function $4(t){for(var e=C4.list(t,"x",!0),r=[],a=0;a<e.length;a++){var i=e[a];i.rangeselector&&i.rangeselector.visible&&r.push(i)}return r}function E4(t){return t._id}function z4(t,e,r){if(e.step==="all")return t.autorange===!0;var a=Object.keys(r);return t.range[0]===r[a[0]]&&t.range[1]===r[a[1]]}function id(t,e,r){var a=ui.ensureSingle(t,"rect","selector-rect",function(i){i.attr("shape-rendering","crispEdges")});a.attr({rx:wh.rx,ry:wh.ry}),a.call(Vb.stroke,e.bordercolor).call(Vb.fill,R4(e,r)).style("stroke-width",e.borderwidth+"px")}function R4(t,e){return e._isActive||e._isHovered?t.activecolor:t.bgcolor}function I4(t,e,r,a){function i(o){Xf.convertToTspans(o,a)}var n=ui.ensureSingle(t,"text","selector-text",function(o){o.attr("text-anchor","middle")});n.call(Uk.font,e.font).text(F4(r,a._fullLayout._meta)).call(i)}function F4(t,e){return t.label?e?ui.templateString(t.label,e):t.label:t.step==="all"?"all":t.count+t.step.charAt(0)}function N4(t,e,r,a,i){var n=0,o=0,l=r.borderwidth;e.each(function(){var p=Sc.select(this),d=p.select(".selector-text"),h=r.font.size*Xb,m=Math.max(h*Xf.lineCount(d),16)+3;o=Math.max(o,m)}),e.each(function(){var p=Sc.select(this),d=p.select(".selector-rect"),h=p.select(".selector-text"),m=h.node()&&Uk.bBox(h.node()).width,y=r.font.size*Xb,b=Xf.lineCount(h),_=Math.max(m+10,wh.minButtonWidth);p.attr("transform",Wb(l+n,l)),d.attr({x:0,y:0,width:_,height:o}),Xf.positionText(h,_/2,o/2-(b-1)*y/2+3),n+=_+5});var s=t._fullLayout._size,f=s.l+s.w*r.x,c=s.t+s.h*(1-r.y),u="left";ui.isRightAnchor(r)&&(f-=n,u="right"),ui.isCenterAnchor(r)&&(f-=n/2,u="center");var v="top";ui.isBottomAnchor(r)&&(c-=o,v="bottom"),ui.isMiddleAnchor(r)&&(c-=o/2,v="middle"),n=Math.ceil(n),o=Math.ceil(o),f=Math.round(f),c=Math.round(c),L4.autoMargin(t,a+"-range-selector",{x:r.x,y:r.y,l:n*Yb[u],r:n*qb[u],b:o*qb[v],t:o*Yb[v]}),i.attr("transform",Wb(f,c))}var H4={moduleType:"component",name:"rangeselector",schema:{subplots:{xaxis:{rangeselector:xh}}},layoutAttributes:xh,handleDefaults:x4,draw:P4},Wi={},Zb=Xt.extendFlat;Wi.attributes=function(t,e){t=t||{},e=e||{};var r={valType:"info_array",editType:t.editType,items:[{valType:"number",min:0,max:1,editType:t.editType},{valType:"number",min:0,max:1,editType:t.editType}],dflt:[0,1]},a=t.name?t.name+" ":"",i=t.trace?"trace ":"subplot ",n=e.description?" "+e.description:"",o={x:Zb({},r,{description:["Sets the horizontal domain of this ",a,i,"(in plot fraction).",n].join("")}),y:Zb({},r,{description:["Sets the vertical domain of this ",a,i,"(in plot fraction).",n].join("")}),editType:t.editType};return t.noGridCell||(o.row={valType:"integer",min:0,dflt:0,editType:t.editType,description:["If there is a layout grid, use the domain ","for this row in the grid for this ",a,i,".",n].join("")},o.column={valType:"integer",min:0,dflt:0,editType:t.editType,description:["If there is a layout grid, use the domain ","for this column in the grid for this ",a,i,".",n].join("")}),o};Wi.defaults=function(t,e,r,a){var i=a&&a.x||[0,1],n=a&&a.y||[0,1],o=e.grid;if(o){var l=r("domain.column");l!==void 0&&(l<o.columns?i=o._domains.x[l]:delete t.domain.column);var s=r("domain.row");s!==void 0&&(s<o.rows?n=o._domains.y[s]:delete t.domain.row)}var f=r("domain.x",i),c=r("domain.y",n);f[0]<f[1]||(t.domain.x=i.slice()),c[0]<c[1]||(t.domain.y=n.slice())};var O4=we,j4=Bo.counter,B4=Wi.attributes,Kb=Rr.idRegex,G4=Ht,Th={rows:{valType:"integer",min:1,editType:"plot",description:["The number of rows in the grid. If you provide a 2D `subplots`","array or a `yaxes` array, its length is used as the default.","But it's also possible to have a different length, if you","want to leave a row at the end for non-cartesian subplots."].join(" ")},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot",description:["Is the first row the top or the bottom? Note that columns","are always enumerated from left to right."].join(" ")},columns:{valType:"integer",min:1,editType:"plot",description:["The number of columns in the grid. If you provide a 2D `subplots`","array, the length of its longest row is used as the default.","If you give an `xaxes` array, its length is used as the default.","But it's also possible to have a different length, if you","want to leave a row at the end for non-cartesian subplots."].join(" ")},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[j4("xy").toString(),""],editType:"plot"},editType:"plot",description:["Used for freeform grids, where some axes may be shared across subplots","but others are not. Each entry should be a cartesian subplot id, like","*xy* or *x3y2*, or ** to leave that cell empty. You may reuse x axes","within the same column, and y axes within the same row.","Non-cartesian subplots and traces that support `domain` can place themselves","in this grid separately using the `gridcell` attribute."].join(" ")},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[Kb.x.toString(),""],editType:"plot"},editType:"plot",description:["Used with `yaxes` when the x and y axes are shared across columns and rows.","Each entry should be an x axis id like *x*, *x2*, etc., or ** to","not put an x axis in that column. Entries other than ** must be unique.","Ignored if `subplots` is present. If missing but `yaxes` is present,","will generate consecutive IDs."].join(" ")},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[Kb.y.toString(),""],editType:"plot"},editType:"plot",description:["Used with `yaxes` when the x and y axes are shared across columns and rows.","Each entry should be an y axis id like *y*, *y2*, etc., or ** to","not put a y axis in that row. Entries other than ** must be unique.","Ignored if `subplots` is present. If missing but `xaxes` is present,","will generate consecutive IDs."].join(" ")},pattern:{valType:"enumerated",values:["independent","coupled"],dflt:"coupled",editType:"plot",description:["If no `subplots`, `xaxes`, or `yaxes` are given but we do have `rows` and `columns`,","we can generate defaults using consecutive axis IDs, in two ways:","*coupled* gives one x axis per column and one y axis per row.","*independent* uses a new xy pair for each cell, left-to-right across each row","then iterating rows according to `roworder`."].join(" ")},xgap:{valType:"number",min:0,max:1,editType:"plot",description:["Horizontal space between grid cells, expressed as a fraction","of the total width available to one cell. Defaults to 0.1","for coupled-axes grids and 0.2 for independent grids."].join(" ")},ygap:{valType:"number",min:0,max:1,editType:"plot",description:["Vertical space between grid cells, expressed as a fraction","of the total height available to one cell. Defaults to 0.1","for coupled-axes grids and 0.3 for independent grids."].join(" ")},domain:B4({name:"grid",editType:"plot",noGridCell:!0},{description:["The first and last cells end exactly at the domain","edges, with no grout around the edges."].join(" ")}),xside:{valType:"enumerated",values:["bottom","bottom plot","top plot","top"],dflt:"bottom plot",editType:"plot",description:["Sets where the x axis labels and titles go. *bottom* means","the very bottom of the grid. *bottom plot* is the lowest plot","that each x axis is used in. *top* and *top plot* are similar."].join(" ")},yside:{valType:"enumerated",values:["left","left plot","right plot","right"],dflt:"left plot",editType:"plot",description:["Sets where the y axis labels and titles go. *left* means","the very left edge of the grid. *left plot* is the leftmost plot","that each y axis is used in. *right* and *right plot* are similar."].join(" ")},editType:"plot"};function Lc(t,e,r){var a=e[r+"axes"],i=Object.keys((t._splomAxes||{})[r]||{});if(Array.isArray(a))return a;if(i.length)return i}function U4(t,e){var r=t.grid||{},a=Lc(e,r,"x"),i=Lc(e,r,"y");if(!t.grid&&!a&&!i)return;var n=Array.isArray(r.subplots)&&Array.isArray(r.subplots[0]),o=Array.isArray(a),l=Array.isArray(i),s=o&&a!==r.xaxes&&l&&i!==r.yaxes,f,c;n?(f=r.subplots.length,c=r.subplots[0].length):(l&&(f=i.length),o&&(c=a.length));var u=G4.newContainer(e,"grid");function v(w,T){return O4.coerce(r,u,Th,w,T)}var p=v("rows",f),d=v("columns",c);if(!(p*d>1)){delete e.grid;return}if(!n&&!o&&!l){var h=v("pattern")==="independent";h&&(n=!0)}u._hasSubplotGrid=n;var m=v("roworder"),y=m==="top to bottom",b=n?.2:.1,_=n?.3:.1,g,x;s&&e._splomGridDflt&&(g=e._splomGridDflt.xside,x=e._splomGridDflt.yside),u._domains={x:Qb("x",v,b,g,d),y:Qb("y",v,_,x,p,y)}}function Qb(t,e,r,a,i,n){var o=e(t+"gap",r),l=e("domain."+t);e(t+"side",a);for(var s=new Array(i),f=l[0],c=(l[1]-f)/(i-o),u=c*(1-o),v=0;v<i;v++){var p=f+c*v;s[n?i-1-v:v]=[p,p+u]}return s}function V4(t,e){var r=e.grid;if(!(!r||!r._domains)){var a=t.grid||{},i=e._subplots,n=r._hasSubplotGrid,o=r.rows,l=r.columns,s=r.pattern==="independent",f,c,u,v,p,d,h,m=r._axisMap={};if(n){var y=a.subplots||[];d=r.subplots=new Array(o);var b=1;for(f=0;f<o;f++){var _=d[f]=new Array(l),g=y[f]||[];for(c=0;c<l;c++)if(s?(p=b===1?"xy":"x"+b+"y"+b,b++):p=g[c],_[c]="",i.cartesian.indexOf(p)!==-1){if(h=p.indexOf("y"),u=p.slice(0,h),v=p.slice(h),m[u]!==void 0&&m[u]!==c||m[v]!==void 0&&m[v]!==f)continue;_[c]=p,m[u]=c,m[v]=f}}}else{var x=Lc(e,a,"x"),w=Lc(e,a,"y");r.xaxes=Jb(x,i.xaxis,l,m,"x"),r.yaxes=Jb(w,i.yaxis,o,m,"y")}var T=r._anchors={},A=r.roworder==="top to bottom";for(var M in m){var S=M.charAt(0),L=r[S+"side"],E,F,N;if(L.length<8)T[M]="free";else if(S==="x"){if(L.charAt(0)==="t"===A?(E=0,F=1,N=o):(E=o-1,F=-1,N=-1),n){var z=m[M];for(f=E;f!==N;f+=F)if(p=d[f][z],!!p&&(h=p.indexOf("y"),p.slice(0,h)===M)){T[M]=p.slice(h);break}}else for(f=E;f!==N;f+=F)if(v=r.yaxes[f],i.cartesian.indexOf(M+v)!==-1){T[M]=v;break}}else if(L.charAt(0)==="l"?(E=0,F=1,N=l):(E=l-1,F=-1,N=-1),n){var H=m[M];for(f=E;f!==N;f+=F)if(p=d[H][f],!!p&&(h=p.indexOf("y"),p.slice(h)===M)){T[M]=p.slice(0,h);break}}else for(f=E;f!==N;f+=F)if(u=r.xaxes[f],i.cartesian.indexOf(u+M)!==-1){T[M]=u;break}}}}function Jb(t,e,r,a,i){var n=new Array(r),o;function l(s,f){e.indexOf(f)!==-1&&a[f]===void 0?(n[s]=f,a[f]=s):n[s]=""}if(Array.isArray(t))for(o=0;o<r;o++)l(o,t[o]);else for(l(0,i),o=1;o<r;o++)l(o,i+(o+1));return n}var W4={moduleType:"component",name:"grid",schema:{layout:{grid:Th}},layoutAttributes:Th,sizeDefaults:U4,contentDefaults:V4},Vk={visible:{valType:"boolean",editType:"calc",description:["Determines whether or not this set of error bars is visible."].join(" ")},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc",description:["Determines the rule used to generate the error bars.","If *constant`, the bar lengths are of a constant value.","Set this constant in `value`.","If *percent*, the bar lengths correspond to a percentage of","underlying data. Set this percentage in `value`.","If *sqrt*, the bar lengths correspond to the square of the","underlying data.","If *data*, the bar lengths are set with data set `array`."].join(" ")},symmetric:{valType:"boolean",editType:"calc",description:["Determines whether or not the error bars have the same length","in both direction","(top/bottom for vertical bars, left/right for horizontal bars."].join(" ")},array:{valType:"data_array",editType:"calc",description:["Sets the data corresponding the length of each error bar.","Values are plotted relative to the underlying data."].join(" ")},arrayminus:{valType:"data_array",editType:"calc",description:["Sets the data corresponding the length of each error bar in the","bottom (left) direction for vertical (horizontal) bars","Values are plotted relative to the underlying data."].join(" ")},value:{valType:"number",min:0,dflt:10,editType:"calc",description:["Sets the value of either the percentage","(if `type` is set to *percent*) or the constant","(if `type` is set to *constant*) corresponding to the lengths of","the error bars."].join(" ")},valueminus:{valType:"number",min:0,dflt:10,editType:"calc",description:["Sets the value of either the percentage","(if `type` is set to *percent*) or the constant","(if `type` is set to *constant*) corresponding to the lengths of","the error bars in the","bottom (left) direction for vertical (horizontal) bars"].join(" ")},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style",description:"Sets the stroke color of the error bars."},thickness:{valType:"number",min:0,dflt:2,editType:"style",description:"Sets the thickness (in px) of the error bars."},width:{valType:"number",min:0,editType:"plot",description:["Sets the width (in px) of the cross-bar at both ends","of the error bars."].join(" ")},editType:"calc"},nd,ex;function X4(){if(ex)return nd;ex=1;var t=kt,e=ot,r=we,a=Ht,i=Vk;return nd=function(n,o,l,s){var f="error_"+s.axis,c=a.newContainer(o,f),u=n[f]||{};function v(_,g){return r.coerce(u,c,i,_,g)}var p=u.array!==void 0||u.value!==void 0||u.type==="sqrt",d=v("visible",p);if(d!==!1){var h=v("type","array"in u?"data":"percent"),m=!0;h!=="sqrt"&&(m=v("symmetric",!((h==="data"?"arrayminus":"valueminus")in u))),h==="data"?(v("array"),v("traceref"),m||(v("arrayminus"),v("tracerefminus"))):(h==="percent"||h==="constant")&&(v("value"),m||v("valueminus"));var y="copy_"+s.inherit+"style";if(s.inherit){var b=o["error_"+s.inherit];(b||{}).visible&&v(y,!(u.color||t(u.thickness)||t(u.width)))}(!s.inherit||!c[y])&&(v("color",l),v("thickness"),v("width",e.traceIs(o,"gl3d")?0:4))}},nd}var od,tx;function Wk(){if(tx)return od;tx=1,od=function(r){var a=r.type,i=r.symmetric;if(a==="data"){var n=r.array||[];if(i)return function(c,u){var v=+n[u];return[v,v]};var o=r.arrayminus||[];return function(c,u){var v=+n[u],p=+o[u];return!isNaN(v)||!isNaN(p)?[p||0,v||0]:[NaN,NaN]}}else{var l=t(a,r.value),s=t(a,r.valueminus);return i||r.valueminus===void 0?function(c){var u=l(c);return[u,u]}:function(c){return[s(c),l(c)]}}};function t(e,r){if(e==="percent")return function(a){return Math.abs(a*r/100)};if(e==="constant")return function(){return Math.abs(r)};if(e==="sqrt")return function(a){return Math.sqrt(Math.abs(a))}}return od}var ld,rx;function Y4(){if(rx)return ld;rx=1;var t=kt,e=ot,r=Ot,a=we,i=Wk();ld=function(l){for(var s=l.calcdata,f=0;f<s.length;f++){var c=s[f],u=c[0].trace;if(u.visible===!0&&e.traceIs(u,"errorBarsOK")){var v=r.getFromId(l,u.xaxis),p=r.getFromId(l,u.yaxis);n(c,u,v,"x"),n(c,u,p,"y")}}};function n(o,l,s,f){var c=l["error_"+f]||{},u=c.visible&&["linear","log"].indexOf(s.type)!==-1,v=[];if(u){for(var p=i(c),d=0;d<o.length;d++){var h=o[d],m=h.i;if(m===void 0)m=d;else if(m===null)continue;var y=h[f];if(t(s.c2l(y))){var b=p(y,m);if(t(b[0])&&t(b[1])){var _=h[f+"s"]=y-b[0],g=h[f+"h"]=y+b[1];v.push(_,g)}}}var x=s._id,w=l._extremes[x],T=r.findExtremes(s,v,a.extendFlat({tozero:w.opts.tozero},{padded:!0}));w.min=w.min.concat(T.min),w.max=w.max.concat(T.max)}}return ld}var sd,ax;function q4(){if(ax)return sd;ax=1;var t=bt,e=kt,r=Et,a=jr;sd=function(o,l,s,f){var c,u=s.xaxis,v=s.yaxis,p=f&&f.duration>0,d=o._context.staticPlot;l.each(function(h){var m=h[0].trace,y=m.error_x||{},b=m.error_y||{},_;m.ids&&(_=function(T){return T.id});var g=a.hasMarkers(m)&&m.marker.maxdisplayed>0;!b.visible&&!y.visible&&(h=[]);var x=t.select(this).selectAll("g.errorbar").data(h,_);if(x.exit().remove(),!!h.length){y.visible||x.selectAll("path.xerror").remove(),b.visible||x.selectAll("path.yerror").remove(),x.style("opacity",1);var w=x.enter().append("g").classed("errorbar",!0);p&&w.style("opacity",0).transition().duration(f.duration).style("opacity",1),r.setClipUrl(x,s.layerClipId,o),x.each(function(T){var A=t.select(this),M=i(T,u,v);if(!(g&&!T.vis)){var S,L=A.select("path.yerror");if(b.visible&&e(M.x)&&e(M.yh)&&e(M.ys)){var E=b.width;S="M"+(M.x-E)+","+M.yh+"h"+2*E+"m-"+E+",0V"+M.ys,M.noYS||(S+="m-"+E+",0h"+2*E),c=!L.size(),c?L=A.append("path").style("vector-effect",d?"none":"non-scaling-stroke").classed("yerror",!0):p&&(L=L.transition().duration(f.duration).ease(f.easing)),L.attr("d",S)}else L.remove();var F=A.select("path.xerror");if(y.visible&&e(M.y)&&e(M.xh)&&e(M.xs)){var N=(y.copy_ystyle?b:y).width;S="M"+M.xh+","+(M.y-N)+"v"+2*N+"m0,-"+N+"H"+M.xs,M.noXS||(S+="m0,-"+N+"v"+2*N),c=!F.size(),c?F=A.append("path").style("vector-effect",d?"none":"non-scaling-stroke").classed("xerror",!0):p&&(F=F.transition().duration(f.duration).ease(f.easing)),F.attr("d",S)}else F.remove()}})}})};function i(n,o,l){var s={x:o.c2p(n.x),y:l.c2p(n.y)};return n.yh!==void 0&&(s.yh=l.c2p(n.yh),s.ys=l.c2p(n.ys),e(s.ys)||(s.noYS=!0,s.ys=l.c2p(n.ys,!0))),n.xh!==void 0&&(s.xh=o.c2p(n.xh),s.xs=o.c2p(n.xs),e(s.xs)||(s.noXS=!0,s.xs=o.c2p(n.xs,!0))),s}return sd}var fd,ix;function Z4(){if(ix)return fd;ix=1;var t=bt,e=yt;return fd=function(a){a.each(function(i){var n=i[0].trace,o=n.error_y||{},l=n.error_x||{},s=t.select(this);s.selectAll("path.yerror").style("stroke-width",o.thickness+"px").call(e.stroke,o.color),l.copy_ystyle&&(l=o),s.selectAll("path.xerror").style("stroke-width",l.thickness+"px").call(e.stroke,l.color)})},fd}var Hl=we,nx=Ja.overrideAll,Ol=Vk,hn={error_x:Hl.extendFlat({},Ol),error_y:Hl.extendFlat({},Ol)};delete hn.error_x.copy_zstyle;delete hn.error_y.copy_zstyle;delete hn.error_y.copy_ystyle;var ks={error_x:Hl.extendFlat({},Ol),error_y:Hl.extendFlat({},Ol),error_z:Hl.extendFlat({},Ol)};delete ks.error_x.copy_ystyle;delete ks.error_y.copy_ystyle;delete ks.error_z.copy_ystyle;delete ks.error_z.copy_zstyle;var K4={moduleType:"component",name:"errorbars",schema:{traces:{scatter:hn,bar:hn,histogram:hn,scatter3d:nx(ks,"calc","nested"),scattergl:nx(hn,"calc","nested")}},supplyDefaults:X4(),calc:Y4(),makeComputeError:Wk(),plot:q4(),style:Z4(),hoverInfo:Q4};function Q4(t,e,r){(e.error_y||{}).visible&&(r.yerr=t.yh-t.y,e.error_y.symmetric||(r.yerrneg=t.y-t.ys)),(e.error_x||{}).visible&&(r.xerr=t.xh-t.x,e.error_x.symmetric||(r.xerrneg=t.x-t.xs))}var J4={cn:{colorbar:"colorbar",cbbg:"cbbg",cbfill:"cbfill",cbfills:"cbfills",cbline:"cbline",cblines:"cblines",cbaxis:"cbaxis",cbtitleunshift:"cbtitleunshift",cbtitle:"cbtitle",cboutline:"cboutline",crisp:"crisp",jsPlaceholder:"js-placeholder"}},Mi=bt,cd=_a,Yf=hr,ox=ot,oi=Ot,mf=ai,ga=we,Da=ga.strTranslate,Xk=Xt.extendFlat,ud=Bi,La=Et,vd=yt,e6=Jc,t6=Tr,r6=ja.flipScale,a6=ik,i6=nk,n6=ti,cm=Vr,lx=cm.LINE_SPACING,sx=cm.FROM_TL,fx=cm.FROM_BR,Zt=J4.cn;function o6(t){var e=t._fullLayout,r=e._infolayer.selectAll("g."+Zt.colorbar).data(l6(t),function(a){return a._id});r.enter().append("g").attr("class",function(a){return a._id}).classed(Zt.colorbar,!0),r.each(function(a){var i=Mi.select(this);ga.ensureSingle(i,"rect",Zt.cbbg),ga.ensureSingle(i,"g",Zt.cbfills),ga.ensureSingle(i,"g",Zt.cblines),ga.ensureSingle(i,"g",Zt.cbaxis,function(o){o.classed(Zt.crisp,!0)}),ga.ensureSingle(i,"g",Zt.cbtitleunshift,function(o){o.append("g").classed(Zt.cbtitle,!0)}),ga.ensureSingle(i,"rect",Zt.cboutline);var n=s6(i,a,t);n&&n.then&&(t._promises||[]).push(n),t._context.edits.colorbarPosition&&f6(i,a,t)}),r.exit().each(function(a){Yf.autoMargin(t,a._id)}).remove(),r.order()}function l6(t){var e=t._fullLayout,r=t.calcdata,a=[],i,n,o,l;function s(_){return Xk(_,{_fillcolor:null,_line:{color:null,width:null,dash:null},_levels:{start:null,end:null,size:null},_filllevels:null,_fillgradient:null,_zrange:null})}function f(){typeof l.calc=="function"?l.calc(t,o,i):(i._fillgradient=n.reversescale?r6(n.colorscale):n.colorscale,i._zrange=[n[l.min],n[l.max]])}for(var c=0;c<r.length;c++){var u=r[c];if(o=u[0].trace,!!o._module){var v=o._module.colorbar;if(o.visible===!0&&v)for(var p=Array.isArray(v),d=p?v:[v],h=0;h<d.length;h++){l=d[h];var m=l.container;n=m?o[m]:o,n&&n.showscale&&(i=s(n.colorbar),i._id="cb"+o.uid+(p&&m?"-"+m:""),i._traceIndex=o.index,i._propPrefix=(m?m+".":"")+"colorbar.",i._meta=o._meta,f(),a.push(i))}}}for(var y in e._colorAxes)if(n=e[y],n.showscale){var b=e._colorAxes[y];i=s(n.colorbar),i._id="cb"+y,i._propPrefix=y+".colorbar.",i._meta=e._meta,l={min:"cmin",max:"cmax"},b[0]!=="heatmap"&&(o=b[1],l.calc=o._module.colorbar.calc),f(),a.push(i)}return a}function s6(t,e,r){var a=e.orientation==="v",i=e.len,n=e.lenmode,o=e.thickness,l=e.thicknessmode,s=e.outlinewidth,f=e.borderwidth,c=e.bgcolor,u=e.xanchor,v=e.yanchor,p=e.xpad,d=e.ypad,h=e.x,m=a?e.y:1-e.y,y=e.yref==="paper",b=e.xref==="paper",_=r._fullLayout,g=_._size,x=e._fillcolor,w=e._line,T=e.title,A=T.side,M=e._zrange||Mi.extent((typeof x=="function"?x:w.color).domain()),S=typeof w.color=="function"?w.color:function(){return w.color},L=typeof x=="function"?x:function(){return x},E=e._levels,F=c6(r,e,M),N=F.fill,z=F.line,H=Math.round(o*(l==="fraction"?a?g.w:g.h:1)),D=H/(a?g.w:g.h),P=Math.round(i*(n==="fraction"?a?g.h:g.w:1)),k=P/(a?g.h:g.w),C=b?g.w:r._fullLayout.width,$=y?g.h:r._fullLayout.height,R=Math.round(a?h*C+p:m*$+d),j={center:.5,right:1}[u]||0,G={top:1,middle:.5}[v]||0,Y=a?h-j*D:m-G*D,O=a?m-G*k:h-j*k,K=Math.round(a?$*(1-O):C*O);e._lenFrac=k,e._thickFrac=D,e._uFrac=Y,e._vFrac=O;var W=e._axis=u6(r,e,M);W.position=D+(a?h+p/g.w:m+d/g.h);var X=["top","bottom"].indexOf(A)!==-1;if(a&&X&&(W.title.side=A,W.titlex=h+p/g.w,W.titley=O+(T.side==="top"?k-d/g.h:d/g.h)),!a&&!X&&(W.title.side=A,W.titley=m+d/g.h,W.titlex=O+p/g.w),w.color&&e.tickmode==="auto"){W.tickmode="linear",W.tick0=E.start;var B=E.size,ee=ga.constrain(P/50,4,15)+1,ae=(M[1]-M[0])/((e.nticks||ee)*B);if(ae>1){var de=Math.pow(10,Math.floor(Math.log(ae)/Math.LN10));B*=de*ga.roundUp(ae/de,[2,5,10]),(Math.abs(E.start)/E.size+1e-6)%1<2e-6&&(W.tick0=0)}W.dtick=B}W.domain=a?[O+d/g.h,O+k-d/g.h]:[O+p/g.w,O+k-p/g.w],W.setScale(),t.attr("transform",Da(Math.round(g.l),Math.round(g.t)));var fe=t.select("."+Zt.cbtitleunshift).attr("transform",Da(-Math.round(g.l),-Math.round(g.t))),q=W.ticklabelposition,te=W.title.font.size,le=t.select("."+Zt.cbaxis),ce,ye=0,ue=0;function oe(_e,J){var be={propContainer:W,propName:e._propPrefix+"title",traceIndex:e._traceIndex,_meta:e._meta,placeholder:_._dfltTitle.colorbar,containerGroup:t.select("."+Zt.cbtitle)},Z=_e.charAt(0)==="h"?_e.substr(1):"h"+_e;t.selectAll("."+Z+",."+Z+"-math-group").remove(),e6.draw(r,_e,Xk(be,J||{}))}function pe(){if(a&&X||!a&&!X){var _e,J;A==="top"&&(_e=p+g.l+C*h,J=d+g.t+$*(1-O-k)+3+te*.75),A==="bottom"&&(_e=p+g.l+C*h,J=d+g.t+$*(1-O)-3-te*.25),A==="right"&&(J=d+g.t+$*m+3+te*.75,_e=p+g.l+C*O),oe(W._id+"title",{attributes:{x:_e,y:J,"text-anchor":a?"start":"middle"}})}}function Me(){if(a&&!X||!a&&X){var _e=W.position||0,J=W._offset+W._length/2,be,Z;if(A==="right")Z=J,be=g.l+C*_e+10+te*(W.showticklabels?1:.5);else if(be=J,A==="bottom"&&(Z=g.t+$*_e+10+(q.indexOf("inside")===-1?W.tickfont.size:0)+(W.ticks!=="intside"&&e.ticklen||0)),A==="top"){var me=T.text.split("<br>").length;Z=g.t+$*_e+10-H-lx*te*me}oe((a?"h":"v")+W._id+"title",{avoid:{selection:Mi.select(r).selectAll("g."+W._id+"tick"),side:A,offsetTop:a?0:g.t,offsetLeft:a?g.l:0,maxShift:a?_.width:_.height},attributes:{x:be,y:Z,"text-anchor":"middle"},transform:{rotate:a?-90:0,offset:0}})}}function ve(){if(!a&&!X||a&&X){var _e=t.select("."+Zt.cbtitle),J=_e.select("text"),be=[-s/2,s/2],Z=_e.select(".h"+W._id+"title-math-group").node(),me=15.6;J.node()&&(me=parseInt(J.node().style.fontSize,10)*lx);var ge;if(Z?(ge=La.bBox(Z),ue=ge.width,ye=ge.height,ye>me&&(be[1]-=(ye-me)/2)):J.node()&&!J.classed(Zt.jsPlaceholder)&&(ge=La.bBox(J.node()),ue=ge.width,ye=ge.height),a){if(ye){if(ye+=5,A==="top")W.domain[1]-=ye/g.h,be[1]*=-1;else{W.domain[0]+=ye/g.h;var Pe=t6.lineCount(J);be[1]+=(1-Pe)*me}_e.attr("transform",Da(be[0],be[1])),W.setScale()}}else ue&&(A==="right"&&(W.domain[0]+=(ue+te/2)/g.w),_e.attr("transform",Da(be[0],be[1])),W.setScale())}t.selectAll("."+Zt.cbfills+",."+Zt.cblines).attr("transform",a?Da(0,Math.round(g.h*(1-W.domain[1]))):Da(Math.round(g.w*W.domain[0]),0)),le.attr("transform",a?Da(0,Math.round(-g.t)):Da(Math.round(-g.l),0));var Ee=t.select("."+Zt.cbfills).selectAll("rect."+Zt.cbfill).attr("style","").data(N);Ee.enter().append("rect").classed(Zt.cbfill,!0).attr("style",""),Ee.exit().remove();var Le=M.map(W.c2p).map(Math.round).sort(function(je,at){return je-at});Ee.each(function(je,at){var xe=[at===0?M[0]:(N[at]+N[at-1])/2,at===N.length-1?M[1]:(N[at]+N[at+1])/2].map(W.c2p).map(Math.round);a&&(xe[1]=ga.constrain(xe[1]+(xe[1]>xe[0])?1:-1,Le[0],Le[1]));var We=Mi.select(this).attr(a?"x":"y",R).attr(a?"y":"x",Mi.min(xe)).attr(a?"width":"height",Math.max(H,2)).attr(a?"height":"width",Math.max(Mi.max(xe)-Mi.min(xe),2));if(e._fillgradient)La.gradient(We,r,e._id,a?"vertical":"horizontalreversed",e._fillgradient,"fill");else{var Xe=L(je).replace("e-","");We.attr("fill",cd(Xe).toHexString())}});var Ae=t.select("."+Zt.cblines).selectAll("path."+Zt.cbline).data(w.color&&w.width?z:[]);Ae.enter().append("path").classed(Zt.cbline,!0),Ae.exit().remove(),Ae.each(function(je){var at=R,xe=Math.round(W.c2p(je))+w.width/2%1;Mi.select(this).attr("d","M"+(a?at+","+xe:xe+","+at)+(a?"h":"v")+H).call(La.lineGroupStyle,w.width,S(je),w.dash)}),le.selectAll("g."+W._id+"tick,path").remove();var Oe=R+H+(s||0)/2-(e.ticks==="outside"?1:0),$e=oi.calcTicks(W),ze=oi.getTickSigns(W)[2];return oi.drawTicks(r,W,{vals:W.ticks==="inside"?oi.clipEnds(W,$e):$e,layer:le,path:oi.makeTickPath(W,Oe,ze),transFn:oi.makeTransTickFn(W)}),oi.drawLabels(r,W,{vals:$e,layer:le,transFn:oi.makeTransTickLabelFn(W),labelFns:oi.makeLabelFns(W,Oe)})}function ke(){var _e,J=H+s/2;q.indexOf("inside")===-1&&(_e=La.bBox(le.node()),J+=a?_e.width:_e.height),ce=fe.select("text");var be=0,Z=a&&A==="top",me=!a&&A==="right",ge=0;if(ce.node()&&!ce.classed(Zt.jsPlaceholder)){var Pe,Ee=fe.select(".h"+W._id+"title-math-group").node();Ee&&(a&&X||!a&&!X)?(_e=La.bBox(Ee),be=_e.width,Pe=_e.height):(_e=La.bBox(fe.node()),be=_e.right-g.l-(a?R:K),Pe=_e.bottom-g.t-(a?K:R),!a&&A==="top"&&(J+=_e.height,ge=_e.height)),me&&(ce.attr("transform",Da(be/2+te/2,0)),be*=2),J=Math.max(J,a?be:Pe)}var Le=(a?p:d)*2+J+f+s/2,Ae=0;!a&&T.text&&v==="bottom"&&m<=0&&(Ae=Le/2,Le+=Ae,ge+=Ae),_._hColorbarMoveTitle=Ae,_._hColorbarMoveCBTitle=ge;var Oe=f+s,$e=(a?R:K)-Oe/2-(a?p:0),ze=(a?K:R)-(a?P:d+ge-Ae);t.select("."+Zt.cbbg).attr("x",$e).attr("y",ze).attr(a?"width":"height",Math.max(Le-Ae,2)).attr(a?"height":"width",Math.max(P+Oe,2)).call(vd.fill,c).call(vd.stroke,e.bordercolor).style("stroke-width",f);var je=me?Math.max(be-10,0):0;t.selectAll("."+Zt.cboutline).attr("x",(a?R:K+p)+je).attr("y",(a?K+d-P:R)+(Z?ye:0)).attr(a?"width":"height",Math.max(H,2)).attr(a?"height":"width",Math.max(P-(a?2*d+ye:2*p+je),2)).call(vd.stroke,e.outlinecolor).style({fill:"none","stroke-width":s});var at=a?j*Le:0,xe=a?0:(1-G)*Le-ge;if(at=b?g.l-at:-at,xe=y?g.t-xe:-xe,t.attr("transform",Da(at,xe)),!a&&(f||cd(c).getAlpha()&&!cd.equals(_.paper_bgcolor,c))){var We=le.selectAll("text"),Xe=We[0].length,Re=t.select("."+Zt.cbbg).node(),et=La.bBox(Re),Ue=La.getTranslate(t),I=2;We.each(function(Te,Ie){var Ge=0,Fe=Xe-1;if(Ie===Ge||Ie===Fe){var tt=La.bBox(this),st=La.getTranslate(this),Ve;if(Ie===Fe){var Lt=tt.right+st.x,ft=et.right+Ue.x+K-f-I+h;Ve=ft-Lt,Ve>0&&(Ve=0)}else if(Ie===Ge){var Ze=tt.left+st.x,gt=et.left+Ue.x+K+f+I;Ve=gt-Ze,Ve<0&&(Ve=0)}Ve&&(Xe<3?this.setAttribute("transform","translate("+Ve+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}})}var U={},V=sx[u],Q=fx[u],se=sx[v],re=fx[v],Ce=Le-H;a?(n==="pixels"?(U.y=m,U.t=P*se,U.b=P*re):(U.t=U.b=0,U.yt=m+i*se,U.yb=m-i*re),l==="pixels"?(U.x=h,U.l=Le*V,U.r=Le*Q):(U.l=Ce*V,U.r=Ce*Q,U.xl=h-o*V,U.xr=h+o*Q)):(n==="pixels"?(U.x=h,U.l=P*V,U.r=P*Q):(U.l=U.r=0,U.xl=h+i*V,U.xr=h-i*Q),l==="pixels"?(U.y=1-m,U.t=Le*se,U.b=Le*re):(U.t=Ce*se,U.b=Ce*re,U.yt=m-o*se,U.yb=m+o*re));var Se=e.y<.5?"b":"t",he=e.x<.5?"l":"r";r._fullLayout._reservedMargin[e._id]={};var ne={r:_.width-$e-at,l:$e+U.r,b:_.height-ze-xe,t:ze+U.b};b&&y?Yf.autoMargin(r,e._id,U):b?r._fullLayout._reservedMargin[e._id][Se]=ne[Se]:y||a?r._fullLayout._reservedMargin[e._id][he]=ne[he]:r._fullLayout._reservedMargin[e._id][Se]=ne[Se]}return ga.syncOrAsync([Yf.previousPromises,pe,ve,Me,Yf.previousPromises,ke],r)}function f6(t,e,r){var a=e.orientation==="v",i=r._fullLayout,n=i._size,o,l,s;mf.init({element:t.node(),gd:r,prepFn:function(){o=t.attr("transform"),ud(t)},moveFn:function(f,c){t.attr("transform",o+Da(f,c)),l=mf.align((a?e._uFrac:e._vFrac)+f/n.w,a?e._thickFrac:e._lenFrac,0,1,e.xanchor),s=mf.align((a?e._vFrac:1-e._uFrac)-c/n.h,a?e._lenFrac:e._thickFrac,0,1,e.yanchor);var u=mf.getCursor(l,s,e.xanchor,e.yanchor);ud(t,u)},doneFn:function(){if(ud(t),l!==void 0&&s!==void 0){var f={};f[e._propPrefix+"x"]=l,f[e._propPrefix+"y"]=s,e._traceIndex!==void 0?ox.call("_guiRestyle",r,f,e._traceIndex):ox.call("_guiRelayout",r,f)}}})}function c6(t,e,r){var a=e._levels,i=[],n=[],o,l,s=a.end+a.size/100,f=a.size,c=1.001*r[0]-.001*r[1],u=1.001*r[1]-.001*r[0];for(l=0;l<1e5&&(o=a.start+l*f,!(f>0?o>=s:o<=s));l++)o>c&&o<u&&i.push(o);if(e._fillgradient)n=[0];else if(typeof e._fillcolor=="function"){var v=e._filllevels;if(v)for(s=v.end+v.size/100,f=v.size,l=0;l<1e5&&(o=v.start+l*f,!(f>0?o>=s:o<=s));l++)o>r[0]&&o<r[1]&&n.push(o);else n=i.map(function(p){return p-a.size/2}),n.push(n[n.length-1]+a.size)}else e._fillcolor&&typeof e._fillcolor=="string"&&(n=[0]);return a.size<0&&(i.reverse(),n.reverse()),{line:i,fill:n}}function u6(t,e,r){var a=t._fullLayout,i=e.orientation==="v",n={type:"linear",range:r,tickmode:e.tickmode,nticks:e.nticks,tick0:e.tick0,dtick:e.dtick,tickvals:e.tickvals,ticktext:e.ticktext,ticks:e.ticks,ticklen:e.ticklen,tickwidth:e.tickwidth,tickcolor:e.tickcolor,showticklabels:e.showticklabels,labelalias:e.labelalias,ticklabelposition:e.ticklabelposition,ticklabeloverflow:e.ticklabeloverflow,ticklabelstep:e.ticklabelstep,tickfont:e.tickfont,tickangle:e.tickangle,tickformat:e.tickformat,exponentformat:e.exponentformat,minexponent:e.minexponent,separatethousands:e.separatethousands,showexponent:e.showexponent,showtickprefix:e.showtickprefix,tickprefix:e.tickprefix,showticksuffix:e.showticksuffix,ticksuffix:e.ticksuffix,title:e.title,showline:!0,anchor:"free",side:i?"right":"bottom",position:1},o=i?"y":"x",l={type:"linear",_id:o+e._id},s={letter:o,font:a.font,noAutotickangles:o==="y",noHover:!0,noTickson:!0,noTicklabelmode:!0,noInsideRange:!0,calendar:a.calendar};function f(c,u){return ga.coerce(n,l,n6,c,u)}return a6(n,l,f,s,a),i6(n,l,f,s),l}var v6={draw:o6},d6={moduleType:"component",name:"colorbar",attributes:np,supplyDefaults:Sw,draw:v6.draw,hasColorbar:bw},h6={moduleType:"component",name:"legend",layoutAttributes:sT,supplyLayoutDefaults:fT,draw:dT,style:uT},p6={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}},m6={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}},y6=ot,Yk=we,dd=Yk.extendFlat,cx=Yk.extendDeep;function ux(t){var e;switch(t){case"themes__thumb":e={autosize:!0,width:150,height:150,title:{text:""},showlegend:!1,margin:{l:5,r:5,t:5,b:5,pad:0},annotations:[]};break;case"thumbnail":e={title:{text:""},hidesources:!0,showlegend:!1,borderwidth:0,bordercolor:"",margin:{l:1,r:1,t:1,b:1,pad:0},annotations:[]};break;default:e={}}return e}function g6(t){var e=["xaxis","yaxis","zaxis"];return e.indexOf(t.slice(0,5))>-1}var qk=function(e,r){var a,i=e.data,n=e.layout,o=cx([],i),l=cx({},n,ux(r.tileClass)),s=e._context||{};if(r.width&&(l.width=r.width),r.height&&(l.height=r.height),r.tileClass==="thumbnail"||r.tileClass==="themes__thumb"){l.annotations=[];var f=Object.keys(l);for(a=0;a<f.length;a++)g6(f[a])&&(l[f[a]].title={text:""});for(a=0;a<o.length;a++){var c=o[a];c.showscale=!1,c.marker&&(c.marker.showscale=!1),y6.traceIs(c,"pie-like")&&(c.textposition="none")}}if(Array.isArray(r.annotations))for(a=0;a<r.annotations.length;a++)l.annotations.push(r.annotations[a]);var u=Object.keys(l).filter(function(m){return m.match(/^scene\d*$/)});if(u.length){var v={};for(r.tileClass==="thumbnail"&&(v={title:{text:""},showaxeslabels:!1,showticklabels:!1,linetickenable:!1}),a=0;a<u.length;a++){var p=l[u[a]];p.xaxis||(p.xaxis={}),p.yaxis||(p.yaxis={}),p.zaxis||(p.zaxis={}),dd(p.xaxis,v),dd(p.yaxis,v),dd(p.zaxis,v),p._scene=null}}var d=document.createElement("div");r.tileClass&&(d.className=r.tileClass);var h={gd:d,td:d,layout:l,data:o,config:{staticPlot:r.staticPlot===void 0?!0:r.staticPlot,plotGlPixelRatio:r.plotGlPixelRatio===void 0?2:r.plotGlPixelRatio,displaylogo:r.displaylogo||!1,showLink:r.showLink||!1,showTips:r.showTips||!1,mapboxAccessToken:s.mapboxAccessToken}};return r.setBackground!=="transparent"&&(h.config.setBackground=r.setBackground||"opaque"),h.gd.defaultLayout=ux(r.tileClass),h},b6=Eh.EventEmitter,x6=ot,_6=we,vx=ra,w6=qk,T6=Gp,k6=Up;function A6(t,e){var r=new b6,a=w6(t,{format:"png"}),i=a.gd;i.style.position="absolute",i.style.left="-5000px",document.body.appendChild(i);function n(){var l=vx.getDelay(i._fullLayout);setTimeout(function(){var s=T6(i),f=document.createElement("canvas");f.id=_6.randstr(),r=k6({format:e.format,width:i._fullLayout.width,height:i._fullLayout.height,canvas:f,emitter:r,svg:s}),r.clean=function(){i&&document.body.removeChild(i)}},l)}var o=vx.getRedrawFunc(i);return x6.call("_doPlot",i,a.data,a.layout,a.config).then(o).then(n).catch(function(l){r.emit("error",l)}),r}var M6=A6,dx=ra,S6={getDelay:dx.getDelay,getRedrawFunc:dx.getRedrawFunc,clone:qk,toSVG:Gp,svgToImg:Up,toImage:M6,downloadImage:P2},L6=S6;(function(t){t.version=Ic.version;for(var e=ot,r=t.register=e.register,a=Yt,i=Object.keys(a),n=0;n<i.length;n++){var o=i[n];o.charAt(0)!=="_"&&(t[o]=a[o]),r({moduleType:"apiMethod",name:o,fn:a[o]})}r(OI),r([vF,DF,Rl,XF,oN,PN,a4,d4,H4,W4,K4,Co,d6,h6,Na,e2]),r([p6,m6]),window.PlotlyLocales&&Array.isArray(window.PlotlyLocales)&&(r(window.PlotlyLocales),delete window.PlotlyLocales),t.Icons=wp;var l=Na,s=hr;t.Plots={resize:s.resize,graphJson:s.graphJson,sendDataToCloud:s.sendDataToCloud},t.Fx={hover:l.hover,unhover:l.unhover,loneHover:l.loneHover,loneUnhover:l.loneUnhover},t.Snapshot=L6,t.PlotSchema=Xo})(J1);var C6=J1;const AB=Ni(C6);var As={TEXTPAD:3,eventDataKeys:["value","label"]},er=Vi,hx=qo.axisHoverFormat,D6=zr.hovertemplateAttrs,P6=zr.texttemplateAttrs,Zk=Rn,$6=Mr,px=As,E6=ta.pattern,pn=Xt.extendFlat,hd=$6({editType:"calc",arrayOk:!0,colorEditType:"style",description:""}),z6=er.marker,R6=z6.line,I6=pn({},R6.width,{dflt:0}),F6=pn({width:I6,editType:"calc"},Zk("marker.line")),N6=pn({line:F6,editType:"calc"},Zk("marker"),{opacity:{valType:"number",arrayOk:!0,dflt:1,min:0,max:1,editType:"style",description:"Sets the opacity of the bars."},pattern:E6,cornerradius:{valType:"any",editType:"calc",description:["Sets the rounding of corners. May be an integer number of pixels,","or a percentage of bar width (as a string ending in %). Defaults to `layout.barcornerradius`.","In stack or relative barmode, the first trace to set cornerradius is used for the whole stack."].join(" ")}}),Ms={x:er.x,x0:er.x0,dx:er.dx,y:er.y,y0:er.y0,dy:er.dy,xperiod:er.xperiod,yperiod:er.yperiod,xperiod0:er.xperiod0,yperiod0:er.yperiod0,xperiodalignment:er.xperiodalignment,yperiodalignment:er.yperiodalignment,xhoverformat:hx("x"),yhoverformat:hx("y"),text:er.text,texttemplate:P6({editType:"plot"},{keys:px.eventDataKeys}),hovertext:er.hovertext,hovertemplate:D6({},{keys:px.eventDataKeys}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"calc",description:["Specifies the location of the `text`.","*inside* positions `text` inside, next to the bar end","(rotated and scaled if needed).","*outside* positions `text` outside, next to the bar end","(scaled if needed), unless there is another bar stacked on","this one, then the text gets pushed inside.","*auto* tries to position `text` inside the bar, but if","the bar is too small and no bar is stacked on this one","the text is moved outside.","If *none*, no text appears."].join(" ")},insidetextanchor:{valType:"enumerated",values:["end","middle","start"],dflt:"end",editType:"plot",description:["Determines if texts are kept at center or start/end points in `textposition` *inside* mode."].join(" ")},textangle:{valType:"angle",dflt:"auto",editType:"plot",description:["Sets the angle of the tick labels with respect to the bar.","For example, a `tickangle` of -90 draws the tick labels","vertically. With *auto* the texts may automatically be","rotated to fit with the maximum size in bars."].join(" ")},textfont:pn({},hd,{description:"Sets the font used for `text`."}),insidetextfont:pn({},hd,{description:"Sets the font used for `text` lying inside the bar."}),outsidetextfont:pn({},hd,{description:"Sets the font used for `text` lying outside the bar."}),constraintext:{valType:"enumerated",values:["inside","outside","both","none"],dflt:"both",editType:"calc",description:["Constrain the size of text inside or outside a bar to be no","larger than the bar itself."].join(" ")},cliponaxis:pn({},er.cliponaxis,{description:["Determines whether the text nodes","are clipped about the subplot axes.","To show the text nodes above axis lines and tick labels,","make sure to set `xaxis.layer` and `yaxis.layer` to *below traces*."].join(" ")}),orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes",description:["Sets the orientation of the bars.","With *v* (*h*), the value of the each bar spans","along the vertical (horizontal)."].join(" ")},base:{valType:"any",dflt:null,arrayOk:!0,editType:"calc",description:["Sets where the bar base is drawn (in position axis units).","In *stack* or *relative* barmode,","traces that set *base* will be excluded","and drawn in *overlay* mode instead."].join(" ")},offset:{valType:"number",dflt:null,arrayOk:!0,editType:"calc",description:["Shifts the position where the bar is drawn","(in position axis units).","In *group* barmode,","traces that set *offset* will be excluded","and drawn in *overlay* mode instead."].join(" ")},width:{valType:"number",dflt:null,min:0,arrayOk:!0,editType:"calc",description:["Sets the bar width (in position axis units)."].join(" ")},marker:N6,offsetgroup:er.offsetgroup,alignmentgroup:er.alignmentgroup,selected:{marker:{opacity:er.selected.marker.opacity,color:er.selected.marker.color,editType:"style"},textfont:er.selected.textfont,editType:"style"},unselected:{marker:{opacity:er.unselected.marker.opacity,color:er.unselected.marker.color,editType:"style"},textfont:er.unselected.textfont,editType:"style"},zorder:er.zorder},um={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group",editType:"calc",description:["Determines how bars at the same location coordinate","are displayed on the graph.","With *stack*, the bars are stacked on top of one another","With *relative*, the bars are stacked on top of one another,","with negative values below the axis, positive values above","With *group*, the bars are plotted next to one another","centered around the shared location.","With *overlay*, the bars are plotted over one another,","you might need to reduce *opacity* to see multiple bars."].join(" ")},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc",description:["Sets the normalization for bar traces on the graph.","With *fraction*, the value of each bar is divided by the sum of all","values at that location coordinate.","*percent* is the same but multiplied by 100 to show percentages."].join(" ")},bargap:{valType:"number",min:0,max:1,editType:"calc",description:["Sets the gap (in plot fraction) between bars of","adjacent location coordinates."].join(" ")},bargroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc",description:["Sets the gap (in plot fraction) between bars of","the same location coordinate."].join(" ")},barcornerradius:{valType:"any",editType:"calc",description:["Sets the rounding of bar corners. May be an integer number of pixels,","or a percentage of bar width (as a string ending in %)."].join(" ")}},H6=yt,mx=ja.hasColorscale,yx=gs,O6=we.coercePattern,Kk=function(e,r,a,i,n){var o=a("marker.color",i),l=mx(e,"marker");l&&yx(e,r,n,a,{prefix:"marker.",cLetter:"c"}),a("marker.line.color",H6.defaultLine),mx(e,"marker.line")&&yx(e,r,n,a,{prefix:"marker.line.",cLetter:"c"}),a("marker.line.width"),a("marker.opacity"),O6(a,"marker.pattern",o,l),a("selected.marker.color"),a("unselected.marker.color")},gx=kt,No=we,bx=yt,j6=ot,B6=Wp,G6=bu,U6=Kk,V6=Xp,Qk=Ms,yf=No.coerceFont;function W6(t,e,r,a){function i(f,c){return No.coerce(t,e,Qk,f,c)}var n=B6(t,e,a,i);if(!n){e.visible=!1;return}G6(t,e,a,i),i("xhoverformat"),i("yhoverformat"),i("zorder"),i("orientation",e.x&&!e.y?"h":"v"),i("base"),i("offset"),i("width"),i("text"),i("hovertext"),i("hovertemplate");var o=i("textposition");eA(t,e,a,i,o,{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),U6(t,e,i,r,a);var l=(e.marker.line||{}).color,s=j6.getComponentMethod("errorbars","supplyDefaults");s(t,e,l||bx.defaultLine,{axis:"y"}),s(t,e,l||bx.defaultLine,{axis:"x",inherit:"y"}),No.coerceSelectionMarkerOpacity(e,i)}function X6(t,e){var r,a;function i(l,s){return No.coerce(a._input,a,Qk,l,s)}for(var n=0;n<t.length;n++)if(a=t[n],a.type==="bar"){r=a._input;var o=i("marker.cornerradius",e.barcornerradius);a.marker&&(a.marker.cornerradius=Jk(o)),V6(r,a,e,i,e.barmode)}}function Jk(t){if(gx(t)){if(t=+t,t>=0)return t}else if(typeof t=="string"&&(t=t.trim(),t.slice(-1)==="%"&&gx(t.slice(0,-1))&&(t=+t.slice(0,-1),t>=0)))return t+"%"}function eA(t,e,r,a,i,n){n=n||{};var o=n.moduleHasSelected!==!1,l=n.moduleHasUnselected!==!1,s=n.moduleHasConstrain!==!1,f=n.moduleHasCliponaxis!==!1,c=n.moduleHasTextangle!==!1,u=n.moduleHasInsideanchor!==!1,v=!!n.hasPathbar,p=Array.isArray(i)||i==="auto",d=p||i==="inside",h=p||i==="outside";if(d||h){var m=yf(a,"textfont",r.font),y=No.extendFlat({},m),b=t.textfont&&t.textfont.color,_=!b;if(_&&delete y.color,yf(a,"insidetextfont",y),v){var g=No.extendFlat({},m);_&&delete g.color,yf(a,"pathbar.textfont",g)}h&&yf(a,"outsidetextfont",m),o&&a("selected.textfont.color"),l&&a("unselected.textfont.color"),s&&a("constraintext"),f&&a("cliponaxis"),c&&a("textangle"),a("texttemplate")}d&&u&&a("insidetextanchor")}var Ln={supplyDefaults:W6,crossTraceDefaults:X6,handleText:eA,validateCornerradius:Jk},Y6=ot,q6=Ot,Z6=we,K6=um,Q6=Ln.validateCornerradius,tA=function(t,e,r){function a(h,m){return Z6.coerce(t,e,K6,h,m)}for(var i=!1,n=!1,o=!1,l={},s=a("barmode"),f=s==="group",c=0;c<r.length;c++){var u=r[c];if(Y6.traceIs(u,"bar")&&u.visible)i=!0;else continue;var v=u.xaxis+u.yaxis;if(f?(l[v]&&(o=!0),l[v]=!0):(v+=u._input.offsetgroup,l.length>0&&!l[v]&&(o=!0),l[v]=!0),u.visible&&u.type==="histogram"){var p=q6.getFromId({_fullLayout:e},u[u.orientation==="v"?"xaxis":"yaxis"]);p.type!=="category"&&(n=!0)}}if(!i){delete e.barmode;return}s!=="overlay"&&a("barnorm"),a("bargap",n&&!o?0:.2),a("bargroupgap");var d=a("barcornerradius");e.barcornerradius=Q6(d)},eo=we,vm=function(e,r){for(var a=0;a<e.length;a++)e[a].i=a;eo.mergeArray(r.text,e,"tx"),eo.mergeArray(r.hovertext,e,"htx");var i=r.marker;if(i){eo.mergeArray(i.opacity,e,"mo",!0),eo.mergeArray(i.color,e,"mc");var n=i.line;n&&(eo.mergeArray(n.color,e,"mlc"),eo.mergeArrayCastPositive(n.width,e,"mlw"))}},xx=Ot,_x=xu,wx=ja.hasColorscale,Tx=op,J6=vm,e8=V2,t8=function(e,r){var a=xx.getFromId(e,r.xaxis||"x"),i=xx.getFromId(e,r.yaxis||"y"),n,o,l,s,f,c,u={msUTC:!!(r.base||r.base===0)};r.orientation==="h"?(n=a.makeCalcdata(r,"x",u),l=i.makeCalcdata(r,"y"),s=_x(r,i,"y",l),f=!!r.yperiodalignment,c="y"):(n=i.makeCalcdata(r,"y",u),l=a.makeCalcdata(r,"x"),s=_x(r,a,"x",l),f=!!r.xperiodalignment,c="x"),o=s.vals;for(var v=Math.min(o.length,n.length),p=new Array(v),d=0;d<v;d++)p[d]={p:o[d],s:n[d]},f&&(p[d].orig_p=l[d],p[d][c+"End"]=s.ends[d],p[d][c+"Start"]=s.starts[d]),r.ids&&(p[d].id=String(r.ids[d]));return wx(r,"marker")&&Tx(e,r,{vals:r.marker.color,containerStr:"marker",cLetter:"c"}),wx(r,"marker.line")&&Tx(e,r,{vals:r.marker.line.color,containerStr:"marker.line",cLetter:"c"}),J6(p,r),e8(p,r),p},r8=bt,a8=we;function i8(t,e,r){var a=t._fullLayout,i=a["_"+r+"Text_minsize"];if(i){var n=a.uniformtext.mode==="hide",o;switch(r){case"funnelarea":case"pie":case"sunburst":o="g.slice";break;case"treemap":case"icicle":o="g.slice, g.pathbar";break;default:o="g.points > g.point"}e.selectAll(o).each(function(l){var s=l.transform;if(s){s.scale=n&&s.hide?0:i/s.fontSize;var f=r8.select(this).select("text");a8.setTransormAndDisplay(f,s)}})}}function n8(t,e,r){if(r.uniformtext.mode){var a=rA(t),i=r.uniformtext.minsize,n=e.scale*e.fontSize;e.hide=n<i,r[a]=r[a]||1/0,e.hide||(r[a]=Math.min(r[a],Math.max(n,i)))}}function o8(t,e){var r=rA(t);e[r]=void 0}function rA(t){return"_"+t+"Text_minsize"}var mi={recordMinTextSize:n8,clearMinTextSize:o8,resizeText:i8},yi={},l8=kt,s8=_a,aA=we.isArrayOrTypedArray;yi.coerceString=function(t,e,r){if(typeof e=="string"){if(e||!t.noBlank)return e}else if((typeof e=="number"||e===!0)&&!t.strict)return String(e);return r!==void 0?r:t.dflt};yi.coerceNumber=function(t,e,r){if(l8(e)){e=+e;var a=t.min,i=t.max,n=a!==void 0&&e<a||i!==void 0&&e>i;if(!n)return e}return r!==void 0?r:t.dflt};yi.coerceColor=function(t,e,r){return s8(e).isValid()?e:r!==void 0?r:t.dflt};yi.coerceEnumerated=function(t,e,r){return t.coerceNumber&&(e=+e),t.values.indexOf(e)!==-1?e:r!==void 0?r:t.dflt};yi.getValue=function(t,e){var r;return aA(t)?e<t.length&&(r=t[e]):r=t,r};yi.getLineWidth=function(t,e){var r=0<e.mlw?e.mlw:aA(t.marker.line.width)?0:t.marker.line.width;return r};var jl=bt,f8=yt,cs=Et,iA=we,nA=ot,oA=mi.resizeText,dm=Ms,c8=dm.textfont,u8=dm.insidetextfont,v8=dm.outsidetextfont,Lr=yi;function d8(t){var e=jl.select(t).selectAll('g[class^="barlayer"]').selectAll("g.trace");oA(t,e,"bar");var r=e.size(),a=t._fullLayout;e.style("opacity",function(i){return i[0].trace.opacity}).each(function(i){(a.barmode==="stack"&&r>1||a.bargap===0&&a.bargroupgap===0&&!i[0].trace.marker.line.width)&&jl.select(this).attr("shape-rendering","crispEdges")}),e.selectAll("g.points").each(function(i){var n=jl.select(this),o=i[0].trace;lA(n,o,t)}),nA.getComponentMethod("errorbars","style")(e)}function lA(t,e,r){cs.pointStyle(t.selectAll("path"),e,r),sA(t,e,r)}function sA(t,e,r){t.selectAll("text").each(function(a){var i=jl.select(this),n=iA.ensureUniformFontSize(r,fA(i,a,e,r));cs.font(i,n)})}function h8(t,e,r){var a=e[0].trace;a.selectedpoints?p8(r,a,t):(lA(r,a,t),nA.getComponentMethod("errorbars","style")(r))}function p8(t,e,r){cs.selectedPointStyle(t.selectAll("path"),e),m8(t.selectAll("text"),e,r)}function m8(t,e,r){t.each(function(a){var i=jl.select(this),n;if(a.selected){n=iA.ensureUniformFontSize(r,fA(i,a,e,r));var o=e.selected.textfont&&e.selected.textfont.color;o&&(n.color=o),cs.font(i,n)}else cs.selectedTextStyle(i,e)})}function fA(t,e,r,a){var i=a._fullLayout.font,n=r.textfont;if(t.classed("bartext-inside")){var o=dA(e,r);n=uA(r,e.i,i,o)}else t.classed("bartext-outside")&&(n=vA(r,e.i,i));return n}function cA(t,e,r){return hm(c8,t.textfont,e,r)}function uA(t,e,r,a){var i=cA(t,e,r),n=t._input.textfont===void 0||t._input.textfont.color===void 0||Array.isArray(t.textfont.color)&&t.textfont.color[e]===void 0;return n&&(i={color:f8.contrast(a),family:i.family,size:i.size,weight:i.weight,style:i.style,variant:i.variant,textcase:i.textcase,lineposition:i.lineposition,shadow:i.shadow}),hm(u8,t.insidetextfont,e,i)}function vA(t,e,r){var a=cA(t,e,r);return hm(v8,t.outsidetextfont,e,a)}function hm(t,e,r,a){e=e||{};var i=Lr.getValue(e.family,r),n=Lr.getValue(e.size,r),o=Lr.getValue(e.color,r),l=Lr.getValue(e.weight,r),s=Lr.getValue(e.style,r),f=Lr.getValue(e.variant,r),c=Lr.getValue(e.textcase,r),u=Lr.getValue(e.lineposition,r),v=Lr.getValue(e.shadow,r);return{family:Lr.coerceString(t.family,i,a.family),size:Lr.coerceNumber(t.size,n,a.size),color:Lr.coerceColor(t.color,o,a.color),weight:Lr.coerceString(t.weight,l,a.weight),style:Lr.coerceString(t.style,s,a.style),variant:Lr.coerceString(t.variant,f,a.variant),textcase:Lr.coerceString(t.variant,c,a.textcase),lineposition:Lr.coerceString(t.variant,u,a.lineposition),shadow:Lr.coerceString(t.variant,v,a.shadow)}}function dA(t,e){return e.type==="waterfall"?e[t.dir].marker.color:t.mcc||t.mc||e.marker.color}var Cn={style:d8,styleTextPoints:sA,styleOnSelect:h8,getInsideTextFont:uA,getOutsideTextFont:vA,getBarColor:dA,resizeText:oA},gf=bt,bf=kt,kr=we,y8=Tr,g8=yt,Di=Et,b8=ot,Cc=Ot.tickText,hA=mi,x8=hA.recordMinTextSize,_8=hA.clearMinTextSize,pd=Cn,Ho=yi,w8=As,pA=Ms,T8=pA.text,k8=pA.textposition,A8=Ta.appendArrayPointValue,Nr=w8.TEXTPAD;function M8(t){return t.id}function S8(t){if(t.ids)return M8}function md(t){return(t>0)-(t<0)}function Ka(t,e){return t<e?1:-1}function L8(t,e,r,a){var i=[],n=[],o=a?e:r,l=a?r:e;return i[0]=o.c2p(t.s0,!0),n[0]=l.c2p(t.p0,!0),i[1]=o.c2p(t.s1,!0),n[1]=l.c2p(t.p1,!0),a?[i,n]:[n,i]}function mA(t,e,r,a){if(!e.uniformtext.mode&&yA(r)){var i;return a&&(i=a()),t.transition().duration(r.duration).ease(r.easing).each("end",function(){i&&i()}).each("interrupt",function(){i&&i()})}else return t}function yA(t){return t&&t.duration>0}function C8(t,e,r,a,i,n){var o=e.xaxis,l=e.yaxis,s=t._fullLayout,f=t._context.staticPlot;i||(i={mode:s.barmode,norm:s.barmode,gap:s.bargap,groupgap:s.bargroupgap},_8("bar",s));var c=kr.makeTraceGroups(a,r,"trace bars").each(function(u){var v=gf.select(this),p=u[0].trace,d=u[0].t,h=p.type==="waterfall",m=p.type==="funnel",y=p.type==="histogram",b=p.type==="bar",_=b||m,g=0;h&&p.connector.visible&&p.connector.mode==="between"&&(g=p.connector.line.width/2);var x=p.orientation==="h",w=yA(i),T=kr.ensureSingle(v,"g","points"),A=S8(p),M=T.selectAll("g.point").data(kr.identity,A);M.enter().append("g").classed("point",!0),M.exit().remove(),M.each(function(L,E){var F=gf.select(this),N=L8(L,o,l,x),z=N[0][0],H=N[0][1],D=N[1][0],P=N[1][1],k=(x?H-z:P-D)===0;k&&_&&Ho.getLineWidth(p,L)&&(k=!1),k||(k=!bf(z)||!bf(H)||!bf(D)||!bf(P)),L.isBlank=k,k&&(x?H=z:P=D),g&&!k&&(x?(z-=Ka(z,H)*g,H+=Ka(z,H)*g):(D-=Ka(D,P)*g,P+=Ka(D,P)*g));var C,$;if(p.type==="waterfall"){if(!k){var R=p[L.dir].marker;C=R.line.width,$=R.color}}else C=Ho.getLineWidth(p,L),$=L.mc||p.marker.color;function j(J){var be=gf.round(C/2%1,2);return i.gap===0&&i.groupgap===0?gf.round(Math.round(J)-be,2):J}function G(J,be,Z){return Z&&J===be?J:Math.abs(J-be)>=2?j(J):J>be?Math.ceil(J):Math.floor(J)}var Y=g8.opacity($),O=Y<1||C>.01?j:G;t._context.staticPlot||(z=O(z,H,x),H=O(H,z,x),D=O(D,P,!x),P=O(P,D,!x));var K=x?o.c2p:l.c2p,W;L.s0>0?W=L._sMax:L.s0<0?W=L._sMin:W=L.s1>0?L._sMax:L._sMin;function X(J,be){if(!J)return 0;var Z=Math.abs(x?P-D:H-z),me=Math.abs(x?H-z:P-D),ge=O(Math.abs(K(W,!0)-K(0,!0))),Pe=L.hasB?Math.min(Z/2,me/2):Math.min(Z/2,ge),Ee;if(be==="%"){var Le=Math.min(50,J);Ee=Z*(Le/100)}else Ee=J;return O(Math.max(Math.min(Ee,Pe),0))}var B=b||y?X(d.cornerradiusvalue,d.cornerradiusform):0,ee,ae,de="M"+z+","+D+"V"+P+"H"+H+"V"+D+"Z",fe=0;if(B&&L.s){var q=md(L.s0)===0||md(L.s)===md(L.s0)?L.s1:L.s0;if(fe=O(L.hasB?0:Math.abs(K(W,!0)-K(q,!0))),fe<B){var te=Ka(z,H),le=Ka(D,P),ce=te===-le?1:0;if(x)if(L.hasB)ee="M"+(z+B*te)+","+D+"A "+B+","+B+" 0 0 "+ce+" "+z+","+(D+B*le)+"V"+(P-B*le)+"A "+B+","+B+" 0 0 "+ce+" "+(z+B*te)+","+P+"H"+(H-B*te)+"A "+B+","+B+" 0 0 "+ce+" "+H+","+(P-B*le)+"V"+(D+B*le)+"A "+B+","+B+" 0 0 "+ce+" "+(H-B*te)+","+D+"Z";else{ae=Math.abs(H-z)+fe;var ye=ae<B?B-Math.sqrt(ae*(2*B-ae)):0,ue=fe>0?Math.sqrt(fe*(2*B-fe)):0,oe=te>0?Math.max:Math.min;ee="M"+z+","+D+"V"+(P-ye*le)+"H"+oe(H-(B-fe)*te,z)+"A "+B+","+B+" 0 0 "+ce+" "+H+","+(P-B*le-ue)+"V"+(D+B*le+ue)+"A "+B+","+B+" 0 0 "+ce+" "+oe(H-(B-fe)*te,z)+","+(D+ye*le)+"Z"}else if(L.hasB)ee="M"+(z+B*te)+","+D+"A "+B+","+B+" 0 0 "+ce+" "+z+","+(D+B*le)+"V"+(P-B*le)+"A "+B+","+B+" 0 0 "+ce+" "+(z+B*te)+","+P+"H"+(H-B*te)+"A "+B+","+B+" 0 0 "+ce+" "+H+","+(P-B*le)+"V"+(D+B*le)+"A "+B+","+B+" 0 0 "+ce+" "+(H-B*te)+","+D+"Z";else{ae=Math.abs(P-D)+fe;var pe=ae<B?B-Math.sqrt(ae*(2*B-ae)):0,Me=fe>0?Math.sqrt(fe*(2*B-fe)):0,ve=le>0?Math.max:Math.min;ee="M"+(z+pe*te)+","+D+"V"+ve(P-(B-fe)*le,D)+"A "+B+","+B+" 0 0 "+ce+" "+(z+B*te-Me)+","+P+"H"+(H-B*te+Me)+"A "+B+","+B+" 0 0 "+ce+" "+(H-pe*te)+","+ve(P-(B-fe)*le,D)+"V"+D+"Z"}}else ee=de}else ee=de;var ke=mA(kr.ensureSingle(F,"path"),s,i,n);if(ke.style("vector-effect",f?"none":"non-scaling-stroke").attr("d",isNaN((H-z)*(P-D))||k&&t._context.staticPlot?"M0,0Z":ee).call(Di.setClipUrl,e.layerClipId,t),!s.uniformtext.mode&&w){var _e=Di.makePointStyleFns(p);Di.singlePointStyle(L,ke,p,_e,t)}D8(t,e,F,u,E,z,H,D,P,B,fe,i,n),e.layerClipId&&Di.hideOutsideRangePoint(L,F.select("text"),o,l,p.xcalendar,p.ycalendar)});var S=p.cliponaxis===!1;Di.setClipUrl(v,S?null:e.layerClipId,t)});b8.getComponentMethod("errorbars","plot")(t,c,e,i)}function D8(t,e,r,a,i,n,o,l,s,f,c,u,v){var p=e.xaxis,d=e.yaxis,h=t._fullLayout,m;function y(ae,de,fe){var q=kr.ensureSingle(ae,"text").text(de).attr({class:"bartext bartext-"+m,"text-anchor":"middle","data-notex":1}).call(Di.font,fe).call(y8.convertToTspans,t);return q}var b=a[0].trace,_=b.orientation==="h",g=E8(h,a,i,p,d);m=z8(b,i);var x=u.mode==="stack"||u.mode==="relative",w=a[i],T=!x||w._outmost,A=w.hasB,M=f&&f-c>Nr;if(!g||m==="none"||(w.isBlank||n===o||l===s)&&(m==="auto"||m==="inside")){r.select("text").remove();return}var S=h.font,L=pd.getBarColor(a[i],b),E=pd.getInsideTextFont(b,i,S,L),F=pd.getOutsideTextFont(b,i,S),N=b.insidetextanchor||"end",z=r.datum();_?p.type==="log"&&z.s0<=0&&(p.range[0]<p.range[1]?n=0:n=p._length):d.type==="log"&&z.s0<=0&&(d.range[0]<d.range[1]?l=d._length:l=0);var H=Math.abs(o-n),D=Math.abs(s-l),P=H-2*Nr,k=D-2*Nr,C,$,R,j,G;if(m==="outside"&&!T&&!w.hasB&&(m="inside"),m==="auto")if(T){m="inside",G=kr.ensureUniformFontSize(t,E),C=y(r,g,G),$=Di.bBox(C.node()),R=$.width,j=$.height;var Y=R>0&&j>0,O;M?A?O=rn(P-2*f,k,R,j,_)||rn(P,k-2*f,R,j,_):_?O=rn(P-(f-c),k,R,j,_)||rn(P,k-2*(f-c),R,j,_):O=rn(P,k-(f-c),R,j,_)||rn(P-2*(f-c),k,R,j,_):O=rn(P,k,R,j,_),Y&&O?m="inside":(m="outside",C.remove(),C=null)}else m="inside";if(!C){G=kr.ensureUniformFontSize(t,m==="outside"?F:E),C=y(r,g,G);var K=C.attr("transform");if(C.attr("transform",""),$=Di.bBox(C.node()),R=$.width,j=$.height,C.attr("transform",K),R<=0||j<=0){C.remove();return}}var W=b.textangle,X,B;m==="outside"?(B=b.constraintext==="both"||b.constraintext==="outside",X=$8(n,o,l,s,$,{isHorizontal:_,constrained:B,angle:W})):(B=b.constraintext==="both"||b.constraintext==="inside",X=xA(n,o,l,s,$,{isHorizontal:_,constrained:B,angle:W,anchor:N,hasB:A,r:f,overhead:c})),X.fontSize=G.size,x8(b.type==="histogram"?"bar":b.type,X,h),w.transform=X;var ee=mA(C,h,u,v);kr.setTransormAndDisplay(ee,X)}function rn(t,e,r,a,i){if(t<0||e<0)return!1;var n=r<=t&&a<=e,o=r<=e&&a<=t,l=i?t>=r*(e/a):e>=a*(t/r);return n||o||l}function gA(t){return t==="auto"?0:t}function bA(t,e){var r=Math.PI/180*e,a=Math.abs(Math.sin(r)),i=Math.abs(Math.cos(r));return{x:t.width*i+t.height*a,y:t.width*a+t.height*i}}function xA(t,e,r,a,i,n){var o=!!n.isHorizontal,l=!!n.constrained,s=n.angle||0,f=n.anchor,c=f==="end",u=f==="start",v=n.leftToRight||0,p=(v+1)/2,d=1-p,h=n.hasB,m=n.r,y=n.overhead,b=i.width,_=i.height,g=Math.abs(e-t),x=Math.abs(a-r),w=g>2*Nr&&x>2*Nr?Nr:0;g-=2*w,x-=2*w;var T=gA(s);s==="auto"&&!(b<=g&&_<=x)&&(b>g||_>x)&&(!(b>x||_>g)||b<_!=g<x)&&(T+=90);var A=bA(i,T),M,S;if(m&&m-y>Nr){var L=P8(t,e,r,a,A,m,y,o,h);M=L.scale,S=L.pad}else M=1,l&&(M=Math.min(1,g/A.x,x/A.y)),S=0;var E=i.left*d+i.right*p,F=(i.top+i.bottom)/2,N=(t+Nr)*d+(e-Nr)*p,z=(r+a)/2,H=0,D=0;if(u||c){var P=(o?A.x:A.y)/2;m&&(c||h)&&(w+=S);var k=o?Ka(t,e):Ka(r,a);o?u?(N=t+k*w,H=-k*P):(N=e-k*w,H=k*P):u?(z=r+k*w,D=-k*P):(z=a-k*w,D=k*P)}return{textX:E,textY:F,targetX:N,targetY:z,anchorX:H,anchorY:D,scale:M,rotate:T}}function P8(t,e,r,a,i,n,o,l,s){var f=Math.max(0,Math.abs(e-t)-2*Nr),c=Math.max(0,Math.abs(a-r)-2*Nr),u=n-Nr,v=o?u-Math.sqrt(u*u-(u-o)*(u-o)):u,p=s?u*2:l?u-o:2*v,d=s?u*2:l?2*v:u-o,h,m,y,b,_;return i.y/i.x>=c/(f-p)?b=c/i.y:i.y/i.x<=(c-d)/f?b=f/i.x:!s&&l?(h=i.x*i.x+i.y*i.y/4,m=-2*i.x*(f-u)-i.y*(c/2-u),y=(f-u)*(f-u)+(c/2-u)*(c/2-u)-u*u,b=(-m+Math.sqrt(m*m-4*h*y))/(2*h)):s?(h=(i.x*i.x+i.y*i.y)/4,m=-i.x*(f/2-u)-i.y*(c/2-u),y=(f/2-u)*(f/2-u)+(c/2-u)*(c/2-u)-u*u,b=(-m+Math.sqrt(m*m-4*h*y))/(2*h)):(h=i.x*i.x/4+i.y*i.y,m=-i.x*(f/2-u)-2*i.y*(c-u),y=(f/2-u)*(f/2-u)+(c-u)*(c-u)-u*u,b=(-m+Math.sqrt(m*m-4*h*y))/(2*h)),b=Math.min(1,b),l?_=Math.max(0,u-Math.sqrt(Math.max(0,u*u-(u-(c-i.y*b)/2)*(u-(c-i.y*b)/2)))-o):_=Math.max(0,u-Math.sqrt(Math.max(0,u*u-(u-(f-i.x*b)/2)*(u-(f-i.x*b)/2)))-o),{scale:b,pad:_}}function $8(t,e,r,a,i,n){var o=!!n.isHorizontal,l=!!n.constrained,s=n.angle||0,f=i.width,c=i.height,u=Math.abs(e-t),v=Math.abs(a-r),p;o?p=v>2*Nr?Nr:0:p=u>2*Nr?Nr:0;var d=1;l&&(d=o?Math.min(1,v/c):Math.min(1,u/f));var h=gA(s),m=bA(i,h),y=(o?m.x:m.y)/2,b=(i.left+i.right)/2,_=(i.top+i.bottom)/2,g=(t+e)/2,x=(r+a)/2,w=0,T=0,A=o?Ka(e,t):Ka(r,a);return o?(g=e-A*p,w=A*y):(x=a+A*p,T=-A*y),{textX:b,textY:_,targetX:g,targetY:x,anchorX:w,anchorY:T,scale:d,rotate:h}}function E8(t,e,r,a,i){var n=e[0].trace,o=n.texttemplate,l;return o?l=R8(t,e,r,a,i):n.textinfo?l=I8(e,r,a,i):l=Ho.getValue(n.text,r),Ho.coerceString(T8,l)}function z8(t,e){var r=Ho.getValue(t.textposition,e);return Ho.coerceEnumerated(k8,r)}function R8(t,e,r,a,i){var n=e[0].trace,o=kr.castOption(n,r,"texttemplate");if(!o)return"";var l=n.type==="histogram",s=n.type==="waterfall",f=n.type==="funnel",c=n.orientation==="h",u,v,p,d;c?(u="y",v=i,p="x",d=a):(u="x",v=a,p="y",d=i);function h(w){return Cc(v,v.c2l(w),!0).text}function m(w){return Cc(d,d.c2l(w),!0).text}var y=e[r],b={};b.label=y.p,b.labelLabel=b[u+"Label"]=h(y.p);var _=kr.castOption(n,y.i,"text");(_===0||_)&&(b.text=_),b.value=y.s,b.valueLabel=b[p+"Label"]=m(y.s);var g={};A8(g,n,y.i),(l||g.x===void 0)&&(g.x=c?b.value:b.label),(l||g.y===void 0)&&(g.y=c?b.label:b.value),(l||g.xLabel===void 0)&&(g.xLabel=c?b.valueLabel:b.labelLabel),(l||g.yLabel===void 0)&&(g.yLabel=c?b.labelLabel:b.valueLabel),s&&(b.delta=+y.rawS||y.s,b.deltaLabel=m(b.delta),b.final=y.v,b.finalLabel=m(b.final),b.initial=b.final-b.delta,b.initialLabel=m(b.initial)),f&&(b.value=y.s,b.valueLabel=m(b.value),b.percentInitial=y.begR,b.percentInitialLabel=kr.formatPercent(y.begR),b.percentPrevious=y.difR,b.percentPreviousLabel=kr.formatPercent(y.difR),b.percentTotal=y.sumR,b.percenTotalLabel=kr.formatPercent(y.sumR));var x=kr.castOption(n,y.i,"customdata");return x&&(b.customdata=x),kr.texttemplateString(o,b,t._d3locale,g,b,n._meta||{})}function I8(t,e,r,a){var i=t[0].trace,n=i.orientation==="h",o=i.type==="waterfall",l=i.type==="funnel";function s(x){var w=n?a:r;return Cc(w,x,!0).text}function f(x){var w=n?r:a;return Cc(w,+x,!0).text}var c=i.textinfo,u=t[e],v=c.split("+"),p=[],d,h=function(x){return v.indexOf(x)!==-1};if(h("label")&&p.push(s(t[e].p)),h("text")&&(d=kr.castOption(i,u.i,"text"),(d===0||d)&&p.push(d)),o){var m=+u.rawS||u.s,y=u.v,b=y-m;h("initial")&&p.push(f(b)),h("delta")&&p.push(f(m)),h("final")&&p.push(f(y))}if(l){h("value")&&p.push(f(u.s));var _=0;h("percent initial")&&_++,h("percent previous")&&_++,h("percent total")&&_++;var g=_>1;h("percent initial")&&(d=kr.formatPercent(u.begR),g&&(d+=" of initial"),p.push(d)),h("percent previous")&&(d=kr.formatPercent(u.difR),g&&(d+=" of previous"),p.push(d)),h("percent total")&&(d=kr.formatPercent(u.sumR),g&&(d+=" of total"),p.push(d))}return p.join("<br>")}var pm={plot:C8,toMoveInsideBar:xA},xl=Na,F8=ot,kx=yt,N8=we.fillText,H8=yi.getLineWidth,yd=Ot.hoverLabelText,O8=fr.BADNUM;function j8(t,e,r,a,i){var n=_A(t,e,r,a,i);if(n){var o=n.cd,l=o[0].trace,s=o[n.index];return n.color=wA(l,s),F8.getComponentMethod("errorbars","hoverInfo")(s,l,n),[n]}}function _A(t,e,r,a,i){var n=t.cd,o=n[0].trace,l=n[0].t,s=a==="closest",f=o.type==="waterfall",c=t.maxHoverDistance,u=t.maxSpikeDistance,v,p,d,h,m,y,b;o.orientation==="h"?(v=r,p=e,d="y",h="x",m=z,y=E):(v=e,p=r,d="x",h="y",y=z,m=E);var _=o[d+"period"],g=s||_;function x(O){return T(O,-1)}function w(O){return T(O,1)}function T(O,K){var W=O.w;return O[d]+K*W/2}function A(O){return O[d+"End"]-O[d+"Start"]}var M=s?x:_?function(O){return O.p-A(O)/2}:function(O){return Math.min(x(O),O.p-l.bardelta/2)},S=s?w:_?function(O){return O.p+A(O)/2}:function(O){return Math.max(w(O),O.p+l.bardelta/2)};function L(O,K,W){return i.finiteRange&&(W=0),xl.inbox(O-v,K-v,W+Math.min(1,Math.abs(K-O)/b)-1)}function E(O){return L(M(O),S(O),c)}function F(O){return L(x(O),w(O),u)}function N(O){var K=O[h];if(f){var W=Math.abs(O.rawS)||0;p>0?K+=W:p<0&&(K-=W)}return K}function z(O){var K=p,W=O.b,X=N(O);return xl.inbox(W-K,X-K,c+(X-K)/(X-W)-1)}function H(O){var K=p,W=O.b,X=N(O);return xl.inbox(W-K,X-K,u+(X-K)/(X-W)-1)}var D=t[d+"a"],P=t[h+"a"];b=Math.abs(D.r2c(D.range[1])-D.r2c(D.range[0]));function k(O){return(m(O)+y(O))/2}var C=xl.getDistanceFunction(a,m,y,k);if(xl.getClosest(n,C,t),t.index!==!1&&n[t.index].p!==O8){g||(M=function(O){return Math.min(x(O),O.p-l.bargroupwidth/2)},S=function(O){return Math.max(w(O),O.p+l.bargroupwidth/2)});var $=t.index,R=n[$],j=o.base?R.b+R.s:R.s;t[h+"0"]=t[h+"1"]=P.c2p(R[h],!0),t[h+"LabelVal"]=j;var G=l.extents[l.extents.round(R.p)];t[d+"0"]=D.c2p(s?M(R):G[0],!0),t[d+"1"]=D.c2p(s?S(R):G[1],!0);var Y=R.orig_p!==void 0;return t[d+"LabelVal"]=Y?R.orig_p:R.p,t.labelLabel=yd(D,t[d+"LabelVal"],o[d+"hoverformat"]),t.valueLabel=yd(P,t[h+"LabelVal"],o[h+"hoverformat"]),t.baseLabel=yd(P,R.b,o[h+"hoverformat"]),t.spikeDistance=(H(R)+F(R))/2,t[d+"Spike"]=D.c2p(R.p,!0),N8(R,o,t),t.hovertemplate=o.hovertemplate,t}}function wA(t,e){var r=e.mcc||t.marker.color,a=e.mlcc||t.marker.line.color,i=H8(t,e);if(kx.opacity(r))return r;if(kx.opacity(a)&&i)return a}var TA={hoverPoints:j8,hoverOnBars:_A,getTraceColor:wA},B8=function(e,r,a){return e.x="xVal"in r?r.xVal:r.x,e.y="yVal"in r?r.yVal:r.y,r.xa&&(e.xaxis=r.xa),r.ya&&(e.yaxis=r.ya),a.orientation==="h"?(e.label=e.y,e.value=e.x):(e.label=e.x,e.value=e.y),e},kA=function(e,r){var a=e.cd,i=e.xaxis,n=e.yaxis,o=a[0].trace,l=o.type==="funnel",s=o.orientation==="h",f=[],c;if(r===!1)for(c=0;c<a.length;c++)a[c].selected=0;else for(c=0;c<a.length;c++){var u=a[c],v="ct"in u?u.ct:G8(u,i,n,s,l);r.contains(v,!1,c,e)?(f.push({pointNumber:c,x:i.c2d(u.x),y:n.c2d(u.y)}),u.selected=1):u.selected=0}return f};function G8(t,e,r,a,i){var n=e.c2p(a?t.s0:t.p0,!0),o=e.c2p(a?t.s1:t.p1,!0),l=r.c2p(a?t.p0:t.s0,!0),s=r.c2p(a?t.p1:t.s1,!0);return i?[(n+o)/2,(l+s)/2]:a?[o,(l+s)/2]:[(n+o)/2,s]}var U8={attributes:Ms,layoutAttributes:um,supplyDefaults:Ln.supplyDefaults,crossTraceDefaults:Ln.crossTraceDefaults,supplyLayoutDefaults:tA,calc:t8,crossTraceCalc:Qp.crossTraceCalc,colorbar:Ts,arraysToCalcdata:vm,plot:pm.plot,style:Cn.style,styleOnSelect:Cn.styleOnSelect,hoverPoints:TA.hoverPoints,eventData:B8,selectPoints:kA,moduleType:"trace",name:"bar",basePlotModule:pr,categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],animatable:!0,meta:{description:["The data visualized by the span of the bars is set in `y`","if `orientation` is set to *v* (the default)","and the labels are set in `x`.","By setting `orientation` to *h*, the roles are interchanged."].join(" ")}},V8=U8;const MB=Ni(V8);var W8=function(e,r){return{start:{valType:"any",editType:"calc",description:["Sets the starting value for the",e,"axis bins. Defaults to the minimum data value,","shifted down if necessary to make nice round values","and to remove ambiguous bin edges. For example, if most of the","data is integers we shift the bin edges 0.5 down, so a `size`","of 5 would have a default `start` of -0.5, so it is clear","that 0-4 are in the first bin, 5-9 in the second, but","continuous data gets a start of 0 and bins [0,5), [5,10) etc.","Dates behave similarly, and `start` should be a date string.","For category data, `start` is based on the category serial","numbers, and defaults to -0.5.",r?"If multiple non-overlaying histograms share a subplot, the first explicit `start` is used exactly and all others are shifted down (if necessary) to differ from that one by an integer number of bins.":""].join(" ")},end:{valType:"any",editType:"calc",description:["Sets the end value for the",e,"axis bins. The last bin may not end exactly at this value,","we increment the bin edge by `size` from `start` until we","reach or exceed `end`. Defaults to the maximum data value.","Like `start`, for dates use a date string, and for category","data `end` is based on the category serial numbers."].join(" ")},size:{valType:"any",editType:"calc",description:["Sets the size of each",e,"axis bin.","Default behavior: If `nbins"+e+"` is 0 or omitted,","we choose a nice round bin size such that the number of bins","is about the same as the typical number of samples in each bin.","If `nbins"+e+"` is provided, we choose a nice round","bin size giving no more than that many bins.","For date data, use milliseconds or *M<n>* for months, as in","`axis.dtick`. For category data, the number of categories to","bin together (always defaults to 1).",r?"If multiple non-overlaying histograms share a subplot, the first explicit `size` is used and all others discarded. If no `size` is provided,the sample data from all traces is combined to determine `size` as described above.":""].join(" ")},editType:"calc"}},X8={eventDataKeys:["binNumber"]},Xr=Ms,Ax=qo.axisHoverFormat,Y8=zr.hovertemplateAttrs,q8=zr.texttemplateAttrs,gd=Mr,Mx=W8,Z8=X8,bd=Xt.extendFlat,AA={x:{valType:"data_array",editType:"calc+clearAxisTypes",description:["Sets the sample data to be binned on the x axis."].join(" ")},y:{valType:"data_array",editType:"calc+clearAxisTypes",description:["Sets the sample data to be binned on the y axis."].join(" ")},xhoverformat:Ax("x"),yhoverformat:Ax("y"),text:bd({},Xr.text,{description:["Sets hover text elements associated with each bar.","If a single string, the same string appears over all bars.","If an array of string, the items are mapped in order to the","this trace's coordinates."].join(" ")}),hovertext:bd({},Xr.hovertext,{description:"Same as `text`."}),orientation:Xr.orientation,histfunc:{valType:"enumerated",values:["count","sum","avg","min","max"],dflt:"count",editType:"calc",description:["Specifies the binning function used for this histogram trace.","If *count*, the histogram values are computed by counting the","number of values lying inside each bin.","If *sum*, *avg*, *min*, *max*,","the histogram values are computed using","the sum, the average, the minimum or the maximum","of the values lying inside each bin respectively."].join(" ")},histnorm:{valType:"enumerated",values:["","percent","probability","density","probability density"],dflt:"",editType:"calc",description:["Specifies the type of normalization used for this histogram trace.","If **, the span of each bar corresponds to the number of","occurrences (i.e. the number of data points lying inside the bins).","If *percent* / *probability*, the span of each bar corresponds to","the percentage / fraction of occurrences with respect to the total","number of sample points","(here, the sum of all bin HEIGHTS equals 100% / 1).","If *density*, the span of each bar corresponds to the number of","occurrences in a bin divided by the size of the bin interval","(here, the sum of all bin AREAS equals the","total number of sample points).","If *probability density*, the area of each bar corresponds to the","probability that an event will fall into the corresponding bin","(here, the sum of all bin AREAS equals 1)."].join(" ")},cumulative:{enabled:{valType:"boolean",dflt:!1,editType:"calc",description:["If true, display the cumulative distribution by summing the","binned values. Use the `direction` and `centralbin` attributes","to tune the accumulation method.","Note: in this mode, the *density* `histnorm` settings behave","the same as their equivalents without *density*:","** and *density* both rise to the number of data points, and","*probability* and *probability density* both rise to the","number of sample points."].join(" ")},direction:{valType:"enumerated",values:["increasing","decreasing"],dflt:"increasing",editType:"calc",description:["Only applies if cumulative is enabled.","If *increasing* (default) we sum all prior bins, so the result","increases from left to right. If *decreasing* we sum later bins","so the result decreases from left to right."].join(" ")},currentbin:{valType:"enumerated",values:["include","exclude","half"],dflt:"include",editType:"calc",description:["Only applies if cumulative is enabled.","Sets whether the current bin is included, excluded, or has half","of its value included in the current cumulative value.","*include* is the default for compatibility with various other","tools, however it introduces a half-bin bias to the results.","*exclude* makes the opposite half-bin bias, and *half* removes","it."].join(" ")},editType:"calc"},nbinsx:{valType:"integer",min:0,dflt:0,editType:"calc",description:["Specifies the maximum number of desired bins. This value will be used","in an algorithm that will decide the optimal bin size such that the","histogram best visualizes the distribution of the data.","Ignored if `xbins.size` is provided."].join(" ")},xbins:Mx("x",!0),nbinsy:{valType:"integer",min:0,dflt:0,editType:"calc",description:["Specifies the maximum number of desired bins. This value will be used","in an algorithm that will decide the optimal bin size such that the","histogram best visualizes the distribution of the data.","Ignored if `ybins.size` is provided."].join(" ")},ybins:Mx("y",!0),autobinx:{valType:"boolean",dflt:null,editType:"calc",description:["Obsolete: since v1.42 each bin attribute is auto-determined","separately and `autobinx` is not needed. However, we accept","`autobinx: true` or `false` and will update `xbins` accordingly","before deleting `autobinx` from the trace."].join(" ")},autobiny:{valType:"boolean",dflt:null,editType:"calc",description:["Obsolete: since v1.42 each bin attribute is auto-determined","separately and `autobiny` is not needed. However, we accept","`autobiny: true` or `false` and will update `ybins` accordingly","before deleting `autobiny` from the trace."].join(" ")},bingroup:{valType:"string",dflt:"",editType:"calc",description:["Set a group of histogram traces which will have compatible bin settings.","Note that traces on the same subplot and with the same *orientation*","under `barmode` *stack*, *relative* and *group* are forced into the same bingroup,","Using `bingroup`, traces under `barmode` *overlay* and on different axes","(of the same axis type) can have compatible bin settings.","Note that histogram and histogram2d* trace can share the same `bingroup`"].join(" ")},hovertemplate:Y8({},{keys:Z8.eventDataKeys}),texttemplate:q8({arrayOk:!1,editType:"plot"},{keys:["label","value"]}),textposition:bd({},Xr.textposition,{arrayOk:!1}),textfont:gd({arrayOk:!1,editType:"plot",colorEditType:"style",description:"Sets the text font."}),outsidetextfont:gd({arrayOk:!1,editType:"plot",colorEditType:"style",description:"Sets the font used for `text` lying outside the bar."}),insidetextfont:gd({arrayOk:!1,editType:"plot",colorEditType:"style",description:"Sets the font used for `text` lying inside the bar."}),insidetextanchor:Xr.insidetextanchor,textangle:Xr.textangle,cliponaxis:Xr.cliponaxis,constraintext:Xr.constraintext,marker:Xr.marker,offsetgroup:Xr.offsetgroup,alignmentgroup:Xr.alignmentgroup,selected:Xr.selected,unselected:Xr.unselected,zorder:Xr.zorder},Sx=ot,_l=we,Lx=yt,K8=Ln.handleText,Q8=Kk,J8=AA,eH=function(e,r,a,i){function n(b,_){return _l.coerce(e,r,J8,b,_)}var o=n("x"),l=n("y"),s=n("cumulative.enabled");s&&(n("cumulative.direction"),n("cumulative.currentbin")),n("text");var f=n("textposition");K8(e,r,i,n,f,{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),n("hovertext"),n("hovertemplate"),n("xhoverformat"),n("yhoverformat");var c=n("orientation",l&&!o?"h":"v"),u=c==="v"?"x":"y",v=c==="v"?"y":"x",p=o&&l?Math.min(_l.minRowLength(o)&&_l.minRowLength(l)):_l.minRowLength(r[u]||[]);if(!p){r.visible=!1;return}r._length=p;var d=Sx.getComponentMethod("calendars","handleTraceDefaults");d(e,r,["x","y"],i);var h=r[v];h&&n("histfunc"),n("histnorm"),n("autobin"+u),Q8(e,r,n,a,i),_l.coerceSelectionMarkerOpacity(r,n);var m=(r.marker.line||{}).color,y=Sx.getComponentMethod("errorbars","supplyDefaults");y(e,r,m||Lx.defaultLine,{axis:"y"}),y(e,r,m||Lx.defaultLine,{axis:"x",inherit:"y"}),n("zorder")},Pl=we,tH=cr,xf=ot.traceIs,rH=Xp,aH=Ln.validateCornerradius,Cx=Pl.nestedProperty,xd=pi.getAxisGroup,Dx=[{aStr:{x:"xbins.start",y:"ybins.start"},name:"start"},{aStr:{x:"xbins.end",y:"ybins.end"},name:"end"},{aStr:{x:"xbins.size",y:"ybins.size"},name:"size"},{aStr:{x:"nbinsx",y:"nbinsy"},name:"nbins"}],iH=["x","y"],nH=function(e,r){var a=r._histogramBinOpts={},i=[],n={},o=[],l,s,f,c,u,v,p;function d(z,H){return Pl.coerce(l._input,l,l._module.attributes,z,H)}function h(z){return z.orientation==="v"?"x":"y"}function m(z,H){var D=tH.getFromTrace({_fullLayout:r},z,H);return D.type}function y(z,H,D){var P=z.uid+"__"+D;H||(H=P);var k=m(z,D),C=z[D+"calendar"]||"",$=a[H],R=!0;$&&(k===$.axType&&C===$.calendar?(R=!1,$.traces.push(z),$.dirs.push(D)):(H=P,k!==$.axType&&Pl.warn(["Attempted to group the bins of trace",z.index,"set on a","type:"+k,"axis","with bins on","type:"+$.axType,"axis."].join(" ")),C!==$.calendar&&Pl.warn(["Attempted to group the bins of trace",z.index,"set with a",C,"calendar","with bins",$.calendar?"on a "+$.calendar+" calendar":"w/o a set calendar"].join(" ")))),R&&(a[H]={traces:[z],dirs:[D],axType:k,calendar:z[D+"calendar"]||""}),z["_"+D+"bingroup"]=H}for(u=0;u<e.length;u++)if(l=e[u],xf(l,"histogram")){if(i.push(l),delete l._xautoBinFinished,delete l._yautoBinFinished,l.type==="histogram"){var b=d("marker.cornerradius",r.barcornerradius);l.marker&&(l.marker.cornerradius=aH(b))}xf(l,"2dMap")||rH(l._input,l,r,d,r.barmode)}var _=r._alignmentOpts||{};for(u=0;u<i.length;u++){if(l=i[u],f="",!xf(l,"2dMap")){if(c=h(l),r.barmode==="group"&&l.alignmentgroup){var g=l[c+"axis"],x=xd(r,g)+l.orientation;(_[x]||{})[l.alignmentgroup]&&(f=x)}!f&&r.barmode!=="overlay"&&(f=xd(r,l.xaxis)+xd(r,l.yaxis)+h(l))}f?(n[f]||(n[f]=[]),n[f].push(l)):o.push(l)}for(f in n){if(s=n[f],s.length===1){o.push(s[0]);continue}var w=!1;for(s.length&&(l=s[0],w=d("bingroup")),f=w||f,u=0;u<s.length;u++){l=s[u];var T=l._input.bingroup;T&&T!==f&&Pl.warn(["Trace",l.index,"must match","within bingroup",f+".","Ignoring its bingroup:",T,"setting."].join(" ")),l.bingroup=f,y(l,f,h(l))}}for(u=0;u<o.length;u++){l=o[u];var A=d("bingroup");if(xf(l,"2dMap"))for(p=0;p<2;p++){c=iH[p];var M=d(c+"bingroup",A?A+"__"+c:null);y(l,M,c)}else y(l,A,h(l))}for(f in a){var S=a[f];for(s=S.traces,v=0;v<Dx.length;v++){var L=Dx[v],E=L.name,F,N;if(!(E==="nbins"&&S.sizeFound)){for(u=0;u<s.length;u++){if(l=s[u],c=S.dirs[u],F=L.aStr[c],Cx(l._input,F).get()!==void 0){S[E]=d(F),S[E+"Found"]=!0;break}N=(l._autoBin||{})[c]||{},N[E]&&Cx(l,F).set(N[E])}if(E==="start"||E==="end")for(;u<s.length;u++)l=s[u],l["_"+c+"bingroup"]&&(N=(l._autoBin||{})[c]||{},d(F,N[E]));E==="nbins"&&!S.sizeFound&&!S.nbinsFound&&(l=s[0],S[E]=d(F))}}}},to=kt,oH={count:function(t,e,r){return r[t]++,1},sum:function(t,e,r,a){var i=a[e];return to(i)?(i=Number(i),r[t]+=i,i):0},avg:function(t,e,r,a,i){var n=a[e];return to(n)&&(n=Number(n),r[t]+=n,i[t]++),0},min:function(t,e,r,a){var i=a[e];if(to(i))if(i=Number(i),to(r[t])){if(r[t]>i){var n=i-r[t];return r[t]=i,n}}else return r[t]=i,i;return 0},max:function(t,e,r,a){var i=a[e];if(to(i))if(i=Number(i),to(r[t])){if(r[t]<i){var n=i-r[t];return r[t]=i,n}}else return r[t]=i,i;return 0}},lH={percent:function(t,e){for(var r=t.length,a=100/e,i=0;i<r;i++)t[i]*=a},probability:function(t,e){for(var r=t.length,a=0;a<r;a++)t[a]/=e},density:function(t,e,r,a){var i=t.length;a=a||1;for(var n=0;n<i;n++)t[n]*=r[n]*a},"probability density":function(t,e,r,a){var i=t.length;a&&(e/=a);for(var n=0;n<i;n++)t[n]*=r[n]/e}},sH=function(e,r){for(var a=e.length,i=0,n=0;n<a;n++)r[n]?(e[n]/=r[n],i+=e[n]):e[n]=null;return i},Jo=fr,wn=Jo.ONEAVGYEAR,Px=Jo.ONEAVGMONTH,Dc=Jo.ONEDAY,$x=Jo.ONEHOUR,Ex=Jo.ONEMIN,zx=Jo.ONESEC,Rx=Ot.tickIncrement,fH=function(e,r,a,i,n){var o=-1.1*r,l=-.1*r,s=e-l,f=a[0],c=a[1],u=Math.min(_f(f+l,f+s,i,n),_f(c+l,c+s,i,n)),v=Math.min(_f(f+o,f+l,i,n),_f(c+o,c+l,i,n)),p,d;if(u>v&&v<Math.abs(c-f)/4e3?(p=u,d=!1):(p=Math.min(u,v),d=!0),i.type==="date"&&p>Dc){var h=p===wn?1:6,m=p===wn?"M12":"M1";return function(y,b){var _=i.c2d(y,wn,n),g=_.indexOf("-",h);g>0&&(_=_.substr(0,g));var x=i.d2c(_,0,n);if(x<y){var w=Rx(x,m,!1,n);(x+w)/2<y+e&&(x=w)}return b&&d?Rx(x,m,!0,n):x}}return function(y,b){var _=p*Math.round(y/p);return _+p/10<y&&_+p*.9<y+e&&(_+=p),b&&d&&(_-=p),_}};function _f(t,e,r,a){if(t*e<=0)return 1/0;for(var i=Math.abs(e-t),n=r.type==="date",o=Ix(i,n),l=0;l<10;l++){var s=Ix(o*80,n);if(o===s)break;if(cH(s,t,e,n,r,a))o=s;else break}return o}function Ix(t,e){return e&&t>zx?t>Dc?t>wn*1.1?wn:t>Px*1.1?Px:Dc:t>$x?$x:t>Ex?Ex:zx:Math.pow(10,Math.floor(Math.log(t)/Math.LN10))}function cH(t,e,r,a,i,n){if(a&&t>Dc){var o=Fx(e,i,n),l=Fx(r,i,n),s=t===wn?0:1;return o[s]!==l[s]}return Math.floor(r/t)-Math.floor(e/t)>.1}function Fx(t,e,r){var a=e.c2d(t,wn,r).split("-");return a[0]===""&&(a.unshift(),a[0]="-"+a[0]),a}var kh=kt,Fr=we,Nx=ot,pa=Ot,uH=vm,Hx=oH,vH=lH,dH=sH,hH=fH;function pH(t,e){var r=[],a=[],i=e.orientation==="h",n=pa.getFromId(t,i?e.yaxis:e.xaxis),o=i?"y":"x",l={x:"y",y:"x"}[o],s=e[o+"calendar"],f=e.cumulative,c,u=mm(t,e,n,o),v=u[0],p=u[1],d=typeof v.size=="string",h=[],m=d?h:v,y=[],b=[],_=[],g=0,x=e.histnorm,w=e.histfunc,T=x.indexOf("density")!==-1,A,M,S;f.enabled&&T&&(x=x.replace(/ ?density$/,""),T=!1);var L=w==="max"||w==="min",E=L?null:0,F=Hx.count,N=vH[x],z=!1,H=function(ae){return n.r2c(ae,0,s)},D;for(Fr.isArrayOrTypedArray(e[l])&&w!=="count"&&(D=e[l],z=w==="avg",F=Hx[w]),c=H(v.start),M=H(v.end)+(c-pa.tickIncrement(c,v.size,!1,s))/1e6;c<M&&r.length<1e6&&(A=pa.tickIncrement(c,v.size,!1,s),r.push((c+A)/2),a.push(E),_.push([]),h.push(c),T&&y.push(1/(A-c)),z&&b.push(0),!(A<=c));)c=A;h.push(c),!d&&n.type==="date"&&(m={start:H(m.start),end:H(m.end),size:m.size}),t._fullLayout._roundFnOpts||(t._fullLayout._roundFnOpts={});var P=e["_"+o+"bingroup"],k={leftGap:1/0,rightGap:1/0};P&&(t._fullLayout._roundFnOpts[P]||(t._fullLayout._roundFnOpts[P]=k),k=t._fullLayout._roundFnOpts[P]);var C=a.length,$=!0,R=k.leftGap,j=k.rightGap,G={};for(c=0;c<p.length;c++){var Y=p[c];S=Fr.findBin(Y,m),S>=0&&S<C&&(g+=F(S,c,a,D,b),$&&_[S].length&&Y!==p[_[S][0]]&&($=!1),_[S].push(c),G[c]=S,R=Math.min(R,Y-h[S]),j=Math.min(j,h[S+1]-Y))}k.leftGap=R,k.rightGap=j;var O;$||(O=function(ae,de){return function(){var fe=t._fullLayout._roundFnOpts[P];return hH(fe.leftGap,fe.rightGap,h,n,s)(ae,de)}}),z&&(g=dH(a,b)),N&&N(a,g,y),f.enabled&&gH(a,f.direction,f.currentbin);var K=Math.min(r.length,a.length),W=[],X=0,B=K-1;for(c=0;c<K;c++)if(a[c]){X=c;break}for(c=K-1;c>=X;c--)if(a[c]){B=c;break}for(c=X;c<=B;c++)if(kh(r[c])&&kh(a[c])){var ee={p:r[c],s:a[c],b:0};f.enabled||(ee.pts=_[c],$?ee.ph0=ee.ph1=_[c].length?p[_[c][0]]:r[c]:(e._computePh=!0,ee.ph0=O(h[c]),ee.ph1=O(h[c+1],!0))),W.push(ee)}return W.length===1&&(W[0].width1=pa.tickIncrement(W[0].p,v.size,!1,s)-W[0].p),uH(W,e),Fr.isArrayOrTypedArray(e.selectedpoints)&&Fr.tagSelected(W,e,G),W}function mm(t,e,r,a,i){var n=a+"bins",o=t._fullLayout,l=e["_"+a+"bingroup"],s=o._histogramBinOpts[l],f=o.barmode==="overlay",c,u,v,p,d,h,m,y=function(Y){return r.r2c(Y,0,p)},b=function(Y){return r.c2r(Y,0,p)},_=r.type==="date"?function(Y){return Y||Y===0?Fr.cleanDate(Y,null,p):null}:function(Y){return kh(Y)?Number(Y):null};function g(Y,O,K){O[Y+"Found"]?(O[Y]=_(O[Y]),O[Y]===null&&(O[Y]=K[Y])):(h[Y]=O[Y]=K[Y],Fr.nestedProperty(u[0],n+"."+Y).set(K[Y]))}if(e["_"+a+"autoBinFinished"])delete e["_"+a+"autoBinFinished"];else{u=s.traces;var x=[],w=!0,T=!1,A=!1;for(c=0;c<u.length;c++)if(v=u[c],v.visible){var M=s.dirs[c];d=v["_"+M+"pos0"]=r.makeCalcdata(v,M),x=Fr.concat(x,d),delete v["_"+a+"autoBinFinished"],e.visible===!0&&(w?w=!1:(delete v._autoBin,v["_"+a+"autoBinFinished"]=1),Nx.traceIs(v,"2dMap")&&(T=!0),v.type==="histogram2dcontour"&&(A=!0))}p=u[0][a+"calendar"];var S=pa.autoBin(x,r,s.nbins,T,p,s.sizeFound&&s.size),L=u[0]._autoBin={};if(h=L[s.dirs[0]]={},A&&(s.size||(S.start=b(pa.tickIncrement(y(S.start),S.size,!0,p))),s.end===void 0&&(S.end=b(pa.tickIncrement(y(S.end),S.size,!1,p)))),f&&!Nx.traceIs(e,"2dMap")&&S._dataSpan===0&&r.type!=="category"&&r.type!=="multicategory"&&e.bingroup===""&&typeof e.xbins>"u"){if(i)return[S,d,!0];S=mH(t,e,r,a,n)}m=v.cumulative||{},m.enabled&&m.currentbin!=="include"&&(m.direction==="decreasing"?S.start=b(pa.tickIncrement(y(S.start),S.size,!0,p)):S.end=b(pa.tickIncrement(y(S.end),S.size,!1,p))),s.size=S.size,s.sizeFound||(h.size=S.size,Fr.nestedProperty(u[0],n+".size").set(S.size)),g("start",s,S),g("end",s,S)}d=e["_"+a+"pos0"],delete e["_"+a+"pos0"];var E=e._input[n]||{},F=Fr.extendFlat({},s),N=s.start,z=r.r2l(E.start),H=z!==void 0;if((s.startFound||H)&&z!==r.r2l(N)){var D=H?z:Fr.aggNums(Math.min,null,d),P={type:r.type==="category"||r.type==="multicategory"?"linear":r.type,r2l:r.r2l,dtick:s.size,tick0:N,calendar:p,range:[D,pa.tickIncrement(D,s.size,!1,p)].map(r.l2r)},k=pa.tickFirst(P);k>r.r2l(D)&&(k=pa.tickIncrement(k,s.size,!0,p)),F.start=r.l2r(k),H||Fr.nestedProperty(e,n+".start").set(F.start)}var C=s.end,$=r.r2l(E.end),R=$!==void 0;if((s.endFound||R)&&$!==r.r2l(C)){var j=R?$:Fr.aggNums(Math.max,null,d);F.end=r.l2r(j),R||Fr.nestedProperty(e,n+".start").set(F.end)}var G="autobin"+a;return e._input[G]===!1&&(e._input[n]=Fr.extendFlat({},e[n]||{}),delete e._input[G],delete e[G]),[F,d]}function mH(t,e,r,a,i){var n=t._fullLayout,o=yH(t,e),l=!1,s=1/0,f=[e],c,u,v;for(c=0;c<o.length;c++)if(u=o[c],u===e)l=!0;else if(!l)v=n._histogramBinOpts[u["_"+a+"bingroup"]],s=Math.min(s,v.size||u[i].size);else{var p=mm(t,u,r,a,!0),d=p[0],h=p[2];u["_"+a+"autoBinFinished"]=1,u["_"+a+"pos0"]=p[1],h?f.push(u):s=Math.min(s,d.size)}var m=new Array(f.length);for(c=0;c<f.length;c++)for(var y=f[c]["_"+a+"pos0"],b=0;b<y.length;b++)if(y[b]!==void 0){m[c]=y[b];break}for(isFinite(s)||(s=Fr.distinctVals(m).minDiff),c=0;c<f.length;c++){u=f[c];var _=u[a+"calendar"],g={start:r.c2r(m[c]-s/2,0,_),end:r.c2r(m[c]+s/2,0,_),size:s};u._input[i]=u[i]=g,v=n._histogramBinOpts[u["_"+a+"bingroup"]],v&&Fr.extendFlat(v,g)}return e[i]}function yH(t,e){for(var r=e.xaxis,a=e.yaxis,i=e.orientation,n=[],o=t._fullData,l=0;l<o.length;l++){var s=o[l];s.type==="histogram"&&s.visible===!0&&s.orientation===i&&s.xaxis===r&&s.yaxis===a&&n.push(s)}return n}function gH(t,e,r){var a,i,n;function o(s){n=t[s],t[s]/=2}function l(s){i=t[s],t[s]=n+i/2,n+=i}if(r==="half")if(e==="increasing")for(o(0),a=1;a<t.length;a++)l(a);else for(o(t.length-1),a=t.length-2;a>=0;a--)l(a);else if(e==="increasing"){for(a=1;a<t.length;a++)t[a]+=t[a-1];r==="exclude"&&(t.unshift(0),t.pop())}else{for(a=t.length-2;a>=0;a--)t[a]+=t[a+1];r==="exclude"&&(t.push(0),t.shift())}}var bH={calc:pH,calcAllAutoBins:mm},xH=TA.hoverPoints,_H=Ot.hoverLabelText,wH=function(e,r,a,i,n){var o=xH(e,r,a,i,n);if(o){e=o[0];var l=e.cd[e.index],s=e.cd[0].trace;if(!s.cumulative.enabled){var f=s.orientation==="h"?"y":"x";e[f+"Label"]=_H(e[f+"a"],[l.ph0,l.ph1],s[f+"hoverformat"])}return o}},TH=function(e,r,a,i,n){if(e.x="xVal"in r?r.xVal:r.x,e.y="yVal"in r?r.yVal:r.y,"zLabelVal"in r&&(e.z=r.zLabelVal),r.xa&&(e.xaxis=r.xa),r.ya&&(e.yaxis=r.ya),!(a.cumulative||{}).enabled){var o=Array.isArray(n)?i[0].pts[n[0]][n[1]]:i[n].pts;e.pointNumbers=o,e.binNumber=e.pointNumber,delete e.pointNumber,delete e.pointIndex;var l;if(a._indexToPoints){l=[];for(var s=0;s<o.length;s++)l=l.concat(a._indexToPoints[o[s]])}else l=o;e.pointIndices=l}return e},kH={attributes:AA,layoutAttributes:um,supplyDefaults:eH,crossTraceDefaults:nH,supplyLayoutDefaults:tA,calc:bH.calc,crossTraceCalc:Qp.crossTraceCalc,plot:pm.plot,layerName:"barlayer",style:Cn.style,styleOnSelect:Cn.styleOnSelect,colorbar:Ts,hoverPoints:wH,selectPoints:kA,eventData:TH,moduleType:"trace",name:"histogram",basePlotModule:pr,categories:["bar-like","cartesian","svg","bar","histogram","oriented","errorBarsOK","showLegend"],meta:{description:["The sample data from which statistics are computed is set in `x`","for vertically spanning histograms and","in `y` for horizontally spanning histograms.","Binning options are set `xbins` and `ybins` respectively","if no aggregation data is provided."].join(" ")}},AH=kH;const SB=Ni(AH);var MH=wa,SH=Wi.attributes,LH=Mr,CH=Or,DH=zr.hovertemplateAttrs,PH=zr.texttemplateAttrs,wl=Xt.extendFlat,$H=ta.pattern,wf=LH({editType:"plot",arrayOk:!0,colorEditType:"plot",description:"Sets the font used for `textinfo`."}),Mu={labels:{valType:"data_array",editType:"calc",description:["Sets the sector labels.","If `labels` entries are duplicated, we sum associated `values`","or simply count occurrences if `values` is not provided.","For other array attributes (including color) we use the first","non-empty entry among all occurrences of the label."].join(" ")},label0:{valType:"number",dflt:0,editType:"calc",description:["Alternate to `labels`.","Builds a numeric set of labels.","Use with `dlabel`","where `label0` is the starting label and `dlabel` the step."].join(" ")},dlabel:{valType:"number",dflt:1,editType:"calc",description:"Sets the label step. See `label0` for more info."},values:{valType:"data_array",editType:"calc",description:["Sets the values of the sectors.","If omitted, we count occurrences of each label."].join(" ")},marker:{colors:{valType:"data_array",editType:"calc",description:["Sets the color of each sector.","If not specified, the default trace color set is used","to pick the sector colors."].join(" ")},line:{color:{valType:"color",dflt:CH.defaultLine,arrayOk:!0,editType:"style",description:["Sets the color of the line enclosing each sector."].join(" ")},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style",description:["Sets the width (in px) of the line enclosing each sector."].join(" ")},editType:"calc"},pattern:$H,editType:"calc"},text:{valType:"data_array",editType:"plot",description:["Sets text elements associated with each sector.","If trace `textinfo` contains a *text* flag, these elements will be seen","on the chart.","If trace `hoverinfo` contains a *text* flag and *hovertext* is not set,","these elements will be seen in the hover labels."].join(" ")},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style",description:["Sets hover text elements associated with each sector.","If a single string, the same string appears for","all data points.","If an array of string, the items are mapped in order of","this trace's sectors.","To be seen, trace `hoverinfo` must contain a *text* flag."].join(" ")},scalegroup:{valType:"string",dflt:"",editType:"calc",description:["If there are multiple pie charts that should be sized according to","their totals, link them by providing a non-empty group id here","shared by every trace in the same group."].join(" ")},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc",description:["Determines which trace information appear on the graph."].join(" ")},hoverinfo:wl({},MH.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:DH({},{keys:["label","color","value","percent","text"]}),texttemplate:PH({editType:"plot"},{keys:["label","color","value","percent","text"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"plot",description:["Specifies the location of the `textinfo`."].join(" ")},textfont:wl({},wf,{description:"Sets the font used for `textinfo`."}),insidetextorientation:{valType:"enumerated",values:["horizontal","radial","tangential","auto"],dflt:"auto",editType:"plot",description:["Controls the orientation of the text inside chart sectors.","When set to *auto*, text may be oriented in any direction in order","to be as big as possible in the middle of a sector.","The *horizontal* option orients text to be parallel with the bottom","of the chart, and may make text smaller in order to achieve that goal.","The *radial* option orients text along the radius of the sector.","The *tangential* option orients text perpendicular to the radius of the sector."].join(" ")},insidetextfont:wl({},wf,{description:"Sets the font used for `textinfo` lying inside the sector."}),outsidetextfont:wl({},wf,{description:"Sets the font used for `textinfo` lying outside the sector."}),automargin:{valType:"boolean",dflt:!1,editType:"plot",description:["Determines whether outside text labels can push the margins."].join(" ")},title:{text:{valType:"string",dflt:"",editType:"plot",description:["Sets the title of the chart.","If it is empty, no title is displayed."].join(" ")},font:wl({},wf,{description:"Sets the font used for `title`."}),position:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"plot",description:["Specifies the location of the `title`."].join(" ")},editType:"plot"},domain:SH({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc",description:["Sets the fraction of the radius to cut out of the pie.","Use this to make a donut chart."].join(" ")},sort:{valType:"boolean",dflt:!0,editType:"calc",description:["Determines whether or not the sectors are reordered","from largest to smallest."].join(" ")},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc",description:["Specifies the direction at which succeeding sectors follow","one another."].join(" ")},rotation:{valType:"angle",dflt:0,editType:"calc",description:["Instead of the first slice starting at 12 o'clock,","rotate to some other angle."].join(" ")},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc",description:["Sets the fraction of larger radius to pull the sectors","out from the center. This can be a constant","to pull all slices apart from each other equally","or an array to highlight one or more slices."].join(" ")}},EH=kt,Bl=we,zH=Mu,RH=Wi.defaults,IH=Ln.handleText,FH=we.coercePattern;function MA(t,e){var r=Bl.isArrayOrTypedArray(t),a=Bl.isArrayOrTypedArray(e),i=Math.min(r?t.length:1/0,a?e.length:1/0);if(isFinite(i)||(i=0),i&&a){for(var n,o=0;o<i;o++){var l=e[o];if(EH(l)&&l>0){n=!0;break}}n||(i=0)}return{hasLabels:r,hasValues:a,len:i}}function SA(t,e,r,a,i){var n=a("marker.line.width");n&&a("marker.line.color",i?void 0:r.paper_bgcolor);var o=a("marker.colors");FH(a,"marker.pattern",o),t.marker&&!e.marker.pattern.fgcolor&&(e.marker.pattern.fgcolor=t.marker.colors),e.marker.pattern.bgcolor||(e.marker.pattern.bgcolor=r.paper_bgcolor)}function NH(t,e,r,a){function i(b,_){return Bl.coerce(t,e,zH,b,_)}var n=i("labels"),o=i("values"),l=MA(n,o),s=l.len;if(e._hasLabels=l.hasLabels,e._hasValues=l.hasValues,!e._hasLabels&&e._hasValues&&(i("label0"),i("dlabel")),!s){e.visible=!1;return}e._length=s,SA(t,e,a,i,!0),i("scalegroup");var f=i("text"),c=i("texttemplate"),u;if(c||(u=i("textinfo",Bl.isArrayOrTypedArray(f)?"text+percent":"percent")),i("hovertext"),i("hovertemplate"),c||u&&u!=="none"){var v=i("textposition");IH(t,e,a,i,v,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1});var p=Array.isArray(v)||v==="auto",d=p||v==="outside";d&&i("automargin"),(v==="inside"||v==="auto"||Array.isArray(v))&&i("insidetextorientation")}else u==="none"&&i("textposition","none");RH(e,a,i);var h=i("hole"),m=i("title.text");if(m){var y=i("title.position",h?"middle center":"top center");!h&&y==="middle center"&&(e.title.position="top center"),Bl.coerceFont(i,"title.font",a.font)}i("sort"),i("direction"),i("rotation"),i("pull")}var LA={handleLabelsAndValues:MA,handleMarkerDefaults:SA,supplyDefaults:NH},CA={hiddenlabels:{valType:"data_array",editType:"calc",description:["hiddenlabels is the funnelarea & pie chart analog of","visible:'legendonly'","but it can contain many labels, and can simultaneously","hide slices from several pies/funnelarea charts"].join(" ")},piecolorway:{valType:"colorlist",editType:"calc",description:["Sets the default pie slice colors. Defaults to the main","`colorway` used for trace colors. If you specify a new","list here it can still be extended with lighter and darker","colors, see `extendpiecolors`."].join(" ")},extendpiecolors:{valType:"boolean",dflt:!0,editType:"calc",description:["If `true`, the pie slice colors (whether given by `piecolorway` or","inherited from `colorway`) will be extended to three times its","original length by first repeating every color 20% lighter then","each color 20% darker. This is intended to reduce the likelihood","of reusing the same color when you have many slices, but you can","set `false` to disable.","Colors provided in the trace, using `marker.colors`, are never","extended."].join(" ")}},HH=we,OH=CA,jH=function(e,r){function a(i,n){return HH.coerce(e,r,OH,i,n)}a("hiddenlabels"),a("piecolorway",r.colorway),a("extendpiecolors")},BH=kt,Ah=_a,GH=yt,UH={};function VH(t,e){var r=[],a=t._fullLayout,i=a.hiddenlabels||[],n=e.labels,o=e.marker.colors||[],l=e.values,s=e._length,f=e._hasValues&&s,c,u;if(e.dlabel)for(n=new Array(s),c=0;c<s;c++)n[c]=String(e.label0+c*e.dlabel);var v={},p=DA(a["_"+e.type+"colormap"]),d=0,h=!1;for(c=0;c<s;c++){var m,y,b;if(f){if(m=l[c],!BH(m))continue;m=+m}else m=1;y=n[c],(y===void 0||y==="")&&(y=c),y=String(y);var _=v[y];_===void 0?(v[y]=r.length,b=i.indexOf(y)!==-1,b||(d+=m),r.push({v:m,label:y,color:p(o[c],y),i:c,pts:[c],hidden:b})):(h=!0,u=r[_],u.v+=m,u.pts.push(c),u.hidden||(d+=m),u.color===!1&&o[c]&&(u.color=p(o[c],y)))}r=r.filter(function(x){return x.v>=0});var g=e.type==="funnelarea"?h:e.sort;return g&&r.sort(function(x,w){return w.v-x.v}),r[0]&&(r[0].vTotal=d),r}function DA(t){return function(r,a){return!r||(r=Ah(r),!r.isValid())?!1:(r=GH.addOpacity(r,r.getAlpha()),t[a]||(t[a]=r),r)}}function WH(t,e){var r=(e||{}).type;r||(r="pie");var a=t._fullLayout,i=t.calcdata,n=a[r+"colorway"],o=a["_"+r+"colormap"];a["extend"+r+"colors"]&&(n=PA(n,UH));for(var l=0,s=0;s<i.length;s++){var f=i[s],c=f[0].trace.type;if(c===r)for(var u=0;u<f.length;u++){var v=f[u];v.color===!1&&(o[v.label]?v.color=o[v.label]:(o[v.label]=v.color=n[l%n.length],l++))}}}function PA(t,e){var r,a=JSON.stringify(t),i=e[a];if(!i){for(i=t.slice(),r=0;r<t.length;r++)i.push(Ah(t[r]).lighten(20).toHexString());for(r=0;r<t.length;r++)i.push(Ah(t[r]).darken(20).toHexString());e[a]=i}return i}var Pc={calc:VH,crossTraceCalc:WH,makePullColorFn:DA,generateExtendedColors:PA},XH=Ta.appendArrayMultiPointValues,YH=function(e,r){var a={curveNumber:r.index,pointNumbers:e.pts,data:r._input,fullData:r,label:e.label,color:e.color,value:e.v,percent:e.percent,text:e.text,bbox:e.bbox,v:e.v};return e.pts.length===1&&(a.pointNumber=a.i=e.pts[0]),XH(a,r,e.pts),r.type==="funnelarea"&&(delete a.v,delete a.i),a},Zr=bt,qH=hr,Tf=Na,$A=yt,ci=Et,Cr=we,ZH=Cr.strScale,Ox=Cr.strTranslate,Mh=Tr,EA=mi,KH=EA.recordMinTextSize,QH=EA.clearMinTextSize,zA=As.TEXTPAD,mt=In,kf=YH,jx=we.isValidTextValue;function JH(t,e){var r=t._context.staticPlot,a=t._fullLayout,i=a._size;QH("pie",a),FA(e,t),UA(e,i);var n=Cr.makeTraceGroups(a._pielayer,e,"trace").each(function(o){var l=Zr.select(this),s=o[0],f=s.trace;sO(o),l.attr("stroke-linejoin","round"),l.each(function(){var c=Zr.select(this).selectAll("g.slice").data(o);c.enter().append("g").classed("slice",!0),c.exit().remove();var u=[[[],[]],[[],[]]],v=!1;c.each(function(g,x){if(g.hidden){Zr.select(this).selectAll("path,g").remove();return}g.pointNumber=g.i,g.curveNumber=f.index,u[g.pxmid[1]<0?0:1][g.pxmid[0]<0?0:1].push(g);var w=s.cx,T=s.cy,A=Zr.select(this),M=A.selectAll("path.surface").data([g]);if(M.enter().append("path").classed("surface",!0).style({"pointer-events":r?"none":"all"}),A.call(RA,t,o),f.pull){var S=+mt.castOption(f.pull,g.pts)||0;S>0&&(w+=S*g.pxmid[0],T+=S*g.pxmid[1])}g.cxFinal=w,g.cyFinal=T;function L(P,k,C,$){var R=$*(k[0]-P[0]),j=$*(k[1]-P[1]);return"a"+$*s.r+","+$*s.r+" 0 "+g.largeArc+(C?" 1 ":" 0 ")+R+","+j}var E=f.hole;if(g.v===s.vTotal){var F="M"+(w+g.px0[0])+","+(T+g.px0[1])+L(g.px0,g.pxmid,!0,1)+L(g.pxmid,g.px0,!0,1)+"Z";E?M.attr("d","M"+(w+E*g.px0[0])+","+(T+E*g.px0[1])+L(g.px0,g.pxmid,!1,E)+L(g.pxmid,g.px0,!1,E)+"Z"+F):M.attr("d",F)}else{var N=L(g.px0,g.px1,!0,1);if(E){var z=1-E;M.attr("d","M"+(w+E*g.px1[0])+","+(T+E*g.px1[1])+L(g.px1,g.px0,!1,E)+"l"+z*g.px0[0]+","+z*g.px0[1]+N+"Z")}else M.attr("d","M"+w+","+T+"l"+g.px0[0]+","+g.px0[1]+N+"Z")}VA(t,g,s);var H=mt.castOption(f.textposition,g.pts),D=A.selectAll("g.slicetext").data(g.text&&H!=="none"?[0]:[]);D.enter().append("g").classed("slicetext",!0),D.exit().remove(),D.each(function(){var P=Cr.ensureSingle(Zr.select(this),"text","",function(O){O.attr("data-notex",1)}),k=Cr.ensureUniformFontSize(t,H==="outside"?tO(f,g,a.font):IA(f,g,a.font));P.text(g.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(ci.font,k).call(Mh.convertToTspans,t);var C=ci.bBox(P.node()),$;if(H==="outside")$=Ux(C,g);else if($=NA(C,g,s),H==="auto"&&$.scale<1){var R=Cr.ensureUniformFontSize(t,f.outsidetextfont);P.call(ci.font,R),C=ci.bBox(P.node()),$=Ux(C,g)}var j=$.textPosAngle,G=j===void 0?g.pxmid:qf(s.r,j);if($.targetX=w+G[0]*$.rCenter+($.x||0),$.targetY=T+G[1]*$.rCenter+($.y||0),WA($,C),$.outside){var Y=$.targetY;g.yLabelMin=Y-C.height/2,g.yLabelMid=Y,g.yLabelMax=Y+C.height/2,g.labelExtraX=0,g.labelExtraY=0,v=!0}$.fontSize=k.size,KH(f.type,$,a),o[x].transform=$,Cr.setTransormAndDisplay(P,$)})});var p=Zr.select(this).selectAll("g.titletext").data(f.title.text?[0]:[]);if(p.enter().append("g").classed("titletext",!0),p.exit().remove(),p.each(function(){var g=Cr.ensureSingle(Zr.select(this),"text","",function(T){T.attr("data-notex",1)}),x=f.title.text;f._meta&&(x=Cr.templateString(x,f._meta)),g.text(x).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(ci.font,f.title.font).call(Mh.convertToTspans,t);var w;f.title.position==="middle center"?w=iO(s):w=BA(s,i),g.attr("transform",Ox(w.x,w.y)+ZH(Math.min(1,w.scale))+Ox(w.tx,w.ty))}),v&&oO(u,f),eO(c,f),v&&f.automargin){var d=ci.bBox(l.node()),h=f.domain,m=i.w*(h.x[1]-h.x[0]),y=i.h*(h.y[1]-h.y[0]),b=(.5*m-s.r)/i.w,_=(.5*y-s.r)/i.h;qH.autoMargin(t,"pie."+f.uid+".automargin",{xl:h.x[0]-b,xr:h.x[1]+b,yb:h.y[0]-_,yt:h.y[1]+_,l:Math.max(s.cx-s.r-d.left,0),r:Math.max(d.right-(s.cx+s.r),0),b:Math.max(d.bottom-(s.cy+s.r),0),t:Math.max(s.cy-s.r-d.top,0),pad:5})}})});setTimeout(function(){n.selectAll("tspan").each(function(){var o=Zr.select(this);o.attr("dy")&&o.attr("dy",o.attr("dy"))})},0)}function eO(t,e){t.each(function(r){var a=Zr.select(this);if(!r.labelExtraX&&!r.labelExtraY){a.select("path.textline").remove();return}var i=a.select("g.slicetext text");r.transform.targetX+=r.labelExtraX,r.transform.targetY+=r.labelExtraY,Cr.setTransormAndDisplay(i,r.transform);var n=r.cxFinal+r.pxmid[0],o=r.cyFinal+r.pxmid[1],l="M"+n+","+o,s=(r.yLabelMax-r.yLabelMin)*(r.pxmid[0]<0?-1:1)/4;if(r.labelExtraX){var f=r.labelExtraX*r.pxmid[1]/r.pxmid[0],c=r.yLabelMid+r.labelExtraY-(r.cyFinal+r.pxmid[1]);Math.abs(f)>Math.abs(c)?l+="l"+c*r.pxmid[0]/r.pxmid[1]+","+c+"H"+(n+r.labelExtraX+s):l+="l"+r.labelExtraX+","+f+"v"+(c-f)+"h"+s}else l+="V"+(r.yLabelMid+r.labelExtraY)+"h"+s;Cr.ensureSingle(a,"path","textline").call($A.stroke,e.outsidetextfont.color).attr({"stroke-width":Math.min(2,e.outsidetextfont.size/8),d:l,fill:"none"})})}function RA(t,e,r){var a=r[0],i=a.cx,n=a.cy,o=a.trace,l=o.type==="funnelarea";"_hasHoverLabel"in o||(o._hasHoverLabel=!1),"_hasHoverEvent"in o||(o._hasHoverEvent=!1),t.on("mouseover",function(s){var f=e._fullLayout,c=e._fullData[o.index];if(!(e._dragging||f.hovermode===!1)){var u=c.hoverinfo;if(Array.isArray(u)&&(u=Tf.castHoverinfo({hoverinfo:[mt.castOption(u,s.pts)],_module:o._module},f,0)),u==="all"&&(u="label+text+value+percent+name"),c.hovertemplate||u!=="none"&&u!=="skip"&&u){var v=s.rInscribed||0,p=i+s.pxmid[0]*(1-v),d=n+s.pxmid[1]*(1-v),h=f.separators,m=[];if(u&&u.indexOf("label")!==-1&&m.push(s.label),s.text=mt.castOption(c.hovertext||c.text,s.pts),u&&u.indexOf("text")!==-1){var y=s.text;Cr.isValidTextValue(y)&&m.push(y)}s.value=s.v,s.valueLabel=mt.formatPieValue(s.v,h),u&&u.indexOf("value")!==-1&&m.push(s.valueLabel),s.percent=s.v/a.vTotal,s.percentLabel=mt.formatPiePercent(s.percent,h),u&&u.indexOf("percent")!==-1&&m.push(s.percentLabel);var b=c.hoverlabel,_=b.font,g=[];Tf.loneHover({trace:o,x0:p-v*a.r,x1:p+v*a.r,y:d,_x0:l?i+s.TL[0]:p-v*a.r,_x1:l?i+s.TR[0]:p+v*a.r,_y0:l?n+s.TL[1]:d-v*a.r,_y1:l?n+s.BL[1]:d+v*a.r,text:m.join("<br>"),name:c.hovertemplate||u.indexOf("name")!==-1?c.name:void 0,idealAlign:s.pxmid[0]<0?"left":"right",color:mt.castOption(b.bgcolor,s.pts)||s.color,borderColor:mt.castOption(b.bordercolor,s.pts),fontFamily:mt.castOption(_.family,s.pts),fontSize:mt.castOption(_.size,s.pts),fontColor:mt.castOption(_.color,s.pts),nameLength:mt.castOption(b.namelength,s.pts),textAlign:mt.castOption(b.align,s.pts),hovertemplate:mt.castOption(c.hovertemplate,s.pts),hovertemplateLabels:s,eventData:[kf(s,c)]},{container:f._hoverlayer.node(),outerContainer:f._paper.node(),gd:e,inOut_bbox:g}),s.bbox=g[0],o._hasHoverLabel=!0}o._hasHoverEvent=!0,e.emit("plotly_hover",{points:[kf(s,c)],event:Zr.event})}}),t.on("mouseout",function(s){var f=e._fullLayout,c=e._fullData[o.index],u=Zr.select(this).datum();o._hasHoverEvent&&(s.originalEvent=Zr.event,e.emit("plotly_unhover",{points:[kf(u,c)],event:Zr.event}),o._hasHoverEvent=!1),o._hasHoverLabel&&(Tf.loneUnhover(f._hoverlayer.node()),o._hasHoverLabel=!1)}),t.on("click",function(s){var f=e._fullLayout,c=e._fullData[o.index];e._dragging||f.hovermode===!1||(e._hoverdata=[kf(s,c)],Tf.click(e,Zr.event))})}function tO(t,e,r){var a=mt.castOption(t.outsidetextfont.color,e.pts)||mt.castOption(t.textfont.color,e.pts)||r.color,i=mt.castOption(t.outsidetextfont.family,e.pts)||mt.castOption(t.textfont.family,e.pts)||r.family,n=mt.castOption(t.outsidetextfont.size,e.pts)||mt.castOption(t.textfont.size,e.pts)||r.size,o=mt.castOption(t.outsidetextfont.weight,e.pts)||mt.castOption(t.textfont.weight,e.pts)||r.weight,l=mt.castOption(t.outsidetextfont.style,e.pts)||mt.castOption(t.textfont.style,e.pts)||r.style,s=mt.castOption(t.outsidetextfont.variant,e.pts)||mt.castOption(t.textfont.variant,e.pts)||r.variant,f=mt.castOption(t.outsidetextfont.textcase,e.pts)||mt.castOption(t.textfont.textcase,e.pts)||r.textcase,c=mt.castOption(t.outsidetextfont.lineposition,e.pts)||mt.castOption(t.textfont.lineposition,e.pts)||r.lineposition,u=mt.castOption(t.outsidetextfont.shadow,e.pts)||mt.castOption(t.textfont.shadow,e.pts)||r.shadow;return{color:a,family:i,size:n,weight:o,style:l,variant:s,textcase:f,lineposition:c,shadow:u}}function IA(t,e,r){var a=mt.castOption(t.insidetextfont.color,e.pts);!a&&t._input.textfont&&(a=mt.castOption(t._input.textfont.color,e.pts));var i=mt.castOption(t.insidetextfont.family,e.pts)||mt.castOption(t.textfont.family,e.pts)||r.family,n=mt.castOption(t.insidetextfont.size,e.pts)||mt.castOption(t.textfont.size,e.pts)||r.size,o=mt.castOption(t.insidetextfont.weight,e.pts)||mt.castOption(t.textfont.weight,e.pts)||r.weight,l=mt.castOption(t.insidetextfont.style,e.pts)||mt.castOption(t.textfont.style,e.pts)||r.style,s=mt.castOption(t.insidetextfont.variant,e.pts)||mt.castOption(t.textfont.variant,e.pts)||r.variant,f=mt.castOption(t.insidetextfont.textcase,e.pts)||mt.castOption(t.textfont.textcase,e.pts)||r.textcase,c=mt.castOption(t.insidetextfont.lineposition,e.pts)||mt.castOption(t.textfont.lineposition,e.pts)||r.lineposition,u=mt.castOption(t.insidetextfont.shadow,e.pts)||mt.castOption(t.textfont.shadow,e.pts)||r.shadow;return{color:a||$A.contrast(e.color),family:i,size:n,weight:o,style:l,variant:s,textcase:f,lineposition:c,shadow:u}}function FA(t,e){for(var r,a,i=0;i<t.length;i++)if(r=t[i][0],a=r.trace,a.title.text){var n=a.title.text;a._meta&&(n=Cr.templateString(n,a._meta));var o=ci.tester.append("text").attr("data-notex",1).text(n).call(ci.font,a.title.font).call(Mh.convertToTspans,e),l=ci.bBox(o.node(),!0);r.titleBox={width:l.width,height:l.height},o.remove()}}function NA(t,e,r){var a=r.r||e.rpx1,i=e.rInscribed,n=e.startangle===e.stopangle;if(n)return{rCenter:1-i,scale:0,rotate:0,textPosAngle:0};var o=e.ring,l=o===1&&Math.abs(e.startangle-e.stopangle)===Math.PI*2,s=e.halfangle,f=e.midangle,c=r.trace.insidetextorientation,u=c==="horizontal",v=c==="tangential",p=c==="radial",d=c==="auto",h=[],m;if(!d){var y=function(A,M){if(rO(e,A)){var S=Math.abs(A-e.startangle),L=Math.abs(A-e.stopangle),E=S<L?S:L;M==="tan"?m=Gx(t,a,o,E,0):m=Bx(t,a,o,E,Math.PI/2),m.textPosAngle=A,h.push(m)}},b;if(u||v){for(b=4;b>=-4;b-=2)y(Math.PI*b,"tan");for(b=4;b>=-4;b-=2)y(Math.PI*(b+1),"tan")}if(u||p){for(b=4;b>=-4;b-=2)y(Math.PI*(b+1.5),"rad");for(b=4;b>=-4;b-=2)y(Math.PI*(b+.5),"rad")}}if(l||d||u){var _=Math.sqrt(t.width*t.width+t.height*t.height);if(m={scale:i*a*2/_,rCenter:1-i,rotate:0},m.textPosAngle=(e.startangle+e.stopangle)/2,m.scale>=1)return m;h.push(m)}(d||p)&&(m=Bx(t,a,o,s,f),m.textPosAngle=(e.startangle+e.stopangle)/2,h.push(m)),(d||v)&&(m=Gx(t,a,o,s,f),m.textPosAngle=(e.startangle+e.stopangle)/2,h.push(m));for(var g=0,x=0,w=0;w<h.length;w++){var T=h[w].scale;if(x<T&&(x=T,g=w),!d&&x>=1)break}return h[g]}function rO(t,e){var r=t.startangle,a=t.stopangle;return r>e&&e>a||r<e&&e<a}function Bx(t,e,r,a,i){e=Math.max(0,e-2*zA);var n=t.width/t.height,o=jA(n,a,e,r);return{scale:o*2/t.height,rCenter:HA(n,o/e),rotate:OA(i)}}function Gx(t,e,r,a,i){e=Math.max(0,e-2*zA);var n=t.height/t.width,o=jA(n,a,e,r);return{scale:o*2/t.width,rCenter:HA(n,o/e),rotate:OA(i+Math.PI/2)}}function HA(t,e){return Math.cos(e)-t*e}function OA(t){return(180/Math.PI*t+720)%180-90}function jA(t,e,r,a){var i=t+1/(2*Math.tan(e));return r*Math.min(1/(Math.sqrt(i*i+.5)+i),a/(Math.sqrt(t*t+a/2)+t))}function aO(t,e){return t.v===e.vTotal&&!e.trace.hole?1:Math.min(1/(1+1/Math.sin(t.halfangle)),t.ring/2)}function Ux(t,e){var r=e.pxmid[0],a=e.pxmid[1],i=t.width/2,n=t.height/2;return r<0&&(i*=-1),a<0&&(n*=-1),{scale:1,rCenter:1,rotate:0,x:i+Math.abs(n)*(i>0?1:-1)/2,y:n/(1+r*r/(a*a)),outside:!0}}function iO(t){var e=Math.sqrt(t.titleBox.width*t.titleBox.width+t.titleBox.height*t.titleBox.height);return{x:t.cx,y:t.cy,scale:t.trace.hole*t.r*2/e,tx:0,ty:-t.titleBox.height/2+t.trace.title.font.size}}function BA(t,e){var r=1,a=1,i,n=t.trace,o={x:t.cx,y:t.cy},l={tx:0,ty:0};l.ty+=n.title.font.size,i=GA(n),n.title.position.indexOf("top")!==-1?(o.y-=(1+i)*t.r,l.ty-=t.titleBox.height):n.title.position.indexOf("bottom")!==-1&&(o.y+=(1+i)*t.r);var s=nO(t.r,t.trace.aspectratio),f=e.w*(n.domain.x[1]-n.domain.x[0])/2;return n.title.position.indexOf("left")!==-1?(f=f+s,o.x-=(1+i)*s,l.tx+=t.titleBox.width/2):n.title.position.indexOf("center")!==-1?f*=2:n.title.position.indexOf("right")!==-1&&(f=f+s,o.x+=(1+i)*s,l.tx-=t.titleBox.width/2),r=f/t.titleBox.width,a=Sh(t,e)/t.titleBox.height,{x:o.x,y:o.y,scale:Math.min(r,a),tx:l.tx,ty:l.ty}}function nO(t,e){return t/(e===void 0?1:e)}function Sh(t,e){var r=t.trace,a=e.h*(r.domain.y[1]-r.domain.y[0]);return Math.min(t.titleBox.height,a/2)}function GA(t){var e=t.pull;if(!e)return 0;var r;if(Cr.isArrayOrTypedArray(e))for(e=0,r=0;r<t.pull.length;r++)t.pull[r]>e&&(e=t.pull[r]);return e}function oO(t,e){var r,a,i,n,o,l,s,f,c,u,v,p,d;function h(_,g){return _.pxmid[1]-g.pxmid[1]}function m(_,g){return g.pxmid[1]-_.pxmid[1]}function y(_,g){g||(g={});var x=g.labelExtraY+(a?g.yLabelMax:g.yLabelMin),w=a?_.yLabelMin:_.yLabelMax,T=a?_.yLabelMax:_.yLabelMin,A=_.cyFinal+o(_.px0[1],_.px1[1]),M=x-w,S,L,E,F,N,z;if(M*s>0&&(_.labelExtraY=M),!!Cr.isArrayOrTypedArray(e.pull))for(L=0;L<u.length;L++)E=u[L],!(E===_||(mt.castOption(e.pull,_.pts)||0)>=(mt.castOption(e.pull,E.pts)||0))&&((_.pxmid[1]-E.pxmid[1])*s>0?(F=E.cyFinal+o(E.px0[1],E.px1[1]),M=F-w-_.labelExtraY,M*s>0&&(_.labelExtraY+=M)):(T+_.labelExtraY-A)*s>0&&(S=3*l*Math.abs(L-u.indexOf(_)),N=E.cxFinal+n(E.px0[0],E.px1[0]),z=N+S-(_.cxFinal+_.pxmid[0])-_.labelExtraX,z*l>0&&(_.labelExtraX+=z)))}for(a=0;a<2;a++)for(i=a?h:m,o=a?Math.max:Math.min,s=a?1:-1,r=0;r<2;r++){for(n=r?Math.max:Math.min,l=r?1:-1,f=t[a][r],f.sort(i),c=t[1-a][r],u=c.concat(f),p=[],v=0;v<f.length;v++)f[v].yLabelMid!==void 0&&p.push(f[v]);for(d=!1,v=0;a&&v<c.length;v++)if(c[v].yLabelMid!==void 0){d=c[v];break}for(v=0;v<p.length;v++){var b=v&&p[v-1];d&&!v&&(b=d),y(p[v],b)}}}function UA(t,e){for(var r=[],a=0;a<t.length;a++){var i=t[a][0],n=i.trace,o=n.domain,l=e.w*(o.x[1]-o.x[0]),s=e.h*(o.y[1]-o.y[0]);n.title.text&&n.title.position!=="middle center"&&(s-=Sh(i,e));var f=l/2,c=s/2;n.type==="funnelarea"&&!n.scalegroup&&(c/=n.aspectratio),i.r=Math.min(f,c)/(1+GA(n)),i.cx=e.l+e.w*(n.domain.x[1]+n.domain.x[0])/2,i.cy=e.t+e.h*(1-n.domain.y[0])-s/2,n.title.text&&n.title.position.indexOf("bottom")!==-1&&(i.cy-=Sh(i,e)),n.scalegroup&&r.indexOf(n.scalegroup)===-1&&r.push(n.scalegroup)}lO(t,r)}function lO(t,e){for(var r,a,i,n=0;n<e.length;n++){var o=1/0,l=e[n];for(a=0;a<t.length;a++)if(r=t[a][0],i=r.trace,i.scalegroup===l){var s;if(i.type==="pie")s=r.r*r.r;else if(i.type==="funnelarea"){var f,c;i.aspectratio>1?(f=r.r,c=f/i.aspectratio):(c=r.r,f=c*i.aspectratio),f*=(1+i.baseratio)/2,s=f*c}o=Math.min(o,s/r.vTotal)}for(a=0;a<t.length;a++)if(r=t[a][0],i=r.trace,i.scalegroup===l){var u=o*r.vTotal;i.type==="funnelarea"&&(u/=(1+i.baseratio)/2,u/=i.aspectratio),r.r=Math.sqrt(u)}}}function sO(t){var e=t[0],r=e.r,a=e.trace,i=mt.getRotationAngle(a.rotation),n=2*Math.PI/e.vTotal,o="px0",l="px1",s,f,c;if(a.direction==="counterclockwise"){for(s=0;s<t.length&&t[s].hidden;s++);if(s===t.length)return;i+=n*t[s].v,n*=-1,o="px1",l="px0"}for(c=qf(r,i),s=0;s<t.length;s++)f=t[s],!f.hidden&&(f[o]=c,f.startangle=i,i+=n*f.v/2,f.pxmid=qf(r,i),f.midangle=i,i+=n*f.v/2,c=qf(r,i),f.stopangle=i,f[l]=c,f.largeArc=f.v>e.vTotal/2?1:0,f.halfangle=Math.PI*Math.min(f.v/e.vTotal,.5),f.ring=1-a.hole,f.rInscribed=aO(f,e))}function qf(t,e){return[t*Math.sin(e),-t*Math.cos(e)]}function VA(t,e,r){var a=t._fullLayout,i=r.trace,n=i.texttemplate,o=i.textinfo;if(!n&&o&&o!=="none"){var l=o.split("+"),s=function(g){return l.indexOf(g)!==-1},f=s("label"),c=s("text"),u=s("value"),v=s("percent"),p=a.separators,d;if(d=f?[e.label]:[],c){var h=mt.getFirstFilled(i.text,e.pts);jx(h)&&d.push(h)}u&&d.push(mt.formatPieValue(e.v,p)),v&&d.push(mt.formatPiePercent(e.v/r.vTotal,p)),e.text=d.join("<br>")}function m(g){return{label:g.label,value:g.v,valueLabel:mt.formatPieValue(g.v,a.separators),percent:g.v/r.vTotal,percentLabel:mt.formatPiePercent(g.v/r.vTotal,a.separators),color:g.color,text:g.text,customdata:Cr.castOption(i,g.i,"customdata")}}if(n){var y=Cr.castOption(i,e.i,"texttemplate");if(!y)e.text="";else{var b=m(e),_=mt.getFirstFilled(i.text,e.pts);(jx(_)||_==="")&&(b.text=_),e.text=Cr.texttemplateString(y,b,t._fullLayout._d3locale,b,i._meta||{})}}}function WA(t,e){var r=t.rotate*Math.PI/180,a=Math.cos(r),i=Math.sin(r),n=(e.left+e.right)/2,o=(e.top+e.bottom)/2;t.textX=n*a-o*i,t.textY=n*i+o*a,t.noCenter=!0}var XA={plot:JH,formatSliceLabel:VA,transformInsideText:NA,determineInsideTextFont:IA,positionTitleOutside:BA,prerenderTitles:FA,layoutAreas:UA,attachFxHandlers:RA,computeTransform:WA},Vx=bt,fO=yp,cO=mi.resizeText,uO=function(e){var r=e._fullLayout._pielayer.selectAll(".trace");cO(e,r,"pie"),r.each(function(a){var i=a[0],n=i.trace,o=Vx.select(this);o.style({opacity:n.opacity}),o.selectAll("path.surface").each(function(l){Vx.select(this).call(fO,l,n,e)})})},YA={};(function(t){var e=hr;t.name="pie",t.plot=function(r,a,i,n){e.plotBasePlot(t.name,r,a,i,n)},t.clean=function(r,a,i,n){e.cleanBasePlot(t.name,r,a,i,n)}})(YA);var vO={attributes:Mu,supplyDefaults:LA.supplyDefaults,supplyLayoutDefaults:jH,layoutAttributes:CA,calc:Pc.calc,crossTraceCalc:Pc.crossTraceCalc,plot:XA.plot,style:uO,styleOne:yp,moduleType:"trace",name:"pie",basePlotModule:YA,categories:["pie-like","pie","showLegend"],meta:{description:["A data visualized by the sectors of the pie is set in `values`.","The sector labels are set in `labels`.","The sector colors are set in `marker.colors`"].join(" ")}},dO=vO;const LB=Ni(dO);var qA={INCREASING:{COLOR:"#3D9970",SYMBOL:"▲"},DECREASING:{COLOR:"#FF4136",SYMBOL:"▼"}},Zf=we.extendFlat,$l=Vi,Wx=qo.axisHoverFormat,Lh=ta.dash,hO=Nc,ZA=qA,pO=ZA.INCREASING.COLOR,mO=ZA.DECREASING.COLOR,$c=$l.line;function Xx(t){return{line:{color:Zf({},$c.color,{dflt:t}),width:$c.width,dash:Lh,editType:"style"},editType:"style"}}var KA={xperiod:$l.xperiod,xperiod0:$l.xperiod0,xperiodalignment:$l.xperiodalignment,xhoverformat:Wx("x"),yhoverformat:Wx("y"),x:{valType:"data_array",editType:"calc+clearAxisTypes",description:["Sets the x coordinates.","If absent, linear coordinate will be generated."].join(" ")},open:{valType:"data_array",editType:"calc",description:"Sets the open values."},high:{valType:"data_array",editType:"calc",description:"Sets the high values."},low:{valType:"data_array",editType:"calc",description:"Sets the low values."},close:{valType:"data_array",editType:"calc",description:"Sets the close values."},line:{width:Zf({},$c.width,{description:[$c.width,"Note that this style setting can also be set per","direction via `increasing.line.width` and","`decreasing.line.width`."].join(" ")}),dash:Zf({},Lh,{description:[Lh.description,"Note that this style setting can also be set per","direction via `increasing.line.dash` and","`decreasing.line.dash`."].join(" ")}),editType:"style"},increasing:Xx(pO),decreasing:Xx(mO),text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc",description:["Sets hover text elements associated with each sample point.","If a single string, the same string appears over","all the data points.","If an array of string, the items are mapped in order to","this trace's sample points."].join(" ")},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc",description:"Same as `text`."},tickwidth:{valType:"number",min:0,max:.5,dflt:.3,editType:"calc",description:["Sets the width of the open/close tick marks","relative to the *x* minimal interval."].join(" ")},hoverlabel:Zf({},hO.hoverlabel,{split:{valType:"boolean",dflt:!1,editType:"style",description:["Show hover information (open, close, high, low) in","separate labels."].join(" ")}}),zorder:$l.zorder},yO=ot,gO=we,bO=function(e,r,a,i){var n=a("x"),o=a("open"),l=a("high"),s=a("low"),f=a("close");a("hoverlabel.split");var c=yO.getComponentMethod("calendars","handleTraceDefaults");if(c(e,r,["x"],i),!!(o&&l&&s&&f)){var u=Math.min(o.length,l.length,s.length,f.length);return n&&(u=Math.min(u,gO.minRowLength(n))),r._length=u,u}},xO=we,_O=bO,wO=bu,TO=KA,kO=function(e,r,a,i){function n(l,s){return xO.coerce(e,r,TO,l,s)}var o=_O(e,r,n,i);if(!o){r.visible=!1;return}wO(e,r,i,n,{x:!0}),n("xhoverformat"),n("yhoverformat"),n("line.width"),n("line.dash"),Yx(e,r,n,"increasing"),Yx(e,r,n,"decreasing"),n("text"),n("hovertext"),n("tickwidth"),i._requestRangeslider[r.xaxis]=!0,n("zorder")};function Yx(t,e,r,a){r(a+".line.color"),r(a+".line.width",e.line.width),r(a+".line.dash",e.line.dash)}var Mo=we,Af=Mo._,Kf=Ot,AO=xu,Tl=fr.BADNUM;function MO(t,e){var r=Kf.getFromId(t,e.xaxis),a=Kf.getFromId(t,e.yaxis),i=LO(t,r,e),n=e._minDiff;e._minDiff=null;var o=e._origX;e._origX=null;var l=e._xcalc;e._xcalc=null;var s=QA(t,e,o,l,a,SO);return e._extremes[r._id]=Kf.findExtremes(r,l,{vpad:n/2}),s.length?(Mo.extendFlat(s[0].t,{wHover:n/2,tickLen:i}),s):[{t:{empty:!0}}]}function SO(t,e,r,a){return{o:t,h:e,l:r,c:a}}function QA(t,e,r,a,i,n){for(var o=i.makeCalcdata(e,"open"),l=i.makeCalcdata(e,"high"),s=i.makeCalcdata(e,"low"),f=i.makeCalcdata(e,"close"),c=Mo.isArrayOrTypedArray(e.text),u=Mo.isArrayOrTypedArray(e.hovertext),v=!0,p=null,d=!!e.xperiodalignment,h=[],m=0;m<a.length;m++){var y=a[m],b=o[m],_=l[m],g=s[m],x=f[m];if(y!==Tl&&b!==Tl&&_!==Tl&&g!==Tl&&x!==Tl){x===b?p!==null&&x!==p&&(v=x>p):v=x>b,p=x;var w=n(b,_,g,x);w.pos=y,w.yc=(b+x)/2,w.i=m,w.dir=v?"increasing":"decreasing",w.x=w.pos,w.y=[g,_],d&&(w.orig_p=r[m]),c&&(w.tx=e.text[m]),u&&(w.htx=e.hovertext[m]),h.push(w)}else h.push({pos:y,empty:!0})}return e._extremes[i._id]=Kf.findExtremes(i,Mo.concat(s,l),{padded:!0}),h.length&&(h[0].t={labels:{open:Af(t,"open:")+" ",high:Af(t,"high:")+" ",low:Af(t,"low:")+" ",close:Af(t,"close:")+" "}}),h}function LO(t,e,r){var a=r._minDiff;if(!a){var i=t._fullData,n=[];a=1/0;var o;for(o=0;o<i.length;o++){var l=i[o];if(l.type==="ohlc"&&l.visible===!0&&l.xaxis===e._id){n.push(l);var s=e.makeCalcdata(l,"x");l._origX=s;var f=AO(r,e,"x",s).vals;l._xcalc=f;var c=Mo.distinctVals(f).minDiff;c&&isFinite(c)&&(a=Math.min(a,c))}}for(a===1/0&&(a=1),o=0;o<n.length;o++)n[o]._minDiff=a}return a*r.tickwidth}var CO={calc:MO,calcCommon:QA},DO=bt,qx=we,PO=function(e,r,a,i){var n=r.yaxis,o=r.xaxis,l=!!o.rangebreaks;qx.makeTraceGroups(i,a,"trace ohlc").each(function(s){var f=DO.select(this),c=s[0],u=c.t,v=c.trace;if(v.visible!==!0||u.empty){f.remove();return}var p=u.tickLen,d=f.selectAll("path").data(qx.identity);d.enter().append("path"),d.exit().remove(),d.attr("d",function(h){if(h.empty)return"M0,0Z";var m=o.c2p(h.pos-p,!0),y=o.c2p(h.pos+p,!0),b=l?(m+y)/2:o.c2p(h.pos,!0),_=n.c2p(h.o,!0),g=n.c2p(h.h,!0),x=n.c2p(h.l,!0),w=n.c2p(h.c,!0);return"M"+m+","+_+"H"+b+"M"+b+","+g+"V"+x+"M"+y+","+w+"H"+b})})},_d=bt,$O=Et,EO=yt,zO=function(e,r,a){var i=a||_d.select(e).selectAll("g.ohlclayer").selectAll("g.trace");i.style("opacity",function(n){return n[0].trace.opacity}),i.each(function(n){var o=n[0].trace;_d.select(this).selectAll("path").each(function(l){if(!l.empty){var s=o[l.dir].line;_d.select(this).style("fill","none").call(EO.stroke,s.color).call($O.dashLine,s.dash,s.width).style("opacity",o.selectedpoints&&!l.selected?.3:1)}})})},Ch=Ot,RO=we,Mf=Na,IO=yt,FO=we.fillText,Zx=qA,NO={increasing:Zx.INCREASING.SYMBOL,decreasing:Zx.DECREASING.SYMBOL};function HO(t,e,r,a){var i=t.cd,n=i[0].trace;return n.hoverlabel.split?eM(t,e,r,a):tM(t,e,r,a)}function JA(t,e,r,a){var i=t.cd,n=t.xa,o=i[0].trace,l=i[0].t,s=o.type,f=s==="ohlc"?"l":"min",c=s==="ohlc"?"h":"max",u,v,p=l.bPos||0,d=function(S){return S.pos+p-e},h=l.bdPos||l.tickLen,m=l.wHover,y=Math.min(1,h/Math.abs(n.r2c(n.range[1])-n.r2c(n.range[0])));u=t.maxHoverDistance-y,v=t.maxSpikeDistance-y;function b(S){var L=d(S);return Mf.inbox(L-m,L+m,u)}function _(S){var L=S[f],E=S[c];return L===E||Mf.inbox(L-r,E-r,u)}function g(S){return(b(S)+_(S))/2}var x=Mf.getDistanceFunction(a,b,_,g);if(Mf.getClosest(i,x,t),t.index===!1)return null;var w=i[t.index];if(w.empty)return null;var T=w.dir,A=o[T],M=A.line.color;return IO.opacity(M)&&A.line.width?t.color=M:t.color=A.fillcolor,t.x0=n.c2p(w.pos+p-h,!0),t.x1=n.c2p(w.pos+p+h,!0),t.xLabelVal=w.orig_p!==void 0?w.orig_p:w.pos,t.spikeDistance=g(w)*v/u,t.xSpike=n.c2p(w.pos,!0),t}function eM(t,e,r,a){var i=t.cd,n=t.ya,o=i[0].trace,l=i[0].t,s=[],f=JA(t,e,r,a);if(!f)return[];var c=f.index,u=i[c],v=u.hi||o.hoverinfo,p=v.split("+"),d=v==="all",h=d||p.indexOf("y")!==-1;if(!h)return[];for(var m=["high","open","close","low"],y={},b=0;b<m.length;b++){var _=m[b],g=o[_][f.index],x=n.c2p(g,!0),w;g in y?(w=y[g],w.yLabel+="<br>"+l.labels[_]+Ch.hoverLabelText(n,g,o.yhoverformat)):(w=RO.extendFlat({},f),w.y0=w.y1=x,w.yLabelVal=g,w.yLabel=l.labels[_]+Ch.hoverLabelText(n,g,o.yhoverformat),w.name="",s.push(w),y[g]=w)}return s}function tM(t,e,r,a){var i=t.cd,n=t.ya,o=i[0].trace,l=i[0].t,s=JA(t,e,r,a);if(!s)return[];var f=s.index,c=i[f],u=s.index=c.i,v=c.dir;function p(g){return l.labels[g]+Ch.hoverLabelText(n,o[g][u],o.yhoverformat)}var d=c.hi||o.hoverinfo,h=d.split("+"),m=d==="all",y=m||h.indexOf("y")!==-1,b=m||h.indexOf("text")!==-1,_=y?[p("open"),p("high"),p("low"),p("close")+" "+NO[v]]:[];return b&&FO(c,o,_),s.extraText=_.join("<br>"),s.y0=s.y1=n.c2p(c.yc,!0),[s]}var OO={hoverPoints:HO,hoverSplit:eM,hoverOnPoints:tM},jO=function(e,r){var a=e.cd,i=e.xaxis,n=e.yaxis,o=[],l,s=a[0].t.bPos||0;if(r===!1)for(l=0;l<a.length;l++)a[l].selected=0;else for(l=0;l<a.length;l++){var f=a[l];r.contains([i.c2p(f.pos+s),n.c2p(f.yc)],null,f.i,e)?(o.push({pointNumber:f.i,x:i.c2d(f.pos),y:n.c2d(f.yc)}),f.selected=1):f.selected=0}return o},BO={moduleType:"trace",name:"ohlc",basePlotModule:pr,categories:["cartesian","svg","showLegend"],meta:{description:["The ohlc (short for Open-High-Low-Close) is a style of financial chart describing","open, high, low and close for a given `x` coordinate (most likely time).","The tip of the lines represent the `low` and `high` values and","the horizontal segments represent the `open` and `close` values.","Sample points where the close value is higher (lower) then the open","value are called increasing (decreasing).","By default, increasing items are drawn in green whereas","decreasing are drawn in red."].join(" ")},attributes:KA,supplyDefaults:kO,calc:CO.calc,plot:PO,style:zO,hoverPoints:OO.hoverPoints,selectPoints:jO},GO=BO;const CB=Ni(GO);var UO=ot,ia=we,VO=ak;function WO(t,e,r,a){var i=t.cd,n=i[0].t,o=i[0].trace,l=t.xa,s=t.ya,f=n.x,c=n.y,u=l.c2p(e),v=s.c2p(r),p=t.distance,d;if(n.tree){var h=l.p2c(u-p),m=l.p2c(u+p),y=s.p2c(v-p),b=s.p2c(v+p);a==="x"?d=n.tree.range(Math.min(h,m),Math.min(s._rl[0],s._rl[1]),Math.max(h,m),Math.max(s._rl[0],s._rl[1])):d=n.tree.range(Math.min(h,m),Math.min(y,b),Math.max(h,m),Math.max(y,b))}else d=n.ids;var _,g,x,w,T,A,M,S,L,E=p;if(a==="x"){var F=!!o.xperiodalignment,N=!!o.yperiodalignment;for(T=0;T<d.length;T++){if(_=d[T],x=f[_],A=Math.abs(l.c2p(x)-u),F){var z=l.c2p(o._xStarts[_]),H=l.c2p(o._xEnds[_]);A=u>=Math.min(z,H)&&u<=Math.max(z,H)?0:1/0}if(A<E){if(E=A,w=c[_],M=s.c2p(w)-v,N){var D=s.c2p(o._yStarts[_]),P=s.c2p(o._yEnds[_]);M=v>=Math.min(D,P)&&v<=Math.max(D,P)?0:1/0}L=Math.sqrt(A*A+M*M),g=d[T]}}}else for(T=d.length-1;T>-1;T--)_=d[T],x=f[_],w=c[_],A=l.c2p(x)-u,M=s.c2p(w)-v,S=Math.sqrt(A*A+M*M),S<E&&(E=L=S,g=_);return t.index=g,t.distance=E,t.dxy=L,g===void 0?[t]:[rM(t,f,c,o)]}function rM(t,e,r,a){var i=t.xa,n=t.ya,o=t.distance,l=t.dxy,s=t.index,f={pointNumber:s,x:e[s],y:r[s]};f.tx=ia.isArrayOrTypedArray(a.text)?a.text[s]:a.text,f.htx=Array.isArray(a.hovertext)?a.hovertext[s]:a.hovertext,f.data=Array.isArray(a.customdata)?a.customdata[s]:a.customdata,f.tp=Array.isArray(a.textposition)?a.textposition[s]:a.textposition;var c=a.textfont;c&&(f.ts=ia.isArrayOrTypedArray(c.size)?c.size[s]:c.size,f.tc=ia.isArrayOrTypedArray(c.color)?c.color[s]:c.color,f.tf=Array.isArray(c.family)?c.family[s]:c.family,f.tw=Array.isArray(c.weight)?c.weight[s]:c.weight,f.ty=Array.isArray(c.style)?c.style[s]:c.style,f.tv=Array.isArray(c.variant)?c.variant[s]:c.variant);var u=a.marker;u&&(f.ms=ia.isArrayOrTypedArray(u.size)?u.size[s]:u.size,f.mo=ia.isArrayOrTypedArray(u.opacity)?u.opacity[s]:u.opacity,f.mx=ia.isArrayOrTypedArray(u.symbol)?u.symbol[s]:u.symbol,f.ma=ia.isArrayOrTypedArray(u.angle)?u.angle[s]:u.angle,f.mc=ia.isArrayOrTypedArray(u.color)?u.color[s]:u.color);var v=u&&u.line;v&&(f.mlc=Array.isArray(v.color)?v.color[s]:v.color,f.mlw=ia.isArrayOrTypedArray(v.width)?v.width[s]:v.width);var p=u&&u.gradient;p&&p.type!=="none"&&(f.mgt=Array.isArray(p.type)?p.type[s]:p.type,f.mgc=Array.isArray(p.color)?p.color[s]:p.color);var d=i.c2p(f.x,!0),h=n.c2p(f.y,!0),m=f.mrc||1,y=a.hoverlabel;y&&(f.hbg=Array.isArray(y.bgcolor)?y.bgcolor[s]:y.bgcolor,f.hbc=Array.isArray(y.bordercolor)?y.bordercolor[s]:y.bordercolor,f.hts=ia.isArrayOrTypedArray(y.font.size)?y.font.size[s]:y.font.size,f.htc=Array.isArray(y.font.color)?y.font.color[s]:y.font.color,f.htf=Array.isArray(y.font.family)?y.font.family[s]:y.font.family,f.hnl=ia.isArrayOrTypedArray(y.namelength)?y.namelength[s]:y.namelength);var b=a.hoverinfo;b&&(f.hi=Array.isArray(b)?b[s]:b);var _=a.hovertemplate;_&&(f.ht=Array.isArray(_)?_[s]:_);var g={};g[t.index]=f;var x=a._origX,w=a._origY,T=ia.extendFlat({},t,{color:VO(a,f),x0:d-m,x1:d+m,xLabelVal:x?x[s]:f.x,y0:h-m,y1:h+m,yLabelVal:w?w[s]:f.y,cd:g,distance:o,spikeDistance:l,hovertemplate:f.ht});return f.htx?T.text=f.htx:f.tx?T.text=f.tx:a.text&&(T.text=a.text),ia.fillText(f,a,T),UO.getComponentMethod("errorbars","hoverInfo")(f,a,T),T}var XO={hoverPoints:WO,calcHover:rM},aM={exports:{}},Kx=20,Su={TOO_MANY_POINTS:1e5,SYMBOL_SDF_SIZE:200,SYMBOL_SIZE:Kx,SYMBOL_STROKE:Kx/20,DOT_RE:/-dot/,OPEN_RE:/-open/,DASHES:{solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}},YO=wa,qO=Mr,ZO=k2,tr=Vi,Qx=qo.axisHoverFormat,Jx=Rn,KO=Yh,wd=Xt.extendFlat,QO=Ja.overrideAll,JO=Su.DASHES,e1=tr.line,fi=tr.marker,e7=fi.line,xo=aM.exports=QO({x:tr.x,x0:tr.x0,dx:tr.dx,y:tr.y,y0:tr.y0,dy:tr.dy,xperiod:tr.xperiod,yperiod:tr.yperiod,xperiod0:tr.xperiod0,yperiod0:tr.yperiod0,xperiodalignment:tr.xperiodalignment,yperiodalignment:tr.yperiodalignment,xhoverformat:Qx("x"),yhoverformat:Qx("y"),text:tr.text,hovertext:tr.hovertext,textposition:tr.textposition,textfont:qO({noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,editType:"calc",colorEditType:"style",arrayOk:!0,noNumericWeightValues:!0,variantValues:["normal","small-caps"],description:"Sets the text font."}),mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"],description:["Determines the drawing mode for this scatter trace."].join(" ")},line:{color:e1.color,width:e1.width,shape:{valType:"enumerated",values:["linear","hv","vh","hvh","vhv"],dflt:"linear",editType:"plot",description:["Determines the line shape.","The values correspond to step-wise line shapes."].join(" ")},dash:{valType:"enumerated",values:KO(JO),dflt:"solid",description:"Sets the style of the lines."}},marker:wd({},Jx("marker"),{symbol:fi.symbol,angle:fi.angle,size:fi.size,sizeref:fi.sizeref,sizemin:fi.sizemin,sizemode:fi.sizemode,opacity:fi.opacity,colorbar:fi.colorbar,line:wd({},Jx("marker.line"),{width:e7.width})}),connectgaps:tr.connectgaps,fill:wd({},tr.fill,{dflt:"none"}),fillcolor:ZO(),selected:{marker:tr.selected.marker,textfont:tr.selected.textfont},unselected:{marker:tr.unselected.marker,textfont:tr.unselected.textfont},opacity:YO.opacity},"calc","nested");xo.x.editType=xo.y.editType=xo.x0.editType=xo.y0.editType="calc+clearAxisTypes";xo.hovertemplate=tr.hovertemplate;xo.texttemplate=tr.texttemplate;var iM=aM.exports,Lu={},nM=Su;Lu.isOpenSymbol=function(t){return typeof t=="string"?nM.OPEN_RE.test(t):t%200>100};Lu.isDotSymbol=function(t){return typeof t=="string"?nM.DOT_RE.test(t):t>200};var t1=we,t7=ot,r7=Lu,a7=iM,i7=yu,Sf=jr,n7=Wp,o7=bu,l7=F2,s7=N2,f7=O2,c7=H2,u7=function(e,r,a,i){function n(p,d){return t1.coerce(e,r,a7,p,d)}var o=e.marker?r7.isOpenSymbol(e.marker.symbol):!1,l=Sf.isBubble(e),s=n7(e,r,i,n);if(!s){r.visible=!1;return}o7(e,r,i,n),n("xhoverformat"),n("yhoverformat");var f=s<i7.PTS_LINESONLY?"lines+markers":"lines";n("text"),n("hovertext"),n("hovertemplate"),n("mode",f),Sf.hasMarkers(r)&&(l7(e,r,a,i,n,{noAngleRef:!0,noStandOff:!0}),n("marker.line.width",o||l?1:0)),Sf.hasLines(r)&&(n("connectgaps"),s7(e,r,a,i,n),n("line.shape")),Sf.hasText(r)&&(n("texttemplate"),c7(e,r,i,n,{noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}));var c=(r.line||{}).color,u=(r.marker||{}).color;n("fill"),r.fill!=="none"&&f7(e,r,a,n);var v=t7.getComponentMethod("errorbars","supplyDefaults");v(e,r,c||u||a,{axis:"y"}),v(e,r,c||u||a,{axis:"x",inherit:"y"}),t1.coerceSelectionMarkerOpacity(r,n)},v7=rk,d7=function(e,r,a){var i=e.i;return"x"in e||(e.x=r._x[i]),"y"in e||(e.y=r._y[i]),v7(e,r,a)},oM=kt,h7=_a,Ec=Z1,zc=Co,p7=Or.defaultLine,r1=sr.isArrayOrTypedArray,Dh=Ec(p7),lM=1;function a1(t,e){var r=t;return r[3]*=e,r}function i1(t){if(oM(t))return Dh;var e=Ec(t);return e.length?e:Dh}function n1(t){return oM(t)?t:lM}function m7(t,e,r){var a=t.color;a&&a._inputArray&&(a=a._inputArray);var i=r1(a),n=r1(e),o=zc.extractOpts(t),l=[],s,f,c,u,v;if(o.colorscale!==void 0?s=zc.makeColorScaleFuncFromTrace(t):s=i1,i?f=function(d,h){return d[h]===void 0?Dh:Ec(s(d[h]))}:f=i1,n?c=function(d,h){return d[h]===void 0?lM:n1(d[h])}:c=n1,i||n)for(var p=0;p<r;p++)u=f(a,p),v=c(e,p),l[p]=a1(u,v);else l=a1(Ec(a),e);return l}function y7(t){var e=zc.extractOpts(t),r=e.colorscale;return e.reversescale&&(r=zc.flipScale(e.colorscale)),r.map(function(a){var i=a[0],n=h7(a[1]),o=n.toRgb();return{index:i,rgb:[o.r,o.g,o.b,o.a]}})}var g7={formatColor:m7,parseColorScale:y7},Qf=kt,b7=EM,Lf=Z1,x7=ot,Oo=we,lr=Oo.isArrayOrTypedArray,co=Et,o1=cr,l1=g7.formatColor,So=jr,_7=Lw,Ph=Lu,Ss=Su,w7=hs.DESELECTDIM,s1={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},T7=Ta.appendArrayPointValue;function k7(t,e){var r,a={marker:void 0,markerSel:void 0,markerUnsel:void 0,line:void 0,fill:void 0,errorX:void 0,errorY:void 0,text:void 0,textSel:void 0,textUnsel:void 0},i=t._context.plotGlPixelRatio;if(e.visible!==!0)return a;if(So.hasText(e)&&(a.text=sM(t,e),a.textSel=c1(t,e,e.selected),a.textUnsel=c1(t,e,e.unselected)),So.hasMarkers(e)&&(a.marker=ym(t,e),a.markerSel=$h(t,e,e.selected),a.markerUnsel=$h(t,e,e.unselected),!e.unselected&&lr(e.marker.opacity))){var n=e.marker.opacity;for(a.markerUnsel.opacity=new Array(n.length),r=0;r<n.length;r++)a.markerUnsel.opacity[r]=w7*n[r]}if(So.hasLines(e)){a.line={overlay:!0,thickness:e.line.width*i,color:e.line.color,opacity:e.opacity};var o=(Ss.DASHES[e.line.dash]||[1]).slice();for(r=0;r<o.length;++r)o[r]*=e.line.width*i;a.line.dashes=o}return e.error_x&&e.error_x.visible&&(a.errorX=u1(e,e.error_x,i)),e.error_y&&e.error_y.visible&&(a.errorY=u1(e,e.error_y,i)),e.fill&&e.fill!=="none"&&(a.fill={closed:!0,fill:e.fillcolor,thickness:0}),a}function sM(t,e){var r=t._fullLayout,a=e._length,i=e.textfont,n=e.textposition,o=lr(n)?n:[n],l=i.color,s=i.size,f=i.family,c=i.weight,u=i.style,v=i.variant,p={},d,h=t._context.plotGlPixelRatio,m=e.texttemplate;if(m){p.text=[];var y=r._d3locale,b=Array.isArray(m),_=b?Math.min(m.length,a):a,g=b?function(L){return m[L]}:function(){return m};for(d=0;d<_;d++){var x={i:d},w=e._module.formatLabels(x,e,r),T={};T7(T,e,d);var A=e._meta||{};p.text.push(Oo.texttemplateString(g(d),w,y,T,x,A))}}else lr(e.text)&&e.text.length<a?p.text=e.text.slice():p.text=e.text;if(lr(p.text))for(d=p.text.length;d<a;d++)p.text[d]="";for(p.opacity=e.opacity,p.font={},p.align=[],p.baseline=[],d=0;d<o.length;d++){var M=o[d].split(/\s+/);switch(M[1]){case"left":p.align.push("right");break;case"right":p.align.push("left");break;default:p.align.push(M[1])}switch(M[0]){case"top":p.baseline.push("bottom");break;case"bottom":p.baseline.push("top");break;default:p.baseline.push(M[0])}}if(lr(l))for(p.color=new Array(a),d=0;d<a;d++)p.color[d]=l[d];else p.color=l;if(lr(s)||Array.isArray(f)||lr(c)||Array.isArray(u)||Array.isArray(v))for(p.font=new Array(a),d=0;d<a;d++){var S=p.font[d]={};S.size=(Oo.isTypedArray(s)?s[d]:lr(s)?Qf(s[d])?s[d]:0:s)*h,S.family=Array.isArray(f)?f[d]:f,S.weight=f1(lr(c)?c[d]:c),S.style=Array.isArray(u)?u[d]:u,S.variant=Array.isArray(v)?v[d]:v}else p.font={size:s*h,family:f,weight:f1(c),style:u,variant:v};return p}function f1(t){return t<=1e3?t>500?"bold":"normal":t}function ym(t,e){var r=e._length,a=e.marker,i={},n,o=lr(a.symbol),l=lr(a.angle),s=lr(a.color),f=lr(a.line.color),c=lr(a.opacity),u=lr(a.size),v=lr(a.line.width),p;if(o||(p=Ph.isOpenSymbol(a.symbol)),o||s||f||c||l){i.symbols=new Array(r),i.angles=new Array(r),i.colors=new Array(r),i.borderColors=new Array(r);var d=a.symbol,h=a.angle,m=l1(a,a.opacity,r),y=l1(a.line,a.opacity,r);if(!lr(y[0])){var b=y;for(y=Array(r),n=0;n<r;n++)y[n]=b}if(!lr(m[0])){var _=m;for(m=Array(r),n=0;n<r;n++)m[n]=_}if(!lr(d)){var g=d;for(d=Array(r),n=0;n<r;n++)d[n]=g}if(!lr(h)){var x=h;for(h=Array(r),n=0;n<r;n++)h[n]=x}for(i.symbols=d,i.angles=h,i.colors=m,i.borderColors=y,n=0;n<r;n++)o&&(p=Ph.isOpenSymbol(a.symbol[n])),p&&(y[n]=m[n].slice(),m[n]=m[n].slice(),m[n][3]=0);for(i.opacity=e.opacity,i.markers=new Array(r),n=0;n<r;n++)i.markers[n]=h1({mx:i.symbols[n],ma:i.angles[n]},e)}else p?(i.color=Lf(a.color,"uint8"),i.color[3]=0,i.borderColor=Lf(a.color,"uint8")):(i.color=Lf(a.color,"uint8"),i.borderColor=Lf(a.line.color,"uint8")),i.opacity=e.opacity*a.opacity,i.marker=h1({mx:a.symbol,ma:a.angle},e);var w=1,T=_7(e,w),A;if(u||v){var M=i.sizes=new Array(r),S=i.borderSizes=new Array(r),L=0,E;if(u){for(n=0;n<r;n++)M[n]=T(a.size[n]),L+=M[n];E=L/r}else for(A=T(a.size),n=0;n<r;n++)M[n]=A;if(v)for(n=0;n<r;n++)S[n]=a.line.width[n];else for(A=a.line.width,n=0;n<r;n++)S[n]=A;i.sizeAvg=E}else i.size=T(a&&a.size||10),i.borderSizes=T(a.line.width);return i}function $h(t,e,r){var a=e.marker,i={};return r&&(r.marker&&r.marker.symbol?i=ym(t,Oo.extendFlat({},a,r.marker)):r.marker&&(r.marker.size&&(i.size=r.marker.size),r.marker.color&&(i.colors=r.marker.color),r.marker.opacity!==void 0&&(i.opacity=r.marker.opacity))),i}function c1(t,e,r){var a={};if(!r)return a;if(r.textfont){var i={opacity:1,text:e.text,texttemplate:e.texttemplate,textposition:e.textposition,textfont:Oo.extendFlat({},e.textfont)};r.textfont&&Oo.extendFlat(i.textfont,r.textfont),a=sM(t,i)}return a}function u1(t,e,r){var a={capSize:e.width*2*r,lineWidth:e.thickness*r,color:e.color};return e.copy_ystyle&&(a=t.error_y),a}var v1=Ss.SYMBOL_SDF_SIZE,sn=Ss.SYMBOL_SIZE,d1=Ss.SYMBOL_STROKE,Td={},A7=co.symbolFuncs[0](sn*.05);function h1(t,e){var r=t.mx;if(r==="circle")return null;var a,i,n=co.symbolNumber(r),o=co.symbolFuncs[n%100],l=!!co.symbolNoDot[n%100],s=!!co.symbolNoFill[n%100],f=Ph.isDotSymbol(r);if(t.ma&&(r+="_"+t.ma),Td[r])return Td[r];var c=co.getMarkerAngle(t,e);return f&&!l?a=o(sn*1.1,c)+A7:a=o(sn,c),i=b7(a,{w:v1,h:v1,viewBox:[-sn,-sn,sn,sn],stroke:s?d1:-d1}),Td[r]=i,i||null}function M7(t,e,r){var a=r.length,i=a/2,n,o;if(So.hasLines(e)&&i)if(e.line.shape==="hv"){for(n=[],o=0;o<i-1;o++)isNaN(r[o*2])||isNaN(r[o*2+1])?n.push(NaN,NaN,NaN,NaN):(n.push(r[o*2],r[o*2+1]),!isNaN(r[o*2+2])&&!isNaN(r[o*2+3])?n.push(r[o*2+2],r[o*2+1]):n.push(NaN,NaN));n.push(r[a-2],r[a-1])}else if(e.line.shape==="hvh"){for(n=[],o=0;o<i-1;o++)if(isNaN(r[o*2])||isNaN(r[o*2+1])||isNaN(r[o*2+2])||isNaN(r[o*2+3]))!isNaN(r[o*2])&&!isNaN(r[o*2+1])?n.push(r[o*2],r[o*2+1]):n.push(NaN,NaN),n.push(NaN,NaN);else{var l=(r[o*2]+r[o*2+2])/2;n.push(r[o*2],r[o*2+1],l,r[o*2+1],l,r[o*2+3])}n.push(r[a-2],r[a-1])}else if(e.line.shape==="vhv"){for(n=[],o=0;o<i-1;o++)if(isNaN(r[o*2])||isNaN(r[o*2+1])||isNaN(r[o*2+2])||isNaN(r[o*2+3]))!isNaN(r[o*2])&&!isNaN(r[o*2+1])?n.push(r[o*2],r[o*2+1]):n.push(NaN,NaN),n.push(NaN,NaN);else{var s=(r[o*2+1]+r[o*2+3])/2;n.push(r[o*2],r[o*2+1],r[o*2],s,r[o*2+2],s)}n.push(r[a-2],r[a-1])}else if(e.line.shape==="vh"){for(n=[],o=0;o<i-1;o++)isNaN(r[o*2])||isNaN(r[o*2+1])?n.push(NaN,NaN,NaN,NaN):(n.push(r[o*2],r[o*2+1]),!isNaN(r[o*2+2])&&!isNaN(r[o*2+3])?n.push(r[o*2],r[o*2+3]):n.push(NaN,NaN));n.push(r[a-2],r[a-1])}else n=r;var f=!1;for(o=0;o<n.length;o++)if(isNaN(n[o])){f=!0;break}var c=f||n.length>Ss.TOO_MANY_POINTS||So.hasMarkers(e)?"rect":"round";if(f&&e.connectgaps){var u=n[0],v=n[1];for(o=0;o<n.length;o+=2)isNaN(n[o])||isNaN(n[o+1])?(n[o]=u,n[o+1]=v):(u=n[o],v=n[o+1])}return{join:c,positions:n}}function S7(t,e,r,a,i){var n=x7.getComponentMethod("errorbars","makeComputeError"),o=o1.getFromId(t,e.xaxis,"x"),l=o1.getFromId(t,e.yaxis,"y"),s=r.length/2,f={};function c(u,v){var p=v._id.charAt(0),d=e["error_"+p];if(d&&d.visible&&(v.type==="linear"||v.type==="log")){for(var h=n(d),m={x:0,y:1}[p],y={x:[0,1,2,3],y:[2,3,0,1]}[p],b=new Float64Array(4*s),_=1/0,g=-1/0,x=0,w=0;x<s;x++,w+=4){var T=u[x];if(Qf(T)){var A=r[x*2+m],M=h(T,x),S=M[0],L=M[1];if(Qf(S)&&Qf(L)){var E=T-S,F=T+L;b[w+y[0]]=A-v.c2l(E),b[w+y[1]]=v.c2l(F)-A,b[w+y[2]]=0,b[w+y[3]]=0,_=Math.min(_,T-S),g=Math.max(g,T+L)}}}f[p]={positions:r,errors:b,_bnds:[_,g]}}}return c(a,o),c(i,l),f}function L7(t,e,r,a){var i=e._length,n={},o;if(So.hasMarkers(e)){var l=r.font,s=r.align,f=r.baseline;for(n.offset=new Array(i),o=0;o<i;o++){var c=a.sizes?a.sizes[o]:a.size,u=lr(l)?l[o].size:l.size,v=lr(s)?s.length>1?s[o]:s[0]:s,p=lr(f)?f.length>1?f[o]:f[0]:f,d=s1[v],h=s1[p],m=c?c/.8+1:0,y=-h*m-h*.5;n.offset[o]=[d*m/u,y/u]}}return n}var C7={style:k7,markerStyle:ym,markerSelection:$h,linePositions:M7,errorBarPositions:S7,textPosition:L7},Cf=we,D7=function(e,r){var a=r._scene,i={count:0,dirty:!0,lineOptions:[],fillOptions:[],markerOptions:[],markerSelectedOptions:[],markerUnselectedOptions:[],errorXOptions:[],errorYOptions:[],textOptions:[],textSelectedOptions:[],textUnselectedOptions:[],selectBatch:[],unselectBatch:[]},n={fill2d:!1,scatter2d:!1,error2d:!1,line2d:!1,glText:!1,select2d:!1};return r._scene||(a=r._scene={},a.init=function(){Cf.extendFlat(a,n,i)},a.init(),a.update=function(l){var s=Cf.repeat(l,a.count);if(a.fill2d&&a.fill2d.update(s),a.scatter2d&&a.scatter2d.update(s),a.line2d&&a.line2d.update(s),a.error2d&&a.error2d.update(s.concat(s)),a.select2d&&a.select2d.update(s),a.glText)for(var f=0;f<a.count;f++)a.glText[f].update(l)},a.draw=function(){for(var l=a.count,s=a.fill2d,f=a.error2d,c=a.line2d,u=a.scatter2d,v=a.glText,p=a.select2d,d=a.selectBatch,h=a.unselectBatch,m=0;m<l;m++){if(s&&a.fillOrder[m]&&s.draw(a.fillOrder[m]),c&&a.lineOptions[m]&&c.draw(m),f&&(a.errorXOptions[m]&&f.draw(m),a.errorYOptions[m]&&f.draw(m+l)),u&&a.markerOptions[m])if(h[m].length){var y=Cf.repeat([],a.count);y[m]=h[m],u.draw(y)}else d[m].length||u.draw(m);v[m]&&a.textOptions[m]&&v[m].render()}p&&p.draw(d),a.dirty=!1},a.destroy=function(){a.fill2d&&a.fill2d.destroy&&a.fill2d.destroy(),a.scatter2d&&a.scatter2d.destroy&&a.scatter2d.destroy(),a.error2d&&a.error2d.destroy&&a.error2d.destroy(),a.line2d&&a.line2d.destroy&&a.line2d.destroy(),a.select2d&&a.select2d.destroy&&a.select2d.destroy(),a.glText&&a.glText.forEach(function(l){l.destroy&&l.destroy()}),a.lineOptions=null,a.fillOptions=null,a.markerOptions=null,a.markerSelectedOptions=null,a.markerUnselectedOptions=null,a.errorXOptions=null,a.errorYOptions=null,a.textOptions=null,a.textSelectedOptions=null,a.textUnselectedOptions=null,a.selectBatch=null,a.unselectBatch=null,r._scene=null}),a.dirty||Cf.extendFlat(a,i),a},P7=zM,ro=we,p1=cr,$7=bs.findExtremes,m1=xu,gm=qp,E7=gm.calcMarkerSize,z7=gm.calcAxisExpansion,R7=gm.setFirstScatter,I7=G2,ao=C7,F7=D7,y1=fr.BADNUM,N7=Su.TOO_MANY_POINTS,H7=function(e,r){var a=e._fullLayout,i=r._xA=p1.getFromId(e,r.xaxis,"x"),n=r._yA=p1.getFromId(e,r.yaxis,"y"),o=a._plots[r.xaxis+r.yaxis],l=r._length,s=l>=N7,f=l*2,c={},u,v=i.makeCalcdata(r,"x"),p=n.makeCalcdata(r,"y"),d=m1(r,i,"x",v),h=m1(r,n,"y",p),m=d.vals,y=h.vals;r._x=m,r._y=y,r.xperiodalignment&&(r._origX=v,r._xStarts=d.starts,r._xEnds=d.ends),r.yperiodalignment&&(r._origY=p,r._yStarts=h.starts,r._yEnds=h.ends);var b=new Array(f),_=new Array(l);for(u=0;u<l;u++)b[u*2]=m[u]===y1?NaN:m[u],b[u*2+1]=y[u]===y1?NaN:y[u],_[u]=u;if(i.type==="log")for(u=0;u<f;u+=2)b[u]=i.c2l(b[u]);if(n.type==="log")for(u=1;u<f;u+=2)b[u]=n.c2l(b[u]);s&&i.type!=="log"&&n.type!=="log"?c.tree=P7(b):c.ids=_,I7(e,r);var g=O7(e,o,r,b,m,y),x=F7(e,o);R7(a,r);var w;return s?g.marker&&(w=g.marker.sizeAvg||Math.max(g.marker.size,3)):w=E7(r,l),z7(e,r,i,n,m,y,w),g.errorX&&g1(r,i,g.errorX),g.errorY&&g1(r,n,g.errorY),g.fill&&!x.fill2d&&(x.fill2d=!0),g.marker&&!x.scatter2d&&(x.scatter2d=!0),g.line&&!x.line2d&&(x.line2d=!0),(g.errorX||g.errorY)&&!x.error2d&&(x.error2d=!0),g.text&&!x.glText&&(x.glText=!0),g.marker&&(g.marker.snap=l),x.lineOptions.push(g.line),x.errorXOptions.push(g.errorX),x.errorYOptions.push(g.errorY),x.fillOptions.push(g.fill),x.markerOptions.push(g.marker),x.markerSelectedOptions.push(g.markerSel),x.markerUnselectedOptions.push(g.markerUnsel),x.textOptions.push(g.text),x.textSelectedOptions.push(g.textSel),x.textUnselectedOptions.push(g.textUnsel),x.selectBatch.push([]),x.unselectBatch.push([]),c._scene=x,c.index=x.count,c.x=m,c.y=y,c.positions=b,x.count++,[{x:!1,y:!1,t:c,trace:r}]};function g1(t,e,r){var a=t._extremes[e._id],i=$7(e,r._bnds,{padded:!0});a.min=a.min.concat(i.min),a.max=a.max.concat(i.max)}function O7(t,e,r,a,i,n){var o=ao.style(t,r);if(o.marker&&(o.marker.positions=a),o.line&&a.length>1&&ro.extendFlat(o.line,ao.linePositions(t,r,a)),o.errorX||o.errorY){var l=ao.errorBarPositions(t,r,a,i,n);o.errorX&&ro.extendFlat(o.errorX,l.x),o.errorY&&ro.extendFlat(o.errorY,l.y)}return o.text&&(ro.extendFlat(o.text,{positions:a},ao.textPosition(t,r,o.text,o.marker)),ro.extendFlat(o.textSel,{positions:a},ao.textPosition(t,r,o.text,o.markerSel)),ro.extendFlat(o.textUnsel,{positions:a},ao.textPosition(t,r,o.text,o.markerUnsel))),o}var b1=we,j7=yt,B7=hs.DESELECTDIM;function G7(t){var e=t[0],r=e.trace,a=e.t,i=a._scene,n=a.index,o=i.selectBatch[n],l=i.unselectBatch[n],s=i.textOptions[n],f=i.textSelectedOptions[n]||{},c=i.textUnselectedOptions[n]||{},u=b1.extendFlat({},s),v,p;if(o.length||l.length){var d=f.color,h=c.color,m=s.color,y=b1.isArrayOrTypedArray(m);for(u.color=new Array(r._length),v=0;v<o.length;v++)p=o[v],u.color[p]=d||(y?m[p]:m);for(v=0;v<l.length;v++){p=l[v];var b=y?m[p]:m;u.color[p]=h||(d?b:j7.addOpacity(b,B7))}}i.glText[n].update(u)}var fM={styleTextSelection:G7},x1=jr,U7=fM.styleTextSelection,V7=function(e,r){var a=e.cd,i=e.xaxis,n=e.yaxis,o=[],l=a[0].trace,s=a[0].t,f=l._length,c=s.x,u=s.y,v=s._scene,p=s.index;if(!v)return o;var d=x1.hasText(l),h=x1.hasMarkers(l),m=!h&&!d;if(l.visible!==!0||m)return o;var y=[],b=[];if(r!==!1&&!r.degenerate)for(var _=0;_<f;_++)r.contains([s.xpx[_],s.ypx[_]],!1,_,e)?(y.push(_),o.push({pointNumber:_,x:i.c2d(c[_]),y:n.c2d(u[_])})):b.push(_);if(h){var g=v.scatter2d;if(!y.length&&!b.length){var x=new Array(v.count);x[p]=v.markerOptions[p],g.update.apply(g,x)}else if(!v.selectBatch[p].length&&!v.unselectBatch[p].length){var w=new Array(v.count);w[p]=v.markerUnselectedOptions[p],g.update.apply(g,w)}}return v.selectBatch[p]=y,v.unselectBatch[p]=b,d&&U7(a),o},W7=XO,X7={moduleType:"trace",name:"scattergl",basePlotModule:pr,categories:["gl","regl","cartesian","symbols","errorBarsOK","showLegend","scatter-like"],attributes:iM,supplyDefaults:u7,crossTraceDefaults:j2,colorbar:Ts,formatLabels:d7,calc:H7,hoverPoints:W7.hoverPoints,selectPoints:V7,meta:{hrName:"scatter_gl",description:["The data visualized as scatter point or lines is set in `x` and `y`","using the WebGL plotting engine.","Bubble charts are achieved by setting `marker.size` and/or `marker.color`","to a numerical arrays."].join(" ")}},cM={exports:{}},_1=yt,Y7=function(){},q7=function(e){for(var r in e)typeof e[r]=="function"&&(e[r]=Y7);e.destroy=function(){e.container.parentNode.removeChild(e.container)};var a=document.createElement("div");a.className="no-webgl",a.style.cursor="pointer",a.style.fontSize="24px",a.style.color=_1.defaults[0],a.style.position="absolute",a.style.left=a.style.top="0px",a.style.width=a.style.height="100%",a.style["background-color"]=_1.lightLine,a.style["z-index"]=30;var i=document.createElement("p");return i.textContent="WebGL is not supported by your browser - visit https://get.webgl.org for more info",i.style.position="relative",i.style.top="50%",i.style.left="50%",i.style.height="30%",i.style.width="50%",i.style.margin="-15% 0 0 -25%",a.appendChild(i),e.container.appendChild(a),e.container.style.background="#FFFFFF",e.container.onclick=function(){window.open("https://get.webgl.org")},!1},Z7=q7,K7=RM,Q7=function(e,r,a){var i=e._fullLayout,n=!0;return i._glcanvas.each(function(o){if(o.regl){o.regl.preloadCachedCode(a);return}if(!(o.pick&&!i._has("parcoords"))){try{o.regl=K7({canvas:this,attributes:{antialias:!o.pick,preserveDrawingBuffer:!0},pixelRatio:e._context.plotGlPixelRatio||AM.devicePixelRatio,extensions:r||[],cachedCode:a||{}})}catch{n=!1}o.regl||(n=!1),n&&this.addEventListener("webglcontextlost",function(l){e&&e.emit&&e.emit("plotly_webglcontextlost",{event:l,layer:o.key})},!1)}}),n||Z7({container:i._glcontainer.node()}),n},w1=IM,T1=FM,J7=NM,k1=HM,kd=we,ej=Fn.selectMode,tj=Q7,rj=jr,aj=ek,ij=fM.styleTextSelection,uM={};function nj(t,e,r,a){var i=t._size,n=t.width*a,o=t.height*a,l=i.l*a,s=i.b*a,f=i.r*a,c=i.t*a,u=i.w*a,v=i.h*a;return[l+e.domain[0]*u,s+r.domain[0]*v,n-f-(1-e.domain[1])*u,o-c-(1-r.domain[1])*v]}var oj=cM.exports=function(e,r,a){if(a.length){var i=e._fullLayout,n=r._scene,o=r.xaxis,l=r.yaxis,s,f;if(n){var c=tj(e,["ANGLE_instanced_arrays","OES_element_index_uint"],uM);if(!c){n.init();return}var u=n.count,v=i._glcanvas.data()[0].regl;if(aj(e,r,a),n.dirty){if((n.line2d||n.error2d)&&!(n.scatter2d||n.fill2d||n.glText)&&v.clear({color:!0,depth:!0}),n.error2d===!0&&(n.error2d=J7(v)),n.line2d===!0&&(n.line2d=T1(v)),n.scatter2d===!0&&(n.scatter2d=w1(v)),n.fill2d===!0&&(n.fill2d=T1(v)),n.glText===!0)for(n.glText=new Array(u),s=0;s<u;s++)n.glText[s]=new k1(v);if(n.glText){if(u>n.glText.length){var p=u-n.glText.length;for(s=0;s<p;s++)n.glText.push(new k1(v))}else if(u<n.glText.length){var d=n.glText.length-u,h=n.glText.splice(u,d);h.forEach(function(k){k.destroy()})}for(s=0;s<u;s++)n.glText[s].update(n.textOptions[s])}if(n.line2d&&(n.line2d.update(n.lineOptions),n.lineOptions=n.lineOptions.map(function(k){if(k&&k.positions){for(var C=k.positions,$=0;$<C.length&&(isNaN(C[$])||isNaN(C[$+1]));)$+=2;for(var R=C.length-2;R>$&&(isNaN(C[R])||isNaN(C[R+1]));)R-=2;k.positions=C.slice($,R+2)}return k}),n.line2d.update(n.lineOptions)),n.error2d){var m=(n.errorXOptions||[]).concat(n.errorYOptions||[]);n.error2d.update(m)}n.scatter2d&&n.scatter2d.update(n.markerOptions),n.fillOrder=kd.repeat(null,u),n.fill2d&&(n.fillOptions=n.fillOptions.map(function(k,C){var $=a[C];if(!(!k||!$||!$[0]||!$[0].trace)){var R=$[0],j=R.trace,G=R.t,Y=n.lineOptions[C],O,K,W=[];j._ownfill&&W.push(C),j._nexttrace&&W.push(C+1),W.length&&(n.fillOrder[C]=W);var X=[],B=Y&&Y.positions||G.positions,ee,ae;if(j.fill==="tozeroy"){for(ee=0;ee<B.length&&isNaN(B[ee+1]);)ee+=2;for(ae=B.length-2;ae>ee&&isNaN(B[ae+1]);)ae-=2;B[ee+1]!==0&&(X=[B[ee],0]),X=X.concat(B.slice(ee,ae+2)),B[ae+1]!==0&&(X=X.concat([B[ae],0]))}else if(j.fill==="tozerox"){for(ee=0;ee<B.length&&isNaN(B[ee]);)ee+=2;for(ae=B.length-2;ae>ee&&isNaN(B[ae]);)ae-=2;B[ee]!==0&&(X=[0,B[ee+1]]),X=X.concat(B.slice(ee,ae+2)),B[ae]!==0&&(X=X.concat([0,B[ae+1]]))}else if(j.fill==="toself"||j.fill==="tonext"){for(X=[],O=0,k.splitNull=!0,K=0;K<B.length;K+=2)(isNaN(B[K])||isNaN(B[K+1]))&&(X=X.concat(B.slice(O,K)),X.push(B[O],B[O+1]),X.push(null,null),O=K+2);X=X.concat(B.slice(O)),O&&X.push(B[O],B[O+1])}else{var de=j._nexttrace;if(de){var fe=n.lineOptions[C+1];if(fe){var q=fe.positions;if(j.fill==="tonexty"){for(X=B.slice(),C=Math.floor(q.length/2);C--;){var te=q[C*2],le=q[C*2+1];isNaN(te)||isNaN(le)||X.push(te,le)}k.fill=de.fillcolor}}}}if(j._prevtrace&&j._prevtrace.fill==="tonext"){var ce=n.lineOptions[C-1].positions,ye=X.length/2;O=ye;var ue=[O];for(K=0;K<ce.length;K+=2)(isNaN(ce[K])||isNaN(ce[K+1]))&&(ue.push(K/2+ye+1),O=K+2);X=X.concat(ce),k.hole=ue}return k.fillmode=j.fill,k.opacity=j.opacity,k.positions=X,k}}),n.fill2d.update(n.fillOptions))}var y=i.dragmode,b=ej(y),_=i.clickmode.indexOf("select")>-1;for(s=0;s<u;s++){var g=a[s][0],x=g.trace,w=g.t,T=w.index,A=x._length,M=w.x,S=w.y;if(x.selectedpoints||b||_){if(b||(b=!0),x.selectedpoints){var L=n.selectBatch[T]=kd.selIndices2selPoints(x),E={};for(f=0;f<L.length;f++)E[L[f]]=1;var F=[];for(f=0;f<A;f++)E[f]||F.push(f);n.unselectBatch[T]=F}var N=w.xpx=new Array(A),z=w.ypx=new Array(A);for(f=0;f<A;f++)N[f]=o.c2p(M[f]),z[f]=l.c2p(S[f])}else w.xpx=w.ypx=null}if(b){if(n.select2d||(n.select2d=w1(i._glcanvas.data()[1].regl)),n.scatter2d){var H=new Array(u);for(s=0;s<u;s++)H[s]=n.selectBatch[s].length||n.unselectBatch[s].length?n.markerUnselectedOptions[s]:{};n.scatter2d.update(H)}n.select2d&&(n.select2d.update(n.markerOptions),n.select2d.update(n.markerSelectedOptions)),n.glText&&a.forEach(function(k){var C=((k||[])[0]||{}).trace||{};rj.hasText(C)&&ij(k)})}else n.scatter2d&&n.scatter2d.update(n.markerOptions);var D={viewport:nj(i,o,l,e._context.plotGlPixelRatio),range:[(o._rl||o.range)[0],(l._rl||l.range)[0],(o._rl||o.range)[1],(l._rl||l.range)[1]]},P=kd.repeat(D,n.count);n.fill2d&&n.fill2d.update(P),n.line2d&&n.line2d.update(P),n.error2d&&n.error2d.update(P.concat(P)),n.scatter2d&&n.scatter2d.update(P),n.select2d&&n.select2d.update(P),n.glText&&n.glText.forEach(function(k){k.update(D)})}}};oj.reglPrecompiled=uM;var lj=cM.exports,vM=X7;vM.plot=lj;var sj=vM,fj=sj;const DB=Ni(fj);var dM={};(function(t){var e=hr;t.name="treemap",t.plot=function(r,a,i,n){e.plotBasePlot(t.name,r,a,i,n)},t.clean=function(r,a,i,n){e.cleanBasePlot(t.name,r,a,i,n)}})(dM);var hM={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"linear",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"]},cj=wa,uj=zr.hovertemplateAttrs,vj=zr.texttemplateAttrs,dj=Rn,hj=Wi.attributes,li=Mu,A1=hM,kl=Xt.extendFlat,pj=ta.pattern,mj={labels:{valType:"data_array",editType:"calc",description:["Sets the labels of each of the sectors."].join(" ")},parents:{valType:"data_array",editType:"calc",description:["Sets the parent sectors for each of the sectors.","Empty string items '' are understood to reference","the root node in the hierarchy.",'If `ids` is filled, `parents` items are understood to be "ids" themselves.',"When `ids` is not set, plotly attempts to find matching items in `labels`,","but beware they must be unique."].join(" ")},values:{valType:"data_array",editType:"calc",description:["Sets the values associated with each of the sectors.","Use with `branchvalues` to determine how the values are summed."].join(" ")},branchvalues:{valType:"enumerated",values:["remainder","total"],dflt:"remainder",editType:"calc",description:["Determines how the items in `values` are summed.","When set to *total*, items in `values` are taken to be value of all its descendants.","When set to *remainder*, items in `values` corresponding to the root and the branches sectors","are taken to be the extra part not part of the sum of the values at their leaves."].join(" ")},count:{valType:"flaglist",flags:["branches","leaves"],dflt:"leaves",editType:"calc",description:["Determines default for `values` when it is not provided,","by inferring a 1 for each of the *leaves* and/or *branches*, otherwise 0."].join(" ")},level:{valType:"any",editType:"plot",anim:!0,description:["Sets the level from which this trace hierarchy is rendered.","Set `level` to `''` to start from the root node in the hierarchy.",'Must be an "id" if `ids` is filled in, otherwise plotly attempts to find a matching',"item in `labels`."].join(" ")},maxdepth:{valType:"integer",editType:"plot",dflt:-1,description:["Sets the number of rendered sectors from any given `level`.","Set `maxdepth` to *-1* to render all the levels in the hierarchy."].join(" ")},marker:kl({colors:{valType:"data_array",editType:"calc",description:["Sets the color of each sector of this trace.","If not specified, the default trace color set is used","to pick the sector colors."].join(" ")},line:{color:kl({},li.marker.line.color,{dflt:null,description:["Sets the color of the line enclosing each sector.","Defaults to the `paper_bgcolor` value."].join(" ")}),width:kl({},li.marker.line.width,{dflt:1}),editType:"calc"},pattern:pj,editType:"calc"},dj("marker",{colorAttr:"colors",anim:!1})),leaf:{opacity:{valType:"number",editType:"style",min:0,max:1,description:["Sets the opacity of the leaves. With colorscale","it is defaulted to 1; otherwise it is defaulted to 0.7"].join(" ")},editType:"plot"},text:li.text,textinfo:{valType:"flaglist",flags:["label","text","value","current path","percent root","percent entry","percent parent"],extras:["none"],editType:"plot",description:["Determines which trace information appear on the graph."].join(" ")},texttemplate:vj({editType:"plot"},{keys:A1.eventDataKeys.concat(["label","value"])}),hovertext:li.hovertext,hoverinfo:kl({},cj.hoverinfo,{flags:["label","text","value","name","current path","percent root","percent entry","percent parent"],dflt:"label+text+value+name"}),hovertemplate:uj({},{keys:A1.eventDataKeys}),textfont:li.textfont,insidetextorientation:li.insidetextorientation,insidetextfont:li.insidetextfont,outsidetextfont:kl({},li.outsidetextfont,{description:["Sets the font used for `textinfo` lying outside the sector.","This option refers to the root of the hierarchy","presented at the center of a sunburst graph.","Please note that if a hierarchy has multiple root nodes,","this option won't have any effect and `insidetextfont` would be used."].join(" ")}),rotation:{valType:"angle",dflt:0,editType:"plot",description:["Rotates the whole diagram counterclockwise by some angle.","By default the first slice starts at 3 o'clock."].join(" ")},sort:li.sort,root:{color:{valType:"color",editType:"calc",dflt:"rgba(0,0,0,0)",description:["sets the color of the root node for a sunburst/treemap/icicle trace.","this has no effect when a colorscale is used to set the markers."].join(" ")},editType:"calc"},domain:hj({name:"sunburst",trace:!0,editType:"calc"})},Cu={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"poly",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"],gapWithPathbar:1},yj=zr.hovertemplateAttrs,gj=zr.texttemplateAttrs,bj=Rn,xj=Wi.attributes,an=Mu,va=mj,M1=Cu,Ad=Xt.extendFlat,_j=ta.pattern,pM={labels:va.labels,parents:va.parents,values:va.values,branchvalues:va.branchvalues,count:va.count,level:va.level,maxdepth:va.maxdepth,tiling:{packing:{valType:"enumerated",values:["squarify","binary","dice","slice","slice-dice","dice-slice"],dflt:"squarify",editType:"plot",description:["Determines d3 treemap solver.","For more info please refer to https://github.com/d3/d3-hierarchy#treemap-tiling"].join(" ")},squarifyratio:{valType:"number",min:1,dflt:1,editType:"plot",description:["When using *squarify* `packing` algorithm, according to https://github.com/d3/d3-hierarchy/blob/v3.1.1/README.md#squarify_ratio","this option specifies the desired aspect ratio of the generated rectangles.","The ratio must be specified as a number greater than or equal to one.","Note that the orientation of the generated rectangles (tall or wide)","is not implied by the ratio; for example, a ratio of two will attempt","to produce a mixture of rectangles whose width:height ratio is either 2:1 or 1:2.","When using *squarify*, unlike d3 which uses the Golden Ratio i.e. 1.618034,","Plotly applies 1 to increase squares in treemap layouts."].join(" ")},flip:{valType:"flaglist",flags:["x","y"],dflt:"",editType:"plot",description:["Determines if the positions obtained from solver are flipped on each axis."].join(" ")},pad:{valType:"number",min:0,dflt:3,editType:"plot",description:["Sets the inner padding (in px)."].join(" ")},editType:"calc"},marker:Ad({pad:{t:{valType:"number",min:0,editType:"plot",description:["Sets the padding form the top (in px)."].join(" ")},l:{valType:"number",min:0,editType:"plot",description:["Sets the padding form the left (in px)."].join(" ")},r:{valType:"number",min:0,editType:"plot",description:["Sets the padding form the right (in px)."].join(" ")},b:{valType:"number",min:0,editType:"plot",description:["Sets the padding form the bottom (in px)."].join(" ")},editType:"calc"},colors:va.marker.colors,pattern:_j,depthfade:{valType:"enumerated",values:[!0,!1,"reversed"],editType:"style",description:["Determines if the sector colors are faded towards","the background from the leaves up to the headers.","This option is unavailable when a `colorscale` is present,","defaults to false when `marker.colors` is set,","but otherwise defaults to true.","When set to *reversed*, the fading direction is inverted,","that is the top elements within hierarchy are drawn with fully saturated colors","while the leaves are faded towards the background color."].join(" ")},line:va.marker.line,cornerradius:{valType:"number",min:0,dflt:0,editType:"plot",description:["Sets the maximum rounding of corners (in px)."].join(" ")},editType:"calc"},bj("marker",{colorAttr:"colors",anim:!1})),pathbar:{visible:{valType:"boolean",dflt:!0,editType:"plot",description:["Determines if the path bar is drawn","i.e. outside the trace `domain` and","with one pixel gap."].join(" ")},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot",description:["Determines on which side of the the treemap the","`pathbar` should be presented."].join(" ")},edgeshape:{valType:"enumerated",values:[">","<","|","/","\\"],dflt:">",editType:"plot",description:["Determines which shape is used for edges between `barpath` labels."].join(" ")},thickness:{valType:"number",min:12,editType:"plot",description:["Sets the thickness of `pathbar` (in px). If not specified the `pathbar.textfont.size` is used","with 3 pixles extra padding on each side."].join(" ")},textfont:Ad({},an.textfont,{description:"Sets the font used inside `pathbar`."}),editType:"calc"},text:an.text,textinfo:va.textinfo,texttemplate:gj({editType:"plot"},{keys:M1.eventDataKeys.concat(["label","value"])}),hovertext:an.hovertext,hoverinfo:va.hoverinfo,hovertemplate:yj({},{keys:M1.eventDataKeys}),textfont:an.textfont,insidetextfont:an.insidetextfont,outsidetextfont:Ad({},an.outsidetextfont,{description:["Sets the font used for `textinfo` lying outside the sector.","This option refers to the root of the hierarchy","presented on top left corner of a treemap graph.","Please note that if a hierarchy has multiple root nodes,","this option won't have any effect and `insidetextfont` would be used."].join(" ")}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"top left",editType:"plot",description:["Sets the positions of the `text` elements."].join(" ")},sort:an.sort,root:va.root,domain:xj({name:"treemap",trace:!0,editType:"calc"})},mM={treemapcolorway:{valType:"colorlist",editType:"calc",description:["Sets the default treemap slice colors. Defaults to the main","`colorway` used for trace colors. If you specify a new","list here it can still be extended with lighter and darker","colors, see `extendtreemapcolors`."].join(" ")},extendtreemapcolors:{valType:"boolean",dflt:!0,editType:"calc",description:["If `true`, the treemap slice colors (whether given by `treemapcolorway` or","inherited from `colorway`) will be extended to three times its","original length by first repeating every color 20% lighter then","each color 20% darker. This is intended to reduce the likelihood","of reusing the same color when you have many slices, but you can","set `false` to disable.","Colors provided in the trace, using `marker.colors`, are never","extended."].join(" ")}},S1=we,wj=pM,Tj=yt,kj=Wi.defaults,Aj=Ln.handleText,Mj=As.TEXTPAD,Sj=LA.handleMarkerDefaults,yM=Co,Lj=yM.hasColorscale,Cj=yM.handleDefaults,Dj=function(e,r,a,i){function n(m,y){return S1.coerce(e,r,wj,m,y)}var o=n("labels"),l=n("parents");if(!o||!o.length||!l||!l.length){r.visible=!1;return}var s=n("values");s&&s.length?n("branchvalues"):n("count"),n("level"),n("maxdepth");var f=n("tiling.packing");f==="squarify"&&n("tiling.squarifyratio"),n("tiling.flip"),n("tiling.pad");var c=n("text");n("texttemplate"),r.texttemplate||n("textinfo",S1.isArrayOrTypedArray(c)?"text+label":"label"),n("hovertext"),n("hovertemplate");var u=n("pathbar.visible"),v="auto";Aj(e,r,i,n,v,{hasPathbar:u,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),n("textposition");var p=r.textposition.indexOf("bottom")!==-1;Sj(e,r,i,n);var d=r._hasColorscale=Lj(e,"marker","colors")||(e.marker||{}).coloraxis;d?Cj(e,r,i,n,{prefix:"marker.",cLetter:"c"}):n("marker.depthfade",!(r.marker.colors||[]).length);var h=r.textfont.size*2;n("marker.pad.t",p?h/4:h),n("marker.pad.l",h/4),n("marker.pad.r",h/4),n("marker.pad.b",p?h:h/4),n("marker.cornerradius"),r._hovered={marker:{line:{width:2,color:Tj.contrast(i.paper_bgcolor)}}},u&&(n("pathbar.thickness",r.pathbar.textfont.size+2*Mj),n("pathbar.side"),n("pathbar.edgeshape")),n("sort"),n("root.color"),kj(r,i,n),r._length=null},Pj=we,$j=mM,Ej=function(e,r){function a(i,n){return Pj.coerce(e,r,$j,i,n)}a("treemapcolorway",r.colorway),a("extendtreemapcolors")},Rc={},gM={};(function(t){var e=zh,r=kt,a=we,i=Co.makeColorScaleFuncFromTrace,n=Pc.makePullColorFn,o=Pc.generateExtendedColors,l=Co.calc,s=fr.ALMOST_EQUAL,f={},c={},u={};t.calc=function(p,d){var h=p._fullLayout,m=d.ids,y=a.isArrayOrTypedArray(m),b=d.labels,_=d.parents,g=d.values,x=a.isArrayOrTypedArray(g),w=[],T={},A={},M=function(B,ee){T[B]?T[B].push(ee):T[B]=[ee],A[ee]=1},S=function(B){return B||typeof B=="number"},L=function(B){return!x||r(g[B])&&g[B]>=0},E,F,N;y?(E=Math.min(m.length,_.length),F=function(B){return S(m[B])&&L(B)},N=function(B){return String(m[B])}):(E=Math.min(b.length,_.length),F=function(B){return S(b[B])&&L(B)},N=function(B){return String(b[B])}),x&&(E=Math.min(E,g.length));for(var z=0;z<E;z++)if(F(z)){var H=N(z),D=S(_[z])?String(_[z]):"",P={i:z,id:H,pid:D,label:S(b[z])?String(b[z]):""};x&&(P.v=+g[z]),w.push(P),M(D,H)}if(T[""]){if(T[""].length>1){for(var $=a.randstr(),R=0;R<w.length;R++)w[R].pid===""&&(w[R].pid=$);w.unshift({hasMultipleRoots:!0,id:$,pid:"",label:""})}}else{var k=[],C;for(C in T)A[C]||k.push(C);if(k.length===1)C=k[0],w.unshift({hasImpliedRoot:!0,id:C,pid:"",label:C});else return a.warn(["Multiple implied roots, cannot build",d.type,"hierarchy of",d.name+".","These roots include:",k.join(", ")].join(" "))}var j;try{j=e.stratify().id(function(B){return B.id}).parentId(function(B){return B.pid})(w)}catch(B){return a.warn(["Failed to build",d.type,"hierarchy of",d.name+".","Error:",B.message].join(" "))}var G=e.hierarchy(j),Y=!1;if(x)switch(d.branchvalues){case"remainder":G.sum(function(B){return B.data.v});break;case"total":G.each(function(B){var ee=B.data.data,ae=ee.v;if(B.children){var de=B.children.reduce(function(fe,q){return fe+q.data.data.v},0);if((ee.hasImpliedRoot||ee.hasMultipleRoots)&&(ae=de),ae<de*s)return Y=!0,a.warn(["Total value for node",B.data.data.id,"of",d.name,"is smaller than the sum of its children.",`
5
- parent value =`,ae,`
6
- children sum =`,de].join(" "))}B.value=ae});break}else v(G,d,{branches:d.count.indexOf("branches")!==-1,leaves:d.count.indexOf("leaves")!==-1});if(!Y){d.sort&&G.sort(function(B,ee){return ee.value-B.value});var O,K,W=d.marker.colors||[],X=!!W.length;return d._hasColorscale?(X||(W=x?d.values:d._values),l(p,d,{vals:W,containerStr:"marker",cLetter:"c"}),K=i(d.marker)):O=n(h["_"+d.type+"colormap"]),G.each(function(B){var ee=B.data.data;ee.color=d._hasColorscale?K(W[ee.i]):O(W[ee.i],ee.id)}),w[0].hierarchy=G,w}},t._runCrossTraceCalc=function(p,d){var h=d._fullLayout,m=d.calcdata,y=h[p+"colorway"],b=h["_"+p+"colormap"];h["extend"+p+"colors"]&&(y=o(y,p==="icicle"?u:p==="treemap"?c:f));var _=0,g;function x(M){var S=M.data.data,L=S.id;S.color===!1&&(b[L]?S.color=b[L]:M.parent?M.parent.parent?S.color=M.parent.data.data.color:(b[L]=S.color=y[_%y.length],_++):S.color=g)}for(var w=0;w<m.length;w++){var T=m[w],A=T[0];A.trace.type===p&&A.hierarchy&&(g=A.trace.root.color,A.hierarchy.each(x))}},t.crossTraceCalc=function(p){return t._runCrossTraceCalc("sunburst",p)};function v(p,d,h){var m=0,y=p.children;if(y){for(var b=y.length,_=0;_<b;_++)m+=v(y[_],d,h);h.branches&&m++}else h.leaves&&m++;return p.value=p.data.data.value=m,d._values||(d._values=[]),d._values[p.data.data.i]=m,m}})(gM);var bM=gM;Rc.calc=function(t,e){return bM.calc(t,e)};Rc.crossTraceCalc=function(t){return bM._runCrossTraceCalc("treemap",t)};var Xi={};(function(t){var e=we,r=yt,a=Bi,i=In;t.findEntryWithLevel=function(s,f){var c;return f&&s.eachAfter(function(u){if(t.getPtId(u)===f)return c=u.copy()}),c||s},t.findEntryWithChild=function(s,f){var c;return s.eachAfter(function(u){for(var v=u.children||[],p=0;p<v.length;p++){var d=v[p];if(t.getPtId(d)===f)return c=u.copy()}}),c||s},t.isEntry=function(s){return!s.parent},t.isLeaf=function(s){return!s.children},t.getPtId=function(s){return s.data.data.id},t.getPtLabel=function(s){return s.data.data.label},t.getValue=function(s){return s.value},t.isHierarchyRoot=function(s){return l(s)===""},t.setSliceCursor=function(s,f,c){var u=c.isTransitioning;if(!u){var v=s.datum();u=c.hideOnRoot&&t.isHierarchyRoot(v)||c.hideOnLeaves&&t.isLeaf(v)}a(s,u?null:"pointer")};function n(s,f,c){return{color:t.getOutsideTextFontKey("color",s,f,c),family:t.getOutsideTextFontKey("family",s,f,c),size:t.getOutsideTextFontKey("size",s,f,c),weight:t.getOutsideTextFontKey("weight",s,f,c),style:t.getOutsideTextFontKey("style",s,f,c),variant:t.getOutsideTextFontKey("variant",s,f,c),textcase:t.getOutsideTextFontKey("textcase",s,f,c),lineposition:t.getOutsideTextFontKey("lineposition",s,f,c),shadow:t.getOutsideTextFontKey("shadow",s,f,c)}}function o(s,f,c,u){var v=(u||{}).onPathbar,p=f.data.data,d=p.i,h=e.castOption(s,d,(v?"pathbar.textfont":"insidetextfont")+".color");return!h&&s._input.textfont&&(h=e.castOption(s._input,d,"textfont.color")),{color:h||r.contrast(p.color),family:t.getInsideTextFontKey("family",s,f,c,u),size:t.getInsideTextFontKey("size",s,f,c,u),weight:t.getInsideTextFontKey("weight",s,f,c,u),style:t.getInsideTextFontKey("style",s,f,c,u),variant:t.getInsideTextFontKey("variant",s,f,c,u),textcase:t.getInsideTextFontKey("textcase",s,f,c,u),lineposition:t.getInsideTextFontKey("lineposition",s,f,c,u),shadow:t.getInsideTextFontKey("shadow",s,f,c,u)}}t.getInsideTextFontKey=function(s,f,c,u,v){var p=(v||{}).onPathbar,d=p?"pathbar.textfont":"insidetextfont",h=c.data.data.i;return e.castOption(f,h,d+"."+s)||e.castOption(f,h,"textfont."+s)||u.size},t.getOutsideTextFontKey=function(s,f,c,u){var v=c.data.data.i;return e.castOption(f,v,"outsidetextfont."+s)||e.castOption(f,v,"textfont."+s)||u.size},t.isOutsideText=function(s,f){return!s._hasColorscale&&t.isHierarchyRoot(f)},t.determineTextFont=function(s,f,c,u){return t.isOutsideText(s,f)?n(s,f,c):o(s,f,c,u)},t.hasTransition=function(s){return!!(s&&s.duration>0)},t.getMaxDepth=function(s){return s.maxdepth>=0?s.maxdepth:1/0},t.isHeader=function(s,f){return!(t.isLeaf(s)||s.depth===f._maxDepth-1)};function l(s){return s.data.data.pid}t.getParent=function(s,f){return t.findEntryWithLevel(s,l(f))},t.listPath=function(s,f){var c=s.parent;if(!c)return[];var u=f?[c.data[f]]:[c];return t.listPath(c,f).concat(u)},t.getPath=function(s){return t.listPath(s,"label").join("/")+"/"},t.formatValue=i.formatPieValue,t.formatPercent=function(s,f){var c=e.formatPercent(s,0);return c==="0%"&&(c=i.formatPiePercent(s,f)),c}})(Xi);var zj=function t(e,r,a){var i;a.swapXY&&(i=e.x0,e.x0=e.y0,e.y0=i,i=e.x1,e.x1=e.y1,e.y1=i),a.flipX&&(i=e.x0,e.x0=r[0]-e.x1,e.x1=r[0]-i),a.flipY&&(i=e.y0,e.y0=r[1]-e.y1,e.y1=r[1]-i);var n=e.children;if(n)for(var o=0;o<n.length;o++)t(n[o],r,a)},uo=zh,Rj=zj,xM=function(e,r,a){var i=a.flipX,n=a.flipY,o=a.packing==="dice-slice",l=a.pad[n?"bottom":"top"],s=a.pad[i?"right":"left"],f=a.pad[i?"left":"right"],c=a.pad[n?"top":"bottom"],u;o&&(u=s,s=l,l=u,u=f,f=c,c=u);var v=uo.treemap().tile(Ij(a.packing,a.squarifyratio)).paddingInner(a.pad.inner).paddingLeft(s).paddingRight(f).paddingTop(l).paddingBottom(c).size(o?[r[1],r[0]]:r)(e);return(o||i||n)&&Rj(v,r,{swapXY:o,flipX:i,flipY:n}),v};function Ij(t,e){switch(t){case"squarify":return uo.treemapSquarify.ratio(e);case"binary":return uo.treemapBinary;case"dice":return uo.treemapDice;case"slice":return uo.treemapSlice;default:return uo.treemapSliceDice}}var Fj=Et,Nj=yt,_M=function(e,r,a,i,n){var o=r.data.data,l=o.i,s=n||o.color;if(l>=0){r.i=o.i;var f=a.marker;f.pattern?(!f.colors||!f.pattern.shape)&&(f.color=s,r.color=s):(f.color=s,r.color=s),Fj.pointStyle(e,a,i,r)}else Nj.fill(e,s)},L1=bt,io=yt,C1=we,Md=Xi,Hj=mi.resizeText,Oj=_M;function jj(t){var e=t._fullLayout._treemaplayer.selectAll(".trace");Hj(t,e,"treemap"),e.each(function(r){var a=L1.select(this),i=r[0],n=i.trace;a.style("opacity",n.opacity),a.selectAll("path.surface").each(function(o){L1.select(this).call(wM,o,n,t,{hovered:!1})})})}function wM(t,e,r,a,i){var n=(i||{}).hovered,o=e.data.data,l=o.i,s,f,c=o.color,u=Md.isHierarchyRoot(e),v=1;if(n)s=r._hovered.marker.line.color,f=r._hovered.marker.line.width;else if(u&&c===r.root.color)v=100,s="rgba(0,0,0,0)",f=0;else if(s=C1.castOption(r,l,"marker.line.color")||io.defaultLine,f=C1.castOption(r,l,"marker.line.width")||0,!r._hasColorscale&&!e.onPathbar){var p=r.marker.depthfade;if(p){var d=io.combine(io.addOpacity(r._backgroundColor,.75),c),h;if(p===!0){var m=Md.getMaxDepth(r);isFinite(m)?Md.isLeaf(e)?h=0:h=r._maxVisibleLayers-(e.data.depth-r._entryDepth):h=e.data.height+1}else h=e.data.depth-r._entryDepth,r._atRootLevel||h++;if(h>0)for(var y=0;y<h;y++){var b=.5*y/h;c=io.combine(io.addOpacity(d,b),c)}}}t.call(Oj,e,r,a,c).style("stroke-width",f).call(io.stroke,s).style("opacity",v)}var bm={style:jj,styleOne:wM},no=bt,D1=ot,Bj=Ta.appendArrayPointValue,Al=Na,P1=we,Gj=ms,mr=Xi,Uj=In,Vj=Uj.formatPieValue,xm=function(e,r,a,i,n){var o=i[0],l=o.trace,s=o.hierarchy,f=l.type==="sunburst",c=l.type==="treemap"||l.type==="icicle";"_hasHoverLabel"in l||(l._hasHoverLabel=!1),"_hasHoverEvent"in l||(l._hasHoverEvent=!1);var u=function(d){var h=a._fullLayout;if(!(a._dragging||h.hovermode===!1)){var m=a._fullData[l.index],y=d.data.data,b=y.i,_=mr.isHierarchyRoot(d),g=mr.getParent(s,d),x=mr.getValue(d),w=function(j){return P1.castOption(m,b,j)},T=w("hovertemplate"),A=Al.castHoverinfo(m,h,b),M=h.separators,S;if(T||A&&A!=="none"&&A!=="skip"){var L,E;f&&(L=o.cx+d.pxmid[0]*(1-d.rInscribed),E=o.cy+d.pxmid[1]*(1-d.rInscribed)),c&&(L=d._hoverX,E=d._hoverY);var F={},N=[],z=[],H=function(j){return N.indexOf(j)!==-1};A&&(N=A==="all"?m._module.attributes.hoverinfo.flags:A.split("+")),F.label=y.label,H("label")&&F.label&&z.push(F.label),y.hasOwnProperty("v")&&(F.value=y.v,F.valueLabel=Vj(F.value,M),H("value")&&z.push(F.valueLabel)),F.currentPath=d.currentPath=mr.getPath(d.data),H("current path")&&!_&&z.push(F.currentPath);var D,P=[],k=function(){P.indexOf(D)===-1&&(z.push(D),P.push(D))};F.percentParent=d.percentParent=x/mr.getValue(g),F.parent=d.parentString=mr.getPtLabel(g),H("percent parent")&&(D=mr.formatPercent(F.percentParent,M)+" of "+F.parent,k()),F.percentEntry=d.percentEntry=x/mr.getValue(r),F.entry=d.entry=mr.getPtLabel(r),H("percent entry")&&!_&&!d.onPathbar&&(D=mr.formatPercent(F.percentEntry,M)+" of "+F.entry,k()),F.percentRoot=d.percentRoot=x/mr.getValue(s),F.root=d.root=mr.getPtLabel(s),H("percent root")&&!_&&(D=mr.formatPercent(F.percentRoot,M)+" of "+F.root,k()),F.text=w("hovertext")||w("text"),H("text")&&(D=F.text,P1.isValidTextValue(D)&&z.push(D)),S=[Ml(d,m,n.eventDataKeys)];var C={trace:m,y:E,_x0:d._x0,_x1:d._x1,_y0:d._y0,_y1:d._y1,text:z.join("<br>"),name:T||H("name")?m.name:void 0,color:w("hoverlabel.bgcolor")||y.color,borderColor:w("hoverlabel.bordercolor"),fontFamily:w("hoverlabel.font.family"),fontSize:w("hoverlabel.font.size"),fontColor:w("hoverlabel.font.color"),fontWeight:w("hoverlabel.font.weight"),fontStyle:w("hoverlabel.font.style"),fontVariant:w("hoverlabel.font.variant"),nameLength:w("hoverlabel.namelength"),textAlign:w("hoverlabel.align"),hovertemplate:T,hovertemplateLabels:F,eventData:S};f&&(C.x0=L-d.rInscribed*d.rpx1,C.x1=L+d.rInscribed*d.rpx1,C.idealAlign=d.pxmid[0]<0?"left":"right"),c&&(C.x=L,C.idealAlign=L<0?"left":"right");var $=[];Al.loneHover(C,{container:h._hoverlayer.node(),outerContainer:h._paper.node(),gd:a,inOut_bbox:$}),S[0].bbox=$[0],l._hasHoverLabel=!0}if(c){var R=e.select("path.surface");n.styleOne(R,d,m,a,{hovered:!0})}l._hasHoverEvent=!0,a.emit("plotly_hover",{points:S||[Ml(d,m,n.eventDataKeys)],event:no.event})}},v=function(d){var h=a._fullLayout,m=a._fullData[l.index],y=no.select(this).datum();if(l._hasHoverEvent&&(d.originalEvent=no.event,a.emit("plotly_unhover",{points:[Ml(y,m,n.eventDataKeys)],event:no.event}),l._hasHoverEvent=!1),l._hasHoverLabel&&(Al.loneUnhover(h._hoverlayer.node()),l._hasHoverLabel=!1),c){var b=e.select("path.surface");n.styleOne(b,y,m,a,{hovered:!1})}},p=function(d){var h=a._fullLayout,m=a._fullData[l.index],y=f&&(mr.isHierarchyRoot(d)||mr.isLeaf(d)),b=mr.getPtId(d),_=mr.isEntry(d)?mr.findEntryWithChild(s,b):mr.findEntryWithLevel(s,b),g=mr.getPtId(_),x={points:[Ml(d,m,n.eventDataKeys)],event:no.event};y||(x.nextLevel=g);var w=Gj.triggerHandler(a,"plotly_"+l.type+"click",x);if(w!==!1&&h.hovermode&&(a._hoverdata=[Ml(d,m,n.eventDataKeys)],Al.click(a,no.event)),!y&&w!==!1&&!a._dragging&&!a._transitioning){D1.call("_storeDirectGUIEdit",m,h._tracePreGUI[m.uid],{level:m.level});var T={data:[{level:g}],traces:[l.index]},A={frame:{redraw:!1,duration:n.transitionTime},transition:{duration:n.transitionTime,easing:n.transitionEasing},mode:"immediate",fromcurrent:!0};Al.loneUnhover(h._hoverlayer.node()),D1.call("animate",a,T,A)}};e.on("mouseover",u),e.on("mouseout",v),e.on("click",p)};function Ml(t,e,r){for(var a=t.data.data,i={curveNumber:e.index,pointNumber:a.i,data:e._input,fullData:e},n=0;n<r.length;n++){var o=r[n];o in t&&(i[o]=t[o])}return"parentString"in t&&!mr.isHierarchyRoot(t)&&(i.parent=t.parentString),Bj(i,e,a.i),i}var $1=bt,Df=we,E1=Et,Wj=Tr,Xj=xM,z1=bm.styleOne,Sd=Cu,oo=Xi,Yj=xm,Ld=!0,qj=function(e,r,a,i,n){var o=n.barDifY,l=n.width,s=n.height,f=n.viewX,c=n.viewY,u=n.pathSlice,v=n.toMoveInsideSlice,p=n.strTransform,d=n.hasTransition,h=n.handleSlicesExit,m=n.makeUpdateSliceInterpolator,y=n.makeUpdateTextInterpolator,b={},_=e._context.staticPlot,g=e._fullLayout,x=r[0],w=x.trace,T=x.hierarchy,A=l/w._entryDepth,M=oo.listPath(a.data,"id"),S=Xj(T.copy(),[l,s],{packing:"dice",pad:{inner:0,top:0,left:0,right:0,bottom:0}}).descendants();S=S.filter(function(E){var F=M.indexOf(E.data.id);return F===-1?!1:(E.x0=A*F,E.x1=A*(F+1),E.y0=o,E.y1=o+s,E.onPathbar=!0,!0)}),S.reverse(),i=i.data(S,oo.getPtId),i.enter().append("g").classed("pathbar",!0),h(i,Ld,b,[l,s],u),i.order();var L=i;d&&(L=L.transition().each("end",function(){var E=$1.select(this);oo.setSliceCursor(E,e,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:!1})})),L.each(function(E){E._x0=f(E.x0),E._x1=f(E.x1),E._y0=c(E.y0),E._y1=c(E.y1),E._hoverX=f(E.x1-Math.min(l,s)/2),E._hoverY=c(E.y1-s/2);var F=$1.select(this),N=Df.ensureSingle(F,"path","surface",function(P){P.style("pointer-events",_?"none":"all")});d?N.transition().attrTween("d",function(P){var k=m(P,Ld,b,[l,s]);return function(C){return u(k(C))}}):N.attr("d",u),F.call(Yj,a,e,r,{styleOne:z1,eventDataKeys:Sd.eventDataKeys,transitionTime:Sd.CLICK_TRANSITION_TIME,transitionEasing:Sd.CLICK_TRANSITION_EASING}).call(oo.setSliceCursor,e,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:e._transitioning}),N.call(z1,E,w,e,{hovered:!1}),E._text=(oo.getPtLabel(E)||"").split("<br>").join(" ")||"";var z=Df.ensureSingle(F,"g","slicetext"),H=Df.ensureSingle(z,"text","",function(P){P.attr("data-notex",1)}),D=Df.ensureUniformFontSize(e,oo.determineTextFont(w,E,g.font,{onPathbar:!0}));H.text(E._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(E1.font,D).call(Wj.convertToTspans,e),E.textBB=E1.bBox(H.node()),E.transform=v(E,{fontSize:D.size,onPathbar:!0}),E.transform.fontSize=D.size,d?H.transition().attrTween("transform",function(P){var k=y(P,Ld,b,[l,s]);return function(C){return p(k(C))}}):H.attr("transform",p(E))})},R1=bt,Cd=K1.interpolate,Li=Xi,Sl=we,I1=As.TEXTPAD,Zj=pm,Kj=Zj.toMoveInsideBar,Qj=mi,Dd=Qj.recordMinTextSize,Jj=Cu,eB=qj;function nn(t){return Li.isHierarchyRoot(t)?"":Li.getPtId(t)}var tB=function(e,r,a,i,n){var o=e._fullLayout,l=r[0],s=l.trace,f=s.type,c=f==="icicle",u=l.hierarchy,v=Li.findEntryWithLevel(u,s.level),p=R1.select(a),d=p.selectAll("g.pathbar"),h=p.selectAll("g.slice");if(!v){d.remove(),h.remove();return}var m=Li.isHierarchyRoot(v),y=!o.uniformtext.mode&&Li.hasTransition(i),b=Li.getMaxDepth(s),_=function(J){return J.data.depth-v.data.depth<b},g=o._size,x=s.domain,w=g.w*(x.x[1]-x.x[0]),T=g.h*(x.y[1]-x.y[0]),A=w,M=s.pathbar.thickness,S=s.marker.line.width+Jj.gapWithPathbar,L=s.pathbar.visible?s.pathbar.side.indexOf("bottom")>-1?T+S:-(M+S):0,E={x0:A,x1:A,y0:L,y1:L+M},F=function(J,be,Z){var me=s.tiling.pad,ge=function(Ae){return Ae-me<=be.x0},Pe=function(Ae){return Ae+me>=be.x1},Ee=function(Ae){return Ae-me<=be.y0},Le=function(Ae){return Ae+me>=be.y1};return J.x0===be.x0&&J.x1===be.x1&&J.y0===be.y0&&J.y1===be.y1?{x0:J.x0,x1:J.x1,y0:J.y0,y1:J.y1}:{x0:ge(J.x0-me)?0:Pe(J.x0-me)?Z[0]:J.x0,x1:ge(J.x1+me)?0:Pe(J.x1+me)?Z[0]:J.x1,y0:Ee(J.y0-me)?0:Le(J.y0-me)?Z[1]:J.y0,y1:Ee(J.y1+me)?0:Le(J.y1+me)?Z[1]:J.y1}},N=null,z={},H={},D=null,P=function(J,be){return be?z[nn(J)]:H[nn(J)]},k=function(J,be,Z,me){if(be)return z[nn(u)]||E;var ge=H[s.level]||Z;return _(J)?F(J,ge,me):{}};l.hasMultipleRoots&&m&&b++,s._maxDepth=b,s._backgroundColor=o.paper_bgcolor,s._entryDepth=v.data.depth,s._atRootLevel=m;var C=-w/2+g.l+g.w*(x.x[1]+x.x[0])/2,$=-T/2+g.t+g.h*(1-(x.y[1]+x.y[0])/2),R=function(J){return C+J},j=function(J){return $+J},G=j(0),Y=R(0),O=function(J){return Y+J},K=function(J){return G+J};function W(J,be){return J+","+be}var X=O(0),B=function(J){J.x=Math.max(X,J.x)},ee=s.pathbar.edgeshape,ae=function(J){var be=O(Math.max(Math.min(J.x0,J.x0),0)),Z=O(Math.min(Math.max(J.x1,J.x1),A)),me=K(J.y0),ge=K(J.y1),Pe=M/2,Ee={},Le={};Ee.x=be,Le.x=Z,Ee.y=Le.y=(me+ge)/2;var Ae={x:be,y:me},Oe={x:Z,y:me},$e={x:Z,y:ge},ze={x:be,y:ge};return ee===">"?(Ae.x-=Pe,Oe.x-=Pe,$e.x-=Pe,ze.x-=Pe):ee==="/"?($e.x-=Pe,ze.x-=Pe,Ee.x-=Pe/2,Le.x-=Pe/2):ee==="\\"?(Ae.x-=Pe,Oe.x-=Pe,Ee.x-=Pe/2,Le.x-=Pe/2):ee==="<"&&(Ee.x-=Pe,Le.x-=Pe),B(Ae),B(ze),B(Ee),B(Oe),B($e),B(Le),"M"+W(Ae.x,Ae.y)+"L"+W(Oe.x,Oe.y)+"L"+W(Le.x,Le.y)+"L"+W($e.x,$e.y)+"L"+W(ze.x,ze.y)+"L"+W(Ee.x,Ee.y)+"Z"},de=s[c?"tiling":"marker"].pad,fe=function(J){return s.textposition.indexOf(J)!==-1},q=fe("top"),te=fe("left"),le=fe("right"),ce=fe("bottom"),ye=function(J){var be=R(J.x0),Z=R(J.x1),me=j(J.y0),ge=j(J.y1),Pe=Z-be,Ee=ge-me;if(!Pe||!Ee)return"";var Le=s.marker.cornerradius||0,Ae=Math.min(Le,Pe/2,Ee/2);Ae&&J.data&&J.data.data&&J.data.data.label&&(q&&(Ae=Math.min(Ae,de.t)),te&&(Ae=Math.min(Ae,de.l)),le&&(Ae=Math.min(Ae,de.r)),ce&&(Ae=Math.min(Ae,de.b)));var Oe=function($e,ze){return Ae?"a"+W(Ae,Ae)+" 0 0 1 "+W($e,ze):""};return"M"+W(be,me+Ae)+Oe(Ae,-Ae)+"L"+W(Z-Ae,me)+Oe(Ae,Ae)+"L"+W(Z,ge-Ae)+Oe(-Ae,Ae)+"L"+W(be+Ae,ge)+Oe(-Ae,-Ae)+"Z"},ue=function(J,be){var Z=J.x0,me=J.x1,ge=J.y0,Pe=J.y1,Ee=J.textBB,Le=q||be.isHeader&&!ce,Ae=Le?"start":ce?"end":"middle",Oe=fe("right"),$e=fe("left")||be.onPathbar,ze=$e?-1:Oe?1:0;if(be.isHeader){if(Z+=(c?de:de.l)-I1,me-=(c?de:de.r)-I1,Z>=me){var je=(Z+me)/2;Z=je,me=je}var at;ce?(at=Pe-(c?de:de.b),ge<at&&at<Pe&&(ge=at)):(at=ge+(c?de:de.t),ge<at&&at<Pe&&(Pe=at))}var xe=Kj(Z,me,ge,Pe,Ee,{isHorizontal:!1,constrained:!0,angle:0,anchor:Ae,leftToRight:ze});return xe.fontSize=be.fontSize,xe.targetX=R(xe.targetX),xe.targetY=j(xe.targetY),isNaN(xe.targetX)||isNaN(xe.targetY)?{}:(Z!==me&&ge!==Pe&&Dd(s.type,xe,o),{scale:xe.scale,rotate:xe.rotate,textX:xe.textX,textY:xe.textY,anchorX:xe.anchorX,anchorY:xe.anchorY,targetX:xe.targetX,targetY:xe.targetY})},oe=function(J,be){for(var Z,me=0,ge=J;!Z&&me<b;)me++,ge=ge.parent,ge?Z=P(ge,be):me=b;return Z||{}},pe=function(J,be,Z,me){var ge=P(J,be),Pe;if(be)Pe=E;else{var Ee=P(v,be);Ee?Pe=F(J,Ee,me):Pe={}}return Cd(ge,Pe)},Me=function(J,be,Z,me,ge){var Pe=P(J,be),Ee;if(Pe)Ee=Pe;else if(be)Ee=E;else if(N)if(J.parent){var Le=D||Z;Le&&!be?Ee=F(J,Le,me):(Ee={},Sl.extendFlat(Ee,oe(J,be)))}else Ee=Sl.extendFlat({},J),c&&(ge.orientation==="h"?ge.flipX?Ee.x0=J.x1:Ee.x1=0:ge.flipY?Ee.y0=J.y1:Ee.y1=0);else Ee={};return Cd(Ee,{x0:J.x0,x1:J.x1,y0:J.y0,y1:J.y1})},ve=function(J,be,Z,me){var ge=P(J,be),Pe={},Ee=k(J,be,Z,me);Sl.extendFlat(Pe,{transform:ue({x0:Ee.x0,x1:Ee.x1,y0:Ee.y0,y1:Ee.y1,textBB:J.textBB,_text:J._text},{isHeader:Li.isHeader(J,s)})}),ge?Pe=ge:J.parent&&Sl.extendFlat(Pe,oe(J,be));var Le=J.transform;return J.x0!==J.x1&&J.y0!==J.y1&&Dd(s.type,Le,o),Cd(Pe,{transform:{scale:Le.scale,rotate:Le.rotate,textX:Le.textX,textY:Le.textY,anchorX:Le.anchorX,anchorY:Le.anchorY,targetX:Le.targetX,targetY:Le.targetY}})},ke=function(J,be,Z,me,ge){var Pe=me[0],Ee=me[1];y?J.exit().transition().each(function(){var Le=R1.select(this),Ae=Le.select("path.surface");Ae.transition().attrTween("d",function($e){var ze=pe($e,be,Z,[Pe,Ee]);return function(je){return ge(ze(je))}});var Oe=Le.select("g.slicetext");Oe.attr("opacity",0)}).remove():J.exit().remove()},_e=function(J){var be=J.transform;return J.x0!==J.x1&&J.y0!==J.y1&&Dd(s.type,be,o),Sl.getTextTransform({textX:be.textX,textY:be.textY,anchorX:be.anchorX,anchorY:be.anchorY,targetX:be.targetX,targetY:be.targetY,scale:be.scale,rotate:be.rotate})};y&&(d.each(function(J){z[nn(J)]={x0:J.x0,x1:J.x1,y0:J.y0,y1:J.y1},J.transform&&(z[nn(J)].transform={textX:J.transform.textX,textY:J.transform.textY,anchorX:J.transform.anchorX,anchorY:J.transform.anchorY,targetX:J.transform.targetX,targetY:J.transform.targetY,scale:J.transform.scale,rotate:J.transform.rotate})}),h.each(function(J){H[nn(J)]={x0:J.x0,x1:J.x1,y0:J.y0,y1:J.y1},J.transform&&(H[nn(J)].transform={textX:J.transform.textX,textY:J.transform.textY,anchorX:J.transform.anchorX,anchorY:J.transform.anchorY,targetX:J.transform.targetX,targetY:J.transform.targetY,scale:J.transform.scale,rotate:J.transform.rotate}),!N&&Li.isEntry(J)&&(N=J)})),D=n(e,r,v,h,{width:w,height:T,viewX:R,viewY:j,pathSlice:ye,toMoveInsideSlice:ue,prevEntry:N,makeUpdateSliceInterpolator:Me,makeUpdateTextInterpolator:ve,handleSlicesExit:ke,hasTransition:y,strTransform:_e}),s.pathbar.visible?eB(e,r,v,d,{barDifY:L,width:A,height:M,viewX:O,viewY:K,pathSlice:ae,toMoveInsideSlice:ue,makeUpdateSliceInterpolator:Me,makeUpdateTextInterpolator:ve,handleSlicesExit:ke,hasTransition:y,strTransform:_e}):d.remove()},rB=bt,aB=Xi,iB=mi,nB=iB.clearMinTextSize,oB=Cn.resizeText,F1=tB,lB=function(e,r,a,i,n){var o=n.type,l=n.drawDescendants,s=e._fullLayout,f=s["_"+o+"layer"],c,u,v=!a;if(nB(o,s),c=f.selectAll("g.trace."+o).data(r,function(d){return d[0].trace.uid}),c.enter().append("g").classed("trace",!0).classed(o,!0),c.order(),!s.uniformtext.mode&&aB.hasTransition(a)){i&&(u=i());var p=rB.transition().duration(a.duration).ease(a.easing).each("end",function(){u&&u()}).each("interrupt",function(){u&&u()});p.each(function(){f.selectAll("g.trace").each(function(d){F1(e,d,this,a,l)})})}else c.each(function(d){F1(e,d,this,a,l)}),s.uniformtext.mode&&oB(e,f.selectAll(".trace"),o);v&&c.exit().remove()},TM={},N1=bt,H1=yt,O1=we,sB=mi.resizeText,fB=_M;function cB(t){var e=t._fullLayout._sunburstlayer.selectAll(".trace");sB(t,e,"sunburst"),e.each(function(r){var a=N1.select(this),i=r[0],n=i.trace;a.style("opacity",n.opacity),a.selectAll("path.surface").each(function(o){N1.select(this).call(kM,o,n,t)})})}function kM(t,e,r,a){var i=e.data.data,n=!e.children,o=i.i,l=O1.castOption(r,o,"marker.line.color")||H1.defaultLine,s=O1.castOption(r,o,"marker.line.width")||0;t.call(fB,e,r,a).style("stroke-width",s).call(H1.stroke,l).style("opacity",n?r.leaf.opacity:null)}var uB={style:cB,styleOne:kM};(function(t){var e=bt,r=zh,a=K1.interpolate,i=Et,n=we,o=Tr,l=mi,s=l.recordMinTextSize,f=l.clearMinTextSize,c=XA,u=In.getRotationAngle,v=c.computeTransform,p=c.transformInsideText,d=uB.styleOne,h=Cn.resizeText,m=xm,y=hM,b=Xi;t.plot=function(A,M,S,L){var E=A._fullLayout,F=E._sunburstlayer,N,z,H=!S,D=!E.uniformtext.mode&&b.hasTransition(S);if(f("sunburst",E),N=F.selectAll("g.trace.sunburst").data(M,function(k){return k[0].trace.uid}),N.enter().append("g").classed("trace",!0).classed("sunburst",!0).attr("stroke-linejoin","round"),N.order(),D){L&&(z=L());var P=e.transition().duration(S.duration).ease(S.easing).each("end",function(){z&&z()}).each("interrupt",function(){z&&z()});P.each(function(){F.selectAll("g.trace").each(function(k){_(A,k,this,S)})})}else N.each(function(k){_(A,k,this,S)}),E.uniformtext.mode&&h(A,E._sunburstlayer.selectAll(".trace"),"sunburst");H&&N.exit().remove()};function _(A,M,S,L){var E=A._context.staticPlot,F=A._fullLayout,N=!F.uniformtext.mode&&b.hasTransition(L),z=e.select(S),H=z.selectAll("g.slice"),D=M[0],P=D.trace,k=D.hierarchy,C=b.findEntryWithLevel(k,P.level),$=b.getMaxDepth(P),R=F._size,j=P.domain,G=R.w*(j.x[1]-j.x[0]),Y=R.h*(j.y[1]-j.y[0]),O=.5*Math.min(G,Y),K=D.cx=R.l+R.w*(j.x[1]+j.x[0])/2,W=D.cy=R.t+R.h*(1-j.y[0])-Y/2;if(!C)return H.remove();var X=null,B={};N&&H.each(function(Z){B[b.getPtId(Z)]={rpx0:Z.rpx0,rpx1:Z.rpx1,x0:Z.x0,x1:Z.x1,transform:Z.transform},!X&&b.isEntry(Z)&&(X=Z)});var ee=g(C).descendants(),ae=C.height+1,de=0,fe=$;D.hasMultipleRoots&&b.isHierarchyRoot(C)&&(ee=ee.slice(1),ae-=1,de=1,fe+=1),ee=ee.filter(function(Z){return Z.y1<=fe});var q=u(P.rotation);q&&ee.forEach(function(Z){Z.x0+=q,Z.x1+=q});var te=Math.min(ae,$),le=function(Z){return(Z-de)/te*O},ce=function(Z,me){return[Z*Math.cos(me),-Z*Math.sin(me)]},ye=function(Z){return n.pathAnnulus(Z.rpx0,Z.rpx1,Z.x0,Z.x1,K,W)},ue=function(Z){return K+w(Z)[0]*(Z.transform.rCenter||0)+(Z.transform.x||0)},oe=function(Z){return W+w(Z)[1]*(Z.transform.rCenter||0)+(Z.transform.y||0)};H=H.data(ee,b.getPtId),H.enter().append("g").classed("slice",!0),N?H.exit().transition().each(function(){var Z=e.select(this),me=Z.select("path.surface");me.transition().attrTween("d",function(Pe){var Ee=ke(Pe);return function(Le){return ye(Ee(Le))}});var ge=Z.select("g.slicetext");ge.attr("opacity",0)}).remove():H.exit().remove(),H.order();var pe=null;if(N&&X){var Me=b.getPtId(X);H.each(function(Z){pe===null&&b.getPtId(Z)===Me&&(pe=Z.x1)})}var ve=H;N&&(ve=ve.transition().each("end",function(){var Z=e.select(this);b.setSliceCursor(Z,A,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:!1})})),ve.each(function(Z){var me=e.select(this),ge=n.ensureSingle(me,"path","surface",function($e){$e.style("pointer-events",E?"none":"all")});Z.rpx0=le(Z.y0),Z.rpx1=le(Z.y1),Z.xmid=(Z.x0+Z.x1)/2,Z.pxmid=ce(Z.rpx1,Z.xmid),Z.midangle=-(Z.xmid-Math.PI/2),Z.startangle=-(Z.x0-Math.PI/2),Z.stopangle=-(Z.x1-Math.PI/2),Z.halfangle=.5*Math.min(n.angleDelta(Z.x0,Z.x1)||Math.PI,Math.PI),Z.ring=1-Z.rpx0/Z.rpx1,Z.rInscribed=x(Z),N?ge.transition().attrTween("d",function($e){var ze=_e($e);return function(je){return ye(ze(je))}}):ge.attr("d",ye),me.call(m,C,A,M,{eventDataKeys:y.eventDataKeys,transitionTime:y.CLICK_TRANSITION_TIME,transitionEasing:y.CLICK_TRANSITION_EASING}).call(b.setSliceCursor,A,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:A._transitioning}),ge.call(d,Z,P,A);var Pe=n.ensureSingle(me,"g","slicetext"),Ee=n.ensureSingle(Pe,"text","",function($e){$e.attr("data-notex",1)}),Le=n.ensureUniformFontSize(A,b.determineTextFont(P,Z,F.font));Ee.text(t.formatSliceLabel(Z,C,P,M,F)).classed("slicetext",!0).attr("text-anchor","middle").call(i.font,Le).call(o.convertToTspans,A);var Ae=i.bBox(Ee.node());Z.transform=p(Ae,Z,D),Z.transform.targetX=ue(Z),Z.transform.targetY=oe(Z);var Oe=function($e,ze){var je=$e.transform;return v(je,ze),je.fontSize=Le.size,s(P.type,je,F),n.getTextTransform(je)};N?Ee.transition().attrTween("transform",function($e){var ze=J($e);return function(je){return Oe(ze(je),Ae)}}):Ee.attr("transform",Oe(Z,Ae))});function ke(Z){var me=b.getPtId(Z),ge=B[me],Pe=B[b.getPtId(C)],Ee;if(Pe){var Le=(Z.x1>Pe.x1?2*Math.PI:0)+q;Ee=Z.rpx1<Pe.rpx1?{x0:Z.x0,x1:Z.x1,rpx0:0,rpx1:0}:{x0:Le,x1:Le,rpx0:Z.rpx0,rpx1:Z.rpx1}}else{var Ae,Oe=b.getPtId(Z.parent);H.each(function(xe){if(b.getPtId(xe)===Oe)return Ae=xe});var $e=Ae.children,ze;$e.forEach(function(xe,We){if(b.getPtId(xe)===me)return ze=We});var je=$e.length,at=a(Ae.x0,Ae.x1);Ee={rpx0:O,rpx1:O,x0:at(ze/je),x1:at((ze+1)/je)}}return a(ge,Ee)}function _e(Z){var me=B[b.getPtId(Z)],ge,Pe={x0:Z.x0,x1:Z.x1,rpx0:Z.rpx0,rpx1:Z.rpx1};if(me)ge=me;else if(X)if(Z.parent)if(pe){var Ee=(Z.x1>pe?2*Math.PI:0)+q;ge={x0:Ee,x1:Ee}}else ge={rpx0:O,rpx1:O},n.extendFlat(ge,be(Z));else ge={rpx0:0,rpx1:0};else ge={x0:q,x1:q};return a(ge,Pe)}function J(Z){var me=B[b.getPtId(Z)],ge,Pe=Z.transform;if(me)ge=me;else if(ge={rpx1:Z.rpx1,transform:{textPosAngle:Pe.textPosAngle,scale:0,rotate:Pe.rotate,rCenter:Pe.rCenter,x:Pe.x,y:Pe.y}},X)if(Z.parent)if(pe){var Ee=Z.x1>pe?2*Math.PI:0;ge.x0=ge.x1=Ee}else n.extendFlat(ge,be(Z));else ge.x0=ge.x1=q;else ge.x0=ge.x1=q;var Le=a(ge.transform.textPosAngle,Z.transform.textPosAngle),Ae=a(ge.rpx1,Z.rpx1),Oe=a(ge.x0,Z.x0),$e=a(ge.x1,Z.x1),ze=a(ge.transform.scale,Pe.scale),je=a(ge.transform.rotate,Pe.rotate),at=Pe.rCenter===0?3:ge.transform.rCenter===0?1/3:1,xe=a(ge.transform.rCenter,Pe.rCenter),We=function(Xe){return xe(Math.pow(Xe,at))};return function(Xe){var Re=Ae(Xe),et=Oe(Xe),Ue=$e(Xe),I=We(Xe),U=ce(Re,(et+Ue)/2),V=Le(Xe),Q={pxmid:U,rpx1:Re,transform:{textPosAngle:V,rCenter:I,x:Pe.x,y:Pe.y}};return s(P.type,Pe,F),{transform:{targetX:ue(Q),targetY:oe(Q),scale:ze(Xe),rotate:je(Xe),rCenter:I}}}}function be(Z){var me=Z.parent,ge=B[b.getPtId(me)],Pe={};if(ge){var Ee=me.children,Le=Ee.indexOf(Z),Ae=Ee.length,Oe=a(ge.x0,ge.x1);Pe.x0=Oe(Le/Ae),Pe.x1=Oe(Le/Ae)}else Pe.x0=Pe.x1=0;return Pe}}function g(A){return r.partition().size([2*Math.PI,A.height+1])(A)}t.formatSliceLabel=function(A,M,S,L,E){var F=S.texttemplate,N=S.textinfo;if(!F&&(!N||N==="none"))return"";var z=E.separators,H=L[0],D=A.data.data,P=H.hierarchy,k=b.isHierarchyRoot(A),C=b.getParent(P,A),$=b.getValue(A);if(!F){var R=N.split("+"),j=function(de){return R.indexOf(de)!==-1},G=[],Y;if(j("label")&&D.label&&G.push(D.label),D.hasOwnProperty("v")&&j("value")&&G.push(b.formatValue(D.v,z)),!k){j("current path")&&G.push(b.getPath(A.data));var O=0;j("percent parent")&&O++,j("percent entry")&&O++,j("percent root")&&O++;var K=O>1;if(O){var W,X=function(de){Y=b.formatPercent(W,z),K&&(Y+=" of "+de),G.push(Y)};j("percent parent")&&!k&&(W=$/b.getValue(C),X("parent")),j("percent entry")&&(W=$/b.getValue(M),X("entry")),j("percent root")&&(W=$/b.getValue(P),X("root"))}}return j("text")&&(Y=n.castOption(S,D.i,"text"),n.isValidTextValue(Y)&&G.push(Y)),G.join("<br>")}var B=n.castOption(S,D.i,"texttemplate");if(!B)return"";var ee={};D.label&&(ee.label=D.label),D.hasOwnProperty("v")&&(ee.value=D.v,ee.valueLabel=b.formatValue(D.v,z)),ee.currentPath=b.getPath(A.data),k||(ee.percentParent=$/b.getValue(C),ee.percentParentLabel=b.formatPercent(ee.percentParent,z),ee.parent=b.getPtLabel(C)),ee.percentEntry=$/b.getValue(M),ee.percentEntryLabel=b.formatPercent(ee.percentEntry,z),ee.entry=b.getPtLabel(M),ee.percentRoot=$/b.getValue(P),ee.percentRootLabel=b.formatPercent(ee.percentRoot,z),ee.root=b.getPtLabel(P),D.hasOwnProperty("color")&&(ee.color=D.color);var ae=n.castOption(S,D.i,"text");return(n.isValidTextValue(ae)||ae==="")&&(ee.text=ae),ee.customdata=n.castOption(S,D.i,"customdata"),n.texttemplateString(B,ee,E._d3locale,ee,S._meta||{})};function x(A){return A.rpx0===0&&n.isFullCircle([A.x0,A.x1])?1:Math.max(0,Math.min(1/(1+1/Math.sin(A.halfangle)),A.ring/2))}function w(A){return T(A.rpx1,A.transform.textPosAngle)}function T(A,M){return[A*Math.sin(M),-A*Math.cos(M)]}})(TM);var j1=bt,Pf=we,B1=Et,vB=Tr,dB=xM,G1=bm.styleOne,Pd=Cu,ki=Xi,hB=xm,pB=TM.formatSliceLabel,$d=!1,mB=function(e,r,a,i,n){var o=n.width,l=n.height,s=n.viewX,f=n.viewY,c=n.pathSlice,u=n.toMoveInsideSlice,v=n.strTransform,p=n.hasTransition,d=n.handleSlicesExit,h=n.makeUpdateSliceInterpolator,m=n.makeUpdateTextInterpolator,y=n.prevEntry,b={},_=e._context.staticPlot,g=e._fullLayout,x=r[0],w=x.trace,T=w.textposition.indexOf("left")!==-1,A=w.textposition.indexOf("right")!==-1,M=w.textposition.indexOf("bottom")!==-1,S=!M&&!w.marker.pad.t||M&&!w.marker.pad.b,L=dB(a,[o,l],{packing:w.tiling.packing,squarifyratio:w.tiling.squarifyratio,flipX:w.tiling.flip.indexOf("x")>-1,flipY:w.tiling.flip.indexOf("y")>-1,pad:{inner:w.tiling.pad,top:w.marker.pad.t,left:w.marker.pad.l,right:w.marker.pad.r,bottom:w.marker.pad.b}}),E=L.descendants(),F=1/0,N=-1/0;E.forEach(function(k){var C=k.depth;C>=w._maxDepth?(k.x0=k.x1=(k.x0+k.x1)/2,k.y0=k.y1=(k.y0+k.y1)/2):(F=Math.min(F,C),N=Math.max(N,C))}),i=i.data(E,ki.getPtId),w._maxVisibleLayers=isFinite(N)?N-F+1:0,i.enter().append("g").classed("slice",!0),d(i,$d,b,[o,l],c),i.order();var z=null;if(p&&y){var H=ki.getPtId(y);i.each(function(k){z===null&&ki.getPtId(k)===H&&(z={x0:k.x0,x1:k.x1,y0:k.y0,y1:k.y1})})}var D=function(){return z||{x0:0,x1:o,y0:0,y1:l}},P=i;return p&&(P=P.transition().each("end",function(){var k=j1.select(this);ki.setSliceCursor(k,e,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),P.each(function(k){var C=ki.isHeader(k,w);k._x0=s(k.x0),k._x1=s(k.x1),k._y0=f(k.y0),k._y1=f(k.y1),k._hoverX=s(k.x1-w.marker.pad.r),k._hoverY=f(M?k.y1-w.marker.pad.b/2:k.y0+w.marker.pad.t/2);var $=j1.select(this),R=Pf.ensureSingle($,"path","surface",function(W){W.style("pointer-events",_?"none":"all")});p?R.transition().attrTween("d",function(W){var X=h(W,$d,D(),[o,l]);return function(B){return c(X(B))}}):R.attr("d",c),$.call(hB,a,e,r,{styleOne:G1,eventDataKeys:Pd.eventDataKeys,transitionTime:Pd.CLICK_TRANSITION_TIME,transitionEasing:Pd.CLICK_TRANSITION_EASING}).call(ki.setSliceCursor,e,{isTransitioning:e._transitioning}),R.call(G1,k,w,e,{hovered:!1}),k.x0===k.x1||k.y0===k.y1?k._text="":C?k._text=S?"":ki.getPtLabel(k)||"":k._text=pB(k,a,w,r,g)||"";var j=Pf.ensureSingle($,"g","slicetext"),G=Pf.ensureSingle(j,"text","",function(W){W.attr("data-notex",1)}),Y=Pf.ensureUniformFontSize(e,ki.determineTextFont(w,k,g.font)),O=k._text||" ",K=C&&O.indexOf("<br>")===-1;G.text(O).classed("slicetext",!0).attr("text-anchor",A?"end":T||K?"start":"middle").call(B1.font,Y).call(vB.convertToTspans,e),k.textBB=B1.bBox(G.node()),k.transform=u(k,{fontSize:Y.size,isHeader:C}),k.transform.fontSize=Y.size,p?G.transition().attrTween("transform",function(W){var X=m(W,$d,D(),[o,l]);return function(B){return v(X(B))}}):G.attr("transform",v(k))}),z},yB=lB,gB=mB,bB=function(e,r,a,i){return yB(e,r,a,i,{type:"treemap",drawDescendants:gB})},xB={moduleType:"trace",name:"treemap",basePlotModule:dM,categories:[],animatable:!0,attributes:pM,layoutAttributes:mM,supplyDefaults:Dj,supplyLayoutDefaults:Ej,calc:Rc.calc,crossTraceCalc:Rc.crossTraceCalc,plot:bB,style:bm.style,colorbar:Ts,meta:{description:["Visualize hierarchal data from leaves (and/or outer branches) towards root","with rectangles. The treemap sectors are determined by the entries in","*labels* or *ids* and in *parents*."].join(" ")}},_B=xB;const PB=Ni(_B);export{AB as P,MB as b,kB as c,SB as h,CB as o,LB as p,DB as s,PB as t};
7
- //# sourceMappingURL=plotly-DDnZiLFO.js.map