@deephaven/embed-widget 1.3.0 → 1.3.1-uri.5

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 (36) hide show
  1. package/build/assets/{App-BrxPaURX.js → App-Hfwf8Htt.js} +2 -2
  2. package/build/assets/{App-BrxPaURX.js.map → App-Hfwf8Htt.js.map} +1 -1
  3. package/build/assets/{Chart-j4Yr39-b.js → Chart-BwvUETpO.js} +2 -2
  4. package/build/assets/{Chart-j4Yr39-b.js.map → Chart-BwvUETpO.js.map} +1 -1
  5. package/build/assets/{IrisGrid-DANquK0y.js → IrisGrid-CpB19U7B.js} +2 -2
  6. package/build/assets/{IrisGrid-DANquK0y.js.map → IrisGrid-CpB19U7B.js.map} +1 -1
  7. package/build/assets/{IrisGridThemeProvider-BDlt5W7h.js → IrisGridThemeProvider-D1dldejk.js} +4 -4
  8. package/build/assets/IrisGridThemeProvider-D1dldejk.js.map +1 -0
  9. package/build/assets/{LocalWorkspaceStorage-2j76O2eq.js → LocalWorkspaceStorage-UlI2bW8x.js} +2 -2
  10. package/build/assets/{LocalWorkspaceStorage-2j76O2eq.js.map → LocalWorkspaceStorage-UlI2bW8x.js.map} +1 -1
  11. package/build/assets/{LogPanel-B7r6wvZY.js → LogPanel-OTAgNgRf.js} +3 -3
  12. package/build/assets/{LogPanel-B7r6wvZY.js.map → LogPanel-OTAgNgRf.js.map} +1 -1
  13. package/build/assets/{MarkdownEditor-cnhAYgFk.js → MarkdownEditor-aWicXGam.js} +2 -2
  14. package/build/assets/{MarkdownEditor-cnhAYgFk.js.map → MarkdownEditor-aWicXGam.js.map} +1 -1
  15. package/build/assets/{MarkdownNotebook-B10k_4rP.js → MarkdownNotebook-CtxGp6Xy.js} +2 -2
  16. package/build/assets/{MarkdownNotebook-B10k_4rP.js.map → MarkdownNotebook-CtxGp6Xy.js.map} +1 -1
  17. package/build/assets/Plot-BTki1mPQ.js +2 -0
  18. package/build/assets/{Plot-CrWE09z_.js.map → Plot-BTki1mPQ.js.map} +1 -1
  19. package/build/assets/{Plotly-AbR82OTZ.js → Plotly-D5d4m8Ha.js} +2 -2
  20. package/build/assets/{Plotly-AbR82OTZ.js.map → Plotly-D5d4m8Ha.js.map} +1 -1
  21. package/build/assets/index-BE0xmNNM.js +84 -0
  22. package/build/assets/index-BE0xmNNM.js.map +1 -0
  23. package/build/assets/{index-B9fwxerk.js → index-BQIR2xJa.js} +12 -12
  24. package/build/assets/index-BQIR2xJa.js.map +1 -0
  25. package/build/assets/{index-DYbHVMTz.js → index-qAF3pUVj.js} +3 -3
  26. package/build/assets/{index-DYbHVMTz.js.map → index-qAF3pUVj.js.map} +1 -1
  27. package/build/assets/plotly-DDnZiLFO.js +7 -0
  28. package/build/assets/{plotly-DPMKRrOg.js.map → plotly-DDnZiLFO.js.map} +1 -1
  29. package/build/index.html +1 -1
  30. package/package.json +17 -17
  31. package/build/assets/IrisGridThemeProvider-BDlt5W7h.js.map +0 -1
  32. package/build/assets/Plot-CrWE09z_.js +0 -2
  33. package/build/assets/index-B9fwxerk.js.map +0 -1
  34. package/build/assets/index-Bzq1CdEj.js +0 -84
  35. package/build/assets/index-Bzq1CdEj.js.map +0 -1
  36. package/build/assets/plotly-DPMKRrOg.js +0 -7
@@ -1,7 +0,0 @@
1
- import{g as Si,c as KM}from"./helpers-BosuxZz1.js";import{r as QM,p as JM,a as o_,f as ht,t as oa,d as ut,g as l_,b as Bl,i as eS,c as s_,e as Nh,h as f_,m as tS,j as c_,k as u_,l as rS,n as aS,o as iS,q as v_,s as nS,u as oS,v as lS,w as sS,x as fS,y as cS,z as uS,A as Hh,B as d_}from"./vendor-Bp3qklGK.js";var h_={};(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(QM),a=i(JM);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}})(h_);const m9=Si(h_);var p_={},Oc={};Oc.version="3.1.0-rc.0";var m_={exports:{}},Wt={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:"−"},Vt={},Tn=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")},vS=o_.decode,dS=Tn,Oh=Array.isArray,hS=ArrayBuffer,pS=DataView;function y_(t){return hS.isView(t)&&!(t instanceof pS)}Vt.isTypedArray=y_;function ac(t){return Oh(t)||y_(t)}Vt.isArrayOrTypedArray=ac;function mS(t){return!ac(t[0])}Vt.isArray1D=mS;Vt.ensureArray=function(t,e){return Oh(t)||(t=[]),t.length=e,t};var sr={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};sr.uint8c=sr.u1c;sr.uint8=sr.u1;sr.int8=sr.i1;sr.uint16=sr.u2;sr.int16=sr.i2;sr.uint32=sr.u4;sr.int32=sr.i4;sr.float32=sr.f4;sr.float64=sr.f8;function jh(t){return t.constructor===ArrayBuffer}Vt.isArrayBuffer=jh;Vt.decodeTypedArraySpec=function(t){var e=[],r=yS(t),a=r.dtype,i=sr[a];if(!i)throw new Error('Error in dtype: "'+a+'"');var n=i.BYTES_PER_ELEMENT,o=r.bdata;jh(o)||(o=vS(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};Vt.isTypedArraySpec=function(t){return dS(t)&&t.hasOwnProperty("dtype")&&typeof t.dtype=="string"&&t.hasOwnProperty("bdata")&&(typeof t.bdata=="string"||jh(t.bdata))&&(t.shape===void 0||t.hasOwnProperty("shape")&&(typeof t.shape=="string"||typeof t.shape=="number"))};function yS(t){return{bdata:t.bdata,dtype:t.dtype,shape:t.shape}}Vt.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),Oh(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};Vt.maxRowLength=function(t){return g_(t,Math.max,0)};Vt.minRowLength=function(t){return g_(t,Math.min,1/0)};function g_(t,e,r){if(ac(t))if(ac(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 b_=ht,Bh=Vt.isArrayOrTypedArray,Gh=function(e,r){if(b_(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"?_S(e,r,a):{set:__(e,a,r),get:x_(e,a),astr:r,parts:a,obj:e}};function x_(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]=x_(a[s],e.slice(l+1))(r),o[s]!==o[0]&&(n=!1);return n?o[0]:o}if(typeof i=="number"&&!Bh(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 gS=/(^|\.)args\[/;function Rd(t,e){return t===void 0||t===null&&!e.match(gS)}function __(t,e,r){return function(a){var i=t,n="",o=Rd(a,r),l,s;for(s=0;s<e.length-1;s++){if(l=e[s],typeof l=="number"&&!Bh(i))throw"array index but container is not an array";if(l===-1){if(o=!xS(i,e.slice(s+1),a,r),o)break;return}if(!w_(i,l,e[s+1],o))break;if(i=i[l],typeof i!="object"||i===null)throw"container is not an object";n=bS(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 bS(t,e){var r=e;return b_(e)?r="["+e+"]":t&&(r="."+e),t+r}function xS(t,e,r,a){var i=Bh(r),n=!0,o=r,l=a.replace("-1",0),s=i?!1:Rd(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=Rd(o,l)),s&&(n=!1),w_(t,c,f,s)&&__(t[c],e,a.replace("-1",c))(o);return n}function w_(t,e,r,a){if(t[e]===void 0){if(a)return!1;typeof r=="number"?t[e]=[]:t[e]={}}return!0}function _S(t,e,r){return{set:function(){throw"bad container"},get:function(){},astr:e,parts:r,obj:t}}var Rn=Gh,wS=/^\w*$/,TS=0,Dm=1,Cs=2,$m=3,ji=4,kS=function(e,r,a,i){a=a||"name",i=i||"value";var n,o,l,s={};r&&r.length?(l=Rn(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=wS.test(i),u={set:function(v,p){var d=p===null?ji:TS;if(!o){if(!l||d===ji)return;o=[],l.set(o)}var h=f[v];if(h===void 0){if(d===ji)return;d=d|$m,h=o.length,f[v]=h}else p!==(c?o[h][i]:Rn(o[h],i).get())&&(d=d|Cs);var m=o[h]=o[h]||{};return m[a]=v,c?m[i]=p:Rn(m,i).set(p),p!==null&&(d=d&~ji),s[h]=s[h]|d,u},get:function(v){if(o){var p=f[v];if(p!==void 0)return c?o[p][i]:Rn(o[p],i).get()}},rename:function(v,p){var d=f[v];return d===void 0||(s[d]=s[d]|Dm,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]|Cs,u.set(v,null);if(c){for(n=p;n<o.length;n++)s[n]=s[n]|$m;for(n=p;n<o.length;n++)f[o[n][a]]--;o.splice(p,1),delete f[v]}else Rn(d,i).set(null),s[p]=s[p]|Cs|ji;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]&Dm&&(d[v+"."+a]=o[p][a]),s[p]&Cs&&(c?d[v+"."+i]=s[p]&ji?null:o[p][i]:d[v+"."+i]=s[p]&ji?null:Rn(o[p],i).get())):d[v]=null;return d}};return u},AS=/^(.*)(\.[^\.\[\]]+|\[\d\])$/,MS=/^[^\.\[\]]+$/,SS=function(t,e){for(;e;){var r=t.match(AS);if(r)t=r[1];else if(t.match(MS))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},LS=ht,Uh=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 LS(a)||(a=Math.log(Math.max(r[0],r[1]))/Math.LN10-6),a},Pm=Vt.isArrayOrTypedArray,el=Tn,CS=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(Pm(i)&&Pm(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 DS(t,e){var r=t%e;return r<0?r+e:r}function $S(t,e){return Math.abs(t)>e/2?t-Math.round(t/e)*e:t}var cs={mod:DS,modHalf:$S},T_={},Et={},Em=Tn,tl=Array.isArray;function PS(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}Et.extendFlat=function(){return us(arguments,!1,!1,!1)};Et.extendDeep=function(){return us(arguments,!0,!1,!1)};Et.extendDeepAll=function(){return us(arguments,!0,!0,!1)};Et.extendDeepNoArrays=function(){return us(arguments,!0,!1,!0)};function us(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=PS(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&&(Em(f)||(c=tl(f)))?(c?(c=!1,u=s&&tl(s)?s:[]):u=s&&Em(s)?s:{},i[l]=us([u,f],e,r,a)):(typeof f<"u"||r)&&(i[l]=f)}return i}var fr=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},jc={YANGLE:60,HOVERARROWSIZE:6,HOVERTEXTPAD:3,HOVERFONTSIZE:13,HOVERFONT:"Arial, sans-serif",HOVERMINTIME:50,HOVERID:"-hover"},k_=jc,A_=fr,Vh=A_({editType:"none",description:"Sets the default hover label font used by all traces on the graph."});Vh.family.dflt=k_.HOVERFONT;Vh.size.dflt=k_.HOVERFONTSIZE;var vs={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:Vh,grouptitlefont:A_({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"}},ES=fr,Ds=vs.hoverlabel,$s=Et.extendFlat,Bc={hoverlabel:{bgcolor:$s({},Ds.bgcolor,{arrayOk:!0,description:"Sets the background color of the hover labels for this trace"}),bordercolor:$s({},Ds.bordercolor,{arrayOk:!0,description:"Sets the border color of the hover labels for this trace."}),font:ES({arrayOk:!0,editType:"none",description:"Sets the font used in hover labels."}),align:$s({},Ds.align,{arrayOk:!0}),namelength:$s({},Ds.namelength,{arrayOk:!0}),editType:"none"}},zS=fr,RS=Bc,la={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:zS({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:RS.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(" ")}},IS=oa,Gc={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)"]]},M_=Gc.RdBu;function FS(t,e){if(e||(e=M_),!t)return e;function r(){try{t=Gc[t]||JSON.parse(t)}catch{t=e}}return typeof t=="string"&&(r(),typeof t=="string"&&r()),S_(t)?t:e}function S_(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||!IS(a[1]).isValid())return!1;e=+a[0]}return!0}function NS(t){return Gc[t]!==void 0?!0:S_(t)}var No={scales:Gc,defaultScale:M_,get:FS,isValid:NS},L_={exports:{}},Tr={};Tr.defaults=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"];Tr.defaultLine="#444";Tr.lightLine="#eee";Tr.background="#fff";Tr.borderLine="#BEC8D9";Tr.lightFraction=100*10/11;var Ir=oa,HS=ht,OS=Vt.isTypedArray,ir=L_.exports={},Uc=Tr;ir.defaults=Uc.defaults;var jS=ir.defaultLine=Uc.defaultLine;ir.lightLine=Uc.lightLine;var Id=ir.background=Uc.background;ir.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"};ir.rgb=function(t){return ir.tinyRGB(Ir(t))};ir.opacity=function(t){return t?Ir(t).getAlpha():0};ir.addOpacity=function(t,e){var r=Ir(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"};ir.combine=function(t,e){var r=Ir(t).toRgb();if(r.a===1)return Ir(t).toRgbString();var a=Ir(e||Id).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 Ir(n).toRgbString()};ir.interpolate=function(t,e,r){var a=Ir(t).toRgb(),i=Ir(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 Ir(n).toRgbString()};ir.contrast=function(t,e,r){var a=Ir(t);a.getAlpha()!==1&&(a=Ir(ir.combine(t,Id)));var i=a.isDark()?e?a.lighten(e):Id:r?a.darken(r):jS;return i.toString()};ir.stroke=function(t,e){var r=Ir(e);t.style({stroke:ir.tinyRGB(r),"stroke-opacity":r.getAlpha()})};ir.fill=function(t,e){var r=Ir(e);t.style({fill:ir.tinyRGB(r),"fill-opacity":r.getAlpha()})};ir.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]=zu(n[a]);else t[i]=zu(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]=zu(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++)ir.clean(n[a])}else n&&typeof n=="object"&&!OS(n)&&ir.clean(n)}};function zu(t){if(HS(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 ct=L_.exports,ds={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2},Ho={};Ho.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=ht,r=oa,a=Et.extendFlat,i=la,n=No,o=ct,l=ds.DESELECTDIM,s=Gh,f=Ho.counter,c=cs.modHalf,u=Vt.isArrayOrTypedArray,v=Vt.isTypedArraySpec,p=Vt.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(I){C=I}};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})(T_);var C_={},D_={exports:{}},$_={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(" ")}},P_={};function E_(t,e){for(var r in t){var a=t[r];a.valType?e[r]=a.dflt:(e[r]||(e[r]={}),E_(a,e[r]))}}E_($_,P_);var Oo={configAttributes:$_,dfltConfig:P_},Ru=ut,BS=ht,rl=[],z_=function(t,e){if(rl.indexOf(t)!==-1)return;rl.push(t);var r=1e3;BS(e)?r=e:e==="long"&&(r=3e3);var a=Ru.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),Ru.select(this).remove()})}i.enter().append("div").classed("notifier-note",!0).style("opacity",0).each(function(o){var l=Ru.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)})},Ao=Oo.dfltConfig,Wh=z_,Xh=D_.exports={};Xh.log=function(){var t;if(Ao.logging>1){var e=["LOG:"];for(t=0;t<arguments.length;t++)e.push(arguments[t]);console.trace.apply(console,e)}if(Ao.notifyOnLogging>1){var r=[];for(t=0;t<arguments.length;t++)r.push(arguments[t]);Wh(r.join("<br>"),"long")}};Xh.warn=function(){var t;if(Ao.logging>0){var e=["WARN:"];for(t=0;t<arguments.length;t++)e.push(arguments[t]);console.trace.apply(console,e)}if(Ao.notifyOnLogging>0){var r=[];for(t=0;t<arguments.length;t++)r.push(arguments[t]);Wh(r.join("<br>"),"stick")}};Xh.error=function(){var t;if(Ao.logging>0){var e=["ERROR:"];for(t=0;t<arguments.length;t++)e.push(arguments[t]);console.error.apply(console,e)}if(Ao.notifyOnLogging>0){var r=[];for(t=0;t<arguments.length;t++)r.push(arguments[t]);Wh(r.join("<br>"),"stick")}};var jo=D_.exports,Je={},Yh=function(){},R_=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},Vc={};(function(t){var e=l_;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]]]}})(Vc);var GS=ut,zm=jo,US=Vc,VS=l_;function WS(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 XS(t){var e=GS.select(t);return e.node()instanceof HTMLElement&&e.size()&&e.classed("js-plotly-plot")}function I_(t){var e=t&&t.parentNode;e&&e.removeChild(t)}function YS(t,e){F_("global",t,e)}function F_(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):zm.warn("addStyleRule failed"):zm.warn("Cannot addRelatedStyleRule, probably due to strict CSP...")}}function qS(t){var e="plotly.js-style-"+t,r=document.getElementById(e);r&&I_(r)}function ZS(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 KS(t){var e=H_(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=N_(a);if(i){var n=US.convertCssMatrix(i);r=VS.multiply(r,r,n)}}),r}function N_(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 H_(t){for(var e=[];QS(t);)e.push(t),t=t.parentNode,typeof ShadowRoot=="function"&&t instanceof ShadowRoot&&(t=t.host);return e}function QS(t){return t&&(t instanceof Element||t instanceof HTMLElement)}function JS(t,e){return t&&e&&t.top===e.top&&t.left===e.left&&t.right===e.right&&t.bottom===e.bottom}var Wc={getGraphDiv:WS,isPlotDiv:XS,removeElement:I_,addStyleRule:YS,addRelatedStyleRule:F_,deleteRelatedStyleRule:qS,setStyleOnHover:ZS,getFullTransformMatrix:KS,getElementTransformMatrix:N_,getElementAndAncestors:H_,equalDomRects:JS},Xc={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(" ")}}},O_=Et.extendFlat,eL=Tn,j_={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(" ")},B_={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(" ")},tL=j_.flags.slice().concat(["fullReplot"]),rL=B_.flags.slice().concat("layoutReplot"),Na={traces:j_,layout:B_,traceFlags:function(){return Rm(tL)},layoutFlags:function(){return Rm(rL)},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:G_};function Rm(t){for(var e={},r=0;r<t.length;r++)e[t[r]]=!1;return e}function G_(t,e,r){var a=O_({},t);for(var i in a){var n=a[i];eL(n)&&(a[i]=U_(n,e,r,i))}return r==="from-root"&&(a.editType=e),a}function U_(t,e,r,a){if(t.valType){var i=O_({},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]=U_(t.items[n],e)}return i}else return G_(t,e,a.charAt(0)==="_"?"nested":"from-root")}var Fr={};Fr.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(" ")};Fr.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 yr={},V_={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"},W_=V_,X_=W_.FORMAT_LINK,Y_=W_.DATE_FORMAT_LINK;function q_(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}".`,X_,"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}".`,Y_,"for details on the date formatting syntax."].join(" ")}function aL(){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`,X_,"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`,Y_,"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 qh(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}yr.hovertemplateAttrs=function(t,e){t=t||{},e=e||{};var r=qh(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`.",q_({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};yr.texttemplateAttrs=function(t,e){t=t||{},e=e||{};var r=qh(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`.",q_(),"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};yr.shapeTexttemplateAttrs=function(t,e){t=t||{},e=e||{};var r=t.newshape?"new ":"",a=qh(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`.",aL(),a].join(" ")};return i};function ki(t,e){return e?e.d2l(t):t}function Z_(t,e){return e?e.l2d(t):t}function iL(t){return t.x0}function nL(t){return t.x1}function oL(t){return t.y0}function lL(t){return t.y1}function K_(t){return t.x0shift||0}function Q_(t){return t.x1shift||0}function J_(t){return t.y0shift||0}function ew(t){return t.y1shift||0}function Yc(t,e){return ki(t.x1,e)+Q_(t)-ki(t.x0,e)-K_(t)}function qc(t,e,r){return ki(t.y1,r)+ew(t)-ki(t.y0,r)-J_(t)}function sL(t,e){return Math.abs(Yc(t,e))}function fL(t,e,r){return Math.abs(qc(t,e,r))}function cL(t,e,r){return t.type!=="line"?void 0:Math.sqrt(Math.pow(Yc(t,e),2)+Math.pow(qc(t,e,r),2))}function uL(t,e){return Z_((ki(t.x1,e)+Q_(t)+ki(t.x0,e)+K_(t))/2,e)}function vL(t,e,r){return Z_((ki(t.y1,r)+ew(t)+ki(t.y0,r)+J_(t))/2,r)}function dL(t,e,r){return t.type!=="line"?void 0:qc(t,e,r)/Yc(t,e)}var Zh={x0:iL,x1:nL,y0:oL,y1:lL,slope:dL,dx:Yc,dy:qc,width:sL,height:fL,length:cL,xcenter:uL,ycenter:vL},hL=Na.overrideAll,Bi=la,Im=fr,pL=Fr.dash,li=Et.extendFlat,mL=yr.shapeTexttemplateAttrs,yL=Zh,gL=hL({newshape:{visible:li({},Bi.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:li({},Bi.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:li({},Bi.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:li({},Bi.legendgrouptitle.text,{}),font:Im({description:["Sets this legend group's title font."].join(" ")})},legendrank:li({},Bi.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:li({},Bi.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:li({},pL,{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:li({},Bi.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:mL({newshape:!0},{keys:Object.keys(yL)}),font:Im({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"),bL=Fr.dash,xL=Et.extendFlat,_L={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:xL({},bL,{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"}},Kh=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}},Fd=fr,wL=Xc,Rf=Tr,Fm=gL,Nm=_L,TL=Kh,Hm=Et.extendFlat,Zc=Fd({editType:"calc",description:["Sets the global font.","Note that fonts used in traces and other","layout components inherit from the global font."].join(" ")});Zc.family.dflt='"Open Sans", verdana, arial, sans-serif';Zc.size.dflt=12;Zc.color.dflt=Rf.defaultLine;var hs={font:Zc,title:{text:{valType:"string",editType:"layoutstyle",description:"Sets the plot's title."},font:Fd({editType:"layoutstyle",description:"Sets the title font."}),subtitle:{text:{valType:"string",editType:"layoutstyle",description:"Sets the plot's subtitle."},font:Fd({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:Hm(TL({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:Rf.background,editType:"plot",description:"Sets the background color of the paper where the graph is drawn."},plot_bgcolor:{valType:"color",dflt:Rf.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:Rf.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:Fm.newshape,activeshape:Fm.activeshape,newselection:Nm.newselection,activeselection:Nm.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:Hm({},wL.transition,{description:["Sets transition options used during Plotly.react updates."].join(" "),editType:"none"})};(function(t){var e=jo,r=Yh,a=R_,i=Tn,n=Wc.addStyleRule,o=Et,l=la,s=hs,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}})(Je);(function(t){var e=Bl.timeFormat,r=ht,a=jo,i=cs.mod,n=Wt,o=n.BADNUM,l=n.ONEDAY,s=n.ONEHOUR,f=n.ONEMIN,c=n.ONESEC,u=n.EPOCHJD,v=Je,p=Bl.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 I=y(P),j=D.charAt(0);I&&(j==="G"||j==="g")&&(D=D.substr(1),P="");var G=I&&P.substr(0,7)==="chinese",X=D.match(G?h:d);if(!X)return o;var O=X[1],q=X[3]||"1",W=Number(X[5]||1),Y=Number(X[7]||0),B=Number(X[9]||0),Q=Number(X[11]||0);if(I){if(O.length===2)return o;O=Number(O);var ee;try{var fe=v.getComponentMethod("calendars","getCal")(P);if(G){var oe=q.charAt(q.length-1)==="i";q=parseInt(q,10),ee=fe.newDate(O,fe.toMonthIndex(O,q,oe),W)}else ee=fe.newDate(O,Number(q),W)}catch{return o}return ee?(ee.toJD()-u)*l+Y*s+B*f+Q*c:o}O.length===2?O=(Number(O)+2e3-m)%100+m:O=Number(O),q-=1;var se=new Date(Date.UTC(2e3,q,W,Y,B));return se.setUTCFullYear(O),se.getUTCMonth()!==q||se.getUTCDate()!==W?o:se.getTime()+Q*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),I,j,G,X,O,q;if(y(k)){var W=Math.floor($/l)+u,Y=Math.floor(i(D,l));try{I=v.getComponentMethod("calendars","getCal")(k).fromJD(W).formatDate("yyyy-mm-dd")}catch{I=p("G%Y-%m-%d")(new Date($))}if(I.charAt(0)==="-")for(;I.length<11;)I="-0"+I.substr(1);else for(;I.length<10;)I="0"+I;j=P<w?Math.floor(Y/s):0,G=P<w?Math.floor(Y%s/f):0,X=P<T?Math.floor(Y%f/c):0,O=P<A?Y%c*10+C:0}else q=new Date($),I=p("%Y-%m-%d")(q),j=P<w?q.getUTCHours():0,G=P<w?q.getUTCMinutes():0,X=P<T?q.getUTCSeconds():0,O=P<A?q.getUTCMilliseconds()*10+C:0;return M(I,j,G,X,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(),I=k.getMinutes(),j=k.getSeconds(),G=k.getUTCMilliseconds()*10+P;return M(C,$,I,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 I=4;$%10===0;)I-=1,$/=10;D+="."+x($,I)}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(I){var j=Math.min(+I.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]),I=(100+$).toFixed(P).substr(1);P>0&&(I=I.replace(/0+$/,"").replace(/[\.]$/,"")),C+=":"+I}return C}t.formatDate=function(D,P,k,C,$,I){if($=y($)&&$,!P)if(k==="y")P=I.year;else if(k==="m")P=I.month;else if(k==="d")P=I.dayMonth+`
2
- `+I.year;else return z(D,k)+`
3
- `+F(I.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,I=v.getComponentMethod("calendars","getCal")(k),j=I.fromJD($);return P%12?I.add(j,P,"m"):I.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,I=0,j,G,X=y(P)&&v.getComponentMethod("calendars","getCal")(P),O=0;O<D.length;O++){if(G=D[O],!r(G)){I++;continue}if(!(G%l))if(X)try{j=X.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 q=D.length-I;return{exactYears:k/q,exactMonths:C/q,exactDays:$/q}}})(C_);var Qh={},tw=function(e){return e};(function(t){var e=ht,r=jo,a=tw,i=Wt.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}})(Qh);var Jh=function(e){return Object.keys(e).sort()},rw={};(function(t){var e=ht,r=Vt.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)]}})(rw);var aw=cs,Iu=aw.mod,kL=aw.modHalf,Gl=Math.PI,gi=2*Gl;function AL(t){return t/180*Gl}function ML(t){return t/Gl*180}function ep(t){return Math.abs(t[1]-t[0])>gi-1e-14}function iw(t,e){return kL(e-t,gi)}function SL(t,e){return Math.abs(iw(t,e))}function nw(t,e){if(ep(e))return!0;var r,a;e[0]<e[1]?(r=e[0],a=e[1]):(r=e[1],a=e[0]),r=Iu(r,gi),a=Iu(a,gi),r>a&&(a+=gi);var i=Iu(t,gi),n=i+gi;return i>=r&&i<=a||n>=r&&n<=a}function LL(t,e,r,a){if(!nw(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 tp(t,e,r,a,i,n,o){i=i||0,n=n||0;var l=ep([r,a]),s,f,c,u,v;l?(s=0,f=Gl,c=gi):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)<=Gl?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 CL(t,e,r,a,i){return tp(null,t,e,r,a,i,0)}function DL(t,e,r,a,i){return tp(null,t,e,r,a,i,1)}function $L(t,e,r,a,i,n){return tp(t,e,r,a,i,n,1)}var PL={deg2rad:AL,rad2deg:ML,angleDelta:iw,angleDist:SL,isFullCircle:ep,isAngleInsideSector:nw,isPtInsideSector:LL,pathArc:CL,pathSector:DL,pathAnnulus:$L},kn={};kn.isLeftAnchor=function(e){return e.xanchor==="left"||e.xanchor==="auto"&&e.x<=1/3};kn.isCenterAnchor=function(e){return e.xanchor==="center"||e.xanchor==="auto"&&e.x>1/3&&e.x<2/3};kn.isRightAnchor=function(e){return e.xanchor==="right"||e.xanchor==="auto"&&e.x>=2/3};kn.isTopAnchor=function(e){return e.yanchor==="top"||e.yanchor==="auto"&&e.y>=2/3};kn.isMiddleAnchor=function(e){return e.yanchor==="middle"||e.yanchor==="auto"&&e.y>1/3&&e.y<2/3};kn.isBottomAnchor=function(e){return e.yanchor==="bottom"||e.yanchor==="auto"&&e.y<=1/3};var An={},Fu=cs.mod;An.segmentsIntersect=ow;function ow(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}}An.segmentDistance=function(e,r,a,i,n,o,l,s){if(ow(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 Es,Nd,Om;An.getTextLocation=function(e,r,a,i){if((e!==Nd||i!==Om)&&(Es={},Nd=e,Om=i),Es[a])return Es[a];var n=e.getPointAtLength(Fu(a-i/2,r)),o=e.getPointAtLength(Fu(a+i/2,r)),l=Math.atan((o.y-n.y)/(o.x-n.x)),s=e.getPointAtLength(Fu(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 Es[a]=u,u};An.clearLocationCache=function(){Nd=null};An.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}};An.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 Kc={};(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)}})(Kc);var EL=function(e){e._responsiveChartHandler&&(window.removeEventListener("resize",e._responsiveChartHandler),delete e._responsiveChartHandler)},zL=ht,RL=eS,IL=function(e){var r;if(e&&e.hasOwnProperty("userAgent")?r=e.userAgent:r=FL(),typeof r!="string")return!0;var a=RL({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(zL(f)&&(f=+f),f>=13)return!0}}}return a};function FL(){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 NL=ut,HL=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]=NL.select(this)}),i},OL=Je,jL=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=OL.localeRegistry}var f=a.split("-")[0];if(f===a)break;a=f}return r},BL=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},GL=function(e){for(var r=WL(e)?VL:UL,a=[],i=0;i<e.length;i++){var n=e[i];r(n)&&a.push(n)}return a};function UL(t){return t.visible===!0}function VL(t){var e=t[0].trace;return e.visible===!0&&e._length!==0}function WL(t){return Array.isArray(t)&&Array.isArray(t[0])&&t[0][0]&&t[0][0].trace}var XL=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},YL=ht,qL=Wt.BADNUM,ZL=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g,KL=function(e){return typeof e=="string"&&(e=e.replace(ZL,"")),YL(e)?Number(e):qL},Ll=ut,QL=Bl.utcFormat,JL=s_.format,lw=ht,sw=Wt,fw=sw.FP_SAFE,eC=-fw,jm=sw.BADNUM,te=m_.exports={};te.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 Bm={};te.warnBadFormat=function(t){var e=String(t);Bm[e]||(Bm[e]=1,te.warn('encountered bad format: "'+e+'"'))};te.noFormat=function(t){return String(t)};te.numberFormat=function(t){var e;try{e=JL(te.adjustFormat(t))}catch{return te.warnBadFormat(t),te.noFormat}return e};te.nestedProperty=Gh;te.keyedContainer=kS;te.relativeAttr=SS;te.isPlainObject=Tn;te.toLogRange=Uh;te.relinkPrivateKeys=CS;var Li=Vt;te.isArrayBuffer=Li.isArrayBuffer;te.isTypedArray=Li.isTypedArray;te.isArrayOrTypedArray=Li.isArrayOrTypedArray;te.isArray1D=Li.isArray1D;te.ensureArray=Li.ensureArray;te.concat=Li.concat;te.maxRowLength=Li.maxRowLength;te.minRowLength=Li.minRowLength;var cw=cs;te.mod=cw.mod;te.modHalf=cw.modHalf;var Ci=T_;te.valObjectMeta=Ci.valObjectMeta;te.coerce=Ci.coerce;te.coerce2=Ci.coerce2;te.coerceFont=Ci.coerceFont;te.coercePattern=Ci.coercePattern;te.coerceHoverinfo=Ci.coerceHoverinfo;te.coerceSelectionMarkerOpacity=Ci.coerceSelectionMarkerOpacity;te.validate=Ci.validate;var Wr=C_;te.dateTime2ms=Wr.dateTime2ms;te.isDateTime=Wr.isDateTime;te.ms2DateTime=Wr.ms2DateTime;te.ms2DateTimeLocal=Wr.ms2DateTimeLocal;te.cleanDate=Wr.cleanDate;te.isJSDate=Wr.isJSDate;te.formatDate=Wr.formatDate;te.incrementMonth=Wr.incrementMonth;te.dateTick0=Wr.dateTick0;te.dfltRange=Wr.dfltRange;te.findExactDates=Wr.findExactDates;te.MIN_MS=Wr.MIN_MS;te.MAX_MS=Wr.MAX_MS;var Mn=Qh;te.findBin=Mn.findBin;te.sorterAsc=Mn.sorterAsc;te.sorterDes=Mn.sorterDes;te.distinctVals=Mn.distinctVals;te.roundUp=Mn.roundUp;te.sort=Mn.sort;te.findIndexOfMin=Mn.findIndexOfMin;te.sortObjectKeys=Jh;var ei=rw;te.aggNums=ei.aggNums;te.len=ei.len;te.mean=ei.mean;te.geometricMean=ei.geometricMean;te.median=ei.median;te.midRange=ei.midRange;te.variance=ei.variance;te.stdev=ei.stdev;te.interp=ei.interp;var ka=Vc;te.init2dArray=ka.init2dArray;te.transposeRagged=ka.transposeRagged;te.dot=ka.dot;te.translationMatrix=ka.translationMatrix;te.rotationMatrix=ka.rotationMatrix;te.rotationXYMatrix=ka.rotationXYMatrix;te.apply3DTransform=ka.apply3DTransform;te.apply2DTransform=ka.apply2DTransform;te.apply2DTransform2=ka.apply2DTransform2;te.convertCssMatrix=ka.convertCssMatrix;te.inverseTransformMatrix=ka.inverseTransformMatrix;var Ha=PL;te.deg2rad=Ha.deg2rad;te.rad2deg=Ha.rad2deg;te.angleDelta=Ha.angleDelta;te.angleDist=Ha.angleDist;te.isFullCircle=Ha.isFullCircle;te.isAngleInsideSector=Ha.isAngleInsideSector;te.isPtInsideSector=Ha.isPtInsideSector;te.pathArc=Ha.pathArc;te.pathSector=Ha.pathSector;te.pathAnnulus=Ha.pathAnnulus;var Bo=kn;te.isLeftAnchor=Bo.isLeftAnchor;te.isCenterAnchor=Bo.isCenterAnchor;te.isRightAnchor=Bo.isRightAnchor;te.isTopAnchor=Bo.isTopAnchor;te.isMiddleAnchor=Bo.isMiddleAnchor;te.isBottomAnchor=Bo.isBottomAnchor;var Go=An;te.segmentsIntersect=Go.segmentsIntersect;te.segmentDistance=Go.segmentDistance;te.getTextLocation=Go.getTextLocation;te.clearLocationCache=Go.clearLocationCache;te.getVisibleSegment=Go.getVisibleSegment;te.findPointOnPath=Go.findPointOnPath;var Qc=Et;te.extendFlat=Qc.extendFlat;te.extendDeep=Qc.extendDeep;te.extendDeepAll=Qc.extendDeepAll;te.extendDeepNoArrays=Qc.extendDeepNoArrays;var rp=jo;te.log=rp.log;te.warn=rp.warn;te.error=rp.error;var tC=Ho;te.counterRegex=tC.counter;var ap=Kc;te.throttle=ap.throttle;te.throttleDone=ap.done;te.clearThrottle=ap.clear;var Aa=Wc;te.getGraphDiv=Aa.getGraphDiv;te.isPlotDiv=Aa.isPlotDiv;te.removeElement=Aa.removeElement;te.addStyleRule=Aa.addStyleRule;te.addRelatedStyleRule=Aa.addRelatedStyleRule;te.deleteRelatedStyleRule=Aa.deleteRelatedStyleRule;te.setStyleOnHover=Aa.setStyleOnHover;te.getFullTransformMatrix=Aa.getFullTransformMatrix;te.getElementTransformMatrix=Aa.getElementTransformMatrix;te.getElementAndAncestors=Aa.getElementAndAncestors;te.equalDomRects=Aa.equalDomRects;te.clearResponsive=EL;te.preserveDrawingBuffer=IL;te.makeTraceGroups=HL;te._=jL;te.notifier=z_;te.filterUnique=BL;te.filterVisible=GL;te.pushUnique=R_;te.increment=XL;te.cleanNumber=KL;te.ensureNumber=function(e){return lw(e)?(e=Number(e),e>fw||e<eC?jm:e):jm};te.isIndex=function(t,e){return e!==void 0&&t>=e?!1:lw(t)&&t>=0&&t%1===0};te.noop=Yh;te.identity=tw;te.repeat=function(t,e){for(var r=new Array(e),a=0;a<e;a++)r[a]=t;return r};te.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=te.nestedProperty(t,n.replace("?",r)),l=te.nestedProperty(t,n.replace("?",a)),s=o.get();o.set(l.get()),l.set(s)}};te.raiseToTop=function(e){e.parentNode.appendChild(e)};te.cancelTransition=function(t){return t.transition().duration(0)};te.constrain=function(t,e,r){return e>r?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))};te.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};te.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};te.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?(te.warn("randstr failed uniqueness"),o):t(e,r,a,(i||0)+1):o};te.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};te.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};te.syncOrAsync=function(t,e,r){var a,i;function n(){return te.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)};te.stripTrailingSlash=function(t){return t.substr(-1)==="/"?t.substr(0,t.length-1):t};te.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]]}};te.mergeArray=function(t,e,r,a){var i=typeof a=="function";if(te.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}};te.mergeArrayCastPositive=function(t,e,r){return te.mergeArray(t,e,r,function(a){var i=+a;return isFinite(i)&&i>0?i:0})};te.fillArray=function(t,e,r,a){if(a=a||te.identity,te.isArrayOrTypedArray(t))for(var i=0;i<e.length;i++)e[i][r]=a(t[i])};te.castOption=function(t,e,r,a){a=a||te.identity;var i=te.nestedProperty(t,r).get();return te.isArrayOrTypedArray(i)?Array.isArray(e)&&te.isArrayOrTypedArray(i[e[0]])?a(i[e[0]][e[1]]):a(i[e]):i};te.extractOption=function(t,e,r,a){if(r in t)return t[r];var i=te.nestedProperty(e,a).get();if(!Array.isArray(i))return i};function uw(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}te.tagSelected=function(t,e,r){var a=e.selectedpoints,i=e._indexToPoints,n;i&&(n=uw(i));function o(u){return u!==void 0&&u<t.length}for(var l=0;l<a.length;l++){var s=a[l];if(te.isIndex(s)||te.isArrayOrTypedArray(s)&&te.isIndex(s[0])&&te.isIndex(s[1])){var f=n?n[s]:s,c=r?r[f]:f;o(c)&&(t[c].selected=1)}}};te.selIndices2selPoints=function(t){var e=t.selectedpoints,r=t._indexToPoints;if(r){for(var a=uw(r),i=[],n=0;n<e.length;n++){var o=e[n];if(te.isIndex(o)){var l=a[o];te.isIndex(l)&&i.push(l)}}return i}else return e};te.getTargetArray=function(t,e){var r=e.target;if(typeof r=="string"&&r){var a=te.nestedProperty(t,r).get();return te.isArrayOrTypedArray(a)?a:!1}else if(te.isArrayOrTypedArray(r))return r;return!1};function vw(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):te.isTypedArray(s)?i===-1?a[l]=s.subarray():a[l]=s.subarray(0,i):s&&typeof s=="object"?a[l]=vw(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}te.minExtend=vw;te.titleCase=function(t){return t.charAt(0).toUpperCase()+t.substr(1)};te.containsAny=function(t,e){for(var r=0;r<e.length;r++)if(t.indexOf(e[r])!==-1)return!0;return!1};var rC=/Version\/[\d\.]+.*Safari/;te.isSafari=function(){return rC.test(window.navigator.userAgent)};var aC=/iPad|iPhone|iPod/;te.isIOS=function(){return aC.test(window.navigator.userAgent)};var iC=/Firefox\/(\d+)\.\d+/;te.getFirefoxVersion=function(){var t=iC.exec(window.navigator.userAgent);if(t&&t.length===2){var e=parseInt(t[1]);if(!isNaN(e))return e}return null};te.isD3Selection=function(t){return t instanceof Ll.selection};te.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};te.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};te.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 nC=/^([^\[\.]+)\.(.+)?/,oC=/^([^\.]+)\[([0-9]+)\](\.)?(.+)?/;function zs(t){return t.slice(0,2)==="__"}te.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(nC)){if(i=t[r],a=e[1],zs(a))continue;delete t[r],t[a]=te.extendDeepNoArrays(t[a]||{},te.objectFromPath(r,te.expandObjectPaths(i))[a])}else if(e=r.match(oC)){if(i=t[r],a=e[1],zs(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]||{},te.extendDeepNoArrays(o,te.objectFromPath(l,te.expandObjectPaths(i)));else{if(zs(a))continue;t[a][n]=te.expandObjectPaths(i)}}else{if(zs(r))continue;t[r]=te.expandObjectPaths(t[r])}}return t};te.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};te.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var dw=/^\w*$/;te.templateString=function(t,e){var r={};return t.replace(te.TEMPLATE_STRING_REGEX,function(a,i){var n;return dw.test(i)?n=e[i]:(r[i]=r[i]||te.nestedProperty(e,i).get,n=r[i](!0)),n!==void 0?n:""})};var lC={max:10,count:0,name:"hovertemplate"};te.hovertemplateString=function(){return ip.apply(lC,arguments)};var sC={max:10,count:0,name:"texttemplate"};te.texttemplateString=function(){return ip.apply(sC,arguments)};var fC=/^(\S+)([\*\/])(-?\d+(\.\d+)?)$/;function cC(t){var e=t.match(fC);return e?{key:e[1],op:e[2],number:Number(e[3])}:{key:t,op:null,number:null}}var uC={max:10,count:0,name:"texttemplate",parseMultDiv:!0};te.texttemplateStringForShapes=function(){return ip.apply(uC,arguments)};var Gm=/^[:|\|]/;function ip(t,e,r){var a=this,i=arguments;return e||(e={}),t.replace(te.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=cC(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(dw.test(p)||(y=te.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&&(te.warn("Variable '"+p+"' in "+a.name+" could not be found!"),y=n),a.count===a.max&&te.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:te.numberFormat,y!==""&&(y=g(l.replace(Gm,""))(y))),l[0]==="|"){g=r?r.timeFormat:QL;var x=te.dateTime2ms(y);y=te.formatDate(x,l.replace(Gm,""),!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 Rs=48,Um=57;te.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>=Rs&&o<=Um,f=l>=Rs&&l<=Um;if(s&&(a=10*a+o-Rs),f&&(i=10*i+l-Rs),!s||!f){if(a!==i)return a-i;if(o!==l)return o-l}}return i-a};var io=2e9;te.seedPseudoRandom=function(){io=2e9};te.pseudoRandom=function(){var t=io;return io=(69069*io+1)%4294967296,Math.abs(io-t)<429496729?te.pseudoRandom():io/4294967296};te.fillText=function(t,e,r){var a=Array.isArray(r)?function(o){r.push(o)}:function(o){r.text=o},i=te.extractOption(t,e,"htx","hovertext");if(te.isValidTextValue(i))return a(i);var n=te.extractOption(t,e,"tx","text");if(te.isValidTextValue(n))return a(n)};te.isValidTextValue=function(t){return t||t===0};te.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};te.isHidden=function(t){var e=window.getComputedStyle(t).display;return!e||e==="none"};te.strTranslate=function(t,e){return t||e?"translate("+t+","+e+")":""};te.strRotate=function(t){return t?"rotate("+t+")":""};te.strScale=function(t){return t!==1?"scale("+t+")":""};te.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,te.strTranslate(i-f*(r+o),n-f*(a+l))+te.strScale(f)+(s?"rotate("+s+(e?"":" "+r+" "+a)+")":"")};te.setTransormAndDisplay=function(t,e){t.attr("transform",te.getTextTransform(e)),t.style("display",e.scale?null:"none")};te.ensureUniformFontSize=function(t,e){var r=te.extendFlat({},e);return r.size=Math.max(e.size,t._fullLayout.uniformtext.minsize||0),r};te.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)};te.bigFont=function(t){return Math.round(1.2*t)};var Vm=te.getFirefoxVersion(),vC=Vm!==null&&Vm<86;te.getPositionFromD3Event=function(){return vC?[Ll.event.layerX,Ll.event.layerY]:[Ll.event.offsetX,Ll.event.offsetY]};var be=m_.exports,dC=be,Wm={"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 Xm in Wm){var hC=Xm.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier");dC.addStyleRule(hC,Wm[Xm])}var zt={},np={},Nu=Nh.EventEmitter,pC={init:function(t){if(t._ev instanceof Nu)return t;var e=new Nu,r=new Nu;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}},ps=pC,Ym=be,mC=Oo.dfltConfig;function yC(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)?Ym.extendDeep([],a):Ym.extendDeepAll({},a):r[i]=a;return r}var Ja={};Ja.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>mC.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--)};Ja.startSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0};Ja.stopSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1};Ja.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++)Ja.plotDo(e,r.undo.calls[a],r.undo.args[a]);e.undoQueue.inSequence=!1,e.autoplay=!1}};Ja.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++)Ja.plotDo(e,r.redo.calls[a],r.redo.args[a]);e.undoQueue.inSequence=!1,e.autoplay=!1,e.undoQueue.index++}};Ja.plotDo=function(t,e,r){t.autoplay=!0,r=yC(t,r),e.apply(null,r)};var gC=Ja,Uo={},hw={_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=Je,r=be,a=la,i=hs,n=hw,o=Xc,l=Oo.configAttributes,s=Na,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 I=(P?P+".":"")+C;H($,C,z,k,I),!t.isValObject($)&&c($)&&C!=="impliedEdits"&&t.crawl($,H,k+1,I)}})},t.isValObject=function(z){return z&&z.valType!==void 0},t.findArrayAttributes=function(z){var H=[],D=[],P=[],k,C;function $(j,G,X,O){D=D.slice(0,O).concat([G]),P=P.slice(0,O).concat([j&&j._isLinkedToArray]);var q=j&&(j.valType==="data_array"||j.arrayOk===!0)&&!(D[O-1]==="colorbar"&&(G==="ticktext"||G==="tickvals"));q&&I(k,0,"")}function I(j,G,X){var O=j[D[G]],q=X+D[G];if(G===D.length-1)u(O)&&H.push(C+q);else if(P[G]){if(Array.isArray(O))for(var W=0;W<O.length;W++)c(O[W])&&I(O[W],G+1,q+"["+W+"].")}else c(O)&&I(O,G+1,q+".")}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 I=$.basePlotModule;I&&I.attributes&&(C=I.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 I;for(D=0;D<$.length;D++){if(k=$[D],k.attrRegex&&k.attrRegex.test(H)){if(k.layoutAttrOverrides)return k.layoutAttrOverrides;!I&&k.layoutAttributes&&(I=k.layoutAttributes)}var j=k.baseLayoutAttrOverrides;if(j&&H in j)return j[H]}if(I)return I}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,X,O,q){v(k,q).set(void 0),j===void 0&&v(C,q).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 I={};f(I,H.layoutAttributes),$.layoutAttributes=M(I)}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 I in $.xaxis)delete z.yaxis[I];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))}})(Uo);var pw={exports:{}},Lt={},go=be,bC=la,xi="templateitemname",Hd={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(" ")}};Hd[xi]={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(" ")};Lt.templatedArray=function(t,e){return e._isLinkedToArray=t,e.name=Hd.name,e[xi]=Hd[xi],e};Lt.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=go.coerce(n,{},bC,"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}};Lt.newContainer=function(t,e,r){var a=t._template,i=a&&(a[e]||r&&a[r]);go.isPlainObject(i)||(i=null);var n=t[e]={_template:i};return n};Lt.arrayTemplater=function(t,e,r){var a=t._template,i=a&&a[mw(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[xi]=f[xi];if(!qm(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(qm(v)&&!o[v]){var p={_template:u,name:v,_input:{_templateitemname:v}};p[xi]=u[xi],f.push(p),o[v]=1}}return f}return{newItem:l,defaultItems:s}};function qm(t){return t&&typeof t=="string"}function mw(t){var e=t.length-1;return t.charAt(e)!=="s"&&go.warn("bad argument to arrayDefaultKey: "+t),t.substr(0,t.length-1)+"defaults"}Lt.arrayDefaultKey=mw;Lt.arrayEditor=function(t,e,r){var a=(go.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][xi]=n)}s();function f(p,d){l[p]=d}function c(p,d){n?go.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)go.nestedProperty(t,m).set(h[m])}return{modifyBase:f,modifyItem:c,getUpdateObj:u,applyUpdate:v}};var Xt={},al=Ho.counter,gr={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=Je,r=gr;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)}})(Xt);function xC(t){var e=t._fullLayout._zoomlayer;e&&e.selectAll(".outline-controllers").remove()}function _C(t){var e=t._fullLayout._zoomlayer;e&&e.selectAll(".select-outline").remove(),t._fullLayout._outlining=!1}var Sn={clearOutlineControllers:xC,clearOutline:_C},op={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(" ")}},ms={},ic=Je;gr.SUBPLOT_PATTERN;ms.getSubplotCalcData=function(t,e,r){var a=ic.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};ms.getModuleCalcData=function(t,e,r){var a=[],i=[],n;if(typeof e=="string"?n=ic.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]};ms.getSubplotData=function(e,r,a){if(!ic.subplotsRegistry[r])return[];for(var i=ic.subplotsRegistry[r].attr,n=[],o,l=0;l<e.length;l++)o=e[l],o[i]===a&&n.push(o);return n};var Hu={},Zm;function wC(){return Zm||(Zm=1,function(t){var e=Je,r=be;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)}})}}(Hu)),Hu}var yw=ut,TC=Bl.timeFormatLocale,kC=s_.formatLocale,El=ht,AC=o_,Tt=Je,gw=Uo,MC=Lt,Xe=be,bw=ct,Km=Wt.BADNUM,Er=Xt,SC=Sn.clearOutline,LC=op,lp=Xc,CC=hw,DC=ms.getModuleCalcData,Qm=Xe.relinkPrivateKeys,Gi=Xe._,Ue=pw.exports={};Xe.extendFlat(Ue,Tt);Ue.attributes=la;Ue.attributes.type.values=Ue.allTypes;Ue.fontAttrs=fr;Ue.layoutAttributes=hs;var Jc=wC();Ue.executeAPICommand=Jc.executeAPICommand;Ue.computeAPICommandBindings=Jc.computeAPICommandBindings;Ue.manageCommandObserver=Jc.manageCommandObserver;Ue.hasSimpleAPICommandBindings=Jc.hasSimpleAPICommandBindings;Ue.redrawText=function(t){return t=Xe.getGraphDiv(t),new Promise(function(e){setTimeout(function(){t._fullLayout&&(Tt.getComponentMethod("annotations","draw")(t),Tt.getComponentMethod("legend","draw")(t),Tt.getComponentMethod("colorbar","draw")(t),e(Ue.previousPromises(t)))},300)})};Ue.resize=function(t){t=Xe.getGraphDiv(t);var e,r=new Promise(function(a,i){(!t||Xe.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||Xe.isHidden(t)){a(t);return}delete t.layout.width,delete t.layout.height;var n=t.changed;t.autoplay=!0,Tt.call("relayout",t,{autosize:!0}).then(function(){t.changed=n,t._resolveResize===a&&(delete t._resolveResize,a(t))})},100)});return e&&e(r),r};Ue.previousPromises=function(t){if((t._promises||[]).length)return Promise.all(t._promises).then(function(){t._promises=[]})};Ue.addLinks=function(t){if(!(!t._context.showLink&&!t._context.showSources)){var e=t._fullLayout,r=Xe.ensureSingle(e._paper,"text","js-plot-link-container",function(s){s.style({"font-family":'"Open Sans", Arial, sans-serif',"font-size":"12px",fill:bw.defaultLine,"pointer-events":"all"}).each(function(){var f=yw.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&&$C(t,n),o.text(n.text()&&l.text()?" - ":"")}};function $C(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(){Ue.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})}}Ue.sendDataToCloud=function(t){var e=(window.PLOTLYENV||{}).BASE_URL||t._context.plotlyServerURL;if(e){t.emit("plotly_beforeexport");var r=yw.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=Ue.graphJson(t,!1,"keepdata"),a.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1}};var PC=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],EC=["year","month","dayMonth","dayMonthYear"];Ue.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||Ue.createTransitionData(t),i._dfltTitle={plot:Gi(t,"Click to enter Plot title"),subtitle:Gi(t,"Click to enter Plot subtitle"),x:Gi(t,"Click to enter X axis title"),y:Gi(t,"Click to enter Y axis title"),colorbar:Gi(t,"Click to enter Colorscale title"),annotation:Gi(t,"new text")},i._traceWord=Gi(t,"trace");var v=Jm(t,PC);if(i._mapboxAccessToken=c.mapboxAccessToken,a._initialAutoSizeIsDone){var p=a.width,d=a.height;Ue.supplyLayoutGlobalDefaults(n,i,v),n.width||(i.width=p),n.height||(i.height=d),Ue.sanitizeMargins(i)}else{Ue.supplyLayoutGlobalDefaults(n,i,v);var h=!n.width||!n.height,m=i.autosize,y=c.autosizable,b=h&&(m||y);b?Ue.plotAutoSize(t,n,i):h&&Ue.sanitizeMargins(i),!m&&h&&(n.width=i.width,n.height=i.height)}i._d3locale=IC(v,i.separators),i._extraFormat=Jm(t,EC),i._initialAutoSizeIsDone=!0,i._dataLength=s.length,i._modules=[],i._visibleModules=[],i._basePlotModules=[];var _=i._subplots=RC(),g=i._splomAxes={x:{},y:{}},x=i._splomSubplots={};i._splomGridDflt={},i._scatterStackOpts={},i._firstScatter={},i._alignmentOpts={},i._colorAxes={},i._requestRangeslider={},i._traceUids=zC(o,s),Ue.supplyDataDefaults(s,l,n,i);var w=Object.keys(g.x),T=Object.keys(g.y);if(w.length>1&&T.length>1){for(Tt.getComponentMethod("grid","sizeDefaults")(n,i),u=0;u<w.length;u++)Xe.pushUnique(_.xaxis,w[u]);for(u=0;u<T.length;u++)Xe.pushUnique(_.yaxis,T[u]);for(var A in x)Xe.pushUnique(_.cartesian,A)}if(i._has=Ue._hasPlotType.bind(i),o.length===l.length)for(u=0;u<l.length;u++)Qm(l[u],o[u]);Ue.supplyLayoutModuleDefaults(n,i,l,t._transitionData);var M=i._visibleModules,S=[];for(u=0;u<M.length;u++){var L=M[u].crossTraceDefaults;L&&Xe.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,Ue.linkSubplots(l,i,o,a),Ue.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&&SC({_fullLayout:a}),FC(l,i),Qm(i,a),Tt.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];xw(i),Tt.getComponentMethod("rangeslider","makeData")(i),!r&&f.length===l.length&&Ue.supplyDefaultsUpdateCalc(f,l)};Ue.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=Xe.nestedProperty(n,s).get().slice(),Xe.nestedProperty(a,s).set(f)}i.trace=a}}};function zC(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(Xe.randstr(f),i))}return s}function RC(){var t=Tt.collectableSubplotTypes,e={},r,a;if(!t){t=[];var i=Tt.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++)Xe.pushUnique(t,l[a])}}for(r=0;r<t.length;r++)e[t[r]]=[];return e}function Jm(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=Tt.localeRegistry}var c=r.split("-")[0];if(a||c===r)break;r=c}return a||n(Tt.localeRegistry.en.format),i}function IC(t,e){return t.decimal=e.charAt(0),t.thousands=e.charAt(1),{numberFormat:function(r){try{r=kC(t).format(Xe.adjustFormat(r))}catch{return Xe.warnBadFormat(r),Xe.noFormat}return r},timeFormat:TC(t).utcFormat}}function FC(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)}Ue.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=[])};Ue._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=Tt.modules[i];if(n&&n.categories[t])return!0}return!1};Ue.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()}};Ue.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=Er.getFromId(f,u,"x"),d=Er.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=Er.list(f,null,!0),b;for(i=0;i<y.length;i++){b=y[i];var _=null;b.overlaying&&(_=Er.getFromId(f,b.overlaying),_&&_.overlaying&&(b.overlaying=!1,_=null)),b._mainAxis=_||b,_&&(b.domain=_.domain.slice()),b._anchorAxis=b.anchor==="free"?null:Er.getFromId(f,b.anchor)}for(i=0;i<y.length;i++)if(b=y[i],b._counterAxes.sort(Er.idSort),b._subplotsWith.sort(Xe.subplotSort),b._mainSubplot=NC(b,e),b._counterAxes.length&&(b.spikemode&&b.spikemode.indexOf("across")!==-1||b.automargin&&b.mirror&&b.anchor!=="free"||Tt.getComponentMethod("rangeslider","isVisible")(b))){var g=1,x=0;for(n=0;n<b._counterAxes.length;n++){var w=Er.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 NC(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=Er.getFromId(r,c);if(l&&v.overlaying===l){n=u;break}}}return n||o}Ue.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=[],gw.crawl(t._module.attributes,i)),a=0;a<e.length;a++){var n=Xe.nestedProperty(t,"_input."+e[a]);n.get()||Xe.nestedProperty(t,e[a]).set(null)}};Ue.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&&(Xe.pushUnique(i,b),y.visible===!0&&Xe.pushUnique(n,b),Xe.pushUnique(o,y._module.basePlotModule),y._input.visible!==!1&&l++)}var v={},p=[],d=(r.template||{}).data||{},h=MC.traceTemplater(d);for(s=0;s<t.length;s++)c=t[s],f=h.newTrace(c),f.uid=a._traceUids[s],Ue.supplyTraceDefaults(c,f,l,a,s),f.index=s,f._input=c,f._fullInput=f,u(f),Tt.traceIs(f,"carpetAxis")&&(v[f.carpet]=f),Tt.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}};Ue.supplyAnimationDefaults=function(t){t=t||{};var e,r={};function a(i,n){return Xe.coerce(t||{},r,lp,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]=Ue.supplyAnimationFrameDefaults(t.frame[e]||{});else r.frame=Ue.supplyAnimationFrameDefaults(t.frame||{});if(Array.isArray(t.transition))for(r.transition=[],e=0;e<t.transition.length;e++)r.transition[e]=Ue.supplyAnimationTransitionDefaults(t.transition[e]||{});else r.transition=Ue.supplyAnimationTransitionDefaults(t.transition||{});return r};Ue.supplyAnimationFrameDefaults=function(t){var e={};function r(a,i){return Xe.coerce(t||{},e,lp.frame,a,i)}return r("duration"),r("redraw"),e};Ue.supplyAnimationTransitionDefaults=function(t){var e={};function r(a,i){return Xe.coerce(t||{},e,lp.transition,a,i)}return r("duration"),r("easing"),e};Ue.supplyFrameDefaults=function(t){var e={};function r(a,i){return Xe.coerce(t,e,CC,a,i)}return r("group"),r("name"),r("traces"),r("baseframe"),r("data"),r("layout"),e};Ue.supplyTraceDefaults=function(t,e,r,a,i){var n=a.colorway||bw.defaults,o=n[r%n.length],l;function s(_,g){return Xe.coerce(t,e,Ue.attributes,_,g)}var f=s("visible");s("type"),s("name",a._traceWord+" "+i),s("uirevision",a.uirevision);var c=Ue.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=Xe.coerce(t,e,p,m);d[m]&&Xe.pushUnique(d[m],y),h+=y}else h=Xe.coerce(t,e,p,v);d[u.name]&&Xe.pushUnique(d[u.name],h)}}if(f&&(s("customdata"),s("ids"),s("meta"),Tt.traceIs(e,"showLegend")?(Xe.coerce(t,e,c.attributes.showlegend?c.attributes:Ue.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),Tt.traceIs(e,"noOpacity")||s("opacity"),Tt.traceIs(e,"notLegendIsolatable")&&(e.visible=!!e.visible),Tt.traceIs(e,"noHover")||(e.hovertemplate||Xe.coerceHoverinfo(t,e,a),e.type!=="parcats"&&Tt.getComponentMethod("fx","supplyDefaults")(t,e,o,a)),c&&c.selectPoints)){var b=s("selectedpoints");Xe.isTypedArray(b)&&(e.selectedpoints=Array.from(b))}return e};Ue.supplyLayoutGlobalDefaults=function(t,e,r){function a(u,v){return Xe.coerce(t,e,Ue.layoutAttributes,u,v)}var i=t.template;Xe.isPlainObject(i)&&(e.template=i,e._template=i.layout,e._dataTemplate=i.data),a("autotypenumbers");var n=Xe.coerceFont(a,"font"),o=n.size;Xe.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),Xe.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&&Ue.sanitizeMargins(e),Tt.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),Tt.getComponentMethod("modebar","supplyLayoutDefaults")(t,e),Tt.getComponentMethod("shapes","supplyDrawNewShapeDefaults")(t,e,a),Tt.getComponentMethod("selections","supplyDrawNewSelectionDefaults")(t,e,a),a("meta"),Xe.isPlainObject(t.transition)&&(a("transition.duration"),a("transition.easing"),a("transition.ordering")),Tt.getComponentMethod("calendars","handleDefaults")(t,e,"calendar"),Tt.getComponentMethod("fx","supplyLayoutGlobalDefaults")(t,e,a),Xe.coerce(t,e,LC,"scattermode")};function Is(t){return typeof t=="string"&&t.substr(t.length-2)==="px"&&parseFloat(t)}Ue.plotAutoSize=function(e,r,a){var i=e._context||{},n=i.frameMargins,o,l,s=Xe.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=Is(f.width)||Is(f.maxWidth)||a.width,l=Is(f.height)||Is(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=Ue.layoutAttributes.width.min,v=Ue.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}),Ue.sanitizeMargins(a)};Ue.supplyLayoutModuleDefaults=function(t,e,r,a){var i=Tt.componentsRegistry,n=e._basePlotModules,o,l,s,f=Tt.subplotsRegistry.cartesian;for(o in i)s=i[o],s.includeBasePlot&&s.includeBasePlot(t,e);n.length||n.push(f),e._has("cartesian")&&(Tt.getComponentMethod("grid","contentDefaults")(t,e),f.finalizeSubplots(t,e));for(var c in e._subplots)e._subplots[c].sort(Xe.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)};Ue.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)),Xe.clearThrottle(),Xe.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()};Ue.style=function(t){var e=t._fullLayout._visibleModules,r=[],a;for(a=0;a<e.length;a++){var i=e[a];i.style&&Xe.pushUnique(r,i.style)}for(a=0;a<r.length;a++)r[a](t)};Ue.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))}};Ue.clearAutoMarginIds=function(t){t._fullLayout._pushmarginIds={}};Ue.allowAutoMargin=function(t,e){t._fullLayout._pushmarginIds[e]=1};function xw(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 _w=2,ww=2;Ue.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=Xe.constrain(i-o.l-o.r,_w,l),c=Xe.constrain(n-o.t-o.b,ww,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 Ue.doAutoMargin(t)}};function HC(t){if("_redrawFromAutoMarginCount"in t._fullLayout)return!1;var e=Er.list(t,"",!0);for(var r in e)if(e[r].autoshift||e[r].shift)return!0;return!1}Ue.doAutoMargin=function(t){var e=t._fullLayout,r=e.width,a=e.height;e._size||(e._size={}),xw(e);var i=e._size,n=e.margin,o={t:0,b:0,l:0,r:0},l=Xe.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),I=(C*(1-E)+(F-H)*(1-k))/(k-E);$+I>s+f&&(s=$,f=I)}}if(El(z)&&v[P].t){var j=v[P].t.val,G=v[P].t.size;if(j>N){var X=(z*j+(G-D)*N)/(j-N),O=(G*(1-N)+(z-D)*(1-j))/(j-N);X+O>u+c&&(u=X,c=O)}}}}}var q=Xe.constrain(r-n.l-n.r,_w,d),W=Xe.constrain(a-n.t-n.b,ww,h),Y=Math.max(0,r-q),B=Math.max(0,a-W);if(Y){var Q=(s+f)/Y;Q>1&&(s/=Q,f/=Q)}if(B){var ee=(u+c)/B;ee>1&&(u/=ee,c/=ee)}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&&(Ue.didMarginChange(l,i)||HC(t))){"_redrawFromAutoMarginCount"in e?e._redrawFromAutoMarginCount++:e._redrawFromAutoMarginCount=1;var fe=3*(1+Object.keys(p).length);if(e._redrawFromAutoMarginCount<fe)return Tt.call("_doPlot",t);e._size=l,Xe.warn("Too many auto-margin redraws.")}OC(t)};function OC(t){var e=Er.list(t,"",!0);["_adjustTickLabelsOverflow","_hideCounterAxisInsideTickLabels"].forEach(function(r){for(var a=0;a<e.length;a++){var i=e[a][r];i&&i()}})}var ey=["l","r","t","b","p","w","h"];Ue.didMarginChange=function(t,e){for(var r=0;r<ey.length;r++){var a=ey[r],i=t[a],n=e[a];if(!El(i)||Math.abs(n-i)>1)return!0}return!1};Ue.graphJson=function(t,e,r,a,i,n){(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&Ue.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(Xe.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&&!Xe.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=Xe.isTypedArray(v);if((m||y)&&v.dtype&&v.shape){var b=v.bdata;return f({dtype:v.dtype,shape:v.shape,bdata:Xe.isArrayBuffer(b)?AC.encode(b):b},p)}return m?v.map(function(_){return f(_,p)}):y?Xe.simpleMap(v,Xe.identity):Xe.isJSDate(v)?Xe.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)};Ue.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()};Ue.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=Ue.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]=Ue.extendTrace(c.data[o],l.data[a]))}return c};Ue.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)}};Ue.extendObjectWithContainers=function(t,e,r){var a,i,n,o,l,s,f,c,u=Xe.extendDeepNoArrays({},e||{}),v=Xe.expandObjectPaths(u),p={};if(r&&r.length)for(n=0;n<r.length;n++)a=Xe.nestedProperty(v,r[n]),i=a.get(),i===void 0?Xe.nestedProperty(p,r[n]).set(null):(a.set(null),Xe.nestedProperty(p,r[n]).set(i));if(t=Xe.extendDeepNoArrays(t||{},v),r&&r.length){for(n=0;n<r.length;n++)if(l=Xe.nestedProperty(p,r[n]),f=l.get(),!!f){for(s=Xe.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]=Ue.extendObjectWithContainers(c[o],d)}s.set(c)}}return t};Ue.dataArrayContainers=["transforms","dimensions"];Ue.layoutArrayContainers=Tt.layoutArrayContainers;Ue.extendTrace=function(t,e){return Ue.extendObjectWithContainers(t,e,Ue.dataArrayContainers)};Ue.extendLayout=function(t,e){return Ue.extendObjectWithContainers(t,e,Ue.layoutArrayContainers)};Ue.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]]=Ue.extendTrace(t.data[c[u]],e[u])}}var m=Xe.expandObjectPaths(Xe.extendDeepNoArrays({},r)),y=/^[xy]axis[0-9]*$/;for(var b in m)y.test(b)&&delete m[b].range;Ue.extendLayout(t.layout,m),delete t.calcdata,Ue.supplyDefaults(t),Ue.doCalcdata(t);var _=Xe.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(Xe.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=Xe.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)}},Tw(t,n,o)};Ue.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(Xe.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=Xe.extendFlat({},n,{duration:0}),d=h,p=n,setTimeout(y,n.duration),b()):(v=n,d=null,p=Xe.extendFlat({},n,{duration:0}),setTimeout(b,v.duration),y()):l.length?(v=n,y()):e.anim&&(d=h,p=n,b())},Tw(t,n,o)};function Tw(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 Tt.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 Tt.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=[Ue.previousPromises,s,r.prepareFn,Ue.rehover,Ue.reselect,o],c=Xe.syncOrAsync(f,t);return(!c||!c.then)&&(c=Promise.resolve()),c.then(function(){return t})}Ue.doCalcdata=function(t,e){var r=Er.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=gw.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:Km,y:Km}]),g[0].t||(g[0].t={}),g[0].trace=n,f[b]=g}}for(ty(r,a,i),l=0;l<a.length;l++)m(l,!0);for(l=0;l<a.length;l++)h(l);for(d&&ty(r,a,i),l=0;l<a.length;l++)m(l,!0);for(l=0;l<a.length;l++)m(l,!1);ry(t);var y=BC(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);ry(t)}Tt.getComponentMethod("fx","calc")(t),Tt.getComponentMethod("errorbars","calc")(t)};var jC=/(total|sum|min|max|mean|geometric mean|median) (ascending|descending)/;function BC(t,e){var r=[],a,i,n,o,l;function s(P,k,C){var $=k._id.charAt(0);if(P==="histogram2dcontour"){var I=k._counterAxes[0],j=Er.getFromId(e,I),G=$==="x"||I==="x"&&j.type==="category",X=$==="y"||I==="y"&&j.type==="category";return function(O,q){return O===0||q===0||G&&O===C[q].length-1||X&&q===C.length-1?-1:($==="y"?q:O)-1}}else return function(O,q){return $==="y"?q:O}}var f={min:function(P){return Xe.aggNums(Math.min,null,P)},max:function(P){return Xe.aggNums(Math.max,null,P)},sum:function(P){return Xe.aggNums(function(k,C){return k+C},null,P)},total:function(P){return Xe.aggNums(function(k,C){return k+C},null,P)},mean:function(P){return Xe.mean(P)},"geometric mean":function(P){return Xe.geometricMean(P)},median:function(P){return Xe.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(jC);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;Tt.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[Er.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 ty(t,e,r){var a={};function i(s){s.clearCalc(),s.type==="multicategory"&&s.setupMultiCategory(e),a[s._id]=1}Xe.simpleMap(t,i);for(var n=r._axisMatchGroups||[],o=0;o<n.length;o++)for(var l in n[o])a[l]||i(r[Er.id2name(l)])}function ry(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]?Xe.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)}}Ue.rehover=function(t){t._fullLayout._rehover&&t._fullLayout._rehover()};Ue.redrag=function(t){t._fullLayout._redrag&&t._fullLayout._redrag()};Ue.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);Tt.getComponentMethod("selections","reselect")(t,i)};Ue.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,Xe.filterVisible(p),a)}e.traceHash=n};Ue.plotBasePlot=function(t,e,r,a,i){var n=Tt.getModule(t),o=DC(e.calcdata,n)[0];n.plot(e,o,a,i)};Ue.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 Kt=pw.exports,kw={exports:{}},or={},Vo={};(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}})(Vo);var Sr={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=ut,r=be,a=r.strTranslate,i=Vo,n=Sr.LINE_SPACING,o=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;t.convertToTspans=function(k,C,$){var I=k.text(),j=!k.attr("data-notex")&&C&&C._context.typesetMath&&typeof MathJax<"u"&&I.match(o),G=e.select(k.node().parentNode);if(G.empty())return;var X=k.attr("class")?k.attr("class").split(" ")[0]:"text";X+="-math",G.selectAll("svg."+X).remove(),G.selectAll("g."+X+"-group").remove(),k.style("display",null).attr({"data-unformatted":I,"data-math":"N"});function O(){G.empty()||(X=k.attr("class")+"-math",G.select("svg."+X).remove()),k.text("").style("white-space","pre");var q=z(k.node(),I);q&&k.style("pointer-events","all"),t.positionText(k),$&&$.call(k)}return j?(C&&C._promises||[]).push(new Promise(function(q){k.style("display","none");var W=parseInt(k.node().style.fontSize,10),Y={fontSize:W};u(j[2],Y,function(B,Q,ee){G.selectAll("svg."+X).remove(),G.selectAll("g."+X+"-group").remove();var fe=B&&B.select("svg");if(!fe||!fe.node()){O(),q();return}var oe=G.append("g").classed(X+"-group",!0).attr({"pointer-events":"none","data-unformatted":I,"data-math":"Y"});oe.node().appendChild(fe.node()),Q&&Q.node()&&fe.node().insertBefore(Q.node().cloneNode(!0),fe.node().firstChild);var se=ee.width,de=ee.height;fe.attr({class:X,height:de,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var ye=k.node().style.fill||"black",_e=fe.select("g");_e.attr({fill:ye,stroke:ye});var Se=_e.node().getBoundingClientRect(),pe=Se.width,ve=Se.height;(pe>se||ve>de)&&(fe.style("overflow","hidden"),Se=fe.node().getBoundingClientRect(),pe=Se.width,ve=Se.height);var Me=+k.attr("x"),Pe=+k.attr("y"),ce=W||k.node().getBoundingClientRect().height,Le=-ce/4;if(X[0]==="y")oe.attr({transform:"rotate("+[-90,Me,Pe]+")"+a(-pe/2,Le-ve/2)});else if(X[0]==="l")Pe=Le-ve/2;else if(X[0]==="a"&&X.indexOf("atitle")!==0)Me=0,Pe=Le;else{var Ce=k.attr("text-anchor");Me=Me-pe*(Ce==="middle"?.5:Ce==="end"?1:0),Pe=Pe+Le-ve/2}fe.attr({x:Me,y:Pe}),$&&$.call(k,oe),q(oe)})})):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 I=parseInt((MathJax.version||"").split(".")[0]);if(I!==2&&I!==3){r.warn("No MathJax version:",MathJax.version);return}var j,G,X,O,q=function(){return G=r.extendDeepAll({},MathJax.Hub.config),X=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},Y=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")},Q=function(){var ye="math-output-"+r.randstr({},64);O=e.select("body").append("div").attr({id:ye}).style({visibility:"hidden",position:"absolute","font-size":C.fontSize+"px"}).text(f(k));var _e=O.node();return I===2?MathJax.Hub.Typeset(_e):MathJax.typeset([_e])},ee=function(){var ye=O.select(I===2?".MathJax_SVG":".MathJax"),_e=!ye.empty()&&O.select("svg").node();if(!_e)r.log("There was an error in the tex syntax.",k),$();else{var Se=_e.getBoundingClientRect(),pe;I===2?pe=e.select("body").select("#MathJax_SVG_glyphs"):pe=ye.select("defs"),$(ye,pe,Se)}O.remove()},fe=function(){if(j!=="SVG")return MathJax.Hub.setRenderer(j)},oe=function(){j!=="svg"&&(MathJax.config.startup.output=j)},se=function(){return X!==void 0&&(MathJax.Hub.processSectionDelay=X),MathJax.Hub.Config(G)},de=function(){MathJax.config=G};I===2?MathJax.Hub.Queue(q,Y,Q,ee,fe,se):I===3&&(W(),B(),MathJax.startup.defaultReady(),MathJax.startup.promise.then(function(){Q(),ee(),oe(),de()}))}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),I=$&&($[3]||$[4]);return I&&F(I)}var S=/(^|;)\s*color:/;t.plainText=function(k,C){C=C||{};for(var $=C.len!==void 0&&C.len!==-1?C.len:1/0,I=C.allowedTags!==void 0?C.allowedTags:["br"],j="...",G=j.length,X=k.split(b),O=[],q="",W=0,Y=0;Y<X.length;Y++){var B=X[Y],Q=B.match(_),ee=Q&&Q[2].toLowerCase();if(ee)I.indexOf(ee)!==-1&&(O.push(B),q=ee);else{var fe=B.length;if(W+fe<$)O.push(B),W+=fe;else if(W<$){var oe=$-W;q&&(q!=="br"||oe<=G||fe<=G)&&O.pop(),$>G?O.push(B.substr(0,oe-G)+j):O.push(B.substr(0,oe));break}q=""}}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 I;return $.charAt(0)==="#"?I=N($.charAt(1)==="x"?parseInt($.substr(2),16):parseInt($.substr(1),10)):I=L[$],I||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,I=[],j,G=-1;function X(){G++;var ve=document.createElementNS(i.svg,"tspan");e.select(ve).attr({class:"line",dy:G*n+"em"}),k.appendChild(ve),j=ve;var Me=I;if(I=[{node:ve}],Me.length>1)for(var Pe=1;Pe<Me.length;Pe++)O(Me[Pe])}function O(ve){var Me=ve.type,Pe={},ce;if(Me==="a"){ce="a";var Le=ve.target,Ce=ve.href,J=ve.popup;Ce&&(Pe={"xlink:xlink:show":Le==="_blank"||Le.charAt(0)!=="_"?"new":"replace",target:Le,"xlink:xlink:href":Ce},J&&(Pe.onclick='window.open(this.href.baseVal,this.target.baseVal,"'+J+'");return false;'))}else ce="tspan";ve.style&&(Pe.style=ve.style);var xe=document.createElementNS(i.svg,ce);if(Me==="sup"||Me==="sub"){q(j,h),j.appendChild(xe);var Z=document.createElementNS(i.svg,"tspan");q(Z,h),e.select(Z).attr("dy",d[Me]),Pe.dy=p[Me],j.appendChild(xe),j.appendChild(Z)}else j.appendChild(xe);e.select(xe).attr(Pe),j=ve.node=xe,I.push(ve)}function q(ve,Me){ve.appendChild(document.createTextNode(Me))}function W(ve){if(I.length===1){r.log("Ignoring unexpected end tag </"+ve+">.",C);return}var Me=I.pop();ve!==Me.type&&r.log("Start tag <"+Me.type+"> doesnt match end tag <"+ve+">. Pretending it did match.",C),j=I[I.length-1].node}var Y=g.test(C);Y?X():(j=k,I=[{node:k}]);for(var B=C.split(b),Q=0;Q<B.length;Q++){var ee=B[Q],fe=ee.match(_),oe=fe&&fe[2].toLowerCase(),se=v[oe];if(oe==="br")X();else if(se===void 0)q(j,F(ee));else if(fe[1])W(oe);else{var de=fe[4],ye={type:oe},_e=M(de,x);if(_e?(_e=_e.replace(S,"$1 fill:"),se&&(_e+=";"+se)):se&&(_e=se),_e&&(ye.style=_e),oe==="a"){$=!0;var Se=M(de,w);if(Se){var pe=H(Se);pe&&(ye.href=pe,ye.target=M(de,T)||"_blank",ye.popup=M(de,A))}}O(ye)}}return $}function H(k){var C=encodeURI(decodeURI(k)),$=document.createElement("a"),I=document.createElement("a");$.href=k,I.href=C;var j=$.protocol,G=I.protocol;return m.indexOf(j)!==-1&&m.indexOf(G)!==-1?C:""}t.sanitizeHTML=function(C){C=C.replace(y," ");for(var $=document.createElement("p"),I=$,j=[],G=C.split(b),X=0;X<G.length;X++){var O=G[X],q=O.match(_),W=q&&q[2].toLowerCase();if(W in v)if(q[1])j.length&&(I=j.pop());else{var Y=q[4],B=M(Y,x),Q=B?{style:B}:{};if(W==="a"){var ee=M(Y,w);if(ee){var fe=H(ee);if(fe){Q.href=fe;var oe=M(Y,T);oe&&(Q.target=oe)}}}var se=document.createElement(W);I.appendChild(se),e.select(se).attr(Q),I=se,j.push(se)}else I.appendChild(document.createTextNode(F(O)))}var de="innerHTML";return $[de]},t.lineCount=function(C){return C.selectAll("tspan.line").size()||1},t.positionText=function(C,$,I){return C.each(function(){var j=e.select(this);function G(q,W){return W===void 0?(W=j.attr(q),W===null&&(j.attr(q,0),W=0)):j.attr(q,W),W}var X=G("x",$),O=G("y",I);this.nodeName==="text"&&j.selectAll("tspan.line").attr({x:X,y:O})})};function D(k,C,$){var I=$.horizontalAlign,j=$.verticalAlign||"top",G=k.node().getBoundingClientRect(),X=C.node().getBoundingClientRect(),O,q,W;return j==="bottom"?q=function(){return G.bottom-O.height}:j==="middle"?q=function(){return G.top+(G.height-O.height)/2}:q=function(){return G.top},I==="right"?W=function(){return G.right-O.width}:I==="center"?W=function(){return G.left+(G.width-O.width)/2}:W=function(){return G.left},function(){O=this.node().getBoundingClientRect();var Y=W()-X.left,B=q()-X.top,Q=$.gd||{};if($.gd){Q._fullLayout._calcInverseTransform(Q);var ee=r.apply3DTransform(Q._fullLayout._invTransform)(Y,B);Y=ee[0],B=ee[1]}return this.style({top:B+"px",left:Y+"px","z-index":1e3}),this}}var P="1px ";t.makeTextShadow=function(k){var C=P,$=P,I=P;return C+$+I+k+", -"+C+"-"+$+I+k+", "+C+"-"+$+I+k+", -"+C+$+I+k},t.makeEditable=function(k,C){var $=C.gd,I=C.delegate,j=e.dispatch("edit","input","cancel"),G=I||k;if(k.style({"pointer-events":I?"none":"all"}),k.size()!==1)throw new Error("boo");function X(){q(),k.style({opacity:0});var W=G.attr("class"),Y;W?Y="."+W.split(" ")[0]+"-math-group":Y="[class*=-math-group]",Y&&e.select(k.node().parentNode).select(Y).style({opacity:0})}function O(W){var Y=W.node(),B=document.createRange();B.selectNodeContents(Y);var Q=window.getSelection();Q.removeAllRanges(),Q.addRange(B),Y.focus()}function q(){var W=e.select($),Y=W.select(".svg-container"),B=Y.append("div"),Q=k.node().style,ee=parseFloat(Q.fontSize||12),fe=C.text;fe===void 0&&(fe=k.attr("data-unformatted")),B.classed("plugin-editable editable",!0).style({position:"absolute","font-family":Q.fontFamily||"Arial","font-size":ee,color:C.fill||Q.fill||"black",opacity:1,"background-color":C.background||"transparent",outline:"#ffffff33 1px solid",margin:[-ee/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(fe).call(D(k,Y,C)).on("blur",function(){$._editing=!1,k.text(this.textContent).style({opacity:1});var oe=e.select(this).attr("class"),se;oe?se="."+oe.split(" ")[0]+"-math-group":se="[class*=-math-group]",se&&e.select(k.node().parentNode).select(se).style({opacity:0});var de=this.textContent;e.select(this).transition().duration(0).remove(),e.select(document).on("mouseup",null),j.edit.call(k,de)}).on("focus",function(){var oe=this;$._editing=!0,e.select(document).on("mouseup",function(){if(e.event.target===oe)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,Y,C)))}).on("keydown",function(){e.event.which===13&&this.blur()}).call(O)}return C.immediate?X():G.on("click",X),e.rebind(k,j,"on")}})(or);var Aw={exports:{}},GC=ut,If=oa,zl=ht,Fs=be,ay=ct,UC=No.isValid;function VC(t,e,r){var a=e?Fs.nestedProperty(t,e).get()||{}:t,i=a[r||"color"];i&&i._inputArray&&(i=i._inputArray);var n=!1;if(Fs.isArrayOrTypedArray(i)){for(var o=0;o<i.length;o++)if(zl(i[o])){n=!0;break}}return Fs.isPlainObject(a)&&(n||a.showscale===!0||zl(a.cmin)&&zl(a.cmax)||UC(a.colorscale)||Fs.isPlainObject(a.colorbar))}var iy=["showscale","autocolorscale","colorscale","reversescale","colorbar"],il=["min","max","mid","auto"];function Mw(t){var e=t._colorAx,r=e||t,a={},i,n,o;for(n=0;n<iy.length;n++)o=iy[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 Sw(t){for(var e=Mw(t),r=e.min,a=e.max,i=e.reversescale?Lw(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 Lw(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 Cw(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=If(a[o]).toRgb();n[o]=[l.r,l.g,l.b,l.a]}var s=GC.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 ny(s(v))}:c?u=function(v){return zl(v)?s(v):If(v).isValid()?v:ay.defaultLine}:u=function(v){return zl(v)?ny(s(v)):If(v).isValid()?v:ay.defaultLine},u.domain=s.domain,u.range=function(){return a},u}function WC(t,e){return Cw(Sw(t),e)}function ny(t){var e={r:t[0],g:t[1],b:t[2],a:t[3]};return If(e).toRgbString()}var Ma={hasColorscale:VC,extractOpts:Mw,extractScale:Sw,flipScale:Lw,makeColorScaleFunc:Cw,makeColorScaleFuncFromTrace:WC},Dw=V_,XC=Dw.FORMAT_LINK,YC=Dw.DATE_FORMAT_LINK;function qC(t,e){return{valType:"string",dflt:"",editType:"none",description:(e?sp:$w)("hover text",t)+["By default the values are formatted using "+(e?"generic number format":"`"+t+"axis.hoverformat`")+"."].join(" ")}}function sp(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: "+XC+"."].join(" ")}function $w(t,e){return sp(t,e)+[" And for dates see: "+YC+".","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 Wo={axisHoverFormat:qC,descriptionOnlyNumbers:sp,descriptionWithDates:$w},oy=fr,fo=Tr,Pw=Fr.dash,fp=Et.extendFlat,ly=Lt.templatedArray,sy=Wo.descriptionWithDates,ZC=Wt.ONEDAY,Ea=gr,Ou=Ea.HOUR_PATTERN,ju=Ea.WEEKDAY_PATTERN,Ff={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(" ")},KC=fp({},Ff,{values:Ff.values.slice().concat(["sync"]),description:[Ff.description,"If *sync*, the number of ticks will sync with the overlayed axis","set by `overlaying` property."].join(" ")});function fy(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 cy={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(" ")},uy={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(" ")},vy={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(" ")},dy={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 hy(t){var e={valType:"number",min:0,editType:"ticks",description:"Sets the tick length (in px)."};return t||(e.dflt=5),e}function py(t){var e={valType:"number",min:0,editType:"ticks",description:"Sets the tick width (in px)."};return t||(e.dflt=1),e}var my={valType:"color",dflt:fo.defaultLine,editType:"ticks",description:"Sets the tick color."},yy={valType:"color",dflt:fo.lightLine,editType:"ticks",description:"Sets the color of the grid lines."};function gy(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 by=fp({},Pw,{editType:"ticks"}),xy={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(" ")},Oa={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:fo.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:oy({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:[Ea.idRegex.x.toString(),Ea.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:[Ea.idRegex.x.toString(),Ea.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:ly("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:[ju,Ou,""],editType:"calc",description:["Determines a pattern on the time line that generates breaks.","If *"+ju+"* - 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 *"+Ou+"* - hour (24-hour clock) as decimal numbers between 0 and 24.","for more info.","Examples:","- { pattern: '"+ju+"', bounds: [6, 1] }"," or simply { bounds: ['sat', 'mon'] }"," breaks from Saturday to Monday (i.e. skips the weekends).","- { pattern: '"+Ou+"', 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:ZC,description:["Sets the size of each `values` item.","The default is one day in milliseconds."].join(" ")},editType:"calc"}),tickmode:KC,nticks:fy(),tick0:cy,dtick:uy,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:vy,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:dy,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:hy(),tickwidth:py(),tickcolor:my,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:fp({},Pw,{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:oy({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:sy("tick label")},tickformatstops:ly("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:sy("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:fo.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:xy,gridcolor:yy,gridwidth:gy(),griddash:by,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:fo.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:fo.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",Ea.idRegex.x.toString(),Ea.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",Ea.idRegex.x.toString(),Ea.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:Ff,nticks:fy("minor"),tick0:cy,dtick:uy,tickvals:vy,ticks:dy,ticklen:hy("minor"),tickwidth:py("minor"),tickcolor:my,gridcolor:yy,gridwidth:gy("minor"),griddash:by,showgrid:xy,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"},Pt=Oa,_y=fr,wy=Et.extendFlat,QC=Na.overrideAll,cp=QC({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:Pt.linecolor,outlinewidth:Pt.linewidth,bordercolor:Pt.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:Pt.minor.tickmode,nticks:Pt.nticks,tick0:Pt.tick0,dtick:Pt.dtick,tickvals:Pt.tickvals,ticktext:Pt.ticktext,ticks:wy({},Pt.ticks,{dflt:""}),ticklabeloverflow:wy({},Pt.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:Pt.ticklen,tickwidth:Pt.tickwidth,tickcolor:Pt.tickcolor,ticklabelstep:Pt.ticklabelstep,showticklabels:Pt.showticklabels,labelalias:Pt.labelalias,tickfont:_y({description:"Sets the color bar's tick label font"}),tickangle:Pt.tickangle,tickformat:Pt.tickformat,tickformatstops:Pt.tickformatstops,tickprefix:Pt.tickprefix,showtickprefix:Pt.showtickprefix,ticksuffix:Pt.ticksuffix,showticksuffix:Pt.showticksuffix,separatethousands:Pt.separatethousands,exponentformat:Pt.exponentformat,minexponent:Pt.minexponent,showexponent:Pt.showexponent,title:{text:{valType:"string",description:"Sets the title of the color bar."},font:_y({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"),JC=cp,eD=Ho.counter,tD=Jh,Ew=No.scales,rD=tD(Ew);function nl(t){return"`"+t+"`"}var Ln=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"?Ew[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: "+rD+"."].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=JC),r.noColorAxis||(T.coloraxis={valType:"subplotid",regex:eD("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},aD=Et.extendFlat,iD=Ln,Bu=No.scales,Gu="Note that `autocolorscale` must be true for this attribute to work.",zw={editType:"calc",colorscale:{editType:"calc",sequential:{valType:"colorscale",dflt:Bu.Reds,editType:"calc",description:["Sets the default sequential colorscale for positive values.",Gu].join(" ")},sequentialminus:{valType:"colorscale",dflt:Bu.Blues,editType:"calc",description:["Sets the default sequential colorscale for negative values.",Gu].join(" ")},diverging:{valType:"colorscale",dflt:Bu.RdBu,editType:"calc",description:["Sets the default diverging colorscale.",Gu].join(" ")}},coloraxis:aD({_isSubplotObj:!0,editType:"calc",description:[""].join(" ")},iD("",{colorAttr:"corresponding trace color array(s)",noColorAxis:!0,showScaleDflt:!0}))},nD=be,Rw=function(e){return nD.isPlainObject(e.colorbar)},eu={},Od=ht,Ty=be,Iw=Wt,oD=Iw.ONEDAY,lD=Iw.ONEWEEK;eu.dtick=function(t,e){var r=e==="log",a=e==="date",i=e==="category",n=a?oD:1;if(!t)return n;if(Od(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=Od(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};eu.tick0=function(t,e,r,a){if(e==="date")return Ty.cleanDate(t,Ty.dateTick0(r,a%lD===0?1:0));if(!(a==="D1"||a==="D2"))return Od(t)?Number(t):0};var ky=eu,sD=be.isArrayOrTypedArray,fD=Vt.isTypedArraySpec,cD=Vt.decodeTypedArraySpec,Fw=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 fD(_)&&(_=cD(_)),_!==void 0?_:(s._template||{})[b]}var u=c("tick0"),v=c("dtick"),p=c("tickvals"),d=sD(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=ky.dtick(v,i);s.tick0=ky.tick0(u,i,r.calendar,m)}else if(i!=="multicategory"){var y=a(f+"tickvals");y===void 0?s.tickmode="auto":o||a("ticktext")}},Uu=be,Ay=Oa,Nw=function(e,r,a,i){var n=i.isMinor,o=n?e.minor||{}:e,l=n?r.minor:r,s=n?Ay.minor:Ay,f=n?"minor.":"",c=Uu.coerce2(o,l,s,"ticklen",n?(r.ticklen||5)*.6:void 0),u=Uu.coerce2(o,l,s,"tickwidth",n?r.tickwidth||1:void 0),v=Uu.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)},Hw=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]]},Ns=be,uD=Lt,ja=function(e,r,a){var i=a.name,n=a.inclusionAttr||"visible",o=r[i],l=Ns.isArrayOrTypedArray(e[i])?e[i]:[],s=r[i]=[],f=uD.arrayTemplater(r,i,n),c,u;for(c=0;c<l.length;c++){var v=l[c];Ns.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(Ns.isArrayOrTypedArray(o)){var d=Math.min(o.length,s.length);for(c=0;c<d;c++)Ns.relinkPrivateKeys(s[c],o[c])}return s},jd=be,vD=ct.contrast,Ow=Oa,dD=Hw,hD=ja,jw=function(e,r,a,i,n){n||(n={});var o=a("labelalias");jd.isPlainObject(o)||delete r.labelalias;var l=dD(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?vD(n.bgColor):c&&c!==Ow.color.dflt?c:f.color;if(jd.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");hD(e,r,{name:"tickformatstops",inclusionAttr:"enabled",handleItemDefaults:pD}),r.tickformatstops.length||delete r.tickformatstops,!n.noExp&&!d&&i!=="date"&&(a("showexponent",l),a("exponentformat"),a("minexponent"),a("separatethousands"))}}};function pD(t,e){function r(i,n){return jd.coerce(t,e,Ow.tickformatstops,i,n)}var a=r("enabled");a&&(r("dtickrange"),r("value"))}var mD=Hw,Bw=function(e,r,a,i,n){n||(n={});var o=n.tickSuffixDflt,l=mD(e),s=a("tickprefix");s&&a("showtickprefix",l);var f=a("ticksuffix",o);f&&a("showticksuffix",l)},si=be,yD=Lt,gD=Fw,bD=Nw,xD=jw,_D=Bw,wD=cp,Gw=function(e,r,a){var i=yD.newContainer(r,"colorbar"),n=e.colorbar||{};function o(L,E){return si.coerce(n,i,wD,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),si.coerce(n,i,{x:{valType:"number",min:y?-2:0,max:y?3:1,dflt:b}},"x"),si.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"),si.noneOrAll(n,i,["x","y"]),o("outlinecolor"),o("outlinewidth"),o("bordercolor"),o("borderwidth"),o("bgcolor");var w=si.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"),gD(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"),_D(n,i,o,"linear",A),xD(n,i,o,"linear",A),bD(n,i,o,"linear"),o("title.text",a._dfltTitle.colorbar);var M=i.showticklabels?i.tickfont:T,S=si.extendFlat({},T,{family:M.family,size:si.bigFont(M.size)});si.coerceFont(o,"title.font",S),o("title.side",u?"top":"right")},My=ht,Bd=be,TD=Rw,kD=Gw,Sy=No.isValid,AD=Je.traceIs;function Vu(t,e){var r=e.slice(0,e.length-1);return e?Bd.nestedProperty(t,r).get()||{}:t}var ys=function t(e,r,a,i,n){var o=n.prefix,l=n.cLetter,s="_module"in r,f=Vu(e,o),c=Vu(r,o),u=Vu(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=AD(r,"contour")&&Bd.nestedProperty(r,"contours.coloring").get()||"heatmap",m=p[d];m?(m[2].push(v),m[0]!==h&&(m[0]=!1,Bd.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"],_=My(y)&&My(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=!Sy(x)),w!==void 0&&(T=!Sy(w)),i(o+"autocolorscale",T),i(o+"colorscale"),i(o+"reversescale"),o!=="marker.line."){var A;o&&s&&(A=TD(f));var M=i(o+"showscale",A);M&&(o&&u&&(c._template=u),kD(f,c,a))}},Ly=be,MD=Lt,Cy=zw,SD=ys,LD=function(e,r){function a(u,v){return Ly.coerce(e,r,Cy,u,v)}a("colorscale.sequential"),a("colorscale.sequentialminus"),a("colorscale.diverging");var i=r._colorAxes,n,o;function l(u,v){return Ly.coerce(n,o,Cy.coloraxis,u,v)}for(var s in i){var f=i[s];if(f[0])n=e[s]||{},o=MD.newContainer(r,s,"coloraxis"),o._name=s,SD(n,o,r,l,{prefix:"",cLetter:"c"});else{for(var c=0;c<f[2].length;c++)f[2][c]();delete r._colorAxes[s]}}},CD=be,DD=Ma.hasColorscale,$D=Ma.extractOpts,PD=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?CD.nestedProperty(c,u.container).get():c;if(v)if(v.coloraxis)v._colorAx=r[v.coloraxis];else{var p=$D(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);DD(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"})},Dy=ht,Wu=be,ED=Ma.extractOpts,up=function(e,r,a){var i=e._fullLayout,n=a.vals,o=a.containerStr,l=o?Wu.nestedProperty(r,o).get():r,s=ED(l),f=s.auto!==!1,c=s.min,u=s.max,v=s.mid,p=function(){return Wu.aggNums(Math.min,null,n)},d=function(){return Wu.aggNums(Math.max,null,n)};if(c===void 0?c=p():f&&(l._colorAx&&Dy(c)?c=Math.min(c,p()):c=p()),u===void 0?u=d():f&&(l._colorAx&&Dy(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)}},Hs=No,In=Ma,Mo={moduleType:"component",name:"colorscale",attributes:Ln,layoutAttributes:zw,supplyLayoutDefaults:LD,handleDefaults:ys,crossTraceDefaults:PD,calc:up,scales:Hs.scales,defaultScale:Hs.defaultScale,getScale:Hs.get,isValidScale:Hs.isValid,hasColorscale:In.hasColorscale,extractOpts:In.extractOpts,extractScale:In.extractScale,flipScale:In.flipScale,makeColorScaleFunc:In.makeColorScaleFunc,makeColorScaleFuncFromTrace:In.makeColorScaleFuncFromTrace},$y=be,zD=Vt.isTypedArraySpec,kr={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 $y.isPlainObject(e)&&($y.isArrayOrTypedArray(e.size)||zD(e.size))}},RD=ht,Uw=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 RD(s)&&s>0?Math.max(s,n):0}},sa={};(function(t){var e=be;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]}})(sa);var Xu,Py;function ID(){if(Py)return Xu;Py=1;var t=f_,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;Xu={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 Xu}var nr=ut,St=be,FD=St.numberFormat,mn=ht,Gd=oa,tu=Je,dr=ct,ND=Mo,Ul=St.strTranslate,ru=or,HD=Vo,OD=Sr,jD=OD.LINE_SPACING,Vw=ds.DESELECTDIM,BD=kr,GD=Uw,UD=sa.appendArrayPointValue,Ve=Aw.exports={};Ve.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",Yu(WD(c))),s&&t.style("text-shadow",s==="auto"?ru.makeTextShadow(dr.contrast(n)):Yu(s)),f&&t.style("text-decoration-line",Yu(XD(f)))};function Yu(t){return t==="none"?void 0:t}var VD={normal:"none",lower:"lowercase",upper:"uppercase","word caps":"capitalize"};function WD(t){return VD[t]}function XD(t){return t.replace("under","underline").replace("over","overline").replace("through","line-through").split("+").join(" ")}Ve.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)};Ve.setSize=function(t,e,r){t.attr("width",e).attr("height",r)};Ve.setRect=function(t,e,r,a,i){t.call(Ve.setPosition,e,r).call(Ve.setSize,a,i)};Ve.translatePoint=function(t,e,r,a){var i=r.c2p(t.x),n=a.c2p(t.y);if(mn(i)&&mn(n)&&e.node())e.node().nodeName==="text"?e.attr("x",i).attr("y",n):e.attr("transform",Ul(i,n));else return!1;return!0};Ve.translatePoints=function(t,e,r){t.each(function(a){var i=nr.select(this);Ve.translatePoint(a,i,e,r)})};Ve.hideOutsideRangePoint=function(t,e,r,a,i,n){e.attr("display",r.isPtWithinRange(t,i)&&a.isPtWithinRange(t,n)?null:"none")};Ve.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=tu.traceIs(n,"bar-like")?".bartext":".point,.textpoint";t.selectAll(s).each(function(f){Ve.hideOutsideRangePoint(f,nr.select(this),r,a,o,l)})})}};Ve.crispRound=function(t,e,r){return!e||!mn(e)?r||0:t._context.staticPlot?e:e<1?1:Math.round(e)};Ve.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),Ve.dashLine(e,l,o)};Ve.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||"";nr.select(this).call(dr.stroke,r||n.color).call(Ve.dashLine,l,o)})};Ve.dashLine=function(t,e,r){r=+r||0,e=Ve.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})};Ve.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 Ww(t,e,r,a){var i=e.fillpattern,n=e.fillgradient,o=Ve.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;Ve.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(qw,r,h,"linear",n.colorscale,"fill",m,y,!0,!1)}else d==="horizontal"&&(d=d+"reversed"),t.call(Ve.gradient,r,h,d,n.colorscale,"fill")}else e.fillcolor&&t.call(dr.fill,e.fillcolor)}Ve.singleFillStyle=function(t,e){var r=nr.select(t.node()),a=r.data(),i=((a[0]||[])[0]||{}).trace||{};Ww(t,i,e,!1)};Ve.fillGroupStyle=function(t,e,r){t.style("stroke-width",0).each(function(a){var i=nr.select(this);a[0].trace&&Ww(i,a[0].trace,e,r)})};var Ey=ID();Ve.symbolNames=[];Ve.symbolFuncs=[];Ve.symbolBackOffs=[];Ve.symbolNeedLines={};Ve.symbolNoDot={};Ve.symbolNoFill={};Ve.symbolList=[];Object.keys(Ey).forEach(function(t){var e=Ey[t],r=e.n;Ve.symbolList.push(r,String(r),t,r+100,String(r+100),t+"-open"),Ve.symbolNames[r]=t,Ve.symbolFuncs[r]=e.f,Ve.symbolBackOffs[r]=e.backoff||0,e.needLine&&(Ve.symbolNeedLines[r]=!0),e.noDot?Ve.symbolNoDot[r]=!0:Ve.symbolList.push(r+200,String(r+200),t+"-dot",r+300,String(r+300),t+"-open-dot"),e.noFill&&(Ve.symbolNoFill[r]=!0)});var YD=Ve.symbolNames.length,qD="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";Ve.symbolNumber=function(t){if(mn(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=Ve.symbolNames.indexOf(t),t>=0&&(t+=e)}return t%100>=YD||t>=400?0:Math.floor(Math.max(t,0))};function Xw(t,e,r,a){var i=t%100;return Ve.symbolFuncs[i](e,r,a)+(t>=200?qD:"")}var zy=FD("~f"),Yw={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}};Ve.gradient=function(t,e,r,a,i,n){var o=Yw[a];return qw(t,e,r,o.type,i,n,o.start,o.stop,!1,o.reversed)};function qw(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]=[zy((1-i[p][0])*100),i[p][1]]:v[p]=[zy(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(";")],St.identity);m.exit().remove(),m.enter().append(u.node).each(function(){var y=nr.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=Gd(_[1]);nr.select(this).attr({offset:_[0]+"%","stop-color":dr.tinyRGB(g),"stop-opacity":g.getAlpha()})})}),t.style(n,vp(h,e)).style(n+"-opacity",null),t.classed("gradient_filled",!0)}Ve.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=Gd(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],St.identity);E.exit().remove(),E.enter().append("pattern").each(function(){var F=nr.select(this);if(F.attr({id:d,width:h+"px",height:m+"px",patternUnits:"userSpaceOnUse",patternTransform:v?"scale(0.8)":""}),f){var N=Gd(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",vp(d,r)).style("fill-opacity",null),t.classed("pattern_filled",!0)};Ve.initGradients=function(t){var e=t._fullLayout,r=St.ensureSingle(e._defs,"g","gradients");r.selectAll("linearGradient,radialGradient").remove(),nr.select(t).selectAll(".gradient_filled").classed("gradient_filled",!1)};Ve.initPatterns=function(t){var e=t._fullLayout,r=St.ensureSingle(e._defs,"g","patterns");r.selectAll("pattern").remove(),nr.select(t).selectAll(".pattern_filled").classed("pattern_filled",!1)};Ve.getPatternAttr=function(t,e,r){return t&&St.isArrayOrTypedArray(t)?e<t.length?t[e]:r:t};Ve.pointStyle=function(t,e,r,a){if(t.size()){var i=Ve.makePointStyleFns(e);t.each(function(n){Ve.singlePointStyle(n,nr.select(this),e,i,r,a)})}};Ve.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=Ve.symbolNumber(t.mx||o.symbol)||0;t.om=f%200>=100;var c=hp(t,r),u=dp(t,r);e.attr("d",Xw(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):St.isArrayOrTypedArray(l.color)?d=dr.defaultLine:d=l.color,St.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,St.isArrayOrTypedArray(b)&&(b=b[0],Yw[b]||(b=0));var _=o.pattern,g=Ve.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),Ve.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||St.isArrayOrTypedArray(_.shape)||St.isArrayOrTypedArray(_.path)||St.isArrayOrTypedArray(_.bgcolor)||St.isArrayOrTypedArray(_.fgcolor)||St.isArrayOrTypedArray(_.size)||St.isArrayOrTypedArray(_.solidity);var z=r.uid;A&&(z+="-"+t.i),Ve.pattern(e,"point",i,z,x,F,N,t.mcc,_.fillmode,L,S,E)}else St.isArrayOrTypedArray(p)?dr.fill(e,p[t.i]):dr.fill(e,p);h&&dr.stroke(e,d)}};Ve.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=Ve.tryColorscale(r,""),e.lineScale=Ve.tryColorscale(r,"line"),tu.traceIs(t,"symbols")&&(e.ms2mrc=BD.isBubble(t)?GD(t):function(){return(r.size||6)/2}),t.selectedpoints&&St.extendFlat(e,Ve.makeSelectedPointStyleFns(t)),e};Ve.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;(St.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:Vw*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 tu.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};Ve.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,Vw))},e};Ve.selectedPointStyle=function(t,e){if(!(!t.size()||!e.selectedpoints)){var r=Ve.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",Xw(Ve.symbolNumber(l),s,hp(o,e),dp(o,e))),o.mrc2=s}),i.length&&t.each(function(n){for(var o=nr.select(this),l=0;l<i.length;l++)i[l](o,n)})}};Ve.tryColorscale=function(t,e){var r=e?St.nestedProperty(t,e).get():t;if(r){var a=r.color;if((r.colorscale||r._colorAx)&&St.isArrayOrTypedArray(a))return ND.makeColorScaleFuncFromTrace(r)}return St.identity};var qu={start:1,end:-1,middle:0,bottom:1,top:-1};function Zw(t,e,r,a,i){var n=nr.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=(ru.lineCount(t)-1)*jD+1,c=qu[l]*s,u=r*.75+qu[o]*s+(qu[o]-1)*f*r/2;t.attr("text-anchor",l),i||n.attr("transform",Ul(c,u))}function Kw(t,e){var r=t.ts||e.textfont.size;return mn(r)&&r>0?r:0}Ve.textPointStyle=function(t,e,r){if(t.size()){var a;if(e.selectedpoints){var i=Ve.makeSelectedTextStyleFns(e);a=i.selectedTextColorFn}var n=e.texttemplate,o=r._fullLayout;t.each(function(l){var s=nr.select(this),f=n?St.extractOption(l,e,"txt","texttemplate"):St.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={};UD(v,e,l.i);var p=e._meta||{};f=St.texttemplateString(f,u,o._d3locale,v,l,p)}var d=l.tp||e.textposition,h=Kw(l,e),m=a?a(l):l.tc||e.textfont.color;s.call(Ve.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(ru.convertToTspans,r).call(Zw,d,h,l.mrc)})}};Ve.selectedTextStyle=function(t,e){if(!(!t.size()||!e.selectedpoints)){var r=Ve.makeSelectedTextStyleFns(e);t.each(function(a){var i=nr.select(this),n=r.selectedTextColorFn(a),o=a.tp||e.textposition,l=Kw(a,e);dr.fill(i,n);var s=tu.traceIs(e,"bar-like");Zw(i,o,l,a.mrc2||a.mrc,s)})}};var Ry=.5;Ve.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(Nf(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};Ve.smoothclosed=function(t,e){if(t.length<3)return"M"+t.join("L")+"Z";var r="M"+t[0],a=t.length-1,i=[Nf(t[a],t[0],t[1],e)],n;for(n=1;n<a;n++)i.push(Nf(t[n-1],t[n],t[n+1],e));for(i.push(Nf(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 Qw,Jw;function co(t,e,r){return r&&(t=eT(t)),e?cn(t[1]):fn(t[0])}function fn(t){var e=nr.round(t,2);return Qw=e,e}function cn(t){var e=nr.round(t,2);return Jw=e,e}function Nf(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,Ry/2),f=Math.pow(o*o+l*l,Ry/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[[fn(e[0]+(v&&c/v)),cn(e[1]+(v&&u/v))],[fn(e[0]-(p&&c/p)),cn(e[1]-(p&&u/p))]]}var ZD={hv:function(t,e,r){return"H"+fn(e[0])+"V"+co(e,1,r)},vh:function(t,e,r){return"V"+cn(e[1])+"H"+co(e,0,r)},hvh:function(t,e,r){return"H"+fn((t[0]+e[0])/2)+"V"+cn(e[1])+"H"+co(e,0,r)},vhv:function(t,e,r){return"V"+cn((t[1]+e[1])/2)+"H"+fn(e[0])+"V"+co(e,1,r)}},KD=function(t,e,r){return"L"+co(e,0,r)+","+co(e,1,r)};Ve.steps=function(t){var e=ZD[t]||KD;return function(r){for(var a="M"+fn(r[0][0])+","+cn(r[0][1]),i=r.length,n=1;n<i;n++)a+=e(r[n-1],r[n],n===i-1);return a}};function eT(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=St.isArrayOrTypedArray(r),l=t,s=e?e[0]:Qw||0,f=e?e[1]:Jw||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;St.isArrayOrTypedArray(b)&&(b=b[m]);var _=y.size;St.isArrayOrTypedArray(_)&&(_=_[m]),h=y?Ve.symbolBackOffs[Ve.symbolNumber(b)]*_:0,h+=Ve.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}Ve.applyBackoff=eT;Ve.makeTester=function(){var t=St.ensureSingleById(nr.select("body"),"svg","js-plotly-tester",function(r){r.attr(HD.svgAttrs).style({position:"absolute",left:"-10000px",top:"-10000px",width:"9000px",height:"9000px","z-index":"1"})}),e=St.ensureSingle(t,"path","js-reference-point",function(r){r.attr("d","M0,0H1V1H0Z").style({"stroke-width":0,fill:"black"})});Ve.tester=t,Ve.testref=e};Ve.savedBBoxes={};var Zu=0,QD=1e4;Ve.bBox=function(t,e,r){r||(r=Iy(t));var a;if(r){if(a=Ve.savedBBoxes[r],a)return St.extendFlat({},a)}else if(t.childNodes.length===1){var i=t.childNodes[0];if(r=Iy(i),r){var n=+i.getAttribute("x")||0,o=+i.getAttribute("y")||0,l=i.getAttribute("transform");if(!l){var s=Ve.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=Ve.savedBBoxes[r],a)return St.extendFlat({},a)}}var f,c;e?f=t:(c=Ve.tester.node(),f=t.cloneNode(!0),c.appendChild(f)),nr.select(f).attr("transform",null).call(ru.positionText,0,0);var u=f.getBoundingClientRect(),v=Ve.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 Zu>=QD&&(Ve.savedBBoxes={},Zu=0),r&&(Ve.savedBBoxes[r]=p),Zu++,St.extendFlat({},p)};function Iy(t){var e=t.getAttribute("data-unformatted");if(e!==null)return e+t.getAttribute("data-math")+t.getAttribute("text-anchor")+t.getAttribute("style")}Ve.setClipUrl=function(t,e,r){t.attr("clip-path",vp(e,r))};function vp(t,e){if(!t)return null;var r=e._context,a=r._exportedPlot?"":r._baseUrl||"";return a?"url('"+a+"#"+t+"')":"url(#"+t+")"}Ve.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}};Ve.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+=Ul(e,r),o=o.trim(),t[n]("transform",o),o};Ve.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}};Ve.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 JD=/\s*sc.*/;Ve.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(JD,"");i+=a,i=i.trim(),this.setAttribute("transform",i)})}};var e5=/translate\([^)]*\)\s*$/;Ve.setTextPointsScale=function(t,e,r){t&&t.each(function(){var a,i=nr.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(e5);e===1&&r===1?a=[]:a=[Ul(o,l),"scale("+e+","+r+")",Ul(-o,-l)],s&&a.push(s),i.attr("transform",a.join(""))}})};function dp(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}Ve.getMarkerStandoff=dp;var ol=Math.atan2,tn=Math.cos,uo=Math.sin;function Fy(t,e){var r=e[0],a=e[1];return[r*tn(t)-a*uo(t),r*uo(t)+a*tn(t)]}var Ny,Hy,Oy,jy,Ku,Qu;function hp(t,e){var r=t.ma;r===void 0&&(r=e.marker.angle,(!r||St.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=Ny/180*Math.PI,_=Hy/180*Math.PI,g=b-m,x=tn(_)*uo(g),w=uo(_)*tn(y)-tn(_)*uo(y)*tn(g);h=-ol(x,w)-Math.PI,Ny=f,Hy=c}var T=Fy(p,[tn(h),0]),A=Fy(d,[uo(h),0]);r=ol(T[1]+A[1],T[0]+A[0])/Math.PI*180,n==="previous"&&!(Qu===e.uid&&t.i===Ku+1)&&(r=null)}if(n==="previous"&&!e._geo)if(Qu===e.uid&&t.i===Ku+1&&mn(a)&&mn(i)){var M=a-Oy,S=i-jy,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 Oy=a,jy=i,Ku=t.i,Qu=e.uid,r}Ve.getMarkerAngle=hp;var kt=Aw.exports,Fn=ut,t5=ht,r5=Kt,Ju=Je,Qi=be,By=Qi.strTranslate,Os=kt,js=ct,Nn=or,Gy=ds,a5=Sr.OPPOSITE_SIDE,Uy=/ [XY][0-9]* /,Ud=1.6,Vd=1.6;function i5(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,I=D.style,j=D.variant,G=D.textcase,X=D.lineposition,O=D.shadow,q;n==="title.text"?q="titleText":n.indexOf("axis")!==-1?q="axisTitleText":n.indexOf("colorbar"!==-1)&&(q="colorbarTitleText");var W=t._context.edits[q];function Y(Me,Pe){return Me===void 0||Pe===void 0?!1:Me.replace(Uy," % ")===Pe.replace(Uy," % ")}d===""?v=0:Y(d,o)&&(W||(d=""),v=.2,h=!0),L&&(N===""?H=0:Y(N,E)&&(W||(N=""),H=.2,z=!0)),r._meta?d=Qi.templateString(d,r._meta):a._meta&&(d=Qi.templateString(d,a._meta));var B=d||N||W,Q;u||(u=Qi.ensureSingle(a._infolayer,"g","g-"+e),Q=a._hColorbarMoveTitle);var ee=u.selectAll("text."+e).data(B?[0]:[]);ee.enter().append("text"),ee.text(d).attr("class",e),ee.exit().remove();var fe=null,oe=e+"-subtitle",se=N||W;if(L&&se&&(fe=u.selectAll("text."+oe).data(se?[0]:[]),fe.enter().append("text"),fe.text(N).attr("class",oe),fe.exit().remove()),!B)return u;function de(Me,Pe){Qi.syncOrAsync([ye,_e],{title:Me,subtitle:Pe})}function ye(Me){var Pe=Me.title,ce=Me.subtitle,Le;!c&&Q&&(c={}),c?(Le="",c.rotate&&(Le+="rotate("+[c.rotate,f.x,f.y]+")"),(c.offset||Q)&&(Le+=By(0,(c.offset||0)-(Q||0)))):Le=null,Pe.attr("transform",Le);function Ce(le){if(le){var ie=Fn.select(le.node().parentNode).select("."+oe);if(!ie.empty()){var me=le.node().getBBox();if(me.height){var he=me.y+me.height+Ud*k;ie.attr("y",he)}}}}if(Pe.style("opacity",v*js.opacity(_)).call(Os.font,{color:js.rgb(_),size:Fn.round(b,2),family:y,weight:g,style:x,variant:w,textcase:T,shadow:M,lineposition:A}).attr(f).call(Nn.convertToTspans,t,Ce),ce){var J=u.select("."+e+"-math-group"),xe=Pe.node().getBBox(),Z=J.node()?J.node().getBBox():void 0,ke=Z?Z.y+Z.height+Ud*k:xe.y+xe.height+Vd*k,Te=Qi.extendFlat({},f,{y:ke});ce.attr("transform",Le),ce.style("opacity",H*js.opacity(C)).call(Os.font,{color:js.rgb(C),size:Fn.round(k,2),family:P,weight:$,style:I,variant:j,textcase:G,shadow:O,lineposition:X}).attr(Te).call(Nn.convertToTspans,t)}return r5.previousPromises(t)}function _e(Me){var Pe=Me.title,ce=Fn.select(Pe.node().parentNode);if(s&&s.selection&&s.side&&d){ce.attr("transform",null);var Le=a5[s.side],Ce=s.side==="left"||s.side==="top"?-1:1,J=t5(s.pad)?s.pad:2,xe=Os.bBox(ce.node()),Z={t:0,b:0,l:0,r:0},ke=t._fullLayout._reservedMargin;for(var Te in ke)for(var le in ke[Te]){var ie=ke[Te][le];Z[le]=Math.max(Z[le],ie)}var me={left:Z.l,top:Z.t,right:a.width-Z.r,bottom:a.height-Z.b},he=s.maxShift||Ce*(me[s.side]-xe[s.side]),Ae=0;if(he<0)Ae=he;else{var we=s.offsetLeft||0,De=s.offsetTop||0;xe.left-=we,xe.right-=we,xe.top-=De,xe.bottom-=De,s.selection.each(function(){var Ge=Os.bBox(this);Qi.bBoxIntersect(xe,Ge,J)&&(Ae=Math.max(Ae,Ce*(Ge[s.side]-xe[Le])+J))}),Ae=Math.min(he,Ae),i._titleScoot=Math.abs(Ae)}if(Ae>0||he<0){var Ie={left:[-Ae,0],right:[Ae,0],top:[0,-Ae],bottom:[0,Ae]}[s.side];ce.attr("transform",By(Ie[0],Ie[1]))}}}ee.call(de,fe);function Se(Me,Pe){Me.text(Pe).on("mouseover.opacity",function(){Fn.select(this).transition().duration(Gy.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){Fn.select(this).transition().duration(Gy.HIDE_PLACEHOLDER).style("opacity",0)})}if(W&&(d?ee.on(".opacity",null):(Se(ee,o),h=!0),ee.call(Nn.makeEditable,{gd:t}).on("edit",function(Me){l!==void 0?Ju.call("_guiRestyle",t,n,Me,l):Ju.call("_guiRelayout",t,n,Me)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(de)}).on("input",function(Me){this.text(Me||" ").call(Nn.positionText,f.x,f.y)}),L)){if(L&&!d){var pe=ee.node().getBBox(),ve=pe.y+pe.height+Vd*k;fe.attr("y",ve)}N?fe.on(".opacity",null):(Se(fe,E),z=!0),fe.call(Nn.makeEditable,{gd:t}).on("edit",function(Me){Ju.call("_guiRelayout",t,"title.subtitle.text",Me)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(de)}).on("input",function(Me){this.text(Me||" ").call(Nn.positionText,fe.attr("x"),fe.attr("y"))})}return ee.classed("js-placeholder",h),fe&&fe.classed("js-placeholder",z),u}var au={draw:i5,SUBTITLE_PADDING_EM:Vd,SUBTITLE_PADDING_MATHJAX_EM:Ud},n5=ut,o5=Bl.utcFormat,Dt=be,l5=Dt.numberFormat,La=ht,fi=Dt.cleanNumber,s5=Dt.ms2DateTime,Vy=Dt.dateTime2ms,Ca=Dt.ensureNumber,Wy=Dt.isArrayOrTypedArray,Di=Wt,Bs=Di.FP_SAFE,ua=Di.BADNUM,f5=Di.LOG_CLIP,c5=Di.ONEWEEK,Gs=Di.ONEDAY,Us=Di.ONEHOUR,Xy=Di.ONEMIN,Yy=Di.ONESEC,Vs=Xt,nc=gr,Ws=nc.HOUR_PATTERN,Xs=nc.WEEKDAY_PATTERN;function ll(t){return Math.pow(10,t)}function ev(t){return t!=null}var pp=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*f5*Math.abs(w-T))}else return ua}function o(g,x,w,T){if((T||{}).msUTC&&La(g))return+g;var A=Vy(g,w||e.calendar);if(A===ua)if(La(g)){g=+g;var M=Math.floor(Dt.mod(g+.05,1)*10),S=Math.round(g-M/10);A=Vy(new Date(S))+M/10}else return ua;return A}function l(g,x,w){return s5(g,x,w||e.calendar)}function s(g){return e._categories[Math.round(g)]}function f(g){if(ev(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 ua}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(La(g))return+g}function p(g){return La(g)?+g:u(g)}function d(g,x,w){return n5.round(w+x*g,2)}function h(g,x,w){return(g-w)/x}var m=function(x){return La(x)?d(x,e._m,e._b):ua},y=function(g){return h(g,e._m,e._b)};if(e.rangebreaks){var b=i==="y";m=function(g){if(!La(g))return ua;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:Ca,e.l2c=e.type==="log"?ll:Ca,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=fi,e.c2d=e.c2r=e.l2d=e.l2r=Ca,e.d2p=e.r2p=function(g){return e.l2p(fi(g))},e.p2d=e.p2r=y,e.cleanPos=Ca):e.type==="log"?(e.d2r=e.d2l=function(g,x){return n(fi(g),x)},e.r2d=e.r2c=function(g){return ll(fi(g))},e.d2c=e.r2l=fi,e.c2d=e.l2r=Ca,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(fi(g))},e.p2r=y,e.cleanPos=Ca):e.type==="date"?(e.d2r=e.r2d=Dt.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 Dt.cleanDate(g,ua,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=Ca,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:Ca(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=Ca,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:Ca(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[Vs.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||Dt.minRowLength(N);if(Wy(N[0])&&Wy(N[1]))for(T=0;T<z;T++){var H=N[0][T],D=N[1][T];ev(H)&&ev(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 I=L[1][1];return I[P[1]]-I[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=Dt.nestedProperty(e,g).get(),A=Dt.simpleMap(T,e.r2l),M=A[1]<A[0];M&&A.reverse();var S=Dt.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=Dt.nestedProperty(e,g).get(),T,A;if(e.type==="date"?A=Dt.dfltRange(e.calendar):i==="y"?A=nc.DFLTRANGEY:e._name==="realaxis"?A=[0,1]:A=x.dfltRange||nc.DFLTRANGEX,A=A.slice(),(e.rangemode==="tozero"||e.rangemode==="nonnegative")&&(A[0]=0),!w||w.length!==2){Dt.nestedProperty(e,g).set(A);return}var M=w[0]===null,S=w[1]===null;for(e.type==="date"&&!e.autorange&&(w[0]=Dt.cleanDate(w[0],ua,e.calendar),w[1]=Dt.cleanDate(w[1],ua,e.calendar)),T=0;T<2;T++)if(e.type==="date"){if(!Dt.isDateTime(w[T],e.calendar)){e[g]=A;break}if(e.r2l(w[0])===e.r2l(w[1])){var L=Dt.constrain(e.r2l(w[0]),Dt.MIN_MS+1e3,Dt.MAX_MS-1e3);w[0]=e.l2r(L-1e3),w[1]=e.l2r(L+1e3);break}}else{if(!La(w[T]))if(!(M||S)&&La(w[1-T]))w[T]=w[1-T]*(T?10:.1);else{e[g]=A;break}if(w[T]<-Bs?w[T]=-Bs:w[T]>Bs&&(w[T]=Bs),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=Vs.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?Dt.simpleMap(C.bounds,C.pattern?fi:e.d2c):null})),x._cachedValues||(x._cachedValues=x.map(function(C){return C.enabled&&C.values?Dt.simpleMap(C.values,e.d2c).sort(Dt.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 Xs:S=new Date(g),M=S.getUTCDay(),T>A&&(A+=7,M<T&&(M+=7));break;case Ws: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 ua}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 ua}}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(I,j){return I.pattern===Xs&&j.pattern===Ws?-1:j.pattern===Xs&&I.pattern===Ws?1:0}),E=function(I,j){if(I=Dt.constrain(I,g,x),j=Dt.constrain(j,g,x),I!==j){for(var G=!0,X=0;X<S.length;X++){var O=S[X];I<O.max&&j>=O.min&&(I<O.min&&(O.min=I),j>O.max&&(O.max=j),G=!1)}G&&S.push({min:I,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=Dt.simpleMap(F.bounds,F.pattern?fi:e.r2l),A=T[0],M=T[1];var H=new Date(N),D,P;switch(F.pattern){case Xs:P=c5,D=((M<A?7:0)+(M-A))*Gs,N+=A*Gs-(H.getUTCDay()*Gs+H.getUTCHours()*Us+H.getUTCMinutes()*Xy+H.getUTCSeconds()*Yy+H.getUTCMilliseconds());break;case Ws:P=Gs,D=((M<A?24:0)+(M-A))*Us,N+=A*Us-(H.getUTCHours()*Us+H.getUTCMinutes()*Xy+H.getUTCSeconds()*Yy+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=Dt.simpleMap(F.values,e.d2c),$=0;$<C.length;$++)A=C[$],M=A+F.dvalue,E(A,M)}return S.sort(function(I,j){return I.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||Dt.minRowLength(T),Dt.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||La(e.r2l(g[0])))&&(x&&g[1]===null||La(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[Vs.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[Vs.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:o5,e._extraFormat=r._extraFormat),e._separators=r.separators,e._numFormat=_?_.numberFormat:l5,delete e._minDtick,delete e._forceTick0},tT=ht,mp=be,u5=Wt.BADNUM,oc=mp.isArrayOrTypedArray,v5=mp.isDateTime,d5=mp.cleanNumber,rT=Math.round,aT=function(e,r,a){var i=e,n=a.noMultiCategory;if(oc(i)&&!i.length)return"-";if(!n&&g5(i))return"multicategory";if(n&&Array.isArray(i[0])){for(var o=[],l=0;l<i.length;l++)if(oc(i[l]))for(var s=0;s<i[l].length;s++)o.push(i[l][s]);i=o}if(m5(i,r))return"date";var f=a.autotypenumbers!=="strict";return y5(i,f)?"category":p5(i,f)?"linear":"-"};function h5(t,e){return e?tT(t):typeof t=="number"}function p5(t,e){for(var r=t.length,a=0;a<r;a++)if(h5(t[a],e))return!0;return!1}function m5(t,e){for(var r=t.length,a=iT(r),i=0,n=0,o={},l=0;l<r;l+=a){var s=rT(l),f=t[s],c=String(f);o[c]||(o[c]=1,v5(f,e)&&i++,tT(f)&&n++)}return i>n*2}function iT(t){return Math.max(1,(t-1)/1e3)}function y5(t,e){for(var r=t.length,a=iT(r),i=0,n=0,o={},l=0;l<r;l+=a){var s=rT(l),f=t[s],c=String(f);if(!o[c]){o[c]=1;var u=typeof f;u==="boolean"?n++:(e?d5(f)!==u5:u==="number")?i++:u==="string"&&n++}}return n>i*2}function g5(t){return oc(t[0])&&oc(t[1])}var b5=ut,nT=ht,wi=be,Hf=Wt.FP_SAFE,x5=Je,_5=kt,oT=Xt,w5=oT.getFromId,T5=oT.isLinked,gs={applyAutorangeOptions:sT,getAutoRange:Wd,makePadFn:Xd,doAutoRange:A5,findExtremes:M5,concatExtremes:yp};function Wd(t,e){var r,a,i=[],n=t._fullLayout,o=Xd(n,e,0),l=Xd(n,e,1),s=yp(t,e),f=s.min,c=s.max;if(f.length===0||c.length===0)return wi.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=wi.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-qy(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-qy(e,w.val,T.val))/(_-o(A)-l(M)),i=[A.val-x*o(A),M.val+x*l(M)];return i=sT(i,e),e.limitRange&&e.limitRange(),d&&i.reverse(),wi.simpleMap(i,e.l2r||Number)}function qy(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 Xd(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=wi.simpleMap(e.range,e.r2l);n=o[1]<o[0]}n&&(r=!r)}var l=0;return T5(t,e._id)||(l=k5(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 Zy=3;function k5(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=wi.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 _=b5.select(this),g=_.select(".text-math-group");g.empty()&&(b.bb=_5.bBox(_.node()))})}for(var p=0;p<l._vals.length;p++){var d=l._vals[p],h=d.bb;if(h){var m=2*Zy+h.width,y=2*Zy+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 yp(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],Yd(o,c.val,c.pad,{extrapad:c.extrapad});for(f=0;f<_.max.length;f++)c=_.max[f],qd(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=w5(t,v),d=yp(t,p,!0),h=e._length/p._length;for(f=0;f<d.min.length;f++)c=d.min[f],Yd(o,c.val,c.pad*h,{extrapad:c.extrapad});for(f=0;f<d.max.length;f++)c=d.max[f],qd(l,c.val,c.pad*h,{extrapad:c.extrapad})}}return{min:o,max:l}}function A5(t,e,r){if(e.setScale(),e.autorange){e.range=r?r.slice():Wd(t,e),e._r=e.range.slice(),e._rl=wi.simpleMap(e._r,e.r2l);var a=e._input,i={};i[e._attr+".range"]=e.range,i[e._attr+".autorange"]=e.autorange,x5.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=Wd(t,e)),n._input.rangeslider[e._name]=wi.extendFlat({},o)}}function M5(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<Hf&&(_=v);else for(u=0;u<n;u++)v=e[u],v<b&&v>-Hf&&(b=v),v>_&&v<Hf&&(_=v);e=[b,_],n=2}var M={tozero:l,extrapad:o};function S(E){p=e[E],nT(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)),Ky(d)&&Yd(a,d,y,M),Ky(h)&&qd(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 Yd(t,e,r,a){lT(t,e,r,a,S5)}function qd(t,e,r,a){lT(t,e,r,a,L5)}function lT(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 Ky(t){return nT(t)&&Math.abs(t)<Hf}function S5(t,e){return t<=e}function L5(t,e){return t>=e}function C5(t,e){var r=e.autorangeoptions;return r&&r.minallowed!==void 0&&lc(e,r.minallowed,r.maxallowed)?r.minallowed:r&&r.clipmin!==void 0&&lc(e,r.clipmin,r.clipmax)?Math.max(t,e.d2l(r.clipmin)):t}function D5(t,e){var r=e.autorangeoptions;return r&&r.maxallowed!==void 0&&lc(e,r.minallowed,r.maxallowed)?r.maxallowed:r&&r.clipmax!==void 0&&lc(e,r.clipmin,r.clipmax)?Math.min(t,e.d2l(r.clipmax)):t}function lc(t,e,r){return e!==void 0&&r!==void 0?(e=t.d2l(e),r=t.d2l(r),e<r):!0}function sT(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);wi.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=C5(r,e),a=D5(a,e),[r,a]}var ea=ut,Zt=ht,bo=Kt,Vl=Je,ot=be,So=ot.strTranslate,rn=or,$5=au,Wl=ct,Br=kt,P5=Oa,Qy=eu,hr=Wt,E5=hr.ONEMAXYEAR,sc=hr.ONEAVGYEAR,fc=hr.ONEMINYEAR,z5=hr.ONEMAXQUARTER,Zd=hr.ONEAVGQUARTER,cc=hr.ONEMINQUARTER,R5=hr.ONEMAXMONTH,Lo=hr.ONEAVGMONTH,uc=hr.ONEMINMONTH,Gr=hr.ONEWEEK,wr=hr.ONEDAY,Ti=wr/2,Fa=hr.ONEHOUR,Xl=hr.ONEMIN,vc=hr.ONESEC,I5=hr.ONEMILLI,F5=hr.ONEMICROSEC,un=hr.MINUS_SIGN,iu=hr.BADNUM,Kd={K:"zeroline"},Qd={K:"gridline",L:"path"},Jd={K:"minor-gridline",L:"path"},fT={K:"tick",L:"path"},Jy={K:"tick",L:"text"},eg={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},nu=Sr,Cl=nu.MID_SHIFT,vn=nu.CAP_SHIFT,Yl=nu.LINE_SPACING,N5=nu.OPPOSITE_SIDE,dc=3,ze=kw.exports={};ze.setConvert=pp;var H5=aT,ti=Xt,O5=ti.idSort,j5=ti.isLinked;ze.id2name=ti.id2name;ze.name2id=ti.name2id;ze.cleanId=ti.cleanId;ze.list=ti.list;ze.listIds=ti.listIds;ze.getFromId=ti.getFromId;ze.getFromTrace=ti.getFromTrace;var cT=gs;ze.getAutoRange=cT.getAutoRange;ze.findExtremes=cT.findExtremes;var B5=1e-4;function gp(t){var e=(t[1]-t[0])*B5;return[t[0]-e,t[1]+e]}ze.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},ot.coerce(t,e,f,s)};ze.getRefType=function(t){return t===void 0?t:t==="paper"?"paper":t==="pixel"?"pixel":/( domain)$/.test(t)?"domain":"range"};ze.coercePosition=function(t,e,r,a,i,n){var o,l,s=ze.getRefType(a);if(s!=="range")o=ot.ensureNumber,l=r(i,n);else{var f=ze.getFromId(e,a);n=f.fraction2r(n),l=r(i,n),o=f.cleanPos}t[i]=o(l)};ze.cleanPosition=function(t,e,r){var a=r==="paper"||r==="pixel"?ot.ensureNumber:ze.getFromId(e,r).cleanPos;return a(t)};ze.redrawComponents=function(t,e){e=e||ze.listIds(t);var r=t._fullLayout;function a(i,n,o,l){for(var s=Vl.getComponentMethod(i,n),f={},c=0;c<e.length;c++)for(var u=r[ze.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 G5=ze.getDataConversions=function(t,e,r,a){var i,n=r==="x"||r==="y"||r==="z"?r:a;if(ot.isArrayOrTypedArray(n)){if(i={type:H5(a,void 0,{autotypenumbers:t._fullLayout.autotypenumbers}),_categories:[]},ze.setConvert(i),i.type==="category")for(var o=0;o<a.length;o++)i.d2c(a[o])}else i=ze.getFromTrace(t,e,n);return i?{d2c:i.d2c,c2d:i.c2d}:n==="ids"?{d2c:rg,c2d:rg}:{d2c:tg,c2d:tg}};function tg(t){return+t}function rg(t){return String(t)}ze.getDataToCoordFunc=function(t,e,r,a){return G5(t,e,r,a).d2c};ze.counterLetter=function(t){var e=t.charAt(0);if(e==="x")return"y";if(e==="y")return"x"};ze.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))};ze.saveRangeInitial=function(t,e){for(var r=ze.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};ze.saveShowSpikeInitial=function(t,e){for(var r=ze.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};ze.autoBin=function(t,e,r,a,i,n){var o=ot.aggNums(Math.min,null,t),l=ot.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:ot.simpleMap([o,l],e.c2r,0,i),calendar:i},ze.setConvert(s),n=n&&Qy.dtick(n,s.type),n)s.dtick=n,s.tick0=Qy.tick0(void 0,s.type,i);else{var f;if(r)f=(l-o)/r;else{var c=ot.distinctVals(t),u=Math.pow(10,Math.floor(Math.log(c.minDiff)/Math.LN10)),v=u*ot.roundUp(c.minDiff/u,[.9,1.9,4.9,9.9],!0);f=Math.max(v,2*ot.stdev(t)/Math.pow(t.length,a?.25:.4)),Zt(f)||(f=1)}ze.autoTicks(s,f)}var p=s.dtick,d=ze.tickIncrement(ze.tickFirst(s),p,"reverse",i),h,m;if(typeof p=="number")d=U5(d,t,s,o,l),m=1+Math.floor((l-d)/p),h=d+m*p;else for(s.dtick.charAt(0)==="M"&&(d=V5(d,t,p,o,i)),h=d,m=0;h<=l;)h=ze.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 U5(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++:Zt(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 V5(t,e,r,a,i){var n=ot.findExactDates(e,i),o=.8;if(n.exactDays>o){var l=Number(r.substr(1));n.exactYears>o&&l%12===0?t=ze.tickIncrement(t,"M6","reverse")+wr*1.5:n.exactMonths>o?t=ze.tickIncrement(t,"M1","reverse")+wr*15.5:t-=Ti;var s=ze.tickIncrement(t,r);if(s<=a)return s}return t}ze.prepMinorTicks=function(t,e,r){if(!e.minor.dtick){delete t.dtick;var a=e.dtick&&Zt(e._tmin),i;if(a){var n=ze.tickIncrement(e._tmin,e.dtick,!0);i=[e._tmin,n*.99+e._tmin*.01]}else{var o=ot.simpleMap(e.range,e.r2l);i=[o[0],.8*o[0]+.2*o[1]]}if(t.range=ot.simpleMap(i,e.l2r),t._isMinor=!0,ze.prepTicks(t,r),a){var l=Zt(e.dtick),s=Zt(t.dtick),f=l?e.dtick:+e.dtick.substring(1),c=s?t.dtick:+t.dtick.substring(1);l&&s?tv(f,c)?f===2*Gr&&c===2*wr&&(t.dtick=Gr):f===2*Gr&&c===3*wr?t.dtick=Gr:f===Gr&&!(e._input.minor||{}).nticks?t.dtick=wr:ag(f/c,2.5)?t.dtick=f/2:t.dtick=f:String(e.dtick).charAt(0)==="M"?s?t.dtick="M1":tv(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"?tv(f,c)||(t.dtick=ag(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 tv(t,e){return Math.abs((t/e+.5)%1-.5)<.001}function ag(t,e){return Math.abs(t/e-1)<.001}ze.prepTicks=function(t,e){var r=ot.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?ot.bigFont(t.tickfont.size||12):15,a=t._length/i):(i=t._id.charAt(0)==="y"?40:80,a=ot.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,ze.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"&&W5(t),t.tick0||(t.tick0=t.type==="date"?"2000-01-01":0),t.type==="date"&&t.dtick<.1&&(t.dtick=.1),hT(t)};function rv(t){return+t.substring(1)}function W5(t){var e;function r(){return!(Zt(t.dtick)||t.dtick.charAt(0)!=="M")}var a=r(),i=ze.getTickFormat(t);if(i){var n=t._dtickInit!==t.dtick;/%[fLQsSMX]/.test(i)||(/%[HI]/.test(i)?(e=Fa,n&&!a&&t.dtick<Fa&&(t.dtick=Fa)):/%p/.test(i)?(e=Ti,n&&!a&&t.dtick<Ti&&(t.dtick=Ti)):/%[Aadejuwx]/.test(i)?(e=wr,n&&!a&&t.dtick<wr&&(t.dtick=wr)):/%[UVW]/.test(i)?(e=Gr,n&&!a&&t.dtick<Gr&&(t.dtick=Gr)):/%[Bbm]/.test(i)?(e=Lo,n&&(a?rv(t.dtick)<1:t.dtick<uc)&&(t.dtick="M1")):/%[q]/.test(i)?(e=Zd,n&&(a?rv(t.dtick)<3:t.dtick<cc)&&(t.dtick="M3")):/%[Yy]/.test(i)&&(e=sc,n&&(a?rv(t.dtick)<12:t.dtick<fc)&&(t.dtick="M12")))}a=r(),a&&t.tick0===t._dowTick0&&(t.tick0=t._rawTick0),t._definedDelta=e}function X5(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>=fc?f>=fc&&f<=E5?u=f:u=sc:r===Zd&&c>=cc?f>=cc&&f<=z5?u=f:u=Zd:c>=uc?f>=uc&&f<=R5?u=f:u=Lo:r===Gr&&c>=Gr?u=Gr:c>=wr?u=wr:r===Ti&&c>=Ti?u=Ti:r===Fa&&c>=Fa&&(u=Fa);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)!==iu&&h++}u*=h/d,u||(t[a].drop=!0),v&&f>Gr&&(u=f)}(u>0||a===0)&&(t[a].periodX=i+u/2)}}ze.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||ot.isArrayOrTypedArray(e.ticklabelindex)?e.ticklabelindex:[e.ticklabelindex],f=ot.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:ot.extendFlat({},e,e.minor);if(x?ze.prepMinorTicks(w,e,r):ze.prepTicks(w,r),w.tickmode==="array"){g?(m=[],d=ig(e,!x)):(y=[],h=ig(e,!x));continue}if(w.tickmode==="sync"){m=[],d=Y5(e);continue}var T=gp(f),A=T[0],M=T[1],S=Zt(w.dtick),L=a==="log"&&!(S||w.dtick.charAt(0)==="L"),E=ze.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=Lo*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=av(N,e),c||(N=ze.tickIncrement(N,D,!c,i))),g&&o&&(N=ze.tickIncrement(N,D,!c,i),z--);c?N>=M:N<=M;N=ze.tickIncrement(N,D,c,i)){if(g&&z++,w.rangebreaks&&!c){if(N<A)continue;if(w.maskBreaks(N)===iu&&av(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);g3(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(ve,Me){return ve.value-Me.value}).filter(function(ve,Me,Pe){return Me===0||ve.value!==Pe[Me-1].value});var $=C.map(function(ve,Me){return ve.minor===void 0&&!ve.skipLabel?Me:null}).filter(function(ve){return ve!==null});$.forEach(function(ve){s.map(function(Me){var Pe=ve+Me;Pe>=0&&Pe<C.length&&ot.pushUnique(b,C[Pe])})})}if(_){var I=e.minor.ticks==="inside"&&e.ticks==="outside"||e.minor.ticks==="outside"&&e.ticks==="inside";if(!I){for(var j=m.map(function(ve){return ve.value}),G=[],X=0;X<y.length;X++){var O=y[X],q=O.value;if(j.indexOf(q)===-1){for(var W=!1,Y=0;!W&&Y<m.length;Y++)1e7+m[Y].value===1e7+q&&(W=!0);W||G.push(O)}}y=G}}o&&X5(b,e,e._definedDelta);var B;if(e.rangebreaks){var Q=e._id.charAt(0)==="y",ee=1;e.tickmode==="auto"&&(ee=e.tickfont?e.tickfont.size:12);var fe=NaN;for(B=m.length-1;B>-1;B--){if(m[B].drop){m.splice(B,1);continue}m[B].value=av(m[B].value,e);var oe=e.c2p(m[B].value);(Q?fe>oe-ee:fe<oe+ee)?m.splice(c?B+1:B,1):fe=oe}}_p(e)&&Math.abs(f[1]-f[0])===360&&m.pop(),e._tmax=(m[m.length-1]||{}).value,e._prevDateHead="",e._inCalcTicks=!0;var se,de=function(ve){ve.text="",e._prevDateHead=se};m=m.concat(y);function ye(ve,Me){var Pe=ze.tickText(ve,Me.value,!1,Me.simpleLabel),ce=Me.periodX;return ce!==void 0&&(Pe.periodX=ce,(ce>v||ce<u)&&(ce>v&&(Pe.periodX=v),ce<u&&(Pe.periodX=u),de(Pe))),Pe}var _e;for(B=0;B<m.length;B++){var Se=m[B].minor,pe=m[B].value;Se?(s&&b.indexOf(m[B])!==-1?_e=ye(e,m[B]):_e={x:pe},_e.minor=!0,h.push(_e)):(se=e._prevDateHead,_e=ye(e,m[B]),(m[B].skipLabel||s&&b.indexOf(m[B])===-1)&&de(_e),d.push(_e))}return d=d.concat(h),e._inCalcTicks=!1,o&&d.length&&(d[0].noTick=!0),d};function uT(t,e){return t.rangebreaks&&(e=e.filter(function(r){return t.maskBreaks(r.x)!==iu})),e}function Y5(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=ze.tickText(t,n);e._vals[a].minor&&(o.minor=!0,o.text=""),r.push(o)}}return r=uT(t,r),r}function ig(t,e){var r=ot.simpleMap(t.range,t.r2l),a=gp(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){ot.isArrayOrTypedArray(c)||(c=[]);for(var u=0;u<f.length;u++){var v=o(f[u]);if(v>i&&v<n){var p=ze.tickText(t,v,!1,String(c[u]));s&&(p.minor=!0,p.text=""),l.push(p)}}}}return l=uT(t,l),l}var Ys=[2,5,10],ng=[1,2,3,6,12],og=[1,2,5,10,15,30],q5=[1,2,3,7,14],vT=[-.046,0,.301,.477,.602,.699,.778,.845,.903,.954,1],dT=[-.301,0,.301,.699,1],Z5=[15,30,45,90,180];function Da(t,e,r){return e*ot.roundUp(t/e,r)}ze.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=ot.dateTick0(t.calendar,0);var n=2*e;if(n>sc)e/=sc,a=i(10),t.dtick="M"+12*Da(e,a,Ys);else if(n>Lo)e/=Lo,t.dtick="M"+Da(e,1,ng);else if(n>wr){if(t.dtick=Da(e,wr,t._hasDayOfWeekBreaks?[1,2,7,14]:q5),!r){var o=ze.getTickFormat(t),l=t.ticklabelmode==="period";l&&(t._rawTick0=t.tick0),/%[uVW]/.test(o)?t.tick0=ot.dateTick0(t.calendar,2):t.tick0=ot.dateTick0(t.calendar,1),l&&(t._dowTick0=t.tick0)}}else n>Fa?t.dtick=Da(e,Fa,ng):n>Xl?t.dtick=Da(e,Xl,og):n>vc?t.dtick=Da(e,vc,og):(a=i(10),t.dtick=Da(e,a,Ys))}else if(t.type==="log"){t.tick0=0;var s=ot.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"+Da(e,a,Ys)}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))):_p(t)?(t.tick0=0,a=1,t.dtick=Da(e,a,Z5)):(t.tick0=0,a=i(10),t.dtick=Da(e,a,Ys));if(t.dtick===0&&(t.dtick=1),!Zt(t.dtick)&&typeof t.dtick!="string"){var c=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(c)}};function hT(t){var e=t.dtick;if(t._tickexponent=0,!Zt(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>=wr&&i<=10||e>=wr*15)t._tickround="d";else if(e>=Xl&&i<=16||e>=Fa)t._tickround="M";else if(e>=vc&&i<=19||e>=Xl)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(Zt(e)||e.charAt(0)==="L"){var o=t.range.map(t.r2d||Number);Zt(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&&(hc(t.exponentformat)&&!bp(s)?t._tickexponent=3*Math.round((s-1)/3):t._tickexponent=s)}else t._tickround=null}ze.tickIncrement=function(t,e,r,a){var i=r?-1:1;if(Zt(e))return ot.increment(t,i*e);var n=e.charAt(0),o=i*Number(e.substr(1));if(n==="M")return ot.incrementMonth(t,o,a);if(n==="L")return Math.log(Math.pow(10,t)+o)/Math.LN10;if(n==="D"){var l=e==="D2"?dT:vT,s=t+i*.01,f=ot.roundUp(ot.mod(s,1),l,r);return Math.floor(s)+Math.log(ea.round(Math.pow(10,f),1))/Math.LN10}throw"unrecognized dtick "+String(e)};ze.tickFirst=function(t,e){var r=t.r2l||Number,a=ot.simpleMap(t.range,r,void 0,void 0,e),i=a[1]<a[0],n=i?Math.floor:Math.ceil,o=gp(a)[0],l=t.dtick,s=r(t.tick0);if(Zt(l)){var f=n((o-s)/l)*l+s;return(t.type==="category"||t.type==="multicategory")&&(f=ot.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=ze.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=ze.tickIncrement(p,m,h<0?!i:i,t.calendar),v++}return ot.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"?dT:vT,b=ot.roundUp(ot.mod(o,1),y,i);return Math.floor(o)+Math.log(ea.round(Math.pow(10,b),1))/Math.LN10}else throw"unrecognized dtick "+String(l)}};ze.tickText=function(t,e,r,a){var i=pT(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&&ot.isArrayOrTypedArray(t.ticktext)){var u=ot.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"?K5(t,i,r,o):l==="log"?Q5(t,i,r,o,d):l==="category"?J5(t,i):l==="multicategory"?e3(t,i,r):_p(t)?r3(t,i,r,o,d):t3(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};ze.hoverLabelText=function(t,e,r){r&&(t=ot.extendFlat({},t,{hoverformat:r}));var a=ot.isArrayOrTypedArray(e)?e[0]:e,i=ot.isArrayOrTypedArray(e)?e[1]:void 0;if(i!==void 0&&i!==a)return ze.hoverLabelText(t,a,r)+" - "+ze.hoverLabelText(t,i,r);var n=t.type==="log"&&a<=0,o=ze.tickText(t,t.c2l(n?-a:a),"hover").text;return n?a===0?"0":un+o:o};function pT(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 K5(t,e,r,a){var i=t._tickround,n=r&&t.hoverformat||ze.getTickFormat(t);a=!n&&a,a&&(Zt(i)?i=4:i={y:"m",m:"d",d:"M",M:"S",S:4}[i]);var o=ot.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=Zl(t),c=t._trueSide||t.side;(!f&&c==="top"||f&&c==="bottom")&&(o+="<br> ")}e.text=o}function Q5(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=ql(Math.pow(10,o),t,i,a);else if(Zt(n)||s==="D"&&ot.mod(o+.01,1)<.1){var f=Math.round(o),c=Math.abs(f),u=t.exponentformat;u==="power"||hc(u)&&bp(f)?(f===0?e.text=1:f===1?e.text="10":e.text="10<sup>"+(f>1?"":un)+c+"</sup>",e.fontSize*=1.25):(u==="e"||u==="E")&&c>2?e.text="1"+u+(f>0?"+":un)+c:(e.text=ql(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,ot.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 J5(t,e){var r=t._categories[Math.round(e.x)];r===void 0&&(r=""),e.text=String(r)}function e3(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 t3(t,e,r,a,i){i==="never"?i="":t.showexponent==="all"&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide"),e.text=ql(e.x,t,i,a)}function r3(t,e,r,a,i){if(t.thetaunit==="radians"&&!r){var n=e.x/180;if(n===0)e.text="0";else{var o=a3(n);if(o[1]>=100)e.text=ql(ot.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=un+e.text)}}}else e.text=ql(e.x,t,i,a)}function a3(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 i3=["f","p","n","μ","m","","k","M","G","T"];function hc(t){return t==="SI"||t==="B"}function bp(t){return t>14||t<-15}function ql(t,e,r,a){var i=t<0,n=e._tickround,o=r||e.exponentformat||"B",l=e._tickexponent,s=ze.getTickFormat(e),f=e.separatethousands;if(a){var c={exponentformat:o,minexponent:e.minexponent,dtick:e.showexponent==="none"?e.dtick:Zt(t)&&Math.abs(t)||1,range:e.showexponent==="none"?e.range.map(e.r2d):[0,t||1]};hT(c),n=(Number(c._tickround)||0)+4,l=c._tickexponent,e.hoverformat&&(s=e.hoverformat)}if(s)return e._numFormat(s)(t).replace(/-/g,un);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=ot.numSeparate(t,e._separators,f)}if(l&&o!=="hide"){hc(o)&&bp(l)&&(o="power");var d;l<0?d=un+-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":hc(o)&&(t+=i3[l/3+5])}return i?un+t:t}ze.getTickFormat=function(t){var e;function r(s){return typeof s!="string"?s:Number(s.replace("M",""))*Lo}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};ze.getSubplots=function(t,e){var r=t._fullLayout._subplots,a=r.cartesian.concat(r.gl2d||[]),i=e?ze.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};ze.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};ze.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=ze.list(t,"x",!0),n=ze.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){ea.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})})}};ze.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"?ze.listIds(t):e,n=ze.list(t),o=n.filter(function(s){return s.autoshift}).map(function(s){return s.overlaying});i.map(function(s){var f=ze.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 ot.syncOrAsync(i.map(function(s){return function(){if(s){var f=ze.getFromId(t,s);r||(r={}),r.axShifts=l,r.overlayingShiftedAx=o;var c=ze.drawOne(t,f,r);return f._shiftPusher&&rh(f,f._fullDepth||0,l,!0),f._r=f.range.slice(),f._rl=ot.simpleMap(f._r,f.r2l),c}}}))};ze.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=ze.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),rh(e,d,a,!0),rh(e,e.shift||0,a,!1)}(r.skipTitle!==!0||e._shift===void 0)&&(e._shift=y3(e,a));var h=v[c+"axislayer"],m=e._mainLinePosition,y=m+=e._shift,b=e._mainMirrorPosition,_=e._vals=ze.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(pe){var ve=f+(pe||"tick");return x[ve]||(x[ve]=s3(e,ve,y)),x[ve]}if(e.visible){var T=ze.makeTransTickFn(e),A=ze.makeTransTickLabelFn(e),M,S,L=e.ticks==="inside",E=e.ticks==="outside";if(e.tickson==="boundaries"){var F=n3(e,_);S=ze.clipEnds(e,F),M=L?S:F}else S=ze.clipEnds(e,_),M=L&&e.ticklabelmode!=="period"?S:_;var N=e._gridVals=S,z=l3(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;ze.drawGrid(t,e,{vals:N,counterAxis:P,layer:l.gridlayer.select("."+f),minorLayer:l.minorGridlayer.select("."+f),path:C,transFn:T}),ze.drawZeroLine(t,e,{counterAxis:P,layer:p?l.zerolinelayerAbove:l.zerolinelayer,path:C,transFn:T})}}}var $,I=ze.getTickSigns(e),j=ze.getTickSigns(e,"minor");if(e.ticks||e.minor&&e.minor.ticks){var G=ze.makeTickPath(e,y,I[2]),X=ze.makeTickPath(e,y,j[2],{minor:!0}),O,q,W,Y;if(e._anchorAxis&&e.mirror&&e.mirror!==!0?(O=ze.makeTickPath(e,b,I[3]),q=ze.makeTickPath(e,b,j[3],{minor:!0}),W=G+O,Y=X+q):(O="",q="",W=G,Y=X),e.showdividers&&E&&e.tickson==="boundaries"){var B={};for(n=0;n<z.length;n++)B[z[n].x]=1;$=function(pe){return B[pe.x]?O:W}}else $=function(pe){return pe.minor?Y:W}}if(ze.drawTicks(t,e,{vals:M,layer:h,path:$,transFn:T}),e.mirror==="allticks"){var Q=Object.keys(e._linepositions||{});for(n=0;n<Q.length;n++){o=Q[n],l=s._plots[o];var ee=e._linepositions[o]||[],fe=ee[0],oe=ee[1],se=ee[2],de=ze.makeTickPath(e,fe,se?I[0]:j[0],{minor:se})+ze.makeTickPath(e,oe,se?I[1]:j[1],{minor:se});ze.drawTicks(t,e,{vals:M,layer:l[c+"axislayer"],path:de,transFn:T})}}var ye=[];if(ye.push(function(){return ze.drawLabels(t,e,{vals:_,layer:h,plotinfo:l,transFn:A,labelFns:ze.makeLabelFns(e,y)})}),e.type==="multicategory"){var _e={x:2,y:10}[c];ye.push(function(){var pe={x:"height",y:"width"}[c],ve=w()[pe]+_e+(e._tickAngles[f+"tick"]?e.tickfont.size*Yl:0);return ze.drawLabels(t,e,{vals:o3(e,_),layer:h,cls:f+"tick2",repositionOnUpdate:!0,secondary:!0,transFn:T,labelFns:ze.makeLabelFns(e,y+ve*I[4])})}),ye.push(function(){return e._depth=I[4]*(w("tick2")[e.side]-y),c3(t,e,{vals:z,layer:h,path:ze.makeTickPath(e,y,I[4],{len:e._depth}),transFn:T})})}else e.title.hasOwnProperty("standoff")&&ye.push(function(){e._depth=I[4]*(w()[e.side]-y)});var Se=Vl.getComponentMethod("rangeslider","isVisible")(e);return!r.skipTitle&&!(Se&&e.side==="bottom")&&ye.push(function(){return u3(t,e)}),ye.push(function(){var pe=e.side.charAt(0),ve=N5[e.side].charAt(0),Me=ze.getPxPosition(t,e),Pe=E?e.ticklen:0,ce,Le,Ce,J;(e.automargin||Se||e._shiftPusher)&&(e.type==="multicategory"?ce=w("tick2"):(ce=w(),c==="x"&&pe==="b"&&(e._depth=Math.max(ce.width>0?ce.bottom-Me:0,Pe))));var xe=0,Z=0;if(e._shiftPusher&&(xe=Math.max(Pe,ce.height>0?pe==="l"?Me-ce.left:ce.right-Me:0),e.title.text!==s._dfltTitle[c]&&(Z=(e._titleStandoff||0)+(e._titleScoot||0),pe==="l"&&(Z+=sg(e))),e._fullDepth=Math.max(xe,Z)),e.automargin){Le={x:0,y:0,r:0,l:0,t:0,b:0};var ke=[0,1],Te=typeof e._shift=="number"?e._shift:0;if(c==="x"){if(pe==="b"?Le[pe]=e._depth:(Le[pe]=e._depth=Math.max(ce.width>0?Me-ce.top:0,Pe),ke.reverse()),ce.width>0){var le=ce.right-(e._offset+e._length);le>0&&(Le.xr=1,Le.r=le);var ie=e._offset-ce.left;ie>0&&(Le.xl=0,Le.l=ie)}}else if(pe==="l"?(e._depth=Math.max(ce.height>0?Me-ce.left:0,Pe),Le[pe]=e._depth-Te):(e._depth=Math.max(ce.height>0?ce.right-Me:0,Pe),Le[pe]=e._depth+Te,ke.reverse()),ce.height>0){var me=ce.bottom-(e._offset+e._length);me>0&&(Le.yb=0,Le.b=me);var he=e._offset-ce.top;he>0&&(Le.yt=1,Le.t=he)}Le[u]=e.anchor==="free"?e.position:e._anchorAxis.domain[ke[0]],e.title.text!==s._dfltTitle[c]&&(Le[pe]+=sg(e)+(e.title.standoff||0)),e.mirror&&e.anchor!=="free"&&(Ce={x:0,y:0,r:0,l:0,t:0,b:0},Ce[ve]=e.linewidth,e.mirror&&e.mirror!==!0&&(Ce[ve]+=Pe),e.mirror===!0||e.mirror==="ticks"?Ce[u]=e._anchorAxis.domain[ke[1]]:(e.mirror==="all"||e.mirror==="allticks")&&(Ce[u]=[e._counterDomainMin,e._counterDomainMax][ke[1]]))}Se&&(J=Vl.getComponentMethod("rangeslider","autoMarginOpts")(t,e)),typeof e.automargin=="string"&&(lg(Le,e.automargin),lg(Ce,e.automargin)),bo.autoMargin(t,xp(e),Le),bo.autoMargin(t,yT(e),Ce),bo.autoMargin(t,gT(e),J)}),ot.syncOrAsync(ye)}};function lg(t,e){if(t){var r=Object.keys(eg).reduce(function(a,i){return e.indexOf(i)!==-1&&eg[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 n3(t,e){var r=[],a,i=function(n,o){var l=n.xbnd[o];l!==null&&r.push(ot.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 o3(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(pT(t,ot.interp(a[o],.5),o));return r}function l3(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(ot.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 s3(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=th(this),f=Br.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=ze.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}}ze.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};ze.makeTransTickFn=function(t){return t._id.charAt(0)==="x"?function(e){return So(t._offset+t.l2p(e.x),0)}:function(e){return So(0,t._offset+t.l2p(e.x))}};ze.makeTransTickLabelFn=function(t){var e=f3(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 So(i+t._offset+t.l2p(eh(v))+r,n+a)}:function(v){return So(n+a,i+t._offset+t.l2p(eh(v))+r)}};function eh(t){return t.periodX!==void 0?t.periodX:t.x}function f3(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=dc,p=t.tickfont?t.tickfont.size:12;return(l||i)&&(u+=p*vn,v+=(t.linewidth||0)/2),(n||o)&&(u+=(t.linewidth||0)/2,v+=dc),s&&c==="top"&&(v-=p*(1-vn)),(n||i)&&(u=-u),(c==="bottom"||c==="right")&&(v=-v),[f?u:0,s?v:0]}ze.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};ze.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=ot.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=vn: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!Zt(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=vn:g=.5),u){var L=Zt(M)?+M:0;if(L!==0){var E=ot.deg2rad(L);w=Math.abs(Math.sin(E))*vn*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 Zt(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 ou(t){return[t.text,t.x,t.axInfo,t.font,t.fontSize,t.fontColor].join("_")}ze.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,ou);n.exit().remove(),n.enter().append("path").classed(a,1).classed("ticks",1).classed("crisp",r.crisp!==!1).each(function(o){return Wl.stroke(ea.select(this),o.minor?e.minor.tickcolor:e.tickcolor)}).style("stroke-width",function(o){return Br.crispRound(t,o.minor?e.minor.tickwidth:e.tickwidth,1)+"px"}).attr("d",r.path).style("display",null),lu(e,[fT]),n.attr("transform",r.transFn)};ze.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&&ze.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=Br.crispRound(t,e.gridwidth,1);for(var u=i?Br.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,ou);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 Wl.stroke(ea.select(this),y.minor?e.minor.gridcolor:e.gridcolor||"#ddd")}).style("stroke-dasharray",function(y){return Br.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)}}lu(e,[Qd,Jd])}};ze.drawZeroLine=function(t,e,r){r=r||r;var a=e._id+"zl",i=ze.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 O5(o.id,l.id)})}),n.attr("transform",r.transFn).attr("d",r.path).call(Wl.stroke,e.zerolinecolor||Wl.defaultLine).style("stroke-width",Br.crispRound(t,e.zerolinewidth,e._gw||1)+"px").style("display",null),lu(e,[Kd])};ze.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:[],ou),v=[];u.enter().append("g").classed(o,1).append("text").attr("text-anchor","middle").each(function(k){var C=ea.select(this),$=t._promises.length;C.call(rn.positionText,s.xFn(k),s.yFn(k)).call(Br.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(rn.convertToTspans,t),t._promises[$]?v.push(t._promises.pop().then(function(){p(C,f)})):p(C,f)}),lu(e,[Jy]),u.exit().remove(),r.repositionOnUpdate&&u.each(function(k){ea.select(this).select("text").call(rn.positionText,s.xFn(k),s.yFn(k))});function p(k,C){k.each(function($){var I=ea.select(this),j=I.select(".text-math-group"),G=s.anchorFn($,C),X=r.transFn.call(I.node(),$)+(Zt(C)&&+C!=0?" rotate("+C+","+s.xFn($)+","+(s.yFn($)-$.fontSize/2)+")":""),O=rn.lineCount(I),q=Yl*$.fontSize,W=s.heightFn($,Zt(C)?+C:0,(O-1)*q);if(W&&(X+=So(0,W)),j.empty()){var Y=I.select("text");Y.attr({transform:X,"text-anchor":G}),Y.style("opacity",1),e._adjustTickLabelsOverflow&&e._adjustTickLabelsOverflow()}else{var B=Br.bBox(j.node()).width,Q=B*{end:-.5,start:.5}[G];j.attr("transform",X+So(Q,0))}})}e._adjustTickLabelsOverflow=function(){var k=e.ticklabeloverflow;if(!(!k||k==="allow")){var C=k.indexOf("hide")!==-1,$=e._id.charAt(0)==="x",I=0,j=$?t._fullLayout.width:t._fullLayout.height;if(k.indexOf("domain")!==-1){var G=ot.simpleMap(e.range,e.r2l);I=e.l2p(G[0])+e._offset,j=e.l2p(G[1])+e._offset}var X=Math.min(I,j),O=Math.max(I,j),q=e.side,W=1/0,Y=-1/0;u.each(function(fe){var oe=ea.select(this),se=oe.select(".text-math-group");if(se.empty()){var de=Br.bBox(oe.node()),ye=0;$?(de.right>O||de.left<X)&&(ye=1):(de.bottom>O||de.top+(e.tickangle?0:fe.fontSize/4)<X)&&(ye=1);var _e=oe.select("text");ye?C&&_e.style("opacity",0):(_e.style("opacity",1),q==="bottom"||q==="right"?W=Math.min(W,$?de.top:de.left):W=-1/0,q==="top"||q==="left"?Y=Math.max(Y,$?de.bottom:de.right):Y=1/0)}});for(var B in a._plots){var Q=a._plots[B];if(!(e._id!==Q.xaxis._id&&e._id!==Q.yaxis._id)){var ee=$?Q.yaxis:Q.xaxis;ee&&(ee["_visibleLabelMin_"+e._id]=W,ee["_visibleLabelMax_"+e._id]=Y)}}}},e._hideCounterAxisInsideTickLabels=function(k){var C=e._id.charAt(0)==="x",$=[];for(var I in a._plots){var j=a._plots[I];e._id!==j.xaxis._id&&e._id!==j.yaxis._id||$.push(C?j.yaxis:j.xaxis)}$.forEach(function(G,X){G&&Zl(G)&&(k||[Kd,Jd,Qd,fT,Jy]).forEach(function(O){var q=O.K==="tick"&&O.L==="text"&&e.ticklabelmode==="period",W=a._plots[e._mainSubplot],Y;if(O.K===Kd.K){var B=n?W.zerolinelayerAbove:W.zerolinelayer;Y=B.selectAll("."+e._id+"zl")}else O.K===Jd.K?Y=W.minorGridlayer.selectAll("."+e._id):O.K===Qd.K?Y=W.gridlayer.selectAll("."+e._id):Y=W[e._id.charAt(0)+"axislayer"];Y.each(function(){var Q=ea.select(this);O.L&&(Q=Q.selectAll(O.L)),Q.each(function(ee){var fe=e.l2p(q?eh(ee):ee.x)+e._offset,oe=ea.select(this);fe<e["_visibleLabelMax_"+G._id]&&fe>e["_visibleLabelMin_"+G._id]?oe.style("display","none"):O.K==="tick"&&!X&&oe.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=[],$,I=1;u.each(function(Le){k=Math.max(k,Le.fontSize);var Ce=e.l2p(Le.x),J=th(this),xe=Br.bBox(J.node());I=Math.max(I,rn.lineCount(J)),C.push({top:0,bottom:10,height:10,left:Ce-xe.width/2,right:Ce+xe.width/2+2,width:xe.width+2})});var j=(e.tickson==="boundaries"||e.showdividers)&&!r.secondary,G=l.length,X=Math.abs((l[G-1].x-l[0].x)*e._m)/(G-1),O=j?X/2:X,q=j?e.ticklen:k*1.25*I,W=Math.sqrt(Math.pow(O,2)+Math.pow(q,2)),Y=O/W,B=e.autotickangles.map(function(Le){return Le*Math.PI/180}),Q=B.find(function(Le){return Math.abs(Math.cos(Le))<=Y});Q===void 0&&(Q=B.reduce(function(Le,Ce){return Math.abs(Math.cos(Le))<Math.abs(Math.cos(Ce))?Le:Ce},B[0]));var ee=Q*(180/Math.PI);if(j){var fe=2;for(e.ticks&&(fe+=e.tickwidth/2),$=0;$<C.length;$++){var oe=l[$].xbnd,se=C[$];if(oe[0]!==null&&se.left-e.l2p(oe[0])<fe||oe[1]!==null&&e.l2p(oe[1])-se.right<fe){h=ee;break}}}else{var de=e.ticklabelposition||"",ye=e.tickson||"",_e=function(Le){return de.indexOf(Le)!==-1},Se=_e("top"),pe=_e("left"),ve=_e("right"),Me=_e("bottom"),Pe=ye!=="boundaries"&&(Me||pe||Se||ve),ce=Pe?(e.tickwidth||0)+2*dc:0;for($=0;$<C.length-1;$++)if(ot.bBoxIntersect(C[$],C[$+1],ce)){h=ee;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?Zt(f)?f:0:h});var b=function(){var k=0,C=0;return u.each(function($,I){var j=th(this),G=j.select(".text-math-group");if(G.empty()){var X;e._vals[I]&&(X=e._vals[I].bb||Br.bBox(j.node()),e._vals[I].bb=X),k=Math.max(k,X.width),C=Math.max(C,X.height)}}),{labelsMaxW:k,labelsMaxH:C}},_=e._anchorAxis;if(_&&(_.autorange||_.insiderange)&&Zl(e)&&!j5(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*dc,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=ot.syncOrAsync(y);return P&&P.then&&t._promises.push(P),P};function c3(t,e,r){var a=e._id+"divider",i=r.vals,n=r.layer.selectAll("path."+a).data(i,ou);n.exit().remove(),n.enter().insert("path",":first-child").classed(a,1).classed("crisp",1).call(Wl.stroke,e.dividercolor).style("stroke-width",Br.crispRound(t,e.dividerwidth,1)+"px"),n.attr("transform",r.transFn).attr("d",r.path)}ze.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 sg(t){var e=t.title.font.size,r=(t.title.text.match(rn.BR_TAG_ALL)||[]).length;return t.title.hasOwnProperty("standoff")?e*(vn+r*Yl):r?e*(r+1)*Yl:e}function u3(t,e){var r=t._fullLayout,a=e._id,i=a.charAt(0),n=e.title.font.size,o,l=(e.title.text.match(rn.BR_TAG_ALL)||[]).length;if(e.title.hasOwnProperty("standoff"))e.side==="bottom"||e.side==="right"?o=e._depth+e.title.standoff+n*vn:(e.side==="top"||e.side==="left")&&(o=e._depth+e.title.standoff+n*(Cl+l*Yl));else{var s=Zl(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=ze.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=Br.getTranslate(h.node().parentNode);d.offsetLeft=m.x,d.offsetTop=m.y}e.title.hasOwnProperty("standoff")&&(d.pad=0)}return e._titleStandoff=o,$5.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"}})}ze.shouldShowZeroLine=function(t,e,r){var a=ot.simpleMap(e.range,e.r2l);return a[0]*a[1]<=0&&e.zeroline&&(e.type==="linear"||e.type==="-")&&!(e.rangebreaks&&e.maskBreaks(0)===iu)&&(mT(e,0)||!v3(t,e,r,a)||d3(t,e))};ze.clipEnds=function(t,e){return e.filter(function(r){return mT(t,r.x)})};function mT(t,e){var r=t.l2p(e);return r>1&&r<t._length-1}function v3(t,e,r,a){var i=r._mainAxis;if(!i)return;var n=t._fullLayout,o=e._id.charAt(0),l=ze.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=ze.list(t,l),v=0;v<u.length;v++){var p=u[v];if(p._mainAxis===i&&f(p))return!0}}function d3(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&&(Vl.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 th(t){var e=ea.select(t),r=e.select(".text-math-group");return r.empty()?e.select("text"):r}ze.allowAutoMargin=function(t){for(var e=ze.list(t,"",!0),r=0;r<e.length;r++){var a=e[r];a.automargin&&(bo.allowAutoMargin(t,xp(a)),a.mirror&&bo.allowAutoMargin(t,yT(a))),Vl.getComponentMethod("rangeslider","isVisible")(a)&&bo.allowAutoMargin(t,gT(a))}};function xp(t){return t._id+".automargin"}function yT(t){return xp(t)+".mirror"}function gT(t){return t._id+".rangeslider"}ze.swap=function(t,e){for(var r=h3(t,e),a=0;a<r.length;a++)p3(t,r[a].x,r[a].y)};function h3(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]],qs(s.x,f.x),qs(s.y,f.y);qs(s.x,[o]),qs(s.y,[l])}}return r}function qs(t,e){for(var r=0;r<e.length;r++)t.indexOf(e[r])===-1&&t.push(e[r])}function p3(t,e,r){var a=[],i=[],n=t.layout,o,l;for(o=0;o<e.length;o++)a.push(ze.getFromId(t,e[o]));for(o=0;o<r.length;o++)i.push(ze.getFromId(t,r[o]));var s=Object.keys(P5),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"),m3(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&&ot.swapAttrs(n.annotations[o],["?"])}}function m3(t,e,r,a,i){var n=ot.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 _p(t){return t._id==="angularaxis"}function av(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 Zl(t){return(t.ticklabelposition||"").indexOf("inside")!==-1}function lu(t,e){Zl(t._anchorAxis||{})&&t._hideCounterAxisInsideTickLabels&&t._hideCounterAxisInsideTickLabels(e)}function rh(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 y3(t,e){return t.autoshift?e[t.overlaying][t.side]:t.shift||0}function g3(t,e){return/%f/.test(e)?t>=F5:/%L/.test(e)?t>=I5:/%[SX]/.test(e)?t>=vc:/%M/.test(e)?t>=Xl:/%[HI]/.test(e)?t>=Fa:/%p/.test(e)?t>=Ti:/%[Aadejuwx]/.test(e)?t>=wr:/%[UVW]/.test(e)?t>=Gr:/%[Bbm]/.test(e)?t>=uc:/%[q]/.test(e)?t>=cc:/%[Yy]/.test(e)?t>=fc:!0}var Ct=kw.exports,b3=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")},x3=b3,bT=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&&(x3(a,c,l),(o==="linear"||o==="-")&&a("rangemode")),r.cleanRange()},wp={},xT={exports:{}},_3=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},fg=be,w3=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]],T3=function(e,r,a,i){return a==="left"?e=0:a==="center"?e=1:a==="right"?e=2:e=fg.constrain(Math.floor(e*3),0,2),i==="bottom"?r=0:i==="middle"?r=1:i==="top"?r=2:r=fg.constrain(Math.floor(r*3),0,2),w3[r][e]},_T={exports:{}},k3=ps,A3=Kc,M3=Wc.getGraphDiv,S3=jc,ah=_T.exports={};ah.wrapped=function(t,e,r){t=M3(t),t._fullLayout&&A3.clear(t._fullLayout._uid+S3.HOVERID),ah.raw(t,e,r)};ah.raw=function(e,r){var a=e._fullLayout,i=e._hoverdata;r||(r={}),!(r.target&&!e._dragged&&k3.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 L3=_T.exports,C3=tS,iv=c_,D3=u_,$3=be.removeElement,P3=gr,yn=xT.exports={};yn.align=_3;yn.getCursor=T3;var wT=L3;yn.unhover=wT.wrapped;yn.unhoverRaw=wT.raw;yn.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,D3?(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=cg(_);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),iv&&!p?(c=TT(),c.style.cursor=window.getComputedStyle(n).cursor):iv||(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=cg(_),x=e.minDrag||P3.MINDRAG,w=h(g[0]-o,g[1]-l,x),T=w[0],A=w[1];(T||A)&&(r._dragged=!0,yn.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),iv?$3(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 TT(){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}yn.coverSlip=TT;function cg(t){return C3(t.changedTouches?t.changedTouches[0]:t,document.body)}var Ba=xT.exports,su={},$i=function(e,r){(e.attr("class")||"").split(" ").forEach(function(a){a.indexOf("cursor-")===0&&e.classed(a,!1)}),r&&e.classed("cursor-"+r,!0)},nv=$i,sl="data-savedcursor",ug="!!",E3=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,ug)}nv(e,r)}else a&&(e.attr(sl,null),a===ug?nv(e):nv(e,a))},ov=fr,z3=Tr,kT={_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:z3.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:ov({editType:"legend",description:"Sets the font used to text the legend items."}),grouptitlefont:ov({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:ov({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"},Xo={};Xo.isGrouped=function(e){return(e.traceorder||"").indexOf("grouped")!==-1};Xo.isVertical=function(e){return e.orientation!=="h"};Xo.isReversed=function(e){return(e.traceorder||"").indexOf("reversed")!==-1};var lv=Je,jr=be,R3=Lt,I3=la,F3=kT,N3=hs,sv=Xo;function H3(t,e,r,a){var i=e[t]||{},n=R3.newContainer(r,t);function o(D,P){return jr.coerce(i,n,F3,D,P)}var l=jr.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 jr.coerce(k,C,I3,D,P)},u=r.font||{},v=jr.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,(!_&&lv.traceIs(f,"pie-like")||f._input.showlegend===!0)&&p++),jr.coerceFont(c,"legendgrouptitle.font",v)),(!_&&lv.traceIs(f,"bar")&&r.barmode==="stack"||["tonextx","tonexty"].indexOf(f.fill)!==-1)&&(h=sv.isGrouped({traceorder:h})?"grouped+reversed":"reversed"),f.legendgroup!==void 0&&f.legendgroup!==""&&(h=sv.isReversed({traceorder:h})?"reversed+grouped":"grouped")}var g=jr.coerce(e,r,N3,"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,lv.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")),jr.coerce(i,n,{x:{valType:"number",editType:"legend",min:S?-2:0,max:S?3:1,dflt:L}},"x"),jr.coerce(i,n,{y:{valType:"number",editType:"legend",min:M?-2:0,max:M?3:1,dflt:E}},"y"),o("traceorder",h),sv.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"),jr.noneOrAll(i,n,["x","y"]);var z=o("title.text");if(z){o("title.side",A?"left":"top");var H=jr.extendFlat({},l,{size:jr.bigFont(l.size)});jr.coerceFont(o,"title.font",H)}}}}var AT=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++)jr.pushUnique(f,n[i].legend);for(r._legends=[],i=0;i<f.length;i++){var c=f[i];H3(c,e,r,n),r[c]&&r[c].visible&&(r[c]._id=c),r._legends.push(c)}},Hn=Je,ih=be,O3=ih.pushUnique,fv=!0,j3=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"&&fv&&r.data&&r._context.showTips&&ih.notifier(ih._(r,"Double-click on legend to isolate one trace"),"long"),fv=!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(ve){return ve.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(ve,Me){var Pe=A.indexOf(ve),ce=T.visible;return ce||(ce=T.visible=[]),A.indexOf(ve)===-1&&(A.push(ve),Pe=A.length-1),ce[Pe]=Me,Pe}var E=(i.shapes||[]).map(function(ve){return ve._input}),F=!1;function N(ve,Me){E[ve].visible=Me,F=!0}function z(ve,Me){if(!(u.groupTitle&&!f)){var Pe=ve._fullInput||ve,ce=Pe._isShape,Le=Pe.index;Le===void 0&&(Le=Pe._index);var Ce=Pe.visible===!1?!1:Me;ce?N(Le,Ce):L(Le,Ce)}}var H=h.legend,D=h._fullInput,P=D&&D._isShape;if(!P&&Hn.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,I=[];for(y=0;y<r.calcdata.length;y++){var j=r.calcdata[y];for(b=0;b<j.length;b++){var G=j[b],X=G.label;H===j[0].trace.legend&&k!==X&&(c.indexOf(X)===-1&&($=!0),O3(c,X),I.push(X))}}if(!$)for(var O=0;O<I.length;O++){var q=c.indexOf(I[O]);q!==-1&&c.splice(q,1)}}Hn.call("_guiRelayout",r,"hiddenlabels",c)}else{var W=m&&m.length,Y=[],B;if(W)for(y=0;y<d.length;y++)B=d[y],B.visible&&B.legendgroup===m&&Y.push(y);if(s==="toggle"){var Q;switch(h.visible){case!0:Q="legendonly";break;case!1:Q=!1;break;case"legendonly":Q=!0;break}if(W)if(f)for(y=0;y<d.length;y++){var ee=d[y];ee.visible!==!1&&ee.legendgroup===m&&z(ee,Q)}else z(h,Q);else z(h,Q)}else if(s==="toggleothers"){var fe,oe,se,de,ye,_e=!0;for(y=0;y<d.length;y++)if(ye=d[y],fe=ye===h,se=ye.showlegend!==!0,!(fe||se)&&(oe=W&&ye.legendgroup===m,!oe&&ye.legend===H&&ye.visible===!0&&!Hn.traceIs(ye,"notLegendIsolatable"))){_e=!1;break}for(y=0;y<d.length;y++)if(ye=d[y],!(ye.visible===!1||ye.legend!==H)&&!Hn.traceIs(ye,"notLegendIsolatable"))switch(h.visible){case"legendonly":z(ye,!0);break;case!0:de=_e?!0:"legendonly",fe=ye===h,se=ye.showlegend!==!0&&!ye.legendgroup,oe=fe||W&&ye.legendgroup===m,z(ye,oe||se?!0:de);break}}for(y=0;y<M.length;y++)if(_=M[y],!!_){var Se=_.constructUpdate(),pe=Object.keys(Se);for(b=0;b<pe.length;b++)g=pe[b],w=T[g]=T[g]||[],w[S[y]]=Se[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?Hn.call("_guiUpdate",r,T,{shapes:E},A):Hn.call("_guiRestyle",r,T,A)}},MT={scrollBarWidth:6,scrollBarMinHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4,scrollBarEnterAttrs:{rx:20,ry:3,width:0,height:0},titlePad:2,itemGap:5},vg=Je,cv=Xo,B3=function(e,r,a){var i=r._inHover,n=cv.isGrouped(r),o=cv.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===""||!cv.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(vg.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(vg.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},Cn={};(function(t){var e=be;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}})(Cn);var G3=kt,U3=ct,V3=function(e,r,a,i){var n=a.marker.pattern;n&&n.shape?G3.pointStyle(e,a,i,r):U3.fill(e,r.color)},dg=ct,hg=Cn.castOption,W3=V3,Tp=function(e,r,a,i){var n=a.marker.line,o=hg(n.color,r.pts)||dg.defaultLine,l=hg(n.width,r.pts)||0;e.call(W3,r,a,i).style("stroke-width",l).call(dg.stroke,o)},br=ut,uv=Je,mr=be,pg=mr.strTranslate,Hr=kt,qr=ct,vv=Ma.extractOpts,pc=kr,X3=Tp,Y3=Cn.castOption,q3=MT,mg=12,yg=5,Ui=2,Z3=10,On=5,ST=function(e,r,a){var i=r._fullLayout;a||(a=i.legend);var n=a.itemsizing==="constant",o=a.itemwidth,l=(o+q3.itemGap*2)/2,s=pg(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=br.select(this),M=mr.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",pg(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=gg(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=vv(H),C=k.colorscale,$=k.reversescale,I=function(Y){if(Y.size())if(M)Hr.fillGroupStyle(Y,r,!0);else{var B="legendfill-"+H.uid;Hr.gradient(Y,r,B,dv($),C,"fill")}},j=function(Y){if(Y.size()){var B="legendline-"+H.uid;Hr.lineGroupStyle(Y),Hr.gradient(Y,r,B,dv($),C,"stroke")}},G=pc.hasMarkers(H)||!F?"M5,0":N?"M5,-2":"M5,-3",X=br.select(this),O=X.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(I),S||L){var q=f(void 0,H.line,Z3,yg);P=mr.minExtend(H,{line:{width:q}}),D=[mr.minExtend(z,{trace:P})]}var W=X.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?Hr.lineGroupStyle:j)}function u(T){var A=gg(T),M=A.anyFill,S=A.anyLine,L=A.showLine,E=A.showMarker,F=T[0],N=F.trace,z=!E&&!S&&!M&&pc.hasText(N),H,D;function P(O,q,W,Y){var B=mr.nestedProperty(N,O).get(),Q=mr.isArrayOrTypedArray(B)&&q?q(B):B;if(n&&Q&&Y!==void 0&&(Q=Y),W){if(Q<W[0])return W[0];if(Q>W[1])return W[1]}return Q}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",mr.mean,[.2,1]),C.mlc=P("marker.line.color",k),C.mlw=P("marker.line.width",mr.mean,[0,5],Ui),$.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var I=P("marker.size",mr.mean,[2,16],mg);C.ms=I,$.marker.size=I}L&&($.line={width:P("line.width",k,[0,10],yg)}),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=[mr.minExtend(F,C)],D=mr.minExtend(N,$),D.selectedpoints=null,D.texttemplate=null}var j=br.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(Hr.pointStyle,D,r),E&&(H[0].mrc=3);var X=j.selectAll("g.pointtext").data(z?H:[]);X.enter().append("g").classed("pointtext",!0).append("text").attr("transform",s),X.exit().remove(),X.selectAll("text").call(Hr.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=br.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=br.select(this),z=A[F[0]].marker,H=f(void 0,z.line,On,Ui);N.attr("d",F[1]).style("stroke-width",H+"px").call(qr.fill,z.color),H&&N.call(qr.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:uv.traceIs(S,"bar"),z=br.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=br.select(this),P=H[0],k=f(P.mlw,L.line,On,Ui);D.style("stroke-width",k+"px");var C=P.mcc;if(!a._inHover&&"mc"in P){var $=vv(L),I=$.mid;I===void 0&&(I=($.max+$.min)/2),C=Hr.tryColorscale(L,"")(I)}var j=C||P.mc||L.color,G=L.pattern,X=Hr.getPatternAttr,O=G&&(X(G.shape,0,"")||X(G.path,0,""));if(O){var q=X(G.bgcolor,0,null),W=X(G.fgcolor,0,null),Y=G.fgopacity,B=bg(G.size,8,10),Q=bg(G.solidity,.5,1),ee="legend-"+S.uid;D.call(Hr.pattern,"legend",r,ee,O,B,Q,C,G.fillmode,q,W,Y)}else D.call(qr.fill,j);k&&qr.stroke(D,P.mlc||E.color)})}function m(T){var A=T[0].trace,M=br.select(this).select("g.legendpoints").selectAll("path.legendbox").data(A.visible&&uv.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=br.select(this);if((A.boxpoints==="all"||A.points==="all")&&qr.opacity(A.fillcolor)===0&&qr.opacity((A.line||{}).color)===0){var L=mr.minExtend(A,{marker:{size:n?mg:mr.constrain(A.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});M.call(Hr.pointStyle,L,r)}else{var E=f(void 0,A.line,On,Ui);S.style("stroke-width",E+"px").call(qr.fill,A.fillcolor),E&&qr.stroke(S,A.line.color)}})}function y(T){var A=T[0].trace,M=br.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=br.select(this),F=A[L?"increasing":"decreasing"],N=f(void 0,F.line,On,Ui);E.style("stroke-width",N+"px").call(qr.fill,F.fillcolor),N&&qr.stroke(E,F.line.color)})}function b(T){var A=T[0].trace,M=br.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=br.select(this),F=A[L?"increasing":"decreasing"],N=f(void 0,F.line,On,Ui);E.style("fill","none").call(Hr.dashLine,F.line.dash,N),N&&qr.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:uv.traceIs(L,M),F=br.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(Y3(N.line.width,S.pts),N.line,On,Ui),H="pieLike",D=mr.minExtend(L,{marker:{line:{width:z}}},H),P=mr.minExtend(S,{trace:D},H);X3(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=br.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=br.select(this),z=vv(A),H=z.colorscale,D=z.reversescale,P=function(I){if(I.size()){var j="legendfill-"+A.uid;Hr.gradient(I,r,j,dv(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=mr.isArrayOrTypedArray(C)?C[F]||C[0]:C}N.attr("d",E[0]),k?N.call(qr.fill,k):N.call(P)})}};function dv(t,e){var r=e?"radial":"horizontal";return r+(t?"":"reversed")}function gg(t){var e=t[0].trace,r=e.contours,a=pc.hasLines(e),i=pc.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 bg(t,e,r){return t&&mr.isArrayOrTypedArray(t)?e:t>r?r:t}var $r=ut,Yt=be,nh=Kt,xo=Je,xg=ps,hv=Ba,qt=kt,Of=ct,dn=or,_g=j3,er=MT,kp=Sr,LT=kp.LINE_SPACING,vo=kp.FROM_TL,wg=kp.FROM_BR,Tg=B3,K3=ST,kg=Xo,no=1,Q3=/^legend[0-9]*$/,CT=function(e,r){if(r)Ag(e,r);else{var a=e._fullLayout,i=a._legends,n=a._infolayer.selectAll('[class^="legend"]');n.each(function(){var f=$r.select(this),c=f.attr("class"),u=c.split(" ")[0];u.match(Q3)&&i.indexOf(u)===-1&&f.remove()});for(var o=0;o<i.length;o++){var l=i[o],s=e._fullLayout[l];Ag(e,s)}}};function J3(t,e,r){if(!(e.title.side!=="top center"&&e.title.side!=="top right")){var a=e.title.font,i=a.size*LT,n=0,o=t.node(),l=qt.bBox(o).width;e.title.side==="top center"?n=.5*(e._width-2*r-2*er.titlePad-l):e.title.side==="top right"&&(n=e._width-2*r-2*er.titlePad-l),dn.positionText(t,r+er.titlePad+n,r+i)}}function Ag(t,e){var r=e||{},a=t._fullLayout,i=fu(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=Tg(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&&Tg(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(),nh.autoMargin(t,i);var h=Yt.ensureSingle(o,"g",i,function(A){l||A.attr("pointer-events","all")}),m=Yt.ensureSingleById(a._topdefs,"clipPath",n,function(A){A.append("rect")}),y=Yt.ensureSingle(h,"rect","bg",function(A){A.attr("shape-rendering","crispEdges")});y.call(Of.stroke,r.bordercolor).call(Of.fill,r.bgcolor).style("stroke-width",r.borderwidth+"px");var b=Yt.ensureSingle(h,"g","scrollbox"),_=r.title;r._titleWidth=0,r._titleHeight=0;var g;_.text?(g=Yt.ensureSingle(b,"text",i+"titletext"),g.attr("text-anchor","start").call(qt.font,_.font).text(_.text),jf(g,b,t,r,no)):b.selectAll("."+i+"titletext").remove();var x=Yt.ensureSingle(h,"rect","scrollbar",function(A){A.attr(er.scrollBarEnterAttrs).call(Of.fill,er.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(Yt.identity);T.enter().append("g").attr("class","traces"),T.exit().remove(),T.style("opacity",function(A){var M=A[0].trace;return xo.traceIs(M,"pie-like")?d.indexOf(A[0].label)!==-1?.5:1:M.visible==="legendonly"?.5:1}).each(function(){$r.select(this).call(e$,t,r)}).call(K3,t,r).each(function(){l||$r.select(this).call(t$,t,i)}),Yt.syncOrAsync([nh.previousPromises,function(){return i$(t,w,T,r)},function(){var A=a._size,M=r.borderwidth,S=r.xref==="paper",L=r.yref==="paper";if(_.text&&J3(g,r,M),!l){var E,F;S?E=A.l+A.w*r.x-vo[mc(r)]*r._width:E=a.width*r.x-vo[mc(r)]*r._width,L?F=A.t+A.h*(1-r.y)-vo[yc(r)]*r._effHeight:F=a.height*(1-r.y)-vo[yc(r)]*r._effHeight;var N=n$(t,i,E,F);if(N)return;if(a.margin.autoexpand){var z=E,H=F;E=S?Yt.constrain(E,0,a.width-r._width):z,F=L?Yt.constrain(F,0,a.height-r._effHeight):H,E!==z&&Yt.log("Constrain "+i+".x to make legend fit inside graph"),F!==H&&Yt.log("Constrain "+i+".y to make legend fit inside graph")}qt.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}),qt.setTranslate(b,0,0),m.select("rect").attr({width:r._width-2*M,height:D-2*M,x:M,y:M}),qt.setClipUrl(b,n,t),qt.setRect(x,0,0,0,0),delete r._scrollY}else{var P=Math.max(er.scrollBarMinHeight,r._effHeight*r._effHeight/r._height),k=r._effHeight-P-2*er.scrollBarMargin,C=r._height-r._effHeight,$=k/C,I=Math.min(r._scrollY||0,C);y.attr({width:r._width-2*M+er.scrollBarWidth+er.scrollBarMargin,height:r._effHeight-M,x:M/2,y:M/2}),m.select("rect").attr({width:r._width-2*M+er.scrollBarWidth+er.scrollBarMargin,height:r._effHeight-2*M,x:M,y:M+I}),qt.setClipUrl(b,n,t),B(I,P,$),h.on("wheel",function(){I=Yt.constrain(r._scrollY+$r.event.deltaY/k*C,0,C),B(I,P,$),I!==0&&I!==C&&$r.event.preventDefault()});var j,G,X,O=function(se,de,ye){var _e=(ye-de)/$+se;return Yt.constrain(_e,0,C)},q=function(se,de,ye){var _e=(de-ye)/$+se;return Yt.constrain(_e,0,C)},W=$r.behavior.drag().on("dragstart",function(){var se=$r.event.sourceEvent;se.type==="touchstart"?j=se.changedTouches[0].clientY:j=se.clientY,X=I}).on("drag",function(){var se=$r.event.sourceEvent;se.buttons===2||se.ctrlKey||(se.type==="touchmove"?G=se.changedTouches[0].clientY:G=se.clientY,I=O(X,j,G),B(I,P,$))});x.call(W);var Y=$r.behavior.drag().on("dragstart",function(){var se=$r.event.sourceEvent;se.type==="touchstart"&&(j=se.changedTouches[0].clientY,X=I)}).on("drag",function(){var se=$r.event.sourceEvent;se.type==="touchmove"&&(G=se.changedTouches[0].clientY,I=q(X,j,G),B(I,P,$))});b.call(Y)}function B(se,de,ye){r._scrollY=t._fullLayout[i]._scrollY=se,qt.setTranslate(b,0,-se),qt.setRect(x,r._width,er.scrollBarMargin+se*ye,er.scrollBarWidth,de),m.select("rect").attr("y",M+se)}if(t._context.edits.legendPosition){var Q,ee,fe,oe;h.classed("cursor-move",!0),hv.init({element:h.node(),gd:t,prepFn:function(se){if(se.target!==x.node()){var de=qt.getTranslate(h);fe=de.x,oe=de.y}},moveFn:function(se,de){if(fe!==void 0&&oe!==void 0){var ye=fe+se,_e=oe+de;qt.setTranslate(h,ye,_e),Q=hv.align(ye,r._width,A.l,A.l+A.w,r.xanchor),ee=hv.align(_e+r._height,-r._height,A.t+A.h,A.t,r.yanchor)}},doneFn:function(){if(Q!==void 0&&ee!==void 0){var se={};se[i+".x"]=Q,se[i+".y"]=ee,xo.call("_guiRelayout",t,se)}},clickFn:function(se,de){var ye=o.selectAll("g.traces").filter(function(){var _e=this.getBoundingClientRect();return de.clientX>=_e.left&&de.clientX<=_e.right&&de.clientY>=_e.top&&de.clientY<=_e.bottom});ye.size()>0&&DT(t,h,ye,se,de)}})}}],t)}}function Zs(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 DT(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),xo.traceIs(n,"pie-like")&&(o.label=r.datum()[0].label);var l=xg.triggerHandler(t,"plotly_legendclick",o);if(a===1){if(l===!1)return;e._clickTimeout=setTimeout(function(){t._fullLayout&&_g(r,t,a)},t._context.doubleClickDelay)}else if(a===2){e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0;var s=xg.triggerHandler(t,"plotly_legenddoubleclick",o);s!==!1&&l!==!1&&_g(r,t,a)}}function e$(t,e,r){var a=fu(r),i=t.data()[0][0],n=i.trace,o=xo.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=Yt.templateString(f,n._meta))));var u=Yt.ensureSingle(t,"text",a+"text");u.attr("text-anchor","start").call(qt.font,c).text(l?Mg(f,s):f);var v=r.indentation+r.itemwidth+er.itemGap*2;dn.positionText(u,v,0),l?u.call(dn.makeEditable,{gd:e,text:f}).call(jf,t,e,r).on("edit",function(p){this.text(Mg(p,s)).call(jf,t,e,r);var d=i.trace._fullInput||{},h={};return h.name=p,d._isShape?xo.call("_guiRelayout",e,"shapes["+n.index+"].name",h.name):xo.call("_guiRestyle",e,h,n.index)}):jf(u,t,e,r)}function Mg(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 t$(t,e,r){var a=e._context.doubleClickDelay,i,n=1,o=Yt.ensureSingle(t,"rect",r+"toggle",function(l){e._context.staticPlot||l.style("cursor","pointer").attr("pointer-events","all"),l.call(Of.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)),DT(e,l,t,n,$r.event)}}))}function jf(t,e,r,a,i){a._inHover&&t.attr("data-notex",!0),dn.convertToTspans(t,r,function(){r$(e,r,a,i)})}function r$(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=fu(r);r||(r=e._fullLayout[l]);var s=r.borderwidth,f;a===no?f=r.title.font:i.groupTitle?f=i.groupTitle.font:f=r.font;var c=f.size*LT,u,v;if(o){var p=qt.bBox(o);u=p.height,v=p.width,a===no?qt.setTranslate(n,s,s+u*.75):qt.setTranslate(n,0,u*.25)}else{var d="."+l+(a===no?"title":"")+"text",h=t.select(d),m=dn.lineCount(h),y=h.node();if(u=c*m,v=y?qt.bBox(y).width:0,a===no)r.title.side==="left"&&(v+=er.itemGap*2),dn.positionText(h,s+er.titlePad,s+c);else{var b=er.itemGap*2+r.indentation+r.itemwidth;i.groupTitle&&(b=er.itemGap,v-=r.indentation+r.itemwidth),dn.positionText(h,b,-c*((m-1)/2-.3))}}a===no?(r._titleWidth=v,r._titleHeight=u):(i.lineHeight=c,i.height=Math.max(u,16)+3,i.width=v)}function a$(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 i$(t,e,r,a){var i=t._fullLayout,n=fu(a);a||(a=i[n]);var o=i._size,l=kg.isVertical(a),s=kg.isGrouped(a),f=a.entrywidthmode==="fraction",c=a.borderwidth,u=2*c,v=er.itemGap,p=a.indentation+a.itemwidth+v*2,d=2*(c+v),h=yc(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=a$(a);if(l)r.each(function(Y){var B=Y[0].height;qt.setTranslate(this,c+M[0],c+M[1]+a._height+B/2+v),a._height+=B,a._width=Math.max(a._width,Y[0].width)}),A=p+a._width,a._width+=v+p+u,a._height+=d,s&&(e.each(function(Y,B){qt.setTranslate(this,0,B*a.tracegroupgap)}),a._height+=(a._lgroupsLength-1)*a.tracegroupgap);else{var S=mc(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(Y){var B=Zs(Y,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 Y=0,B=0;$r.select(this).selectAll("g.traces").each(function(ee){var fe=Zs(ee,a,p),oe=ee[0].height;qt.setTranslate(this,M[0],M[1]+c+v+oe/2+B),B+=oe,Y=Math.max(Y,fe),_[ee[0].trace.legendgroup]=Y});var Q=Y+v;k>0&&Q+c+k>a._maxWidth?(D=Math.max(D,k),k=0,C+=P+b,P=B):P=Math.max(P,B),qt.setTranslate(this,k,C),k+=Q}),a._width=Math.max(D,k)+c,a._height=C+P+d}else{var $=r.size(),I=H+u+($-1)*v<a._maxWidth,j=0,G=0,X=0,O=0;r.each(function(Y){var B=Y[0].height,Q=Zs(Y,a,p),ee=I?Q:z;f||(ee+=v),ee+c+G-v>=a._maxWidth&&(D=Math.max(D,O),G=0,X+=j,a._height+=j,j=0),qt.setTranslate(this,M[0]+c+G,M[1]+c+X+B/2+v),O=G+Q+v,G+=ee,j=Math.max(j,B)}),I?(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+er.titlePad))),a._height=Math.ceil(Math.max(a._height+M[1],a._titleHeight+2*(c+er.itemGap))),a._effHeight=Math.min(a._height,a._maxHeight);var q=t._context.edits,W=q.legendText||q.legendPosition;r.each(function(Y){var B=$r.select(this).select("."+n+"toggle"),Q=Y[0].height,ee=Y[0].trace.legendgroup,fe=Zs(Y,a,p);s&&ee!==""&&(fe=_[ee]);var oe=W?p:A||fe;!l&&!f&&(oe+=v/2),qt.setRect(B,0,-Q/2,oe,Q)})}function n$(t,e,r,a){var i=t._fullLayout,n=i[e],o=mc(n),l=yc(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 nh.autoMargin(t,e,{x:n.x,y:n.y,l:n._width*vo[o],r:n._width*wg[o],b:n._effHeight*wg[l],t:n._effHeight*vo[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 mc(t){return Yt.isRightAnchor(t)?"right":Yt.isCenterAnchor(t)?"center":"left"}function yc(t){return Yt.isBottomAnchor(t)?"bottom":Yt.isMiddleAnchor(t)?"middle":"top"}function fu(t){return t._id||"legend"}var nn=ut,qa=ht,Sg=oa,Gt=be,o$=Gt.pushUnique,pv=Gt.strTranslate,l$=Gt.strRotate,s$=ps,Kr=or,f$=E3,za=kt,ar=ct,Ks=Ba,Ra=Ct,c$=gr.zindexSeparator,Co=Je,ha=sa,gn=jc,u$=AT,v$=CT,$T=gn.YANGLE,Ap=Math.PI*$T/180,d$=1/Math.sin(Ap),h$=Math.cos(Ap),p$=Math.sin(Ap),Rt=gn.HOVERARROWSIZE,gt=gn.HOVERTEXTPAD,Lg={box:!0,ohlc:!0,violin:!0,candlestick:!0},m$={scatter:!0,scattergl:!0,splom:!0};function Cg(t,e){return t.distance-e.distance}su.hover=function(e,r,a,i){e=Gt.getGraphDiv(e);var n=r.target;Gt.throttle(e._fullLayout._uid+gn.HOVERID,gn.HOVERMINTIME,function(){y$(e,r,a,i,n)})};su.loneHover=function(e,r){var a=!0;Array.isArray(e)||(a=!1,e=[e]);var i=r.gd,n=IT(i),o=FT(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(Co.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||ar.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=ET(l,{gd:i,hovermode:"closest",rotateLabels:s,bgColor:r.bgColor||ar.background,container:nn.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 RT(c,s,d,h),a?c:c.node()};function y$(t,e,r,a,i){r||(r="xy"),typeof r=="string"&&(r=r.split(c$)[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=Ra.getFromId(t,o,"x"),m=Ra.getFromId(t,o,"y");var _=(p?h:m)._subplotsWith;if(_&&_.length)for(var g=0;g<_.length;g++)o$(n,_[g])}}if(c&&s!=="single"){var x=c.overlays.map(function(Be){return Be.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{Gt.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 Ks.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,$,I,j,G,X,O,q,W,Y={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 Q=t.calcdata.slice();for(Q.sort(function(Be,rt){var at=Be[0].trace.zorder||0,Ye=rt[0].trace.zorder||0;return at-Ye}),k=0;k<Q.length;k++)C=Q[k],$=C[0].trace,$.hoverinfo!=="skip"&&ha.isTraceInSubplots($,n)&&(z.push(C),$.orientation==="h"&&(B=!0));var ee=!i,fe,oe;if(ee)"xpx"in e?fe=e.xpx:fe=T[0]._length/2,"ypx"in e?oe=e.ypx:oe=A[0]._length/2;else{if(s$.triggerHandler(t,"plotly_beforehover",e)===!1)return;var se=i.getBoundingClientRect();fe=e.clientX-se.left,oe=e.clientY-se.top,l._calcInverseTransform(t);var de=Gt.apply3DTransform(l._invTransform)(fe,oe);if(fe=de[0],oe=de[1],fe<0||fe>T[0]._length||oe<0||oe>A[0]._length)return Ks.unhoverRaw(t,e)}if(e.pointerX=fe+T[0]._offset,e.pointerY=oe+A[0]._offset,"xval"in e?H=ha.flat(n,e.xval):H=ha.p2c(T,fe),"yval"in e?D=ha.flat(n,e.yval):D=ha.p2c(A,oe),!qa(H[0])||!qa(D[0]))return Gt.warn("Fx.hover failed",e,t),Ks.unhoverRaw(t,e)}var ye=1/0;function _e(Be,rt){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,ha.isUnifiedHover(G)&&(G=G.charAt(0)),$.type==="splom"?(j=0,I=n[j]):(I=ha.getSubplot($),j=n.indexOf(I)),q={cd:C,trace:$,xa:T[j],ya:A[j],maxHoverDistance:E,maxSpikeDistance:F,index:!1,distance:Math.min(ye,E),spikeDistance:1/0,xSpike:void 0,ySpike:void 0,color:ar.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[I]&&(q.subplot=l[I]._subplot),l._splomScenes&&l._splomScenes[$.uid]&&(q.scene=l._splomScenes[$.uid]),G==="array"){var at=e[k];"pointNumber"in at?(q.index=at.pointNumber,G="closest"):(G="","xval"in at&&(X=at.xval,G="x"),"yval"in at&&(O=at.yval,G=G?"closest":"y"))}else Be!==void 0&&rt!==void 0?(X=Be,O=rt):(X=H[j],O=D[j]);if(W=N.length,E!==0)if($._module&&$._module.hoverPoints){var Ye=$._module.hoverPoints(q,X,O,G,{finiteRange:!0,hoverLayer:l._hoverlayer,hoversubplots:s,gd:t});if(Ye)for(var wt,tt=0;tt<Ye.length;tt++)wt=Ye[tt],qa(wt.x0)&&qa(wt.y0)&&N.push(_$(wt,v))}else Gt.log("Unrecognized trace type in hover:",$);if(v==="closest"&&N.length>W&&(N.splice(0,W),ye=N[0].distance),u&&F!==0&&N.length===0){q.distance=F,q.index=!1;var Ze=$._module.hoverPoints(q,X,O,"closest",{hoverLayer:l._hoverlayer});if(Ze&&(Ze=Ze.filter(function(et){return et.spikeDistance<=F})),Ze&&Ze.length){var vt,pt=Ze.filter(function(et){return et.xa.showspikes&&et.xa.spikesnap!=="hovered data"});if(pt.length){var lt=pt[0];qa(lt.x0)&&qa(lt.y0)&&(vt=pe(lt),(!Y.vLinePoint||Y.vLinePoint.spikeDistance>vt.spikeDistance)&&(Y.vLinePoint=vt))}var it=Ze.filter(function(et){return et.ya.showspikes&&et.ya.spikesnap!=="hovered data"});if(it.length){var Ke=it[0];qa(Ke.x0)&&qa(Ke.y0)&&(vt=pe(Ke),(!Y.hLinePoint||Y.hLinePoint.spikeDistance>vt.spikeDistance)&&(Y.hLinePoint=vt))}}}}}_e();function Se(Be,rt,at){for(var Ye=null,wt=1/0,tt,Ze=0;Ze<Be.length;Ze++)h&&h._id!==Be[Ze].xa._id||m&&m._id!==Be[Ze].ya._id||(tt=Be[Ze].spikeDistance,at&&Ze===0&&(tt=-1/0),tt<=wt&&tt<=rt&&(Ye=Be[Ze],wt=tt));return Ye}function pe(Be){return Be?{xa:Be.xa,ya:Be.ya,x:Be.xSpike!==void 0?Be.xSpike:(Be.x0+Be.x1)/2,y:Be.ySpike!==void 0?Be.ySpike:(Be.y0+Be.y1)/2,distance:Be.distance,spikeDistance:Be.spikeDistance,curveNumber:Be.trace.index,color:Be.color,pointNumber:Be.index}:null}var ve={fullLayout:l,container:l._hoverlayer,event:e};t._spikepoints;var Me={vLinePoint:Y.vLinePoint,hLinePoint:Y.hLinePoint};t._spikepoints=Me;var Pe=function(){var Be=N.filter(function(at){return h&&h._id===at.xa._id&&m&&m._id===at.ya._id}),rt=N.filter(function(at){return!(h&&h._id===at.xa._id&&m&&m._id===at.ya._id)});Be.sort(Cg),rt.sort(Cg),N=Be.concat(rt),N=T$(N,v)};Pe();var ce=v.charAt(0),Le=(ce==="x"||ce==="y")&&N[0]&&m$[N[0].trace.type];if(u&&F!==0&&N.length!==0){var Ce=N.filter(function(Be){return Be.ya.showspikes}),J=Se(Ce,F,Le);Y.hLinePoint=pe(J);var xe=N.filter(function(Be){return Be.xa.showspikes}),Z=Se(xe,F,Le);Y.vLinePoint=pe(Z)}if(N.length===0){var ke=Ks.unhoverRaw(t,e);return u&&(Y.hLinePoint!==null||Y.vLinePoint!==null)&&Pg()&&$g(t,Y,ve),ke}if(u&&Pg()&&$g(t,Y,ve),ha.isXYhover(G)&&N[0].length!==0&&N[0].trace.type!=="splom"){var Te=N[0];Lg[Te.trace.type]?N=N.filter(function(Be){return Be.trace.index===Te.trace.index}):N=[Te];var le=N.length,ie=zg("x",Te,l),me=zg("y",Te,l);_e(ie,me);var he=[],Ae={},we=0,De=function(Be){var rt=Lg[Be.trace.type]?PT(Be):Be.trace.index;if(!Ae[rt])we++,Ae[rt]=we,he.push(Be);else{var at=Ae[rt]-1,Ye=he[at];at>0&&Math.abs(Be.distance)<Math.abs(Ye.distance)&&(he[at]=Be)}},Ie;for(Ie=0;Ie<le;Ie++)De(N[Ie]);for(Ie=N.length-1;Ie>le-1;Ie--)De(N[Ie]);N=he,Pe()}var Ge=t._hoverdata,ue=[],He=IT(t),je=FT(t);for(P=0;P<N.length;P++){var Fe=N[P],qe=ha.makeEventData(Fe,Fe.trace,Fe.cd);if(Fe.hovertemplate!==!1){var Ne=!1;Fe.cd[Fe.index]&&Fe.cd[Fe.index].ht&&(Ne=Fe.cd[Fe.index].ht),Fe.hovertemplate=Ne||Fe.trace.hovertemplate||!1}if(Fe.xa&&Fe.ya){var R=Fe.x0+Fe.xa._offset,U=Fe.x1+Fe.xa._offset,V=Fe.y0+Fe.ya._offset,K=Fe.y1+Fe.ya._offset,ne=Math.min(R,U),re=Math.max(R,U),Ee=Math.min(V,K),$e=Math.max(V,K);qe.bbox={x0:ne+je,x1:re+je,y0:Ee+He,y1:$e+He}}Fe.eventData=[qe],ue.push(qe)}t._hoverdata=ue;var ge=v==="y"&&(z.length>1||N.length>1)||v==="closest"&&B&&N.length>1,ae=ar.combine(l.plot_bgcolor||ar.background,l.paper_bgcolor),Re=ET(N,{gd:t,hovermode:v,rotateLabels:ge,bgColor:ae,container:l._hoverlayer,outerContainer:l._paper.node(),commonLabelOpts:l.hoverlabel,hoverdistance:l.hoverdistance}),Oe=Re.hoverLabels;if(ha.isUnifiedHover(v)||(b$(Oe,ge,l,Re.commonLabelBoundingBox),RT(Oe,ge,l._invScaleX,l._invScaleY)),i&&i.tagName){var We=Co.getComponentMethod("annotations","hasClickToShow")(t,ue);f$(nn.select(i),We?"pointer":"")}!i||a||!w$(t,e,Ge)||(Ge&&t.emit("plotly_unhover",{event:e,points:Ge}),t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:T,yaxes:A,xvals:H,yvals:D}))}function PT(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 g$=/<extra>([\s\S]*)<\/extra>/;function ET(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||gn.HOVERFONT,u=e.fontSize||gn.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=jn(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=nn.select(this),ke=Gt.ensureSingle(Z,"path","",function(re){re.style({"stroke-width":"1px"})}),Te=Gt.ensureSingle(Z,"text","",function(re){re.attr("data-notex",1)}),le=f.bgcolor||ar.defaultLine,ie=f.bordercolor||ar.contrast(le),me=ar.contrast(le),he=f.font,Ae={weight:he.weight||v,style:he.style||p,variant:he.variant||d,textcase:he.textcase||h,lineposition:he.lineposition||m,shadow:he.shadow||y,family:he.family||c,size:he.size||u,color:he.color||me};ke.style({fill:le,stroke:ie}),Te.text(T).call(za.font,Ae).call(Kr.positionText,0,0).call(Kr.convertToTspans,r),Z.attr("transform","");var we=jn(r,Te.node()),De,Ie;if(i==="x"){var Ge=_.side==="top"?"-":"";Te.attr("text-anchor","middle").call(Kr.positionText,0,_.side==="top"?S-we.bottom-Rt-gt:S-we.top+Rt+gt),De=_._offset+(b.x0+b.x1)/2,Ie=g._offset+(_.side==="top"?0:g._length);var ue=we.width/2+gt,He=De;De<ue?He=ue:De>a.width-ue&&(He=a.width-ue),ke.attr("d","M"+(De-He)+",0L"+(De-He+Rt)+","+Ge+Rt+"H"+ue+"v"+Ge+(gt*2+we.height)+"H"+-ue+"V"+Ge+Rt+"H"+(De-He-Rt)+"Z"),De=He,k.minX=De-ue,k.maxX=De+ue,_.side==="top"?(k.minY=Ie-(gt*2+we.height),k.maxY=Ie-gt):(k.minY=Ie+gt,k.maxY=Ie+(gt*2+we.height))}else{var je,Fe,qe;g.side==="right"?(je="start",Fe=1,qe="",De=_._offset+_._length):(je="end",Fe=-1,qe="-",De=_._offset),Ie=g._offset+(b.y0+b.y1)/2,Te.attr("text-anchor",je),ke.attr("d","M0,0L"+qe+Rt+","+Rt+"V"+(gt+we.height/2)+"h"+qe+(gt*2+we.width)+"V-"+(gt+we.height/2)+"H"+qe+Rt+"V-"+Rt+"Z"),k.minY=Ie-(gt+we.height/2),k.maxY=Ie+(gt+we.height/2),g.side==="right"?(k.minX=De+Rt,k.maxX=De+Rt+(gt*2+we.width)):(k.minX=De-Rt-(gt*2+we.width),k.maxX=De-Rt);var Ne=we.height/2,R=S-we.top-Ne,U="clip"+a._uid+"commonlabel"+g._id,V;if(De<we.width+2*gt+Rt){V="M-"+(Rt+gt)+"-"+Ne+"h-"+(we.width-gt)+"V"+Ne+"h"+(we.width-gt)+"Z";var K=we.width-De+gt;Kr.positionText(Te,K,R),je==="end"&&Te.selectAll("tspan").each(function(){var re=nn.select(this),Ee=za.tester.append("text").text(re.text()).call(za.font,Ae),$e=jn(r,Ee.node());Math.round($e.width)<Math.round(we.width)&&re.attr("x",K-$e.width),Ee.remove()})}else Kr.positionText(Te,Fe*(gt+Rt),R),V=null;var ne=a._topclips.selectAll("#"+U).data(V?[0]:[]);ne.enter().append("clipPath").attr("id",U).append("path"),ne.exit().remove(),ne.select("path").attr("d",V),za.setClipUrl(Te,V?U:null,r)}Z.attr("transform",pv(De,Ie))}),ha.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,I=$.font,j={showlegend:!0,legend:{title:{text:T,font:I},font:I,bgcolor:$.bgcolor,bordercolor:$.bordercolor,borderwidth:1,tracegroupgap:7,traceorder:a.legend?a.legend.traceorder:void 0,orientation:"v"}},G={font:I};u$(j,G,r._fullData);var X=G.legend;X.entries=[];for(var O=0;O<C.length;O++){var q=C[O];if(q.hoverinfo!=="none"){var W=Dg(q,!0,i,a,T),Y=W[0],B=W[1];q.name=B,B!==""?q.text=B+" : "+Y:q.text=Y;var Q=q.cd[q.index];Q&&(Q.mc&&(q.mc=Q.mc),Q.mcc&&(q.mc=Q.mcc),Q.mlc&&(q.mlc=Q.mlc),Q.mlcc&&(q.mlc=Q.mlcc),Q.mlw&&(q.mlw=Q.mlw),Q.mrc&&(q.mrc=Q.mrc),Q.dir&&(q.dir=Q.dir)),q._distinct=!0,X.entries.push([q])}}X.entries.sort(function(Z,ke){return Z[0].trace.index-ke[0].trace.index}),X.layer=l,X._inHover=!0,X._groupTitleFont=$.grouptitlefont,v$(r,X);var ee=l.select("g.legend"),fe=jn(r,ee.node()),oe=fe.width+2*gt,se=fe.height+2*gt,de=C[0],ye=(de.x0+de.x1)/2,_e=(de.y0+de.y1)/2,Se=!(Co.traceIs(de.trace,"bar-like")||Co.traceIs(de.trace,"box-violin")),pe,ve;x==="y"?Se?(ve=_e-gt,pe=_e+gt):(ve=Math.min.apply(null,C.map(function(Z){return Math.min(Z.y0,Z.y1)})),pe=Math.max.apply(null,C.map(function(Z){return Math.max(Z.y0,Z.y1)}))):ve=pe=Gt.mean(C.map(function(Z){return(Z.y0+Z.y1)/2}))-se/2;var Me,Pe;x==="x"?Se?(Me=ye+gt,Pe=ye-gt):(Me=Math.max.apply(null,C.map(function(Z){return Math.max(Z.x0,Z.x1)})),Pe=Math.min.apply(null,C.map(function(Z){return Math.min(Z.x0,Z.x1)}))):Me=Pe=Gt.mean(C.map(function(Z){return(Z.x0+Z.x1)/2}))-oe/2;var ce=_._offset,Le=g._offset;pe+=Le,Me+=ce,Pe+=ce-oe,ve+=Le-se;var Ce,J;return Me+oe<L&&Me>=0?Ce=Me:Pe+oe<L&&Pe>=0?Ce=Pe:ce+oe<L?Ce=ce:Me-ye<ye-Pe+oe?Ce=L-oe:Ce=0,Ce+=gt,pe+se<E&&pe>=0?J=pe:ve+se<E&&ve>=0?J=ve:Le+se<E?J=Le:pe-_e<_e-ve+se?J=E-se:J=0,J+=gt,ee.attr("transform",pv(Ce-1,J-1)),ee}var xe=l.selectAll("g.hovertext").data(t,function(Z){return PT(Z)});return xe.enter().append("g").classed("hovertext",!0).each(function(){var Z=nn.select(this);Z.append("rect").call(ar.fill,ar.addOpacity(o,.8)),Z.append("text").classed("name",!0),Z.append("path").style("stroke-width","1px"),Z.append("text").classed("nums",!0).call(za.font,{weight:v,style:p,variant:d,textcase:h,lineposition:m,shadow:y,family:c,size:u})}),xe.exit().remove(),xe.each(function(Z){var ke=nn.select(this).attr("transform",""),Te=Z.color;Array.isArray(Te)&&(Te=Te[Z.eventData[0].pointNumber]);var le=Z.bgcolor||Te,ie=ar.combine(ar.opacity(le)?le:ar.defaultLine,o),me=ar.combine(ar.opacity(Te)?Te:ar.defaultLine,o),he=Z.borderColor||ar.contrast(ie),Ae=Dg(Z,F,i,a,T,ke),we=Ae[0],De=Ae[1],Ie=ke.select("text.nums").call(za.font,{family:Z.fontFamily||c,size:Z.fontSize||u,color:Z.fontColor||he,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(we).attr("data-notex",1).call(Kr.positionText,0,0).call(Kr.convertToTspans,r),Ge=ke.select("text.name"),ue=0,He=0;if(De&&De!==we){Ge.call(za.font,{family:Z.fontFamily||c,size:Z.fontSize||u,color:me,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(De).attr("data-notex",1).call(Kr.positionText,0,0).call(Kr.convertToTspans,r);var je=jn(r,Ge.node());ue=je.width+2*gt,He=je.height+2*gt}else Ge.remove(),ke.select("rect").remove();ke.select("path").style({fill:ie,stroke:he});var Fe=Z.xa._offset+(Z.x0+Z.x1)/2,qe=Z.ya._offset+(Z.y0+Z.y1)/2,Ne=Math.abs(Z.x1-Z.x0),R=Math.abs(Z.y1-Z.y0),U=jn(r,Ie.node()),V=U.width/a._invScaleX,K=U.height/a._invScaleY;Z.ty0=(S-U.top)/a._invScaleY,Z.bx=V+2*gt,Z.by=Math.max(K+2*gt,He),Z.anchor="start",Z.txwidth=V,Z.tx2width=ue,Z.offset=0;var ne=(V+Rt+gt+ue)*a._invScaleX,re,Ee;if(n)Z.pos=Fe,re=qe+R/2+ne<=E,Ee=qe-R/2-ne>=0,(Z.idealAlign==="top"||!re)&&Ee?(qe-=R/2,Z.anchor="end"):re?(qe+=R/2,Z.anchor="start"):Z.anchor="middle",Z.crossPos=qe;else{if(Z.pos=qe,re=Fe+Ne/2+ne<=L,Ee=Fe-Ne/2-ne>=0,(Z.idealAlign==="left"||!re)&&Ee)Fe-=Ne/2,Z.anchor="end";else if(re)Fe+=Ne/2,Z.anchor="start";else{Z.anchor="middle";var $e=ne/2,ge=Fe+$e-L,ae=Fe-$e;ge>0&&(Fe-=ge),ae<0&&(Fe+=-ae)}Z.crossPos=Fe}Ie.attr("text-anchor",Z.anchor),ue&&Ge.attr("text-anchor",Z.anchor),ke.attr("transform",pv(Fe,qe)+(n?l$($T):""))}),{hoverLabels:xe,commonLabelBoundingBox:k}}function Dg(t,e,r,a,i,n){var o="",l="";t.nameOverride!==void 0&&(t.name=t.nameOverride),t.name&&(t.trace._meta&&(t.name=Gt.templateString(t.name,t.trace._meta)),o=Eg(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=Gt.hovertemplateString(c,u,a._d3locale,t.eventData[0]||{},t.trace._meta),l=l.replace(g$,function(v,p){return o=Eg(p,t.nameLength),""})}return[l,o]}function b$(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,I=k?r.width:r.height;if(r.hovermode==="x"||r.hovermode==="y"){var j=zT(H,e),G=H.anchor,X=G==="end"?-1:1,O,q;if(G==="middle")O=H.crossPos+(k?m(j.y-H.by/2):h(H.bx/2+H.tx2width/2)),q=O+(k?m(H.by):h(H.bx));else if(k)O=H.crossPos+m(Rt+j.y)-m(H.by/2-Rt),q=O+m(H.by);else{var W=h(X*Rt+j.x),Y=W+h(X*H.bx);O=H.crossPos+Math.min(W,Y),q=H.crossPos+Math.max(W,Y)}k?p!==void 0&&d!==void 0&&Math.min(q,d)-Math.max(O,p)>1&&(P.side==="left"?($=P._mainLinePosition,I=r.width):I=P._mainLinePosition):u!==void 0&&v!==void 0&&Math.min(q,v)-Math.max(O,u)>1&&(P.side==="top"?($=P._mainLinePosition,I=r.height):I=P._mainLinePosition)}f[c++]=[{datum:H,traceIndex:H.trace.index,dp:0,pos:H.pos,posref:H.posref,size:H.by*(k?d$:1)/2,pmin:$,pmax:I}]}),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 zT(t,e){var r=0,a=t.offset;return e&&(a*=-p$,r=t.offset*h$),{x:r,y:a}}function x$(t){var e={start:1,end:-1,middle:0}[t.anchor],r=e*(Rt+gt),a=r+e*(t.txwidth+gt),i=t.anchor==="middle";return i&&(r-=t.tx2width/2,a+=t.txwidth/2+gt),{alignShift:e,textShiftX:r,text2ShiftX:a}}function RT(t,e,r,a){var i=function(o){return o*r},n=function(o){return o*a};t.each(function(o){var l=nn.select(this);if(o.del)return l.remove();var s=l.select("text.nums"),f=o.anchor,c=f==="end"?-1:1,u=x$(o),v=zT(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*Rt+p)+","+n(Rt+d)+"v"+n(o.by/2-Rt)+"h"+i(c*o.bx)+"v-"+n(o.by)+"H"+i(c*Rt+p)+"V"+n(d-Rt)+"Z");var m=p+u.textShiftX,y=d+o.ty0-o.by/2+gt,b=o.textAlign||"auto";b!=="auto"&&(b==="left"&&f!=="start"?(s.attr("text-anchor","start"),m=h?-o.bx/2-o.tx2width/2+gt:-o.bx-gt):b==="right"&&f!=="end"&&(s.attr("text-anchor","end"),m=h?o.bx/2-o.tx2width/2-gt:o.bx+gt)),s.call(Kr.positionText,i(m),n(y)),o.tx2width&&(l.select("text.name").call(Kr.positionText,i(u.text2ShiftX+u.alignShift*gt+p),n(d+o.ty0-o.by/2+gt)),l.select("rect").call(za.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 _$(t,e){var r=t.index,a=t.trace||{},i=t.cd[0],n=t.cd[r]||{};function o(v){return v||qa(v)&&v===0}var l=Array.isArray(r)?function(v,p){var d=Gt.castOption(i,r,v);return o(d)?d:Gt.extractOption({},a,"",p)}:function(v,p){return Gt.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=Gt.constrain(t.x0,0,t.xa._length),t.x1=Gt.constrain(t.x1,0,t.xa._length),t.y0=Gt.constrain(t.y0,0,t.ya._length),t.y1=Gt.constrain(t.y1,0,t.ya._length),t.xLabelVal!==void 0&&(t.xLabel="xLabel"in t?t.xLabel:Ra.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:Ra.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=Ra.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;t.xerrneg!==void 0?t.xLabel+=" +"+f+" / -"+Ra.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=Ra.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;t.yerrneg!==void 0?t.yLabel+=" +"+c+" / -"+Ra.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 $g(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=ar.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=Sg.readability(v.color,u)<1.5?ar.contrast(u):v.color,y=c.spikemode,b=c.spikethickness,_=c.spikecolor||m,g=Ra.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":za.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=Sg.readability(M.color,u)<1.5?ar.contrast(u):M.color,N=f.spikemode,z=f.spikethickness,H=f.spikecolor||F,D=Ra.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":za.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 w$(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 Pg(t,e){return!0}function Eg(t,e){return Kr.plainText(t||"",{len:e,allowedTags:["br","sub","sup","b","i","em","s","u"]})}function T$(t,e){for(var r=e.charAt(0),a=[],i=[],n=[],o=0;o<t.length;o++){var l=t[o];Co.traceIs(l.trace,"bar-like")||Co.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 zg(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 IT(t){return t.offsetTop+t.clientTop}function FT(t){return t.offsetLeft+t.clientLeft}function jn(t,e){var r=t._fullLayout,a=e.getBoundingClientRect(),i=a.left,n=a.top,o=i+a.width,l=n+a.height,s=Gt.apply3DTransform(r._invTransform)(i,n),f=Gt.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 k$=be,A$=ct,M$=sa.isUnifiedHover,Mp=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&&M$(r.hovermode)&&(i.font||(i.font={}),o("size"),o("family"),o("color"),o("weight"),o("style"),o("variant"),n?(i.bgcolor||(i.bgcolor=A$.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),k$.coerceFont(a,"hoverlabel.font",i.font),a("hoverlabel.align",i.align)},S$=be,L$=Mp,C$=vs,D$=function(e,r){function a(i,n){return S$.coerce(e,r,C$,i,n)}L$(e,r,a)},Rg=be,$$=Bc,P$=Mp,E$=function(e,r,a,i){function n(l,s){return Rg.coerce(e,r,$$,l,s)}var o=Rg.extendFlat({},i.hoverlabel);r.hovertemplate&&(o.namelength=-1),P$(e,r,n,o)},z$=be,R$=vs,NT=function(e,r){function a(i,n){return r[i]!==void 0?r[i]:z$.coerce(e,r,R$,i,n)}return a("clickmode"),a("hoversubplots"),a("hovermode")},Ig=be,I$=vs,F$=NT,N$=Mp,H$=function(e,r){function a(c,u){return Ig.coerce(e,r,I$,c,u)}var i=F$(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"),N$(e,r,a),Ig.coerceFont(a,"hoverlabel.grouptitlefont",r.hoverlabel.font)},oh=be,Fg=Je,O$=function(e){var r=e.calcdata,a=e._fullLayout;function i(f){return function(c){return oh.coerceHoverinfo({hoverinfo:c},{_module:f._module},a)}}for(var n=0;n<r.length;n++){var o=r[n],l=o[0].trace;if(!Fg.traceIs(l,"pie-like")){var s=Fg.traceIs(l,"2dMap")?j$:oh.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 j$(t,e,r,a){a=a||oh.identity,Array.isArray(t)&&(e[0][r]=a(t))}var B$=Je,G$=su.hover,U$=function(e,r,a){var i=B$.getComponentMethod("annotations","onClick")(e,e._hoverdata);a!==void 0&&G$(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())},V$=ut,gc=be,W$=Ba,fl=sa,Ng=vs,Hg=su,Ta={moduleType:"component",name:"fx",constants:jc,schema:{layout:Ng},attributes:Bc,layoutAttributes:Ng,supplyLayoutGlobalDefaults:D$,supplyDefaults:E$,supplyLayoutDefaults:H$,calc:O$,getDistanceFunction:fl.getDistanceFunction,getClosest:fl.getClosest,inbox:fl.inbox,quadrature:fl.quadrature,appendArrayPointValue:fl.appendArrayPointValue,castHoverOption:Y$,castHoverinfo:q$,hover:Hg.hover,unhover:W$.unhover,loneHover:Hg.loneHover,loneUnhover:X$,click:U$};function X$(t){var e=gc.isD3Selection(t)?t:V$.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()}function Y$(t,e,r){return gc.castOption(t,e,"hoverlabel."+r)}function q$(t,e,r){function a(i){return gc.coerceHoverinfo({hoverinfo:i},{_module:t._module},e)}return gc.castOption(t,r,"hoverinfo",a)}var Dn={};(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)}})(Dn);var Sp=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})})},cu={},HT={exports:{}},Lp={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("")}},Pi={},Qs=32,Cp={CIRCLE_SIDES:Qs,i000:0,i090:Qs/4,i180:Qs/2,i270:Qs/4*3,cos45:Math.cos(Math.PI/4),sin45:Math.sin(Math.PI/4),SQRT2:Math.sqrt(2)},Z$=be.strTranslate;function OT(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 K$(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 Q$(t){var e=t._id.charAt(0)==="y"?1:0;return function(r){return OT(t,r[e])}}function J$(t){return Z$(t.xaxis._offset,t.yaxis._offset)}var Dp={p2r:OT,r2p:K$,axValue:Q$,getTransform:J$};(function(t){var e=f_,r=Cp,a=r.CIRCLE_SIDES,i=r.SQRT2,n=Dp,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 I=2*Math.PI*g/a;L.push([D,C+P*Math.cos(I),$+k*Math.sin(I)])}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,X=d&&d.xsizemode==="pixel",O=d&&d.ysizemode==="pixel",q=h===!1,W=0;W<L.length;W++){for(g=0;g+2<7;g+=2){var Y=L[W][g+1],B=L[W][g+2];Y===void 0||B===void 0||(x=Y,w=B,d&&(d.xaxis&&d.xaxis.p2r?(q&&(Y-=d.xaxis._offset),X?Y=l(d.xaxis,d.xanchor)+Y:Y=o(d.xaxis,Y)):(q&&(Y-=G.l),j?Y=j.x[0]+Y/G.w:Y=Y/G.w),d.yaxis&&d.yaxis.p2r?(q&&(B-=d.yaxis._offset),O?B=l(d.yaxis,d.yanchor)-B:B=o(d.yaxis,B)):(q&&(B-=G.t),j?B=j.y[1]-B/G.h:B=1-B/G.h)),L[W][g+1]=Y,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}})(Pi);var jT=Dn,eP=jT.drawMode,tP=jT.openMode,Yo=Cp,Og=Yo.i000,jg=Yo.i090,Bg=Yo.i180,Gg=Yo.i270,rP=Yo.cos45,aP=Yo.sin45,BT=Dp,Js=BT.p2r,ci=BT.r2p,iP=Sn,nP=iP.clearOutline,uu=Pi,oP=uu.readPaths,lP=uu.writePaths,sP=uu.ellipseOver,fP=uu.fixDatesForPaths;function cP(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(!eP(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=GT(t,e,n);nP(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 GT(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=tP(r),d=oP(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[Og][1],b=m[jg][1],_=m[Bg][1],g=m[Gg][1],x=m[Og][2],w=m[jg][2],T=m[Bg][2],A=m[Gg][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=ci(l.xaxis,y),b=ci(l.xaxis,b),_=ci(l.xaxis,_),g=ci(l.xaxis,g)),S&&(x=ci(l.yaxis,x),w=ci(l.yaxis,w),T=ci(l.yaxis,T),A=ci(l.yaxis,A));var L=(b+g)/2,E=(x+T)/2,F=(g-b+_-y)/2,N=(A-w+T-x)/2,z=sP({x0:L,y0:E,x1:L+F*rP,y1:E+N*aP});M&&(z.x0=Js(l.xaxis,z.x0),z.x1=Js(l.xaxis,z.x1)),S&&(z.y0=Js(l.yaxis,z.y0),z.y1=Js(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=lP(d),m=null;return h}var $p={newShapes:cP,createShapeObj:GT},uP=Dn,vP=uP.selectMode,dP=Sn,hP=dP.clearOutline,Pp=Pi,pP=Pp.readPaths,mP=Pp.writePaths,yP=Pp.fixDatesForPaths,UT=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(!vP(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=pP(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&&yP(d,s,f),h.path=mP(d),m=null),hP(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():{}}}},Ei={},vu={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=vu,r=be,a=Ct;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}})(Ei);var gP=be,Bn=Ct,Ug=or,Vg=kt,bP=Pi.readPaths,lh=Ei,xP=lh.getPathString,Wg=Zh,_P=Sr.FROM_TL,VT=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=Bn.getFromId(e,a.xref),s=Bn.getFromId(e,a.yref);for(var f in Wg){var c=Wg[f](a,l,s);c!==void 0&&(o[f]=c)}}n=gP.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=xP(e,a),x=bP(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=Bn.getFromId(e,a.xref),F=a.x0shift,N=a.x1shift,z=Bn.getRefType(a.xref),H=Bn.getFromId(e,a.yref),D=a.y0shift,P=a.y1shift,k=Bn.getRefType(a.yref),C=function(W,Y){var B=lh.getDataToPixel(e,E,Y,!1,z);return B(W)},$=function(W,Y){var B=lh.getDataToPixel(e,H,Y,!0,k);return B(W)};m=C(a.x0,F),y=C(a.x1,N),b=$(a.y0,D),_=$(a.y1,P)}var I=a.label.textangle;I==="auto"&&(a.type==="line"?I=wP(m,b,y,_):I=0),h.call(function(W){return W.call(Vg.font,v).attr({}),Ug.convertToTspans(W,e),W});var j=Vg.bBox(h.node()),G=TP(m,b,y,_,a,I,j),X=G.textx,O=G.texty,q=G.xanchor;h.attr({"text-anchor":{left:"start",center:"middle",right:"end"}[q],y:O,x:X,transform:"rotate("+I+","+X+","+O+")"}).call(Ug.positionText,X,O)}};function wP(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 TP(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=_P[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 kP=be,AP=kP.strTranslate,Xg=Ba,WT=Dn,MP=WT.drawMode,XT=WT.selectMode,YT=Je,Yg=ct,du=Cp,SP=du.i000,LP=du.i090,CP=du.i180,DP=du.i270,$P=Sn,qT=$P.clearOutlineControllers,Ep=Pi,ef=Ep.pointsOnRectangle,mv=Ep.pointsOnEllipse,PP=Ep.writePaths,EP=$p.newShapes,zP=$p.createShapeObj,RP=UT,IP=VT,zp=function t(e,r,a,i){i||(i=0);var n=a.gd;function o(){t(e,r,a,i++),(mv(e[0])||a.hasText)&&l({redrawing:!0})}function l(D){var P={};a.isActiveShape!==void 0&&(a.isActiveShape=!1,P=EP(r,a)),a.isActiveSelection!==void 0&&(a.isActiveSelection=!1,P=RP(r,a),n._fullLayout._reselect=!0),Object.keys(P).length&&YT.call((D||{}).redrawing?"relayout":"_guiRelayout",n,P)}var s=n._fullLayout,f=s._zoomlayer,c=a.dragmode,u=MP(c),v=XT(c);(u||v)&&(n._fullLayout._outlining=!0),qT(n),r.attr("d",PP(e));var p,d,h,m,y;if(!i&&(a.isActiveShape||a.isActiveSelection)){y=FP([],e);var b=f.append("g").attr("class","outline-controllers");S(b),H()}if(u&&a.hasText){var _=f.select(".label-temp"),g=zP(r,a,a.dragmode);IP(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],I=$.length;if(ef($)){var j=D,G=P;if(a.isActiveSelection){var X=qg($,m);X[1]===$[m][1]?G=0:j=0}for(var O=0;O<I;O++)if(O!==m){var q=$[O];q[1]===$[m][1]&&(q[1]=k+j),q[2]===$[m][2]&&(q[2]=C+G)}if($[m][1]=k+j,$[m][2]=C+G,!ef($))for(var W=0;W<I;W++)for(var Y=0;Y<$[W].length;Y++)$[W][Y]=y[h][W][Y]}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];!ef(k)&&!mv(k)&&A()}}function S(D){p=[];for(var P=0;P<e.length;P++){var k=e[P],C=ef(k),$=!C&&mv(k);p[P]=[];for(var I=k.length,j=0;j<I;j++)if(k[j][0]!=="Z"&&!($&&j!==SP&&j!==LP&&j!==CP&&j!==DP)){var G=C&&a.isActiveSelection,X;G&&(X=qg(k,j));var O=k[j][1],q=k[j][2],W=D.append(G?"rect":"circle").attr("data-i",P).attr("data-j",j).style({fill:Yg.background,stroke:Yg.defaultLine,"stroke-width":1,"shape-rendering":"crispEdges"});if(G){var Y=X[1]-O,B=X[2]-q,Q=B?5:Math.max(Math.min(25,Math.abs(Y)-5),5),ee=Y?5:Math.max(Math.min(25,Math.abs(B)-5),5);W.classed(B?"cursor-ew-resize":"cursor-ns-resize",!0).attr("width",Q).attr("height",ee).attr("x",O-Q/2).attr("y",q-ee/2).attr("transform",AP(Y/2,B/2))}else W.classed("cursor-grab",!0).attr("r",5).attr("cx",O).attr("cy",q);p[P][j]={element:W.node(),gd:n,prepFn:x,doneFn:T,clickFn:M},Xg.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&&NP(n)}function H(){if(d=[],!!e.length){var D=0;d[D]={element:r[0][0],gd:n,prepFn:F,doneFn:N,clickFn:z},Xg.init(d[D])}}};function FP(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 qg(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 NP(t){if(XT(t._fullLayout.dragmode)){qT(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},YT.call("_guiRelayout",t,{selections:a})}}}var HP=ut,ZT=Je,Zg=be,Gn=Ct,OP=Pi.readPaths,jP=zp,bc=VT,KT=Sn.clearOutlineControllers,yv=ct,Rp=kt,BP=Lt.arrayEditor,Kg=Ba,Qg=$i,an=vu,Dr=Ei,sh=Dr.getPathString,Ip={draw:Fp,drawOne:QT,eraseActiveShape:VP,drawLabel:bc};function Fp(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&&QT(t,i)}function tf(t){return!!t._fullLayout._outlining}function hu(t){return!t._context.edits.shapePosition}function QT(t,e){t._fullLayout._paperdiv.selectAll('.shapelayer [data-index="'+e+'"]').remove();var r=Dr.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=sh(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=hu(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(yv.stroke,v).call(yv.fill,u).call(Rp.dashLine,d,p);JT(y,t,a),bc(t,e,a,y);var _;if((m||t._context.edits.shapePosition)&&(_=BP(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=OP(s,t);jP(x,b,g)}else t._context.edits.shapePosition?GP(t,b,a,e,l,_):a.editable===!0&&b.style("pointer-events",h||yv.opacity(u)*c<=.5?"stroke":"all");b.node().addEventListener("click",function(){return UP(t,b)})}}function JT(t,e,r){var a=(r.xref+r.yref).replace(/paper/g,"").replace(/[xyz][1-9]* *domain/g,"");Rp.setClipUrl(t,a?"clip"+e._fullLayout._uid+a:null,e)}function GP(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=HP.select(e.node().parentNode),F=Gn.getFromId(t,r.xref),N=Gn.getRefType(r.xref),z=Gn.getFromId(t,r.yref),H=Gn.getRefType(r.yref),D=r.x0shift,P=r.x1shift,k=r.y0shift,C=r.y1shift,$=function(Se,pe){var ve=Dr.getDataToPixel(t,F,pe,!1,N);return ve(Se)},I=function(Se,pe){var ve=Dr.getDataToPixel(t,z,pe,!0,H);return ve(Se)},j=Dr.getPixelToData(t,F,!1,N),G=Dr.getPixelToData(t,z,!0,H),X=W(),O={element:X.node(),gd:t,prepFn:Q,doneFn:ee,clickFn:fe},q;Kg.init(O),X.node().onmousemove=B;function W(){return c?Y():e}function Y(){var Se=10,pe=Math.max(r.line.width,Se),ve=i.append("g").attr("data-index",a).attr("drag-helper",!0);ve.append("path").attr("d",e.attr("d")).style({cursor:"move","stroke-width":pe,"stroke-opacity":"0"});var Me={"fill-opacity":"0"},Pe=Math.max(pe/2,Se);return ve.append("circle").attr({"data-line-point":"start-point",cx:s?$(r.xanchor)+r.x0:$(r.x0,D),cy:f?I(r.yanchor)-r.y0:I(r.y0,k),r:Pe}).style(Me).classed("cursor-grab",!0),ve.append("circle").attr({"data-line-point":"end-point",cx:s?$(r.xanchor)+r.x1:$(r.x1,P),cy:f?I(r.yanchor)-r.y1:I(r.y1,C),r:Pe}).style(Me).classed("cursor-grab",!0),ve}function B(Se){if(tf(t)){q=null;return}if(c)Se.target.tagName==="path"?q="move":q=Se.target.attributes["data-line-point"].value==="start-point"?"resize-over-start-point":"resize-over-end-point";else{var pe=O.element.getBoundingClientRect(),ve=pe.right-pe.left,Me=pe.bottom-pe.top,Pe=Se.clientX-pe.left,ce=Se.clientY-pe.top,Le=!u&&ve>o&&Me>l&&!Se.shiftKey?Kg.getCursor(Pe/ve,1-ce/Me):"move";Qg(e,Le),q=Le.split("-")[0]}}function Q(Se){tf(t)||(s&&(y=$(r.xanchor)),f&&(b=I(r.yanchor)),r.type==="path"?L=r.path:(p=s?r.x0:$(r.x0),d=f?r.y0:I(r.y0),h=s?r.x1:$(r.x1),m=f?r.y1:I(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(Se),de(i,r),_e(e,r,t),O.moveFn=q==="move"?oe:se,O.altKey=Se.altKey)}function ee(){tf(t)||(Qg(e),ye(i),JT(e,t,r),ZT.call("_guiRelayout",t,n.getUpdateObj()))}function fe(){tf(t)||ye(i)}function oe(Se,pe){if(r.type==="path"){var ve=function(ce){return ce},Me=ve,Pe=ve;s?v("xanchor",r.xanchor=j(y+Se)):(Me=function(Le){return j($(Le)+Se)},F&&F.type==="date"&&(Me=Dr.encodeDate(Me))),f?v("yanchor",r.yanchor=G(b+pe)):(Pe=function(Le){return G(I(Le)+pe)},z&&z.type==="date"&&(Pe=Dr.encodeDate(Pe))),v("path",r.path=Jg(L,Me,Pe))}else s?v("xanchor",r.xanchor=j(y+Se)):(v("x0",r.x0=j(p+Se)),v("x1",r.x1=j(h+Se))),f?v("yanchor",r.yanchor=G(b+pe)):(v("y0",r.y0=G(d+pe)),v("y1",r.y1=G(m+pe)));e.attr("d",sh(t,r)),de(i,r),bc(t,a,r,E)}function se(Se,pe){if(u){var ve=function(we){return we},Me=ve,Pe=ve;s?v("xanchor",r.xanchor=j(y+Se)):(Me=function(De){return j($(De)+Se)},F&&F.type==="date"&&(Me=Dr.encodeDate(Me))),f?v("yanchor",r.yanchor=G(b+pe)):(Pe=function(De){return G(I(De)+pe)},z&&z.type==="date"&&(Pe=Dr.encodeDate(Pe))),v("path",r.path=Jg(L,Me,Pe))}else if(c){if(q==="resize-over-start-point"){var ce=p+Se,Le=f?d-pe:d+pe;v("x0",r.x0=s?ce:j(ce)),v("y0",r.y0=f?Le:G(Le))}else if(q==="resize-over-end-point"){var Ce=h+Se,J=f?m-pe:m+pe;v("x1",r.x1=s?Ce:j(Ce)),v("y1",r.y1=f?J:G(J))}}else{var xe=function(we){return q.indexOf(we)!==-1},Z=xe("n"),ke=xe("s"),Te=xe("w"),le=xe("e"),ie=Z?_+pe:_,me=ke?g+pe:g,he=Te?x+Se:x,Ae=le?w+Se:w;f&&(Z&&(ie=_-pe),ke&&(me=g-pe)),(!f&&me-ie>l||f&&ie-me>l)&&(v(T,r[T]=f?ie:G(ie)),v(A,r[A]=f?me:G(me))),Ae-he>o&&(v(M,r[M]=s?he:j(he)),v(S,r[S]=s?Ae:j(Ae)))}e.attr("d",sh(t,r)),de(i,r),bc(t,a,r,E)}function de(Se,pe){(s||f)&&ve();function ve(){var Me=pe.type!=="path",Pe=Se.selectAll(".visual-cue").data([0]),ce=1;Pe.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":ce}).classed("visual-cue",!0);var Le=$(s?pe.xanchor:Zg.midRange(Me?[pe.x0,pe.x1]:Dr.extractPathCoords(pe.path,an.paramIsX))),Ce=I(f?pe.yanchor:Zg.midRange(Me?[pe.y0,pe.y1]:Dr.extractPathCoords(pe.path,an.paramIsY)));if(Le=Dr.roundPositionForSharpStrokeRendering(Le,ce),Ce=Dr.roundPositionForSharpStrokeRendering(Ce,ce),s&&f){var J="M"+(Le-1-ce)+","+(Ce-1-ce)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";Pe.attr("d",J)}else if(s){var xe="M"+(Le-1-ce)+","+(Ce-9-ce)+"v18 h2 v-18 Z";Pe.attr("d",xe)}else{var Z="M"+(Le-9-ce)+","+(Ce-1-ce)+"h18 v2 h-18 Z";Pe.attr("d",Z)}}}function ye(Se){Se.selectAll(".visual-cue").remove()}function _e(Se,pe,ve){var Me=pe.xref,Pe=pe.yref,ce=Gn.getFromId(ve,Me),Le=Gn.getFromId(ve,Pe),Ce="";Me!=="paper"&&!ce.autorange&&(Ce+=Me),Pe!=="paper"&&!Le.autorange&&(Ce+=Pe),Rp.setClipUrl(Se,Ce?"clip"+ve._fullLayout._uid+Ce:null,ve)}}function Jg(t,e,r){return t.replace(an.segmentRE,function(a){var i=0,n=a.charAt(0),o=an.paramIsX[n],l=an.paramIsY[n],s=an.numParams[n],f=a.substr(1).replace(an.paramRE,function(c){return i>=s||(o[i]?c=e(c):l[i]&&(c=r(c)),i++),c});return n+f})}function UP(t,e){if(hu(t)){var r=e.node(),a=+r.getAttribute("data-index");if(a>=0){if(a===t._fullLayout._activeShapeIndex){e0(t);return}t._fullLayout._activeShapeIndex=a,t._fullLayout._deactivateShape=e0,Fp(t)}}}function e0(t){if(hu(t)){var e=t._fullLayout._activeShapeIndex;e>=0&&(KT(t),delete t._fullLayout._activeShapeIndex,Fp(t))}}function VP(t){if(hu(t)){KT(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 fa=Je,e2=Kt,t2=Xt,xt=Lp,WP=Ip.eraseActiveShape,Bf=be,yt=Bf._,_t=HT.exports={};_t.toImage={name:"toImage",title:function(t){var e=t._context.toImageButtonOptions||{},r=e.format||"png";return r==="png"?yt(t,"Download plot as a PNG"):yt(t,"Download plot")},icon:xt.camera,click:function(t){var e=t._context.toImageButtonOptions,r={format:e.format||"png"};Bf.notifier(yt(t,"Taking snapshot - this may take a few seconds"),"long"),["filename","width","height","scale"].forEach(function(a){a in e&&(r[a]=e[a])}),fa.call("downloadImage",t,r).then(function(a){Bf.notifier(yt(t,"Snapshot succeeded")+" - "+a,"long")}).catch(function(){Bf.notifier(yt(t,"Sorry, there was a problem downloading your snapshot!"),"long")})}};_t.sendDataToCloud={name:"sendDataToCloud",title:function(t){return yt(t,"Edit in Chart Studio")},icon:xt.disk,click:function(t){e2.sendDataToCloud(t)}};_t.editInChartStudio={name:"editInChartStudio",title:function(t){return yt(t,"Edit in Chart Studio")},icon:xt.pencil,click:function(t){e2.sendDataToCloud(t)}};_t.zoom2d={name:"zoom2d",_cat:"zoom",title:function(t){return yt(t,"Zoom")},attr:"dragmode",val:"zoom",icon:xt.zoombox,click:Ar};_t.pan2d={name:"pan2d",_cat:"pan",title:function(t){return yt(t,"Pan")},attr:"dragmode",val:"pan",icon:xt.pan,click:Ar};_t.select2d={name:"select2d",_cat:"select",title:function(t){return yt(t,"Box Select")},attr:"dragmode",val:"select",icon:xt.selectbox,click:Ar};_t.lasso2d={name:"lasso2d",_cat:"lasso",title:function(t){return yt(t,"Lasso Select")},attr:"dragmode",val:"lasso",icon:xt.lasso,click:Ar};_t.drawclosedpath={name:"drawclosedpath",title:function(t){return yt(t,"Draw closed freeform")},attr:"dragmode",val:"drawclosedpath",icon:xt.drawclosedpath,click:Ar};_t.drawopenpath={name:"drawopenpath",title:function(t){return yt(t,"Draw open freeform")},attr:"dragmode",val:"drawopenpath",icon:xt.drawopenpath,click:Ar};_t.drawline={name:"drawline",title:function(t){return yt(t,"Draw line")},attr:"dragmode",val:"drawline",icon:xt.drawline,click:Ar};_t.drawrect={name:"drawrect",title:function(t){return yt(t,"Draw rectangle")},attr:"dragmode",val:"drawrect",icon:xt.drawrect,click:Ar};_t.drawcircle={name:"drawcircle",title:function(t){return yt(t,"Draw circle")},attr:"dragmode",val:"drawcircle",icon:xt.drawcircle,click:Ar};_t.eraseshape={name:"eraseshape",title:function(t){return yt(t,"Erase active shape")},icon:xt.eraseshape,click:WP};_t.zoomIn2d={name:"zoomIn2d",_cat:"zoomin",title:function(t){return yt(t,"Zoom in")},attr:"zoom",val:"in",icon:xt.zoom_plus,click:Ar};_t.zoomOut2d={name:"zoomOut2d",_cat:"zoomout",title:function(t){return yt(t,"Zoom out")},attr:"zoom",val:"out",icon:xt.zoom_minus,click:Ar};_t.autoScale2d={name:"autoScale2d",_cat:"autoscale",title:function(t){return yt(t,"Autoscale")},attr:"zoom",val:"auto",icon:xt.autoscale,click:Ar};_t.resetScale2d={name:"resetScale2d",_cat:"resetscale",title:function(t){return yt(t,"Reset axes")},attr:"zoom",val:"reset",icon:xt.home,click:Ar};_t.hoverClosestCartesian={name:"hoverClosestCartesian",_cat:"hoverclosest",title:function(t){return yt(t,"Show closest data on hover")},attr:"hovermode",val:"closest",icon:xt.tooltip_basic,gravity:"ne",click:Ar};_t.hoverCompareCartesian={name:"hoverCompareCartesian",_cat:"hoverCompare",title:function(t){return yt(t,"Compare data on hover")},attr:"hovermode",val:function(t){return t._fullLayout._isHoriz?"y":"x"},icon:xt.tooltip_compare,gravity:"ne",click:Ar};function Ar(t,e){var r=e.currentTarget,a=r.getAttribute("data-attr"),i=r.getAttribute("data-val")||!0,n=t._fullLayout,o={},l=t2.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,fa.call("_guiRelayout",t,o)}_t.zoom3d={name:"zoom3d",_cat:"zoom",title:function(t){return yt(t,"Zoom")},attr:"scene.dragmode",val:"zoom",icon:xt.zoombox,click:pu};_t.pan3d={name:"pan3d",_cat:"pan",title:function(t){return yt(t,"Pan")},attr:"scene.dragmode",val:"pan",icon:xt.pan,click:pu};_t.orbitRotation={name:"orbitRotation",title:function(t){return yt(t,"Orbital rotation")},attr:"scene.dragmode",val:"orbit",icon:xt["3d_rotate"],click:pu};_t.tableRotation={name:"tableRotation",title:function(t){return yt(t,"Turntable rotation")},attr:"scene.dragmode",val:"turntable",icon:xt["z-axis"],click:pu};function pu(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,fa.call("_guiRelayout",t,o)}_t.resetCameraDefault3d={name:"resetCameraDefault3d",_cat:"resetCameraDefault",title:function(t){return yt(t,"Reset camera to default")},attr:"resetDefault",icon:xt.home,click:Np};_t.resetCameraLastSave3d={name:"resetCameraLastSave3d",_cat:"resetCameraLastSave",title:function(t){return yt(t,"Reset camera to last save")},attr:"resetLastSave",icon:xt.movie,click:Np};function Np(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)}fa.call("_guiRelayout",t,s)}_t.hoverClosest3d={name:"hoverClosest3d",_cat:"hoverclosest",title:function(t){return yt(t,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:xt.tooltip_basic,gravity:"ne",click:XP};function r2(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 XP(t,e){var r=r2(t,e);fa.call("_guiRelayout",t,r)}_t.zoomInGeo={name:"zoomInGeo",_cat:"zoomin",title:function(t){return yt(t,"Zoom in")},attr:"zoom",val:"in",icon:xt.zoom_plus,click:Hp};_t.zoomOutGeo={name:"zoomOutGeo",_cat:"zoomout",title:function(t){return yt(t,"Zoom out")},attr:"zoom",val:"out",icon:xt.zoom_minus,click:Hp};_t.resetGeo={name:"resetGeo",_cat:"reset",title:function(t){return yt(t,"Reset")},attr:"reset",val:null,icon:xt.autoscale,click:Hp};_t.hoverClosestGeo={name:"hoverClosestGeo",_cat:"hoverclosest",title:function(t){return yt(t,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:xt.tooltip_basic,gravity:"ne",click:i2};function Hp(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;fa.call("_guiRelayout",t,s+".projection.scale",u)}}a==="reset"&&_o(t,"geo")}_t.hoverClosestPie={name:"hoverClosestPie",_cat:"hoverclosest",title:function(t){return yt(t,"Toggle show closest data on hover")},attr:"hovermode",val:"closest",icon:xt.tooltip_basic,gravity:"ne",click:i2};function a2(t){var e=t._fullLayout;return e.hovermode?!1:e._has("cartesian")?e._isHoriz?"y":"x":"closest"}function i2(t){var e=a2(t);fa.call("_guiRelayout",t,"hovermode",e)}_t.resetViewSankey={name:"resetSankeyGroup",title:function(t){return yt(t,"Reset view")},icon:xt.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())}fa.call("restyle",t,e)}};_t.toggleHover={name:"toggleHover",title:function(t){return yt(t,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:xt.tooltip_basic,gravity:"ne",click:function(t,e){var r=r2(t,e);r.hovermode=a2(t),fa.call("_guiRelayout",t,r)}};_t.resetViews={name:"resetViews",title:function(t){return yt(t,"Reset views")},icon:xt.home,click:function(t,e){var r=e.currentTarget;r.setAttribute("data-attr","zoom"),r.setAttribute("data-val","reset"),Ar(t,e),r.setAttribute("data-attr","resetLastSave"),Np(t,e),_o(t,"geo"),_o(t,"mapbox"),_o(t,"map")}};_t.toggleSpikelines={name:"toggleSpikelines",title:function(t){return yt(t,"Toggle Spike Lines")},icon:xt.spikeline,attr:"_cartesianSpikesEnabled",val:"on",click:function(t){var e=t._fullLayout,r=e._cartesianSpikesEnabled;e._cartesianSpikesEnabled=r==="on"?"off":"on",fa.call("_guiRelayout",t,YP(t))}};function YP(t){for(var e=t._fullLayout,r=e._cartesianSpikesEnabled==="on",a=t2.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}_t.resetViewMapbox={name:"resetViewMapbox",_cat:"resetView",title:function(t){return yt(t,"Reset view")},attr:"reset",icon:xt.home,click:function(t){_o(t,"mapbox")}};_t.resetViewMap={name:"resetViewMap",_cat:"resetView",title:function(t){return yt(t,"Reset view")},attr:"reset",icon:xt.home,click:function(t){_o(t,"map")}};_t.zoomInMapbox={name:"zoomInMapbox",_cat:"zoomin",title:function(t){return yt(t,"Zoom in")},attr:"zoom",val:"in",icon:xt.zoom_plus,click:n2};_t.zoomInMap={name:"zoomInMap",_cat:"zoomin",title:function(t){return yt(t,"Zoom in")},attr:"zoom",val:"in",icon:xt.zoom_plus,click:o2};_t.zoomOutMapbox={name:"zoomOutMapbox",_cat:"zoomout",title:function(t){return yt(t,"Zoom out")},attr:"zoom",val:"out",icon:xt.zoom_minus,click:n2};_t.zoomOutMap={name:"zoomOutMap",_cat:"zoomout",title:function(t){return yt(t,"Zoom out")},attr:"zoom",val:"out",icon:xt.zoom_minus,click:o2};function n2(t,e){l2(t,e,"mapbox")}function o2(t,e){l2(t,e,"map")}function l2(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}fa.call("_guiRelayout",t,s)}function _o(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]}fa.call("_guiRelayout",t,i)}var s2=HT.exports,f2=s2,qP=Object.keys(f2),c2=["drawline","drawopenpath","drawclosedpath","drawcircle","drawrect","eraseshape"],u2=["v1hovermode","hoverclosest","hovercompare","togglehover","togglespikelines"].concat(c2),ho=[],ZP=function(t){if(u2.indexOf(t._cat||t.name)===-1){var e=t.name,r=(t._cat||t.name).toLowerCase();ho.indexOf(e)===-1&&ho.push(e),ho.indexOf(r)===-1&&ho.push(r)}};qP.forEach(function(t){ZP(f2[t])});ho.sort();var v2={DRAW_MODES:c2,backButtons:u2,foreButtons:ho},t0=v2,d2={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 *"+t0.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 *"+t0.foreButtons.join("*, *")+"*."].join(" ")}},KP=be,cl=ct,QP=Lt,JP=d2,eE=function(e,r){var a=e.modebar||{},i=QP.newContainer(r,"modebar");function n(l,s){return KP.coerce(a,i,JP,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")},Op=ut,tE=ht,mu=be,h2=Lp,rE=Oc.version,aE=new DOMParser;function p2(t){this.container=t.container,this.element=document.createElement("div"),this.update(t.graphInfo,t.buttons),this.container.appendChild(this.element)}var Ga=p2.prototype;Ga.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(),mu.setStyleOnHover("#"+i+" .modebar-btn",".active",".icon path","fill: "+n.activecolor,"fill: "+n.color,this.element)};Ga.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)})};Ga.createGroup=function(){var t=document.createElement("div");t.className="modebar-group";var e=this.graphInfo._fullLayout.modebar;return t.style.backgroundColor=e.bgcolor,t};Ga.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&&Op.select(r).classed("active",!0);var o=t.icon;return typeof o=="function"?r.appendChild(o()):r.appendChild(this.createIcon(o||h2.question)),r.setAttribute("data-gravity",t.gravity||"n"),r};Ga.createIcon=function(t){var e=tE(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=aE.parseFromString(t.svg,"application/xml");a=n.childNodes[0]}return a.setAttribute("height","1em"),a.setAttribute("width","1em"),a};Ga.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=Op.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:mu.nestedProperty(e,n).get();l.classed("active",c===i),s(a,c===i)}})};Ga.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 iE(t){return t+" (v"+rE+")"}Ga.getLogo=function(){var t=this.createGroup(),e=document.createElement("a");return e.href="https://plotly.com/",e.target="_blank",e.setAttribute("data-title",iE(mu._(this.graphInfo,"Produced with Plotly.js"))),e.className="modebar-btn plotlyjsicon modebar-btn--logo",e.appendChild(this.createIcon(h2.newplotlylogo)),t.appendChild(e),t};Ga.removeAllButtons=function(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.hasLogo=!1};Ga.destroy=function(){mu.removeElement(this.container.querySelector(".modebar"))};function nE(t,e){var r=t._fullLayout,a=new p2({graphInfo:t,container:r._modebardiv.node(),buttons:e});return r._privateplot&&Op.select(a.element).append("span").classed("badge-private float--left",!0).text("PRIVATE"),a}var oE=nE,lE=Xt,r0=kr,fh=Je,sE=sa.isUnifiedHover,fE=oE,xc=s2,cE=v2.DRAW_MODES,uE=be.extendDeep,vE=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=gE(n):!a.displayModeBar&&a.watermark?o=[]:o=dE(e),i?i.update(e,o):r._modeBar=fE(e,o)};function dE(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=hE(e),x=sE(e.hovermode),w=[];function T(P){if(P.length){for(var k=[],C=0;C<P.length;C++){for(var $=P[C],I=xc[$],j=I.name.toLowerCase(),G=(I._cat||I.name).toLowerCase(),X=!1,O=0;O<s.length;O++){var q=s[O].toLowerCase();if(q===j||q===G){X=!0;break}}X||k.push(xc[$])}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"),(mE(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"]),pE(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(),cE.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),yE(w,l)}function hE(t){for(var e=lE.list({_fullLayout:t},null,!0),r=0;r<e.length;r++)if(!e[r].fixedrange)return!1;return!0}function pE(t){for(var e=!1,r=0;r<t.length&&!e;r++){var a=t[r];!a._module||!a._module.selectPoints||(fh.traceIs(a,"scatter-like")?(r0.hasMarkers(a)||r0.hasText(a))&&(e=!0):fh.traceIs(a,"box-violin")?(a.boxpoints==="all"||a.points==="all")&&(e=!0):e=!0)}return e}function mE(t){for(var e=0;e<t.length;e++)if(!fh.traceIs(t[e],"noHover"))return!1;return!0}function yE(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 gE(t){for(var e=uE([],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(xc[n]!==void 0)e[r][i]=xc[n];else throw new Error(["*modeBarButtons* configuration options","invalid button name"].join(" "))}return e}var m2={moduleType:"component",name:"modebar",layoutAttributes:d2,supplyLayoutDefaults:eE,manage:vE},ri={},bE=Sr.FROM_BL,y2=function(e,r,a){a===void 0&&(a=bE[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()},Ji=be,gv=gs,ya=Xt.id2name,xE=Oa,a0=y2,_E=pp,wE=Wt.ALMOST_EQUAL,TE=Sr.FROM_BL;ri.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=ya(a[l]),u=t[c],v=e[c],kE(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[ya(f)][M]=s}}for(h(o,"_matchGroup"),l=0;l<n.length;l++){s=n[l];for(f in s)if(v=e[ya(f)],v.fixedrange){for(var m in s){var y=ya(m);(t[y]||{}).fixedrange===!1&&Ji.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[ya(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=ya(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[ya(f)],v[p]=p==="range"?d.slice():d,p==="rangebreaks"&&(v._hasDayOfWeekBreaks=g,_E(v,e))}}};function kE(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 Ji.coerce(t,e,xE,E,F)}p("constrain",n?"domain":"range"),Ji.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[ya(m)];b.type===d&&y.push(m)}var _=g2(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=Ji.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=Ji.coerce(t,e,{scaleanchor:{valType:"enumerated",values:y.concat([!1])}},"scaleanchor",A)),w){e._matchGroup=bv(l,u,w,1);var M=i[ya(w)],S=i0(i,e)/i0(i,M);v!==(w.charAt(0)==="x")&&(S=(v?"x":"y")+S),bv(o,u,w,S)}else t.matches&&a.indexOf(t.matches)!==-1&&Ji.warn("ignored "+e._name+'.matches: "'+t.matches+'" to avoid an infinite loop');if(T){var L=p("scaleratio");L||(L=e.scaleratio=1),bv(o,u,T,L)}else t.scaleanchor&&a.indexOf(t.scaleanchor)!==-1&&Ji.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 i0(t,e){var r=e.domain;return r||(r=t[ya(e.overlaying)].domain),r[1]-r[0]}function g2(t,e){for(var r=0;r<t.length;r++)if(t[r][e])return t[r];return null}function bv(t,e,r,a){var i,n,o,l,s,f=g2(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]=xv(u,xv(a,f[l]));t.splice(s,1);return}if(a!==1)for(n=0;n<c.length;n++){var v=c[n];f[v]=xv(a,f[v])}f[r]=1}function xv(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 AE(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}ri.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=AE(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[ya(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>wE*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")a0(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(),a0(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=gv.makePadFn(r,s,0),z=gv.makePadFn(r,s,1);n0(s,u);var H=Math.abs(s._m),D=gv.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 I=(S-M)/(2*L);u/=I,M=s.l2r(M),S=s.l2r(S),s.range=s._input.range=w<T?[M,S]:[S,M]}n0(s,u)}}}};ri.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};ri.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 n0(t,e){var r=t._inputDomain,a=TE[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=ut,r=Je,a=Kt,i=be,n=or,o=Sp,l=ct,s=kt,f=au,c=m2,u=Ct,v=Sr,p=ri,d=p.enforce,h=p.clean,m=gs.doAutoRange,y="start",b="middle",_="end",g=gr.zindexSeparator;t.layoutStyles=function(k){return i.syncOrAsync([a.doAutoMargin,w],k)};function x(k,C,$){for(var I=0;I<$.length;I++){var j=$[I][0],G=$[I][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,I=$.p,j=u.list(k,"",!0),G,X,O,q,W,Y;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(Ne,R,U){var V=Ne._lw/2;if(Ne._id.charAt(0)==="x"){if(R){if(U==="top")return R._offset-I-V}else return $.t+$.h*(1-(Ne.position||0))+V%1;return R._offset+R._length+I+V}if(R){if(U==="right")return R._offset+R._length+I+V}else return $.l+$.w*(Ne.position||0)+V%1;return R._offset-I-V}for(G=0;G<j.length;G++){q=j[G];var Q=q._anchorAxis;q._linepositions={},q._lw=s.crispRound(k,q.linewidth,1),q._mainLinePosition=B(q,Q,q.side),q._mainMirrorPosition=q.mirror&&Q?B(q,Q,v.OPPOSITE_SIDE[q.side]):null}var ee=[],fe=[],oe=[],se=l.opacity(C.paper_bgcolor)===1&&l.opacity(C.plot_bgcolor)===1&&C.paper_bgcolor===C.plot_bgcolor;for(X in C._plots)if(O=C._plots[X],O.mainplot)O.bg&&O.bg.remove(),O.bg=void 0;else{var de=O.xaxis.domain,ye=O.yaxis.domain,_e=O.plotgroup;if(x(de,ye,oe)&&X.indexOf(g)===-1){var Se=_e.node(),pe=O.bg=i.ensureSingle(_e,"rect","bg");Se.insertBefore(pe.node(),Se.childNodes[0]),fe.push(X)}else _e.select("rect.bg").remove(),oe.push([de,ye]),se||(ee.push(X),fe.push(X))}var ve=C._bgLayer.selectAll(".bg").data(ee);for(ve.enter().append("rect").classed("bg",!0),ve.exit().remove(),ve.each(function(Ne){C._plots[Ne].bg=e.select(this)}),G=0;G<fe.length;G++)O=C._plots[fe[G]],W=O.xaxis,Y=O.yaxis,O.bg&&W._offset!==void 0&&Y._offset!==void 0&&O.bg.call(s.setRect,W._offset-I,Y._offset-I,W._length+2*I,Y._length+2*I).call(l.fill,C.plot_bgcolor).style("stroke-width",0);if(!C._hasOnlyLargeSploms)for(X in C._plots){O=C._plots[X],W=O.xaxis,Y=O.yaxis;var Me=O.clipId="clip"+C._uid+X+"plot",Pe=i.ensureSingleById(C._clips,"clipPath",Me,function(Ne){Ne.classed("plotclip",!0).append("rect")});O.clipRect=Pe.select("rect").attr({width:W._length,height:Y._length}),s.setTranslate(O.plot,W._offset,Y._offset);var ce,Le;O._hasClipOnAxisFalse?(ce=null,Le=Me):(ce=Me,Le=null),s.setClipUrl(O.plot,ce,k),O.layerClipId=Le}var Ce,J,xe,Z,ke,Te,le,ie,me,he,Ae,we,De;function Ie(Ne){return"M"+Ce+","+Ne+"H"+J}function Ge(Ne){return"M"+W._offset+","+Ne+"h"+W._length}function ue(Ne){return"M"+Ne+","+ie+"V"+le}function He(Ne){return Y._shift!==void 0&&(Ne+=Y._shift),"M"+Ne+","+Y._offset+"v"+Y._length}function je(Ne,R,U){if(!Ne.showline||X!==Ne._mainSubplot)return"";if(!Ne._anchorAxis)return U(Ne._mainLinePosition);var V=R(Ne._mainLinePosition);return Ne.mirror&&(V+=R(Ne._mainMirrorPosition)),V}for(X in C._plots){O=C._plots[X],W=O.xaxis,Y=O.yaxis;var Fe="M0,0";T(W,X)&&(ke=M(W,"left",Y,j),Ce=W._offset-(ke?I+ke:0),Te=M(W,"right",Y,j),J=W._offset+W._length+(Te?I+Te:0),xe=B(W,Y,"bottom"),Z=B(W,Y,"top"),De=!W._anchorAxis||X!==W._mainSubplot,De&&(W.mirror==="allticks"||W.mirror==="all")&&(W._linepositions[X]=[xe,Z]),Fe=je(W,Ie,Ge),De&&W.showline&&(W.mirror==="all"||W.mirror==="allticks")&&(Fe+=Ie(xe)+Ie(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",Fe);var qe="M0,0";T(Y,X)&&(Ae=M(Y,"bottom",W,j),le=Y._offset+Y._length+(Ae?I:0),we=M(Y,"top",W,j),ie=Y._offset-(we?I:0),me=B(Y,W,"left"),he=B(Y,W,"right"),De=!Y._anchorAxis||X!==Y._mainSubplot,De&&(Y.mirror==="allticks"||Y.mirror==="all")&&(Y._linepositions[X]=[me,he]),qe=je(Y,ue,He),De&&Y.showline&&(Y.mirror==="all"||Y.mirror==="allticks")&&(qe+=ue(me)+ue(he)),O.ylines.style("stroke-width",Y._lw+"px").call(l.stroke,Y.showline?Y.linecolor:"rgba(0,0,0,0)")),O.ylines.attr("d",qe)}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 I=$._anchorAxis;if(!I)return!1;var j=v.FROM_BL[C];return $.side===C?I.domain[j]===k.domain[j]:$.mirror&&I.domain[1-j]===k.domain[1-j]}function M(k,C,$,I){if(A(k,C,$))return $._lw;for(var j=0;j<I.length;j++){var G=I[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,I=D($),j=P($),G=z($,j),X=N($,I);if(f.draw(k,"gtitle",{propContainer:$,propName:"title.text",subtitlePropName:"title.subtitle.text",placeholder:$._dfltTitle.plot,subtitlePlaceholder:$._dfltTitle.subtitle,attributes:{x:X,y:G,"text-anchor":I,dy:j}}),C.text&&C.automargin){var O=e.selectAll(".gtitle"),q=s.bBox(e.selectAll(".g-gtitle").node()).height,W=E(k,C,q);if(W>0){F(k,G,W,q),O.attr({x:X,y:G,"text-anchor":I,dy:H(C.yanchor)}).call(n.positionText,X,G);var Y=(C.text.match(n.BR_TAG_ALL)||[]).length;if(Y){var B=v.LINE_SPACING*Y+v.MID_SHIFT;C.y===0&&(B=-B),O.selectAll(".line").each(function(){var se=+this.getAttribute("dy").slice(0,-2)-B+"em";this.setAttribute("dy",se)})}var Q=e.selectAll(".gtitle-subtitle");if(Q.node()){var ee=O.node().getBBox(),fe=ee.y+ee.height,oe=fe+f.SUBTITLE_PADDING_EM*C.subtitle.font.size;Q.attr({x:X,y:oe,"text-anchor":I,dy:H(C.yanchor)}).call(n.positionText,X,oe)}}}};function S(k,C,$,I,j){var G=C.yref==="paper"?k._fullLayout._size.h:k._fullLayout.height,X=i.isTopAnchor(C)?I:I-j,O=$==="b"?G-X:X;return i.isTopAnchor(C)&&$==="t"||i.isBottomAnchor(C)&&$==="b"?!1:O<j}function L(k,C,$,I,j){var G=0;return $==="middle"&&(G+=j/2),k==="t"?($==="top"&&(G+=j),G+=I-C*I):($==="bottom"&&(G+=j),G+=C*I),G}function E(k,C,$){var I=C.y,j=C.yanchor,G=I>.5?"t":"b",X=k._fullLayout.margin[G],O=0;return C.yref==="paper"?O=$+C.pad.t+C.pad.b:C.yref==="container"&&(O=L(G,I,j,k._fullLayout.height,$)+C.pad.t+C.pad.b),O>X?O:0}function F(k,C,$,I){var j="title.automargin",G=k._fullLayout.title,X=G.y>.5?"t":"b",O={x:G.x,y:G.y,t:0,b:0},q={};G.yref==="paper"&&S(k,G,X,C,I)?O[X]=$:G.yref==="container"&&(q[X]=$,k._fullLayout._reservedMargin[j]=q),a.allowAutoMargin(k,j),a.autoMargin(k,j,O)}function N(k,C){var $=k.title,I=k._size,j=0;switch(C===y?j=$.pad.l:C===_&&(j=-$.pad.r),$.xref){case"paper":return I.l+I.w*$.x+j;case"container":default:return k.width*$.x+j}}function z(k,C){var $=k.title,I=k._size,j=0;if(C==="0em"||!C?j=-$.pad.b:C===v.CAP_SHIFT+"em"&&(j=$.pad.t),$.y==="auto")return I.t/2;switch($.yref){case"paper":return I.t+I.h-I.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,$=[],I;for(I=0;I<C.length;I++){var j=C[I],G=j[0]||{},X=G.trace||{},O=X._module||{},q=O.arraysToCalcdata;q&&q(j,X);var W=O.editStyle;W&&$.push({fn:W,cd0:G})}if($.length){for(I=0;I<$.length;I++){var Y=$[I];Y.fn(k,Y.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 I=C._basePlotModules[$].updateFx;I&&I(k)}return a.previousPromises(k)},t.doCamera=function(k){for(var C=k._fullLayout,$=C._subplots.gl3d,I=0;I<$.length;I++){var j=C[$[I]],G=j._scene;G.setViewport(j)}},t.drawData=function(k){var C=k._fullLayout;o(k);for(var $=C._basePlotModules,I=0;I<$.length;I++)$[I].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,I=[],j=[],G,X;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(I,O.xaxis+O.yaxis):O.type==="scatterpolargl"&&i.pushUnique(j,O.subplot))}for(G=0;G<I.length;G++)X=C._plots[I[G]],X._scene&&X._scene.draw();for(G=0;G<j.length;G++)X=C[j[G]]._subplot,X._scene&&X._scene.draw()}},t.doAutoRangeAndConstraints=function(k){for(var C=u.list(k,"",!0),$,I={},j=0;j<C.length;j++)if($=C[j],!I[$._id]){I[$._id]=1,h(k,$),m(k,$);var G=$._matchGroup;if(G)for(var X in G){var O=u.getFromId(k,X);m(k,O,$.range),I[X]=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)}})(cu);var ME=Pi.readPaths,SE=zp,b2=Sn.clearOutlineControllers,_v=ct,x2=kt,LE=Lt.arrayEditor,_2=Ei,CE=_2.getPathString,w2={draw:yu,drawOne:T2,activateLastSelection:PE};function yu(t){var e=t._fullLayout;b2(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++)T2(t,i)}function gu(t){return t._context.editSelection}function T2(t,e){t._fullLayout._paperdiv.selectAll('.selectionlayer [data-index="'+e+'"]').remove();var r=_2.makeSelectionsOptionsAndPlotinfo(t,e),a=r.options,i=r.plotinfo;if(!a._input)return;n(t._fullLayout._selectionLayer);function n(o){var l=CE(t,a),s={"data-index":e,"fill-rule":"evenodd",d:l},f=a.opacity,c="rgba(0,0,0,0)",u=a.line.color||_v.contrast(t._fullLayout.plot_bgcolor),v=a.line.width,p=a.line.dash;v||(v=5,p="solid");var d=gu(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(_v.stroke,u).call(_v.fill,c).call(x2.dashLine,m?"solid":p,m?4+v:v);if(DE(y,t,a),d){var b=LE(t.layout,"selections",a);y.style({cursor:"move"});var _={element:y.node(),plotinfo:i,gd:t,editHelpers:b,isActiveSelection:!0},g=ME(l,t);SE(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 $E(t,x)})}}function DE(t,e,r){var a=r.xref+r.yref;x2.setClipUrl(t,"clip"+e._fullLayout._uid+a,e)}function $E(t,e){if(gu(t)){var r=e.node(),a=+r.getAttribute("data-index");if(a>=0){if(a===t._fullLayout._activeSelectionIndex){ch(t);return}t._fullLayout._activeSelectionIndex=a,t._fullLayout._deactivateSelection=ch,yu(t)}}}function PE(t){if(gu(t)){var e=t._fullLayout.selections.length-1;t._fullLayout._activeSelectionIndex=e,t._fullLayout._deactivateSelection=ch,yu(t)}}function ch(t){if(gu(t)){var e=t._fullLayout._activeSelectionIndex;e>=0&&(b2(t),delete t._fullLayout._activeSelectionIndex,yu(t))}}var k2={exports:{}},wv=Vc.dot,rf=Wt.BADNUM,_c=k2.exports={};_c.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===rf||m<a||m>i||y===rf||y<n||y>o||h&&f(d))}function u(d,h){var m=d[0],y=d[1];if(m===rf||m<a||m>i||y===rf||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}};_c.isSegmentBent=function(e,r,a,i){var n=e[r],o=[e[a][0]-n[0],e[a][1]-n[1]],l=wv(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=wv(u,o),v<0||v>l||Math.abs(wv(u,f))>i)return!0;return!1};_c.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||_c.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 A2=k2.exports,EE={BENDPX:1.5,MINSELECT:12,SELECTDELAY:100,SELECTID:"-select"},o0=rS,zE=aS,Kl=Je,RE=kt.dashStyle,ul=ct,IE=Ta,FE=sa.makeEventData,bs=Dn,NE=bs.freeMode,HE=bs.rectMode,Ql=bs.drawMode,jp=bs.openMode,Bp=bs.selectMode,l0=Ei,s0=vu,M2=zp,S2=Sn.clearOutline,L2=Pi,Tv=L2.handleEllipse,OE=L2.readPaths,jE=$p.newShapes,BE=UT,GE=w2.activateLastSelection,Gf=be,UE=Gf.sorterAsc,C2=A2,vl=Kc,ta=Xt.getFromId,VE=Sp,WE=cu.redrawReglTraces,Uf=EE,$a=Uf.MINSELECT,XE=C2.filter,Gp=C2.tester,Up=Dp,f0=Up.p2r,YE=Up.axValue,qE=Up.getTransform;function Vp(t){return t.subplot!==void 0}function ZE(t,e,r,a,i){var n=!Vp(a),o=NE(i),l=HE(i),s=jp(i),f=Ql(i),c=Bp(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=qE(_),x=e-b.left,w=r-b.top;h._calcInverseTransform(d);var T=Gf.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&&!(Ql(i)&&s),P,k,C,$,I,j,G;$2(t,d,a),o&&(P=XE([[x,w]],Uf.BENDPX));var X=y.selectAll("path.select-outline-"+_.id).data([1]),O=f?h.newshape:h.newselection;f&&(a.hasText=O.label.text||O.label.texttemplate);var q=f&&!s?O.fillcolor:"rgba(0,0,0,0)",W=O.line.color||(n?ul.contrast(d._fullLayout.plot_bgcolor):"#7f7f7f");X.enter().append("path").attr("class","select-outline select-outline-"+_.id).style({opacity:f?O.opacity/2:1,"stroke-dasharray":RE(O.line.dash,O.line.width),"stroke-width":O.line.width+"px","shape-rendering":"crispEdges"}).call(ul.stroke,W).call(ul.fill,q).attr("fill-rule","evenodd").classed("cursor-move",!!f).attr("transform",g).attr("d",E+"Z");var Y=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 Q=h._uid+Uf.SELECTID,ee=[],fe=bu(d,a.xaxes,a.yaxes,a.subplot);m&&!t.shiftKey&&(a._clearSubplotSelections=function(){if(n){var se=F._id,de=N._id;I2(d,se,de,fe);for(var ye=(d.layout||{}).selections||[],_e=[],Se=!1,pe=0;pe<ye.length;pe++){var ve=h.selections[pe];!ve||ve.xref!==se||ve.yref!==de?_e.push(ye[pe]):Se=!0}Se&&(d._fullLayout._noEmitSelectedAtStart=!0,Kl.call("_guiRelayout",d,{selections:_e}))}});var oe=cz(a);a.moveFn=function(se,de){a._clearSubplotSelections&&(a._clearSubplotSelections(),a._clearSubplotSelections=void 0),S=Math.max(0,Math.min(z,A*se+x)),L=Math.max(0,Math.min(H,M*de+w));var ye=Math.abs(S-x),_e=Math.abs(L-w);if(l){var Se,pe,ve;if(c){var Me=h.selectdirection;switch(Me==="any"?_e<Math.min(ye*.6,$a)?Se="h":ye<Math.min(_e*.6,$a)?Se="v":Se="d":Se=Me,Se){case"h":pe=v?H/2:0,ve=H;break;case"v":pe=v?z/2:0,ve=z;break}}if(f)switch(h.newshape.drawdirection){case"vertical":Se="h",pe=v?H/2:0,ve=H;break;case"horizontal":Se="v",pe=v?z/2:0,ve=z;break;case"ortho":ye<_e?(Se="h",pe=w,ve=L):(Se="v",pe=x,ve=S);break;default:Se="d"}Se==="h"?($=p?Tv(v,[S,pe],[S,ve]):[[x,pe],[x,ve],[S,ve],[S,pe]],$.xmin=p?S:Math.min(x,S),$.xmax=p?S:Math.max(x,S),$.ymin=Math.min(pe,ve),$.ymax=Math.max(pe,ve),Y.attr("d","M"+$.xmin+","+(w-$a)+"h-4v"+2*$a+"h4ZM"+($.xmax-1)+","+(w-$a)+"h4v"+2*$a+"h-4Z")):Se==="v"?($=p?Tv(v,[pe,L],[ve,L]):[[pe,w],[pe,L],[ve,L],[ve,w]],$.xmin=Math.min(pe,ve),$.xmax=Math.max(pe,ve),$.ymin=p?L:Math.min(w,L),$.ymax=p?L:Math.max(w,L),Y.attr("d","M"+(x-$a)+","+$.ymin+"v-4h"+2*$a+"v4ZM"+(x-$a)+","+($.ymax-1)+"v4h"+2*$a+"v-4Z")):Se==="d"&&($=p?Tv(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),Y.attr("d","M0,0Z"))}else o&&(P.addPt([S,L]),$=P.filtered);if(a.selectionDefs&&a.selectionDefs.length?(C=P2(a.mergedPolygons,$,D),$.subtract=D,k=Wp(a.selectionDefs.concat([$]))):(C=[$],k=Gp($)),M2(z2(C,s),X,a),c){var Pe=uh(d,!1),ce=Pe.eventData?Pe.eventData.points.slice():[];Pe=uh(d,!1,k,fe,a),k=Pe.selectionTesters,G=Pe.eventData;var Le;P?Le=P.filtered:Le=F2(C),vl.throttle(Q,Uf.SELECTDELAY,function(){ee=R2(k,fe);for(var Ce=ee.slice(),J=0;J<ce.length;J++){for(var xe=ce[J],Z=!1,ke=0;ke<Ce.length;ke++)if(Ce[ke].curveNumber===xe.curveNumber&&Ce[ke].pointNumber===xe.pointNumber){Z=!0;break}Z||Ce.push(xe)}Ce.length&&(G||(G={}),G.points=Ce),oe(G,Le),uz(d,G)})}},a.clickFn=function(se,de){if(Y.remove(),d._fullLayout._activeShapeIndex>=0){d._fullLayout._deactivateShape(d);return}if(!f){var ye=h.clickmode;vl.done(Q).then(function(){if(vl.clear(Q),se===2){for(X.remove(),I=0;I<fe.length;I++)j=fe[I],j._module.selectPoints(j,!1);if(es(d,fe),Jl(a),Yp(d),fe.length){var _e=fe[0].xaxis,Se=fe[0].yaxis;if(_e&&Se){for(var pe=[],ve=d._fullLayout.selections,Me=0;Me<ve.length;Me++){var Pe=ve[Me];Pe&&(Pe.xref!==_e._id||Pe.yref!==Se._id)&&pe.push(Pe)}pe.length<ve.length&&(d._fullLayout._noEmitSelectedAtStart=!0,Kl.call("_guiRelayout",d,{selections:pe}))}}}else ye.indexOf("select")>-1&&D2(de,d,a.xaxes,a.yaxes,a.subplot,a,X),ye==="event"&&ts(d,void 0);IE.click(d,de,_.id)}).catch(Gf.error)}},a.doneFn=function(){Y.remove(),vl.done(Q).then(function(){vl.clear(Q),!m&&$&&a.selectionDefs&&($.subtract=D,a.selectionDefs.push($),a.mergedPolygons.length=0,[].push.apply(a.mergedPolygons,C)),(m||f)&&Jl(a,m),a.doneFnCompleted&&a.doneFnCompleted(ee),c&&ts(d,G)}).catch(Gf.error)}}function D2(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(tz(l)){$2(t,e,n),v=bu(e,r,a,i);var w=rz(l,v),T=w.pointNumbers.length>0;if(T?az(v,w):iz(v)&&(b=u0(w))){for(o&&o.remove(),x=0;x<v.length;x++)p=v[x],p._module.selectPoints(p,!1);es(e,v),Jl(n),c&&Yp(e)}else{_=t.shiftKey&&(b!==void 0?b:u0(w)),d=KE(w.pointNumber,w.searchInfo,_);var A=n.selectionDefs.concat([d]);for(h=Wp(A),x=0;x<v.length;x++)if(m=v[x]._module.selectPoints(v[x],h),y=E2(m,v[x]),u.length)for(var M=0;M<y.length;M++)u.push(y[M]);else u=y;if(g={points:u},es(e,v,g),d&&n&&n.selectionDefs.push(d),o){var S=n.mergedPolygons,L=jp(n.dragmode);M2(z2(S,L),o,n)}c&&ts(e,g)}}}function KE(t,e,r){return{pointNumber:t,searchInfo:e,subtract:!!r}}function kv(t){return"pointNumber"in t&&"searchInfo"in t}function QE(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 Wp(t){if(!t.length)return;for(var e=[],r=kv(t[0])?0:t[0][0][0],a=r,i=kv(t[0])?0:t[0][0][1],n=i,o=0;o<t.length;o++)if(kv(t[o]))e.push(QE(t[o]));else{var l=Gp(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 $2(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)&&!(Ql(n)&&jp(n));o&&l&&i.selection&&i.selection.selectionDefs&&!r.selectionDefs?(r.selectionDefs=i.selection.selectionDefs,r.mergedPolygons=i.selection.mergedPolygons):(!l||!i.selection)&&Jl(r),o||(S2(e),a._lastSelectedSubplot=i.id)}function JE(t){return t._fullLayout._activeShapeIndex>=0}function ez(t){return t._fullLayout._activeSelectionIndex>=0}function Jl(t,e){var r=t.dragmode,a=t.plotinfo,i=t.gd;JE(i)&&i._fullLayout._deactivateShape(i),ez(i)&&i._fullLayout._deactivateSelection(i);var n=i._fullLayout,o=n._zoomlayer,l=Ql(r),s=Bp(r);if(l||s){var f=o.selectAll(".select-outline-"+a.id);if(f&&i._fullLayout._outlining){var c;l&&(c=jE(f,t)),c&&Kl.call("_guiRelayout",i,{shapes:c});var u;s&&!Vp(t)&&(u=BE(f,t)),u&&(i._fullLayout._noEmitSelectedAtStart=!0,Kl.call("_guiRelayout",i,{selections:u}).then(function(){e&&GE(i)})),i._fullLayout._outlining=!1}}a.selection={},a.selection.selectionDefs=t.selectionDefs=[],a.selection.mergedPolygons=t.mergedPolygons=[]}function c0(t){return t._id}function bu(t,e,r,a){if(!t.calcdata)return[];var i=[],n=e.map(c0),o=r.map(c0),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(Vp({subplot:a})&&(s.subplot===a||s.geo===a))i.push(af(s._module,l,e[0],r[0]));else if(s.type==="splom"){if(s._xaxes[n[0]]&&s._yaxes[o[0]]){var c=af(s._module,l,e[0],r[0]);c.scene=t._fullLayout._splomScenes[s.uid],i.push(c)}}else if(s.type==="sankey"){var u=af(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(af(s._module,l,ta(t,s.xaxis),ta(t,s.yaxis)))}return i}function af(t,e,r,a){return{_module:t,cd:e,xaxis:r,yaxis:a}}function tz(t){return t&&Array.isArray(t)&&t[0].hoverOnBox!==!0}function rz(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 u0(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 az(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 iz(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 es(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;nz(t,e)}function nz(t,e){for(var r=!1,a=0;a<e.length;a++){var i=e[a],n=i.cd;Kl.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&&(VE(t),WE(t))}function P2(t,e,r){for(var a=r?o0.difference:o0.union,i=a({regions:t},{regions:[e]}),n=i.regions.reverse(),o=0;o<n.length;o++){var l=n[o];l.subtract=Xp(l,n.slice(0,o))}return n}function E2(t,e){if(Array.isArray(t))for(var r=e.cd,a=e.cd[0].trace,i=0;i<t.length;i++)t[i]=FE(t[i],a,r);return t}function z2(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 R2(t,e){for(var r=[],a,i,n=0;n<e.length;n++){var o=e[n];i=o._module.selectPoints(o,t),a=E2(i,o),r=r.concat(a)}return r}function uh(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=v0(t),v=t._fullLayout;if(o){var p=v._zoomlayer,d=v.dragmode,h=Ql(d),m=Bp(d);if(h||m){var y=ta(t,l,"x"),b=ta(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=OE(x,t,o),T=[],A=0;A<w.length;A++){for(var M=w[A],S=[],L=0;L<M.length;L++)S.push([mi(y,M[L][1]),mi(b,M[L][2])]);S.xref=l,S.yref=s,S.subtract=Xp(S,T),T.push(S)}u=u.concat(T)}}}}var E=l&&s?[l+s]:v._subplots.cartesian;oz(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=sz(u,D,P,k),k){var C=a;if(!n){var $=ta(t,D,"x"),I=ta(t,P,"y");C=bu(t,[$],[I],z);for(var j=0;j<C.length;j++){var G=C[j],X=G.cd[0],O=X.trace;if(G._module.name==="scattergl"&&!X.t.xpx){var q=O.x,W=O.y,Y=O._length;X.t.xpx=[],X.t.ypx=[];for(var B=0;B<Y;B++)X.t.xpx[B]=$.c2p(q[B]),X.t.ypx[B]=I.c2p(W[B])}G._module.name==="splom"&&(F[O.uid]||(F[O.uid]=!0))}}var Q=R2(k,C);f=f.concat(Q),c=c.concat(C)}}var ee={points:f};es(t,c,ee);var fe=v.clickmode,oe=fe.indexOf("event")>-1&&e;if(!o&&e){var se=v0(t,!0);if(se.length){var de=se[0].xref,ye=se[0].yref;if(de&&ye){var _e=F2(se),Se=N2([ta(t,de,"x"),ta(t,ye,"y")]);Se(ee,_e)}}t._fullLayout._noEmitSelectedAtStart?t._fullLayout._noEmitSelectedAtStart=!1:oe&&ts(t,ee),v._reselect=!1}if(!o&&v._deselect){var pe=v._deselect;l=pe.xref,s=pe.yref,lz(l,s,c)||I2(t,l,s,a),oe&&(ee.points.length?ts(t,ee):Yp(t)),v._deselect=!1}return{eventData:ee,selectionTesters:r}}function oz(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 lz(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 I2(t,e,r,a){a=bu(t,[ta(t,e,"x")],[ta(t,r,"y")],e+r);for(var i=0;i<a.length;i++){var n=a[i];n._module.selectPoints(n,!1)}es(t,a)}function sz(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=P2(i,o,l),a=Wp(i)}else i=[o],a=Gp(o)}return a}function v0(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=ta(t,s,"x"),u=ta(t,f,"y"),v,p,d,h,m;if(l.type==="rect"){m=[];var y=mi(c,l.x0),b=mi(c,l.x1),_=mi(u,l.y0),g=mi(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=l0.extractPathCoords(A,s0.paramIsX,"raw"),S=l0.extractPathCoords(A,s0.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=mi(c,M[L]),F=mi(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=Xp(m,w),w.push(m),r.push(m)}}}}return r}function Xp(t,e){for(var r=!1,a=0;a<e.length;a++)for(var i=e[a],n=0;n<t.length;n++)if(zE(t[n],i)){r=!r;break}return r}function mi(t,e){return t.type==="date"&&(e=e.replace("_"," ")),t.type==="log"?t.c2p(e):t.r2p(e,null,t.calendar)}function F2(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 fz(r)}function fz(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 N2(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]=[f0(o,f),f0(o,c)].sort(UE))}else i||(i={}),i[l]=r.map(YE(o))}a&&(e.range=a),i&&(e.lassoPoints=i)}}function cz(t){var e=t.plotinfo;return e.fillRangeItems||N2(t.xaxes.concat(t.yaxes))}function uz(t,e){t.emit("plotly_selecting",e)}function ts(t,e){e&&(e.selections=(t.layout||{}).selections||[]),t.emit("plotly_selected",e)}function Yp(t){t.emit("plotly_deselect",null)}var vz={reselect:uh,prepSelect:ZE,clearOutline:S2,clearSelectionsCache:Jl,selectOnClick:D2},H2=[{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}],xu={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(" ")}},d0=H2,h0=fr,nf=gr,dz=Lt.templatedArray,of=xu;function p0(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 m0(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 xs=dz("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:h0({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:d0.length,dflt:1,editType:"arraydraw",description:"Sets the end annotation arrow head style."},startarrowhead:{valType:"integer",min:0,max:d0.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:[m0("x","left","right")].join(" ")},ay:{valType:"any",editType:"calc+arraydraw",description:[m0("y","top","bottom")].join(" ")},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",nf.idRegex.x.toString()],editType:"calc",description:["Indicates in what coordinates the tail of the","annotation (ax,ay) is specified.",of.axisRefDescription("x","left","right"),p0("x")].join(" ")},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",nf.idRegex.y.toString()],editType:"calc",description:["Indicates in what coordinates the tail of the","annotation (ax,ay) is specified.",of.axisRefDescription("y","bottom","top"),p0("y")].join(" ")},xref:{valType:"enumerated",values:["paper",nf.idRegex.x.toString()],editType:"calc",description:["Sets the annotation's x coordinate axis.",of.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",nf.idRegex.y.toString()],editType:"calc",description:["Sets the annotation's y coordinate axis.",of.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:h0({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"}),_u={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20,eventDataKeys:[]},O2=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(" ")}},y0=Wo.axisHoverFormat,hz=yr.texttemplateAttrs,pz=yr.hovertemplateAttrs,g0=Ln,mz=fr,yz=Fr.dash,gz=Fr.pattern,bz=kt,b0=_u,lf=Et.extendFlat,xz=O2;function x0(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 _0(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 w0(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 zi={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:x0("x"),yperiod:x0("y"),xperiod0:_0("x0"),yperiod0:_0("y0"),xperiodalignment:w0("x"),yperiodalignment:w0("y"),xhoverformat:y0("x"),yhoverformat:y0("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:hz({},{}),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 "+b0.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:pz({},{keys:b0.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:lf({},yz,{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:xz(!0),fillgradient:lf({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:gz,marker:lf({symbol:{valType:"enumerated",values:bz.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:lf({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"},g0("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"},g0("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:mz({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(" ")}},T0=xs,k0=zi.line,_z=Fr.dash,sf=Et.extendFlat,wz=Na.overrideAll,Tz=Lt.templatedArray,A0=xu,j2=wz(Tz("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:sf({},T0.xref,{description:["Sets the selection's x coordinate axis.",A0.axisRefDescription("x","left","right")].join(" ")}),yref:sf({},T0.yref,{description:["Sets the selection's x coordinate axis.",A0.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:k0.color,width:sf({},k0.width,{min:1,dflt:1}),dash:sf({},_z,{dflt:"dot"})}}),"arraydraw","from-root"),M0=be,ff=Ct,kz=ja,Az=j2,S0=Ei,Mz=function(e,r){kz(e,r,{name:"selections",handleItemDefaults:Sz});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 Sz(t,e,r){function a(w,T){return M0.coerce(t,e,Az,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=ff.coerceRef(t,e,u,c);if(v=ff.getFromId(u,h),v._selectionIndices.push(e._index),d=S0.rangeToShapePosition(v),p=S0.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),ff.coercePosition(e,u,a,h,m),ff.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&&M0.noneOrAll(t,e,["x0","x1","y0","y1"])}var Lz=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")},Cz=Je,L0=be,C0=Xt,wu=function(e){return function(a,i){var n=a[e];if(Array.isArray(n))for(var o=Cz.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(L0.isPlainObject(d)){var h=C0.cleanId(d.xref,"x",!1),m=C0.cleanId(d.yref,"y",!1),y=l.x.test(h),b=l.y.test(m);if(y||b){v||L0.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)}}}}},D0=w2,dl=vz,_s={moduleType:"component",name:"selections",layoutAttributes:j2,supplyLayoutDefaults:Mz,supplyDrawNewSelectionDefaults:Lz,includeBasePlot:wu("selections"),draw:D0.draw,drawOne:D0.drawOne,reselect:dl.reselect,prepSelect:dl.prepSelect,clearOutline:dl.clearOutline,clearSelectionsCache:dl.clearSelectionsCache,selectOnClick:dl.selectOnClick},qp=ut,ra=be,$0=ra.numberFormat,Dz=oa,$z=u_,cf=Je,B2=ra.strTranslate,Pz=or,P0=ct,di=kt,Ez=Ta,E0=Ct,zz=$i,Rz=Ba,G2=Dn,uf=G2.selectingOrDrawing,Iz=G2.freeMode,Fz=Sr.FROM_TL,Nz=Sp,Hz=cu.redrawReglTraces,Oz=Kt,vh=Xt.getFromId,jz=_s.prepSelect,Bz=_s.clearOutline,Gz=_s.selectOnClick,Av=y2,Zp=gr,z0=Zp.MINDRAG,Mr=Zp.MINZOOM,R0=!0;function Uz(t,e,r,a,i,n,o,l){var s=t._fullLayout._zoomlayer,f=o+l==="nsew",c=(o+l).length===1,u,v,p,d,h,m,y,b,_,g,x,w,T,A,M,S,L,E,F,N,z,H,D;r+=e.yaxis._shift;function P(){if(u=e.xaxis,v=e.yaxis,_=u._length,g=v._length,y=u._offset,b=v._offset,p={},p[u._id]=u,d={},d[v._id]=v,o&&l)for(var le=e.overlays,ie=0;ie<le.length;ie++){var me=le[ie].xaxis;p[me._id]=me;var he=le[ie].yaxis;d[he._id]=he}h=H0(p),m=H0(d),T=I0(h,l),A=I0(m,o),M=!A&&!T,w=N0(t,t._fullLayout._axisMatchGroups,p,d),x=N0(t,t._fullLayout._axisConstraintGroups,p,d,w);var Ae=x.isSubplotConstrained||w.isSubplotConstrained;S=l||Ae,L=o||Ae;var we=t._fullLayout;E=we._has("scattergl"),F=we._has("splom"),N=we._has("svg")}P();var k=Xz(A+T,t._fullLayout.dragmode,f),C=V2(e,o+l+"drag",k,r,a,i,n);if(M&&!f)return C.onmousedown=null,C.style.pointerEvents="none",C;var $={element:C,gd:t,plotinfo:e};$.prepFn=function(le,ie,me){var he=$.dragmode,Ae=t._fullLayout.dragmode;Ae!==he&&($.dragmode=Ae),P(),H=t._fullLayout._invScaleX,D=t._fullLayout._invScaleY,M||(f?le.shiftKey?Ae==="pan"?Ae="zoom":uf(Ae)||(Ae="pan"):le.ctrlKey&&(Ae="pan"):Ae="pan"),Iz(Ae)?$.minDrag=1:$.minDrag=void 0,uf(Ae)?($.xaxes=h,$.yaxes=m,jz(le,ie,me,$,Ae)):($.clickFn=j,uf(he)&&I(),M||(Ae==="zoom"?($.moveFn=se,$.doneFn=ye,$.minDrag=1,oe(le,ie,me)):Ae==="pan"&&($.moveFn=Pe,$.doneFn=J))),t._fullLayout._redrag=function(){var we=t._dragdata;if(we&&we.element===C){var De=t._fullLayout.dragmode;uf(De)||(P(),xe([0,0,_,g]),$.moveFn(we.dx,we.dy))}}};function I(){$.plotinfo.selection=!1,Bz(t)}function j(le,ie){var me=$.gd;if(me._fullLayout._activeShapeIndex>=0){me._fullLayout._deactivateShape(me);return}var he=me._fullLayout.clickmode;if(hh(me),le===2&&!c&&Ce(),f)he.indexOf("select")>-1&&Gz(ie,me,h,m,e.id,$),he.indexOf("event")>-1&&Ez.click(me,ie,e.id);else if(le===1&&c){var Ae=o?v:u,we=o==="s"||l==="w"?0:1,De=Ae._name+".range["+we+"]",Ie=Vz(Ae,we),Ge="left",ue="middle";if(Ae.fixedrange)return;o?(ue=o==="n"?"top":"bottom",Ae.side==="right"&&(Ge="right")):l==="e"&&(Ge="right"),me._context.showAxisRangeEntryBoxes&&qp.select(C).call(Pz.makeEditable,{gd:me,immediate:!0,background:me._fullLayout.paper_bgcolor,text:String(Ie),fill:Ae.tickfont?Ae.tickfont.color:"#444",horizontalAlign:Ge,verticalAlign:ue}).on("edit",function(He){var je=Ae.d2r(He);je!==void 0&&cf.call("_guiRelayout",me,De,je)})}}Rz.init($);var G,X,O,q,W,Y,B,Q,ee,fe;function oe(le,ie,me){var he=C.getBoundingClientRect();G=ie-he.left,X=me-he.top,t._fullLayout._calcInverseTransform(t);var Ae=ra.apply3DTransform(t._fullLayout._invTransform)(G,X);G=Ae[0],X=Ae[1],O={l:G,r:G,w:0,t:X,b:X,h:0},q=t._hmpixcount?t._hmlumcount/t._hmpixcount:Dz(t._fullLayout.plot_bgcolor).getLuminance(),W="M0,0H"+_+"V"+g+"H0V0",Y=!1,B="xy",fe=!1,Q=W2(s,q,y,b,W),ee=X2(s,y,b)}function se(le,ie){if(t._transitioningWithDuration)return!1;var me=Math.max(0,Math.min(_,H*le+G)),he=Math.max(0,Math.min(g,D*ie+X)),Ae=Math.abs(me-G),we=Math.abs(he-X);O.l=Math.min(G,me),O.r=Math.max(G,me),O.t=Math.min(X,he),O.b=Math.max(X,he);function De(){B="",O.r=O.l,O.t=O.b,ee.attr("d","M0,0Z")}if(x.isSubplotConstrained)Ae>Mr||we>Mr?(B="xy",Ae/_>we/g?(we=Ae*g/_,X>he?O.t=X-we:O.b=X+we):(Ae=we*_/g,G>me?O.l=G-Ae:O.r=G+Ae),ee.attr("d",Vf(O))):De();else if(w.isSubplotConstrained)if(Ae>Mr||we>Mr){B="xy";var Ie=Math.min(O.l/_,(g-O.b)/g),Ge=Math.max(O.r/_,(g-O.t)/g);O.l=Ie*_,O.r=Ge*_,O.b=(1-Ie)*g,O.t=(1-Ge)*g,ee.attr("d",Vf(O))}else De();else!A||we<Math.min(Math.max(Ae*.6,z0),Mr)?Ae<z0||!T?De():(O.t=0,O.b=g,B="x",ee.attr("d",Yz(O,X))):!T||Ae<Math.min(we*.6,Mr)?(O.l=0,O.r=_,B="y",ee.attr("d",qz(O,G))):(B="xy",ee.attr("d",Vf(O)));O.w=O.r-O.l,O.h=O.b-O.t,B&&(fe=!0),t._dragged=fe,Y2(Q,ee,O,W,Y,q),de(),t.emit("plotly_relayouting",z),Y=!0}function de(){z={},(B==="xy"||B==="x")&&(dh(h,O.l/_,O.r/_,z,x.xaxes),ce("x",z)),(B==="xy"||B==="y")&&(dh(m,(g-O.b)/g,(g-O.t)/g,z,x.yaxes),ce("y",z))}function ye(){de(),hh(t),J(),Z2(t)}var _e=[0,0,_,g],Se=null,pe=Zp.REDRAWDELAY,ve=e.mainplot?t._fullLayout._plots[e.mainplot]:e;function Me(le){if(!t._context._scrollZoom.cartesian&&!t._fullLayout._enablescrollzoom)return;if(I(),t._transitioningWithDuration){le.preventDefault(),le.stopPropagation();return}P(),clearTimeout(Se);var ie=-le.deltaY;if(isFinite(ie)||(ie=le.wheelDelta/10),!isFinite(ie)){ra.log("Did not find wheel motion attributes: ",le);return}var me=Math.exp(-Math.min(Math.max(ie,-20),20)/200),he=ve.draglayer.select(".nsewdrag").node().getBoundingClientRect(),Ae=(le.clientX-he.left)/he.width,we=(he.bottom-le.clientY)/he.height,De;function Ie(Ge,ue,He){if(Ge.fixedrange)return;var je=ra.simpleMap(Ge.range,Ge.r2l),Fe=je[0]+(je[1]-je[0])*ue;function qe(Ne){return Ge.l2r(Fe+(Ne-Fe)*He)}Ge.range=je.map(qe)}if(S){for(l||(Ae=.5),De=0;De<h.length;De++)Ie(h[De],Ae,me);ce("x"),_e[2]*=me,_e[0]+=_e[2]*Ae*(1/me-1)}if(L){for(o||(we=.5),De=0;De<m.length;De++)Ie(m[De],we,me);ce("y"),_e[3]*=me,_e[1]+=_e[3]*(1-we)*(1/me-1)}xe(_e),Le(),t.emit("plotly_relayouting",z),Se=setTimeout(function(){t._fullLayout&&(_e=[0,0,_,g],J())},pe),le.preventDefault()}o.length*l.length!==1&&K2(C,Me);function Pe(le,ie){if(le=le*H,ie=ie*D,t._transitioningWithDuration)return;if(t._fullLayout._replotting=!0,T==="ew"||A==="ns"){var me=T?-le:0,he=A?-ie:0;if(w.isSubplotConstrained){if(T&&A){var Ae=(le/_-ie/g)/2;le=Ae*_,ie=-Ae*g,me=-le,he=-ie}A?me=-he*_/g:he=-me*g/_}T&&(F0(h,le),ce("x")),A&&(F0(m,ie),ce("y")),xe([me,he,_,g]),Le(),t.emit("plotly_relayouting",z);return}function we(qe,Ne,R){for(var U=1-Ne,V,K,ne=0;ne<qe.length;ne++){var re=qe[ne];if(!re.fixedrange){V=re,K=re._rl[U]+(re._rl[Ne]-re._rl[U])/Wz(R/re._length);var Ee=re.l2r(K);Ee!==!1&&Ee!==void 0&&(re.range[Ne]=Ee)}}return V._length*(V._rl[Ne]-K)/(V._rl[Ne]-V._rl[U])}var De=T==="w"==(A==="n")?1:-1;if(T&&A&&(x.isSubplotConstrained||w.isSubplotConstrained)){var Ie=(le/_+De*ie/g)/2;le=Ie*_,ie=De*Ie*g}var Ge,ue;if(T==="w"?le=we(h,0,le):T==="e"?le=we(h,1,-le):T||(le=0),A==="n"?ie=we(m,1,ie):A==="s"?ie=we(m,0,-ie):A||(ie=0),Ge=T==="w"?le:0,ue=A==="n"?ie:0,x.isSubplotConstrained&&!w.isSubplotConstrained||w.isSubplotConstrained&&T&&A&&De>0){var He;if(w.isSubplotConstrained||!T&&A.length===1){for(He=0;He<h.length;He++)h[He].range=h[He]._r.slice(),Av(h[He],1-ie/g);le=ie*_/g,Ge=le/2}if(w.isSubplotConstrained||!A&&T.length===1){for(He=0;He<m.length;He++)m[He].range=m[He]._r.slice(),Av(m[He],1-le/_);ie=le*g/_,ue=ie/2}}(!w.isSubplotConstrained||!A)&&ce("x"),(!w.isSubplotConstrained||!T)&&ce("y");var je=_-le,Fe=g-ie;w.isSubplotConstrained&&!(T&&A)&&(T?(ue=Ge?0:le*g/_,Fe=je*g/_):(Ge=ue?0:ie*_/g,je=Fe*_/g)),xe([Ge,ue,je,Fe]),Le(),t.emit("plotly_relayouting",z)}function ce(le,ie){for(var me=w.isSubplotConstrained?{x:m,y:h}[le]:w[le+"axes"],he=w.isSubplotConstrained?{x:h,y:m}[le]:[],Ae=0;Ae<me.length;Ae++){var we=me[Ae],De=we._id,Ie=w.xLinks[De]||w.yLinks[De],Ge=he[0]||p[Ie]||d[Ie];Ge&&(ie?(ie[we._name+".range[0]"]=ie[Ge._name+".range[0]"],ie[we._name+".range[1]"]=ie[Ge._name+".range[1]"]):we.range=Ge.range.slice())}}function Le(){var le=[],ie;function me(De){for(ie=0;ie<De.length;ie++)De[ie].fixedrange||le.push(De[ie]._id)}function he(De,Ie){for(ie=0;ie<De.length;ie++){var Ge=De[ie],ue=Ge[Ie];!Ge.fixedrange&&ue.tickmode==="sync"&&le.push(ue._id)}}for(S&&(me(h),me(x.xaxes),me(w.xaxes),he(e.overlays,"xaxis")),L&&(me(m),me(x.yaxes),me(w.yaxes),he(e.overlays,"yaxis")),z={},ie=0;ie<le.length;ie++){var Ae=le[ie],we=vh(t,Ae);E0.drawOne(t,we,{skipTitle:!0}),z[we._name+".range[0]"]=we.range[0],z[we._name+".range[1]"]=we.range[1]}E0.redrawComponents(t,le)}function Ce(){if(!t._transitioningWithDuration){var le=t._context.doubleClick,ie=[];T&&(ie=ie.concat(h)),A&&(ie=ie.concat(m)),w.xaxes&&(ie=ie.concat(w.xaxes)),w.yaxes&&(ie=ie.concat(w.yaxes));var me={},he,Ae;if(le==="reset+autosize")for(le="autosize",Ae=0;Ae<ie.length;Ae++){he=ie[Ae];var we=he._rangeInitial0,De=he._rangeInitial1,Ie=we!==void 0||De!==void 0;if(Ie&&(we!==void 0&&we!==he.range[0]||De!==void 0&&De!==he.range[1])||!Ie&&he.autorange!==!0){le="reset";break}}if(le==="autosize")for(Ae=0;Ae<ie.length;Ae++)he=ie[Ae],he.fixedrange||(me[he._name+".autorange"]=!0);else if(le==="reset"){for((T||x.isSubplotConstrained)&&(ie=ie.concat(x.xaxes)),A&&!x.isSubplotConstrained&&(ie=ie.concat(x.yaxes)),x.isSubplotConstrained&&(T?A||(ie=ie.concat(m)):ie=ie.concat(h)),Ae=0;Ae<ie.length;Ae++)if(he=ie[Ae],!he.fixedrange){var Ge=he._name,ue=he._autorangeInitial;he._rangeInitial0===void 0&&he._rangeInitial1===void 0?me[Ge+".autorange"]=!0:he._rangeInitial0===void 0?(me[Ge+".autorange"]=ue,me[Ge+".range"]=[null,he._rangeInitial1]):he._rangeInitial1===void 0?(me[Ge+".range"]=[he._rangeInitial0,null],me[Ge+".autorange"]=ue):me[Ge+".range"]=[he._rangeInitial0,he._rangeInitial1]}}t.emit("plotly_doubleclick",null),cf.call("_guiRelayout",t,me)}}function J(){xe([0,0,_,g]),ra.syncOrAsync([Oz.previousPromises,function(){t._fullLayout._replotting=!1,cf.call("_guiRelayout",t,z)}],t)}function xe(le){var ie=t._fullLayout,me=ie._plots,he=ie._subplots.cartesian,Ae,we,De,Ie;if(F&&cf.subplotsRegistry.splom.drag(t),E){for(Ae=0;Ae<he.length;Ae++)if(we=me[he[Ae]],De=we.xaxis,Ie=we.yaxis,we._scene){De.limitRange&&De.limitRange(),Ie.limitRange&&Ie.limitRange();var Ge=ra.simpleMap(De.range,De.r2l),ue=ra.simpleMap(Ie.range,Ie.r2l);we._scene.update({range:[Ge[0],ue[0],Ge[1],ue[1]]})}}if((F||E)&&(Nz(t),Hz(t)),N){var He=le[2]/u._length,je=le[3]/v._length;for(Ae=0;Ae<he.length;Ae++){we=me[he[Ae]],De=we.xaxis,Ie=we.yaxis;var Fe=(S||w.isSubplotConstrained)&&!De.fixedrange&&p[De._id],qe=(L||w.isSubplotConstrained)&&!Ie.fixedrange&&d[Ie._id],Ne,R,U,V;if(Fe?(Ne=He,U=l||w.isSubplotConstrained?le[0]:Te(De,Ne)):w.xaHash[De._id]?(Ne=He,U=le[0]*De._length/u._length):w.yaHash[De._id]?(Ne=je,U=A==="ns"?-le[1]*De._length/v._length:Te(De,Ne,{n:"top",s:"bottom"}[A])):(Ne=Z(De,He,je),U=ke(De,Ne)),Ne>1&&(De.maxallowed!==void 0&&S===(De.range[0]<De.range[1]?"e":"w")||De.minallowed!==void 0&&S===(De.range[0]<De.range[1]?"w":"e"))&&(Ne=1,U=0),qe?(R=je,V=o||w.isSubplotConstrained?le[1]:Te(Ie,R)):w.yaHash[Ie._id]?(R=je,V=le[1]*Ie._length/v._length):w.xaHash[Ie._id]?(R=He,V=T==="ew"?-le[0]*Ie._length/u._length:Te(Ie,R,{e:"right",w:"left"}[T])):(R=Z(Ie,He,je),V=ke(Ie,R)),R>1&&(Ie.maxallowed!==void 0&&L===(Ie.range[0]<Ie.range[1]?"n":"s")||Ie.minallowed!==void 0&&L===(Ie.range[0]<Ie.range[1]?"s":"n"))&&(R=1,V=0),!(!Ne&&!R)){Ne||(Ne=1),R||(R=1);var K=De._offset-U/Ne,ne=Ie._offset-V/R;we.clipRect.call(di.setTranslate,U,V).call(di.setScale,Ne,R),we.plot.call(di.setTranslate,K,ne).call(di.setScale,1/Ne,1/R),(Ne!==we.xScaleFactor||R!==we.yScaleFactor)&&(di.setPointGroupScale(we.zoomScalePts,Ne,R),di.setTextPointsScale(we.zoomScaleTxt,Ne,R)),di.hideOutsideRangePoints(we.clipOnAxisFalseTraces,we),we.xScaleFactor=Ne,we.yScaleFactor=R}}}}function Z(le,ie,me){return le.fixedrange?0:S&&x.xaHash[le._id]?ie:L&&(x.isSubplotConstrained?x.xaHash:x.yaHash)[le._id]?me:0}function ke(le,ie){return ie?(le.range=le._r.slice(),Av(le,ie),Te(le,ie)):0}function Te(le,ie,me){return le._length*(1-ie)*Fz[me||le.constraintoward||"middle"]}return C}function U2(t,e,r,a){var i=ra.ensureSingle(t.draglayer,e,r,function(n){n.classed("drag",!0).style({fill:"transparent","stroke-width":0}).attr("data-subplot",t.id)});return i.call(zz,a),i.node()}function V2(t,e,r,a,i,n,o){var l=U2(t,"rect",e,r);return qp.select(l).call(di.setRect,a,i,n,o),l}function I0(t,e){for(var r=0;r<t.length;r++)if(!t[r].fixedrange)return e;return""}function Vz(t,e){var r=t.range[e],a=Math.abs(r-t.range[1-e]),i;return t.type==="date"?r:t.type==="log"?(i=Math.ceil(Math.max(0,-Math.log(a)/Math.LN10))+3,$0("."+i+"g")(Math.pow(10,r))):(i=Math.floor(Math.log(Math.abs(r))/Math.LN10)-Math.floor(Math.log(a)/Math.LN10)+4,$0("."+String(i)+"g")(r))}function dh(t,e,r,a,i){for(var n=0;n<t.length;n++){var o=t[n];if(!o.fixedrange)if(o.rangebreaks){var l=o._id.charAt(0)==="y",s=l?1-e:e,f=l?1-r:r;a[o._name+".range[0]"]=o.l2r(o.p2l(s*o._length)),a[o._name+".range[1]"]=o.l2r(o.p2l(f*o._length))}else{var c=o._rl[0],u=o._rl[1]-c;a[o._name+".range[0]"]=o.l2r(c+u*e),a[o._name+".range[1]"]=o.l2r(c+u*r)}}if(i&&i.length){var v=(e+(1-r))/2;dh(i,v,1-v,a,[])}}function F0(t,e){for(var r=0;r<t.length;r++){var a=t[r];if(!a.fixedrange){if(a.rangebreaks){var i=0,n=a._length,o=a.p2l(i+e)-a.p2l(i),l=a.p2l(n+e)-a.p2l(n),s=(o+l)/2;a.range=[a.l2r(a._rl[0]-s),a.l2r(a._rl[1]-s)]}else a.range=[a.l2r(a._rl[0]-e/a._m),a.l2r(a._rl[1]-e/a._m)];a.limitRange&&a.limitRange()}}}function Wz(t){return 1-(t>=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function Xz(t,e,r){return t?t==="nsew"?r?"":e==="pan"?"move":"crosshair":t.toLowerCase()+"-resize":"pointer"}function W2(t,e,r,a,i){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",B2(r,a)).attr("d",i+"Z")}function X2(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:P0.background,stroke:P0.defaultLine,"stroke-width":1,opacity:0}).attr("transform",B2(e,r)).attr("d","M0,0Z")}function Y2(t,e,r,a,i,n){t.attr("d",a+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),q2(t,e,i,n)}function q2(t,e,r,a){r||(t.transition().style("fill",a>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function hh(t){qp.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function Z2(t){R0&&t.data&&t._context.showTips&&(ra.notifier(ra._(t,"Double-click to zoom back out"),"long"),R0=!1)}function Yz(t,e){return"M"+(t.l-.5)+","+(e-Mr-.5)+"h-3v"+(2*Mr+1)+"h3ZM"+(t.r+.5)+","+(e-Mr-.5)+"h3v"+(2*Mr+1)+"h-3Z"}function qz(t,e){return"M"+(e-Mr-.5)+","+(t.t-.5)+"v-3h"+(2*Mr+1)+"v3ZM"+(e-Mr-.5)+","+(t.b+.5)+"v3h"+(2*Mr+1)+"v-3Z"}function Vf(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,Mr)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function N0(t,e,r,a,i){for(var n=!1,o={},l={},s,f,c,u,v=(i||{}).xaHash,p=(i||{}).yaHash,d=0;d<e.length;d++){var h=e[d];for(s in r)if(h[s]){for(c in h)!(i&&(v[c]||p[c]))&&!(c.charAt(0)==="x"?r:a)[c]&&(o[c]=s);for(f in a)!(i&&(v[f]||p[f]))&&h[f]&&(n=!0)}for(f in a)if(h[f])for(u in h)!(i&&(v[u]||p[u]))&&!(u.charAt(0)==="x"?r:a)[u]&&(l[u]=f)}n&&(ra.extendFlat(o,l),l={});var m={},y=[];for(c in o){var b=vh(t,c);y.push(b),m[b._id]=b}var _={},g=[];for(u in l){var x=vh(t,u);g.push(x),_[x._id]=x}return{xaHash:m,yaHash:_,xaxes:y,yaxes:g,xLinks:o,yLinks:l,isSubplotConstrained:n}}function K2(t,e){if(!$z)t.onwheel!==void 0?t.onwheel=e:t.onmousewheel!==void 0?t.onmousewheel=e:t.isAddedWheelEvent||(t.isAddedWheelEvent=!0,t.addEventListener("wheel",e,{passive:!1}));else{var r=t.onwheel!==void 0?"wheel":"mousewheel";t._onwheel&&t.removeEventListener(r,t._onwheel),t._onwheel=e,t.addEventListener(r,e,{passive:!1})}}function H0(t){var e=[];for(var r in t)e.push(t[r]);return e}var Zz={makeDragBox:Uz,makeDragger:U2,makeRectDragger:V2,makeZoombox:W2,makeCorners:X2,updateZoombox:Y2,xyCorners:Vf,transitionZoombox:q2,removeZoombox:hh,showDoubleClickNotifier:Z2,attachWheelEventHandler:K2};(function(t){var e=ut,r=Ta,a=Ba,i=$i,n=Zz.makeDragBox,o=gr.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)}})(wp);var ws={},O0=Je,Kz=function(e){for(var r=O0.layoutArrayContainers,a=O0.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:""}},Qz=Tn,Mv=Yh,hl=jo,Jz=Qh.sorterAsc,Sv=Je;ws.containerArrayMatch=Kz;var eR=ws.isAddVal=function(e){return e==="add"||Qz(e)},j0=ws.isRemoveVal=function(e){return e===null||e==="remove"};ws.applyContainerArrayChanges=function(e,r,a,i,n){var o=r.astr,l=Sv.getComponentMethod(o,"supplyLayoutDefaults"),s=Sv.getComponentMethod(o,"draw"),f=Sv.getComponentMethod(o,"drawOne"),c=i.replot||i.recalc||l===Mv||s===Mv,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(j0(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(Jz),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=eR(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),j0(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!==Mv){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 Q2={};(function(t){var e=ht,r=Je,a=be,i=Kt,n=Xt,o=ct,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)}}}})(Q2);(function(t){var e=ut,r=ht,a=c_,i=be,n=i.nestedProperty,o=ps,l=gC,s=Je,f=Uo,c=Kt,u=Ct,v=bT,p=Oa,d=kt,h=ct,m=wp.initInteractions,y=Vo,b=_s.clearOutline,_=Oo.dfltConfig,g=ws,x=Q2,w=cu,T=Na,A=gr.AX_NAME_PATTERN,M=0,S=5;function L(R,U,V,K){var ne;if(R=i.getGraphDiv(R),o.init(R),i.isPlainObject(U)){var re=U;U=re.data,V=re.layout,K=re.config,ne=re.frames}var Ee=o.triggerHandler(R,"plotly_beforeplot",[U,V,K]);if(Ee===!1)return Promise.reject();!U&&!V&&!i.isPlotDiv(R)&&i.warn("Calling _doPlot as if redrawing but this container doesn't yet have a plot.",R);function $e(){if(ne)return t.addFrames(R,ne)}H(R,K),V||(V={}),e.select(R).classed("js-plotly-plot",!0),d.makeTester(),Array.isArray(R._promises)||(R._promises=[]);var ge=(R.data||[]).length===0&&Array.isArray(U);Array.isArray(U)&&(x.cleanData(U),ge?R.data=U:R.data.push.apply(R.data,U),R.empty=!1),(!R.layout||ge)&&(R.layout=x.cleanLayout(V)),c.supplyDefaults(R);var ae=R._fullLayout,Re=ae._has("cartesian");ae._replotting=!0,(ge||ae._shouldCreateBgLayer)&&(Ne(R),ae._shouldCreateBgLayer&&delete ae._shouldCreateBgLayer),d.initGradients(R),d.initPatterns(R),ge&&u.saveShowSpikeInitial(R);var Oe=!R.calcdata||R.calcdata.length!==(R._fullData||[]).length;Oe&&c.doCalcdata(R);for(var We=0;We<R.calcdata.length;We++)R.calcdata[We][0].trace=R._fullData[We];R._context.responsive?R._responsiveChartHandler||(R._responsiveChartHandler=function(){i.isHidden(R)||c.resize(R)},window.addEventListener("resize",R._responsiveChartHandler)):i.clearResponsive(R);var Be=i.extendFlat({},ae._size),rt=0;function at(){for(var it=ae._basePlotModules,Ke=0;Ke<it.length;Ke++)it[Ke].drawFramework&&it[Ke].drawFramework(R);!ae._glcanvas&&ae._has("gl")&&(ae._glcanvas=ae._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}),ae._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 et=R._context.plotGlPixelRatio;if(ae._glcanvas){ae._glcanvas.attr("width",ae.width*et).attr("height",ae.height*et).style("width",ae.width+"px").style("height",ae.height+"px");var ft=ae._glcanvas.data()[0].regl;if(ft&&(Math.floor(ae.width*et)!==ft._gl.drawingBufferWidth||Math.floor(ae.height*et)!==ft._gl.drawingBufferHeight)){var mt="WebGL context buffer and canvas dimensions do not match due to browser/WebGL bug.";if(rt)i.error(mt);else return i.log(mt+" Clearing graph and plotting again."),c.cleanPlot([],{},R._fullData,ae),c.supplyDefaults(R),ae=R._fullLayout,c.doCalcdata(R),rt++,at()}}return ae.modebar.orientation==="h"?ae._modebardiv.style("height",null).style("width","100%"):ae._modebardiv.style("width",null).style("height",ae.height+"px"),c.previousPromises(R)}function Ye(){if(c.clearAutoMarginIds(R),w.drawMarginPushers(R),u.allowAutoMargin(R),R._fullLayout.title.text&&R._fullLayout.title.automargin&&c.allowAutoMargin(R,"title.automargin"),ae._has("pie"))for(var it=R._fullData,Ke=0;Ke<it.length;Ke++){var et=it[Ke];et.type==="pie"&&et.automargin&&c.allowAutoMargin(R,"pie."+et.uid+".automargin")}return c.doAutoMargin(R),c.previousPromises(R)}function wt(){if(c.didMarginChange(Be,ae._size))return i.syncOrAsync([Ye,w.layoutStyles],R)}function tt(){if(!Oe){Ze();return}return i.syncOrAsync([s.getComponentMethod("shapes","calcAutorange"),s.getComponentMethod("annotations","calcAutorange"),Ze],R)}function Ze(){R._transitioning||(w.doAutoRangeAndConstraints(R),ge&&u.saveRangeInitial(R),s.getComponentMethod("rangeslider","calcAutorange")(R))}function vt(){return u.draw(R,ge?"":"redraw")}var pt=[c.previousPromises,$e,at,Ye,wt];Re&&pt.push(tt),pt.push(w.layoutStyles),Re&&pt.push(vt,function(Ke){var et=Ke._fullLayout._insideTickLabelsUpdaterange;if(et)return Ke._fullLayout._insideTickLabelsUpdaterange=void 0,_e(Ke,et).then(function(){u.saveRangeInitial(Ke,!0)})}),pt.push(w.drawData,w.finalDraw,m,c.addLinks,c.rehover,c.redrag,c.reselect,c.doAutoMargin,c.previousPromises);var lt=i.syncOrAsync(pt,R);return(!lt||!lt.then)&&(lt=Promise.resolve()),lt.then(function(){return E(R),R})}function E(R){var U=R._fullLayout;U._redrawFromAutoMarginCount?U._redrawFromAutoMarginCount--:R.emit("plotly_afterplot")}function F(R){return i.extendFlat(_,R)}function N(R,U){try{R._fullLayout._paper.style("background",U)}catch(V){i.error(V)}}function z(R,U){var V=h.combine(U,"white");N(R,V)}function H(R,U){if(!R._context){R._context=i.extendDeep({},_);var V=e.select("base");R._context._baseUrl=V.size()&&V.attr("href")?window.location.href.split("#")[0]:""}var K=R._context,ne,re,Ee;if(U){for(re=Object.keys(U),ne=0;ne<re.length;ne++)Ee=re[ne],!(Ee==="editable"||Ee==="edits")&&Ee in K&&(Ee==="setBackground"&&U[Ee]==="opaque"?K[Ee]=z:K[Ee]=U[Ee]);var $e=U.editable;if($e!==void 0)for(K.editable=$e,re=Object.keys(K.edits),ne=0;ne<re.length;ne++)K.edits[re[ne]]=$e;if(U.edits)for(re=Object.keys(U.edits),ne=0;ne<re.length;ne++)Ee=re[ne],Ee in K.edits&&(K.edits[Ee]=U.edits[Ee]);K._exportedPlot=U._exportedPlot}K.staticPlot&&(K.editable=!1,K.edits={},K.autosizable=!1,K.scrollZoom=!1,K.doubleClick=!1,K.showTips=!1,K.showLink=!1,K.displayModeBar=!1),K.displayModeBar==="hover"&&!a&&(K.displayModeBar=!0),(K.setBackground==="transparent"||typeof K.setBackground!="function")&&(K.setBackground=N),K._hasZeroHeight=K._hasZeroHeight||R.clientHeight===0,K._hasZeroWidth=K._hasZeroWidth||R.clientWidth===0;var ge=K.scrollZoom,ae=K._scrollZoom={};if(ge===!0)ae.cartesian=1,ae.gl3d=1,ae.geo=1,ae.mapbox=1,ae.map=1;else if(typeof ge=="string"){var Re=ge.split("+");for(ne=0;ne<Re.length;ne++)ae[Re[ne]]=1}else ge!==!1&&(ae.gl3d=1,ae.geo=1,ae.mapbox=1,ae.map=1)}function D(R){if(R=i.getGraphDiv(R),!i.isPlotDiv(R))throw new Error("This element is not a Plotly plot: "+R);return x.cleanData(R.data),x.cleanLayout(R.layout),R.calcdata=void 0,t._doPlot(R).then(function(){return R.emit("plotly_redraw"),R})}function P(R,U,V,K){return R=i.getGraphDiv(R),c.cleanPlot([],{},R._fullData||[],R._fullLayout||{}),c.purge(R),t._doPlot(R,U,V,K)}function k(R,U){var V=U+1,K=[],ne,re;for(ne=0;ne<R.length;ne++)re=R[ne],re<0?K.push(V+re):K.push(re);return K}function C(R,U,V){var K,ne;for(K=0;K<U.length;K++){if(ne=U[K],ne!==parseInt(ne,10))throw new Error("all values in "+V+" must be integers");if(ne>=R.data.length||ne<-R.data.length)throw new Error(V+" must be valid indices for gd.data.");if(U.indexOf(ne,K+1)>-1||ne>=0&&U.indexOf(-R.data.length+ne)>-1||ne<0&&U.indexOf(R.data.length+ne)>-1)throw new Error("each index in "+V+" must be unique.")}}function $(R,U,V){if(!Array.isArray(R.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(R,U,"currentIndices"),typeof V<"u"&&!Array.isArray(V)&&(V=[V]),typeof V<"u"&&C(R,V,"newIndices"),typeof V<"u"&&U.length!==V.length)throw new Error("current and new indices must be of equal length.")}function I(R,U,V){var K,ne;if(!Array.isArray(R.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]),K=0;K<U.length;K++)if(ne=U[K],typeof ne!="object"||Array.isArray(ne)||ne===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(R,U,V,K){var ne=i.isPlainObject(K);if(!Array.isArray(R.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(R,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(ne&&(!(re in K)||!Array.isArray(K[re])||K[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(R,U,V,K){var ne=i.isPlainObject(K),re=[],Ee,$e,ge,ae,Re;Array.isArray(V)||(V=[V]),V=k(V,R.data.length-1);for(var Oe in U)for(var We=0;We<V.length;We++){if(Ee=R.data[V[We]],ge=n(Ee,Oe),$e=ge.get(),ae=U[Oe][We],!i.isArrayOrTypedArray(ae))throw new Error("attribute: "+Oe+" index: "+We+" must be an array");if(!i.isArrayOrTypedArray($e))throw new Error("cannot extend missing or non-array attribute: "+Oe);if($e.constructor!==ae.constructor)throw new Error("cannot extend array with an array of a different type: "+Oe);Re=ne?K[Oe][We]:K,r(Re)||(Re=-1),re.push({prop:ge,target:$e,insert:ae,maxp:Math.floor(Re)})}return re}function X(R,U,V,K,ne){j(R,U,V,K);for(var re=G(R,U,V,K),Ee={},$e={},ge=0;ge<re.length;ge++){var ae=re[ge].prop,Re=re[ge].maxp,Oe=ne(re[ge].target,re[ge].insert,Re);ae.set(Oe[0]),Array.isArray(Ee[ae.astr])||(Ee[ae.astr]=[]),Ee[ae.astr].push(Oe[1]),Array.isArray($e[ae.astr])||($e[ae.astr]=[]),$e[ae.astr].push(re[ge].target.length)}return{update:Ee,maxPoints:$e}}function O(R,U){var V=new R.constructor(R.length+U.length);return V.set(R),V.set(U,R.length),V}function q(R,U,V,K){R=i.getGraphDiv(R);function ne(ge,ae,Re){var Oe,We;if(i.isTypedArray(ge))if(Re<0){var Be=new ge.constructor(0),rt=O(ge,ae);Re<0?(Oe=rt,We=Be):(Oe=Be,We=rt)}else if(Oe=new ge.constructor(Re),We=new ge.constructor(ge.length+ae.length-Re),Re===ae.length)Oe.set(ae),We.set(ge);else if(Re<ae.length){var at=ae.length-Re;Oe.set(ae.subarray(at)),We.set(ge),We.set(ae.subarray(0,at),ge.length)}else{var Ye=Re-ae.length,wt=ge.length-Ye;Oe.set(ge.subarray(wt)),Oe.set(ae,Ye),We.set(ge.subarray(0,wt))}else Oe=ge.concat(ae),We=Re>=0&&Re<Oe.length?Oe.splice(0,Oe.length-Re):[];return[Oe,We]}var re=X(R,U,V,K,ne),Ee=t.redraw(R),$e=[R,re.update,V,re.maxPoints];return l.add(R,t.prependTraces,$e,q,arguments),Ee}function W(R,U,V,K){R=i.getGraphDiv(R);function ne(ge,ae,Re){var Oe,We;if(i.isTypedArray(ge))if(Re<=0){var Be=new ge.constructor(0),rt=O(ae,ge);Re<0?(Oe=rt,We=Be):(Oe=Be,We=rt)}else if(Oe=new ge.constructor(Re),We=new ge.constructor(ge.length+ae.length-Re),Re===ae.length)Oe.set(ae),We.set(ge);else if(Re<ae.length){var at=ae.length-Re;Oe.set(ae.subarray(0,at)),We.set(ae.subarray(at)),We.set(ge,at)}else{var Ye=Re-ae.length;Oe.set(ae),Oe.set(ge.subarray(0,Ye),ae.length),We.set(ge.subarray(Ye))}else Oe=ae.concat(ge),We=Re>=0&&Re<Oe.length?Oe.splice(Re,Oe.length):[];return[Oe,We]}var re=X(R,U,V,K,ne),Ee=t.redraw(R),$e=[R,re.update,V,re.maxPoints];return l.add(R,t.extendTraces,$e,W,arguments),Ee}function Y(R,U,V){R=i.getGraphDiv(R);var K=[],ne=t.deleteTraces,re=Y,Ee=[R,K],$e=[R,U],ge,ae;for(I(R,U,V),Array.isArray(U)||(U=[U]),U=U.map(function(Re){return i.extendFlat({},Re)}),x.cleanData(U),ge=0;ge<U.length;ge++)R.data.push(U[ge]);for(ge=0;ge<U.length;ge++)K.push(-U.length+ge);if(typeof V>"u")return ae=t.redraw(R),l.add(R,ne,Ee,re,$e),ae;Array.isArray(V)||(V=[V]);try{$(R,K,V)}catch(Re){throw R.data.splice(R.data.length-U.length,U.length),Re}return l.startSequence(R),l.add(R,ne,Ee,re,$e),ae=t.moveTraces(R,K,V),l.stopSequence(R),ae}function B(R,U){R=i.getGraphDiv(R);var V=[],K=t.addTraces,ne=B,re=[R,V,U],Ee=[R,U],$e,ge;if(typeof U>"u")throw new Error("indices must be an integer or array of integers.");for(Array.isArray(U)||(U=[U]),C(R,U,"indices"),U=k(U,R.data.length-1),U.sort(i.sorterDes),$e=0;$e<U.length;$e+=1)ge=R.data.splice(U[$e],1)[0],V.push(ge);var ae=t.redraw(R);return l.add(R,K,re,ne,Ee),ae}function Q(R,U,V){R=i.getGraphDiv(R);var K=[],ne=[],re=Q,Ee=Q,$e=[R,V,U],ge=[R,U,V],ae;if($(R,U,V),U=Array.isArray(U)?U:[U],typeof V>"u")for(V=[],ae=0;ae<U.length;ae++)V.push(-U.length+ae);for(V=Array.isArray(V)?V:[V],U=k(U,R.data.length-1),V=k(V,R.data.length-1),ae=0;ae<R.data.length;ae++)U.indexOf(ae)===-1&&K.push(R.data[ae]);for(ae=0;ae<U.length;ae++)ne.push({newIndex:V[ae],trace:R.data[U[ae]]});for(ne.sort(function(Oe,We){return Oe.newIndex-We.newIndex}),ae=0;ae<ne.length;ae+=1)K.splice(ne[ae].newIndex,0,ne[ae].trace);R.data=K;var Re=t.redraw(R);return l.add(R,re,$e,Ee,ge),Re}function ee(R,U,V,K){R=i.getGraphDiv(R),x.clearPromiseQueue(R);var ne={};if(typeof U=="string")ne[U]=V;else if(i.isPlainObject(U))ne=i.extendFlat({},U),K===void 0&&(K=V);else return i.warn("Restyle fail.",U,V,K),Promise.reject();Object.keys(ne).length&&(R.changed=!0);var re=x.coerceTraceIndices(R,K),Ee=ye(R,ne,re),$e=Ee.flags;$e.calc&&(R.calcdata=void 0),$e.clearAxisTypes&&x.clearAxisTypes(R,re,{});var ge=[];$e.fullReplot?ge.push(t._doPlot):(ge.push(c.previousPromises),c.supplyDefaults(R),$e.markerSize&&(c.doCalcdata(R),pe(ge)),$e.style&&ge.push(w.doTraceStyle),$e.colorbars&&ge.push(w.doColorBars),ge.push(E)),ge.push(c.rehover,c.redrag,c.reselect),l.add(R,ee,[R,Ee.undoit,Ee.traces],ee,[R,Ee.redoit,Ee.traces]);var ae=i.syncOrAsync(ge,R);return(!ae||!ae.then)&&(ae=Promise.resolve()),ae.then(function(){return R.emit("plotly_restyle",Ee.eventData),R})}function fe(R){return R===void 0?null:R}function oe(R,U){return U?function(V,K,ne){var re=n(V,K),Ee=re.set;return re.set=function($e){var ge=(ne||"")+K;se(ge,re.get(),$e,R),Ee($e)},re}:n}function se(R,U,V,K){if(Array.isArray(U)||Array.isArray(V))for(var ne=Array.isArray(U)?U:[],re=Array.isArray(V)?V:[],Ee=Math.max(ne.length,re.length),$e=0;$e<Ee;$e++)se(R+"["+$e+"]",ne[$e],re[$e],K);else if(i.isPlainObject(U)||i.isPlainObject(V)){var ge=i.isPlainObject(U)?U:{},ae=i.isPlainObject(V)?V:{},Re=i.extendFlat({},ge,ae);for(var Oe in Re)se(R+"."+Oe,ge[Oe],ae[Oe],K)}else K[R]===void 0&&(K[R]=fe(U))}function de(R,U,V){for(var K in V){var ne=n(R,K);se(K,ne.get(),V[K],U)}}function ye(R,U,V){var K=R._fullLayout,ne=R._fullData,re=R.data,Ee=K._guiEditing,$e=oe(K._preGUI,Ee),ge=i.extendDeepAll({},U),ae,Re=T.traceFlags(),Oe={},We={},Be;function rt(){return V.map(function(){})}function at(Ft){var pr=u.id2name(Ft);Be.indexOf(pr)===-1&&Be.push(pr)}function Ye(Ft){return"LAYOUT"+Ft+".autorange"}function wt(Ft){return"LAYOUT"+Ft+".range"}function tt(Ft){for(var pr=Ft;pr<ne.length;pr++)if(ne[pr]._input===re[Ft])return ne[pr]}function Ze(Ft,pr,Va){if(Array.isArray(Ft)){Ft.forEach(function(oi){Ze(oi,pr,Va)});return}if(!(Ft in U||x.hasParent(U,Ft))){var Oi;if(Ft.substr(0,6)==="LAYOUT")Oi=$e(R.layout,Ft.replace("LAYOUT",""));else{var Jo=V[Va],ca=K._tracePreGUI[tt(Jo)._fullInput.uid];Oi=oe(ca,Ee)(re[Jo],Ft)}Ft in We||(We[Ft]=rt()),We[Ft][Va]===void 0&&(We[Ft][Va]=fe(Oi.get())),pr!==void 0&&Oi.set(pr)}}function vt(Ft){return function(pr){return ne[pr][Ft]}}function pt(Ft){return function(pr,Va){return pr===!1?ne[V[Va]][Ft]:null}}for(var lt in U){if(x.hasParent(U,lt))throw new Error("cannot set "+lt+" and a parent attribute simultaneously");var it=U[lt],Ke,et,ft,mt,Qe,bt;if((lt==="autobinx"||lt==="autobiny")&&(lt=lt.charAt(lt.length-1)+"bins",Array.isArray(it)?it=it.map(pt(lt)):it===!1?it=V.map(vt(lt)):it=null),Oe[lt]=it,lt.substr(0,6)==="LAYOUT"){ft=$e(R.layout,lt.replace("LAYOUT","")),We[lt]=[fe(ft.get())],ft.set(Array.isArray(it)?it[0]:it),Re.calc=!0;continue}for(We[lt]=rt(),ae=0;ae<V.length;ae++){Ke=re[V[ae]],et=tt(V[ae]);var Mt=K._tracePreGUI[et._fullInput.uid];if(ft=oe(Mt,Ee)(Ke,lt),mt=ft.get(),Qe=Array.isArray(it)?it[ae%it.length]:it,Qe!==void 0){var Lr=ft.parts[ft.parts.length-1],cr=lt.substr(0,lt.length-Lr.length-1),Xr=cr?cr+".":"",Yr=cr?n(et,cr).get():et;if(bt=f.getTraceValObject(et,ft.parts),bt&&bt.impliedEdits&&Qe!==null)for(var Ko in bt.impliedEdits)Ze(i.relativeAttr(lt,Ko),bt.impliedEdits[Ko],ae);else if((Lr==="thicknessmode"||Lr==="lenmode")&&mt!==Qe&&(Qe==="fraction"||Qe==="pixels")&&Yr){var Fi=K._size,$n=Yr.orient,Pn=$n==="top"||$n==="bottom";if(Lr==="thicknessmode"){var Ls=Pn?Fi.h:Fi.w;Ze(Xr+"thickness",Yr.thickness*(Qe==="fraction"?1/Ls:Ls),ae)}else{var Ua=Pn?Fi.w:Fi.h;Ze(Xr+"len",Yr.len*(Qe==="fraction"?1/Ua:Ua),ae)}}else if(lt==="type"&&(Qe==="pie"!=(mt==="pie")||Qe==="funnelarea"!=(mt==="funnelarea"))){var Sa="x",Qo="y";(Qe==="bar"||mt==="bar")&&Ke.orientation==="h"&&(Sa="y",Qo="x"),i.swapAttrs(Ke,["?","?src"],"labels",Sa),i.swapAttrs(Ke,["d?","?0"],"label",Sa),i.swapAttrs(Ke,["?","?src"],"values",Qo),mt==="pie"||mt==="funnelarea"?(n(Ke,"marker.color").set(n(Ke,"marker.colors").get()),K._pielayer.selectAll("g.trace").remove()):s.traceIs(Ke,"cartesian")&&n(Ke,"marker.colors").set(n(Ke,"marker.color").get())}We[lt][ae]=fe(mt);var Ni=["swapxy","swapxyaxes","orientation","orientationaxes"];if(Ni.indexOf(lt)!==-1){if(lt==="orientation"){ft.set(Qe);var En=Ke.x&&!Ke.y?"h":"v";if((ft.get()||En)===et.orientation)continue}else lt==="orientationaxes"&&(Ke.orientation={v:"h",h:"v"}[et.orientation]);x.swapXYData(Ke),Re.calc=Re.clearAxisTypes=!0}else c.dataArrayContainers.indexOf(ft.parts[0])!==-1?(x.manageArrayContainers(ft,Qe,We),Re.calc=!0):(bt?bt.arrayOk&&!s.traceIs(et,"regl")&&(i.isArrayOrTypedArray(Qe)||i.isArrayOrTypedArray(mt))?Re.calc=!0:T.update(Re,bt):Re.calc=!0,ft.set(Qe))}}if(["swapxyaxes","orientationaxes"].indexOf(lt)!==-1&&u.swap(R,V),lt==="orientationaxes"){var ni=n(R.layout,"hovermode"),zn=ni.get();zn==="x"?ni.set("y"):zn==="y"?ni.set("x"):zn==="x unified"?ni.set("y unified"):zn==="y unified"&&ni.set("x unified")}if(["orientation","type"].indexOf(lt)!==-1){for(Be=[],ae=0;ae<V.length;ae++){var Hi=re[V[ae]];s.traceIs(Hi,"cartesian")&&(at(Hi.xaxis||"x"),at(Hi.yaxis||"y"))}Ze(Be.map(Ye),!0,0),Ze(Be.map(wt),[0,1],0)}}return(Re.calc||Re.plot)&&(Re.fullReplot=!0),{flags:Re,undoit:We,redoit:Oe,traces:V,eventData:i.extendDeepNoArrays([],[ge,V])}}function _e(R,U,V){R=i.getGraphDiv(R),x.clearPromiseQueue(R);var K={};if(typeof U=="string")K[U]=V;else if(i.isPlainObject(U))K=i.extendFlat({},U);else return i.warn("Relayout fail.",U,V),Promise.reject();Object.keys(K).length&&(R.changed=!0);var ne=ce(R,K),re=ne.flags;re.calc&&(R.calcdata=void 0);var Ee=[c.previousPromises];re.layoutReplot?Ee.push(w.layoutReplot):Object.keys(K).length&&(Se(R,re,ne)||c.supplyDefaults(R),re.legend&&Ee.push(w.doLegend),re.layoutstyle&&Ee.push(w.layoutStyles),re.axrange&&pe(Ee,ne.rangesAltered),re.ticks&&Ee.push(w.doTicksRelayout),re.modebar&&Ee.push(w.doModeBar),re.camera&&Ee.push(w.doCamera),re.colorbars&&Ee.push(w.doColorBars),Ee.push(E)),Ee.push(c.rehover,c.redrag,c.reselect),l.add(R,_e,[R,ne.undoit],_e,[R,ne.redoit]);var $e=i.syncOrAsync(Ee,R);return(!$e||!$e.then)&&($e=Promise.resolve(R)),$e.then(function(){return R.emit("plotly_relayout",ne.eventData),R})}function Se(R,U,V){var K=R._fullLayout;if(!U.axrange)return!1;for(var ne in U)if(ne!=="axrange"&&U[ne])return!1;var re,Ee,$e=function(Be,rt){return i.coerce(re,Ee,p,Be,rt)},ge={};for(var ae in V.rangesAltered){var Re=u.id2name(ae);if(re=R.layout[Re],Ee=K[Re],v(re,Ee,$e,ge),Ee._matchGroup){for(var Oe in Ee._matchGroup)if(Oe!==ae){var We=K[u.id2name(Oe)];We.autorange=Ee.autorange,We.range=Ee.range.slice(),We._input.range=Ee.range.slice()}}}return!0}function pe(R,U){var V=U?function(K){var ne=[],re=!0;for(var Ee in U){var $e=u.getFromId(K,Ee);if(ne.push(Ee),($e.ticklabelposition||"").indexOf("inside")!==-1&&$e._anchorAxis&&ne.push($e._anchorAxis._id),$e._matchGroup)for(var ge in $e._matchGroup)U[ge]||ne.push(ge)}return u.draw(K,ne,{skipTitle:re})}:function(K){return u.draw(K,"redraw")};R.push(b,w.doAutoRangeAndConstraints,V,w.drawData,w.finalDraw)}var ve=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,Me=/^[xyz]axis[0-9]*\.autorange$/,Pe=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function ce(R,U){var V=R.layout,K=R._fullLayout,ne=K._guiEditing,re=oe(K._preGUI,ne),Ee=Object.keys(U),$e=u.list(R),ge=i.extendDeepAll({},U),ae={},Re,Oe,We;for(Ee=Object.keys(U),Oe=0;Oe<Ee.length;Oe++)if(Ee[Oe].indexOf("allaxes")===0){for(We=0;We<$e.length;We++){var Be=$e[We]._id.substr(1),rt=Be.indexOf("scene")!==-1?Be+".":"",at=Ee[Oe].replace("allaxes",rt+$e[We]._name);U[at]||(U[at]=U[Ee[Oe]])}delete U[Ee[Oe]]}var Ye=T.layoutFlags(),wt={},tt={};function Ze(ca,oi){if(Array.isArray(ca)){ca.forEach(function(ZM){Ze(ZM,oi)});return}if(!(ca in U||x.hasParent(U,ca))){var Cm=re(V,ca);ca in tt||(tt[ca]=fe(Cm.get())),oi!==void 0&&Cm.set(oi)}}var vt={},pt;function lt(ca){var oi=u.name2id(ca.split(".")[0]);return vt[oi]=1,oi}for(var it in U){if(x.hasParent(U,it))throw new Error("cannot set "+it+" and a parent attribute simultaneously");for(var Ke=re(V,it),et=U[it],ft=Ke.parts.length,mt=ft-1;mt>0&&typeof Ke.parts[mt]!="string";)mt--;var Qe=Ke.parts[mt],bt=Ke.parts[mt-1]+"."+Qe,Mt=Ke.parts.slice(0,mt).join("."),Lr=n(R.layout,Mt).get(),cr=n(K,Mt).get(),Xr=Ke.get();if(et!==void 0){wt[it]=et,tt[it]=Qe==="reverse"?et:fe(Xr);var Yr=f.getLayoutValObject(K,Ke.parts);if(Yr&&Yr.impliedEdits&&et!==null)for(var Ko in Yr.impliedEdits)Ze(i.relativeAttr(it,Ko),Yr.impliedEdits[Ko]);if(["width","height"].indexOf(it)!==-1)if(et){Ze("autosize",null);var Fi=it==="height"?"width":"height";Ze(Fi,K[Fi])}else K[it]=R._initialAutoSize[it];else if(it==="autosize")Ze("width",et?null:K.width),Ze("height",et?null:K.height);else if(bt.match(ve))lt(bt),n(K,Mt+"._inputRange").set(null);else if(bt.match(Me)){lt(bt),n(K,Mt+"._inputRange").set(null);var $n=n(K,Mt).get();$n._inputDomain&&($n._input.domain=$n._inputDomain.slice())}else bt.match(Pe)&&n(K,Mt+"._inputDomain").set(null);if(Qe==="type"){pt=Lr;var Pn=cr.type==="linear"&&et==="log",Ls=cr.type==="log"&&et==="linear";if(Pn||Ls){if(!pt||!pt.range)Ze(Mt+".autorange",!0);else if(cr.autorange)Pn&&(pt.range=pt.range[1]>pt.range[0]?[1,2]:[2,1]);else{var Ua=pt.range[0],Sa=pt.range[1];Pn?(Ua<=0&&Sa<=0&&Ze(Mt+".autorange",!0),Ua<=0?Ua=Sa/1e6:Sa<=0&&(Sa=Ua/1e6),Ze(Mt+".range[0]",Math.log(Ua)/Math.LN10),Ze(Mt+".range[1]",Math.log(Sa)/Math.LN10)):(Ze(Mt+".range[0]",Math.pow(10,Ua)),Ze(Mt+".range[1]",Math.pow(10,Sa)))}Array.isArray(K._subplots.polar)&&K._subplots.polar.length&&K[Ke.parts[0]]&&Ke.parts[1]==="radialaxis"&&delete K[Ke.parts[0]]._subplot.viewInitial["radialaxis.range"],s.getComponentMethod("annotations","convertCoords")(R,cr,et,Ze),s.getComponentMethod("images","convertCoords")(R,cr,et,Ze)}else Ze(Mt+".autorange",!0),Ze(Mt+".range",null);n(K,Mt+"._inputRange").set(null)}else if(Qe.match(A)){var Qo=n(K,it).get(),Ni=(et||{}).type;(!Ni||Ni==="-")&&(Ni="linear"),s.getComponentMethod("annotations","convertCoords")(R,Qo,Ni,Ze),s.getComponentMethod("images","convertCoords")(R,Qo,Ni,Ze)}var En=g.containerArrayMatch(it);if(En){Re=En.array,Oe=En.index;var ni=En.property,zn=Yr||{editType:"calc"};Oe!==""&&ni===""&&(g.isAddVal(et)?tt[it]=null:g.isRemoveVal(et)?tt[it]=(n(V,Re).get()||[])[Oe]:i.warn("unrecognized full object value",U)),T.update(Ye,zn),ae[Re]||(ae[Re]={});var Hi=ae[Re][Oe];Hi||(Hi=ae[Re][Oe]={}),Hi[ni]=et,delete U[it]}else Qe==="reverse"?(Lr.range?Lr.range.reverse():(Ze(Mt+".autorange",!0),Lr.range=[1,0]),cr.autorange?Ye.calc=!0:Ye.plot=!0):(it==="dragmode"&&(et===!1&&Xr!==!1||et!==!1&&Xr===!1)||K._has("scatter-like")&&K._has("regl")&&it==="dragmode"&&(et==="lasso"||et==="select")&&!(Xr==="lasso"||Xr==="select")?Ye.plot=!0:Yr?T.update(Ye,Yr):Ye.calc=!0,Ke.set(et))}}for(Re in ae){var Ft=g.applyContainerArrayChanges(R,re(V,Re),ae[Re],Ye,re);Ft||(Ye.plot=!0)}for(var pr in vt){pt=u.getFromId(R,pr);var Va=pt&&pt._constraintGroup;if(Va){Ye.calc=!0;for(var Oi in Va)vt[Oi]||(u.getFromId(R,Oi)._constraintShrinkable=!0)}}(Le(R)||U.height||U.width)&&(Ye.plot=!0);var Jo=K.shapes;for(Oe=0;Oe<Jo.length;Oe++)if(Jo[Oe].showlegend){Ye.calc=!0;break}return(Ye.plot||Ye.calc)&&(Ye.layoutReplot=!0),{flags:Ye,rangesAltered:vt,undoit:tt,redoit:wt,eventData:ge}}function Le(R){var U=R._fullLayout,V=U.width,K=U.height;return R.layout.autosize&&c.plotAutoSize(R,R.layout,U),U.width!==V||U.height!==K}function Ce(R,U,V,K){R=i.getGraphDiv(R),x.clearPromiseQueue(R),i.isPlainObject(U)||(U={}),i.isPlainObject(V)||(V={}),Object.keys(U).length&&(R.changed=!0),Object.keys(V).length&&(R.changed=!0);var ne=x.coerceTraceIndices(R,K),re=ye(R,i.extendFlat({},U),ne),Ee=re.flags,$e=ce(R,i.extendFlat({},V)),ge=$e.flags;(Ee.calc||ge.calc)&&(R.calcdata=void 0),Ee.clearAxisTypes&&x.clearAxisTypes(R,ne,V);var ae=[];ge.layoutReplot?ae.push(w.layoutReplot):Ee.fullReplot?ae.push(t._doPlot):(ae.push(c.previousPromises),Se(R,ge,$e)||c.supplyDefaults(R),Ee.style&&ae.push(w.doTraceStyle),(Ee.colorbars||ge.colorbars)&&ae.push(w.doColorBars),ge.legend&&ae.push(w.doLegend),ge.layoutstyle&&ae.push(w.layoutStyles),ge.axrange&&pe(ae,$e.rangesAltered),ge.ticks&&ae.push(w.doTicksRelayout),ge.modebar&&ae.push(w.doModeBar),ge.camera&&ae.push(w.doCamera),ae.push(E)),ae.push(c.rehover,c.redrag,c.reselect),l.add(R,Ce,[R,re.undoit,$e.undoit,re.traces],Ce,[R,re.redoit,$e.redoit,re.traces]);var Re=i.syncOrAsync(ae,R);return(!Re||!Re.then)&&(Re=Promise.resolve(R)),Re.then(function(){return R.emit("plotly_update",{data:re.eventData,layout:$e.eventData}),R})}function J(R){return function(V){V._fullLayout._guiEditing=!0;var K=R.apply(null,arguments);return V._fullLayout._guiEditing=!1,K}}var xe=[{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 ke(R,U){for(var V=0;V<U.length;V++){var K=U[V],ne=R.match(K.pattern);if(ne){var re=ne[1]||"";return{head:re,tail:R.substr(re.length+1),attr:K.attr}}}}function Te(R,U){var V=n(U,R).get();if(V!==void 0)return V;var K=R.split(".");for(K.pop();K.length>1;)if(K.pop(),V=n(U,K.join(".")+".uirevision").get(),V!==void 0)return V;return U.uirevision}function le(R,U){for(var V=0;V<U.length;V++)if(U[V]._fullInput.uid===R)return V;return-1}function ie(R,U,V){for(var K=0;K<U.length;K++)if(U[K].uid===R)return K;return!U[V]||U[V].uid?-1:V}function me(R,U){var V=i.isPlainObject(R),K=Array.isArray(R);return V||K?(V&&i.isPlainObject(U)||K&&Array.isArray(U))&&JSON.stringify(R)===JSON.stringify(U):R===U}function he(R,U,V,K){var ne=K._preGUI,re,Ee,$e,ge,ae,Re,Oe,We,Be,rt,at=[],Ye={},wt={};for(re in ne){if(ae=ke(re,xe),ae){if(Be=ae.head,rt=ae.tail,Ee=ae.attr||Be+".uirevision",$e=n(K,Ee).get(),ge=$e&&Te(Ee,U),ge&&ge===$e){if(Re=ne[re],Re===null&&(Re=void 0),Oe=n(U,re),We=Oe.get(),me(We,Re)){We===void 0&&rt==="autorange"&&at.push(Be),Oe.set(fe(n(K,re).get()));continue}else if(rt==="autorange"||rt.substr(0,6)==="range["){var tt=ne[Be+".range[0]"],Ze=ne[Be+".range[1]"],vt=ne[Be+".autorange"];if(vt||vt===null&&tt===null&&Ze===null){if(!(Be in Ye)){var pt=n(U,Be).get();Ye[Be]=pt&&(pt.autorange||pt.autorange!==!1&&(!pt.range||pt.range.length!==2))}if(Ye[Be]){Oe.set(fe(n(K,re).get()));continue}}}}}else i.warn("unrecognized GUI edit: "+re);delete ne[re],ae&&ae.tail.substr(0,6)==="range["&&(wt[ae.head]=1)}for(var lt=0;lt<at.length;lt++){var it=at[lt];if(wt[it]){var Ke=n(U,it).get();Ke&&delete Ke.autorange}}var et=K._tracePreGUI;for(var ft in et){var mt=et[ft],Qe=null,bt;for(re in mt){if(!Qe){var Mt=le(ft,V);if(Mt<0){delete et[ft];break}var Lr=V[Mt];bt=Lr._fullInput;var cr=ie(ft,R,bt.index);if(cr<0){delete et[ft];break}Qe=R[cr]}if(ae=ke(re,Z),ae){if(ae.attr?($e=n(K,ae.attr).get(),ge=$e&&Te(ae.attr,U)):($e=bt.uirevision,ge=Qe.uirevision,ge===void 0&&(ge=U.uirevision)),ge&&ge===$e&&(Re=mt[re],Re===null&&(Re=void 0),Oe=n(Qe,re),We=Oe.get(),me(We,Re))){Oe.set(fe(n(bt,re).get()));continue}}else i.warn("unrecognized GUI edit: "+re+" in trace uid "+ft);delete mt[re]}}}function Ae(R,U,V,K){var ne,re;function Ee(){return t.addFrames(R,ne)}R=i.getGraphDiv(R),x.clearPromiseQueue(R);var $e=R._fullData,ge=R._fullLayout;if(!i.isPlotDiv(R)||!$e||!ge)re=t.newPlot(R,U,V,K);else{if(i.isPlainObject(U)){var ae=U;U=ae.data,V=ae.layout,K=ae.config,ne=ae.frames}var Re=!1;if(K){var Oe=i.extendDeep({},R._context);R._context=void 0,H(R,K),Re=Ge(Oe,R._context)}R.data=U||[],x.cleanData(R.data),R.layout=V||{},x.cleanLayout(R.layout),he(R.data,R.layout,$e,ge),c.supplyDefaults(R,{skipUpdateCalc:!0});var We=R._fullData,Be=R._fullLayout,rt=Be.datarevision===void 0,at=Be.transition,Ye=De(R,ge,Be,rt,at),wt=Ye.newDataRevision,tt=we(R,$e,We,rt,at,wt);if(Le(R)&&(Ye.layoutReplot=!0),tt.calc||Ye.calc){R.calcdata=void 0;for(var Ze=Object.getOwnPropertyNames(Be),vt=0;vt<Ze.length;vt++){var pt=Ze[vt],lt=pt.substring(0,5);if(lt==="xaxis"||lt==="yaxis"){var it=Be[pt]._emptyCategories;it&&it()}}}else c.supplyDefaultsUpdateCalc(R.calcdata,We);var Ke=[];if(ne&&(R._transitionData={},c.createTransitionData(R),Ke.push(Ee)),Be.transition&&!Re&&(tt.anim||Ye.anim))Ye.ticks&&Ke.push(w.doTicksRelayout),c.doCalcdata(R),w.doAutoRangeAndConstraints(R),Ke.push(function(){return c.transitionFromReact(R,tt,Ye,ge)});else if(tt.fullReplot||Ye.layoutReplot||Re)R._fullLayout._skipDefaults=!0,Ke.push(t._doPlot);else{for(var et in Ye.arrays){var ft=Ye.arrays[et];if(ft.length){var mt=s.getComponentMethod(et,"drawOne");if(mt!==i.noop)for(var Qe=0;Qe<ft.length;Qe++)mt(R,ft[Qe]);else{var bt=s.getComponentMethod(et,"draw");if(bt===i.noop)throw new Error("cannot draw components: "+et);bt(R)}}}Ke.push(c.previousPromises),tt.style&&Ke.push(w.doTraceStyle),(tt.colorbars||Ye.colorbars)&&Ke.push(w.doColorBars),Ye.legend&&Ke.push(w.doLegend),Ye.layoutstyle&&Ke.push(w.layoutStyles),Ye.axrange&&pe(Ke),Ye.ticks&&Ke.push(w.doTicksRelayout),Ye.modebar&&Ke.push(w.doModeBar),Ye.camera&&Ke.push(w.doCamera),Ke.push(E)}Ke.push(c.rehover,c.redrag,c.reselect),re=i.syncOrAsync(Ke,R),(!re||!re.then)&&(re=Promise.resolve(R))}return re.then(function(){return R.emit("plotly_react",{data:U,layout:V}),R})}function we(R,U,V,K,ne,re){var Ee=U.length===V.length;if(!ne&&!Ee)return{fullReplot:!0,calc:!0};var $e=T.traceFlags();$e.arrays={},$e.nChanges=0,$e.nChangesAnim=0;var ge,ae;function Re(Be){var rt=f.getTraceValObject(ae,Be);return!ae._module.animatable&&rt.anim&&(rt.anim=!1),rt}var Oe={getValObject:Re,flags:$e,immutable:K,transition:ne,newDataRevision:re,gd:R},We={};for(ge=0;ge<U.length;ge++)if(V[ge]){if(ae=V[ge]._fullInput,We[ae.uid])continue;We[ae.uid]=1,Ie(U[ge]._fullInput,ae,[],Oe)}return($e.calc||$e.plot)&&($e.fullReplot=!0),ne&&$e.nChanges&&$e.nChangesAnim&&($e.anim=$e.nChanges===$e.nChangesAnim&&Ee?"all":"some"),$e}function De(R,U,V,K,ne){var re=T.layoutFlags();re.arrays={},re.rangesAltered={},re.nChanges=0,re.nChangesAnim=0;function Ee(We){return f.getLayoutValObject(V,We)}for(var $e in V)if(!(!$e.startsWith("xaxis")&&!$e.startsWith("yaxis"))&&U[$e]){var ge=V[$e].domain,ae=U[$e].domain,Re=U[$e]._inputDomain;U[$e]._inputDomain&&(ge[0]===Re[0]&&ge[1]===Re[1]?V[$e].domain=U[$e].domain:(ge[0]!==ae[0]||ge[1]!==ae[1])&&(V[$e]._inputDomain=null))}var Oe={getValObject:Ee,flags:re,immutable:K,transition:ne,gd:R};return Ie(U,V,[],Oe),(re.plot||re.calc)&&(re.layoutReplot=!0),ne&&re.nChanges&&re.nChangesAnim&&(re.anim=re.nChanges===re.nChangesAnim?"all":"some"),re}function Ie(R,U,V,K){var ne,re,Ee,$e=K.getValObject,ge=K.flags,ae=K.immutable,Re=K.inArray,Oe=K.arrayIndex;function We(){var Mt=ne.editType;if(Re&&Mt.indexOf("arraydraw")!==-1){i.pushUnique(ge.arrays[Re],Oe);return}T.update(ge,ne),Mt!=="none"&&ge.nChanges++,K.transition&&ne.anim&&ge.nChangesAnim++,(ve.test(Ee)||Me.test(Ee))&&(ge.rangesAltered[V[0]]=1),re==="datarevision"&&(ge.newDataRevision=1)}function Be(Mt){return Mt.valType==="data_array"||Mt.arrayOk}for(re in R){if(ge.calc&&!K.transition)return;var rt=R[re],at=U[re],Ye=V.concat(re);if(Ee=Ye.join("."),!(re.charAt(0)==="_"||typeof rt=="function"||rt===at)){if((re==="tick0"||re==="dtick")&&V[0]!=="geo"){var wt=U.tickmode;if(wt==="auto"||wt==="array"||!wt)continue}if(!(re==="range"&&U.autorange)&&!((re==="zmin"||re==="zmax")&&U.type==="contourcarpet")&&(ne=$e(Ye),!!ne&&!(ne._compareAsJSON&&JSON.stringify(rt)===JSON.stringify(at)))){var tt=ne.valType,Ze,vt=Be(ne),pt=Array.isArray(rt),lt=Array.isArray(at);if(pt&&lt){var it="_input_"+re,Ke=R[it],et=U[it];if(Array.isArray(Ke)&&Ke===et)continue}if(at===void 0)vt&&pt?ge.calc=!0:We();else if(ne._isLinkedToArray){var ft=[],mt=!1;Re||(ge.arrays[re]=ft);var Qe=Math.min(rt.length,at.length),bt=Math.max(rt.length,at.length);if(Qe!==bt)if(ne.editType==="arraydraw")mt=!0;else{We();continue}for(Ze=0;Ze<Qe;Ze++)Ie(rt[Ze],at[Ze],Ye.concat(Ze),i.extendFlat({inArray:re,arrayIndex:Ze},K));if(mt)for(Ze=Qe;Ze<bt;Ze++)ft.push(Ze)}else!tt&&i.isPlainObject(rt)?Ie(rt,at,Ye,K):vt?pt&&lt?(ae&&(ge.calc=!0),(ae||K.newDataRevision)&&We()):pt!==lt?ge.calc=!0:We():pt&&lt?(rt.length!==at.length||String(rt)!==String(at))&&We():We()}}}for(re in U)if(!(re in R||re.charAt(0)==="_"||typeof U[re]=="function"))if(ne=$e(V.concat(re)),Be(ne)&&Array.isArray(U[re])){ge.calc=!0;return}else We()}function Ge(R,U){var V;for(V in R)if(V.charAt(0)!=="_"){var K=R[V],ne=U[V];if(K!==ne)if(i.isPlainObject(K)&&i.isPlainObject(ne)){if(Ge(K,ne))return!0}else if(Array.isArray(K)&&Array.isArray(ne)){if(K.length!==ne.length)return!0;for(var re=0;re<K.length;re++)if(K[re]!==ne[re])if(i.isPlainObject(K[re])&&i.isPlainObject(ne[re])){if(Ge(K[re],ne[re]))return!0}else return!0}else return!0}}function ue(R,U,V){if(R=i.getGraphDiv(R),!i.isPlotDiv(R))throw new Error("This element is not a Plotly plot: "+R+". It's likely that you've failed to create a plot before animating it. For more details, see https://plotly.com/javascript/animations/");var K=R._transitionData;K._frameQueue||(K._frameQueue=[]),V=c.supplyAnimationDefaults(V);var ne=V.transition,re=V.frame;K._frameWaitingCnt===void 0&&(K._frameWaitingCnt=0);function Ee(ae){return Array.isArray(ne)?ae>=ne.length?ne[0]:ne[ae]:ne}function $e(ae){return Array.isArray(re)?ae>=re.length?re[0]:re[ae]:re}function ge(ae,Re){var Oe=0;return function(){if(ae&&++Oe===Re)return ae()}}return new Promise(function(ae,Re){function Oe(){if(K._frameQueue.length!==0){for(;K._frameQueue.length;){var Qe=K._frameQueue.pop();Qe.onInterrupt&&Qe.onInterrupt()}R.emit("plotly_animationinterrupted",[])}}function We(Qe){if(Qe.length!==0){for(var bt=0;bt<Qe.length;bt++){var Mt;Qe[bt].type==="byname"?Mt=c.computeFrame(R,Qe[bt].name):Mt=Qe[bt].data;var Lr=$e(bt),cr=Ee(bt);cr.duration=Math.min(cr.duration,Lr.duration);var Xr={frame:Mt,name:Qe[bt].name,frameOpts:Lr,transitionOpts:cr};bt===Qe.length-1&&(Xr.onComplete=ge(ae,2),Xr.onInterrupt=Re),K._frameQueue.push(Xr)}V.mode==="immediate"&&(K._lastFrameAt=-1/0),K._animationRaf||at()}}function Be(){R.emit("plotly_animated"),window.cancelAnimationFrame(K._animationRaf),K._animationRaf=null}function rt(){K._currentFrame&&K._currentFrame.onComplete&&K._currentFrame.onComplete();var Qe=K._currentFrame=K._frameQueue.shift();if(Qe){var bt=Qe.name?Qe.name.toString():null;R._fullLayout._currentFrame=bt,K._lastFrameAt=Date.now(),K._timeToNext=Qe.frameOpts.duration,c.transition(R,Qe.frame.data,Qe.frame.layout,x.coerceTraceIndices(R,Qe.frame.traces),Qe.frameOpts,Qe.transitionOpts).then(function(){Qe.onComplete&&Qe.onComplete()}),R.emit("plotly_animatingframe",{name:bt,frame:Qe.frame,animation:{frame:Qe.frameOpts,transition:Qe.transitionOpts}})}else Be()}function at(){R.emit("plotly_animating"),K._lastFrameAt=-1/0,K._timeToNext=0,K._runningTransitions=0,K._currentFrame=null;var Qe=function(){K._animationRaf=window.requestAnimationFrame(Qe),Date.now()-K._lastFrameAt>K._timeToNext&&rt()};Qe()}var Ye=0;function wt(Qe){return Array.isArray(ne)?Ye>=ne.length?Qe.transitionOpts=ne[Ye]:Qe.transitionOpts=ne[0]:Qe.transitionOpts=ne,Ye++,Qe}var tt,Ze,vt=[],pt=U==null,lt=Array.isArray(U),it=!pt&&!lt&&i.isPlainObject(U);if(it)vt.push({type:"object",data:wt(i.extendFlat({},U))});else if(pt||["string","number"].indexOf(typeof U)!==-1)for(tt=0;tt<K._frames.length;tt++)Ze=K._frames[tt],Ze&&(pt||String(Ze.group)===String(U))&&vt.push({type:"byname",name:String(Ze.name),data:wt({name:Ze.name})});else if(lt)for(tt=0;tt<U.length;tt++){var Ke=U[tt];["number","string"].indexOf(typeof Ke)!==-1?(Ke=String(Ke),vt.push({type:"byname",name:Ke,data:wt({name:Ke})})):i.isPlainObject(Ke)&&vt.push({type:"object",data:wt(i.extendFlat({},Ke))})}for(tt=0;tt<vt.length;tt++)if(Ze=vt[tt],Ze.type==="byname"&&!K._frameHash[Ze.data.name]){i.warn('animate failure: frame not found: "'+Ze.data.name+'"'),Re();return}["next","immediate"].indexOf(V.mode)!==-1&&Oe(),V.direction==="reverse"&&vt.reverse();var et=R._fullLayout._currentFrame;if(et&&V.fromcurrent){var ft=-1;for(tt=0;tt<vt.length;tt++)if(Ze=vt[tt],Ze.type==="byname"&&Ze.name===et){ft=tt;break}if(ft>0&&ft<vt.length-1){var mt=[];for(tt=0;tt<vt.length;tt++)Ze=vt[tt],(vt[tt].type!=="byname"||tt>ft)&&mt.push(Ze);vt=mt}}vt.length>0?We(vt):(R.emit("plotly_animated"),ae())})}function He(R,U,V){if(R=i.getGraphDiv(R),U==null)return Promise.resolve();if(!i.isPlotDiv(R))throw new Error("This element is not a Plotly plot: "+R+". It's likely that you've failed to create a plot before adding frames. For more details, see https://plotly.com/javascript/animations/");var K,ne,re,Ee,$e=R._transitionData._frames,ge=R._transitionData._frameHash;if(!Array.isArray(U))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+U);var ae=$e.length+U.length*2,Re=[],Oe={};for(K=U.length-1;K>=0;K--)if(i.isPlainObject(U[K])){var We=U[K].name,Be=(ge[We]||Oe[We]||{}).name,rt=U[K].name,at=ge[Be]||Oe[Be];Be&&rt&&typeof rt=="number"&&at&&M<S&&(M++,i.warn('addFrames: overwriting frame "'+(ge[Be]||Oe[Be]).name+'" with a frame whose name of type "number" also equates to "'+Be+'". 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.")),Oe[We]={name:We},Re.push({frame:c.supplyFrameDefaults(U[K]),index:V&&V[K]!==void 0&&V[K]!==null?V[K]:ae+K})}Re.sort(function(it,Ke){return it.index>Ke.index?-1:it.index<Ke.index?1:0});var Ye=[],wt=[],tt=$e.length;for(K=Re.length-1;K>=0;K--){if(ne=Re[K].frame,typeof ne.name=="number"&&i.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!ne.name)for(;ge[ne.name="frame "+R._transitionData._counter++];);if(ge[ne.name]){for(re=0;re<$e.length&&($e[re]||{}).name!==ne.name;re++);Ye.push({type:"replace",index:re,value:ne}),wt.unshift({type:"replace",index:re,value:$e[re]})}else Ee=Math.max(0,Math.min(Re[K].index,tt)),Ye.push({type:"insert",index:Ee,value:ne}),wt.unshift({type:"delete",index:Ee}),tt++}var Ze=c.modifyFrames,vt=c.modifyFrames,pt=[R,wt],lt=[R,Ye];return l&&l.add(R,Ze,pt,vt,lt),c.modifyFrames(R,Ye)}function je(R,U){if(R=i.getGraphDiv(R),!i.isPlotDiv(R))throw new Error("This element is not a Plotly plot: "+R);var V,K,ne=R._transitionData._frames,re=[],Ee=[];if(!U)for(U=[],V=0;V<ne.length;V++)U.push(V);for(U=U.slice(),U.sort(),V=U.length-1;V>=0;V--)K=U[V],re.push({type:"delete",index:K}),Ee.unshift({type:"insert",index:K,value:ne[K]});var $e=c.modifyFrames,ge=c.modifyFrames,ae=[R,Ee],Re=[R,re];return l&&l.add(R,$e,ae,ge,Re),c.modifyFrames(R,re)}function Fe(R){R=i.getGraphDiv(R);var U=R._fullLayout||{},V=R._fullData||[];return c.cleanPlot([],{},V,U),c.purge(R),o.purge(R),U._container&&U._container.remove(),delete R._context,R}function qe(R){var U=R._fullLayout,V=R.getBoundingClientRect();if(!i.equalDomRects(V,U._lastBBox)){var K=U._invTransform=i.inverseTransformMatrix(i.getFullTransformMatrix(R));U._invScaleX=Math.sqrt(K[0][0]*K[0][0]+K[0][1]*K[0][1]+K[0][2]*K[0][2]),U._invScaleY=Math.sqrt(K[1][0]*K[1][0]+K[1][1]*K[1][1]+K[1][2]*K[1][2]),U._lastBBox=V}}function Ne(R){var U=e.select(R),V=R._fullLayout;if(V._calcInverseTransform=qe,V._calcInverseTransform(R),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 K={};e.selectAll("defs").each(function(){this.id&&(K[this.id.split("-")[1]]=1)}),V._uid=i.randstr(K)}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 ne=V._paper.append("g").classed("layer-below",!0);V._imageLowerLayer=ne.append("g").classed("imagelayer",!0),V._shapeLowerLayer=ne.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"),R.emit("plotly_framework")}t.animate=ue,t.addFrames=He,t.deleteFrames=je,t.addTraces=Y,t.deleteTraces=B,t.extendTraces=q,t.moveTraces=Q,t.prependTraces=W,t.newPlot=P,t._doPlot=L,t.purge=Fe,t.react=Ae,t.redraw=D,t.relayout=_e,t.restyle=ee,t.setPlotConfig=F,t.update=Ce,t._guiRelayout=J(_e),t._guiRestyle=J(ee),t._guiUpdate=J(Ce),t._storeDirectGUIEdit=de})(np);var Nr={},tR=Je;Nr.getDelay=function(t){return t._has&&(t._has("gl3d")||t._has("mapbox")||t._has("map"))?500:0};Nr.getRedrawFunc=function(t){return function(){tR.getComponentMethod("colorbar","draw")(t)}};Nr.encodeSVG=function(t){return"data:image/svg+xml,"+encodeURIComponent(t)};Nr.encodeJSON=function(t){return"data:application/json,"+encodeURIComponent(t)};var J2=window.URL||window.webkitURL;Nr.createObjectURL=function(t){return J2.createObjectURL(t)};Nr.revokeObjectURL=function(t){return J2.revokeObjectURL(t)};Nr.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=rR(window.atob(t));return new window.Blob([r],{type:"image/"+e})};Nr.octetStream=function(t){document.location.href="data:application/octet-stream"+t};function rR(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}Nr.IMAGE_URL_PREFIX=/^data:image\/\w+;base64,/;var ph=ut,aR=kt,iR=ct,Lv=/"/g,Rl="TOBESTRIPPED",nR=new RegExp('("'+Rl+")|("+Rl+'")',"g");function oR(t){var e=ph.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 lR(t){return t.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&amp;")}var Kp=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(aR.setRect,0,0,l,s).call(iR.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=ph.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(Lv,Rl));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=ph.select(this),y=this.style.fill;y&&y.indexOf("url(")!==-1&&m.style("fill",y.replace(Lv,Rl));var b=this.style.stroke;b&&b.indexOf("url(")!==-1&&m.style("stroke",b.replace(Lv,Rl))}),(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=oR(h),h=lR(h),h=h.replace(nR,"'"),h},sR=be,fR=Nh.EventEmitter,pl=Nr;function cR(t){var e=t.emitter||new fR,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"||sR.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 Qp=cR,B0=ht,G0=np,uR=Kt,Pa=be,ml=Nr,vR=Kp,dR=Qp,hR=Oc.version,Cv={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 pR(t,e){e=e||{};var r,a,i,n;Pa.isPlainObject(t)?(r=t.data||[],a=t.layout||{},i=t.config||{},n={}):(t=Pa.getGraphDiv(t),r=Pa.extendDeep([],t.data),a=Pa.extendDeep({},t.layout),i=t._context,n=t._fullLayout||{});function o(w){return!(w in e)||Pa.validate(e[w],Cv[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 "+Pa.join2(Cv.format.values,", "," or ")+".");var l={};function s(w,T){return Pa.coerce(e,l,Cv,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=Pa.extendFlat({},a);c?m.width=c:e.width===null&&B0(n.width)&&(m.width=n.width),u?m.height=u:e.height===null&&B0(n.height)&&(m.height=n.height);var y=Pa.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=vR(h,f,v),M=h._fullLayout.width,S=h._fullLayout.height;function L(){G0.purge(h),document.body.removeChild(h)}if(f==="full-json"){var E=uR.graphJson(h,!1,"keepdata","object",!0,!0);return E.version=hR,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=Pa.randstr(),dR({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){G0.newPlot(h,r,m,y).then(b).then(_).then(g).then(function(A){w(x(A))}).catch(function(A){T(A)})})}var ek=pR,ia=be,mR=Kt,yR=Uo,gR=Oo.dfltConfig,ma=ia.isPlainObject,hn=Array.isArray,Dv=ia.isArrayOrTypedArray,bR=function(e,r){e===void 0&&(e=[]),r===void 0&&(r={});var a=yR.get(),i=[],n={_context:ia.extendFlat({},gR)},o,l;hn(e)?(n.data=ia.extendDeep([],e),o=e):(n.data=[],o=[],i.push(rr("array","data"))),ma(r)?(n.layout=ia.extendDeep({},r),l=r):(n.layout={},l={},arguments.length>1&&i.push(rr("object","layout"))),mR.supplyDefaults(n);for(var s=n._fullData,f=o.length,c=0;c<f;c++){var u=o[c],v=["data",c];if(!ma(u)){i.push(rr("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(rr("invisible",v)),wc(u,p,h,i,v)}var m=n._fullLayout,y=xR(a,s);return wc(l,m,y,i,"layout"),i.length===0?void 0:i};function wc(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=TR(r,s),p=(v||{}).valType,d=p==="info_array",h=p==="colorscale",m=(v||{}).items;if(!wR(r,s))a.push(rr("schema",i,f));else if(ma(c)&&ma(u)&&p!=="any")wc(c,u,v,a,i,f);else if(d&&hn(c)){c.length>u.length&&a.push(rr("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(hn(c[g])){c[g].length>u[g].length&&a.push(rr("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][_],ia.validate(w,x)?T!==w&&T!==+w&&a.push(rr("dynamic",i,f.concat(g,_),w,T)):a.push(rr("value",i,f.concat(g,_),w))}else a.push(rr("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],ia.validate(w,x)?T!==w&&T!==+w&&a.push(rr("dynamic",i,f.concat(g),w,T)):a.push(rr("value",i,f.concat(g),w))}else if(v.items&&!d&&hn(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),ma(c[F])&&ma(u[L])){S.push(F);var N=c[F],z=u[L];ma(N)&&N.visible!==!1&&z.visible===!1?a.push(rr("invisible",i,E)):wc(N,z,M,a,i,E)}}for(L=0;L<c.length;L++)E=f.slice(),E.push(L),ma(c[L])?S.indexOf(L)===-1&&a.push(rr("unused",i,E)):a.push(rr("object",i,E,c[L]))}else!ma(c)&&ma(u)?a.push(rr("object",i,f,c)):!Dv(c)&&Dv(u)&&!d&&!h?a.push(rr("array",i,f,c)):s in e?ia.validate(c,v)?v.valType==="enumerated"&&(v.coerceNumber&&c!==+u||!Dv(c)&&c!==u||String(c)!==String(u))&&a.push(rr("dynamic",i,f,c,u)):a.push(rr("value",i,f,c)):a.push(rr("unused",i,f,c))}return a}function xR(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?ia.extendFlat(r[n.attributes.subplot.dflt],o):ia.extendFlat(r,o))}return r}var _R={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=Vi(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=Vi(t)+"key "+e,r+" must be linked to an array container"},schema:function(t,e){return Vi(t)+"key "+e+" is not part of the schema"},unused:function(t,e,r){var a=ma(r)?"container":"key";return Vi(t)+a+" "+e+" did not get coerced"},dynamic:function(t,e,r,a){return[Vi(t)+"key",e,"(set to '"+r+"')","got reset to","'"+a+"'","during defaults."].join(" ")},invisible:function(t,e){return(e?Vi(t)+"item "+e:"Trace "+t[1])+" got defaulted to be not visible"},value:function(t,e,r){return[Vi(t)+"key "+e,"is set to an invalid value ("+r+")"].join(" ")}};function Vi(t){return hn(t)?"In data trace "+t[1]+", ":"In "+t+", "}function rr(t,e,r,a,i){r=r||"";var n,o;hn(e)?(n=e[0],o=e[1]):(n=e,o=null);var l=AR(r),s=_R[t](e,l,a,i);return ia.log(s),{code:t,container:n,trace:o,path:r,astr:l,msg:s}}function wR(t,e){var r=tk(e),a=r.keyMinusId,i=r.id;return a in t&&t[a]._isSubplotObj&&i?!0:e in t}function TR(t,e){if(e in t)return t[e];var r=tk(e);return t[r.keyMinusId]}var kR=ia.counterRegex("([a-z]+)");function tk(t){var e=t.match(kR);return{keyMinusId:e&&e[1],id:e&&e[2]}}function AR(t){if(!hn(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 MR=be,vf=Nr;function SR(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=vf.createBlob(t,r),f=vf.createObjectURL(s),a.href=f,a.download=e,document.body.appendChild(a),a.click(),document.body.removeChild(a),vf.revokeObjectURL(f),s=null,o(e);if(MR.isSafari()){var c=r==="svg"?",":";base64,";return vf.octetStream(c+encodeURIComponent(t)),o(e)}l(new Error("download error"))});return n}var LR=SR,U0=be,CR=ek,DR=LR;function $R(t,e){var r;return U0.isPlainObject(t)||(r=U0.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=CR(t,e),o=e.filename||t.fn||"newplot";o+="."+e.format.replace("-","."),n.then(function(l){return r&&(r._snapshotInProgress=!1),DR(l,o,e.format)}).then(function(l){a(l)}).catch(function(l){r&&(r._snapshotInProgress=!1),i(l)})})}var rk=$R,Jp={},zr=be,Rr=zr.isPlainObject,ak=Uo,ik=Kt,PR=la,nk=Lt,ok=Oo.dfltConfig;Jp.makeTemplate=function(t){t=zr.isPlainObject(t)?t:zr.getGraphDiv(t),t=zr.extendDeep({_context:ok},{data:t.data,layout:t.layout}),ik.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={};Il(p,d,zR.bind(null,p));var h=zr.coerce(p,{},PR,"type"),m=a.data[h];m||(m=a.data[h]=[]),m.push(d)}),Il(r,a.layout,ER.bind(null,r)),delete a.layout.template;var i=r.template;if(Rr(i)){var n=i.layout,o,l,s,f,c,u;Rr(n)&&Tc(n,a.layout);var v=i.data;if(Rr(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++)Tc(s[o%f],c[o]);for(o=u;o<f;o++)c.push(zr.extendDeep({},s[o]))}for(l in v)l in a.data||(a.data[l]=zr.extendDeep([],v[l]))}}return a};function Tc(t,e){t=zr.extendDeep({},t);var r=Object.keys(t).sort(),a,i;function n(c,u,v){if(Rr(u)&&Rr(c))Tc(c,u);else if(Array.isArray(u)&&Array.isArray(c)){var p=nk.arrayTemplater({_template:t},v);for(i=0;i<u.length;i++){var d=u[i],h=p.newItem(d)._template;h&&Tc(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,kc(o)===o)for(var s in e){var f=kc(s);s!==f&&f===o&&!(s in t)&&n(l,e[s],o)}}}function kc(t){return t.replace(/[0-9]+$/,"")}function Il(t,e,r,a,i){var n=i&&r(i);for(var o in t){var l=t[o],s=Qr(t,o,a),f=Qr(t,o,i),c=r(f);if(!c){var u=kc(o);u!==o&&(f=Qr(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&&Rr(l))Il(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(Rr(m)){var y=m.name;if(y)d[y]||(Il(m,e,r,Qr(l,p,s),Qr(l,p,f)),p++,d[y]=1);else if(!v){var b=nk.arrayDefaultKey(o),_=Qr(t,b,a),g=Qr(l,p,s);Il(m,e,r,g,Qr(l,p,f));var x=zr.nestedProperty(e,g),w=zr.nestedProperty(e,_);w.set(x.get()),x.set(null),v=!0}}}else{var T=zr.nestedProperty(e,s);T.set(l)}}}function ER(t,e){return ak.getLayoutValObject(t,zr.nestedProperty({},e).parts)}function zR(t,e){return ak.getTraceValObject(t,zr.nestedProperty({},e).parts)}function Qr(t,e,r){var a;return r?Array.isArray(t)?a=r+"["+e+"]":a=r+"."+e:a=e,a}Jp.validateTemplate=function(t,e){var r=zr.extendDeep({},{_context:ok,data:t.data,layout:t.layout}),a=r.layout||{};Rr(e)||(e=a.template||{});var i=e.layout,n=e.data,o=[];r.layout=a,r.layout.template=e,ik.supplyDefaults(r);var l=r._fullLayout,s=r._fullData,f={};function c(_,g){for(var x in _)if(x.charAt(0)!=="_"&&Rr(_[x])){var w=kc(x),T=[],A;for(A=0;A<g.length;A++)T.push(Qr(_,x,g[A])),w!==x&&T.push(Qr(_,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&&Rr(_[x])){var w=Qr(_,x,g);f[w]?u(_[x],w):o.push({code:"unused",path:w})}}if(Rr(i)?(c(l,["layout"]),u(i,"layout")):o.push({code:"layout"}),!Rr(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=Qr(_,x,g);Rr(w)?(Array.isArray(_)&&w._template===!1&&w.templateitemname&&o.push({code:"missing",path:T,templateitemname:w.templateitemname}),b(w,T)):Array.isArray(w)&&RR(w)&&b(w,T)}}if(b({data:s,layout:l},""),o.length)return o.map(IR)};function RR(t){for(var e=0;e<t.length;e++)if(Rr(t[e]))return!0}function IR(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 tr=np;zt._doPlot=tr._doPlot;zt.newPlot=tr.newPlot;zt.restyle=tr.restyle;zt.relayout=tr.relayout;zt.redraw=tr.redraw;zt.update=tr.update;zt._guiRestyle=tr._guiRestyle;zt._guiRelayout=tr._guiRelayout;zt._guiUpdate=tr._guiUpdate;zt._storeDirectGUIEdit=tr._storeDirectGUIEdit;zt.react=tr.react;zt.extendTraces=tr.extendTraces;zt.prependTraces=tr.prependTraces;zt.addTraces=tr.addTraces;zt.deleteTraces=tr.deleteTraces;zt.moveTraces=tr.moveTraces;zt.purge=tr.purge;zt.addFrames=tr.addFrames;zt.deleteFrames=tr.deleteFrames;zt.animate=tr.animate;zt.setPlotConfig=tr.setPlotConfig;var FR=Wc.getGraphDiv,NR=Ip.eraseActiveShape;zt.deleteActiveShape=function(t){return NR(FR(t))};zt.toImage=ek;zt.validate=bR;zt.downloadImage=rk;var lk=Jp;zt.makeTemplate=lk.makeTemplate;zt.validateTemplate=lk.validateTemplate;var $v=be,HR=Je,em=function(e,r,a,i){var n=i("x"),o=i("y"),l,s=HR.getComponentMethod("calendars","handleTraceDefaults");if(s(e,r,["x","y"],a),n){var f=$v.minRowLength(n);o?l=Math.min(f,$v.minRowLength(o)):(l=f,i("y0"),i("dy"))}else{if(!o)return 0;l=$v.minRowLength(o),i("x0"),i("dx")}return r._length=l,l},V0=be.dateTick0,OR=Wt,jR=OR.ONEWEEK;function W0(t,e){return t%jR===0?V0(e,1):V0(e,0)}var Tu=function(e,r,a,i,n){if(n||(n={x:!0,y:!0}),n.x){var o=i("xperiod");o&&(i("xperiod0",W0(o,r.xcalendar)),i("xperiodalignment"))}if(n.y){var l=i("yperiod");l&&(i("yperiod0",W0(l,r.ycalendar)),i("yperiodalignment"))}},X0=["orientation","groupnorm","stackgaps"],BR=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<X0.length;v++){var p=X0[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}},Y0=ct,q0=Ma.hasColorscale,Z0=ys,GR=kr,sk=function(e,r,a,i,n,o){var l=GR.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),q0(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=Y0.background:f=Y0.defaultLine,n("marker.line.color",f),q0(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")}},UR=be.isArrayOrTypedArray,VR=Ma.hasColorscale,WR=ys,fk=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),VR(e,"line"))WR(e,r,i,n,{prefix:"line.",cLetter:"c"});else{var s=(UR(l)?!1:l)||a;n("line.color",s)}n("line.width"),o.noDash||n("line.dash"),o.backoff&&n("line.backoff")},XR=function(e,r,a){var i=a("line.shape");i==="spline"&&a("line.smoothing")},YR=be,ck=function(t,e,r,a,i){i=i||{},a("textposition"),YR.coerceFont(a,"textfont",i.font||r.font,i),i.noSelect||(a("selected.textfont.color"),a("unselected.textfont.color"))},Wf=ct,K0=be.isArrayOrTypedArray;function qR(t){for(var e=Wf.interpolate(t[0][1],t[1][1],.5),r=2;r<t.length;r++){var a=Wf.interpolate(t[r-1][1],t[r][1],.5);e=Wf.interpolate(e,a,t[r-1][0]/t[r][0])}return e}var uk=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&&!K0(l)?o=l:s&&!K0(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=qR(u))}}i("fillcolor",Wf.addOpacity((r.line||{}).color||o||f||a,.5))},Q0=be,ZR=Je,KR=zi,QR=_u,Un=kr,JR=em,eI=Tu,tI=BR,rI=sk,aI=fk,J0=XR,iI=ck,nI=uk,oI=be.coercePattern,lI=function(e,r,a,i){function n(p,d){return Q0.coerce(e,r,KR,p,d)}var o=JR(e,r,i,n);if(o||(r.visible=!1),!!r.visible){eI(e,r,i,n),n("xhoverformat"),n("yhoverformat"),n("zorder");var l=tI(e,r,i,n);i.scattermode==="group"&&r.orientation===void 0&&n("orientation","v");var s=!l&&o<QR.PTS_LINESONLY?"lines+markers":"lines";n("text"),n("hovertext"),n("mode",s),Un.hasMarkers(r)&&rI(e,r,a,i,n,{gradient:!0}),Un.hasLines(r)&&(aI(e,r,a,i,n,{backoff:!0}),J0(e,r,n),n("connectgaps"),n("line.simplify")),Un.hasText(r)&&(n("texttemplate"),iI(e,r,i,n));var f=[];(Un.hasMarkers(r)||Un.hasText(r))&&(n("cliponaxis"),n("marker.maxdisplayed"),f.push("points")),n("fill",l?l.fillDflt:"none"),r.fill!=="none"&&(nI(e,r,a,n,{moduleHasFillgradient:!0}),Un.hasLines(r)||J0(e,r,n),oI(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=ZR.getComponentMethod("errorbars","supplyDefaults");v(e,r,c||u||a,{axis:"y"}),v(e,r,c||u||a,{axis:"x",inherit:"y"}),Q0.coerceSelectionMarkerOpacity(r,n)}},sI=ri.getAxisGroup,tm=function(e,r,a,i,n){var o=r.orientation,l=r[{v:"x",h:"y"}[o]+"axis"],s=sI(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)},fI=be,cI=tm,uI=zi,vk=function(e,r){var a,i,n,o=r.scattermode;function l(v){return fI.coerce(i._input,i,uI,v)}if(r.scattermode==="group")for(n=0;n<e.length;n++)i=e[n],i.type==="scatter"&&(a=i._input,cI(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}}}}},vI=be,dI=op,hI=function(t,e){function r(i,n){return vI.coerce(t,e,dI,i,n)}var a=e.barmode==="group";e.scattermode==="group"&&r("scattergap",a?e.bargap:.2)},pI=ht,dk=be,mI=dk.dateTime2ms,df=dk.incrementMonth,yI=Wt,gI=yI.ONEAVGMONTH,ku=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(pI(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=mI(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*gI)),w=df(p,l*g,f);w>_;)w=df(w,-l,f);for(;w<=_;)w=df(w,l,f);x=df(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}},Pv=Ma.hasColorscale,Ev=up,eb=kr,hk=function(e,r){eb.hasLines(r)&&Pv(r,"line")&&Ev(e,r,{vals:r.line.color,containerStr:"line",cLetter:"c"}),eb.hasMarkers(r)&&(Pv(r,"marker")&&Ev(e,r,{vals:r.marker.color,containerStr:"marker",cLetter:"c"}),Pv(r,"marker.line")&&Ev(e,r,{vals:r.marker.line.color,containerStr:"marker.line",cLetter:"c"}))},jt=be,pk=function(e,r){for(var a=0;a<e.length;a++)e[a].i=a;jt.mergeArray(r.text,e,"tx"),jt.mergeArray(r.texttemplate,e,"txt"),jt.mergeArray(r.hovertext,e,"htx"),jt.mergeArray(r.customdata,e,"data"),jt.mergeArray(r.textposition,e,"tp"),r.textfont&&(jt.mergeArrayCastPositive(r.textfont.size,e,"ts"),jt.mergeArray(r.textfont.color,e,"tc"),jt.mergeArray(r.textfont.family,e,"tf"),jt.mergeArray(r.textfont.weight,e,"tw"),jt.mergeArray(r.textfont.style,e,"ty"),jt.mergeArray(r.textfont.variant,e,"tv"),jt.mergeArray(r.textfont.textcase,e,"tC"),jt.mergeArray(r.textfont.lineposition,e,"tE"),jt.mergeArray(r.textfont.shadow,e,"tS"));var i=r.marker;if(i){jt.mergeArrayCastPositive(i.size,e,"ms"),jt.mergeArrayCastPositive(i.opacity,e,"mo"),jt.mergeArray(i.symbol,e,"mx"),jt.mergeArray(i.angle,e,"ma"),jt.mergeArray(i.standoff,e,"mf"),jt.mergeArray(i.color,e,"mc");var n=i.line;i.line&&(jt.mergeArray(n.color,e,"mlc"),jt.mergeArrayCastPositive(n.width,e,"mlw"));var o=i.gradient;o&&o.type!=="none"&&(jt.mergeArray(o.type,e,"mgt"),jt.mergeArray(o.color,e,"mgc"))}},tb=be,mk=function(e,r){tb.isArrayOrTypedArray(r.selectedpoints)&&tb.tagSelected(e,r)},rb=ht,mh=be,rs=Ct,ab=ku,zv=Wt.BADNUM,yh=kr,bI=hk,xI=pk,_I=mk;function wI(t,e){var r=t._fullLayout,a=e._xA=rs.getFromId(t,e.xaxis||"x","x"),i=e._yA=rs.getFromId(t,e.yaxis||"y","y"),n=a.makeCalcdata(e,"x"),o=i.makeCalcdata(e,"y"),l=ab(e,a,"x",n),s=ab(e,i,"y",o),f=l.vals,c=s.vals,u=e._length,v=new Array(u),p=e.ids,d=rm(e,r,a,i),h=!1,m,y,b,_,g,x;bk(r,e);var w="x",T="y",A;if(d)mh.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=gk(e,u);yk(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=rb(f[y]),N=rb(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=zv,h=!0):E.s=0):E[w]=E[T]=zv,p&&(E.id=String(p[y]))}if(xI(v,e),bI(t,e),_I(v,e),d){for(y=0;y<v.length;)v[y][A]===zv?v.splice(y,1):y++;if(mh.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 yk(t,e,r,a,i,n,o){var l=e._length,s=t._fullLayout,f=r._id,c=a._id,u=s._firstScatter[xk(e)]===e.uid,v=(rm(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"||!yh.hasMarkers(e)&&!yh.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]=rs.findExtremes(r,i,d)),c&&(e._extremes[c]=rs.findExtremes(a,n,h))}function gk(t,e){if(yh.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)},mh.isArrayOrTypedArray(r.size)){var n={type:"linear"};rs.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 bk(t,e){var r=xk(e),a=t._firstScatter;a[r]||(a[r]=e.uid)}function xk(t){var e=t.stackgroup;return t.xaxis+t.yaxis+t.type+(e?"-"+e:"")}function rm(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 am={calc:wI,calcMarkerSize:gk,calcAxisExpansion:yk,setFirstScatter:bk,getStackOpts:rm},TI=Au,kI=be.distinctVals;function Au(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=kI(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={}}Au.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};Au.prototype.get=function(e,r,a){var i=this.getLabel(e,r,a);return this.bins[i]||0};Au.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 na=ht,Ai=be.isArrayOrTypedArray,Do=Wt.BADNUM,AI=Je,as=Ct,MI=ri.getAxisGroup,Mu=TI;function SI(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&&AI.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};gh(t,r,a,s,p),gh(t,a,r,l,p)}function gh(t,e,r,a,i){if(a.length){var n,o,l,s,f;switch(DI(r,a),i.mode){case"overlay":Rv(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&&$I(t,e,r,o,i),n.length&&Rv(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);CI(o),o.length&&PI(t,e,r,o,i),n.length&&Rv(t,e,r,n,i);break}LI(a),NI(a,e)}}function LI(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=na(n)?+n:+n.slice(0,-1),l=na(n)?"px":"%",i.cornerradiusvalue=o,i.cornerradiusform=l))}function CI(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=na(n)?+n:+n.slice(0,-1),l=na(n)?"px":"%",e=0;e<t.length;e++)r=t[e],i=r[0].t,i.cornerradiusvalue=o,i.cornerradiusform=l}}function DI(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(Ai(o)){for(a=0;a<Math.min(o.length,i.length);a++)l=f(o[a],0,s),na(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=na(l);for(l=c?l:0,a=0;a<i.length;a++)i[a].b=l,c&&(i[a].hasB=1)}}}function Rv(t,e,r,a,i){for(var n=0;n<a.length;n++){var o=a[n],l=new Mu([o],{posAxis:e,sepNegVal:!1,overlapNoMerge:!i.norm});im(t,e,l,i),i.norm?(wk(l),nm(r,l,i)):_k(r,l)}}function $I(t,e,r,a,i){var n=new Mu(a,{posAxis:e,sepNegVal:!1,overlapNoMerge:!i.norm});im(t,e,n,i),II(n,e),i.norm?(wk(n),nm(r,n,i)):_k(r,n)}function PI(t,e,r,a,i){var n=new Mu(a,{posAxis:e,sepNegVal:i.mode==="relative",overlapNoMerge:!(i.norm||i.mode==="stack"||i.mode==="relative")});im(t,e,n,i),RI(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!==Do){var u=c.b+c.s===n.get(c.p,s,c.s);u&&(c._outmost=!0)}}i.norm&&nm(r,n,i)}function im(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=MI(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,EI(r),zI(e,r),e._id==="angularaxis"?ib(e,r):ib(e,r,c)}function EI(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(Ai(s)){for(c=Array.prototype.slice.call(s,0,i.length),a=0;a<c.length;a++)na(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(Ai(u)){var p=Array.prototype.slice.call(u,0,i.length);for(a=0;a<p.length;a++)na(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 zI(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=Ai(l),f=o.barwidth,c=Ai(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 ib(t,e,r){var a=e.traces,i=e.minDiff,n=i/2;as.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=Ai(m),_=Ai(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]=as.findExtremes(t,c,{padded:!1})}}function _k(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]=as.findExtremes(t,f,{tozero:c,padded:!0})}}function RI(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!==Do&&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!==Do){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]=as.findExtremes(t,v,{tozero:!0,padded:!0}))}}function wk(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!==Do&&t.put(o.p,i,o.b+o.s)}}function II(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 Mu([i],{posAxis:e,sepNegVal:!0,overlapNoMerge:!0}),s=0;s<i.length;s++){var f=i[s];if(f.p!==Do){var c=l.put(f.p,o,f.b+f.s);c&&(f.b=c)}}}}function nm(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 na(t.c2l(w))&&(w<l-o||w>s+o||!na(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!==Do){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]=as.findExtremes(t,d,{tozero:h,padded:m})}}function FI(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 NI(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;na(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=Ai(h);for(n=0;n<o.length;n++){var y=o[n],b=y[r]-y.w/2;if(na(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&&FI(t,v,p,e)}function qo(t){return t._id.charAt(0)}var om={crossTraceCalc:SI,setGroupPositions:gh},nb=am,ob=om.setGroupPositions;function HI(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};ob(t,r,a,s,u),ob(t,a,r,l,u)}var OI=function(e,r){e._fullLayout.scattermode==="group"&&HI(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++)Iv(v,f,M[c],s,w,b,g),f++;if(d!==M[c]){for(u=0;u<s;u++)Iv(l[A[u]],c,d,u,w,b,g);M.splice(c,0,d)}c++}for(;c<M.length;c++)Iv(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=nb.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;nb.calcAxisExpansion(e,E,a,i,H,D,F),v[0].t.orientation=y.orientation}}}}};function Iv(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=jI(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 jI(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 BI=kt,Tk=Wt,yl=Tk.BADNUM,kk=Tk.LOG_CLIP,lb=kk+.5,sb=kk-.5,Ac=be,GI=Ac.segmentsIntersect,fb=Ac.constrain,Fv=_u,UI=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=Fv.minTolerance,_=e.length,g=new Array(_),x=0,w,T,A,M,S,L,E,F,N,z,H,D,P,k,C,$;function I(ue){var He=e[ue];if(!He)return!1;var je=r.linearized?i.l2p(He.x):i.c2p(He.x),Fe=r.linearized?n.l2p(He.y):n.c2p(He.y);if(je===yl){if(o&&(je=i.c2p(He.x,!0)),je===yl)return!1;l&&Fe===yl&&(je*=Math.abs(i._m*f*(i._m>0?lb:sb)/(n._m*s*(n._m>0?lb:sb)))),je*=1e3}if(Fe===yl){if(l&&(Fe=n.c2p(He.y,!0)),Fe===yl)return!1;Fe*=1e3}return[je,Fe]}function j(ue,He,je,Fe){var qe=je-ue,Ne=Fe-He,R=.5-ue,U=.5-He,V=qe*qe+Ne*Ne,K=qe*R+Ne*U;if(K>0&&K<V){var ne=R*Ne-U*qe;if(ne*ne<V)return!0}}var G,X;function O(ue,He){var je=ue[0]/s,Fe=ue[1]/f,qe=Math.max(0,-je,je-1,-Fe,Fe-1);return qe&&G!==void 0&&j(je,Fe,G,X)&&(qe=0),qe&&He&&j(je,Fe,He[0]/s,He[1]/f)&&(qe=0),(1+Fv.toleranceGrowth*qe)*p}function q(ue,He){var je=ue[0]-He[0],Fe=ue[1]-He[1];return Math.sqrt(je*je+Fe*Fe)}var W=Fv.maxScreensAway,Y=-s*W,B=s*(1+W),Q=-f*W,ee=f*(1+W),fe=[[Y,Q,B,Q],[B,Q,B,ee],[B,ee,Y,ee],[Y,ee,Y,Q]],oe,se,de,ye,_e,Se;function pe(ue,He){for(var je=[],Fe=0,qe=0;qe<4;qe++){var Ne=fe[qe],R=GI(ue[0],ue[1],He[0],He[1],Ne[0],Ne[1],Ne[2],Ne[3]);R&&(!Fe||Math.abs(R.x-je[0][0])>1||Math.abs(R.y-je[0][1])>1)&&(R=[R.x,R.y],Fe&&q(R,ue)<q(je[0],ue)?je.unshift(R):je.push(R),Fe++)}return je}function ve(ue){if(ue[0]<Y||ue[0]>B||ue[1]<Q||ue[1]>ee)return[fb(ue[0],Y,B),fb(ue[1],Q,ee)]}function Me(ue,He){if(ue[0]===He[0]&&(ue[0]===Y||ue[0]===B)||ue[1]===He[1]&&(ue[1]===Q||ue[1]===ee))return!0}function Pe(ue,He){var je=[],Fe=ve(ue),qe=ve(He);return Fe&&qe&&Me(Fe,qe)||(Fe&&je.push(Fe),qe&&je.push(qe)),je}function ce(ue,He,je){return function(Fe,qe){var Ne=ve(Fe),R=ve(qe),U=[];if(Ne&&R&&Me(Ne,R))return U;Ne&&U.push(Ne),R&&U.push(R);var V=2*Ac.constrain((Fe[ue]+qe[ue])/2,He,je)-((Ne||Fe)[ue]+(R||qe)[ue]);if(V){var K;Ne&&R?K=V>0==Ne[ue]>R[ue]?Ne:R:K=Ne||R,K[ue]+=V}return U}}var Le;d==="linear"||d==="spline"?Le=pe:d==="hv"||d==="vh"?Le=Pe:d==="hvh"?Le=ce(0,Y,B):d==="vhv"&&(Le=ce(1,Q,ee));function Ce(ue,He){var je=He[0]-ue[0],Fe=(He[1]-ue[1])/je,qe=(ue[1]*He[0]-He[1]*ue[0])/je;return qe>0?[Fe>0?Y:B,ee]:[Fe>0?B:Y,Q]}function J(ue){var He=ue[0],je=ue[1],Fe=He===g[x-1][0],qe=je===g[x-1][1];if(!(Fe&&qe))if(x>1){var Ne=He===g[x-2][0],R=je===g[x-2][1];Fe&&(He===Y||He===B)&&Ne?R?x--:g[x-1]=ue:qe&&(je===Q||je===ee)&&R?Ne?x--:g[x-1]=ue:g[x++]=ue}else g[x++]=ue}function xe(ue){g[x-1][0]!==ue[0]&&g[x-1][1]!==ue[1]&&J([de,ye]),J(ue),_e=null,de=ye=0}var Z=Ac.isArrayOrTypedArray(u);function ke(ue){if(ue&&c&&(ue.i=w,ue.d=e,ue.trace=a,ue.marker=Z?u[ue.i]:u,ue.backoff=c),G=ue[0]/s,X=ue[1]/f,oe=ue[0]<Y?Y:ue[0]>B?B:0,se=ue[1]<Q?Q:ue[1]>ee?ee:0,oe||se){if(!x)g[x++]=[oe||ue[0],se||ue[1]];else if(_e){var He=Le(_e,ue);He.length>1&&(xe(He[0]),g[x++]=He[1])}else Se=Le(g[x-1],ue)[0],g[x++]=Se;var je=g[x-1];oe&&se&&(je[0]!==oe||je[1]!==se)?(_e&&(de!==oe&&ye!==se?J(de&&ye?Ce(_e,ue):[de||oe,ye||se]):de&&ye&&J([de,ye])),J([oe,se])):de-oe&&ye-se&&J([oe||de,se||ye]),_e=ue,de=oe,ye=se}else _e&&xe(Le(_e,ue)[0]),g[x++]=ue}for(w=0;w<_;w++)if(T=I(w),!!T){for(x=0,_e=null,ke(T),w++;w<_;w++){if(M=I(w),!M){if(v)continue;break}if(!h||!r.simplify){ke(M);continue}var Te=I(w+1);if(z=q(M,T),!(!(m&&(x===0||x===_-1))&&z<O(M,Te)*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=Te,Te=I(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,Te))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?(ke(M),A!==S&&ke(S)):(S!==T&&ke(S),A!==M&&ke(M)),ke(A),w>=e.length||!L)break;ke(L),T=L}}_e&&J([de||_e[0],ye||_e[1]]),y.push(g.slice(0,x))}var le=d.slice(d.length-1);if(c&&le!=="h"&&le!=="v"){for(var ie=!1,me=-1,he=[],Ae=0;Ae<y.length;Ae++)for(var we=0;we<y[Ae].length-1;we++){var De=y[Ae][we],Ie=y[Ae][we+1],Ge=BI.applyBackoff(Ie,De);(Ge[0]!==Ie[0]||Ge[1]!==Ie[1])&&(ie=!0),he[me+1]||(me++,he[me]=[De,[Ge[0],Ge[1]]])}return ie?he:y}return y},cb={tonextx:1,tonexty:1,tonext:1},Ak=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 cb&&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 cb&&(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},ga=ut,VI=Je,is=be,po=is.ensureSingle,Mk=is.identity,Bt=kt,mo=kr,WI=UI,XI=Ak,hf=A2.tester,YI=function(e,r,a,i,n,o){var l,s,f=!n,c=!!n&&n.duration>0,u=XI(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(),qI(e,l,r),c){o&&(s=o());var v=ga.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){ub(e,d,r,p,u,this,n)})})}else l.each(function(p,d){ub(e,d,r,p,u,this,n)});f&&l.exit().remove(),i.selectAll("path:not([d])").remove()};function qI(t,e,r){e.each(function(a){var i=po(ga.select(this),"g","fills");Bt.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,Mk);l.enter().append("g"),l.exit().each(function(s){n[s]=null}).remove(),l.order().each(function(s){n[s]=po(ga.select(this),"path","js-fill")})})}function ub(t,e,r,a,i,n,o){var l=t._context.staticPlot,s;ZI(t,e,r,a,i);var f=!!o&&o.duration>0;function c(ce){return f?ce.transition():ce}var u=r.xaxis,v=r.yaxis,p=a[0].trace,d=p.line,h=ga.select(n),m=po(h,"g","errorbars"),y=po(h,"g","lines"),b=po(h,"g","points"),_=po(h,"g","text");if(VI.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,$,I,j,G=[];p._polygons=[];var X=[],O=[],q=is.noop;if(g=p._ownFill,mo.hasLines(p)||p.fill!=="none"){x&&x.datum(a),["hv","vh","hvh","vhv"].indexOf(d.shape)!==-1?(P=Bt.steps(d.shape),k=Bt.steps(d.shape.split("").reverse().join(""))):d.shape==="spline"?P=k=function(ce){var Le=ce[ce.length-1];return ce.length>1&&ce[0][0]===Le[0]&&ce[0][1]===Le[1]?Bt.smoothclosed(ce.slice(1),d.smoothing):Bt.smoothopen(ce,d.smoothing)}:P=k=function(ce){return"M"+ce.join("L")},C=function(ce){return k(ce.reverse())},O=WI(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}),X=new Array(O.length);var W=0;for(s=0;s<O.length;s++){var Y,B=O[s];!Y||!w?(Y=B.slice(),X[W]=Y,W++):Y.push.apply(Y,B)}p._fillElement=null,p._fillExclusionElement=F,p._fillsegments=X.slice(0,W),X=p._fillsegments,O.length&&($=O[0][0].slice(),I=O[O.length-1],j=I[I.length-1].slice()),q=function(ce){return function(Le){if(N=P(Le),z=C(Le),H?w?(H+="L"+N.substr(1),D=z+("L"+D.substr(1))):(H+="Z"+N,D=z+"Z"+D):(H=N,D=z),mo.hasLines(p)){var Ce=ga.select(this);if(Ce.datum(a),ce)c(Ce.style("opacity",0).attr("d",N).call(Bt.lineGroupStyle)).style("opacity",1);else{var J=c(Ce);J.attr("d",N),Bt.singleLineStyle(a,J)}}}}}var Q=y.selectAll(".js-line").data(O);c(Q.exit()).style("opacity",0).remove(),Q.each(q(!1)),Q.enter().append("path").classed("js-line",!0).style("vector-effect",l?"none":"non-scaling-stroke").call(Bt.lineGroupStyle).each(q(!0)),Bt.setClipUrl(Q,r.layerClipId,t);function ee(ce){c(ce).attr("d","M0,0Z")}var fe=function(){var ce=new Array(X.length);for(s=0;s<X.length;s++)ce[s]=hf(X[s]);return ce},oe=function(ce){var Le,Ce;if(!ce||ce.length===0)for(Le=new Array(X.length),Ce=0;Ce<X.length;Ce++){var J=X[Ce][0].slice(),xe=X[Ce][X[Ce].length-1].slice();J[T]=xe[T]=A;var Z=[xe,J],ke=Z.concat(X[Ce]);Le[Ce]=hf(ke)}else{for(Le=new Array(ce.length-1+X.length),Ce=0;Ce<ce.length-1;Ce++)Le[Ce]=hf(ce[Ce]);var Te=ce[ce.length-1].slice();for(Te.reverse(),Ce=0;Ce<X.length;Ce++)Le[ce.length-1+Ce]=hf(X[Ce].concat(Te))}return Le};O.length?(g?(g.datum(a),$&&j&&(w?($[T]=j[T]=A,c(g).attr("d","M"+j+"L"+$+"L"+H.substr(1)).call(Bt.singleFillStyle,t),G=oe(null)):(c(g).attr("d",H+"Z").call(Bt.singleFillStyle,t),G=fe())),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(Bt.singleFillStyle,t),G=fe(),p._polygons=G.concat(S)):(c(x).attr("d",H+"L"+M.substr(1)+"Z").call(Bt.singleFillStyle,t),G=oe(E),p._polygons=G),p._fillElement=x):ee(x)),p._prevRevpath=D):(g?ee(g):x&&ee(x),p._prevRevpath=null),p._ownPolygons=G;function se(ce){return ce.filter(function(Le){return!Le.gap&&Le.vis})}function de(ce){return ce.filter(function(Le){return Le.vis})}function ye(ce){return ce.filter(function(Le){return!Le.gap})}function _e(ce){return ce.id}function Se(ce){if(ce.ids)return _e}function pe(){return!1}function ve(ce,Le,Ce){var J,xe,Z,ke=Ce[0].trace,Te=mo.hasMarkers(ke),le=mo.hasText(ke),ie=Se(ke),me=pe,he=pe;if(Te||le){var Ae=Mk,we=ke.stackgroup,De=we&&t._fullLayout._scatterStackOpts[u._id+v._id][we].stackgaps==="infer zero";ke.marker.maxdisplayed||ke._needsCull?Ae=De?de:se:we&&!De&&(Ae=ye),Te&&(me=Ae),le&&(he=Ae)}xe=ce.selectAll("path.point"),J=xe.data(me,ie);var Ie=J.enter().append("path").classed("point",!0);f&&Ie.call(Bt.pointStyle,ke,t).call(Bt.translatePoints,u,v).style("opacity",0).transition().style("opacity",1),J.order();var Ge;Te&&(Ge=Bt.makePointStyleFns(ke)),J.each(function(ue){var He=ga.select(this),je=c(He);Z=Bt.translatePoint(ue,je,u,v),Z?(Bt.singlePointStyle(ue,je,ke,Ge,t),r.layerClipId&&Bt.hideOutsideRangePoint(ue,je,u,v,ke.xcalendar,ke.ycalendar),ke.customdata&&He.classed("plotly-customdata",ue.data!==null&&ue.data!==void 0)):je.remove()}),f?J.exit().transition().style("opacity",0).remove():J.exit().remove(),xe=Le.selectAll("g"),J=xe.data(he,ie),J.enter().append("g").classed("textpoint",!0).append("text"),J.order(),J.each(function(ue){var He=ga.select(this),je=c(He.select("text"));Z=Bt.translatePoint(ue,je,u,v),Z?r.layerClipId&&Bt.hideOutsideRangePoint(ue,He,u,v,ke.xcalendar,ke.ycalendar):He.remove()}),J.selectAll("text").call(Bt.textPointStyle,ke,t).each(function(ue){var He=u.c2p(ue.x),je=v.c2p(ue.y);ga.select(this).selectAll("tspan.line").each(function(){c(ga.select(this)).attr({x:He,y:je})})}),J.exit().remove()}b.datum(a),_.datum(a),ve(b,_,a);var Me=p.cliponaxis===!1,Pe=Me?null:r.layerClipId;Bt.setClipUrl(b,Pe,t),Bt.setClipUrl(_,Pe,t)}function ZI(t,e,r,a,i){var n=r.xaxis,o=r.yaxis,l=ga.extent(is.simpleMap(n.range,n.r2c)),s=ga.extent(is.simpleMap(o.range,o.r2c)),f=a[0].trace;if(mo.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;mo.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"},pf=Ct,Sk=function(e,r,a){var i={},n={_fullLayout:a},o=pf.getFromTrace(n,r,"x"),l=pf.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=pf.tickText(o,o.c2l(s),!0).text,i.yLabel=pf.tickText(l,l.c2l(f),!0).text,i},Nv=ut,$o=kt,KI=Je;function QI(t){var e=Nv.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=Nv.select(this),i=r.trace||r[0].trace;lm(a,i,t)}),e.selectAll("g.text").each(function(r){var a=Nv.select(this),i=r.trace||r[0].trace;sm(a,i,t)}),e.selectAll("g.trace path.js-line").call($o.lineGroupStyle),e.selectAll("g.trace path.js-fill").call($o.fillGroupStyle,t,!1),KI.getComponentMethod("errorbars","style")(e)}function lm(t,e,r){$o.pointStyle(t.selectAll("path.point"),e,r)}function sm(t,e,r){$o.textPointStyle(t.selectAll("text"),e,r)}function JI(t,e,r){var a=e[0].trace;a.selectedpoints?($o.selectedPointStyle(r.selectAll("path.point"),a),$o.selectedTextStyle(r.selectAll("text"),a)):(lm(r,a,t),sm(r,a,t))}var vb={style:QI,stylePoints:lm,styleText:sm,styleOnSelect:JI},Vn=ct,eF=kr,Lk=function(e,r){var a,i;if(e.mode==="lines")return a=e.line.color,a&&Vn.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&&Vn.opacity(n)?n:o&&Vn.opacity(o)&&(r.mlw||((e.marker||{}).line||{}).width)?o:"",i?Vn.opacity(i)<.3?Vn.addOpacity(i,.3):i:(a=(e.line||{}).color,a&&Vn.opacity(a)&&eF.hasLines(e)&&e.line.width?a:e.fillcolor)},Xf=be,db=Ta,tF=Je,rF=Lk,Hv=ct,aF=Xf.fillText,iF=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,I=Math.abs(l.c2p(D.x)-f);return I<C?$*I/C:I-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,I=Math.abs(s.c2p(D.y)-c);return I<C?$*I/C:I-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)},_=db.getDistanceFunction(i,m,y,b);if(db.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 Xf.extendFlat(e,{color:rF(o,g),x0:x-T,x1:x+T,xLabelVal:S,y0:w-T,y1:w+T,yLabelVal:L,spikeDistance:b(g),hovertemplate:o.hovertemplate}),aF(g,o,e),tF.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,I=1/0,j=-1/0,G;for(P=0;P<D.length;P++){var X=D[P];X.contains(u)&&(k.push(X),I=Math.min(I,X.ymin),j=Math.max(j,X.ymax))}if(k.length===0)return null;I=Math.max(I,0),j=Math.min(j,s._length),G=(I+j)/2;var O,q,W,Y,B,Q,ee;for(P=0;P<k.length;P++)for(q=k[P].pts,O=1;O<q.length;O++)Q=q[O-1][1],ee=q[O][1],Q>G!=ee>=G&&(Y=q[O-1][0],B=q[O][0],ee-Q&&(W=Y+(B-Y)*(G-Q)/(ee-Q),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=Hv.defaultLine;return Hv.opacity(o.fillcolor)?H=o.fillcolor:Hv.opacity((o.line||{}).color)&&(H=o.line.color),Xf.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&&!Xf.isArrayOrTypedArray(o.text)?e.text=String(o.text):e.text=o.name,[e]}}},hb=kr,nF=function(e,r){var a=e.cd,i=e.xaxis,n=e.yaxis,o=[],l=a[0].trace,s,f,c,u,v=!hb.hasMarkers(l)&&!hb.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},Qt={},Ov,pb;function oF(){return pb||(pb=1,Ov={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(" ")}}),Ov}var jv,mb;function lF(){if(mb)return jv;mb=1;var t=Je.traceIs,e=aT;jv=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 jv}var sF=Vt.isTypedArraySpec;function fF(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 cF=function(e,r,a,i){if(r.type==="category"){var n=e.categoryarray,o=Array.isArray(n)&&n.length>0||sF(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=fF(r,i).sort(),s==="category ascending"?r._initialCategories=f:s==="category descending"&&(r._initialCategories=f.reverse()))}},yb=oa.mix,uF=Tr,vF=be,dF=function(e,r,a,i){i=i||{};var n=i.dfltColor;function o(T,A){return vF.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=yb(n,i.bgColor,i.blend||uF.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=yb(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)}},gb=ht,hF=Je,Dl=be,pF=Lt,mF=ja,bh=Oa,bb=Fw,xb=Nw,yF=jw,gF=Bw,bF=cF,xF=dF,_F=bT,_b=pp,Yf=gr.WEEKDAY_PATTERN,wF=gr.HOUR_PATTERN,Ck=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=hF.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"),_b(r,n),_F(e,r,a,i),bF(e,r,a,i),u!=="category"&&!i.noHover&&a("hoverformat");var h=a("color"),m=h!==bh.color.dflt?h:l.color,y=s.label||n._dfltTitle[o];if(gF(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}}),bb(e,r,a,u);var b=i.hasMinor;if(b&&(pF.newContainer(r,"minor"),bb(e,r,a,u,{isMinor:!0})),yF(e,r,a,u,i),xb(e,r,a,i),b){var _=i.isMinor;i.isMinor=!0,xb(e,r,a,i),i.isMinor=_}xF(e,r,a,{dfltColor:h,bgColor:i.bgColor,showGrid:i.showGrid,hasMinor:b,attributes:bh}),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(mF(e,r,{name:"rangebreaks",inclusionAttr:"enabled",handleItemDefaults:TF}),!r.rangebreaks.length)delete r.rangebreaks;else{for(var w=0;w<r.rangebreaks.length;w++)if(r.rangebreaks[w].pattern===Yf){r._hasDayOfWeekBreaks=!0;break}if(_b(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 TF(t,e,r){function a(v,p){return Dl.coerce(t,e,bh.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=wb(n[l]),s){o=Yf;break}}var f=a("pattern",o);if(f===Yf)for(l=0;l<2;l++)s=wb(n[l]),s&&(e.bounds[l]=n[l]=s-1);if(f)for(l=0;l<2;l++)switch(s=n[l],f){case Yf:if(!gb(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 wF:if(!gb(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 kF={sun:1,mon:2,tue:3,wed:4,thu:5,fri:6,sat:7};function wb(t){if(typeof t=="string")return kF[t.substr(0,3).toLowerCase()]}var AF=ht,mf=be,Dk=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||(AF(e.position)?"free":n[0]||"free"),v=v||(l==="x"?"bottom":"left"),p=p||0,d=0,h=!1;var m=mf.coerce(e,r,{anchor:{valType:"enumerated",values:["free"].concat(n),dflt:c}},"anchor"),y=mf.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&&(_=mf.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),mf.noneOrAll(e.domain,r.domain,u),r.tickmode==="sync"&&(r.tickmode="auto")}return a("layer"),r},Bv,Tb;function MF(){if(Tb)return Bv;Tb=1;var t=be,e=ct,r=sa.isUnifiedHover,a=NT,i=Lt,n=hs,o=Oa,l=lF(),s=Ck,f=ri,c=Dk,u=Xt,v=u.id2name,p=u.name2id,d=gr.AX_ID_PATTERN,h=Je,m=h.traceIs,y=h.getComponentMethod;function b(_,g,x){Array.isArray(_[g])?_[g].push(x):_[g]=[x]}return Bv=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 I;if(C.yaxis)I=v(C.yaxis),b(A,I,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),I&&(N[I]=!0)):I&&(S[I]=!0):C.type==="image"?(I&&(z[I]=!0),$&&(z[$]=!0)):(I&&(E[I]=!0,F[I]=!0),(!m(C,"carpet")||C.type==="carpet"&&!C._cheater)&&$&&(L[$]=!0)),C.type==="carpet"&&C._cheater&&$&&(M[$]=!0),m(C,"2dMap")&&(H[$]=!0,H[I]=!0),m(C,"oriented")){var j=C.orientation==="h"?I:$;D[j]=!0}}}var G=x._subplots,X=G.xaxis,O=G.yaxis,q=t.simpleMap(X,v),W=t.simpleMap(O,v),Y=q.concat(W),B=e.background;X.length&&O.length&&(B=t.coerce(g,x,n,"plot_bgcolor"));var Q=e.combine(B,x.paper_bgcolor),ee,fe,oe,se,de;function ye(){var R=A[ee]||[];de._traceIndices=R.map(function(U){return U.index}),de._annIndices=[],de._shapeIndices=[],de._selectionIndices=[],de._imgIndices=[],de._subplotsWith=[],de._counterAxes=[],de._name=de._attr=ee,de._id=fe}function _e(R,U){return t.coerce(se,de,o,R,U)}function Se(R,U){return t.coerce2(se,de,o,R,U)}function pe(R){return R==="x"?O:X}function ve(R,U){for(var V=R==="x"?q:W,K=[],ne=0;ne<V.length;ne++){var re=V[ne];re!==U&&!(g[re]||{}).overlaying&&K.push(p(re))}return K}var Me={x:pe("x"),y:pe("y")},Pe=Me.x.concat(Me.y),ce={},Le=[];function Ce(){var R=se.matches;d.test(R)&&Pe.indexOf(R)===-1&&(ce[R]=se.type,Le=Object.keys(ce))}var J=a(g,x),xe=r(J);for(P=0;P<Y.length;P++){ee=Y[P],fe=p(ee),oe=ee.charAt(0),t.isPlainObject(g[ee])||(g[ee]={}),se=g[ee],de=i.newContainer(x,ee,oe+"axis"),ye();var Z=oe==="x"&&!L[ee]&&M[ee]||oe==="y"&&!E[ee]&&S[ee],ke=oe==="y"&&(!F[ee]&&N[ee]||z[ee]),Te={hasMinor:!0,letter:oe,font:x.font,outerTicks:H[ee],showGrid:!D[ee],data:A[ee]||[],bgColor:Q,calendar:x.calendar,automargin:!0,visibleDflt:Z,reverseDflt:ke,autotypenumbersDflt:T,splomStash:((x._splomAxes||{})[oe]||{})[fe],noAutotickangles:oe==="y"};_e("uirevision",x.uirevision),l(se,de,_e,Te),s(se,de,_e,Te,x);var le=xe&&oe===J.charAt(0),ie=Se("spikecolor",xe?de.color:void 0),me=Se("spikethickness",xe?1.5:void 0),he=Se("spikedash",xe?"dot":void 0),Ae=Se("spikemode",xe?"across":void 0),we=Se("spikesnap"),De=_e("showspikes",!!le||!!ie||!!me||!!he||!!Ae||!!we);De||(delete de.spikecolor,delete de.spikethickness,delete de.spikedash,delete de.spikemode,delete de.spikesnap);var Ie=v(se.overlaying),Ge=[0,1];if(x[Ie]!==void 0){var ue=v(x[Ie].anchor);x[ue]!==void 0&&(Ge=x[ue].domain)}c(se,de,_e,{letter:oe,counterAxes:Me[oe],overlayableAxes:ve(oe,ee),grid:x.grid,overlayingDomain:Ge}),_e("title.standoff"),Ce(),de._input=se}for(P=0;P<Le.length;){fe=Le[P++],ee=v(fe),oe=ee.charAt(0),t.isPlainObject(g[ee])||(g[ee]={}),se=g[ee],de=i.newContainer(x,ee,oe+"axis"),ye();var He={letter:oe,font:x.font,outerTicks:H[ee],showGrid:!D[ee],data:[],bgColor:Q,calendar:x.calendar,automargin:!0,visibleDflt:!1,reverseDflt:!1,autotypenumbersDflt:T,splomStash:((x._splomAxes||{})[oe]||{})[fe]};_e("uirevision",x.uirevision),de.type=ce[fe]||"linear",s(se,de,_e,He,x),c(se,de,_e,{letter:oe,counterAxes:Me[oe],overlayableAxes:ve(oe,ee),grid:x.grid}),_e("fixedrange"),Ce(),de._input=se}var je=y("rangeslider","handleDefaults"),Fe=y("rangeselector","handleDefaults");for(P=0;P<q.length;P++)ee=q[P],se=g[ee],de=x[ee],je(g,x,ee),de.type==="date"&&Fe(se,de,x,W,de.calendar),_e("fixedrange");for(P=0;P<W.length;P++){ee=W[P],se=g[ee],de=x[ee];var qe=x[v(de.anchor)],Ne=y("rangeslider","isVisible")(qe);_e("fixedrange",Ne)}f.handleDefaults(g,x,{axIds:Pe.concat(Le).sort(u.idSort),axHasImage:z})},Bv}var Gv,kb;function SF(){if(kb)return Gv;kb=1;var t=ut,e=Je,r=be,a=kt,i=Ct;return Gv=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],I=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*I/$),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,X=E?N[0]:0,O=F?N[1]:0,q=E?N[0]/N[2]*S:0,W=F?N[1]/N[3]*L:0,Y=A._offset-q,B=M._offset-W;T.clipRect.call(a.setTranslate,X,O).call(a.setScale,1/j,1/G),T.plot.call(a.setTranslate,Y,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()},Gv}var Su=ut,Ab=Je,bn=be,LF=Kt,CF=kt,Mb=ms.getModuleCalcData,_i=Xt,wa=gr,DF=Vo,At=bn.ensureSingle;function yf(t,e,r){return bn.ensureSingle(t,e,r,function(a){a.datum(r)})}var xn=wa.zindexSeparator;Qt.name="cartesian";Qt.attr=["xaxis","yaxis"];Qt.idRoot=["x","y"];Qt.idRegex=wa.idRegex;Qt.attrRegex=wa.attrRegex;Qt.attributes=oF();Qt.layoutAttributes=Oa;Qt.supplyLayoutDefaults=MF();Qt.transitionAxes=SF();Qt.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,wa.idRegex.y.test(u)||(u="y"),n.push(c+u),o.push(c+u),s[u]||(s[u]=1,bn.pushUnique(i,u)));for(f=0;f<i.length;f++)u=i[f],s[u]||(c=(t[_i.id2name(u)]||{}).anchor,wa.idRegex.x.test(c)||(c="x"),n.push(c+u),o.push(c+u),l[c]||(l[c]=1,bn.pushUnique(a,c)));if(!o.length){c="",u="";for(var p in t)if(wa.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)}};Qt.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(xn)!==-1)continue;p+=xn+(f+1),v=bn.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)}$k(t,v,d,r,a)}}};function $k(t,e,r,a,i){for(var n=wa.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=Ab.modules[y].categories;if(b.svg){var _=f.layerName||y+"layer",g=_+(d?Number(d)+1:""),x=f.plot;c=Mb(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=Su.select(this),S=A.className;A.plotMethod(t,e,A.cdModule,M,a,i),wa.clipOnAxisFalseQuery.indexOf("."+S)===-1&&CF.setClipUrl(M,e.layerClipId,t)}),o._has("scattergl")&&(f=Ab.getModule("scattergl"),u=Mb(r,f)[0],f.plot(t,e,u)),!t._context.staticPlot&&(e._hasClipOnAxisFalse&&(e.clipOnAxisFalseTraces=e.plot.selectAll(wa.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")}}Qt.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)Ek(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(xn)===-1&&!n[m]){var y="."+m+",."+m+"-x,."+m+"-y";a._cartesianlayer.selectAll(y).remove(),zk(m,a)}}};Qt.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(bn.sorterAsc);s.length||(s=[0]),e._zindices=s;var f=$F(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]+=xn+(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(Ek,e),d.each(function(h){var m=h[0],y=m.indexOf(xn),b=y!==-1,_=b?m.slice(0,y):m,g=e._plots[m];g||(g=bn.extendFlat({},e._plots[_]),g&&(g.id=m,e._plots[m]=g,e._subplots.cartesian.push(m))),g&&(g.plotgroup=Su.select(this),Pk(t,g),b||(g.draglayer=At(e._draggers,"g",m)))})};Qt.rangePlot=function(t,e,r){Pk(t,e),$k(t,e,r),LF.style(t)};function $F(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+=xn+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 Pk(t,e){var r=t._fullLayout,a=e.plotgroup,i=e.id,n=i.indexOf(xn),o=n!==-1,l=wa.layerValue2layerClass[e.xaxis.layer],s=wa.layerValue2layerClass[e.yaxis.layer],f=r._hasOnlyLargeSploms,c=r._zindices.length>1,u=e.mainplotinfo;if(!e.mainplot||c)if(f)e.xlines=At(a,"path","xlines-above"),e.ylines=At(a,"path","ylines-above"),e.xaxislayer=At(a,"g","xaxislayer-above"),e.yaxislayer=At(a,"g","yaxislayer-above");else{if(!o){var v=At(a,"g","layer-subplot");e.shapelayer=At(v,"g","shapelayer"),e.imagelayer=At(v,"g","imagelayer"),u&&c?(e.minorGridlayer=u.minorGridlayer,e.gridlayer=u.gridlayer,e.zerolinelayer=u.zerolinelayer):(e.minorGridlayer=At(a,"g","minor-gridlayer"),e.gridlayer=At(a,"g","gridlayer"),e.zerolinelayer=At(a,"g","zerolinelayer"));var p=At(a,"g","layer-between");e.shapelayerBetween=At(p,"g","shapelayer"),e.imagelayerBetween=At(p,"g","imagelayer"),At(a,"path","xlines-below"),At(a,"path","ylines-below"),e.overlinesBelow=At(a,"g","overlines-below"),At(a,"g","xaxislayer-below"),At(a,"g","yaxislayer-below"),e.overaxesBelow=At(a,"g","overaxes-below")}e.overplot=At(a,"g","overplot"),e.plot=At(e.overplot,"g",i),u&&c?e.zerolinelayerAbove=u.zerolinelayerAbove:e.zerolinelayerAbove=At(a,"g","zerolinelayer-above"),o||(e.xlines=At(a,"path","xlines-above"),e.ylines=At(a,"path","ylines-above"),e.overlinesAbove=At(a,"g","overlines-above"),At(a,"g","xaxislayer-above"),At(a,"g","yaxislayer-above"),e.overaxesAbove=At(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,At(u.overlinesBelow,"path",h),At(u.overlinesBelow,"path",m),At(u.overaxesBelow,"g",h),At(u.overaxesBelow,"g",m),e.plot=At(u.overplot,"g",i),At(u.overlinesAbove,"path",h),At(u.overlinesAbove,"path",m),At(u.overaxesAbove,"g",h),At(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||(yf(e.minorGridlayer,"g",e.xaxis._id),yf(e.minorGridlayer,"g",e.yaxis._id),e.minorGridlayer.selectAll("g").map(function(y){return y[0]}).sort(_i.idSort),yf(e.gridlayer,"g",e.xaxis._id),yf(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 Ek(t,e){if(t){var r={};t.each(function(s){var f=s[0],c=Su.select(this);c.remove(),zk(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 zk(t,e){e._draggers.selectAll("g."+t).remove(),e._defs.select("#clip"+e._uid+t+"plot").remove()}Qt.toSVG=function(t){var e=t._fullLayout._glimages,r=Su.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:DF.svg,"xlink:href":o,preserveAspectRatio:"none",x:0,y:0,width:n.style.width,height:n.style.height})}a.each(i)};Qt.updateFx=wp.updateFx;var gf=kr,PF={hasLines:gf.hasLines,hasMarkers:gf.hasMarkers,hasText:gf.hasText,isBubble:gf.isBubble,attributes:zi,layoutAttributes:op,supplyDefaults:lI,crossTraceDefaults:vk,supplyLayoutDefaults:hI,calc:am.calc,crossTraceCalc:OI,arraysToCalcdata:pk,plot:YI,colorbar:Ts,formatLabels:Sk,style:vb.style,styleOnSelect:vb.styleOnSelect,hoverPoints:iF,selectPoints:nF,animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:Qt,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(" ")}},EF=ut,zF=ct,Sb=H2,fm=be,RF=fm.strScale,IF=fm.strRotate,FF=fm.strTranslate,NF=function(e,r,a){var i=e.node(),n=Sb[a.arrowhead||0],o=Sb[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),EF.select(i.parentNode).append("path").attr({class:e.attr("class"),d:H.path,transform:FF(D.x,D.y)+IF(P*180/Math.PI)+RF(k)}).style({fill:zF.rgb(a.arrowcolor),"stroke-width":0}))}f&&z(o,p,h,s),c&&z(n,d,m,l)},Lb=ut,Uv=Je,HF=Kt,hi=be,Vv=hi.strTranslate,ns=Ct,Wi=ct,Wa=kt,Cb=Ta,Wv=or,Xv=$i,gl=Ba,OF=Lt.arrayEditor,jF=NF,cm={draw:BF,drawOne:Rk,drawRaw:Ik};function BF(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r<e.annotations.length;r++)e.annotations[r].visible&&Rk(t,r);return HF.previousPromises(t)}function Rk(t,e){var r=t._fullLayout,a=r.annotations[e]||{},i=ns.getFromId(t,a.xref),n=ns.getFromId(t,a.yref);i&&i.setScale(),n&&n.setScale(),Ik(t,a,e,!1,i,n)}function ui(t,e,r,a,i){var n=i[r],o=i[r+"ref"],l=r.indexOf("y")!==-1,s=ns.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 Ik(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=OF(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){Lb.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(Xv,"pointer").on("click",function(){t._dragging=!1,t.emit("plotly_clickannotation",w(Lb.event))});e.hovertext&&T.on("mouseover",function(){var k=e.hoverlabel,C=k.font,$=this.getBoundingClientRect(),I=t.getBoundingClientRect();Cb.loneHover({x0:$.left-I.left,x1:$.right-I.left,y:($.top+$.bottom)/2-I.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(){Cb.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(Wi.stroke,e.bordercolor).call(Wi.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?hi.templateString(e.text,o._meta):e.text,H=T.append("text").classed("annotation-text",!0).text(z);function D(k){return k.call(Wa.font,N).attr({"text-anchor":{left:"start",right:"end"}[e.align]||"middle"}),Wv.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"),I=!$.empty(),j=Wa.bBox((I?$:H).node()),G=j.width,X=j.height,O=e.width||G,q=e.height||X,W=Math.round(O+2*S),Y=Math.round(q+2*S);function B(Fe,qe){return qe==="auto"&&(Fe<1/3?qe="left":Fe>2/3?qe="right":qe="center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[qe]}for(var Q=!1,ee=["x","y"],fe=0;fe<ee.length;fe++){var oe=ee[fe],se=e[oe+"ref"]||oe,de=e["a"+oe+"ref"],ye={x:i,y:n}[oe],_e=(y+(oe==="x"?0:-90))*Math.PI/180,Se=W*Math.cos(_e),pe=Y*Math.sin(_e),ve=Math.abs(Se)+Math.abs(pe),Me=e[oe+"anchor"],Pe=e[oe+"shift"]*(oe==="x"?1:-1),ce=m[oe],Le,Ce,J,xe,Z,ke=ns.getRefType(se);if(ye&&ke!=="domain"){var Te=ye.r2fraction(e[oe]);(Te<0||Te>1)&&(de===se?(Te=ye.r2fraction(e["a"+oe]),(Te<0||Te>1)&&(Q=!0)):Q=!0),Le=ye._offset+ye.r2p(e[oe]),xe=.5}else{var le=ke==="domain";oe==="x"?(J=e[oe],Le=le?ye._offset+ye._length*J:Le=l.l+l.w*J):(J=1-e[oe],Le=le?ye._offset+ye._length*J:Le=l.t+l.h*J),xe=e.showarrow?.5:J}if(e.showarrow){ce.head=Le;var ie=e["a"+oe];if(Z=Se*B(.5,e.xanchor)-pe*B(.5,e.yanchor),de===se){var me=ns.getRefType(de);me==="domain"?(oe==="y"&&(ie=1-ie),ce.tail=ye._offset+ye._length*ie):me==="paper"?oe==="y"?(ie=1-ie,ce.tail=l.t+l.h*ie):ce.tail=l.l+l.w*ie:ce.tail=ye._offset+ye.r2p(ie),Ce=Z}else ce.tail=Le+ie,Ce=Z+ie;ce.text=ce.tail+Z;var he=o[oe==="x"?"width":"height"];if(se==="paper"&&(ce.head=hi.constrain(ce.head,1,he-1)),de==="pixel"){var Ae=-Math.max(ce.tail-3,ce.text),we=Math.min(ce.tail+3,ce.text)-he;Ae>0?(ce.tail+=Ae,ce.text+=Ae):we>0&&(ce.tail-=we,ce.text-=we)}ce.tail+=Pe,ce.head+=Pe}else Z=ve*B(xe,Me),Ce=Z,ce.text=Le+Z;ce.text+=Pe,Z+=Pe,Ce+=Pe,e["_"+oe+"padplus"]=ve/2+Ce,e["_"+oe+"padminus"]=ve/2-Ce,e["_"+oe+"size"]=ve,e["_"+oe+"shift"]=Z}if(Q){T.remove();return}var De=0,Ie=0;if(e.align!=="left"&&(De=(O-G)*(e.align==="center"?.5:1)),e.valign!=="top"&&(Ie=(q-X)*(e.valign==="middle"?.5:1)),I)$.select("svg").attr({x:S+De-1,y:S+Ie}).call(Wa.setClipUrl,E?h:null,t);else{var Ge=S+Ie-j.top,ue=S+De-j.left;H.call(Wv.positionText,ue,Ge).call(Wa.setClipUrl,E?h:null,t)}F.select("rect").call(Wa.setRect,S,S,O,q),L.call(Wa.setRect,A/2,A/2,W-A,Y-A),T.call(Wa.setTranslate,Math.round(m.x.text-W/2),Math.round(m.y.text-Y/2)),_.attr({transform:"rotate("+y+","+m.x.text+","+m.y.text+")"});var He=function(Fe,qe){b.selectAll(".annotation-arrow-g").remove();var Ne=m.x.head,R=m.y.head,U=m.x.tail+Fe,V=m.y.tail+qe,K=m.x.text+Fe,ne=m.y.text+qe,re=hi.rotationXYMatrix(y,K,ne),Ee=hi.apply2DTransform(re),$e=hi.apply2DTransform2(re),ge=+L.attr("width"),ae=+L.attr("height"),Re=K-.5*ge,Oe=Re+ge,We=ne-.5*ae,Be=We+ae,rt=[[Re,We,Re,Be],[Re,Be,Oe,Be],[Oe,Be,Oe,We],[Oe,We,Re,We]].map($e);if(!rt.reduce(function(ft,mt){return ft^!!hi.segmentsIntersect(Ne,R,Ne+1e6,R+1e6,mt[0],mt[1],mt[2],mt[3])},!1)){rt.forEach(function(ft){var mt=hi.segmentsIntersect(U,V,Ne,R,ft[0],ft[1],ft[2],ft[3]);mt&&(U=mt.x,V=mt.y)});var at=e.arrowwidth,Ye=e.arrowcolor,wt=e.arrowside,tt=b.append("g").style({opacity:Wi.opacity(Ye)}).classed("annotation-arrow-g",!0),Ze=tt.append("path").attr("d","M"+U+","+V+"L"+Ne+","+R).style("stroke-width",at+"px").call(Wi.stroke,Wi.rgb(Ye));if(jF(Ze,wt,e),s.annotationPosition&&Ze.node().parentNode&&!a){var vt=Ne,pt=R;if(e.standoff){var lt=Math.sqrt(Math.pow(Ne-U,2)+Math.pow(R-V,2));vt+=e.standoff*(U-Ne)/lt,pt+=e.standoff*(V-R)/lt}var it=tt.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(U-vt)+","+(V-pt),transform:Vv(vt,pt)}).style("stroke-width",at+6+"px").call(Wi.stroke,"rgba(0,0,0,0)").call(Wi.fill,"rgba(0,0,0,0)"),Ke,et;gl.init({element:it.node(),gd:t,prepFn:function(){var ft=Wa.getTranslate(T);Ke=ft.x,et=ft.y,i&&i.autorange&&v(i._name+".autorange",!0),n&&n.autorange&&v(n._name+".autorange",!0)},moveFn:function(ft,mt){var Qe=Ee(Ke,et),bt=Qe[0]+ft,Mt=Qe[1]+mt;T.call(Wa.setTranslate,bt,Mt),p("x",ui(i,ft,"x",l,e)),p("y",ui(n,mt,"y",l,e)),e.axref===e.xref&&p("ax",ui(i,ft,"ax",l,e)),e.ayref===e.yref&&p("ay",ui(n,mt,"ay",l,e)),tt.attr("transform",Vv(ft,mt)),_.attr({transform:"rotate("+y+","+bt+","+Mt+")"})},doneFn:function(){Uv.call("_guiRelayout",t,d());var ft=document.querySelector(".js-notes-box-panel");ft&&ft.redraw(ft.selectedObj)}})}}};if(e.showarrow&&He(0,0),g){var je;gl.init({element:T.node(),gd:t,prepFn:function(){je=_.attr("transform")},moveFn:function(Fe,qe){var Ne="pointer";if(e.showarrow)e.axref===e.xref?p("ax",ui(i,Fe,"ax",l,e)):p("ax",e.ax+Fe),e.ayref===e.yref?p("ay",ui(n,qe,"ay",l.w,e)):p("ay",e.ay+qe),He(Fe,qe);else{if(a)return;var R,U;if(i)R=ui(i,Fe,"x",l,e);else{var V=e._xsize/l.w,K=e.x+(e._xshift-e.xshift)/l.w-V/2;R=gl.align(K+Fe/l.w,V,0,1,e.xanchor)}if(n)U=ui(n,qe,"y",l,e);else{var ne=e._ysize/l.h,re=e.y-(e._yshift+e.yshift)/l.h-ne/2;U=gl.align(re-qe/l.h,ne,0,1,e.yanchor)}p("x",R),p("y",U),(!i||!n)&&(Ne=gl.getCursor(i?.5:R,n?.5:U,e.xanchor,e.yanchor))}_.attr({transform:Vv(Fe,qe)+je}),Xv(T,Ne)},clickFn:function(Fe,qe){e.captureevents&&t.emit("plotly_clickannotation",w(qe))},doneFn:function(){Xv(T),Uv.call("_guiRelayout",t,d());var Fe=document.querySelector(".js-notes-box-panel");Fe&&Fe.redraw(Fe.selectedObj)}})}}s.annotationText?H.call(Wv.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),Uv.call("_guiRelayout",t,d())}):H.call(D)}var Db=be,GF=Je,$b=Lt.arrayEditor,UF={hasClickToShow:VF,onClick:WF};function VF(t,e){var r=Fk(t,e);return r.on.length>0||r.explicitOff.length>0}function WF(t,e){var r=Fk(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=$b(t.layout,"annotations",o[a[l]]),s.modifyItem("visible",!0),Db.extendFlat(n,s.getUpdateObj());for(l=0;l<i.length;l++)s=$b(t.layout,"annotations",o[i[l]]),s.modifyItem("visible",!1),Db.extendFlat(n,s.getUpdateObj());return GF.call("update",t,{},n)}}function Fk(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)===Pb(f._xclick,v)&&p.d2r(u.y)===Pb(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 Pb(t,e){return e.type==="log"?e.l2r(t):e.d2r(t)}var Yv=be,Wn=ct,Nk=function(e,r,a,i){i("opacity");var n=i("bgcolor"),o=i("bordercolor"),l=Wn.opacity(o);i("borderpad");var s=i("borderwidth"),f=i("showarrow");i("text",f?" ":a._dfltTitle.annotation),i("textangle"),Yv.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:Wn.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||(Wn.opacity(n)?Wn.rgb(n):Wn.defaultLine)),y=i("hoverlabel.bordercolor",h.bordercolor||Wn.contrast(m)),b=Yv.extendFlat({},h.font);b.color||(b.color=y),Yv.coerceFont(i,"hoverlabel.font",b)}i("captureevents",!!d)},qv=be,Xi=Ct,XF=ja,YF=Nk,qF=xs,ZF=function(e,r){XF(e,r,{name:"annotations",handleItemDefaults:KF})};function KF(t,e,r){function a(_,g){return qv.coerce(t,e,qF,_,g)}var i=a("visible"),n=a("clicktoshow");if(i||n){YF(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=Xi.coerceRef(t,e,f,u,"","paper");if(v!=="paper"){var p=Xi.getFromId(f,v);p._annIndices.push(e._index)}if(Xi.coercePosition(e,f,a,v,u,.5),o){var d="a"+u,h=Xi.coerceRef(t,e,f,d,"pixel",["pixel","paper"]);h!=="pixel"&&h!==v&&(h=e[d]="pixel");var m=h==="pixel"?s[c]:.4;Xi.coercePosition(e,f,a,h,d,m)}a(u+"anchor"),a(u+"shift")}if(qv.noneOrAll(t,e,["x","y"]),o&&qv.noneOrAll(t,e,["ax","ay"]),n){var y=a("xclick"),b=a("yclick");e._xclick=y===void 0?e.x:Xi.cleanPosition(y,f,e.xref),e._yclick=b===void 0?e.y:Xi.cleanPosition(b,f,e.yref)}}}var xh=be,on=Ct,QF=cm.draw,JF=function(e){var r=e._fullLayout,a=xh.filterVisible(r.annotations);if(a.length&&e._fullData.length)return xh.syncOrAsync([QF,eN],e)};function eN(t){var e=t._fullLayout;xh.filterVisible(e.annotations).forEach(function(r){var a=on.getFromId(t,r.xref),i=on.getFromId(t,r.yref),n=on.getRefType(r.xref),o=on.getRefType(r.yref);r._extremes={},n==="range"&&Eb(r,a),o==="range"&&Eb(r,i)})}function Eb(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=on.findExtremes(e,[e.r2c(i)],{ppadplus:v,ppadminus:p}),_=on.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=on.findExtremes(e,[e.r2c(i)],{ppadplus:Math.max(s,v,h),ppadminus:Math.max(f,p,m)});t._extremes[r]=y}var tN=ht,rN=Uh,aN=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=rN(d,r.range):h=Math.pow(10,d),tN(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)},Zv=cm,zb=UF,iN={moduleType:"component",name:"annotations",layoutAttributes:xs,supplyLayoutDefaults:ZF,includeBasePlot:wu("annotations"),calcAutorange:JF,draw:Zv.draw,drawOne:Zv.drawOne,drawRaw:Zv.drawRaw,hasClickToShow:zb.hasClickToShow,onClick:zb.onClick,convertCoords:aN},$t=xs,nN=Na.overrideAll,oN=Lt.templatedArray,_h=nN(oN("annotation",{visible:$t.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:$t.xanchor,xshift:$t.xshift,yanchor:$t.yanchor,yshift:$t.yshift,text:$t.text,textangle:$t.textangle,font:$t.font,width:$t.width,height:$t.height,opacity:$t.opacity,align:$t.align,valign:$t.valign,bgcolor:$t.bgcolor,bordercolor:$t.bordercolor,borderpad:$t.borderpad,borderwidth:$t.borderwidth,showarrow:$t.showarrow,arrowcolor:$t.arrowcolor,arrowhead:$t.arrowhead,startarrowhead:$t.startarrowhead,arrowside:$t.arrowside,arrowsize:$t.arrowsize,startarrowsize:$t.startarrowsize,arrowwidth:$t.arrowwidth,standoff:$t.standoff,startstandoff:$t.startstandoff,hovertext:$t.hovertext,hoverlabel:$t.hoverlabel,captureevents:$t.captureevents}),"calc","from-root"),Kv=be,lN=Ct,sN=ja,fN=Nk,cN=_h,uN=function(e,r,a){sN(e,r,{name:"annotations",handleItemDefaults:vN,fullLayout:a.fullLayout})};function vN(t,e,r,a){function i(l,s){return Kv.coerce(t,e,cN,l,s)}function n(l){var s=l+"axis",f={_fullLayout:{}};return f._fullLayout[s]=r[s],lN.coercePosition(e,f,i,l,l,.5)}var o=i("visible");o&&(fN(t,e,a.fullLayout,i),n("x"),n("y"),n("z"),Kv.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),Kv.noneOrAll(t,e,["ax","ay"])))}var Rb=be,Ib=Ct,dN=function(e){for(var r=e.fullSceneLayout,a=r.annotations,i=0;i<a.length;i++)hN(a[i],e);e.fullLayout._infolayer.selectAll(".annotation-"+e.id).remove()};function hN(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={},Rb.extendFlat(t._xa,n),Ib.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={},Rb.extendFlat(t._ya,n),Ib.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 Qv(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 pN(t,e){var r=Qv(t.projection,Qv(t.view,Qv(t.model,[e[0],e[1],e[2],1])));return r}var mN=pN,yN=cm.drawRaw,gN=mN,bN=["x","y","z"],xN=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=bN[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=gN(e.glplot.cameraParams,[r.xaxis.r2l(o.x)*a[0],r.yaxis.r2l(o.y)*a[1],r.zaxis.r2l(o.z)*a[2]]),yN(e.graphDiv,o,n,e.id,o._xa,o._ya))}},_N=Je,Fb=be,wN={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:_h}}},layoutAttributes:_h,handleDefaults:uN,includeBasePlot:TN,convert:dN,draw:xN};function TN(t,e){var r=_N.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&&(Fb.pushUnique(e._basePlotModules,r),Fb.pushUnique(e._subplots.gl3d,o))}}var Nb=xs,Hb=fr,Ob=zi.line,kN=Fr.dash,va=Et.extendFlat,AN=Lt.templatedArray,jb=xu,Xn=la,MN=yr.shapeTexttemplateAttrs,SN=Zh,Hk=AN("shape",{visible:va({},Xn.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:va({},Xn.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:va({},Xn.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:va({},Xn.legendgrouptitle.text,{editType:"calc+arraydraw"}),font:Hb({editType:"calc+arraydraw",description:["Sets this legend group's title font."].join(" ")}),editType:"calc+arraydraw"},legendrank:va({},Xn.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:va({},Xn.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:va({},Nb.xref,{description:["Sets the shape's x coordinate axis.",jb.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:va({},Nb.yref,{description:["Sets the shape's y coordinate axis.",jb.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:va({},Ob.color,{editType:"arraydraw"}),width:va({},Ob.width,{editType:"calc+arraydraw"}),dash:va({},kN,{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:MN({},{keys:Object.keys(SN)}),font:Hb({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=be,Yn=Ct,LN=ja,CN=Hk,Bb=Ei,DN=function(e,r){LN(e,r,{name:"shapes",handleItemDefaults:PN})};function $N(t,e){return t?"bottom":e.indexOf("top")!==-1?"top":e.indexOf("bottom")!==-1?"bottom":"middle"}function PN(t,e,r){function a(k,C){return bl.coerce(t,e,CN,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=Yn.coerceRef(t,e,b,h,void 0,"paper"),T=Yn.getRefType(w);if(T==="range"?(_=Yn.getFromId(b,w),_._shapeIndices.push(e._index),x=Bb.rangeToShapePosition(_),g=Bb.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)):(Yn.coercePosition(e,b,a,w,S,A),Yn.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),Yn.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",$N(z,P)),a("label.padding"),bl.coerceFont(a,"label.font",r.font)}}}var EN=ct,Gb=be;function zN(t,e){return t?"bottom":e.indexOf("top")!==-1?"top":e.indexOf("bottom")!==-1?"bottom":"middle"}var RN=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"),Gb.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",EN.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",zN(o,f)),a("newshape.label.padding"),Gb.coerceFont(a,"newshape.label.font",r.font)}a("activeshape.fillcolor"),a("activeshape.opacity")},wh=be,qn=Ct,Po=vu,Ok=Ei,IN=function(e){var r=e._fullLayout,a=wh.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=Ub(o,n,Po.paramIsX),l&&(n._extremes[o._id]=qn.findExtremes(o,l,FN(n)))),n.yref!=="paper"&&f!=="domain"&&(o=qn.getFromId(e,n.yref),l=Ub(o,n,Po.paramIsY),l&&(n._extremes[o._id]=qn.findExtremes(o,l,NN(n))))}};function FN(t){return jk(t.line.width,t.xsizemode,t.x0,t.x1,t.path,!1)}function NN(t){return jk(t.line.width,t.ysizemode,t.y0,t.y1,t.path,!0)}function jk(t,e,r,a,i,n){var o=t/2,l=n;if(e==="pixel"){var s=i?Ok.extractPathCoords(i,n?Po.paramIsY:Po.paramIsX):[r,a],f=wh.aggNums(Math.max,null,s),c=wh.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 Ub(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(Po.segmentRE),d,h,m,y,b;for(t.type==="date"&&(f=Ok.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(Po.paramRE),!(!y||y.length<m)&&(b=f(y[m]),b<u&&(u=b),b>v&&(v=b)));if(v>=u)return[u,v]}}var Vb=Ip,HN={moduleType:"component",name:"shapes",layoutAttributes:Hk,supplyLayoutDefaults:DN,supplyDrawNewShapeDefaults:RN,includeBasePlot:wu("shapes"),calcAutorange:IN,draw:Vb.draw,drawOne:Vb.drawOne},Wb=gr,ON=Lt.templatedArray,Xb=xu,Bk=ON("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",Wb.idRegex.x.toString()],dflt:"paper",editType:"arraydraw",description:["Sets the images's x coordinate axis.",Xb.axisRefDescription("x","left","right")].join(" ")},yref:{valType:"enumerated",values:["paper",Wb.idRegex.y.toString()],dflt:"paper",editType:"arraydraw",description:["Sets the images's y coordinate axis.",Xb.axisRefDescription("y","bottom","top")].join(" ")},editType:"arraydraw"}),jN=be,Jv=Ct,BN=ja,GN=Bk,UN="images",VN=function(e,r){var a={name:UN,handleItemDefaults:WN};BN(e,r,a)};function WN(t,e,r){function a(v,p){return jN.coerce(t,e,GN,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=Jv.coerceRef(t,e,o,f,"paper",void 0);if(c!=="paper"){var u=Jv.getFromId(o,c);u._imgIndices.push(e._index)}Jv.coercePosition(e,o,a,c,f,0)}return e}var Yb=ut,XN=kt,Zn=Ct,qb=Xt,YN=Vo,qN=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=qb.ref2id(s.xref)+qb.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=Yb.select(this);if(this._imgSrc!==g.source)if(x.attr("xmlns",YN.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=Yb.select(this),w=Zn.getFromId(e,g.xref),T=Zn.getFromId(e,g.yref),A=Zn.getRefType(g.xref)==="domain",M=Zn.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&&Zn.getRefType(g.xref)!=="domain"?w._id:"",k=T&&Zn.getRefType(g.yref)!=="domain"?T._id:"",C=P+k;XN.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=ht,ZN=Uh,KN=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=ZN(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)}}},QN={moduleType:"component",name:"images",layoutAttributes:Bk,supplyLayoutDefaults:VN,includeBasePlot:wu("images"),draw:qN,convertCoords:KN},um={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:"▼"}},JN=fr,e4=Tr,t4=Et.extendFlat,r4=Na.overrideAll,a4=Kh,Gk=Lt.templatedArray,i4=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(" ")}}),Uk=r4(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:i4,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:t4(a4({editType:"arraydraw"}),{description:"Sets the padding around the buttons or dropdown menu."}),font:JN({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:e4.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"),qf=be,Vk=ja,Wk=Uk,n4=um,o4=n4.name,l4=Wk.buttons,s4=function(e,r){var a={name:o4,handleItemDefaults:f4};Vk(e,r,a)};function f4(t,e,r){function a(o,l){return qf.coerce(t,e,Wk,o,l)}var i=Vk(t,e,{name:"buttons",handleItemDefaults:c4}),n=a("visible",i.length>0);n&&(a("active"),a("direction"),a("type"),a("showactive"),a("x"),a("y"),qf.noneOrAll(t,e,["x","y"]),a("xanchor"),a("yanchor"),a("pad.t"),a("pad.r"),a("pad.b"),a("pad.l"),qf.coerceFont(a,"font",r.font),a("bgcolor",r.paper_bgcolor),a("bordercolor"),a("borderwidth"))}function c4(t,e){function r(i,n){return qf.coerce(t,e,l4,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 u4=Nt,ba=ut,Kb=ct,wo=kt,Mc=be;function Nt(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})}Nt.barWidth=2;Nt.barLength=20;Nt.barRadius=2;Nt.barPad=1;Nt.barColor="#808BA4";Nt.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=Nt.barLength+2*Nt.barPad,M=Nt.barWidth+2*Nt.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(Kb.fill,Nt.barColor),T?(this.hbar=E.attr({rx:Nt.barRadius,ry:Nt.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=Nt.barWidth+2*Nt.barPad,z=Nt.barLength+2*Nt.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(Kb.fill,Nt.barColor),F?(this.vbar=P.attr({rx:Nt.barRadius,ry:Nt.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,I=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(I),width:Math.ceil($)-Math.floor(C),height:Math.ceil(j)-Math.floor(I)}),this.container.call(wo.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(wo.setClipUrl,null),delete this._clipRect),T||F){var X=ba.behavior.drag().on("dragstart",function(){ba.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(X);var O=ba.behavior.drag().on("dragstart",function(){ba.event.sourceEvent.preventDefault(),ba.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)};Nt.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(wo.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)};Nt.prototype._onBoxDrag=function(){var e=this.translateX,r=this.translateY;this.hbar&&(e-=ba.event.dx),this.vbar&&(r-=ba.event.dy),this.setTranslate(e,r)};Nt.prototype._onBoxWheel=function(){var e=this.translateX,r=this.translateY;this.hbar&&(e+=ba.event.deltaY),this.vbar&&(r+=ba.event.deltaY),this.setTranslate(e,r)};Nt.prototype._onBarDrag=function(){var e=this.translateX,r=this.translateY;if(this.hbar){var a=e+this._hbarXMin,i=a+this._hbarTranslateMax,n=Mc.constrain(ba.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=Mc.constrain(ba.event.y,s,f),u=(c-s)/(f-s),v=this.position.h-this._box.h;r=u*v}this.setTranslate(e,r)};Nt.prototype.setTranslate=function(e,r){var a=this.position.w-this._box.w,i=this.position.h-this._box.h;if(e=Mc.constrain(e||0,0,a),r=Mc.constrain(r||0,0,i),this.translateX=e,this.translateY=r,this.container.call(wo.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(wo.setTranslate,e+n*this._hbarTranslateMax,r)}if(this.vbar){var o=r/i;this.vbar.call(wo.setTranslate,e,r+o*this._vbarTranslateMax)}};var Eo=ut,os=Kt,ls=ct,zo=kt,Ur=be,Sc=or,v4=Lt.arrayEditor,Xk=Sr.LINE_SPACING,nt=um,d4=u4,h4=function(e){var r=e._fullLayout,a=Ur.filterVisible(r[nt.name]);function i(v){os.autoMargin(e,Qk(v))}var n=r._menulayer.selectAll("g."+nt.containerClassName).data(a.length>0?[0]:[]);if(n.enter().append("g").classed(nt.containerClassName,!0).style("cursor","pointer"),n.exit().each(function(){Eo.select(this).selectAll("g."+nt.headerGroupClassName).each(i)}).remove(),a.length!==0){var o=n.selectAll("g."+nt.headerGroupClassName).data(a,p4);o.enter().append("g").classed(nt.headerGroupClassName,!0);for(var l=Ur.ensureSingle(n,"g",nt.dropdownButtonGroupClassName,function(v){v.style("pointer-events","all")}),s=0;s<a.length;s++){var f=a[s];_4(e,f)}var c="updatemenus"+r._uid,u=new d4(e,l,c);o.enter().size()&&(l.node().parentNode.appendChild(l.node()),l.call(kh)),o.exit().each(function(v){l.call(kh),i(v)}).remove(),o.each(function(v){var p=Eo.select(this),d=v.type==="dropdown"?l:null;os.manageCommandObserver(e,v,v.buttons,function(h){Th(e,v,v.buttons[h.index],p,d,u,h.index,!0)}),v.type==="dropdown"?(qk(e,p,l,u,v),Yk(l,v)&&ss(e,p,l,u,v)):ss(e,p,null,null,v)})}};function p4(t){return t._index}function m4(t){return+t.attr(nt.menuIndexAttrName)==-1}function Yk(t,e){return+t.attr(nt.menuIndexAttrName)===e._index}function Th(t,e,r,a,i,n,o,l){e.active=o,v4(t.layout,nt.name,e).applyUpdate("active",o),e.type==="buttons"?ss(t,a,null,null,e):e.type==="dropdown"&&(i.attr(nt.menuIndexAttrName,"-1"),qk(t,a,i,n,e),l||ss(t,a,i,n,e))}function qk(t,e,r,a,i){var n=Ur.ensureSingle(e,"g",nt.headerClassName,function(v){v.style("pointer-events","all")}),o=i._dims,l=i.active,s=i.buttons[l]||nt.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(vm,i,s,t).call(Jk,i,f,c);var u=Ur.ensureSingle(e,"text",nt.headerArrowClassName,function(v){v.attr("text-anchor","end").call(zo.font,i.font).text(nt.arrowSymbol[i.direction])});u.attr({x:o.headerWidth-nt.arrowOffsetX+i.pad.l,y:o.headerHeight/2+nt.textOffsetY+i.pad.t}),n.on("click",function(){r.call(kh,String(Yk(r,i)?-1:i._index)),ss(t,e,r,a,i)}),n.on("mouseover",function(){n.call(Zk)}),n.on("mouseout",function(){n.call(Kk,i)}),zo.setTranslate(e,o.lx,o.ly)}function ss(t,e,r,a,i){r||(r=e,r.attr("pointer-events","all"));var n=!m4(r)||i.type==="buttons"?i.buttons:[],o=i.type==="dropdown"?nt.dropdownButtonClassName:nt.buttonClassName,l=r.selectAll("g."+o).data(Ur.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+nt.gapButtonHeader:c=v.headerWidth+nt.gapButtonHeader),i.type==="dropdown"&&i.direction==="up"&&(u=-nt.gapButtonHeader+nt.gapButton-v.openHeight),i.type==="dropdown"&&i.direction==="left"&&(c=-nt.gapButtonHeader+nt.gapButton-v.openWidth);var d={x:v.lx+c+i.pad.l,y:v.ly+u+i.pad.t,yPad:nt.gapButton,xPad:nt.gapButton,index:0},h={l:d.x+i.borderwidth,t:d.y+i.borderwidth};l.each(function(m,y){var b=Eo.select(this);b.call(vm,i,m,t).call(Jk,i,d),b.on("click",function(){Eo.event.defaultPrevented||(m.execute&&(m.args2&&i.active===y?(Th(t,i,m,e,r,a,-1),os.executeAPICommand(t,m.method,m.args2)):(Th(t,i,m,e,r,a,y),os.executeAPICommand(t,m.method,m.args))),t.emit("plotly_buttonclicked",{menu:i,button:m,active:i.active}))}),b.on("mouseover",function(){b.call(Zk)}),b.on("mouseout",function(){b.call(Kk,i),l.call(Qb,i)})}),l.call(Qb,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()?y4(t,e,r,a,i,h):g4(a))}function y4(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]+nt.gapButton;else for(c=0,v=0;v<f;v++)c+=s.widths[v]+nt.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 g4(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 vm(t,e,r,a){t.call(b4,e).call(x4,e,r,a)}function b4(t,e){var r=Ur.ensureSingle(t,"rect",nt.itemRectClassName,function(a){a.attr({rx:nt.rx,ry:nt.ry,"shape-rendering":"crispEdges"})});r.call(ls.stroke,e.bordercolor).call(ls.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px")}function x4(t,e,r,a){var i=Ur.ensureSingle(t,"text",nt.itemTextClassName,function(l){l.attr({"text-anchor":"start","data-notex":1})}),n=r.label,o=a._fullLayout._meta;o&&(n=Ur.templateString(n,o)),i.call(zo.font,e.font).text(n).call(Sc.convertToTspans,a)}function Qb(t,e){var r=e.active;t.each(function(a,i){var n=Eo.select(this);i===r&&e.showactive&&n.select("rect."+nt.itemRectClassName).call(ls.fill,nt.activeColor)})}function Zk(t){t.select("rect."+nt.itemRectClassName).call(ls.fill,nt.hoverColor)}function Kk(t,e){t.select("rect."+nt.itemRectClassName).call(ls.fill,e.bgcolor)}function _4(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=zo.tester.selectAll("g."+nt.dropdownButtonClassName).data(Ur.filterVisible(e.buttons));a.enter().append("g").classed(nt.dropdownButtonClassName,!0);var i=["up","down"].indexOf(e.direction)!==-1;a.each(function(c,u){var v=Eo.select(this);v.call(vm,e,c,t);var p=v.select("."+nt.itemTextClassName),d=p.node()&&zo.bBox(p.node()).width,h=Math.max(d+nt.textPadX,nt.minWidth),m=e.font.size*Xk,y=Sc.lineCount(p),b=Math.max(m*y,nt.minHeight)+nt.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+nt.gapButton,r.openHeight+=b+nt.gapButton):(r.totalWidth+=h+nt.gapButton,r.openWidth+=h+nt.gapButton,r.totalHeight=Math.max(r.totalHeight,b),r.openHeight=r.totalHeight)}),i?r.totalHeight-=nt.gapButton:r.totalWidth-=nt.gapButton,r.headerWidth=r.width1+nt.arrowPadX,r.headerHeight=r.height1,e.type==="dropdown"&&(i?(r.width1+=nt.arrowPadX,r.totalHeight=r.height1):r.totalWidth=r.width1,r.totalWidth+=nt.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";Ur.isRightAnchor(e)&&(r.lx-=n,s="right"),Ur.isCenterAnchor(e)&&(r.lx-=n/2,s="center");var f="top";Ur.isBottomAnchor(e)&&(r.ly-=o,f="bottom"),Ur.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),os.autoMargin(t,Qk(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 Qk(t){return nt.autoMarginIdRoot+t._index}function Jk(t,e,r,a){a=a||{};var i=t.select("."+nt.itemRectClassName),n=t.select("."+nt.itemTextClassName),o=e.borderwidth,l=r.index,s=e._dims;zo.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*Xk,v=Sc.lineCount(n),p=(v-1)*u/2;Sc.positionText(n,nt.textOffsetX,c/2-p+nt.textOffsetY),f?r.y+=s.heights[l]+r.yPad:r.x+=s.widths[l]+r.xPad,r.index++}function kh(t,e){t.attr(nt.menuIndexAttrName,e||"-1").selectAll("g."+nt.dropdownButtonClassName).remove()}var w4=um,T4={moduleType:"component",name:w4.name,layoutAttributes:Uk,supplyLayoutDefaults:s4,draw:h4},Lu={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},Jb=fr,k4=Kh,A4=Et.extendDeepAll,M4=Na.overrideAll,S4=Xc,eA=Lt.templatedArray,Yi=Lu,L4=eA("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(" ")}}),tA=M4(eA("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:L4,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:A4(k4({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:S4.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:Jb({description:"Sets the font of the current value label text."})},font:Jb({description:"Sets the font of the slider step labels."}),activebgcolor:{valType:"color",dflt:Yi.gripBgActiveColor,description:["Sets the background color of the slider grip","while dragging."].join(" ")},bgcolor:{valType:"color",dflt:Yi.railBgColor,description:"Sets the background color of the slider."},bordercolor:{valType:"color",dflt:Yi.railBorderColor,description:"Sets the color of the border enclosing the slider."},borderwidth:{valType:"number",min:0,dflt:Yi.railBorderWidth,description:"Sets the width (in px) of the border enclosing the slider."},ticklen:{valType:"number",min:0,dflt:Yi.tickLength,description:"Sets the length in pixels of step tick marks"},tickcolor:{valType:"color",dflt:Yi.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:Yi.minorTickLength,description:"Sets the length in pixels of minor step tick marks"}}),"arraydraw","from-root"),oo=be,rA=ja,aA=tA,C4=Lu,D4=C4.name,$4=aA.steps,P4=function(e,r){rA(e,r,{name:D4,handleItemDefaults:E4})};function E4(t,e,r){function a(u,v){return oo.coerce(t,e,aA,u,v)}for(var i=rA(t,e,{name:"steps",handleItemDefaults:z4}),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=oo.filterVisible(i),f=a("active");(i[f]||{}).visible||(e.active=s[0]._index),a("x"),a("y"),oo.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"),oo.coerceFont(a,"font",r.font);var c=a("currentvalue.visible");c&&(a("currentvalue.xanchor"),a("currentvalue.prefix"),a("currentvalue.suffix"),a("currentvalue.offset"),oo.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 z4(t,e){function r(n,o){return oo.coerce(t,e,$4,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 xa=ut,Lc=Kt,Mi=ct,_a=kt,Vr=be,R4=Vr.strTranslate,Fl=or,I4=Lt.arrayEditor,dt=Lu,dm=Sr,iA=dm.LINE_SPACING,ed=dm.FROM_TL,td=dm.FROM_BR,F4=function(e){var r=e._context.staticPlot,a=e._fullLayout,i=N4(a,e),n=a._infolayer.selectAll("g."+dt.containerClassName).data(i.length>0?[0]:[]);n.enter().append("g").classed(dt.containerClassName,!0).style("cursor",r?null:"ew-resize");function o(c){c._commandObserver&&(c._commandObserver.remove(),delete c._commandObserver),Lc.autoMargin(e,nA(c))}if(n.exit().each(function(){xa.select(this).selectAll("g."+dt.groupClassName).each(o)}).remove(),i.length!==0){var l=n.selectAll("g."+dt.groupClassName).data(i,H4);l.enter().append("g").classed(dt.groupClassName,!0),l.exit().each(o).remove();for(var s=0;s<i.length;s++){var f=i[s];O4(e,f)}l.each(function(c){var u=xa.select(this);V4(c),Lc.manageCommandObserver(e,c,c._visibleSteps,function(v){var p=u.data()[0];p.active!==v.index&&(p._dragging||lA(e,u,p,v.index,!1,!0))}),j4(e,xa.select(this),c)})}};function nA(t){return dt.autoMarginIdRoot+t._index}function N4(t,e){for(var r=t[dt.name],a=[],i=0;i<r.length;i++){var n=r[i];n.visible&&(n._gd=e,a.push(n))}return a}function H4(t){return t._index}function O4(t,e){var r=_a.tester.selectAll("g."+dt.labelGroupClass).data(e._visibleSteps);r.enter().append("g").classed(dt.labelGroupClass,!0);var a=0,i=0;r.each(function(d){var h=xa.select(this),m=oA(h,{step:d},e),y=m.node();if(y){var b=_a.bBox(y);i=Math.max(i,b.height),a=Math.max(a,b.width)}}),r.remove();var n=e._dims={};n.inputAreaWidth=Math.max(dt.railWidth,dt.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*dt.stepInset,s=l/(e._stepCount-1),f=a+dt.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=_a.tester.append("g");r.each(function(d){var h=Cc(c,e,d.label),m=h.node()&&_a.bBox(h.node())||{width:0,height:0},y=Fl.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+dt.tickOffset+e.ticklen+dt.labelOffset+n.labelHeight+e.pad.t+e.pad.b;var u="left";Vr.isRightAnchor(e)&&(n.lx-=n.outerLength,u="right"),Vr.isCenterAnchor(e)&&(n.lx-=n.outerLength/2,u="center");var v="top";Vr.isBottomAnchor(e)&&(n.ly-=n.height,v="bottom"),Vr.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*td[v],t:n.height*ed[v]};e.lenmode==="fraction"?(p.l=0,p.xl=e.x-e.len*ed[u],p.r=0,p.xr=e.x+e.len*td[u]):(p.x=e.x,p.l=n.outerLength*ed[u],p.r=n.outerLength*td[u]),Lc.autoMargin(t,nA(e),p)}function j4(t,e,r){(r.steps[r.active]||{}).visible||(r.active=r._visibleSteps[0]._index),e.call(Cc,r).call(X4,r).call(G4,r).call(U4,r).call(W4,t,r).call(B4,t,r);var a=r._dims;_a.setTranslate(e,a.lx+r.pad.l,a.ly+r.pad.t),e.call(fA,r,!1),e.call(Cc,r)}function Cc(t,e,r){if(e.currentvalue.visible){var a=e._dims,i,n;switch(e.currentvalue.xanchor){case"right":i=a.inputAreaLength-dt.currentValueInset-a.currentValueMaxWidth,n="left";break;case"center":i=a.inputAreaLength*.5,n="middle";break;default:i=dt.currentValueInset,n="left"}var o=Vr.ensureSingle(t,"text",dt.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=Vr.templateString(s,f)),l+=s}e.currentvalue.suffix&&(l+=e.currentvalue.suffix),o.call(_a.font,e.currentvalue.font).text(l).call(Fl.convertToTspans,e._gd);var c=Fl.lineCount(o),u=(a.currentValueMaxLines+1-c)*e.currentvalue.font.size*iA;return Fl.positionText(o,i,u),o}}function B4(t,e,r){var a=Vr.ensureSingle(t,"rect",dt.gripRectClass,function(i){i.call(sA,e,t,r).style("pointer-events","all")});a.attr({width:dt.gripWidth,height:dt.gripHeight,rx:dt.gripRadius,ry:dt.gripRadius}).call(Mi.stroke,r.bordercolor).call(Mi.fill,r.bgcolor).style("stroke-width",r.borderwidth+"px")}function oA(t,e,r){var a=Vr.ensureSingle(t,"text",dt.labelClass,function(o){o.attr({"text-anchor":"middle","data-notex":1})}),i=e.step.label,n=r._gd._fullLayout._meta;return n&&(i=Vr.templateString(i,n)),a.call(_a.font,r.font).text(i).call(Fl.convertToTspans,r._gd),a}function G4(t,e){var r=Vr.ensureSingle(t,"g",dt.labelsClass),a=e._dims,i=r.selectAll("g."+dt.labelGroupClass).data(a.labelSteps);i.enter().append("g").classed(dt.labelGroupClass,!0),i.exit().remove(),i.each(function(n){var o=xa.select(this);o.call(oA,n,e),_a.setTranslate(o,hm(e,n.fraction),dt.tickOffset+e.ticklen+e.font.size*iA+dt.labelOffset+a.currentValueTotalHeight)})}function ex(t,e,r,a,i){var n=Math.round(a*(r._stepCount-1)),o=r._visibleSteps[n]._index;o!==r.active&&lA(t,e,r,o,!0,i)}function lA(t,e,r,a,i,n){var o=r.active;r.active=a,I4(t.layout,dt.name,r).applyUpdate("active",a);var l=r.steps[r.active];e.call(fA,r,n),e.call(Cc,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&&Lc.executeAPICommand(t,s.method,s.args),e._nextMethod=null,e._nextMethodRaf=null)})))}function sA(t,e,r){if(e._context.staticPlot)return;var a=r.node(),i=xa.select(e);function n(){return r.data()[0]}function o(){var l=n();e.emit("plotly_sliderstart",{slider:l});var s=r.select("."+dt.gripRectClass);xa.event.stopPropagation(),xa.event.preventDefault(),s.call(Mi.fill,l.activebgcolor);var f=tx(l,xa.mouse(a)[0]);ex(e,r,l,f,!0),l._dragging=!0;function c(){var v=n(),p=tx(v,xa.mouse(a)[0]);ex(e,r,v,p,!1)}i.on("mousemove",c),i.on("touchmove",c);function u(){var v=n();v._dragging=!1,s.call(Mi.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 U4(t,e){var r=t.selectAll("rect."+dt.tickRectClass).data(e._visibleSteps),a=e._dims;r.enter().append("rect").classed(dt.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=xa.select(this);l.attr({height:o?e.ticklen:e.minorticklen}).call(Mi.fill,e.tickcolor),_a.setTranslate(l,hm(e,n/(e._stepCount-1))-.5*e.tickwidth,(o?dt.tickOffset:dt.minorTickOffset)+a.currentValueTotalHeight)})}function V4(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 fA(t,e,r){for(var a=t.select("rect."+dt.gripRectClass),i=0,n=0;n<e._stepCount;n++)if(e._visibleSteps[n]._index===e.active){i=n;break}var o=hm(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",R4(o-dt.gripWidth*.5,e._dims.currentValueTotalHeight))}}function hm(t,e){var r=t._dims;return r.inputAreaStart+dt.stepInset+(r.inputAreaLength-2*dt.stepInset)*Math.min(1,Math.max(0,e))}function tx(t,e){var r=t._dims;return Math.min(1,Math.max(0,(e-dt.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*dt.stepInset-2*r.inputAreaStart)))}function W4(t,e,r){var a=r._dims,i=Vr.ensureSingle(t,"rect",dt.railTouchRectClass,function(n){n.call(sA,e,t,r).style("pointer-events","all")});i.attr({width:a.inputAreaLength,height:Math.max(a.inputAreaWidth,dt.tickOffset+r.ticklen+a.labelHeight)}).call(Mi.fill,r.bgcolor).attr("opacity",0),_a.setTranslate(i,0,a.currentValueTotalHeight)}function X4(t,e){var r=e._dims,a=r.inputAreaLength-dt.railInset*2,i=Vr.ensureSingle(t,"rect",dt.railRectClass);i.attr({width:a,height:dt.railWidth,rx:dt.railRadius,ry:dt.railRadius,"shape-rendering":"crispEdges"}).call(Mi.stroke,e.bordercolor).call(Mi.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),_a.setTranslate(i,dt.railInset,(r.inputAreaWidth-dt.railWidth)*.5+r.currentValueTotalHeight)}var Y4=Lu,q4={moduleType:"component",name:Y4.name,layoutAttributes:tA,supplyLayoutDefaults:P4,draw:F4},rx=Tr,pm={bgcolor:{valType:"color",dflt:rx.background,editType:"plot",description:"Sets the background color of the range slider."},bordercolor:{valType:"color",dflt:rx.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"},cA={_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"},Cu={},mm={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},Z4=Xt,K4=or,uA=mm,Q4=Sr.LINE_SPACING,Dc=uA.name;function vA(t){var e=t&&t[Dc];return e&&e.visible}Cu.isVisible=vA;Cu.makeData=function(t){for(var e=Z4.list({_fullLayout:t},"x",!0),r=t.margin,a=[],i=0;i<e.length;i++){var n=e[i];if(vA(n)){a.push(n);var o=n[Dc];o._id=Dc+n._id,o._height=(t.height-r.b-r.t)*o.thickness,o._offsetShift=Math.floor(o.borderwidth/2)}}t._rangeSliderData=a};Cu.autoMarginOpts=function(t,e){var r=t._fullLayout,a=e[Dc],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(K4.BR_TAG_ALL)||[]).length;o+=l*e.title.font.size*Q4}return{x:0,y:e._counterDomainMin,l:0,r:0,t:0,b:a._height+n+Math.max(r.margin.b,o),pad:uA.extraPad+a._offsetShift*2}};var rd,ax;function J4(){if(ax)return rd;ax=1;var t=be,e=Lt,r=Xt,a=pm,i=cA;return rd=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}},rd}var ad,ix;function e6(){if(ix)return ad;ix=1;var t=Xt.list,e=gs.getAutoRange,r=mm;return ad=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))}},ad}var id,nx;function t6(){if(nx)return id;nx=1;var t=ut,e=Je,r=Kt,a=be,i=a.strTranslate,n=kt,o=ct,l=au,s=Qt,f=Xt,c=Ba,u=$i,v=mm;id=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),I;$[0]<$[1]?I=[Math.min(C[0],$[0]),Math.max(C[1],$[1])]:I=[Math.max(C[0],$[0]),Math.min(C[1],$[1])],D.range=D._input.range=a.simpleMap(I,z.l2r)}z.cleanRange("rangeslider.range");var j=M._size,G=z.domain;D._width=j.w*(G[1]-G[0]);var X=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(X,O)),D._rl=a.simpleMap(D.range,z.r2l);var q=D._rl[0],W=D._rl[1],Y=W-q;if(D.p2d=function(Se){return Se/D._width*Y+q},D.d2p=function(Se){return(Se-q)/Y*D._width},z.rangebreaks){var B=z.locateBreaks(q,W);if(B.length){var Q,ee,fe=0;for(Q=0;Q<B.length;Q++)ee=B[Q],fe+=ee.max-ee.min;var oe=D._width/(W-q-fe),se=[-oe*q];for(Q=0;Q<B.length;Q++)ee=B[Q],se.push(se[se.length-1]-oe*(ee.max-ee.min));for(D.d2p=function(Se){for(var pe=se[0],ve=0;ve<B.length;ve++){var Me=B[ve];if(Se>=Me.max)pe=se[ve+1];else if(Se<Me.min)break}return pe+oe*Se},Q=0;Q<B.length;Q++)ee=B[Q],ee.pmin=D.d2p(ee.min),ee.pmax=D.d2p(ee.max);D.p2d=function(Se){for(var pe=se[0],ve=0;ve<B.length;ve++){var Me=B[ve];if(Se>=Me.pmax)pe=se[ve+1];else if(Se<Me.pmin)break}return(Se-pe)/oe}}}if(k.rangemode!=="match"){var de=P.r2l(k.range[0]),ye=P.r2l(k.range[1]),_e=ye-de;D.d2pOppAxis=function(Se){return(Se-de)/_e*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]),I=c.coverSlip();this.addEventListener("touchmove",j),this.addEventListener("touchend",G),I.addEventListener("mousemove",j),I.addEventListener("mouseup",G);function j(X){var O=p(X),q=+O-P,W,Y,B;switch(D){case E:if(B="ew-resize",C+q>S._length||$+q<0)return;W=C+q,Y=$+q;break;case F:if(B="col-resize",C+q>S._length)return;W=C+q,Y=$;break;case N:if(B="col-resize",$+q<0)return;W=C,Y=$+q;break;default:B="ew-resize",W=k,Y=k+q;break}if(Y<W){var Q=Y;Y=W,W=Q}L._pixelMin=W,L._pixelMax=Y,u(t.select(I),B),h(A,M,S,L)}function G(){I.removeEventListener("mousemove",j),I.removeEventListener("mouseup",G),this.removeEventListener("touchmove",j),this.removeEventListener("touchend",G),a.removeElement(I)}}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(X){return a.constrain(X,0,L._width)}function H(X){return a.constrain(X,0,L._height)}function D(X){return a.constrain(X,-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 I=.5,j=Math.round(D(P-N))-I,G=Math.round(D(k-N))+I;A.select("g."+v.grabberMinClassName).attr("transform",i(j,I)),A.select("g."+v.grabberMaxClassName).attr("transform",i(G,I))}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],I={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&&(I.layout.xaxis.rangebreaks=S.rangebreaks),I.layout[C]={type:k.type,domain:[0,1],range:$.rangemode!=="match"?$.range.slice():k.range.slice(),calendar:k.calendar},k.rangebreaks&&(I.layout[C].rangebreaks=k.rangebreaks),r.supplyDefaults(I);var j=I._fullLayout.xaxis,G=I._fullLayout[C];j.clearCalc(),j.setScale(),G.clearCalc(),G.setScale();var X={id:z,plotgroup:D,xaxis:j,yaxis:G,isRangePlot:!0};P?N=X:(X.mainplot="xy",X.mainplotinfo=N),s.rangePlot(M,X,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 id}var r6=be,a6=pm,i6=cA,nd=Cu,n6={moduleType:"component",name:"rangeslider",schema:{subplots:{xaxis:{rangeslider:r6.extendFlat({},a6,{yaxis:i6})}}},layoutAttributes:pm,handleDefaults:J4(),calcAutorange:e6(),draw:t6(),isVisible:nd.isVisible,makeData:nd.makeData,autoMarginOpts:nd.autoMarginOpts},o6=fr,ox=Tr,l6=Lt.templatedArray,s6=l6("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(" ")}),Ah={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:s6,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:o6({editType:"plot",description:"Sets the font of the range selector button text."}),bgcolor:{valType:"color",dflt:ox.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:ox.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"},dA={yPad:.02,minButtonWidth:30,rx:3,ry:3,lightAmount:25,darkAmount:10},Zf=be,f6=ct,c6=Lt,u6=ja,hA=Ah,Mh=dA,v6=function(e,r,a,i,n){var o=e.rangeselector||{},l=c6.newContainer(r,"rangeselector");function s(p,d){return Zf.coerce(o,l,hA,p,d)}var f=u6(o,l,{name:"buttons",handleItemDefaults:d6,calendar:n}),c=s("visible",f.length>0);if(c){var u=h6(r,a,i);s("x",u[0]),s("y",u[1]),Zf.noneOrAll(e,r,["x","y"]),s("xanchor"),s("yanchor"),Zf.coerceFont(s,"font",a.font);var v=s("bgcolor");s("activecolor",f6.contrast(v,Mh.lightAmount,Mh.darkAmount)),s("bordercolor"),s("borderwidth")}};function d6(t,e,r,a){var i=a.calendar;function n(s,f){return Zf.coerce(t,e,hA.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 h6(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+Mh.yPad]}var p6=iS,m6=be.titleCase,y6=function(e,r){var a=e._name,i={};if(r.step==="all")i[a+".autorange"]=!0;else{var n=g6(e,r);i[a+".range[0]"]=n[0],i[a+".range[1]"]=n[1]}return i};function g6(t,e){var r=t.range,a=new Date(t.r2l(r[1])),i=e.step,n=p6["utc"+m6(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 $c=ut,b6=Je,x6=Kt,lx=ct,pA=kt,Qa=be,sx=Qa.strTranslate,Kf=or,_6=Xt,ym=Sr,fx=ym.LINE_SPACING,cx=ym.FROM_TL,ux=ym.FROM_BR,Sh=dA,w6=y6,T6=function(e){var r=e._fullLayout,a=r._infolayer.selectAll(".rangeselector").data(k6(e),A6);a.enter().append("g").classed("rangeselector",!0),a.exit().remove(),a.style({cursor:"pointer","pointer-events":"all"}),a.each(function(i){var n=$c.select(this),o=i,l=o.rangeselector,s=n.selectAll("g.button").data(Qa.filterVisible(l.buttons));s.enter().append("g").classed("button",!0),s.exit().remove(),s.each(function(f){var c=$c.select(this),u=w6(o,f);f._isActive=M6(o,f,u),c.call(od,l,f),c.call(L6,l,f,e),c.on("click",function(){e._dragged||b6.call("_guiRelayout",e,u)}),c.on("mouseover",function(){f._isHovered=!0,c.call(od,l,f)}),c.on("mouseout",function(){f._isHovered=!1,c.call(od,l,f)})}),D6(e,s,l,o._name,n)})};function k6(t){for(var e=_6.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 A6(t){return t._id}function M6(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 od(t,e,r){var a=Qa.ensureSingle(t,"rect","selector-rect",function(i){i.attr("shape-rendering","crispEdges")});a.attr({rx:Sh.rx,ry:Sh.ry}),a.call(lx.stroke,e.bordercolor).call(lx.fill,S6(e,r)).style("stroke-width",e.borderwidth+"px")}function S6(t,e){return e._isActive||e._isHovered?t.activecolor:t.bgcolor}function L6(t,e,r,a){function i(o){Kf.convertToTspans(o,a)}var n=Qa.ensureSingle(t,"text","selector-text",function(o){o.attr("text-anchor","middle")});n.call(pA.font,e.font).text(C6(r,a._fullLayout._meta)).call(i)}function C6(t,e){return t.label?e?Qa.templateString(t.label,e):t.label:t.step==="all"?"all":t.count+t.step.charAt(0)}function D6(t,e,r,a,i){var n=0,o=0,l=r.borderwidth;e.each(function(){var p=$c.select(this),d=p.select(".selector-text"),h=r.font.size*fx,m=Math.max(h*Kf.lineCount(d),16)+3;o=Math.max(o,m)}),e.each(function(){var p=$c.select(this),d=p.select(".selector-rect"),h=p.select(".selector-text"),m=h.node()&&pA.bBox(h.node()).width,y=r.font.size*fx,b=Kf.lineCount(h),_=Math.max(m+10,Sh.minButtonWidth);p.attr("transform",sx(l+n,l)),d.attr({x:0,y:0,width:_,height:o}),Kf.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";Qa.isRightAnchor(r)&&(f-=n,u="right"),Qa.isCenterAnchor(r)&&(f-=n/2,u="center");var v="top";Qa.isBottomAnchor(r)&&(c-=o,v="bottom"),Qa.isMiddleAnchor(r)&&(c-=o/2,v="middle"),n=Math.ceil(n),o=Math.ceil(o),f=Math.round(f),c=Math.round(c),x6.autoMargin(t,a+"-range-selector",{x:r.x,y:r.y,l:n*cx[u],r:n*ux[u],b:o*ux[v],t:o*cx[v]}),i.attr("transform",sx(f,c))}var $6={moduleType:"component",name:"rangeselector",schema:{subplots:{xaxis:{rangeselector:Ah}}},layoutAttributes:Ah,handleDefaults:v6,draw:T6},Ri={},vx=Et.extendFlat;Ri.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:vx({},r,{description:["Sets the horizontal domain of this ",a,i,"(in plot fraction).",n].join("")}),y:vx({},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};Ri.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 P6=be,E6=Ho.counter,z6=Ri.attributes,dx=gr.idRegex,R6=Lt,Lh={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:[E6("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:[dx.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:[dx.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:z6({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 Pc(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 I6(t,e){var r=t.grid||{},a=Pc(e,r,"x"),i=Pc(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=R6.newContainer(e,"grid");function v(w,T){return P6.coerce(r,u,Lh,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:hx("x",v,b,g,d),y:hx("y",v,_,x,p,y)}}function hx(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 F6(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=Pc(e,a,"x"),w=Pc(e,a,"y");r.xaxes=px(x,i.xaxis,l,m,"x"),r.yaxes=px(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 px(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 N6={moduleType:"component",name:"grid",schema:{layout:{grid:Lh}},layoutAttributes:Lh,sizeDefaults:I6,contentDefaults:F6},mA={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"},ld,mx;function H6(){if(mx)return ld;mx=1;var t=ht,e=Je,r=be,a=Lt,i=mA;return ld=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))}},ld}var sd,yx;function yA(){if(yx)return sd;yx=1,sd=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 sd}var fd,gx;function O6(){if(gx)return fd;gx=1;var t=ht,e=Je,r=Ct,a=be,i=yA();fd=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 fd}var cd,bx;function j6(){if(bx)return cd;bx=1;var t=ut,e=ht,r=kt,a=kr;cd=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 cd}var ud,xx;function B6(){if(xx)return ud;xx=1;var t=ut,e=ct;return ud=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)})},ud}var Nl=be,_x=Na.overrideAll,Hl=mA,ln={error_x:Nl.extendFlat({},Hl),error_y:Nl.extendFlat({},Hl)};delete ln.error_x.copy_zstyle;delete ln.error_y.copy_zstyle;delete ln.error_y.copy_ystyle;var ks={error_x:Nl.extendFlat({},Hl),error_y:Nl.extendFlat({},Hl),error_z:Nl.extendFlat({},Hl)};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 G6={moduleType:"component",name:"errorbars",schema:{traces:{scatter:ln,bar:ln,histogram:ln,scatter3d:_x(ks,"calc","nested"),scattergl:_x(ln,"calc","nested")}},supplyDefaults:H6(),calc:O6(),makeComputeError:yA(),plot:j6(),style:B6(),hoverInfo:U6};function U6(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 V6={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"}},pi=ut,vd=oa,Qf=Kt,wx=Je,Xa=Ct,bf=Ba,aa=be,pa=aa.strTranslate,gA=Et.extendFlat,dd=$i,da=kt,hd=ct,W6=au,X6=or,Y6=Ma.flipScale,q6=Ck,Z6=Dk,K6=Oa,gm=Sr,Tx=gm.LINE_SPACING,kx=gm.FROM_TL,Ax=gm.FROM_BR,It=V6.cn;function Q6(t){var e=t._fullLayout,r=e._infolayer.selectAll("g."+It.colorbar).data(J6(t),function(a){return a._id});r.enter().append("g").attr("class",function(a){return a._id}).classed(It.colorbar,!0),r.each(function(a){var i=pi.select(this);aa.ensureSingle(i,"rect",It.cbbg),aa.ensureSingle(i,"g",It.cbfills),aa.ensureSingle(i,"g",It.cblines),aa.ensureSingle(i,"g",It.cbaxis,function(o){o.classed(It.crisp,!0)}),aa.ensureSingle(i,"g",It.cbtitleunshift,function(o){o.append("g").classed(It.cbtitle,!0)}),aa.ensureSingle(i,"rect",It.cboutline);var n=e8(i,a,t);n&&n.then&&(t._promises||[]).push(n),t._context.edits.colorbarPosition&&t8(i,a,t)}),r.exit().each(function(a){Qf.autoMargin(t,a._id)}).remove(),r.order()}function J6(t){var e=t._fullLayout,r=t.calcdata,a=[],i,n,o,l;function s(_){return gA(_,{_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?Y6(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 e8(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||pi.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=r8(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,I=Math.round(a?h*C+p:m*$+d),j={center:.5,right:1}[u]||0,G={top:1,middle:.5}[v]||0,X=a?h-j*D:m-G*D,O=a?m-G*k:h-j*k,q=Math.round(a?$*(1-O):C*O);e._lenFrac=k,e._thickFrac=D,e._uFrac=X,e._vFrac=O;var W=e._axis=a8(r,e,M);W.position=D+(a?h+p/g.w:m+d/g.h);var Y=["top","bottom"].indexOf(A)!==-1;if(a&&Y&&(W.title.side=A,W.titlex=h+p/g.w,W.titley=O+(T.side==="top"?k-d/g.h:d/g.h)),!a&&!Y&&(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,Q=aa.constrain(P/50,4,15)+1,ee=(M[1]-M[0])/((e.nticks||Q)*B);if(ee>1){var fe=Math.pow(10,Math.floor(Math.log(ee)/Math.LN10));B*=fe*aa.roundUp(ee/fe,[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",pa(Math.round(g.l),Math.round(g.t)));var oe=t.select("."+It.cbtitleunshift).attr("transform",pa(-Math.round(g.l),-Math.round(g.t))),se=W.ticklabelposition,de=W.title.font.size,ye=t.select("."+It.cbaxis),_e,Se=0,pe=0;function ve(Ce,J){var xe={propContainer:W,propName:e._propPrefix+"title",traceIndex:e._traceIndex,_meta:e._meta,placeholder:_._dfltTitle.colorbar,containerGroup:t.select("."+It.cbtitle)},Z=Ce.charAt(0)==="h"?Ce.substr(1):"h"+Ce;t.selectAll("."+Z+",."+Z+"-math-group").remove(),W6.draw(r,Ce,gA(xe,J||{}))}function Me(){if(a&&Y||!a&&!Y){var Ce,J;A==="top"&&(Ce=p+g.l+C*h,J=d+g.t+$*(1-O-k)+3+de*.75),A==="bottom"&&(Ce=p+g.l+C*h,J=d+g.t+$*(1-O)-3-de*.25),A==="right"&&(J=d+g.t+$*m+3+de*.75,Ce=p+g.l+C*O),ve(W._id+"title",{attributes:{x:Ce,y:J,"text-anchor":a?"start":"middle"}})}}function Pe(){if(a&&!Y||!a&&Y){var Ce=W.position||0,J=W._offset+W._length/2,xe,Z;if(A==="right")Z=J,xe=g.l+C*Ce+10+de*(W.showticklabels?1:.5);else if(xe=J,A==="bottom"&&(Z=g.t+$*Ce+10+(se.indexOf("inside")===-1?W.tickfont.size:0)+(W.ticks!=="intside"&&e.ticklen||0)),A==="top"){var ke=T.text.split("<br>").length;Z=g.t+$*Ce+10-H-Tx*de*ke}ve((a?"h":"v")+W._id+"title",{avoid:{selection:pi.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:xe,y:Z,"text-anchor":"middle"},transform:{rotate:a?-90:0,offset:0}})}}function ce(){if(!a&&!Y||a&&Y){var Ce=t.select("."+It.cbtitle),J=Ce.select("text"),xe=[-s/2,s/2],Z=Ce.select(".h"+W._id+"title-math-group").node(),ke=15.6;J.node()&&(ke=parseInt(J.node().style.fontSize,10)*Tx);var Te;if(Z?(Te=da.bBox(Z),pe=Te.width,Se=Te.height,Se>ke&&(xe[1]-=(Se-ke)/2)):J.node()&&!J.classed(It.jsPlaceholder)&&(Te=da.bBox(J.node()),pe=Te.width,Se=Te.height),a){if(Se){if(Se+=5,A==="top")W.domain[1]-=Se/g.h,xe[1]*=-1;else{W.domain[0]+=Se/g.h;var le=X6.lineCount(J);xe[1]+=(1-le)*ke}Ce.attr("transform",pa(xe[0],xe[1])),W.setScale()}}else pe&&(A==="right"&&(W.domain[0]+=(pe+de/2)/g.w),Ce.attr("transform",pa(xe[0],xe[1])),W.setScale())}t.selectAll("."+It.cbfills+",."+It.cblines).attr("transform",a?pa(0,Math.round(g.h*(1-W.domain[1]))):pa(Math.round(g.w*W.domain[0]),0)),ye.attr("transform",a?pa(0,Math.round(-g.t)):pa(Math.round(-g.l),0));var ie=t.select("."+It.cbfills).selectAll("rect."+It.cbfill).attr("style","").data(N);ie.enter().append("rect").classed(It.cbfill,!0).attr("style",""),ie.exit().remove();var me=M.map(W.c2p).map(Math.round).sort(function(Ie,Ge){return Ie-Ge});ie.each(function(Ie,Ge){var ue=[Ge===0?M[0]:(N[Ge]+N[Ge-1])/2,Ge===N.length-1?M[1]:(N[Ge]+N[Ge+1])/2].map(W.c2p).map(Math.round);a&&(ue[1]=aa.constrain(ue[1]+(ue[1]>ue[0])?1:-1,me[0],me[1]));var He=pi.select(this).attr(a?"x":"y",I).attr(a?"y":"x",pi.min(ue)).attr(a?"width":"height",Math.max(H,2)).attr(a?"height":"width",Math.max(pi.max(ue)-pi.min(ue),2));if(e._fillgradient)da.gradient(He,r,e._id,a?"vertical":"horizontalreversed",e._fillgradient,"fill");else{var je=L(Ie).replace("e-","");He.attr("fill",vd(je).toHexString())}});var he=t.select("."+It.cblines).selectAll("path."+It.cbline).data(w.color&&w.width?z:[]);he.enter().append("path").classed(It.cbline,!0),he.exit().remove(),he.each(function(Ie){var Ge=I,ue=Math.round(W.c2p(Ie))+w.width/2%1;pi.select(this).attr("d","M"+(a?Ge+","+ue:ue+","+Ge)+(a?"h":"v")+H).call(da.lineGroupStyle,w.width,S(Ie),w.dash)}),ye.selectAll("g."+W._id+"tick,path").remove();var Ae=I+H+(s||0)/2-(e.ticks==="outside"?1:0),we=Xa.calcTicks(W),De=Xa.getTickSigns(W)[2];return Xa.drawTicks(r,W,{vals:W.ticks==="inside"?Xa.clipEnds(W,we):we,layer:ye,path:Xa.makeTickPath(W,Ae,De),transFn:Xa.makeTransTickFn(W)}),Xa.drawLabels(r,W,{vals:we,layer:ye,transFn:Xa.makeTransTickLabelFn(W),labelFns:Xa.makeLabelFns(W,Ae)})}function Le(){var Ce,J=H+s/2;se.indexOf("inside")===-1&&(Ce=da.bBox(ye.node()),J+=a?Ce.width:Ce.height),_e=oe.select("text");var xe=0,Z=a&&A==="top",ke=!a&&A==="right",Te=0;if(_e.node()&&!_e.classed(It.jsPlaceholder)){var le,ie=oe.select(".h"+W._id+"title-math-group").node();ie&&(a&&Y||!a&&!Y)?(Ce=da.bBox(ie),xe=Ce.width,le=Ce.height):(Ce=da.bBox(oe.node()),xe=Ce.right-g.l-(a?I:q),le=Ce.bottom-g.t-(a?q:I),!a&&A==="top"&&(J+=Ce.height,Te=Ce.height)),ke&&(_e.attr("transform",pa(xe/2+de/2,0)),xe*=2),J=Math.max(J,a?xe:le)}var me=(a?p:d)*2+J+f+s/2,he=0;!a&&T.text&&v==="bottom"&&m<=0&&(he=me/2,me+=he,Te+=he),_._hColorbarMoveTitle=he,_._hColorbarMoveCBTitle=Te;var Ae=f+s,we=(a?I:q)-Ae/2-(a?p:0),De=(a?q:I)-(a?P:d+Te-he);t.select("."+It.cbbg).attr("x",we).attr("y",De).attr(a?"width":"height",Math.max(me-he,2)).attr(a?"height":"width",Math.max(P+Ae,2)).call(hd.fill,c).call(hd.stroke,e.bordercolor).style("stroke-width",f);var Ie=ke?Math.max(xe-10,0):0;t.selectAll("."+It.cboutline).attr("x",(a?I:q+p)+Ie).attr("y",(a?q+d-P:I)+(Z?Se:0)).attr(a?"width":"height",Math.max(H,2)).attr(a?"height":"width",Math.max(P-(a?2*d+Se:2*p+Ie),2)).call(hd.stroke,e.outlinecolor).style({fill:"none","stroke-width":s});var Ge=a?j*me:0,ue=a?0:(1-G)*me-Te;if(Ge=b?g.l-Ge:-Ge,ue=y?g.t-ue:-ue,t.attr("transform",pa(Ge,ue)),!a&&(f||vd(c).getAlpha()&&!vd.equals(_.paper_bgcolor,c))){var He=ye.selectAll("text"),je=He[0].length,Fe=t.select("."+It.cbbg).node(),qe=da.bBox(Fe),Ne=da.getTranslate(t),R=2;He.each(function(Re,Oe){var We=0,Be=je-1;if(Oe===We||Oe===Be){var rt=da.bBox(this),at=da.getTranslate(this),Ye;if(Oe===Be){var wt=rt.right+at.x,tt=qe.right+Ne.x+q-f-R+h;Ye=tt-wt,Ye>0&&(Ye=0)}else if(Oe===We){var Ze=rt.left+at.x,vt=qe.left+Ne.x+q+f+R;Ye=vt-Ze,Ye<0&&(Ye=0)}Ye&&(je<3?this.setAttribute("transform","translate("+Ye+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}})}var U={},V=kx[u],K=Ax[u],ne=kx[v],re=Ax[v],Ee=me-H;a?(n==="pixels"?(U.y=m,U.t=P*ne,U.b=P*re):(U.t=U.b=0,U.yt=m+i*ne,U.yb=m-i*re),l==="pixels"?(U.x=h,U.l=me*V,U.r=me*K):(U.l=Ee*V,U.r=Ee*K,U.xl=h-o*V,U.xr=h+o*K)):(n==="pixels"?(U.x=h,U.l=P*V,U.r=P*K):(U.l=U.r=0,U.xl=h+i*V,U.xr=h-i*K),l==="pixels"?(U.y=1-m,U.t=me*ne,U.b=me*re):(U.t=Ee*ne,U.b=Ee*re,U.yt=m-o*ne,U.yb=m+o*re));var $e=e.y<.5?"b":"t",ge=e.x<.5?"l":"r";r._fullLayout._reservedMargin[e._id]={};var ae={r:_.width-we-Ge,l:we+U.r,b:_.height-De-ue,t:De+U.b};b&&y?Qf.autoMargin(r,e._id,U):b?r._fullLayout._reservedMargin[e._id][$e]=ae[$e]:y||a?r._fullLayout._reservedMargin[e._id][ge]=ae[ge]:r._fullLayout._reservedMargin[e._id][$e]=ae[$e]}return aa.syncOrAsync([Qf.previousPromises,Me,ce,Pe,Qf.previousPromises,Le],r)}function t8(t,e,r){var a=e.orientation==="v",i=r._fullLayout,n=i._size,o,l,s;bf.init({element:t.node(),gd:r,prepFn:function(){o=t.attr("transform"),dd(t)},moveFn:function(f,c){t.attr("transform",o+pa(f,c)),l=bf.align((a?e._uFrac:e._vFrac)+f/n.w,a?e._thickFrac:e._lenFrac,0,1,e.xanchor),s=bf.align((a?e._vFrac:1-e._uFrac)-c/n.h,a?e._lenFrac:e._thickFrac,0,1,e.yanchor);var u=bf.getCursor(l,s,e.xanchor,e.yanchor);dd(t,u)},doneFn:function(){if(dd(t),l!==void 0&&s!==void 0){var f={};f[e._propPrefix+"x"]=l,f[e._propPrefix+"y"]=s,e._traceIndex!==void 0?wx.call("_guiRestyle",r,f,e._traceIndex):wx.call("_guiRelayout",r,f)}}})}function r8(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 a8(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 aa.coerce(n,l,K6,c,u)}return q6(n,l,f,s,a),Z6(n,l,f,s),l}var i8={draw:Q6},n8={moduleType:"component",name:"colorbar",attributes:cp,supplyDefaults:Gw,draw:i8.draw,hasColorbar:Rw},o8={moduleType:"component",name:"legend",layoutAttributes:kT,supplyLayoutDefaults:AT,draw:CT,style:ST},l8={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"}},s8={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}},f8=Je,bA=be,pd=bA.extendFlat,Mx=bA.extendDeep;function Sx(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 c8(t){var e=["xaxis","yaxis","zaxis"];return e.indexOf(t.slice(0,5))>-1}var xA=function(e,r){var a,i=e.data,n=e.layout,o=Mx([],i),l=Mx({},n,Sx(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++)c8(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),f8.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={}),pd(p.xaxis,v),pd(p.yaxis,v),pd(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=Sx(r.tileClass),h},u8=Nh.EventEmitter,v8=Je,d8=be,Lx=Nr,h8=xA,p8=Kp,m8=Qp;function y8(t,e){var r=new u8,a=h8(t,{format:"png"}),i=a.gd;i.style.position="absolute",i.style.left="-5000px",document.body.appendChild(i);function n(){var l=Lx.getDelay(i._fullLayout);setTimeout(function(){var s=p8(i),f=document.createElement("canvas");f.id=d8.randstr(),r=m8({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=Lx.getRedrawFunc(i);return v8.call("_doPlot",i,a.data,a.layout,a.config).then(o).then(n).catch(function(l){r.emit("error",l)}),r}var g8=y8,Cx=Nr,b8={getDelay:Cx.getDelay,getRedrawFunc:Cx.getRedrawFunc,clone:xA,toSVG:Kp,svgToImg:Qp,toImage:g8,downloadImage:rk},x8=b8;(function(t){t.version=Oc.version;for(var e=Je,r=t.register=e.register,a=zt,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(PF),r([iN,wN,_s,HN,QN,T4,q4,n6,$6,N6,G6,Mo,n8,o8,Ta,m2]),r([l8,s8]),window.PlotlyLocales&&Array.isArray(window.PlotlyLocales)&&(r(window.PlotlyLocales),delete window.PlotlyLocales),t.Icons=Lp;var l=Ta,s=Kt;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=x8,t.PlotSchema=Uo})(p_);var _8=p_;const y9=Si(_8);var As={TEXTPAD:3,eventDataKeys:["value","label"]},Ht=zi,Dx=Wo.axisHoverFormat,w8=yr.hovertemplateAttrs,T8=yr.texttemplateAttrs,_A=Ln,k8=fr,$x=As,A8=Fr.pattern,sn=Et.extendFlat,md=k8({editType:"calc",arrayOk:!0,colorEditType:"style",description:""}),M8=Ht.marker,S8=M8.line,L8=sn({},S8.width,{dflt:0}),C8=sn({width:L8,editType:"calc"},_A("marker.line")),D8=sn({line:C8,editType:"calc"},_A("marker"),{opacity:{valType:"number",arrayOk:!0,dflt:1,min:0,max:1,editType:"style",description:"Sets the opacity of the bars."},pattern:A8,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:Ht.x,x0:Ht.x0,dx:Ht.dx,y:Ht.y,y0:Ht.y0,dy:Ht.dy,xperiod:Ht.xperiod,yperiod:Ht.yperiod,xperiod0:Ht.xperiod0,yperiod0:Ht.yperiod0,xperiodalignment:Ht.xperiodalignment,yperiodalignment:Ht.yperiodalignment,xhoverformat:Dx("x"),yhoverformat:Dx("y"),text:Ht.text,texttemplate:T8({editType:"plot"},{keys:$x.eventDataKeys}),hovertext:Ht.hovertext,hovertemplate:w8({},{keys:$x.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:sn({},md,{description:"Sets the font used for `text`."}),insidetextfont:sn({},md,{description:"Sets the font used for `text` lying inside the bar."}),outsidetextfont:sn({},md,{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:sn({},Ht.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:D8,offsetgroup:Ht.offsetgroup,alignmentgroup:Ht.alignmentgroup,selected:{marker:{opacity:Ht.selected.marker.opacity,color:Ht.selected.marker.color,editType:"style"},textfont:Ht.selected.textfont,editType:"style"},unselected:{marker:{opacity:Ht.unselected.marker.opacity,color:Ht.unselected.marker.color,editType:"style"},textfont:Ht.unselected.textfont,editType:"style"},zorder:Ht.zorder},bm={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(" ")}},$8=ct,Px=Ma.hasColorscale,Ex=ys,P8=be.coercePattern,wA=function(e,r,a,i,n){var o=a("marker.color",i),l=Px(e,"marker");l&&Ex(e,r,n,a,{prefix:"marker.",cLetter:"c"}),a("marker.line.color",$8.defaultLine),Px(e,"marker.line")&&Ex(e,r,n,a,{prefix:"marker.line.",cLetter:"c"}),a("marker.line.width"),a("marker.opacity"),P8(a,"marker.pattern",o,l),a("selected.marker.color"),a("unselected.marker.color")},zx=ht,Ro=be,Rx=ct,E8=Je,z8=em,R8=Tu,I8=wA,F8=tm,TA=Ms,xf=Ro.coerceFont;function N8(t,e,r,a){function i(f,c){return Ro.coerce(t,e,TA,f,c)}var n=z8(t,e,a,i);if(!n){e.visible=!1;return}R8(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");AA(t,e,a,i,o,{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),I8(t,e,i,r,a);var l=(e.marker.line||{}).color,s=E8.getComponentMethod("errorbars","supplyDefaults");s(t,e,l||Rx.defaultLine,{axis:"y"}),s(t,e,l||Rx.defaultLine,{axis:"x",inherit:"y"}),Ro.coerceSelectionMarkerOpacity(e,i)}function H8(t,e){var r,a;function i(l,s){return Ro.coerce(a._input,a,TA,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=kA(o)),F8(r,a,e,i,e.barmode)}}function kA(t){if(zx(t)){if(t=+t,t>=0)return t}else if(typeof t=="string"&&(t=t.trim(),t.slice(-1)==="%"&&zx(t.slice(0,-1))&&(t=+t.slice(0,-1),t>=0)))return t+"%"}function AA(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=xf(a,"textfont",r.font),y=Ro.extendFlat({},m),b=t.textfont&&t.textfont.color,_=!b;if(_&&delete y.color,xf(a,"insidetextfont",y),v){var g=Ro.extendFlat({},m);_&&delete g.color,xf(a,"pathbar.textfont",g)}h&&xf(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 _n={supplyDefaults:N8,crossTraceDefaults:H8,handleText:AA,validateCornerradius:kA},O8=Je,j8=Ct,B8=be,G8=bm,U8=_n.validateCornerradius,MA=function(t,e,r){function a(h,m){return B8.coerce(t,e,G8,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(O8.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=j8.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=U8(d)},Kn=be,xm=function(e,r){for(var a=0;a<e.length;a++)e[a].i=a;Kn.mergeArray(r.text,e,"tx"),Kn.mergeArray(r.hovertext,e,"htx");var i=r.marker;if(i){Kn.mergeArray(i.opacity,e,"mo",!0),Kn.mergeArray(i.color,e,"mc");var n=i.line;n&&(Kn.mergeArray(n.color,e,"mlc"),Kn.mergeArrayCastPositive(n.width,e,"mlw"))}},Ix=Ct,Fx=ku,Nx=Ma.hasColorscale,Hx=up,V8=xm,W8=mk,X8=function(e,r){var a=Ix.getFromId(e,r.xaxis||"x"),i=Ix.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=Fx(r,i,"y",l),f=!!r.yperiodalignment,c="y"):(n=i.makeCalcdata(r,"y",u),l=a.makeCalcdata(r,"x"),s=Fx(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 Nx(r,"marker")&&Hx(e,r,{vals:r.marker.color,containerStr:"marker",cLetter:"c"}),Nx(r,"marker.line")&&Hx(e,r,{vals:r.marker.line.color,containerStr:"marker.line",cLetter:"c"}),V8(p,r),W8(p,r),p},Y8=ut,q8=be;function Z8(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=Y8.select(this).select("text");q8.setTransormAndDisplay(f,s)}})}}function K8(t,e,r){if(r.uniformtext.mode){var a=SA(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 Q8(t,e){var r=SA(t);e[r]=void 0}function SA(t){return"_"+t+"Text_minsize"}var ai={recordMinTextSize:K8,clearMinTextSize:Q8,resizeText:Z8},ii={},J8=ht,eH=oa,LA=be.isArrayOrTypedArray;ii.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};ii.coerceNumber=function(t,e,r){if(J8(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};ii.coerceColor=function(t,e,r){return eH(e).isValid()?e:r!==void 0?r:t.dflt};ii.coerceEnumerated=function(t,e,r){return t.coerceNumber&&(e=+e),t.values.indexOf(e)!==-1?e:r!==void 0?r:t.dflt};ii.getValue=function(t,e){var r;return LA(t)?e<t.length&&(r=t[e]):r=t,r};ii.getLineWidth=function(t,e){var r=0<e.mlw?e.mlw:LA(t.marker.line.width)?0:t.marker.line.width;return r};var Ol=ut,tH=ct,fs=kt,CA=be,DA=Je,$A=ai.resizeText,_m=Ms,rH=_m.textfont,aH=_m.insidetextfont,iH=_m.outsidetextfont,ur=ii;function nH(t){var e=Ol.select(t).selectAll('g[class^="barlayer"]').selectAll("g.trace");$A(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)&&Ol.select(this).attr("shape-rendering","crispEdges")}),e.selectAll("g.points").each(function(i){var n=Ol.select(this),o=i[0].trace;PA(n,o,t)}),DA.getComponentMethod("errorbars","style")(e)}function PA(t,e,r){fs.pointStyle(t.selectAll("path"),e,r),EA(t,e,r)}function EA(t,e,r){t.selectAll("text").each(function(a){var i=Ol.select(this),n=CA.ensureUniformFontSize(r,zA(i,a,e,r));fs.font(i,n)})}function oH(t,e,r){var a=e[0].trace;a.selectedpoints?lH(r,a,t):(PA(r,a,t),DA.getComponentMethod("errorbars","style")(r))}function lH(t,e,r){fs.selectedPointStyle(t.selectAll("path"),e),sH(t.selectAll("text"),e,r)}function sH(t,e,r){t.each(function(a){var i=Ol.select(this),n;if(a.selected){n=CA.ensureUniformFontSize(r,zA(i,a,e,r));var o=e.selected.textfont&&e.selected.textfont.color;o&&(n.color=o),fs.font(i,n)}else fs.selectedTextStyle(i,e)})}function zA(t,e,r,a){var i=a._fullLayout.font,n=r.textfont;if(t.classed("bartext-inside")){var o=NA(e,r);n=IA(r,e.i,i,o)}else t.classed("bartext-outside")&&(n=FA(r,e.i,i));return n}function RA(t,e,r){return wm(rH,t.textfont,e,r)}function IA(t,e,r,a){var i=RA(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:tH.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}),wm(aH,t.insidetextfont,e,i)}function FA(t,e,r){var a=RA(t,e,r);return wm(iH,t.outsidetextfont,e,a)}function wm(t,e,r,a){e=e||{};var i=ur.getValue(e.family,r),n=ur.getValue(e.size,r),o=ur.getValue(e.color,r),l=ur.getValue(e.weight,r),s=ur.getValue(e.style,r),f=ur.getValue(e.variant,r),c=ur.getValue(e.textcase,r),u=ur.getValue(e.lineposition,r),v=ur.getValue(e.shadow,r);return{family:ur.coerceString(t.family,i,a.family),size:ur.coerceNumber(t.size,n,a.size),color:ur.coerceColor(t.color,o,a.color),weight:ur.coerceString(t.weight,l,a.weight),style:ur.coerceString(t.style,s,a.style),variant:ur.coerceString(t.variant,f,a.variant),textcase:ur.coerceString(t.variant,c,a.textcase),lineposition:ur.coerceString(t.variant,u,a.lineposition),shadow:ur.coerceString(t.variant,v,a.shadow)}}function NA(t,e){return e.type==="waterfall"?e[t.dir].marker.color:t.mcc||t.mc||e.marker.color}var wn={style:nH,styleTextPoints:EA,styleOnSelect:oH,getInsideTextFont:IA,getOutsideTextFont:FA,getBarColor:NA,resizeText:$A},_f=ut,wf=ht,lr=be,fH=or,cH=ct,bi=kt,uH=Je,Ec=Ct.tickText,HA=ai,vH=HA.recordMinTextSize,dH=HA.clearMinTextSize,yd=wn,Io=ii,hH=As,OA=Ms,pH=OA.text,mH=OA.textposition,yH=sa.appendArrayPointValue,_r=hH.TEXTPAD;function gH(t){return t.id}function bH(t){if(t.ids)return gH}function gd(t){return(t>0)-(t<0)}function Ia(t,e){return t<e?1:-1}function xH(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 jA(t,e,r,a){if(!e.uniformtext.mode&&BA(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 BA(t){return t&&t.duration>0}function _H(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},dH("bar",s));var c=lr.makeTraceGroups(a,r,"trace bars").each(function(u){var v=_f.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=BA(i),T=lr.ensureSingle(v,"g","points"),A=bH(p),M=T.selectAll("g.point").data(lr.identity,A);M.enter().append("g").classed("point",!0),M.exit().remove(),M.each(function(L,E){var F=_f.select(this),N=xH(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&&_&&Io.getLineWidth(p,L)&&(k=!1),k||(k=!wf(z)||!wf(H)||!wf(D)||!wf(P)),L.isBlank=k,k&&(x?H=z:P=D),g&&!k&&(x?(z-=Ia(z,H)*g,H+=Ia(z,H)*g):(D-=Ia(D,P)*g,P+=Ia(D,P)*g));var C,$;if(p.type==="waterfall"){if(!k){var I=p[L.dir].marker;C=I.line.width,$=I.color}}else C=Io.getLineWidth(p,L),$=L.mc||p.marker.color;function j(J){var xe=_f.round(C/2%1,2);return i.gap===0&&i.groupgap===0?_f.round(Math.round(J)-xe,2):J}function G(J,xe,Z){return Z&&J===xe?J:Math.abs(J-xe)>=2?j(J):J>xe?Math.ceil(J):Math.floor(J)}var X=cH.opacity($),O=X<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 q=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 Y(J,xe){if(!J)return 0;var Z=Math.abs(x?P-D:H-z),ke=Math.abs(x?H-z:P-D),Te=O(Math.abs(q(W,!0)-q(0,!0))),le=L.hasB?Math.min(Z/2,ke/2):Math.min(Z/2,Te),ie;if(xe==="%"){var me=Math.min(50,J);ie=Z*(me/100)}else ie=J;return O(Math.max(Math.min(ie,le),0))}var B=b||y?Y(d.cornerradiusvalue,d.cornerradiusform):0,Q,ee,fe="M"+z+","+D+"V"+P+"H"+H+"V"+D+"Z",oe=0;if(B&&L.s){var se=gd(L.s0)===0||gd(L.s)===gd(L.s0)?L.s1:L.s0;if(oe=O(L.hasB?0:Math.abs(q(W,!0)-q(se,!0))),oe<B){var de=Ia(z,H),ye=Ia(D,P),_e=de===-ye?1:0;if(x)if(L.hasB)Q="M"+(z+B*de)+","+D+"A "+B+","+B+" 0 0 "+_e+" "+z+","+(D+B*ye)+"V"+(P-B*ye)+"A "+B+","+B+" 0 0 "+_e+" "+(z+B*de)+","+P+"H"+(H-B*de)+"A "+B+","+B+" 0 0 "+_e+" "+H+","+(P-B*ye)+"V"+(D+B*ye)+"A "+B+","+B+" 0 0 "+_e+" "+(H-B*de)+","+D+"Z";else{ee=Math.abs(H-z)+oe;var Se=ee<B?B-Math.sqrt(ee*(2*B-ee)):0,pe=oe>0?Math.sqrt(oe*(2*B-oe)):0,ve=de>0?Math.max:Math.min;Q="M"+z+","+D+"V"+(P-Se*ye)+"H"+ve(H-(B-oe)*de,z)+"A "+B+","+B+" 0 0 "+_e+" "+H+","+(P-B*ye-pe)+"V"+(D+B*ye+pe)+"A "+B+","+B+" 0 0 "+_e+" "+ve(H-(B-oe)*de,z)+","+(D+Se*ye)+"Z"}else if(L.hasB)Q="M"+(z+B*de)+","+D+"A "+B+","+B+" 0 0 "+_e+" "+z+","+(D+B*ye)+"V"+(P-B*ye)+"A "+B+","+B+" 0 0 "+_e+" "+(z+B*de)+","+P+"H"+(H-B*de)+"A "+B+","+B+" 0 0 "+_e+" "+H+","+(P-B*ye)+"V"+(D+B*ye)+"A "+B+","+B+" 0 0 "+_e+" "+(H-B*de)+","+D+"Z";else{ee=Math.abs(P-D)+oe;var Me=ee<B?B-Math.sqrt(ee*(2*B-ee)):0,Pe=oe>0?Math.sqrt(oe*(2*B-oe)):0,ce=ye>0?Math.max:Math.min;Q="M"+(z+Me*de)+","+D+"V"+ce(P-(B-oe)*ye,D)+"A "+B+","+B+" 0 0 "+_e+" "+(z+B*de-Pe)+","+P+"H"+(H-B*de+Pe)+"A "+B+","+B+" 0 0 "+_e+" "+(H-Me*de)+","+ce(P-(B-oe)*ye,D)+"V"+D+"Z"}}else Q=fe}else Q=fe;var Le=jA(lr.ensureSingle(F,"path"),s,i,n);if(Le.style("vector-effect",f?"none":"non-scaling-stroke").attr("d",isNaN((H-z)*(P-D))||k&&t._context.staticPlot?"M0,0Z":Q).call(bi.setClipUrl,e.layerClipId,t),!s.uniformtext.mode&&w){var Ce=bi.makePointStyleFns(p);bi.singlePointStyle(L,Le,p,Ce,t)}wH(t,e,F,u,E,z,H,D,P,B,oe,i,n),e.layerClipId&&bi.hideOutsideRangePoint(L,F.select("text"),o,l,p.xcalendar,p.ycalendar)});var S=p.cliponaxis===!1;bi.setClipUrl(v,S?null:e.layerClipId,t)});uH.getComponentMethod("errorbars","plot")(t,c,e,i)}function wH(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(ee,fe,oe){var se=lr.ensureSingle(ee,"text").text(fe).attr({class:"bartext bartext-"+m,"text-anchor":"middle","data-notex":1}).call(bi.font,oe).call(fH.convertToTspans,t);return se}var b=a[0].trace,_=b.orientation==="h",g=AH(h,a,i,p,d);m=MH(b,i);var x=u.mode==="stack"||u.mode==="relative",w=a[i],T=!x||w._outmost,A=w.hasB,M=f&&f-c>_r;if(!g||m==="none"||(w.isBlank||n===o||l===s)&&(m==="auto"||m==="inside")){r.select("text").remove();return}var S=h.font,L=yd.getBarColor(a[i],b),E=yd.getInsideTextFont(b,i,S,L),F=yd.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*_r,k=D-2*_r,C,$,I,j,G;if(m==="outside"&&!T&&!w.hasB&&(m="inside"),m==="auto")if(T){m="inside",G=lr.ensureUniformFontSize(t,E),C=y(r,g,G),$=bi.bBox(C.node()),I=$.width,j=$.height;var X=I>0&&j>0,O;M?A?O=qi(P-2*f,k,I,j,_)||qi(P,k-2*f,I,j,_):_?O=qi(P-(f-c),k,I,j,_)||qi(P,k-2*(f-c),I,j,_):O=qi(P,k-(f-c),I,j,_)||qi(P-2*(f-c),k,I,j,_):O=qi(P,k,I,j,_),X&&O?m="inside":(m="outside",C.remove(),C=null)}else m="inside";if(!C){G=lr.ensureUniformFontSize(t,m==="outside"?F:E),C=y(r,g,G);var q=C.attr("transform");if(C.attr("transform",""),$=bi.bBox(C.node()),I=$.width,j=$.height,C.attr("transform",q),I<=0||j<=0){C.remove();return}}var W=b.textangle,Y,B;m==="outside"?(B=b.constraintext==="both"||b.constraintext==="outside",Y=kH(n,o,l,s,$,{isHorizontal:_,constrained:B,angle:W})):(B=b.constraintext==="both"||b.constraintext==="inside",Y=VA(n,o,l,s,$,{isHorizontal:_,constrained:B,angle:W,anchor:N,hasB:A,r:f,overhead:c})),Y.fontSize=G.size,vH(b.type==="histogram"?"bar":b.type,Y,h),w.transform=Y;var Q=jA(C,h,u,v);lr.setTransormAndDisplay(Q,Y)}function qi(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 UA(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 VA(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*_r&&x>2*_r?_r: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=UA(i,T),M,S;if(m&&m-y>_r){var L=TH(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+_r)*d+(e-_r)*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?Ia(t,e):Ia(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 TH(t,e,r,a,i,n,o,l,s){var f=Math.max(0,Math.abs(e-t)-2*_r),c=Math.max(0,Math.abs(a-r)-2*_r),u=n-_r,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 kH(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*_r?_r:0:p=u>2*_r?_r:0;var d=1;l&&(d=o?Math.min(1,v/c):Math.min(1,u/f));var h=GA(s),m=UA(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?Ia(e,t):Ia(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 AH(t,e,r,a,i){var n=e[0].trace,o=n.texttemplate,l;return o?l=SH(t,e,r,a,i):n.textinfo?l=LH(e,r,a,i):l=Io.getValue(n.text,r),Io.coerceString(pH,l)}function MH(t,e){var r=Io.getValue(t.textposition,e);return Io.coerceEnumerated(mH,r)}function SH(t,e,r,a,i){var n=e[0].trace,o=lr.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 Ec(v,v.c2l(w),!0).text}function m(w){return Ec(d,d.c2l(w),!0).text}var y=e[r],b={};b.label=y.p,b.labelLabel=b[u+"Label"]=h(y.p);var _=lr.castOption(n,y.i,"text");(_===0||_)&&(b.text=_),b.value=y.s,b.valueLabel=b[p+"Label"]=m(y.s);var g={};yH(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=lr.formatPercent(y.begR),b.percentPrevious=y.difR,b.percentPreviousLabel=lr.formatPercent(y.difR),b.percentTotal=y.sumR,b.percenTotalLabel=lr.formatPercent(y.sumR));var x=lr.castOption(n,y.i,"customdata");return x&&(b.customdata=x),lr.texttemplateString(o,b,t._d3locale,g,b,n._meta||{})}function LH(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 Ec(w,x,!0).text}function f(x){var w=n?r:a;return Ec(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=lr.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=lr.formatPercent(u.begR),g&&(d+=" of initial"),p.push(d)),h("percent previous")&&(d=lr.formatPercent(u.difR),g&&(d+=" of previous"),p.push(d)),h("percent total")&&(d=lr.formatPercent(u.sumR),g&&(d+=" of total"),p.push(d))}return p.join("<br>")}var Tm={plot:_H,toMoveInsideBar:VA},xl=Ta,CH=Je,Ox=ct,DH=be.fillText,$H=ii.getLineWidth,bd=Ct.hoverLabelText,PH=Wt.BADNUM;function EH(t,e,r,a,i){var n=WA(t,e,r,a,i);if(n){var o=n.cd,l=o[0].trace,s=o[n.index];return n.color=XA(l,s),CH.getComponentMethod("errorbars","hoverInfo")(s,l,n),[n]}}function WA(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,q){var W=O.w;return O[d]+q*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,q,W){return i.finiteRange&&(W=0),xl.inbox(O-v,q-v,W+Math.min(1,Math.abs(q-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 q=O[h];if(f){var W=Math.abs(O.rawS)||0;p>0?q+=W:p<0&&(q-=W)}return q}function z(O){var q=p,W=O.b,Y=N(O);return xl.inbox(W-q,Y-q,c+(Y-q)/(Y-W)-1)}function H(O){var q=p,W=O.b,Y=N(O);return xl.inbox(W-q,Y-q,u+(Y-q)/(Y-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!==PH){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,I=n[$],j=o.base?I.b+I.s:I.s;t[h+"0"]=t[h+"1"]=P.c2p(I[h],!0),t[h+"LabelVal"]=j;var G=l.extents[l.extents.round(I.p)];t[d+"0"]=D.c2p(s?M(I):G[0],!0),t[d+"1"]=D.c2p(s?S(I):G[1],!0);var X=I.orig_p!==void 0;return t[d+"LabelVal"]=X?I.orig_p:I.p,t.labelLabel=bd(D,t[d+"LabelVal"],o[d+"hoverformat"]),t.valueLabel=bd(P,t[h+"LabelVal"],o[h+"hoverformat"]),t.baseLabel=bd(P,I.b,o[h+"hoverformat"]),t.spikeDistance=(H(I)+F(I))/2,t[d+"Spike"]=D.c2p(I.p,!0),DH(I,o,t),t.hovertemplate=o.hovertemplate,t}}function XA(t,e){var r=e.mcc||t.marker.color,a=e.mlcc||t.marker.line.color,i=$H(t,e);if(Ox.opacity(r))return r;if(Ox.opacity(a)&&i)return a}var YA={hoverPoints:EH,hoverOnBars:WA,getTraceColor:XA},zH=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},qA=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:RH(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 RH(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 IH={attributes:Ms,layoutAttributes:bm,supplyDefaults:_n.supplyDefaults,crossTraceDefaults:_n.crossTraceDefaults,supplyLayoutDefaults:MA,calc:X8,crossTraceCalc:om.crossTraceCalc,colorbar:Ts,arraysToCalcdata:xm,plot:Tm.plot,style:wn.style,styleOnSelect:wn.styleOnSelect,hoverPoints:YA.hoverPoints,eventData:zH,selectPoints:qA,moduleType:"trace",name:"bar",basePlotModule:Qt,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(" ")}},FH=IH;const g9=Si(FH);var NH=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"}},HH={eventDataKeys:["binNumber"]},Cr=Ms,jx=Wo.axisHoverFormat,OH=yr.hovertemplateAttrs,jH=yr.texttemplateAttrs,xd=fr,Bx=NH,BH=HH,_d=Et.extendFlat,ZA={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:jx("x"),yhoverformat:jx("y"),text:_d({},Cr.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:_d({},Cr.hovertext,{description:"Same as `text`."}),orientation:Cr.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:Bx("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:Bx("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:OH({},{keys:BH.eventDataKeys}),texttemplate:jH({arrayOk:!1,editType:"plot"},{keys:["label","value"]}),textposition:_d({},Cr.textposition,{arrayOk:!1}),textfont:xd({arrayOk:!1,editType:"plot",colorEditType:"style",description:"Sets the text font."}),outsidetextfont:xd({arrayOk:!1,editType:"plot",colorEditType:"style",description:"Sets the font used for `text` lying outside the bar."}),insidetextfont:xd({arrayOk:!1,editType:"plot",colorEditType:"style",description:"Sets the font used for `text` lying inside the bar."}),insidetextanchor:Cr.insidetextanchor,textangle:Cr.textangle,cliponaxis:Cr.cliponaxis,constraintext:Cr.constraintext,marker:Cr.marker,offsetgroup:Cr.offsetgroup,alignmentgroup:Cr.alignmentgroup,selected:Cr.selected,unselected:Cr.unselected,zorder:Cr.zorder},Gx=Je,_l=be,Ux=ct,GH=_n.handleText,UH=wA,VH=ZA,WH=function(e,r,a,i){function n(b,_){return _l.coerce(e,r,VH,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");GH(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=Gx.getComponentMethod("calendars","handleTraceDefaults");d(e,r,["x","y"],i);var h=r[v];h&&n("histfunc"),n("histnorm"),n("autobin"+u),UH(e,r,n,a,i),_l.coerceSelectionMarkerOpacity(r,n);var m=(r.marker.line||{}).color,y=Gx.getComponentMethod("errorbars","supplyDefaults");y(e,r,m||Ux.defaultLine,{axis:"y"}),y(e,r,m||Ux.defaultLine,{axis:"x",inherit:"y"}),n("zorder")},$l=be,XH=Xt,Tf=Je.traceIs,YH=tm,qH=_n.validateCornerradius,Vx=$l.nestedProperty,wd=ri.getAxisGroup,Wx=[{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"}],ZH=["x","y"],KH=function(e,r){var a=r._histogramBinOpts={},i=[],n={},o=[],l,s,f,c,u,v,p;function d(z,H){return $l.coerce(l._input,l,l._module.attributes,z,H)}function h(z){return z.orientation==="v"?"x":"y"}function m(z,H){var D=XH.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],I=!0;$&&(k===$.axType&&C===$.calendar?(I=!1,$.traces.push(z),$.dirs.push(D)):(H=P,k!==$.axType&&$l.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&&$l.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(" ")))),I&&(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],Tf(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=qH(b))}Tf(l,"2dMap")||YH(l._input,l,r,d,r.barmode)}var _=r._alignmentOpts||{};for(u=0;u<i.length;u++){if(l=i[u],f="",!Tf(l,"2dMap")){if(c=h(l),r.barmode==="group"&&l.alignmentgroup){var g=l[c+"axis"],x=wd(r,g)+l.orientation;(_[x]||{})[l.alignmentgroup]&&(f=x)}!f&&r.barmode!=="overlay"&&(f=wd(r,l.xaxis)+wd(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&&$l.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(Tf(l,"2dMap"))for(p=0;p<2;p++){c=ZH[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<Wx.length;v++){var L=Wx[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],Vx(l._input,F).get()!==void 0){S[E]=d(F),S[E+"Found"]=!0;break}N=(l._autoBin||{})[c]||{},N[E]&&Vx(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))}}}},Qn=ht,QH={count:function(t,e,r){return r[t]++,1},sum:function(t,e,r,a){var i=a[e];return Qn(i)?(i=Number(i),r[t]+=i,i):0},avg:function(t,e,r,a,i){var n=a[e];return Qn(n)&&(n=Number(n),r[t]+=n,i[t]++),0},min:function(t,e,r,a){var i=a[e];if(Qn(i))if(i=Number(i),Qn(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(Qn(i))if(i=Number(i),Qn(r[t])){if(r[t]<i){var n=i-r[t];return r[t]=i,n}}else return r[t]=i,i;return 0}},JH={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}},eO=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},Zo=Wt,pn=Zo.ONEAVGYEAR,Xx=Zo.ONEAVGMONTH,zc=Zo.ONEDAY,Yx=Zo.ONEHOUR,qx=Zo.ONEMIN,Zx=Zo.ONESEC,Kx=Ct.tickIncrement,tO=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(kf(f+l,f+s,i,n),kf(c+l,c+s,i,n)),v=Math.min(kf(f+o,f+l,i,n),kf(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>zc){var h=p===pn?1:6,m=p===pn?"M12":"M1";return function(y,b){var _=i.c2d(y,pn,n),g=_.indexOf("-",h);g>0&&(_=_.substr(0,g));var x=i.d2c(_,0,n);if(x<y){var w=Kx(x,m,!1,n);(x+w)/2<y+e&&(x=w)}return b&&d?Kx(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 kf(t,e,r,a){if(t*e<=0)return 1/0;for(var i=Math.abs(e-t),n=r.type==="date",o=Qx(i,n),l=0;l<10;l++){var s=Qx(o*80,n);if(o===s)break;if(rO(s,t,e,n,r,a))o=s;else break}return o}function Qx(t,e){return e&&t>Zx?t>zc?t>pn*1.1?pn:t>Xx*1.1?Xx:zc:t>Yx?Yx:t>qx?qx:Zx:Math.pow(10,Math.floor(Math.log(t)/Math.LN10))}function rO(t,e,r,a,i,n){if(a&&t>zc){var o=Jx(e,i,n),l=Jx(r,i,n),s=t===pn?0:1;return o[s]!==l[s]}return Math.floor(r/t)-Math.floor(e/t)>.1}function Jx(t,e,r){var a=e.c2d(t,pn,r).split("-");return a[0]===""&&(a.unshift(),a[0]="-"+a[0]),a}var Ch=ht,xr=be,e1=Je,Jr=Ct,aO=xm,t1=QH,iO=JH,nO=eO,oO=tO;function lO(t,e){var r=[],a=[],i=e.orientation==="h",n=Jr.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=km(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=t1.count,N=iO[x],z=!1,H=function(ee){return n.r2c(ee,0,s)},D;for(xr.isArrayOrTypedArray(e[l])&&w!=="count"&&(D=e[l],z=w==="avg",F=t1[w]),c=H(v.start),M=H(v.end)+(c-Jr.tickIncrement(c,v.size,!1,s))/1e6;c<M&&r.length<1e6&&(A=Jr.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,I=k.leftGap,j=k.rightGap,G={};for(c=0;c<p.length;c++){var X=p[c];S=xr.findBin(X,m),S>=0&&S<C&&(g+=F(S,c,a,D,b),$&&_[S].length&&X!==p[_[S][0]]&&($=!1),_[S].push(c),G[c]=S,I=Math.min(I,X-h[S]),j=Math.min(j,h[S+1]-X))}k.leftGap=I,k.rightGap=j;var O;$||(O=function(ee,fe){return function(){var oe=t._fullLayout._roundFnOpts[P];return oO(oe.leftGap,oe.rightGap,h,n,s)(ee,fe)}}),z&&(g=nO(a,b)),N&&N(a,g,y),f.enabled&&cO(a,f.direction,f.currentbin);var q=Math.min(r.length,a.length),W=[],Y=0,B=q-1;for(c=0;c<q;c++)if(a[c]){Y=c;break}for(c=q-1;c>=Y;c--)if(a[c]){B=c;break}for(c=Y;c<=B;c++)if(Ch(r[c])&&Ch(a[c])){var Q={p:r[c],s:a[c],b:0};f.enabled||(Q.pts=_[c],$?Q.ph0=Q.ph1=_[c].length?p[_[c][0]]:r[c]:(e._computePh=!0,Q.ph0=O(h[c]),Q.ph1=O(h[c+1],!0))),W.push(Q)}return W.length===1&&(W[0].width1=Jr.tickIncrement(W[0].p,v.size,!1,s)-W[0].p),aO(W,e),xr.isArrayOrTypedArray(e.selectedpoints)&&xr.tagSelected(W,e,G),W}function km(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(X){return r.r2c(X,0,p)},b=function(X){return r.c2r(X,0,p)},_=r.type==="date"?function(X){return X||X===0?xr.cleanDate(X,null,p):null}:function(X){return Ch(X)?Number(X):null};function g(X,O,q){O[X+"Found"]?(O[X]=_(O[X]),O[X]===null&&(O[X]=q[X])):(h[X]=O[X]=q[X],xr.nestedProperty(u[0],n+"."+X).set(q[X]))}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=xr.concat(x,d),delete v["_"+a+"autoBinFinished"],e.visible===!0&&(w?w=!1:(delete v._autoBin,v["_"+a+"autoBinFinished"]=1),e1.traceIs(v,"2dMap")&&(T=!0),v.type==="histogram2dcontour"&&(A=!0))}p=u[0][a+"calendar"];var S=Jr.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(Jr.tickIncrement(y(S.start),S.size,!0,p))),s.end===void 0&&(S.end=b(Jr.tickIncrement(y(S.end),S.size,!1,p)))),f&&!e1.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=sO(t,e,r,a,n)}m=v.cumulative||{},m.enabled&&m.currentbin!=="include"&&(m.direction==="decreasing"?S.start=b(Jr.tickIncrement(y(S.start),S.size,!0,p)):S.end=b(Jr.tickIncrement(y(S.end),S.size,!1,p))),s.size=S.size,s.sizeFound||(h.size=S.size,xr.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=xr.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:xr.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,Jr.tickIncrement(D,s.size,!1,p)].map(r.l2r)},k=Jr.tickFirst(P);k>r.r2l(D)&&(k=Jr.tickIncrement(k,s.size,!0,p)),F.start=r.l2r(k),H||xr.nestedProperty(e,n+".start").set(F.start)}var C=s.end,$=r.r2l(E.end),I=$!==void 0;if((s.endFound||I)&&$!==r.r2l(C)){var j=I?$:xr.aggNums(Math.max,null,d);F.end=r.l2r(j),I||xr.nestedProperty(e,n+".start").set(F.end)}var G="autobin"+a;return e._input[G]===!1&&(e._input[n]=xr.extendFlat({},e[n]||{}),delete e._input[G],delete e[G]),[F,d]}function sO(t,e,r,a,i){var n=t._fullLayout,o=fO(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=km(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=xr.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&&xr.extendFlat(v,g)}return e[i]}function fO(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 cO(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 uO={calc:lO,calcAllAutoBins:km},vO=YA.hoverPoints,dO=Ct.hoverLabelText,hO=function(e,r,a,i,n){var o=vO(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"]=dO(e[f+"a"],[l.ph0,l.ph1],s[f+"hoverformat"])}return o}},pO=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},mO={attributes:ZA,layoutAttributes:bm,supplyDefaults:WH,crossTraceDefaults:KH,supplyLayoutDefaults:MA,calc:uO.calc,crossTraceCalc:om.crossTraceCalc,plot:Tm.plot,layerName:"barlayer",style:wn.style,styleOnSelect:wn.styleOnSelect,colorbar:Ts,hoverPoints:hO,selectPoints:qA,eventData:pO,moduleType:"trace",name:"histogram",basePlotModule:Qt,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(" ")}},yO=mO;const b9=Si(yO);var gO=la,bO=Ri.attributes,xO=fr,_O=Tr,wO=yr.hovertemplateAttrs,TO=yr.texttemplateAttrs,wl=Et.extendFlat,kO=Fr.pattern,Af=xO({editType:"plot",arrayOk:!0,colorEditType:"plot",description:"Sets the font used for `textinfo`."}),Du={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:_O.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:kO,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({},gO.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:wO({},{keys:["label","color","value","percent","text"]}),texttemplate:TO({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({},Af,{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({},Af,{description:"Sets the font used for `textinfo` lying inside the sector."}),outsidetextfont:wl({},Af,{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({},Af,{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:bO({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(" ")}},AO=ht,jl=be,MO=Du,SO=Ri.defaults,LO=_n.handleText,CO=be.coercePattern;function KA(t,e){var r=jl.isArrayOrTypedArray(t),a=jl.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(AO(l)&&l>0){n=!0;break}}n||(i=0)}return{hasLabels:r,hasValues:a,len:i}}function QA(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");CO(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 DO(t,e,r,a){function i(b,_){return jl.coerce(t,e,MO,b,_)}var n=i("labels"),o=i("values"),l=KA(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,QA(t,e,a,i,!0),i("scalegroup");var f=i("text"),c=i("texttemplate"),u;if(c||(u=i("textinfo",jl.isArrayOrTypedArray(f)?"text+percent":"percent")),i("hovertext"),i("hovertemplate"),c||u&&u!=="none"){var v=i("textposition");LO(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");SO(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"),jl.coerceFont(i,"title.font",a.font)}i("sort"),i("direction"),i("rotation"),i("pull")}var JA={handleLabelsAndValues:KA,handleMarkerDefaults:QA,supplyDefaults:DO},eM={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(" ")}},$O=be,PO=eM,EO=function(e,r){function a(i,n){return $O.coerce(e,r,PO,i,n)}a("hiddenlabels"),a("piecolorway",r.colorway),a("extendpiecolors")},zO=ht,Dh=oa,RO=ct,IO={};function FO(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=tM(a["_"+e.type+"colormap"]),d=0,h=!1;for(c=0;c<s;c++){var m,y,b;if(f){if(m=l[c],!zO(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 tM(t){return function(r,a){return!r||(r=Dh(r),!r.isValid())?!1:(r=RO.addOpacity(r,r.getAlpha()),t[a]||(t[a]=r),r)}}function NO(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=rM(n,IO));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 rM(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(Dh(t[r]).lighten(20).toHexString());for(r=0;r<t.length;r++)i.push(Dh(t[r]).darken(20).toHexString());e[a]=i}return i}var Rc={calc:FO,crossTraceCalc:NO,makePullColorFn:tM,generateExtendedColors:rM},HO=sa.appendArrayMultiPointValues,OO=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]),HO(a,r,e.pts),r.type==="funnelarea"&&(delete a.v,delete a.i),a},Pr=ut,jO=Kt,Mf=Ta,aM=ct,Ka=kt,vr=be,BO=vr.strScale,r1=vr.strTranslate,$h=or,iM=ai,GO=iM.recordMinTextSize,UO=iM.clearMinTextSize,nM=As.TEXTPAD,st=Cn,Sf=OO,a1=be.isValidTextValue;function VO(t,e){var r=t._context.staticPlot,a=t._fullLayout,i=a._size;UO("pie",a),sM(e,t),pM(e,i);var n=vr.makeTraceGroups(a._pielayer,e,"trace").each(function(o){var l=Pr.select(this),s=o[0],f=s.trace;e7(o),l.attr("stroke-linejoin","round"),l.each(function(){var c=Pr.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){Pr.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=Pr.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(oM,t,o),f.pull){var S=+st.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 I=$*(k[0]-P[0]),j=$*(k[1]-P[1]);return"a"+$*s.r+","+$*s.r+" 0 "+g.largeArc+(C?" 1 ":" 0 ")+I+","+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")}mM(t,g,s);var H=st.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=vr.ensureSingle(Pr.select(this),"text","",function(O){O.attr("data-notex",1)}),k=vr.ensureUniformFontSize(t,H==="outside"?XO(f,g,a.font):lM(f,g,a.font));P.text(g.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(Ka.font,k).call($h.convertToTspans,t);var C=Ka.bBox(P.node()),$;if(H==="outside")$=o1(C,g);else if($=fM(C,g,s),H==="auto"&&$.scale<1){var I=vr.ensureUniformFontSize(t,f.outsidetextfont);P.call(Ka.font,I),C=Ka.bBox(P.node()),$=o1(C,g)}var j=$.textPosAngle,G=j===void 0?g.pxmid:Jf(s.r,j);if($.targetX=w+G[0]*$.rCenter+($.x||0),$.targetY=T+G[1]*$.rCenter+($.y||0),yM($,C),$.outside){var X=$.targetY;g.yLabelMin=X-C.height/2,g.yLabelMid=X,g.yLabelMax=X+C.height/2,g.labelExtraX=0,g.labelExtraY=0,v=!0}$.fontSize=k.size,GO(f.type,$,a),o[x].transform=$,vr.setTransormAndDisplay(P,$)})});var p=Pr.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=vr.ensureSingle(Pr.select(this),"text","",function(T){T.attr("data-notex",1)}),x=f.title.text;f._meta&&(x=vr.templateString(x,f._meta)),g.text(x).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(Ka.font,f.title.font).call($h.convertToTspans,t);var w;f.title.position==="middle center"?w=ZO(s):w=dM(s,i),g.attr("transform",r1(w.x,w.y)+BO(Math.min(1,w.scale))+r1(w.tx,w.ty))}),v&&QO(u,f),WO(c,f),v&&f.automargin){var d=Ka.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;jO.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=Pr.select(this);o.attr("dy")&&o.attr("dy",o.attr("dy"))})},0)}function WO(t,e){t.each(function(r){var a=Pr.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,vr.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;vr.ensureSingle(a,"path","textline").call(aM.stroke,e.outsidetextfont.color).attr({"stroke-width":Math.min(2,e.outsidetextfont.size/8),d:l,fill:"none"})})}function oM(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=Mf.castHoverinfo({hoverinfo:[st.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=st.castOption(c.hovertext||c.text,s.pts),u&&u.indexOf("text")!==-1){var y=s.text;vr.isValidTextValue(y)&&m.push(y)}s.value=s.v,s.valueLabel=st.formatPieValue(s.v,h),u&&u.indexOf("value")!==-1&&m.push(s.valueLabel),s.percent=s.v/a.vTotal,s.percentLabel=st.formatPiePercent(s.percent,h),u&&u.indexOf("percent")!==-1&&m.push(s.percentLabel);var b=c.hoverlabel,_=b.font,g=[];Mf.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:st.castOption(b.bgcolor,s.pts)||s.color,borderColor:st.castOption(b.bordercolor,s.pts),fontFamily:st.castOption(_.family,s.pts),fontSize:st.castOption(_.size,s.pts),fontColor:st.castOption(_.color,s.pts),nameLength:st.castOption(b.namelength,s.pts),textAlign:st.castOption(b.align,s.pts),hovertemplate:st.castOption(c.hovertemplate,s.pts),hovertemplateLabels:s,eventData:[Sf(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:[Sf(s,c)],event:Pr.event})}}),t.on("mouseout",function(s){var f=e._fullLayout,c=e._fullData[o.index],u=Pr.select(this).datum();o._hasHoverEvent&&(s.originalEvent=Pr.event,e.emit("plotly_unhover",{points:[Sf(u,c)],event:Pr.event}),o._hasHoverEvent=!1),o._hasHoverLabel&&(Mf.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=[Sf(s,c)],Mf.click(e,Pr.event))})}function XO(t,e,r){var a=st.castOption(t.outsidetextfont.color,e.pts)||st.castOption(t.textfont.color,e.pts)||r.color,i=st.castOption(t.outsidetextfont.family,e.pts)||st.castOption(t.textfont.family,e.pts)||r.family,n=st.castOption(t.outsidetextfont.size,e.pts)||st.castOption(t.textfont.size,e.pts)||r.size,o=st.castOption(t.outsidetextfont.weight,e.pts)||st.castOption(t.textfont.weight,e.pts)||r.weight,l=st.castOption(t.outsidetextfont.style,e.pts)||st.castOption(t.textfont.style,e.pts)||r.style,s=st.castOption(t.outsidetextfont.variant,e.pts)||st.castOption(t.textfont.variant,e.pts)||r.variant,f=st.castOption(t.outsidetextfont.textcase,e.pts)||st.castOption(t.textfont.textcase,e.pts)||r.textcase,c=st.castOption(t.outsidetextfont.lineposition,e.pts)||st.castOption(t.textfont.lineposition,e.pts)||r.lineposition,u=st.castOption(t.outsidetextfont.shadow,e.pts)||st.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 lM(t,e,r){var a=st.castOption(t.insidetextfont.color,e.pts);!a&&t._input.textfont&&(a=st.castOption(t._input.textfont.color,e.pts));var i=st.castOption(t.insidetextfont.family,e.pts)||st.castOption(t.textfont.family,e.pts)||r.family,n=st.castOption(t.insidetextfont.size,e.pts)||st.castOption(t.textfont.size,e.pts)||r.size,o=st.castOption(t.insidetextfont.weight,e.pts)||st.castOption(t.textfont.weight,e.pts)||r.weight,l=st.castOption(t.insidetextfont.style,e.pts)||st.castOption(t.textfont.style,e.pts)||r.style,s=st.castOption(t.insidetextfont.variant,e.pts)||st.castOption(t.textfont.variant,e.pts)||r.variant,f=st.castOption(t.insidetextfont.textcase,e.pts)||st.castOption(t.textfont.textcase,e.pts)||r.textcase,c=st.castOption(t.insidetextfont.lineposition,e.pts)||st.castOption(t.textfont.lineposition,e.pts)||r.lineposition,u=st.castOption(t.insidetextfont.shadow,e.pts)||st.castOption(t.textfont.shadow,e.pts)||r.shadow;return{color:a||aM.contrast(e.color),family:i,size:n,weight:o,style:l,variant:s,textcase:f,lineposition:c,shadow:u}}function sM(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=vr.templateString(n,a._meta));var o=Ka.tester.append("text").attr("data-notex",1).text(n).call(Ka.font,a.title.font).call($h.convertToTspans,e),l=Ka.bBox(o.node(),!0);r.titleBox={width:l.width,height:l.height},o.remove()}}function fM(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(YO(e,A)){var S=Math.abs(A-e.startangle),L=Math.abs(A-e.stopangle),E=S<L?S:L;M==="tan"?m=n1(t,a,o,E,0):m=i1(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=i1(t,a,o,s,f),m.textPosAngle=(e.startangle+e.stopangle)/2,h.push(m)),(d||v)&&(m=n1(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 YO(t,e){var r=t.startangle,a=t.stopangle;return r>e&&e>a||r<e&&e<a}function i1(t,e,r,a,i){e=Math.max(0,e-2*nM);var n=t.width/t.height,o=vM(n,a,e,r);return{scale:o*2/t.height,rCenter:cM(n,o/e),rotate:uM(i)}}function n1(t,e,r,a,i){e=Math.max(0,e-2*nM);var n=t.height/t.width,o=vM(n,a,e,r);return{scale:o*2/t.width,rCenter:cM(n,o/e),rotate:uM(i+Math.PI/2)}}function cM(t,e){return Math.cos(e)-t*e}function uM(t){return(180/Math.PI*t+720)%180-90}function vM(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 qO(t,e){return t.v===e.vTotal&&!e.trace.hole?1:Math.min(1/(1+1/Math.sin(t.halfangle)),t.ring/2)}function o1(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 ZO(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 dM(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=hM(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=KO(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=Ph(t,e)/t.titleBox.height,{x:o.x,y:o.y,scale:Math.min(r,a),tx:l.tx,ty:l.ty}}function KO(t,e){return t/(e===void 0?1:e)}function Ph(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 hM(t){var e=t.pull;if(!e)return 0;var r;if(vr.isArrayOrTypedArray(e))for(e=0,r=0;r<t.pull.length;r++)t.pull[r]>e&&(e=t.pull[r]);return e}function QO(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),!!vr.isArrayOrTypedArray(e.pull))for(L=0;L<u.length;L++)E=u[L],!(E===_||(st.castOption(e.pull,_.pts)||0)>=(st.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 pM(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-=Ph(i,e));var f=l/2,c=s/2;n.type==="funnelarea"&&!n.scalegroup&&(c/=n.aspectratio),i.r=Math.min(f,c)/(1+hM(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-=Ph(i,e)),n.scalegroup&&r.indexOf(n.scalegroup)===-1&&r.push(n.scalegroup)}JO(t,r)}function JO(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 e7(t){var e=t[0],r=e.r,a=e.trace,i=st.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=Jf(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=Jf(r,i),f.midangle=i,i+=n*f.v/2,c=Jf(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=qO(f,e))}function Jf(t,e){return[t*Math.sin(e),-t*Math.cos(e)]}function mM(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=st.getFirstFilled(i.text,e.pts);a1(h)&&d.push(h)}u&&d.push(st.formatPieValue(e.v,p)),v&&d.push(st.formatPiePercent(e.v/r.vTotal,p)),e.text=d.join("<br>")}function m(g){return{label:g.label,value:g.v,valueLabel:st.formatPieValue(g.v,a.separators),percent:g.v/r.vTotal,percentLabel:st.formatPiePercent(g.v/r.vTotal,a.separators),color:g.color,text:g.text,customdata:vr.castOption(i,g.i,"customdata")}}if(n){var y=vr.castOption(i,e.i,"texttemplate");if(!y)e.text="";else{var b=m(e),_=st.getFirstFilled(i.text,e.pts);(a1(_)||_==="")&&(b.text=_),e.text=vr.texttemplateString(y,b,t._fullLayout._d3locale,b,i._meta||{})}}}function yM(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 gM={plot:VO,formatSliceLabel:mM,transformInsideText:fM,determineInsideTextFont:lM,positionTitleOutside:dM,prerenderTitles:sM,layoutAreas:pM,attachFxHandlers:oM,computeTransform:yM},l1=ut,t7=Tp,r7=ai.resizeText,a7=function(e){var r=e._fullLayout._pielayer.selectAll(".trace");r7(e,r,"pie"),r.each(function(a){var i=a[0],n=i.trace,o=l1.select(this);o.style({opacity:n.opacity}),o.selectAll("path.surface").each(function(l){l1.select(this).call(t7,l,n,e)})})},bM={};(function(t){var e=Kt;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)}})(bM);var i7={attributes:Du,supplyDefaults:JA.supplyDefaults,supplyLayoutDefaults:EO,layoutAttributes:eM,calc:Rc.calc,crossTraceCalc:Rc.crossTraceCalc,plot:gM.plot,style:a7,styleOne:Tp,moduleType:"trace",name:"pie",basePlotModule:bM,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(" ")}},n7=i7;const x9=Si(n7);var xM={INCREASING:{COLOR:"#3D9970",SYMBOL:"▲"},DECREASING:{COLOR:"#FF4136",SYMBOL:"▼"}},ec=be.extendFlat,Pl=zi,s1=Wo.axisHoverFormat,Eh=Fr.dash,o7=Bc,_M=xM,l7=_M.INCREASING.COLOR,s7=_M.DECREASING.COLOR,Ic=Pl.line;function f1(t){return{line:{color:ec({},Ic.color,{dflt:t}),width:Ic.width,dash:Eh,editType:"style"},editType:"style"}}var wM={xperiod:Pl.xperiod,xperiod0:Pl.xperiod0,xperiodalignment:Pl.xperiodalignment,xhoverformat:s1("x"),yhoverformat:s1("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:ec({},Ic.width,{description:[Ic.width,"Note that this style setting can also be set per","direction via `increasing.line.width` and","`decreasing.line.width`."].join(" ")}),dash:ec({},Eh,{description:[Eh.description,"Note that this style setting can also be set per","direction via `increasing.line.dash` and","`decreasing.line.dash`."].join(" ")}),editType:"style"},increasing:f1(l7),decreasing:f1(s7),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:ec({},o7.hoverlabel,{split:{valType:"boolean",dflt:!1,editType:"style",description:["Show hover information (open, close, high, low) in","separate labels."].join(" ")}}),zorder:Pl.zorder},f7=Je,c7=be,u7=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=f7.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,c7.minRowLength(n))),r._length=u,u}},v7=be,d7=u7,h7=Tu,p7=wM,m7=function(e,r,a,i){function n(l,s){return v7.coerce(e,r,p7,l,s)}var o=d7(e,r,n,i);if(!o){r.visible=!1;return}h7(e,r,i,n,{x:!0}),n("xhoverformat"),n("yhoverformat"),n("line.width"),n("line.dash"),c1(e,r,n,"increasing"),c1(e,r,n,"decreasing"),n("text"),n("hovertext"),n("tickwidth"),i._requestRangeslider[r.xaxis]=!0,n("zorder")};function c1(t,e,r,a){r(a+".line.color"),r(a+".line.width",e.line.width),r(a+".line.dash",e.line.dash)}var To=be,Lf=To._,tc=Ct,y7=ku,Tl=Wt.BADNUM;function g7(t,e){var r=tc.getFromId(t,e.xaxis),a=tc.getFromId(t,e.yaxis),i=x7(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=TM(t,e,o,l,a,b7);return e._extremes[r._id]=tc.findExtremes(r,l,{vpad:n/2}),s.length?(To.extendFlat(s[0].t,{wHover:n/2,tickLen:i}),s):[{t:{empty:!0}}]}function b7(t,e,r,a){return{o:t,h:e,l:r,c:a}}function TM(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=To.isArrayOrTypedArray(e.text),u=To.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]=tc.findExtremes(i,To.concat(s,l),{padded:!0}),h.length&&(h[0].t={labels:{open:Lf(t,"open:")+" ",high:Lf(t,"high:")+" ",low:Lf(t,"low:")+" ",close:Lf(t,"close:")+" "}}),h}function x7(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=y7(r,e,"x",s).vals;l._xcalc=f;var c=To.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 _7={calc:g7,calcCommon:TM},w7=ut,u1=be,T7=function(e,r,a,i){var n=r.yaxis,o=r.xaxis,l=!!o.rangebreaks;u1.makeTraceGroups(i,a,"trace ohlc").each(function(s){var f=w7.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(u1.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})})},Td=ut,k7=kt,A7=ct,M7=function(e,r,a){var i=a||Td.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;Td.select(this).selectAll("path").each(function(l){if(!l.empty){var s=o[l.dir].line;Td.select(this).style("fill","none").call(A7.stroke,s.color).call(k7.dashLine,s.dash,s.width).style("opacity",o.selectedpoints&&!l.selected?.3:1)}})})},zh=Ct,S7=be,Cf=Ta,L7=ct,C7=be.fillText,v1=xM,D7={increasing:v1.INCREASING.SYMBOL,decreasing:v1.DECREASING.SYMBOL};function $7(t,e,r,a){var i=t.cd,n=i[0].trace;return n.hoverlabel.split?AM(t,e,r,a):MM(t,e,r,a)}function kM(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 Cf.inbox(L-m,L+m,u)}function _(S){var L=S[f],E=S[c];return L===E||Cf.inbox(L-r,E-r,u)}function g(S){return(b(S)+_(S))/2}var x=Cf.getDistanceFunction(a,b,_,g);if(Cf.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 L7.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 AM(t,e,r,a){var i=t.cd,n=t.ya,o=i[0].trace,l=i[0].t,s=[],f=kM(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[_]+zh.hoverLabelText(n,g,o.yhoverformat)):(w=S7.extendFlat({},f),w.y0=w.y1=x,w.yLabelVal=g,w.yLabel=l.labels[_]+zh.hoverLabelText(n,g,o.yhoverformat),w.name="",s.push(w),y[g]=w)}return s}function MM(t,e,r,a){var i=t.cd,n=t.ya,o=i[0].trace,l=i[0].t,s=kM(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]+zh.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")+" "+D7[v]]:[];return b&&C7(c,o,_),s.extraText=_.join("<br>"),s.y0=s.y1=n.c2p(c.yc,!0),[s]}var P7={hoverPoints:$7,hoverSplit:AM,hoverOnPoints:MM},E7=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},z7={moduleType:"trace",name:"ohlc",basePlotModule:Qt,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:wM,supplyDefaults:m7,calc:_7.calc,plot:T7,style:M7,hoverPoints:P7.hoverPoints,selectPoints:E7},R7=z7;const _9=Si(R7);var I7=Je,Or=be,F7=Lk;function N7(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]:[SM(t,f,c,o)]}function SM(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=Or.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=Or.isArrayOrTypedArray(c.size)?c.size[s]:c.size,f.tc=Or.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=Or.isArrayOrTypedArray(u.size)?u.size[s]:u.size,f.mo=Or.isArrayOrTypedArray(u.opacity)?u.opacity[s]:u.opacity,f.mx=Or.isArrayOrTypedArray(u.symbol)?u.symbol[s]:u.symbol,f.ma=Or.isArrayOrTypedArray(u.angle)?u.angle[s]:u.angle,f.mc=Or.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=Or.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=Or.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=Or.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=Or.extendFlat({},t,{color:F7(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),Or.fillText(f,a,T),I7.getComponentMethod("errorbars","hoverInfo")(f,a,T),T}var H7={hoverPoints:N7,calcHover:SM},LM={exports:{}},d1=20,$u={TOO_MANY_POINTS:1e5,SYMBOL_SDF_SIZE:200,SYMBOL_SIZE:d1,SYMBOL_STROKE:d1/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]}},O7=la,j7=fr,B7=O2,Ot=zi,h1=Wo.axisHoverFormat,p1=Ln,G7=Jh,kd=Et.extendFlat,U7=Na.overrideAll,V7=$u.DASHES,m1=Ot.line,Za=Ot.marker,W7=Za.line,yo=LM.exports=U7({x:Ot.x,x0:Ot.x0,dx:Ot.dx,y:Ot.y,y0:Ot.y0,dy:Ot.dy,xperiod:Ot.xperiod,yperiod:Ot.yperiod,xperiod0:Ot.xperiod0,yperiod0:Ot.yperiod0,xperiodalignment:Ot.xperiodalignment,yperiodalignment:Ot.yperiodalignment,xhoverformat:h1("x"),yhoverformat:h1("y"),text:Ot.text,hovertext:Ot.hovertext,textposition:Ot.textposition,textfont:j7({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:m1.color,width:m1.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:G7(V7),dflt:"solid",description:"Sets the style of the lines."}},marker:kd({},p1("marker"),{symbol:Za.symbol,angle:Za.angle,size:Za.size,sizeref:Za.sizeref,sizemin:Za.sizemin,sizemode:Za.sizemode,opacity:Za.opacity,colorbar:Za.colorbar,line:kd({},p1("marker.line"),{width:W7.width})}),connectgaps:Ot.connectgaps,fill:kd({},Ot.fill,{dflt:"none"}),fillcolor:B7(),selected:{marker:Ot.selected.marker,textfont:Ot.selected.textfont},unselected:{marker:Ot.unselected.marker,textfont:Ot.unselected.textfont},opacity:O7.opacity},"calc","nested");yo.x.editType=yo.y.editType=yo.x0.editType=yo.y0.editType="calc+clearAxisTypes";yo.hovertemplate=Ot.hovertemplate;yo.texttemplate=Ot.texttemplate;var CM=LM.exports,Pu={},DM=$u;Pu.isOpenSymbol=function(t){return typeof t=="string"?DM.OPEN_RE.test(t):t%200>100};Pu.isDotSymbol=function(t){return typeof t=="string"?DM.DOT_RE.test(t):t>200};var y1=be,X7=Je,Y7=Pu,q7=CM,Z7=_u,Df=kr,K7=em,Q7=Tu,J7=sk,ej=fk,tj=uk,rj=ck,aj=function(e,r,a,i){function n(p,d){return y1.coerce(e,r,q7,p,d)}var o=e.marker?Y7.isOpenSymbol(e.marker.symbol):!1,l=Df.isBubble(e),s=K7(e,r,i,n);if(!s){r.visible=!1;return}Q7(e,r,i,n),n("xhoverformat"),n("yhoverformat");var f=s<Z7.PTS_LINESONLY?"lines+markers":"lines";n("text"),n("hovertext"),n("hovertemplate"),n("mode",f),Df.hasMarkers(r)&&(J7(e,r,a,i,n,{noAngleRef:!0,noStandOff:!0}),n("marker.line.width",o||l?1:0)),Df.hasLines(r)&&(n("connectgaps"),ej(e,r,a,i,n),n("line.shape")),Df.hasText(r)&&(n("texttemplate"),rj(e,r,i,n,{noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}));var c=(r.line||{}).color,u=(r.marker||{}).color;n("fill"),r.fill!=="none"&&tj(e,r,a,n);var v=X7.getComponentMethod("errorbars","supplyDefaults");v(e,r,c||u||a,{axis:"y"}),v(e,r,c||u||a,{axis:"x",inherit:"y"}),y1.coerceSelectionMarkerOpacity(r,n)},ij=Sk,nj=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]),ij(e,r,a)},$M=ht,oj=oa,Fc=v_,Nc=Mo,lj=Tr.defaultLine,g1=Vt.isArrayOrTypedArray,Rh=Fc(lj),PM=1;function b1(t,e){var r=t;return r[3]*=e,r}function x1(t){if($M(t))return Rh;var e=Fc(t);return e.length?e:Rh}function _1(t){return $M(t)?t:PM}function sj(t,e,r){var a=t.color;a&&a._inputArray&&(a=a._inputArray);var i=g1(a),n=g1(e),o=Nc.extractOpts(t),l=[],s,f,c,u,v;if(o.colorscale!==void 0?s=Nc.makeColorScaleFuncFromTrace(t):s=x1,i?f=function(d,h){return d[h]===void 0?Rh:Fc(s(d[h]))}:f=x1,n?c=function(d,h){return d[h]===void 0?PM:_1(d[h])}:c=_1,i||n)for(var p=0;p<r;p++)u=f(a,p),v=c(e,p),l[p]=b1(u,v);else l=b1(Fc(a),e);return l}function fj(t){var e=Nc.extractOpts(t),r=e.colorscale;return e.reversescale&&(r=Nc.flipScale(e.colorscale)),r.map(function(a){var i=a[0],n=oj(a[1]),o=n.toRgb();return{index:i,rgb:[o.r,o.g,o.b,o.a]}})}var cj={formatColor:sj,parseColorScale:fj},rc=ht,uj=nS,$f=v_,vj=Je,Fo=be,Ut=Fo.isArrayOrTypedArray,lo=kt,w1=Xt,T1=cj.formatColor,ko=kr,dj=Uw,Ih=Pu,Ss=$u,hj=ds.DESELECTDIM,k1={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},pj=sa.appendArrayPointValue;function mj(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(ko.hasText(e)&&(a.text=EM(t,e),a.textSel=M1(t,e,e.selected),a.textUnsel=M1(t,e,e.unselected)),ko.hasMarkers(e)&&(a.marker=Am(t,e),a.markerSel=Fh(t,e,e.selected),a.markerUnsel=Fh(t,e,e.unselected),!e.unselected&&Ut(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]=hj*n[r]}if(ko.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=S1(e,e.error_x,i)),e.error_y&&e.error_y.visible&&(a.errorY=S1(e,e.error_y,i)),e.fill&&e.fill!=="none"&&(a.fill={closed:!0,fill:e.fillcolor,thickness:0}),a}function EM(t,e){var r=t._fullLayout,a=e._length,i=e.textfont,n=e.textposition,o=Ut(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={};pj(T,e,d);var A=e._meta||{};p.text.push(Fo.texttemplateString(g(d),w,y,T,x,A))}}else Ut(e.text)&&e.text.length<a?p.text=e.text.slice():p.text=e.text;if(Ut(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(Ut(l))for(p.color=new Array(a),d=0;d<a;d++)p.color[d]=l[d];else p.color=l;if(Ut(s)||Array.isArray(f)||Ut(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=(Fo.isTypedArray(s)?s[d]:Ut(s)?rc(s[d])?s[d]:0:s)*h,S.family=Array.isArray(f)?f[d]:f,S.weight=A1(Ut(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:A1(c),style:u,variant:v};return p}function A1(t){return t<=1e3?t>500?"bold":"normal":t}function Am(t,e){var r=e._length,a=e.marker,i={},n,o=Ut(a.symbol),l=Ut(a.angle),s=Ut(a.color),f=Ut(a.line.color),c=Ut(a.opacity),u=Ut(a.size),v=Ut(a.line.width),p;if(o||(p=Ih.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=T1(a,a.opacity,r),y=T1(a.line,a.opacity,r);if(!Ut(y[0])){var b=y;for(y=Array(r),n=0;n<r;n++)y[n]=b}if(!Ut(m[0])){var _=m;for(m=Array(r),n=0;n<r;n++)m[n]=_}if(!Ut(d)){var g=d;for(d=Array(r),n=0;n<r;n++)d[n]=g}if(!Ut(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=Ih.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]=D1({mx:i.symbols[n],ma:i.angles[n]},e)}else p?(i.color=$f(a.color,"uint8"),i.color[3]=0,i.borderColor=$f(a.color,"uint8")):(i.color=$f(a.color,"uint8"),i.borderColor=$f(a.line.color,"uint8")),i.opacity=e.opacity*a.opacity,i.marker=D1({mx:a.symbol,ma:a.angle},e);var w=1,T=dj(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 Fh(t,e,r){var a=e.marker,i={};return r&&(r.marker&&r.marker.symbol?i=Am(t,Fo.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 M1(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:Fo.extendFlat({},e.textfont)};r.textfont&&Fo.extendFlat(i.textfont,r.textfont),a=EM(t,i)}return a}function S1(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 L1=Ss.SYMBOL_SDF_SIZE,en=Ss.SYMBOL_SIZE,C1=Ss.SYMBOL_STROKE,Ad={},yj=lo.symbolFuncs[0](en*.05);function D1(t,e){var r=t.mx;if(r==="circle")return null;var a,i,n=lo.symbolNumber(r),o=lo.symbolFuncs[n%100],l=!!lo.symbolNoDot[n%100],s=!!lo.symbolNoFill[n%100],f=Ih.isDotSymbol(r);if(t.ma&&(r+="_"+t.ma),Ad[r])return Ad[r];var c=lo.getMarkerAngle(t,e);return f&&!l?a=o(en*1.1,c)+yj:a=o(en,c),i=uj(a,{w:L1,h:L1,viewBox:[-en,-en,en,en],stroke:s?C1:-C1}),Ad[r]=i,i||null}function gj(t,e,r){var a=r.length,i=a/2,n,o;if(ko.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||ko.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 bj(t,e,r,a,i){var n=vj.getComponentMethod("errorbars","makeComputeError"),o=w1.getFromId(t,e.xaxis,"x"),l=w1.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(rc(T)){var A=r[x*2+m],M=h(T,x),S=M[0],L=M[1];if(rc(S)&&rc(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 xj(t,e,r,a){var i=e._length,n={},o;if(ko.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=Ut(l)?l[o].size:l.size,v=Ut(s)?s.length>1?s[o]:s[0]:s,p=Ut(f)?f.length>1?f[o]:f[0]:f,d=k1[v],h=k1[p],m=c?c/.8+1:0,y=-h*m-h*.5;n.offset[o]=[d*m/u,y/u]}}return n}var _j={style:mj,markerStyle:Am,markerSelection:Fh,linePositions:gj,errorBarPositions:bj,textPosition:xj},Pf=be,wj=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(){Pf.extendFlat(a,n,i)},a.init(),a.update=function(l){var s=Pf.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=Pf.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||Pf.extendFlat(a,i),a},Tj=oS,Jn=be,$1=Xt,kj=gs.findExtremes,P1=ku,Mm=am,Aj=Mm.calcMarkerSize,Mj=Mm.calcAxisExpansion,Sj=Mm.setFirstScatter,Lj=hk,eo=_j,Cj=wj,E1=Wt.BADNUM,Dj=$u.TOO_MANY_POINTS,$j=function(e,r){var a=e._fullLayout,i=r._xA=$1.getFromId(e,r.xaxis,"x"),n=r._yA=$1.getFromId(e,r.yaxis,"y"),o=a._plots[r.xaxis+r.yaxis],l=r._length,s=l>=Dj,f=l*2,c={},u,v=i.makeCalcdata(r,"x"),p=n.makeCalcdata(r,"y"),d=P1(r,i,"x",v),h=P1(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]===E1?NaN:m[u],b[u*2+1]=y[u]===E1?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=Tj(b):c.ids=_,Lj(e,r);var g=Pj(e,o,r,b,m,y),x=Cj(e,o);Sj(a,r);var w;return s?g.marker&&(w=g.marker.sizeAvg||Math.max(g.marker.size,3)):w=Aj(r,l),Mj(e,r,i,n,m,y,w),g.errorX&&z1(r,i,g.errorX),g.errorY&&z1(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 z1(t,e,r){var a=t._extremes[e._id],i=kj(e,r._bnds,{padded:!0});a.min=a.min.concat(i.min),a.max=a.max.concat(i.max)}function Pj(t,e,r,a,i,n){var o=eo.style(t,r);if(o.marker&&(o.marker.positions=a),o.line&&a.length>1&&Jn.extendFlat(o.line,eo.linePositions(t,r,a)),o.errorX||o.errorY){var l=eo.errorBarPositions(t,r,a,i,n);o.errorX&&Jn.extendFlat(o.errorX,l.x),o.errorY&&Jn.extendFlat(o.errorY,l.y)}return o.text&&(Jn.extendFlat(o.text,{positions:a},eo.textPosition(t,r,o.text,o.marker)),Jn.extendFlat(o.textSel,{positions:a},eo.textPosition(t,r,o.text,o.markerSel)),Jn.extendFlat(o.textUnsel,{positions:a},eo.textPosition(t,r,o.text,o.markerUnsel))),o}var R1=be,Ej=ct,zj=ds.DESELECTDIM;function Rj(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=R1.extendFlat({},s),v,p;if(o.length||l.length){var d=f.color,h=c.color,m=s.color,y=R1.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:Ej.addOpacity(b,zj))}}i.glText[n].update(u)}var zM={styleTextSelection:Rj},I1=kr,Ij=zM.styleTextSelection,Fj=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=I1.hasText(l),h=I1.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&&Ij(a),o},Nj=H7,Hj={moduleType:"trace",name:"scattergl",basePlotModule:Qt,categories:["gl","regl","cartesian","symbols","errorBarsOK","showLegend","scatter-like"],attributes:CM,supplyDefaults:aj,crossTraceDefaults:vk,colorbar:Ts,formatLabels:nj,calc:$j,hoverPoints:Nj.hoverPoints,selectPoints:Fj,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(" ")}},RM={exports:{}},F1=ct,Oj=function(){},jj=function(e){for(var r in e)typeof e[r]=="function"&&(e[r]=Oj);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=F1.defaults[0],a.style.position="absolute",a.style.left=a.style.top="0px",a.style.width=a.style.height="100%",a.style["background-color"]=F1.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},Bj=jj,Gj=lS,Uj=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=Gj({canvas:this,attributes:{antialias:!o.pick,preserveDrawingBuffer:!0},pixelRatio:e._context.plotGlPixelRatio||KM.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||Bj({container:i._glcontainer.node()}),n},N1=sS,H1=fS,Vj=cS,O1=uS,Md=be,Wj=Dn.selectMode,Xj=Uj,Yj=kr,qj=Ak,Zj=zM.styleTextSelection,IM={};function Kj(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 Qj=RM.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=Xj(e,["ANGLE_instanced_arrays","OES_element_index_uint"],IM);if(!c){n.init();return}var u=n.count,v=i._glcanvas.data()[0].regl;if(qj(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=Vj(v)),n.line2d===!0&&(n.line2d=H1(v)),n.scatter2d===!0&&(n.scatter2d=N1(v)),n.fill2d===!0&&(n.fill2d=H1(v)),n.glText===!0)for(n.glText=new Array(u),s=0;s<u;s++)n.glText[s]=new O1(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 O1(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 I=C.length-2;I>$&&(isNaN(C[I])||isNaN(C[I+1]));)I-=2;k.positions=C.slice($,I+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=Md.repeat(null,u),n.fill2d&&(n.fillOptions=n.fillOptions.map(function(k,C){var $=a[C];if(!(!k||!$||!$[0]||!$[0].trace)){var I=$[0],j=I.trace,G=I.t,X=n.lineOptions[C],O,q,W=[];j._ownfill&&W.push(C),j._nexttrace&&W.push(C+1),W.length&&(n.fillOrder[C]=W);var Y=[],B=X&&X.positions||G.positions,Q,ee;if(j.fill==="tozeroy"){for(Q=0;Q<B.length&&isNaN(B[Q+1]);)Q+=2;for(ee=B.length-2;ee>Q&&isNaN(B[ee+1]);)ee-=2;B[Q+1]!==0&&(Y=[B[Q],0]),Y=Y.concat(B.slice(Q,ee+2)),B[ee+1]!==0&&(Y=Y.concat([B[ee],0]))}else if(j.fill==="tozerox"){for(Q=0;Q<B.length&&isNaN(B[Q]);)Q+=2;for(ee=B.length-2;ee>Q&&isNaN(B[ee]);)ee-=2;B[Q]!==0&&(Y=[0,B[Q+1]]),Y=Y.concat(B.slice(Q,ee+2)),B[ee]!==0&&(Y=Y.concat([0,B[ee+1]]))}else if(j.fill==="toself"||j.fill==="tonext"){for(Y=[],O=0,k.splitNull=!0,q=0;q<B.length;q+=2)(isNaN(B[q])||isNaN(B[q+1]))&&(Y=Y.concat(B.slice(O,q)),Y.push(B[O],B[O+1]),Y.push(null,null),O=q+2);Y=Y.concat(B.slice(O)),O&&Y.push(B[O],B[O+1])}else{var fe=j._nexttrace;if(fe){var oe=n.lineOptions[C+1];if(oe){var se=oe.positions;if(j.fill==="tonexty"){for(Y=B.slice(),C=Math.floor(se.length/2);C--;){var de=se[C*2],ye=se[C*2+1];isNaN(de)||isNaN(ye)||Y.push(de,ye)}k.fill=fe.fillcolor}}}}if(j._prevtrace&&j._prevtrace.fill==="tonext"){var _e=n.lineOptions[C-1].positions,Se=Y.length/2;O=Se;var pe=[O];for(q=0;q<_e.length;q+=2)(isNaN(_e[q])||isNaN(_e[q+1]))&&(pe.push(q/2+Se+1),O=q+2);Y=Y.concat(_e),k.hole=pe}return k.fillmode=j.fill,k.opacity=j.opacity,k.positions=Y,k}}),n.fill2d.update(n.fillOptions))}var y=i.dragmode,b=Wj(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]=Md.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=N1(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||{};Yj.hasText(C)&&Zj(k)})}else n.scatter2d&&n.scatter2d.update(n.markerOptions);var D={viewport:Kj(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=Md.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)})}}};Qj.reglPrecompiled=IM;var Jj=RM.exports,FM=Hj;FM.plot=Jj;var eB=FM,tB=eB;const w9=Si(tB);var NM={};(function(t){var e=Kt;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)}})(NM);var HM={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"linear",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"]},rB=la,aB=yr.hovertemplateAttrs,iB=yr.texttemplateAttrs,nB=Ln,oB=Ri.attributes,Ya=Du,j1=HM,kl=Et.extendFlat,lB=Fr.pattern,sB={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({},Ya.marker.line.color,{dflt:null,description:["Sets the color of the line enclosing each sector.","Defaults to the `paper_bgcolor` value."].join(" ")}),width:kl({},Ya.marker.line.width,{dflt:1}),editType:"calc"},pattern:lB,editType:"calc"},nB("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:Ya.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:iB({editType:"plot"},{keys:j1.eventDataKeys.concat(["label","value"])}),hovertext:Ya.hovertext,hoverinfo:kl({},rB.hoverinfo,{flags:["label","text","value","name","current path","percent root","percent entry","percent parent"],dflt:"label+text+value+name"}),hovertemplate:aB({},{keys:j1.eventDataKeys}),textfont:Ya.textfont,insidetextorientation:Ya.insidetextorientation,insidetextfont:Ya.insidetextfont,outsidetextfont:kl({},Ya.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:Ya.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:oB({name:"sunburst",trace:!0,editType:"calc"})},Eu={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"poly",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"],gapWithPathbar:1},fB=yr.hovertemplateAttrs,cB=yr.texttemplateAttrs,uB=Ln,vB=Ri.attributes,Zi=Du,Zr=sB,B1=Eu,Sd=Et.extendFlat,dB=Fr.pattern,OM={labels:Zr.labels,parents:Zr.parents,values:Zr.values,branchvalues:Zr.branchvalues,count:Zr.count,level:Zr.level,maxdepth:Zr.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:Sd({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:Zr.marker.colors,pattern:dB,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:Zr.marker.line,cornerradius:{valType:"number",min:0,dflt:0,editType:"plot",description:["Sets the maximum rounding of corners (in px)."].join(" ")},editType:"calc"},uB("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:Sd({},Zi.textfont,{description:"Sets the font used inside `pathbar`."}),editType:"calc"},text:Zi.text,textinfo:Zr.textinfo,texttemplate:cB({editType:"plot"},{keys:B1.eventDataKeys.concat(["label","value"])}),hovertext:Zi.hovertext,hoverinfo:Zr.hoverinfo,hovertemplate:fB({},{keys:B1.eventDataKeys}),textfont:Zi.textfont,insidetextfont:Zi.insidetextfont,outsidetextfont:Sd({},Zi.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:Zi.sort,root:Zr.root,domain:vB({name:"treemap",trace:!0,editType:"calc"})},jM={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(" ")}},G1=be,hB=OM,pB=ct,mB=Ri.defaults,yB=_n.handleText,gB=As.TEXTPAD,bB=JA.handleMarkerDefaults,BM=Mo,xB=BM.hasColorscale,_B=BM.handleDefaults,wB=function(e,r,a,i){function n(m,y){return G1.coerce(e,r,hB,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",G1.isArrayOrTypedArray(c)?"text+label":"label"),n("hovertext"),n("hovertemplate");var u=n("pathbar.visible"),v="auto";yB(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;bB(e,r,i,n);var d=r._hasColorscale=xB(e,"marker","colors")||(e.marker||{}).coloraxis;d?_B(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:pB.contrast(i.paper_bgcolor)}}},u&&(n("pathbar.thickness",r.pathbar.textfont.size+2*gB),n("pathbar.side"),n("pathbar.edgeshape")),n("sort"),n("root.color"),mB(r,i,n),r._length=null},TB=be,kB=jM,AB=function(e,r){function a(i,n){return TB.coerce(e,r,kB,i,n)}a("treemapcolorway",r.colorway),a("extendtreemapcolors")},Hc={},GM={};(function(t){var e=Hh,r=ht,a=be,i=Mo.makeColorScaleFuncFromTrace,n=Rc.makePullColorFn,o=Rc.generateExtendedColors,l=Mo.calc,s=Wt.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,Q){T[B]?T[B].push(Q):T[B]=[Q],A[Q]=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(),I=0;I<w.length;I++)w[I].pid===""&&(w[I].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),X=!1;if(x)switch(d.branchvalues){case"remainder":G.sum(function(B){return B.data.v});break;case"total":G.each(function(B){var Q=B.data.data,ee=Q.v;if(B.children){var fe=B.children.reduce(function(oe,se){return oe+se.data.data.v},0);if((Q.hasImpliedRoot||Q.hasMultipleRoots)&&(ee=fe),ee<fe*s)return X=!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 =`,ee,`
6
- children sum =`,fe].join(" "))}B.value=ee});break}else v(G,d,{branches:d.count.indexOf("branches")!==-1,leaves:d.count.indexOf("leaves")!==-1});if(!X){d.sort&&G.sort(function(B,Q){return Q.value-B.value});var O,q,W=d.marker.colors||[],Y=!!W.length;return d._hasColorscale?(Y||(W=x?d.values:d._values),l(p,d,{vals:W,containerStr:"marker",cLetter:"c"}),q=i(d.marker)):O=n(h["_"+d.type+"colormap"]),G.each(function(B){var Q=B.data.data;Q.color=d._hasColorscale?q(W[Q.i]):O(W[Q.i],Q.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 UM=GM;Hc.calc=function(t,e){return UM.calc(t,e)};Hc.crossTraceCalc=function(t){return UM._runCrossTraceCalc("treemap",t)};var Ii={};(function(t){var e=be,r=ct,a=$i,i=Cn;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}})(Ii);var MB=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)},so=Hh,SB=MB,VM=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=so.treemap().tile(LB(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)&&SB(v,r,{swapXY:o,flipX:i,flipY:n}),v};function LB(t,e){switch(t){case"squarify":return so.treemapSquarify.ratio(e);case"binary":return so.treemapBinary;case"dice":return so.treemapDice;case"slice":return so.treemapSlice;default:return so.treemapSliceDice}}var CB=kt,DB=ct,WM=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),CB.pointStyle(e,a,i,r)}else DB.fill(e,s)},U1=ut,to=ct,V1=be,Ld=Ii,$B=ai.resizeText,PB=WM;function EB(t){var e=t._fullLayout._treemaplayer.selectAll(".trace");$B(t,e,"treemap"),e.each(function(r){var a=U1.select(this),i=r[0],n=i.trace;a.style("opacity",n.opacity),a.selectAll("path.surface").each(function(o){U1.select(this).call(XM,o,n,t,{hovered:!1})})})}function XM(t,e,r,a,i){var n=(i||{}).hovered,o=e.data.data,l=o.i,s,f,c=o.color,u=Ld.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=V1.castOption(r,l,"marker.line.color")||to.defaultLine,f=V1.castOption(r,l,"marker.line.width")||0,!r._hasColorscale&&!e.onPathbar){var p=r.marker.depthfade;if(p){var d=to.combine(to.addOpacity(r._backgroundColor,.75),c),h;if(p===!0){var m=Ld.getMaxDepth(r);isFinite(m)?Ld.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=to.combine(to.addOpacity(d,b),c)}}}t.call(PB,e,r,a,c).style("stroke-width",f).call(to.stroke,s).style("opacity",v)}var Sm={style:EB,styleOne:XM},ro=ut,W1=Je,zB=sa.appendArrayPointValue,Al=Ta,X1=be,RB=ps,Jt=Ii,IB=Cn,FB=IB.formatPieValue,Lm=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,_=Jt.isHierarchyRoot(d),g=Jt.getParent(s,d),x=Jt.getValue(d),w=function(j){return X1.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=FB(F.value,M),H("value")&&z.push(F.valueLabel)),F.currentPath=d.currentPath=Jt.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/Jt.getValue(g),F.parent=d.parentString=Jt.getPtLabel(g),H("percent parent")&&(D=Jt.formatPercent(F.percentParent,M)+" of "+F.parent,k()),F.percentEntry=d.percentEntry=x/Jt.getValue(r),F.entry=d.entry=Jt.getPtLabel(r),H("percent entry")&&!_&&!d.onPathbar&&(D=Jt.formatPercent(F.percentEntry,M)+" of "+F.entry,k()),F.percentRoot=d.percentRoot=x/Jt.getValue(s),F.root=d.root=Jt.getPtLabel(s),H("percent root")&&!_&&(D=Jt.formatPercent(F.percentRoot,M)+" of "+F.root,k()),F.text=w("hovertext")||w("text"),H("text")&&(D=F.text,X1.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 I=e.select("path.surface");n.styleOne(I,d,m,a,{hovered:!0})}l._hasHoverEvent=!0,a.emit("plotly_hover",{points:S||[Ml(d,m,n.eventDataKeys)],event:ro.event})}},v=function(d){var h=a._fullLayout,m=a._fullData[l.index],y=ro.select(this).datum();if(l._hasHoverEvent&&(d.originalEvent=ro.event,a.emit("plotly_unhover",{points:[Ml(y,m,n.eventDataKeys)],event:ro.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&&(Jt.isHierarchyRoot(d)||Jt.isLeaf(d)),b=Jt.getPtId(d),_=Jt.isEntry(d)?Jt.findEntryWithChild(s,b):Jt.findEntryWithLevel(s,b),g=Jt.getPtId(_),x={points:[Ml(d,m,n.eventDataKeys)],event:ro.event};y||(x.nextLevel=g);var w=RB.triggerHandler(a,"plotly_"+l.type+"click",x);if(w!==!1&&h.hovermode&&(a._hoverdata=[Ml(d,m,n.eventDataKeys)],Al.click(a,ro.event)),!y&&w!==!1&&!a._dragging&&!a._transitioning){W1.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()),W1.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&&!Jt.isHierarchyRoot(t)&&(i.parent=t.parentString),zB(i,e,a.i),i}var Y1=ut,Ef=be,q1=kt,NB=or,HB=VM,Z1=Sm.styleOne,Cd=Eu,ao=Ii,OB=Lm,Dd=!0,jB=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=ao.listPath(a.data,"id"),S=HB(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,ao.getPtId),i.enter().append("g").classed("pathbar",!0),h(i,Dd,b,[l,s],u),i.order();var L=i;d&&(L=L.transition().each("end",function(){var E=Y1.select(this);ao.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=Y1.select(this),N=Ef.ensureSingle(F,"path","surface",function(P){P.style("pointer-events",_?"none":"all")});d?N.transition().attrTween("d",function(P){var k=m(P,Dd,b,[l,s]);return function(C){return u(k(C))}}):N.attr("d",u),F.call(OB,a,e,r,{styleOne:Z1,eventDataKeys:Cd.eventDataKeys,transitionTime:Cd.CLICK_TRANSITION_TIME,transitionEasing:Cd.CLICK_TRANSITION_EASING}).call(ao.setSliceCursor,e,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:e._transitioning}),N.call(Z1,E,w,e,{hovered:!1}),E._text=(ao.getPtLabel(E)||"").split("<br>").join(" ")||"";var z=Ef.ensureSingle(F,"g","slicetext"),H=Ef.ensureSingle(z,"text","",function(P){P.attr("data-notex",1)}),D=Ef.ensureUniformFontSize(e,ao.determineTextFont(w,E,g.font,{onPathbar:!0}));H.text(E._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(q1.font,D).call(NB.convertToTspans,e),E.textBB=q1.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,Dd,b,[l,s]);return function(C){return p(k(C))}}):H.attr("transform",p(E))})},K1=ut,$d=d_.interpolate,yi=Ii,Sl=be,Q1=As.TEXTPAD,BB=Tm,GB=BB.toMoveInsideBar,UB=ai,Pd=UB.recordMinTextSize,VB=Eu,WB=jB;function Ki(t){return yi.isHierarchyRoot(t)?"":yi.getPtId(t)}var XB=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=yi.findEntryWithLevel(u,s.level),p=K1.select(a),d=p.selectAll("g.pathbar"),h=p.selectAll("g.slice");if(!v){d.remove(),h.remove();return}var m=yi.isHierarchyRoot(v),y=!o.uniformtext.mode&&yi.hasTransition(i),b=yi.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+VB.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,xe,Z){var ke=s.tiling.pad,Te=function(he){return he-ke<=xe.x0},le=function(he){return he+ke>=xe.x1},ie=function(he){return he-ke<=xe.y0},me=function(he){return he+ke>=xe.y1};return J.x0===xe.x0&&J.x1===xe.x1&&J.y0===xe.y0&&J.y1===xe.y1?{x0:J.x0,x1:J.x1,y0:J.y0,y1:J.y1}:{x0:Te(J.x0-ke)?0:le(J.x0-ke)?Z[0]:J.x0,x1:Te(J.x1+ke)?0:le(J.x1+ke)?Z[0]:J.x1,y0:ie(J.y0-ke)?0:me(J.y0-ke)?Z[1]:J.y0,y1:ie(J.y1+ke)?0:me(J.y1+ke)?Z[1]:J.y1}},N=null,z={},H={},D=null,P=function(J,xe){return xe?z[Ki(J)]:H[Ki(J)]},k=function(J,xe,Z,ke){if(xe)return z[Ki(u)]||E;var Te=H[s.level]||Z;return _(J)?F(J,Te,ke):{}};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),I=function(J){return C+J},j=function(J){return $+J},G=j(0),X=I(0),O=function(J){return X+J},q=function(J){return G+J};function W(J,xe){return J+","+xe}var Y=O(0),B=function(J){J.x=Math.max(Y,J.x)},Q=s.pathbar.edgeshape,ee=function(J){var xe=O(Math.max(Math.min(J.x0,J.x0),0)),Z=O(Math.min(Math.max(J.x1,J.x1),A)),ke=q(J.y0),Te=q(J.y1),le=M/2,ie={},me={};ie.x=xe,me.x=Z,ie.y=me.y=(ke+Te)/2;var he={x:xe,y:ke},Ae={x:Z,y:ke},we={x:Z,y:Te},De={x:xe,y:Te};return Q===">"?(he.x-=le,Ae.x-=le,we.x-=le,De.x-=le):Q==="/"?(we.x-=le,De.x-=le,ie.x-=le/2,me.x-=le/2):Q==="\\"?(he.x-=le,Ae.x-=le,ie.x-=le/2,me.x-=le/2):Q==="<"&&(ie.x-=le,me.x-=le),B(he),B(De),B(ie),B(Ae),B(we),B(me),"M"+W(he.x,he.y)+"L"+W(Ae.x,Ae.y)+"L"+W(me.x,me.y)+"L"+W(we.x,we.y)+"L"+W(De.x,De.y)+"L"+W(ie.x,ie.y)+"Z"},fe=s[c?"tiling":"marker"].pad,oe=function(J){return s.textposition.indexOf(J)!==-1},se=oe("top"),de=oe("left"),ye=oe("right"),_e=oe("bottom"),Se=function(J){var xe=I(J.x0),Z=I(J.x1),ke=j(J.y0),Te=j(J.y1),le=Z-xe,ie=Te-ke;if(!le||!ie)return"";var me=s.marker.cornerradius||0,he=Math.min(me,le/2,ie/2);he&&J.data&&J.data.data&&J.data.data.label&&(se&&(he=Math.min(he,fe.t)),de&&(he=Math.min(he,fe.l)),ye&&(he=Math.min(he,fe.r)),_e&&(he=Math.min(he,fe.b)));var Ae=function(we,De){return he?"a"+W(he,he)+" 0 0 1 "+W(we,De):""};return"M"+W(xe,ke+he)+Ae(he,-he)+"L"+W(Z-he,ke)+Ae(he,he)+"L"+W(Z,Te-he)+Ae(-he,he)+"L"+W(xe+he,Te)+Ae(-he,-he)+"Z"},pe=function(J,xe){var Z=J.x0,ke=J.x1,Te=J.y0,le=J.y1,ie=J.textBB,me=se||xe.isHeader&&!_e,he=me?"start":_e?"end":"middle",Ae=oe("right"),we=oe("left")||xe.onPathbar,De=we?-1:Ae?1:0;if(xe.isHeader){if(Z+=(c?fe:fe.l)-Q1,ke-=(c?fe:fe.r)-Q1,Z>=ke){var Ie=(Z+ke)/2;Z=Ie,ke=Ie}var Ge;_e?(Ge=le-(c?fe:fe.b),Te<Ge&&Ge<le&&(Te=Ge)):(Ge=Te+(c?fe:fe.t),Te<Ge&&Ge<le&&(le=Ge))}var ue=GB(Z,ke,Te,le,ie,{isHorizontal:!1,constrained:!0,angle:0,anchor:he,leftToRight:De});return ue.fontSize=xe.fontSize,ue.targetX=I(ue.targetX),ue.targetY=j(ue.targetY),isNaN(ue.targetX)||isNaN(ue.targetY)?{}:(Z!==ke&&Te!==le&&Pd(s.type,ue,o),{scale:ue.scale,rotate:ue.rotate,textX:ue.textX,textY:ue.textY,anchorX:ue.anchorX,anchorY:ue.anchorY,targetX:ue.targetX,targetY:ue.targetY})},ve=function(J,xe){for(var Z,ke=0,Te=J;!Z&&ke<b;)ke++,Te=Te.parent,Te?Z=P(Te,xe):ke=b;return Z||{}},Me=function(J,xe,Z,ke){var Te=P(J,xe),le;if(xe)le=E;else{var ie=P(v,xe);ie?le=F(J,ie,ke):le={}}return $d(Te,le)},Pe=function(J,xe,Z,ke,Te){var le=P(J,xe),ie;if(le)ie=le;else if(xe)ie=E;else if(N)if(J.parent){var me=D||Z;me&&!xe?ie=F(J,me,ke):(ie={},Sl.extendFlat(ie,ve(J,xe)))}else ie=Sl.extendFlat({},J),c&&(Te.orientation==="h"?Te.flipX?ie.x0=J.x1:ie.x1=0:Te.flipY?ie.y0=J.y1:ie.y1=0);else ie={};return $d(ie,{x0:J.x0,x1:J.x1,y0:J.y0,y1:J.y1})},ce=function(J,xe,Z,ke){var Te=P(J,xe),le={},ie=k(J,xe,Z,ke);Sl.extendFlat(le,{transform:pe({x0:ie.x0,x1:ie.x1,y0:ie.y0,y1:ie.y1,textBB:J.textBB,_text:J._text},{isHeader:yi.isHeader(J,s)})}),Te?le=Te:J.parent&&Sl.extendFlat(le,ve(J,xe));var me=J.transform;return J.x0!==J.x1&&J.y0!==J.y1&&Pd(s.type,me,o),$d(le,{transform:{scale:me.scale,rotate:me.rotate,textX:me.textX,textY:me.textY,anchorX:me.anchorX,anchorY:me.anchorY,targetX:me.targetX,targetY:me.targetY}})},Le=function(J,xe,Z,ke,Te){var le=ke[0],ie=ke[1];y?J.exit().transition().each(function(){var me=K1.select(this),he=me.select("path.surface");he.transition().attrTween("d",function(we){var De=Me(we,xe,Z,[le,ie]);return function(Ie){return Te(De(Ie))}});var Ae=me.select("g.slicetext");Ae.attr("opacity",0)}).remove():J.exit().remove()},Ce=function(J){var xe=J.transform;return J.x0!==J.x1&&J.y0!==J.y1&&Pd(s.type,xe,o),Sl.getTextTransform({textX:xe.textX,textY:xe.textY,anchorX:xe.anchorX,anchorY:xe.anchorY,targetX:xe.targetX,targetY:xe.targetY,scale:xe.scale,rotate:xe.rotate})};y&&(d.each(function(J){z[Ki(J)]={x0:J.x0,x1:J.x1,y0:J.y0,y1:J.y1},J.transform&&(z[Ki(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[Ki(J)]={x0:J.x0,x1:J.x1,y0:J.y0,y1:J.y1},J.transform&&(H[Ki(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&&yi.isEntry(J)&&(N=J)})),D=n(e,r,v,h,{width:w,height:T,viewX:I,viewY:j,pathSlice:Se,toMoveInsideSlice:pe,prevEntry:N,makeUpdateSliceInterpolator:Pe,makeUpdateTextInterpolator:ce,handleSlicesExit:Le,hasTransition:y,strTransform:Ce}),s.pathbar.visible?WB(e,r,v,d,{barDifY:L,width:A,height:M,viewX:O,viewY:q,pathSlice:ee,toMoveInsideSlice:pe,makeUpdateSliceInterpolator:Pe,makeUpdateTextInterpolator:ce,handleSlicesExit:Le,hasTransition:y,strTransform:Ce}):d.remove()},YB=ut,qB=Ii,ZB=ai,KB=ZB.clearMinTextSize,QB=wn.resizeText,J1=XB,JB=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(KB(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&&qB.hasTransition(a)){i&&(u=i());var p=YB.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){J1(e,d,this,a,l)})})}else c.each(function(d){J1(e,d,this,a,l)}),s.uniformtext.mode&&QB(e,f.selectAll(".trace"),o);v&&c.exit().remove()},YM={},e_=ut,t_=ct,r_=be,e9=ai.resizeText,t9=WM;function r9(t){var e=t._fullLayout._sunburstlayer.selectAll(".trace");e9(t,e,"sunburst"),e.each(function(r){var a=e_.select(this),i=r[0],n=i.trace;a.style("opacity",n.opacity),a.selectAll("path.surface").each(function(o){e_.select(this).call(qM,o,n,t)})})}function qM(t,e,r,a){var i=e.data.data,n=!e.children,o=i.i,l=r_.castOption(r,o,"marker.line.color")||t_.defaultLine,s=r_.castOption(r,o,"marker.line.width")||0;t.call(t9,e,r,a).style("stroke-width",s).call(t_.stroke,l).style("opacity",n?r.leaf.opacity:null)}var a9={style:r9,styleOne:qM};(function(t){var e=ut,r=Hh,a=d_.interpolate,i=kt,n=be,o=or,l=ai,s=l.recordMinTextSize,f=l.clearMinTextSize,c=gM,u=Cn.getRotationAngle,v=c.computeTransform,p=c.transformInsideText,d=a9.styleOne,h=wn.resizeText,m=Lm,y=HM,b=Ii;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),I=F._size,j=P.domain,G=I.w*(j.x[1]-j.x[0]),X=I.h*(j.y[1]-j.y[0]),O=.5*Math.min(G,X),q=D.cx=I.l+I.w*(j.x[1]+j.x[0])/2,W=D.cy=I.t+I.h*(1-j.y[0])-X/2;if(!C)return H.remove();var Y=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},!Y&&b.isEntry(Z)&&(Y=Z)});var Q=g(C).descendants(),ee=C.height+1,fe=0,oe=$;D.hasMultipleRoots&&b.isHierarchyRoot(C)&&(Q=Q.slice(1),ee-=1,fe=1,oe+=1),Q=Q.filter(function(Z){return Z.y1<=oe});var se=u(P.rotation);se&&Q.forEach(function(Z){Z.x0+=se,Z.x1+=se});var de=Math.min(ee,$),ye=function(Z){return(Z-fe)/de*O},_e=function(Z,ke){return[Z*Math.cos(ke),-Z*Math.sin(ke)]},Se=function(Z){return n.pathAnnulus(Z.rpx0,Z.rpx1,Z.x0,Z.x1,q,W)},pe=function(Z){return q+w(Z)[0]*(Z.transform.rCenter||0)+(Z.transform.x||0)},ve=function(Z){return W+w(Z)[1]*(Z.transform.rCenter||0)+(Z.transform.y||0)};H=H.data(Q,b.getPtId),H.enter().append("g").classed("slice",!0),N?H.exit().transition().each(function(){var Z=e.select(this),ke=Z.select("path.surface");ke.transition().attrTween("d",function(le){var ie=Le(le);return function(me){return Se(ie(me))}});var Te=Z.select("g.slicetext");Te.attr("opacity",0)}).remove():H.exit().remove(),H.order();var Me=null;if(N&&Y){var Pe=b.getPtId(Y);H.each(function(Z){Me===null&&b.getPtId(Z)===Pe&&(Me=Z.x1)})}var ce=H;N&&(ce=ce.transition().each("end",function(){var Z=e.select(this);b.setSliceCursor(Z,A,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:!1})})),ce.each(function(Z){var ke=e.select(this),Te=n.ensureSingle(ke,"path","surface",function(we){we.style("pointer-events",E?"none":"all")});Z.rpx0=ye(Z.y0),Z.rpx1=ye(Z.y1),Z.xmid=(Z.x0+Z.x1)/2,Z.pxmid=_e(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?Te.transition().attrTween("d",function(we){var De=Ce(we);return function(Ie){return Se(De(Ie))}}):Te.attr("d",Se),ke.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}),Te.call(d,Z,P,A);var le=n.ensureSingle(ke,"g","slicetext"),ie=n.ensureSingle(le,"text","",function(we){we.attr("data-notex",1)}),me=n.ensureUniformFontSize(A,b.determineTextFont(P,Z,F.font));ie.text(t.formatSliceLabel(Z,C,P,M,F)).classed("slicetext",!0).attr("text-anchor","middle").call(i.font,me).call(o.convertToTspans,A);var he=i.bBox(ie.node());Z.transform=p(he,Z,D),Z.transform.targetX=pe(Z),Z.transform.targetY=ve(Z);var Ae=function(we,De){var Ie=we.transform;return v(Ie,De),Ie.fontSize=me.size,s(P.type,Ie,F),n.getTextTransform(Ie)};N?ie.transition().attrTween("transform",function(we){var De=J(we);return function(Ie){return Ae(De(Ie),he)}}):ie.attr("transform",Ae(Z,he))});function Le(Z){var ke=b.getPtId(Z),Te=B[ke],le=B[b.getPtId(C)],ie;if(le){var me=(Z.x1>le.x1?2*Math.PI:0)+se;ie=Z.rpx1<le.rpx1?{x0:Z.x0,x1:Z.x1,rpx0:0,rpx1:0}:{x0:me,x1:me,rpx0:Z.rpx0,rpx1:Z.rpx1}}else{var he,Ae=b.getPtId(Z.parent);H.each(function(ue){if(b.getPtId(ue)===Ae)return he=ue});var we=he.children,De;we.forEach(function(ue,He){if(b.getPtId(ue)===ke)return De=He});var Ie=we.length,Ge=a(he.x0,he.x1);ie={rpx0:O,rpx1:O,x0:Ge(De/Ie),x1:Ge((De+1)/Ie)}}return a(Te,ie)}function Ce(Z){var ke=B[b.getPtId(Z)],Te,le={x0:Z.x0,x1:Z.x1,rpx0:Z.rpx0,rpx1:Z.rpx1};if(ke)Te=ke;else if(Y)if(Z.parent)if(Me){var ie=(Z.x1>Me?2*Math.PI:0)+se;Te={x0:ie,x1:ie}}else Te={rpx0:O,rpx1:O},n.extendFlat(Te,xe(Z));else Te={rpx0:0,rpx1:0};else Te={x0:se,x1:se};return a(Te,le)}function J(Z){var ke=B[b.getPtId(Z)],Te,le=Z.transform;if(ke)Te=ke;else if(Te={rpx1:Z.rpx1,transform:{textPosAngle:le.textPosAngle,scale:0,rotate:le.rotate,rCenter:le.rCenter,x:le.x,y:le.y}},Y)if(Z.parent)if(Me){var ie=Z.x1>Me?2*Math.PI:0;Te.x0=Te.x1=ie}else n.extendFlat(Te,xe(Z));else Te.x0=Te.x1=se;else Te.x0=Te.x1=se;var me=a(Te.transform.textPosAngle,Z.transform.textPosAngle),he=a(Te.rpx1,Z.rpx1),Ae=a(Te.x0,Z.x0),we=a(Te.x1,Z.x1),De=a(Te.transform.scale,le.scale),Ie=a(Te.transform.rotate,le.rotate),Ge=le.rCenter===0?3:Te.transform.rCenter===0?1/3:1,ue=a(Te.transform.rCenter,le.rCenter),He=function(je){return ue(Math.pow(je,Ge))};return function(je){var Fe=he(je),qe=Ae(je),Ne=we(je),R=He(je),U=_e(Fe,(qe+Ne)/2),V=me(je),K={pxmid:U,rpx1:Fe,transform:{textPosAngle:V,rCenter:R,x:le.x,y:le.y}};return s(P.type,le,F),{transform:{targetX:pe(K),targetY:ve(K),scale:De(je),rotate:Ie(je),rCenter:R}}}}function xe(Z){var ke=Z.parent,Te=B[b.getPtId(ke)],le={};if(Te){var ie=ke.children,me=ie.indexOf(Z),he=ie.length,Ae=a(Te.x0,Te.x1);le.x0=Ae(me/he),le.x1=Ae(me/he)}else le.x0=le.x1=0;return le}}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 I=N.split("+"),j=function(fe){return I.indexOf(fe)!==-1},G=[],X;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 q=O>1;if(O){var W,Y=function(fe){X=b.formatPercent(W,z),q&&(X+=" of "+fe),G.push(X)};j("percent parent")&&!k&&(W=$/b.getValue(C),Y("parent")),j("percent entry")&&(W=$/b.getValue(M),Y("entry")),j("percent root")&&(W=$/b.getValue(P),Y("root"))}}return j("text")&&(X=n.castOption(S,D.i,"text"),n.isValidTextValue(X)&&G.push(X)),G.join("<br>")}var B=n.castOption(S,D.i,"texttemplate");if(!B)return"";var Q={};D.label&&(Q.label=D.label),D.hasOwnProperty("v")&&(Q.value=D.v,Q.valueLabel=b.formatValue(D.v,z)),Q.currentPath=b.getPath(A.data),k||(Q.percentParent=$/b.getValue(C),Q.percentParentLabel=b.formatPercent(Q.percentParent,z),Q.parent=b.getPtLabel(C)),Q.percentEntry=$/b.getValue(M),Q.percentEntryLabel=b.formatPercent(Q.percentEntry,z),Q.entry=b.getPtLabel(M),Q.percentRoot=$/b.getValue(P),Q.percentRootLabel=b.formatPercent(Q.percentRoot,z),Q.root=b.getPtLabel(P),D.hasOwnProperty("color")&&(Q.color=D.color);var ee=n.castOption(S,D.i,"text");return(n.isValidTextValue(ee)||ee==="")&&(Q.text=ee),Q.customdata=n.castOption(S,D.i,"customdata"),n.texttemplateString(B,Q,E._d3locale,Q,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)]}})(YM);var a_=ut,zf=be,i_=kt,i9=or,n9=VM,n_=Sm.styleOne,Ed=Eu,vi=Ii,o9=Lm,l9=YM.formatSliceLabel,zd=!1,s9=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=n9(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,vi.getPtId),w._maxVisibleLayers=isFinite(N)?N-F+1:0,i.enter().append("g").classed("slice",!0),d(i,zd,b,[o,l],c),i.order();var z=null;if(p&&y){var H=vi.getPtId(y);i.each(function(k){z===null&&vi.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=a_.select(this);vi.setSliceCursor(k,e,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),P.each(function(k){var C=vi.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 $=a_.select(this),I=zf.ensureSingle($,"path","surface",function(W){W.style("pointer-events",_?"none":"all")});p?I.transition().attrTween("d",function(W){var Y=h(W,zd,D(),[o,l]);return function(B){return c(Y(B))}}):I.attr("d",c),$.call(o9,a,e,r,{styleOne:n_,eventDataKeys:Ed.eventDataKeys,transitionTime:Ed.CLICK_TRANSITION_TIME,transitionEasing:Ed.CLICK_TRANSITION_EASING}).call(vi.setSliceCursor,e,{isTransitioning:e._transitioning}),I.call(n_,k,w,e,{hovered:!1}),k.x0===k.x1||k.y0===k.y1?k._text="":C?k._text=S?"":vi.getPtLabel(k)||"":k._text=l9(k,a,w,r,g)||"";var j=zf.ensureSingle($,"g","slicetext"),G=zf.ensureSingle(j,"text","",function(W){W.attr("data-notex",1)}),X=zf.ensureUniformFontSize(e,vi.determineTextFont(w,k,g.font)),O=k._text||" ",q=C&&O.indexOf("<br>")===-1;G.text(O).classed("slicetext",!0).attr("text-anchor",A?"end":T||q?"start":"middle").call(i_.font,X).call(i9.convertToTspans,e),k.textBB=i_.bBox(G.node()),k.transform=u(k,{fontSize:X.size,isHeader:C}),k.transform.fontSize=X.size,p?G.transition().attrTween("transform",function(W){var Y=m(W,zd,D(),[o,l]);return function(B){return v(Y(B))}}):G.attr("transform",v(k))}),z},f9=JB,c9=s9,u9=function(e,r,a,i){return f9(e,r,a,i,{type:"treemap",drawDescendants:c9})},v9={moduleType:"trace",name:"treemap",basePlotModule:NM,categories:[],animatable:!0,attributes:OM,layoutAttributes:jM,supplyDefaults:wB,supplyLayoutDefaults:AB,calc:Hc.calc,crossTraceCalc:Hc.crossTraceCalc,plot:u9,style:Sm.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(" ")}},d9=v9;const T9=Si(d9);export{y9 as P,g9 as b,m9 as c,b9 as h,_9 as o,x9 as p,w9 as s,T9 as t};
7
- //# sourceMappingURL=plotly-DPMKRrOg.js.map