UNPKG

jsrootdi

Version:
2 lines 1.25 MB
// https://root.cern/js/ v7.6.101 !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).JSROOT=t.JSROOT||{})}(this,(function(t){"use strict";const e="dev 8/05/2024",i=!!("object"==typeof process&&qt(process.versions)&&process.versions.node&&process.versions.v8),n={id_counter:1},r="undefined"==typeof document&&"undefined"==typeof location?void 0:"undefined"==typeof document?location.href:document.currentScript&&document.currentScript.src||new URL("jsroot.js",document.baseURI).href;let s="";if(r&&Bt(r)){const t=r.indexOf("modules/core.mjs");t>=0?(s=r.slice(0,t),i||console.log(`Set jsroot source_dir to ${s}, ${e}`)):(i||console.log(`jsroot bundle, ${e}`),n.ignore_v6=!0)}let a=i;function o(){return a}function l(){return i}const h=l()?t=>Buffer.from(t,"base64").toString("latin1"):globalThis?.atob,c=l()?t=>Buffer.from(t,"latin1").toString("base64"):globalThis?.btoa,d={isFirefox:!0,isSafari:!1,isChrome:!1,isWin:!1,touches:!1,screenWidth:1200};function u(t){if(t.length<14||0!==t.indexOf("[object "))return 0;const e=t.indexOf("Array]");return e<0||e!==t.length-6?0:14===t.length?1:2}"undefined"!=typeof document&&"undefined"!=typeof window&&"undefined"!=typeof navigator&&(navigator.userAgentData?.brands?.forEach((t=>{"HeadlessChrome"===t.brand?(d.isChromeHeadless=!0,d.chromeVersion=parseInt(t.version)):"Chromium"===t.brand&&(d.isChrome=!0,d.chromeVersion=parseInt(t.version))})),d.chromeVersion?(d.isFirefox=!1,d.isWin="Windows"===navigator.userAgentData.platform):(d.isFirefox=navigator.userAgent.indexOf("Firefox")>=0,d.isSafari=Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>0,d.isChrome=!!window.chrome,d.isChromeHeadless=navigator.userAgent.indexOf("HeadlessChrome")>=0,d.chromeVersion=d.isChrome||d.isChromeHeadless?parseInt(navigator.userAgent.match(/Chrom(?:e|ium)\/([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)/)[1]):0,d.isWin=navigator.userAgent.indexOf("Windows")>=0),d.touches="ontouchend"in document,d.screenWidth=window.screen?.width??1200);const f={Render3D:{Default:0,WebGL:1,WebGLImage:2,SVG:3,fromString(t){return"webgl"===t||"gl"===t?this.WebGL:"img"===t?this.WebGLImage:"svg"===t?this.SVG:this.Default}},Embed3D:{NoEmbed:-1,Default:0,Overlay:1,Embed:2,EmbedSVG:3,fromString(t){return"embed"===t?this.Embed:"overlay"===t?this.Overlay:this.Default}},Latex:{Off:0,Symbols:1,Normal:2,MathJax:3,AlwaysMathJax:4,fromString(t){if(!t||!Bt(t))return this.Normal;switch(t){case"off":return this.Off;case"symbols":return this.Symbols;case"normal":case"latex":case"exp":case"experimental":return this.Normal;case"MathJax":case"mathjax":case"math":return this.MathJax;case"AlwaysMathJax":case"alwaysmath":case"alwaysmathjax":return this.AlwaysMathJax}const e=parseInt(t);return Number.isInteger(e)&&e>=this.Off&&e<=this.AlwaysMathJax?e:this.Normal}}},p={Render3D:f.Render3D.Default,Render3DBatch:f.Render3D.Default,Embed3D:f.Embed3D.Default,Tooltip:!i,TooltipAnimation:500,ContextMenu:!i,Zooming:!i,ZoomMouse:!i,ZoomWheel:!i,ZoomTouch:!i,MoveResize:!d.touches&&!i,HandleKeys:!i,DragAndDrop:!i,DragGraphs:!0,ProgressBox:!i,ToolBar:!i&&"popup",ToolBarSide:"left",ToolBarVert:!1,CanEnlarge:!0,CanAdjustFrame:!1,ApproxTextSize:!1,OptimizeDraw:1,AutoStat:!0,FrameNDC:{},SmallPad:{width:150,height:100},Palette:57,Latex:f.Latex.Normal,GeoGradPerSegm:6,GeoCompressComp:!0,IgnoreUrlOptions:!1,HierarchyLimit:250,DislpayKind:"simple",BrowserWidth:250,XValuesFormat:void 0,YValuesFormat:void 0,ZValuesFormat:void 0,HandleWrongHttpResponse:!1,UseStamp:!0,MaxRanges:200,WithCredentials:!1,SkipStreamerInfos:!1,OnlyLastCycle:!1,DarkMode:!1,PreferSavedPoints:!1,AxisTiltAngle:25,StripAxisLabels:!0,FuncAsCurve:!1,TimeZone:"",NewTabUrl:"",NewTabUrlPars:"",NewTabUrlExportSettings:!1},m={fName:"Modern",fOptLogx:0,fOptLogy:0,fOptLogz:0,fOptDate:0,fOptFile:0,fDateX:.01,fDateY:.01,fOptTitle:1,fCanvasColor:0,fPadColor:0,fPadBottomMargin:.1,fPadTopMargin:.1,fPadLeftMargin:.1,fPadRightMargin:.1,fPadGridX:!1,fPadGridY:!1,fPadTickX:0,fPadTickY:0,fPadBorderSize:2,fPadBorderMode:0,fCanvasBorderSize:2,fCanvasBorderMode:0,fStatColor:0,fStatStyle:1e3,fStatTextColor:1,fStatFontSize:0,fStatFont:42,fStatBorderSize:1,fStatFormat:"6.4g",fStatX:.98,fStatY:.935,fStatW:.2,fStatH:.16,fTitleAlign:23,fTitleColor:0,fTitleTextColor:1,fTitleBorderSize:0,fTitleFont:42,fTitleFontSize:.05,fTitleStyle:0,fTitleX:.5,fTitleY:.995,fTitleW:0,fTitleH:0,fFitFormat:"5.4g",fOptStat:1111,fOptFit:0,fNumberContours:20,fGridColor:0,fGridStyle:3,fGridWidth:1,fFrameFillColor:0,fFrameFillStyle:1001,fFrameLineColor:1,fFrameLineWidth:1,fFrameLineStyle:1,fFrameBorderSize:1,fFrameBorderMode:0,fEndErrorSize:2,fErrorX:.5,fHistMinimumZero:!1,fHistTopMargin:.05,fHistFillColor:0,fHistFillStyle:1001,fHistLineColor:602,fHistLineStyle:1,fHistLineWidth:1,fPaintTextFormat:"g",fTimeOffset:788918400,fLegendBorderSize:1,fLegendFont:42,fLegendTextSize:0,fLegendFillColor:0,fHatchesLineWidth:1,fHatchesSpacing:1,fCandleWhiskerRange:1,fCandleBoxRange:.5,fCandleScaled:!1,fViolinScaled:!0,fOrthoCamera:!1,fXAxisExpXOffset:0,fXAxisExpYOffset:0,fYAxisExpXOffset:0,fYAxisExpYOffset:0,fAxisMaxDigits:5,fStripDecimals:!0,fBarWidth:1};function g(){return i?n.nodejs_document:"undefined"!=typeof document?document:"object"==typeof window?window.document:void 0}async function _(t){if(i){let e,i;return Promise.resolve().then((function(){return Aw})).then((t=>(e=t.tmpNameSync()+".js",Promise.resolve().then((function(){return Aw}))))).then((n=>(i=n,i.writeFileSync(e,t),import("file://"+e)))).finally((()=>i.unlinkSync(e)))}if("undefined"!=typeof document){const e=document.getElementsByTagName("script");for(let i=0;i<e.length;++i)if(e[i].innerHTML===t)return!0;return(t.indexOf("JSROOT.require")>=0?async function(){return(globalThis.JSROOT?Promise.resolve(!0):x(s+"scripts/JSRoot.core.js")).then((()=>{if(globalThis.JSROOT?._complete_loading)return globalThis.JSROOT._complete_loading()})).then((()=>globalThis.JSROOT))}():Promise.resolve(!0)).then((()=>{const e=document.createElement("script");return e.setAttribute("type","text/javascript"),e.innerHTML=t,document.head.appendChild(e),Ht(!0,10)}))}return!1}async function x(t){if(!t)return!0;if(Bt(t)&&t.indexOf(";")>=0&&(t=t.split(";")),!Bt(t)){const e=t,i=()=>!e.length||x(e.shift()).then(i,i);return i()}0===t.indexOf("$$$")&&(0===(t=t.slice(3)).indexOf("style/")&&t.indexOf(".css")<0&&(t+=".css"),t=s+t);const e=t.indexOf(".css")>0;if(i)return e?null:0===t.indexOf("http:")||0===t.indexOf("https:")?C(t,"text").then((t=>_(t))):0===t.indexOf("./")?Promise.resolve().then((function(){return Aw})).then((e=>_(e.readFileSync(t)))):import(t);const n=e=>{if(e===t)return!0;const i=e.indexOf(t);return i>0&&i+t.length===e.length&&"/"===e[i-1]};if(e){const t=document.getElementsByTagName("link");for(let e=0;e<t.length;++e)if(t[e].href&&"text/css"===t[e].type&&"stylesheet"===t[e].rel&&n(t[e].href))return!0}else{const t=document.getElementsByTagName("script");for(let e=0;e<t.length;++e)if(n(t[e].src))return!0}let r;return e?(r=document.createElement("link"),r.setAttribute("rel","stylesheet"),r.setAttribute("type","text/css"),r.setAttribute("href",t)):(r=document.createElement("script"),r.setAttribute("type","text/javascript"),r.setAttribute("src",t)),new Promise(((e,i)=>{r.onload=()=>e(!0),r.onerror=()=>{r.remove(),i(Error(`Fail to load ${t}`))},document.head.appendChild(r)}))}function y(t){return 1<<t}function v(t,e,i){if(!t)return null;if(e){const i=e.obj.indexOf(t);if(i>=0)return e.clones[i]}else e={obj:[],clones:[],nofunc:i};const n=u(Object.prototype.toString.apply(t));if(1===n){const i=[];e.obj.push(t),e.clones.push(i);for(let n=0;n<t.length;++n)i.push(qt(t[n])?v(t[n],e):t[n]);return i}if(2===n){const i=[];e.obj.push(t),e.clones.push(i);for(let e=0;e<t.length;++e)i.push(t[e]);return i}const r={};e.obj.push(t),e.clones.push(r);for(const i in t)qt(t[i])?r[i]=v(t[i],e):e.nofunc&&Ut(t[i])||(r[i]=t[i]);return r}const b=Object.assign;function M(t,e){b(t,function(t,e){let i=Ft[t];const n=void 0!==i;n||(i={});t!==E&&t!==P&&void 0===e?.fBits||void 0===i.TestBit&&(i.TestBit=function(t){return!!(this.fBits&t)},i.InvertBit=function(t){this.fBits=this.fBits^16777215&t});if(n)return i;t!==L&&t!==z||(i.Clear=function(){this.arr=[],this.opt=[]},i.Add=function(t,e){this.arr.push(t),this.opt.push(Bt(e)?e:"")},i.AddFirst=function(t,e){this.arr.unshift(t),this.opt.unshift(Bt(e)?e:"")},i.RemoveAt=function(t){this.arr.splice(t,1),this.opt.splice(t,1)});t!==G&&t!==j||(i.AddText=function(t){const e=kt(tt);e.fTitle=t,e.fTextAlign=0,e.fTextColor=0,e.fTextFont=0,e.fTextSize=0,this.fLines.Add(e)},i.Clear=function(){this.fLines.Clear()});0!==t.indexOf(Mt)&&t!==wt||(i.addFormula=function(t){t&&(void 0===this.formulas&&(this.formulas=[]),this.formulas.push(t))},i.GetParName=function(t){if(this.fParams?.fParNames)return this.fParams.fParNames[t];if(this.fFormula?.fParams)for(let e=0,i=this.fFormula.fParams;e<i.length;++e)if(i[e].second===t)return i[e].first;return this.fNames&&this.fNames[t]?this.fNames[t]:`p${t}`},i.GetParValue=function(t){return this.fParams?.fParameters?this.fParams.fParameters[t]:this.fFormula?.fClingParameters?this.fFormula.fClingParameters[t]:this.fParams?this.fParams[t]:void 0},i.GetParError=function(t){return this.fParErrors?this.fParErrors[t]:void 0},i.GetNumPars=function(){return this.fNpar});0!==t.indexOf(F)&&t!==U||t===B||t===$||(i.IsInside=function(t,e){const i=this.fX,n=this.fY;let r=0,s=this.fNpoints-1,a=!1;for(;r<this.fNpoints;++r)(n[r]<e&&n[s]>=e||n[s]<e&&n[r]>=e)&&i[r]+(e-n[r])/(n[s]-n[r])*(i[s]-i[r])<t&&(a=!a),s=r;return a});0!==t.indexOf(mt)&&0!==t.indexOf(xt)&&0!==t.indexOf(bt)||(i.getBinError=function(t){return t>=this.fNcells&&(t=this.fNcells-1),t<0&&(t=0),t<this.fSumw2.length?Math.sqrt(this.fSumw2[t]):Math.sqrt(Math.abs(this.fArray[t]))},i.setBinContent=function(t,e){this.fEntries++,this.fTsumw=0,t>=0&&t<this.fArray.length&&(this.fArray[t]=e)});0===t.indexOf(mt)&&(i.getBin=function(t){return t},i.getBinContent=function(t){return this.fArray[t]},i.Fill=function(t,e){const i=this.fXaxis,n=Math.max(0,1+Math.min(i.fNbins,Math.floor((t-i.fXmin)/(i.fXmax-i.fXmin)*i.fNbins)));this.fArray[n]+=e??1,this.fEntries++});0===t.indexOf(xt)&&(i.getBin=function(t,e){return t+(this.fXaxis.fNbins+2)*e},i.getBinContent=function(t,e){return this.fArray[this.getBin(t,e)]},i.Fill=function(t,e,i){const n=this.fXaxis,r=this.fYaxis,s=Math.max(0,1+Math.min(n.fNbins,Math.floor((t-n.fXmin)/(n.fXmax-n.fXmin)*n.fNbins))),a=Math.max(0,1+Math.min(r.fNbins,Math.floor((e-r.fXmin)/(r.fXmax-r.fXmin)*r.fNbins)));this.fArray[s+(n.fNbins+2)*a]+=i??1,this.fEntries++});0===t.indexOf(bt)&&(i.getBin=function(t,e,i){return t+(this.fXaxis.fNbins+2)*(e+(this.fYaxis.fNbins+2)*i)},i.getBinContent=function(t,e,i){return this.fArray[this.getBin(t,e,i)]},i.Fill=function(t,e,i,n){const r=this.fXaxis,s=this.fYaxis,a=this.fZaxis,o=Math.max(0,1+Math.min(r.fNbins,Math.floor((t-r.fXmin)/(r.fXmax-r.fXmin)*r.fNbins))),l=Math.max(0,1+Math.min(s.fNbins,Math.floor((e-s.fXmin)/(s.fXmax-s.fXmin)*s.fNbins))),h=Math.max(0,1+Math.min(a.fNbins,Math.floor((i-a.fXmin)/(a.fXmax-a.fXmin)*a.fNbins)));this.fArray[o+(r.fNbins+2)*(l+(s.fNbins+2)*h)]+=n??1,this.fEntries++});t!==lt&&t!==ht||(i.Divide=function(t,e,i=.01,n=.01){if(!e){const i=t;if(i<2)return this;(t=e=Math.round(Math.sqrt(i)))*e<i&&(t+=1)}if(t*e<2)return 0;this.fPrimitives.Clear();const r=1/e,s=1/t;let a=0;for(let o=0;o<e;o++){const e=1-o*r-n;let l=e-r+2*n;if(l<0&&(l=0),!(l>e))for(let n=0;n<t;n++){const t=n*s+i,r=t+s-2*i;if(t>r)continue;a++;const o=kt(lt);o.fName=o.fTitle=`${this.fName}_${a}`,o.fNumber=a,this._typename!==ht?(o.fAbsWNDC=(r-t)*this.fAbsWNDC,o.fAbsHNDC=(e-l)*this.fAbsHNDC,o.fAbsXlowNDC=this.fAbsXlowNDC+t*this.fAbsWNDC,o.fAbsYlowNDC=this.fAbsYlowNDC+l*this.fAbsWNDC):(o.fAbsWNDC=r-t,o.fAbsHNDC=e-l,o.fAbsXlowNDC=t,o.fAbsYlowNDC=l),this.fPrimitives.Add(o)}}return t*e},i.GetPad=function(t){return this.fPrimitives.arr.find((e=>e._typename===lt&&e.fNumber===t))});0===t.indexOf(Tt)&&(t===Et?(i.getBin=function(t,e,i){return t+(this.fXaxis.fNbins+2)*(e+(this.fYaxis.fNbins+2)*i)},i.getBinContent=function(t,e,i){const n=this.getBin(t,e,i);return n<0||n>=this.fNcells||this.fBinEntries[n]<1e-300?0:this.fArray?this.fArray[n]/this.fBinEntries[n]:0},i.getBinEntries=function(t,e,i){const n=this.getBin(t,e,i);return n<0||n>=this.fNcells?0:this.fBinEntries[n]}):t===Ct?(i.getBin=function(t,e){return t+(this.fXaxis.fNbins+2)*e},i.getBinContent=function(t,e){const i=this.getBin(t,e);return i<0||i>=this.fNcells||this.fBinEntries[i]<1e-300?0:this.fArray?this.fArray[i]/this.fBinEntries[i]:0},i.getBinEntries=function(t,e){const i=this.getBin(t,e);return i<0||i>=this.fNcells?0:this.fBinEntries[i]}):(i.getBin=function(t){return t},i.getBinContent=function(t){return t<0||t>=this.fNcells||this.fBinEntries[t]<1e-300?0:this.fArray?this.fArray[t]/this.fBinEntries[t]:0}),i.getBinEffectiveEntries=function(t){if(t<0||t>=this.fNcells)return 0;const e=this.fBinEntries[t];if(!this.fBinSumw2||this.fBinSumw2.length!==this.fNcells)return e;const i=this.fBinSumw2[t];return i>0?e*e/i:0},i.getBinError=function(t){if(t<0||t>=this.fNcells)return 0;const e=this.fArray[t],i=this.fBinEntries[t],n=this.fSumw2[t],r=this.getBinEffectiveEntries(t);if(i<1e-300)return 0;const s={kERRORMEAN:0,kERRORSPREAD:1,kERRORSPREADI:2,kERRORSPREADG:3};if(this.fErrorMode===s.kERRORSPREADG)return 1/Math.sqrt(i);const a=e/i,o=Math.sqrt(Math.abs(n/i-a**2));return this.fErrorMode===s.kERRORSPREADI?0!==o?o/Math.sqrt(r):1/Math.sqrt(12*r):this.fErrorMode===s.kERRORSPREAD?o:o/Math.sqrt(r)});t===pt&&(i.GetBinLowEdge=function(t){return this.fNbins<=0?0:this.fXbins.length>0&&t>0&&t<=this.fNbins?this.fXbins[t-1]:this.fXmin+(t-1)*(this.fXmax-this.fXmin)/this.fNbins},i.GetBinCenter=function(t){return this.fNbins<=0?0:this.fXbins.length>0&&t>0&&t<this.fNbins?(this.fXbins[t-1]+this.fXbins[t])/2:this.fXmin+(t-.5)*(this.fXmax-this.fXmin)/this.fNbins});0===t.indexOf("ROOT::Math::LorentzVector")&&(i.Px=i.X=function(){return this.fCoordinates.Px()},i.Py=i.Y=function(){return this.fCoordinates.Py()},i.Pz=i.Z=function(){return this.fCoordinates.Pz()},i.E=i.T=function(){return this.fCoordinates.E()},i.M2=function(){return this.fCoordinates.M2()},i.M=function(){return this.fCoordinates.M()},i.R=i.P=function(){return this.fCoordinates.R()},i.P2=function(){return this.P()*this.P()},i.Pt=i.pt=function(){return Math.sqrt(this.P2())},i.Phi=i.phi=function(){return Math.atan2(this.fCoordinates.Py(),this.fCoordinates.Px())},i.Eta=i.eta=function(){return Math.atanh(this.Pz()/this.P())});0===t.indexOf("ROOT::Math::PxPyPzE4D")&&(i.Px=i.X=function(){return this.fX},i.Py=i.Y=function(){return this.fY},i.Pz=i.Z=function(){return this.fZ},i.E=i.T=function(){return this.fT},i.P2=function(){return this.fX**2+this.fY**2+this.fZ**2},i.R=i.P=function(){return Math.sqrt(this.P2())},i.Mag2=i.M2=function(){return this.fT**2-this.fX**2-this.fY**2-this.fZ**2},i.Mag=i.M=function(){return this.M2()>=0?Math.sqrt(this.M2()):-Math.sqrt(-this.M2())},i.Perp2=i.Pt2=function(){return this.fX**2+this.fY**2},i.Pt=i.pt=function(){return Math.sqrt(this.P2())},i.Phi=i.phi=function(){return Math.atan2(this.fY,this.fX)},i.Eta=i.eta=function(){return Math.atanh(this.Pz/this.P())});return Ft[t]=i,i}(e||t._typename,t))}function w(t){if(!t)return null;const e=Bt(t)?JSON.parse(t):t,i=[];let n;const r=t=>{if(null==t)return;if(Bt(t)){if(n||t.length<6||0!==t.indexOf("$ref:"))return;const e=parseInt(t.slice(5));if(!Number.isInteger(e)||e<0||e>=i.length)return;return n=!1,i[e]}if("object"!=typeof t)return;if(u(Object.prototype.toString.apply(t))>0){for(let e=0;e<t.length;++e){const i=r(t[e]);void 0!==i&&(t[e]=i)}return}const e=Object.keys(t),s=e.length;if(!1!==n&&1===s&&"$ref"===e[0]){const e=parseInt(t.$ref);if(!Number.isInteger(e)||e<0||e>=i.length)return;return n=!0,i[e]}if(!1!==n&&s>1&&"$arr"===e[0]&&"len"===e[1]){let i;switch(t.$arr){case"Int8":i=new Int8Array(t.len);break;case"Uint8":i=new Uint8Array(t.len);break;case"Int16":i=new Int16Array(t.len);break;case"Uint16":i=new Uint16Array(t.len);break;case"Int32":i=new Int32Array(t.len);break;case"Uint32":i=new Uint32Array(t.len);break;case"Float32":i=new Float32Array(t.len);break;case"Int64":case"Uint64":case"Float64":i=new Float64Array(t.len);break;default:i=new Array(t.len)}if(i.fill("Bool"!==t.$arr&&0),void 0!==t.b){const e=h(t.b);if(!i.buffer)throw new Error("base64 coding supported only for native arrays with binary data");{const n=new DataView(i.buffer,t.o||0),r=Math.min(e.length,n.byteLength);for(let t=0;t<r;++t)n.setUint8(t,e.charCodeAt(t))}}else{let n=2,r=0;for(;n<s;){if("p"===e[n][0]&&(r=t[e[n++]]),"v"!==e[n][0])throw new Error(`Unexpected member ${e[n]} in array decoding`);const a=t[e[n++]];if("object"==typeof a)for(let t=0;t<a.length;++t)i[r++]=a[t];else if(i[r++]=a,n<s&&"n"===e[n][0]){let s=t[e[n++]];for(;--s;)i[r++]=a}}}return i}if(!1!==n&&3===s&&"$pair"===e[0]&&"first"===e[1]&&"second"===e[2]){n=!0;const e=r(t.first),i=r(t.second);return void 0!==e&&(t.first=e),void 0!==i&&(t.second=i),t._typename=t.$pair,void delete t.$pair}if(!(i.indexOf(t)>=0)){i.push(t),t._typename&&M(t);for(let i=0;i<s;++i){const n=e[i],s=r(t[n]);void 0!==s&&(t[n]=s)}}};return r(e),e}function S(t,e){if(!qt(t))return"";const i=[],n=t=>{if(Ut(t))return;if(null==t||!qt(t))return t;if(u(Object.prototype.toString.apply(t))>0){const e=new Array(t.length);for(let i=0;i<t.length;++i)e[i]=n(t[i]);return e}const e=i.indexOf(t);if(e>=0)return{$ref:e};const r=Object.keys(t),s=r.length,a={};if(3===s&&"$pair"===r[0]&&"first"===r[1]&&"second"===r[2])return a.$pair=t.$pair,a.first=n(t.first),a.second=n(t.second),a;i.push(t);for(let e=0;e<s;++e){const i=r[e];i&&"$"!==i[0]&&(a[i]=n(t[i]))}return a},r=n(t);return JSON.stringify(r,null,e)}function T(t,e,n,r,s){function a(s){s.http_callback=Ut(n)?n.bind(s):()=>{},s.error_callback=Ut(r)?r.bind(s):function(t){console.warn(t.message),this.http_callback(null)}.bind(s),e||(e="buf");let a="GET",o=!0;const l=e.indexOf(";sync");switch(l>0&&(e=e.slice(0,l),o=!1),e){case"head":a="HEAD";break;case"posttext":a="POST",e="text";break;case"postbuf":a="POST",e="buf";break;case"post":case"multi":a="POST"}return s.kind=e,p.WithCredentials&&(s.withCredentials=!0),p.HandleWrongHttpResponse&&"GET"===a&&Ut(s.addEventListener)&&s.addEventListener("progress",function(t){t.lengthComputable&&this.expected_size&&t.loaded>this.expected_size&&(this.did_abort=!0,this.abort(),this.error_callback(Error(`Server sends more bytes ${t.loaded} than expected ${this.expected_size}. Abort I/O operation`),598))}.bind(s)),s.onreadystatechange=function(){if(!this.did_abort){if(2===this.readyState&&this.expected_size){const t=parseInt(this.getResponseHeader("Content-Length"));if(Number.isInteger(t)&&t>this.expected_size&&!p.HandleWrongHttpResponse)return this.did_abort=!0,this.abort(),this.error_callback(Error(`Server response size ${t} larger than expected ${this.expected_size}. Abort I/O operation`),599)}if(4===this.readyState){if(200!==this.status&&206!==this.status&&!d.qt5&&(0!==this.status||0!==t.indexOf("file://")&&0!==t.indexOf("blob:")))return this.error_callback(Error(`Fail to load url ${t}`),this.status);if(this.nodejs_checkzip&&"gzip"===this.getResponseHeader("content-encoding"))return Promise.resolve().then((function(){return Aw})).then((t=>{const e=t.unzipSync(Buffer.from(this.response)),i=JSON.parse(e);return this.http_callback(w(i))}));switch(this.kind){case"xml":return this.http_callback(this.responseXML);case"text":return this.http_callback(this.responseText);case"object":return this.http_callback(w(this.responseText));case"multi":return this.http_callback(function(t){if(!t)return null;const e=JSON.parse(t);if(e?.length)for(let t=0;t<e.length;++t)e[t]=w(e[t]);return e}(this.responseText));case"head":return this.http_callback(this)}if(void 0===this.responseType)return this.http_callback(this.responseText);if("bin"===this.kind&&"byteLength"in this.response){const t=new Uint8Array(this.response);let e="";for(let i=0;i<t.length;++i)e+=String.fromCharCode(t[i]);return this.http_callback(e)}this.http_callback(this.response)}}},s.open(a,t,o),"bin"!==e&&"buf"!==e||(s.responseType="arraybuffer"),i&&"GET"===a&&"object"===e&&t.indexOf(".json.gz")>0&&(s.nodejs_checkzip=!0,s.responseType="arraybuffer"),s}if(l()){if(!s)throw Error("Not allowed to create http requests in node.js without promise");return Promise.resolve().then((function(){return Aw})).then((t=>a(new t.default)))}const o=a(new XMLHttpRequest);return s?Promise.resolve(o):o}async function C(t,e,i){return new Promise(((n,r)=>{T(t,e,n,r,!0).then((t=>t.send(i||null)))}))}const E="TObject",P="TNamed",A="TObjString",L="TList",z="THashList",R="TObjArray",N="TAttLine",D="TAttFill",k="TAttMarker",O="TAttText",I="THStack",F="TGraph",q="TMultiGraph",U="TCutG",B="TGraphPolargram",$="TGraphTime",H="TPave",G="TPaveText",j="TPaveStats",X="TPavesText",V="TPaveLabel",W="TPaveClass",Y="TDiamond",Z="TLegend",K="TLegendEntry",J="TPaletteAxis",Q="TText",tt="TLatex",et="TColor",it="TLine",nt="TBox",rt="TPolyLine",st="TPolyLine3D",at="TPolyMarker3D",ot="TAttPad",lt="TPad",ht="TCanvas",ct="TFrame",dt="TAttCanvas",ut="TGaxis",ft="TAttAxis",pt="TAxis",mt="TH1",gt="TH1I",_t="TH1D",xt="TH2",yt="TH2I",vt="TH2F",bt="TH3",Mt="TF1",wt="TF2",St="TF3",Tt="TProfile",Ct="TProfile2D",Et="TProfile3D",Pt="TGeoVolume",At="TGeoNode",Lt="TGeoNodeMatrix",zt=-1111,Rt=y(9),Nt="inspect",Dt="title";function kt(t,e){const i=e||{};switch(t){case E:b(i,{fUniqueID:0,fBits:0});break;case P:b(i,{fUniqueID:0,fBits:0,fName:"",fTitle:""});break;case L:case z:b(i,{name:t,arr:[],opt:[]});break;case ft:b(i,{fNdivisions:510,fAxisColor:1,fLabelColor:1,fLabelFont:42,fLabelOffset:.005,fLabelSize:.035,fTickLength:.03,fTitleOffset:1,fTitleSize:.035,fTitleColor:1,fTitleFont:42});break;case pt:kt(P,i),kt(ft,i),b(i,{fNbins:1,fXmin:0,fXmax:1,fXbins:[],fFirst:0,fLast:0,fBits2:0,fTimeDisplay:!1,fTimeFormat:"",fLabels:null,fModLabs:null});break;case N:b(i,{fLineColor:1,fLineStyle:1,fLineWidth:1});break;case D:b(i,{fFillColor:0,fFillStyle:0});break;case k:b(i,{fMarkerColor:1,fMarkerStyle:1,fMarkerSize:1});break;case it:kt(E,i),kt(N,i),b(i,{fX1:0,fX2:1,fY1:0,fY2:1});break;case nt:kt(E,i),kt(N,i),kt(D,i),b(i,{fX1:0,fX2:1,fY1:0,fY2:1});break;case H:kt(nt,i),b(i,{fX1NDC:0,fY1NDC:0,fX2NDC:1,fY2NDC:1,fBorderSize:0,fInit:1,fShadowColor:1,fCornerRadius:0,fOption:"brNDC",fName:""});break;case O:b(i,{fTextAngle:0,fTextSize:0,fTextAlign:22,fTextColor:1,fTextFont:42});break;case G:kt(H,i),kt(O,i),b(i,{fLabel:"",fLongest:27,fMargin:.05,fLines:kt(L)});break;case j:kt(G,i),b(i,{fFillColor:m.fStatColor,fFillStyle:m.fStatStyle,fTextFont:m.fStatFont,fTextSize:m.fStatFontSize,fTextColor:m.fStatTextColor,fBorderSize:m.fStatBorderSize,fOptFit:0,fOptStat:0,fFitFormat:"",fStatFormat:"",fParent:null});break;case Z:kt(H,i),kt(O,i),b(i,{fColumnSeparation:0,fEntrySeparation:.1,fMargin:.25,fNColumns:1,fPrimitives:kt(L),fName:H,fBorderSize:m.fLegendBorderSize,fTextFont:m.fLegendFont,fTextSize:m.fLegendTextSize,fFillColor:m.fLegendFillColor});break;case J:kt(H,i),b(i,{fAxis:kt(ut),fH:null,fName:H});break;case K:kt(E,i),kt(O,i),kt(N,i),kt(D,i),kt(k,i),b(i,{fLabel:"",fObject:null,fOption:"",fTextAlign:0,fTextColor:0,fTextFont:0});break;case Q:kt(P,i),kt(O,i),b(i,{fLimitFactorSize:3,fOriginSize:.04});break;case tt:kt(Q,i),kt(N,i),b(i,{fX:0,fY:0});break;case A:kt(E,i),b(i,{fString:""});break;case mt:kt(P,i),kt(N,i),kt(D,i),kt(k,i),b(i,{fBits:8,fNcells:0,fXaxis:kt(pt),fYaxis:kt(pt),fZaxis:kt(pt),fFillColor:m.fHistFillColor,fFillStyle:m.fHistFillStyle,fLineColor:m.fHistLineColor,fLineStyle:m.fHistLineStyle,fLineWidth:m.fHistLineWidth,fBarOffset:0,fBarWidth:1e3,fEntries:0,fTsumw:0,fTsumw2:0,fTsumwx:0,fTsumwx2:0,fMaximum:zt,fMinimum:zt,fNormFactor:0,fContour:[],fSumw2:[],fOption:"",fFunctions:kt(L),fBufferSize:0,fBuffer:[],fBinStatErrOpt:0,fStatOverflows:2});break;case gt:case _t:case"TH1L64":case"TH1F":case"TH1S":case"TH1C":kt(mt,i),i.fArray=[];break;case xt:kt(mt,i),b(i,{fScalefactor:1,fTsumwy:0,fTsumwy2:0,fTsumwxy:0});break;case yt:case"TH2L64":case vt:case"TH2D":case"TH2S":case"TH2C":kt(xt,i),i.fArray=[];break;case bt:kt(mt,i),b(i,{fTsumwy:0,fTsumwy2:0,fTsumwz:0,fTsumwz2:0,fTsumwxy:0,fTsumwxz:0,fTsumwyz:0});break;case"TH3I":case"TH3L64":case"TH3F":case"TH3D":case"TH3S":case"TH3C":kt(bt,i),i.fArray=[];break;case I:kt(P,i),b(i,{fHists:kt(L),fHistogram:null,fMaximum:zt,fMinimum:zt});break;case F:kt(P,i),kt(N,i),kt(D,i),kt(k,i),b(i,{fFunctions:kt(L),fHistogram:null,fMaxSize:0,fMaximum:zt,fMinimum:zt,fNpoints:0,fX:[],fY:[]});break;case"TGraphAsymmErrors":kt(F,i),b(i,{fEXlow:[],fEXhigh:[],fEYlow:[],fEYhigh:[]});break;case q:kt(P,i),b(i,{fFunctions:kt(L),fGraphs:kt(L),fHistogram:null,fMaximum:zt,fMinimum:zt});break;case B:kt(P,i),kt(O,i),kt(N,i),b(i,{fRadian:!0,fDegree:!1,fGrad:!1,fPolarLabelColor:1,fRadialLabelColor:1,fAxisAngle:0,fPolarOffset:.04,fPolarTextSize:.04,fRadialOffset:.025,fRadialTextSize:.035,fRwrmin:0,fRwrmax:1,fRwtmin:0,fRwtmax:2*Math.PI,fTickpolarSize:.02,fPolarLabelFont:62,fRadialLabelFont:62,fCutRadial:0,fNdivRad:508,fNdivPol:508});break;case rt:kt(E,i),kt(N,i),kt(D,i),b(i,{fLastPoint:-1,fN:0,fOption:"",fX:null,fY:null});break;case ut:kt(it,i),kt(O,i),b(i,{fChopt:"",fFunctionName:"",fGridLength:0,fLabelColor:1,fLabelFont:42,fLabelOffset:.005,fLabelSize:.035,fName:"",fNdiv:12,fTickSize:.02,fTimeFormat:"",fTitle:"",fTitleOffset:1,fTitleSize:.035,fWmax:100,fWmin:0});break;case ot:b(i,{fLeftMargin:m.fPadLeftMargin,fRightMargin:m.fPadRightMargin,fBottomMargin:m.fPadBottomMargin,fTopMargin:m.fPadTopMargin,fXfile:2,fYfile:2,fAfile:1,fXstat:.99,fYstat:.99,fAstat:2,fFrameFillColor:m.fFrameFillColor,fFrameFillStyle:m.fFrameFillStyle,fFrameLineColor:m.fFrameLineColor,fFrameLineWidth:m.fFrameLineWidth,fFrameLineStyle:m.fFrameLineStyle,fFrameBorderSize:m.fFrameBorderSize,fFrameBorderMode:m.fFrameBorderMode});break;case lt:kt(E,i),kt(N,i),kt(D,i),kt(ot,i),b(i,{fFillColor:m.fPadColor,fFillStyle:1001,fX1:0,fY1:0,fX2:1,fY2:1,fXtoAbsPixelk:1,fXtoPixelk:1,fXtoPixel:1,fYtoAbsPixelk:1,fYtoPixelk:1,fYtoPixel:1,fUtoAbsPixelk:1,fUtoPixelk:1,fUtoPixel:1,fVtoAbsPixelk:1,fVtoPixelk:1,fVtoPixel:1,fAbsPixeltoXk:1,fPixeltoXk:1,fPixeltoX:1,fAbsPixeltoYk:1,fPixeltoYk:1,fPixeltoY:1,fXlowNDC:0,fYlowNDC:0,fXUpNDC:0,fYUpNDC:0,fWNDC:1,fHNDC:1,fAbsXlowNDC:0,fAbsYlowNDC:0,fAbsWNDC:1,fAbsHNDC:1,fUxmin:0,fUymin:0,fUxmax:0,fUymax:0,fTheta:30,fPhi:30,fAspectRatio:0,fNumber:0,fLogx:m.fOptLogx,fLogy:m.fOptLogy,fLogz:m.fOptLogz,fTickx:m.fPadTickX,fTicky:m.fPadTickY,fPadPaint:0,fCrosshair:0,fCrosshairPos:0,fBorderSize:m.fPadBorderSize,fBorderMode:m.fPadBorderMode,fModified:!1,fGridx:m.fPadGridX,fGridy:m.fPadGridY,fAbsCoord:!1,fEditable:!0,fFixedAspectRatio:!1,fPrimitives:kt(L),fExecs:null,fName:"pad",fTitle:"canvas"});break;case dt:b(i,{fXBetween:2,fYBetween:2,fTitleFromTop:1.2,fXdate:.2,fYdate:.3,fAdate:1});break;case ht:kt(lt,i),b(i,{fFillColor:m.fCanvasColor,fFillStyle:1001,fNumPaletteColor:0,fNextPaletteColor:0,fDISPLAY:"$DISPLAY",fDoubleBuffer:0,fRetained:!0,fXsizeUser:0,fYsizeUser:0,fXsizeReal:20,fYsizeReal:10,fWindowTopX:0,fWindowTopY:0,fWindowWidth:0,fWindowHeight:0,fBorderSize:m.fCanvasBorderSize,fBorderMode:m.fCanvasBorderMode,fCw:500,fCh:300,fCatt:kt(dt),kMoveOpaque:!0,kResizeOpaque:!0,fHighLightColor:5,fBatch:!0,kShowEventStatus:!1,kAutoExec:!0,kMenuBar:!0});break;case Pt:kt(P,i),kt(N,i),kt(D,i),b(i,{fGeoAtt:0,fFinder:null,fMedium:null,fNodes:null,fNtotal:0,fNumber:0,fRefCount:0,fShape:null,fVoxels:null});break;case At:kt(P,i),b(i,{fGeoAtt:0,fMother:null,fNovlp:0,fNumber:0,fOverlaps:null,fVolume:null});break;case Lt:kt(At,i),b(i,{fMatrix:null});break;case"TGeoTrack":kt(E,i),kt(N,i),kt(k,i),b(i,{fGeoAtt:0,fNpoints:0,fPoints:[]});break;case st:kt(E,i),kt(N,i),b(i,{fLastPoint:-1,fN:0,fOption:"",fP:[]});break;case at:kt(E,i),kt(k,i),b(i,{fLastPoint:-1,fN:0,fName:"",fOption:"",fP:[]})}return i._typename=t,M(i,t),i}function Ot(t,e,i,n){const r=kt(t);if(!r.fXaxis||!r.fYaxis||!r.fZaxis)return null;switch(r.fName="hist",r.fTitle="title",e&&b(r.fXaxis,{fNbins:e,fXmin:0,fXmax:e}),i&&b(r.fYaxis,{fNbins:i,fXmin:0,fXmax:i}),n&&b(r.fZaxis,{fNbins:n,fXmin:0,fXmax:n}),parseInt(t[2])){case 1:e&&(r.fNcells=e+2);break;case 2:e&&i&&(r.fNcells=(e+2)*(i+2));break;case 3:e&&i&&n&&(r.fNcells=(e+2)*(i+2)*(n+2))}if(r.fNcells>0){switch(t[3]){case"C":r.fArray=new Int8Array(r.fNcells);break;case"S":r.fArray=new Int16Array(r.fNcells);break;case"I":r.fArray=new Int32Array(r.fNcells);break;case"F":r.fArray=new Float32Array(r.fNcells);break;case"L":case"D":r.fArray=new Float64Array(r.fNcells);break;default:r.fArray=new Array(r.fNcells)}r.fArray.fill(0)}return r}function It(t,e){const i=kt(rt);return t&&(i.fN=t,e?(i.fX=new Int32Array(t),i.fY=new Int32Array(t)):(i.fX=new Float32Array(t),i.fY=new Float32Array(t))),i}const Ft={};function qt(t){return t&&"object"==typeof t}function Ut(t){return"function"==typeof t}function Bt(t){return"string"==typeof t}function $t(t){return qt(t)&&Ut(t.then)}function Ht(t,e){return new Promise((i=>{setTimeout((()=>{const e=Ut(t)?t():t;i(e)}),e)}))}function Gt(t){return $t(t)?t:Promise.resolve(t)}function jt(t,e,i){t.prototype=e.prototype=i,i.constructor=t}function Xt(t,e){var i=Object.create(t.prototype);for(var n in e)i[n]=e[n];return i}function Vt(){}m.fXaxis=kt(ft),m.fYaxis=kt(ft),m.fZaxis=kt(ft);var Wt=.7,Yt=1/Wt,Zt="\\s*([+-]?\\d+)\\s*",Kt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Jt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Qt=/^#([0-9a-f]{3,8})$/,te=new RegExp(`^rgb\\(${Zt},${Zt},${Zt}\\)$`),ee=new RegExp(`^rgb\\(${Jt},${Jt},${Jt}\\)$`),ie=new RegExp(`^rgba\\(${Zt},${Zt},${Zt},${Kt}\\)$`),ne=new RegExp(`^rgba\\(${Jt},${Jt},${Jt},${Kt}\\)$`),re=new RegExp(`^hsl\\(${Kt},${Jt},${Jt}\\)$`),se=new RegExp(`^hsla\\(${Kt},${Jt},${Jt},${Kt}\\)$`),ae={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function oe(){return this.rgb().formatHex()}function le(){return this.rgb().formatRgb()}function he(t){var e,i;return t=(t+"").trim().toLowerCase(),(e=Qt.exec(t))?(i=e[1].length,e=parseInt(e[1],16),6===i?ce(e):3===i?new pe(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===i?de(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===i?de(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=te.exec(t))?new pe(e[1],e[2],e[3],1):(e=ee.exec(t))?new pe(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=ie.exec(t))?de(e[1],e[2],e[3],e[4]):(e=ne.exec(t))?de(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=re.exec(t))?ve(e[1],e[2]/100,e[3]/100,1):(e=se.exec(t))?ve(e[1],e[2]/100,e[3]/100,e[4]):ae.hasOwnProperty(t)?ce(ae[t]):"transparent"===t?new pe(NaN,NaN,NaN,0):null}function ce(t){return new pe(t>>16&255,t>>8&255,255&t,1)}function de(t,e,i,n){return n<=0&&(t=e=i=NaN),new pe(t,e,i,n)}function ue(t){return t instanceof Vt||(t=he(t)),t?new pe((t=t.rgb()).r,t.g,t.b,t.opacity):new pe}function fe(t,e,i,n){return 1===arguments.length?ue(t):new pe(t,e,i,null==n?1:n)}function pe(t,e,i,n){this.r=+t,this.g=+e,this.b=+i,this.opacity=+n}function me(){return`#${ye(this.r)}${ye(this.g)}${ye(this.b)}`}function ge(){const t=_e(this.opacity);return`${1===t?"rgb(":"rgba("}${xe(this.r)}, ${xe(this.g)}, ${xe(this.b)}${1===t?")":`, ${t})`}`}function _e(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function xe(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function ye(t){return((t=xe(t))<16?"0":"")+t.toString(16)}function ve(t,e,i,n){return n<=0?t=e=i=NaN:i<=0||i>=1?t=e=NaN:e<=0&&(t=NaN),new Me(t,e,i,n)}function be(t){if(t instanceof Me)return new Me(t.h,t.s,t.l,t.opacity);if(t instanceof Vt||(t=he(t)),!t)return new Me;if(t instanceof Me)return t;var e=(t=t.rgb()).r/255,i=t.g/255,n=t.b/255,r=Math.min(e,i,n),s=Math.max(e,i,n),a=NaN,o=s-r,l=(s+r)/2;return o?(a=e===s?(i-n)/o+6*(i<n):i===s?(n-e)/o+2:(e-i)/o+4,o/=l<.5?s+r:2-s-r,a*=60):o=l>0&&l<1?0:a,new Me(a,o,l,t.opacity)}function Me(t,e,i,n){this.h=+t,this.s=+e,this.l=+i,this.opacity=+n}function we(t){return(t=(t||0)%360)<0?t+360:t}function Se(t){return Math.max(0,Math.min(1,t||0))}function Te(t,e,i){return 255*(t<60?e+(i-e)*t/60:t<180?i:t<240?e+(i-e)*(240-t)/60:e)}jt(Vt,he,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:oe,formatHex:oe,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return be(this).formatHsl()},formatRgb:le,toString:le}),jt(pe,fe,Xt(Vt,{brighter(t){return t=null==t?Yt:Math.pow(Yt,t),new pe(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?Wt:Math.pow(Wt,t),new pe(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new pe(xe(this.r),xe(this.g),xe(this.b),_e(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:me,formatHex:me,formatHex8:function(){return`#${ye(this.r)}${ye(this.g)}${ye(this.b)}${ye(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:ge,toString:ge})),jt(Me,(function(t,e,i,n){return 1===arguments.length?be(t):new Me(t,e,i,null==n?1:n)}),Xt(Vt,{brighter(t){return t=null==t?Yt:Math.pow(Yt,t),new Me(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Wt:Math.pow(Wt,t),new Me(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,i=this.l,n=i+(i<.5?i:1-i)*e,r=2*i-n;return new pe(Te(t>=240?t-240:t+120,r,n),Te(t,r,n),Te(t<120?t+240:t-120,r,n),this.opacity)},clamp(){return new Me(we(this.h),Se(this.s),Se(this.l),_e(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=_e(this.opacity);return`${1===t?"hsl(":"hsla("}${we(this.h)}, ${100*Se(this.s)}%, ${100*Se(this.l)}%${1===t?")":`, ${t})`}`}}));const Ce=Math.PI/180,Ee=180/Math.PI,Pe=.96422,Ae=1,Le=.82521,ze=4/29,Re=6/29,Ne=3*Re*Re,De=Re*Re*Re;function ke(t){if(t instanceof Oe)return new Oe(t.l,t.a,t.b,t.opacity);if(t instanceof Be)return $e(t);t instanceof pe||(t=ue(t));var e,i,n=Ue(t.r),r=Ue(t.g),s=Ue(t.b),a=Ie((.2225045*n+.7168786*r+.0606169*s)/Ae);return n===r&&r===s?e=i=a:(e=Ie((.4360747*n+.3850649*r+.1430804*s)/Pe),i=Ie((.0139322*n+.0971045*r+.7141733*s)/Le)),new Oe(116*a-16,500*(e-a),200*(a-i),t.opacity)}function Oe(t,e,i,n){this.l=+t,this.a=+e,this.b=+i,this.opacity=+n}function Ie(t){return t>De?Math.pow(t,1/3):t/Ne+ze}function Fe(t){return t>Re?t*t*t:Ne*(t-ze)}function qe(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Ue(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Be(t,e,i,n){this.h=+t,this.c=+e,this.l=+i,this.opacity=+n}function $e(t){if(isNaN(t.h))return new Oe(t.l,0,0,t.opacity);var e=t.h*Ce;return new Oe(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}jt(Oe,(function(t,e,i,n){return 1===arguments.length?ke(t):new Oe(t,e,i,null==n?1:n)}),Xt(Vt,{brighter(t){return new Oe(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker(t){return new Oe(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,i=isNaN(this.b)?t:t-this.b/200;return new pe(qe(3.1338561*(e=Pe*Fe(e))-1.6168667*(t=Ae*Fe(t))-.4906146*(i=Le*Fe(i))),qe(-.9787684*e+1.9161415*t+.033454*i),qe(.0719453*e-.2289914*t+1.4052427*i),this.opacity)}})),jt(Be,(function(t,e,i,n){return 1===arguments.length?function(t){if(t instanceof Be)return new Be(t.h,t.c,t.l,t.opacity);if(t instanceof Oe||(t=ke(t)),0===t.a&&0===t.b)return new Be(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*Ee;return new Be(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new Be(t,e,i,null==n?1:n)}),Xt(Vt,{brighter(t){return new Be(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker(t){return new Be(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb(){return $e(this).rgb()}}));var He=-.14861,Ge=1.78277,je=-.29227,Xe=-.90649,Ve=1.97294,We=Ve*Xe,Ye=Ve*Ge,Ze=Ge*je-Xe*He;function Ke(t,e,i,n){this.h=+t,this.s=+e,this.l=+i,this.opacity=+n}jt(Ke,(function(t,e,i,n){return 1===arguments.length?function(t){if(t instanceof Ke)return new Ke(t.h,t.s,t.l,t.opacity);t instanceof pe||(t=ue(t));var e=t.r/255,i=t.g/255,n=t.b/255,r=(Ze*n+We*e-Ye*i)/(Ze+We-Ye),s=n-r,a=(Ve*(i-r)-je*s)/Xe,o=Math.sqrt(a*a+s*s)/(Ve*r*(1-r)),l=o?Math.atan2(a,s)*Ee-120:NaN;return new Ke(l<0?l+360:l,o,r,t.opacity)}(t):new Ke(t,e,i,null==n?1:n)}),Xt(Vt,{brighter(t){return t=null==t?Yt:Math.pow(Yt,t),new Ke(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Wt:Math.pow(Wt,t),new Ke(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*Ce,e=+this.l,i=isNaN(this.s)?0:this.s*e*(1-e),n=Math.cos(t),r=Math.sin(t);return new pe(255*(e+i*(He*n+Ge*r)),255*(e+i*(je*n+Xe*r)),255*(e+i*(Ve*n)),this.opacity)}}));var Je=Math.abs,Qe=Math.cos,ti=Math.sin,ei=Math.PI,ii=ei/2,ni=2*ei,ri=Math.max,si=1e-12;function ai(t,e){return Array.from({length:e-t},((e,i)=>t+i))}function oi(){return function(t,e){var i=0,n=null,r=null,s=null;function a(a){var o,l=a.length,h=new Array(l),c=ai(0,l),d=new Array(l*l),u=new Array(l),f=0;a=Float64Array.from({length:l*l},e?(t,e)=>a[e%l][e/l|0]:(t,e)=>a[e/l|0][e%l]);for(let e=0;e<l;++e){let i=0;for(let n=0;n<l;++n)i+=a[e*l+n]+t*a[n*l+e];f+=h[e]=i}o=(f=ri(0,ni-i*l)/f)?i:ni/l;{let e=0;n&&c.sort(((t,e)=>n(h[t],h[e])));for(const i of c){const n=e;if(t){const t=ai(1+~l,l).filter((t=>t<0?a[~t*l+i]:a[i*l+t]));r&&t.sort(((t,e)=>r(t<0?-a[~t*l+i]:a[i*l+t],e<0?-a[~e*l+i]:a[i*l+e])));for(const n of t)if(n<0){(d[~n*l+i]||(d[~n*l+i]={source:null,target:null})).target={index:i,startAngle:e,endAngle:e+=a[~n*l+i]*f,value:a[~n*l+i]}}else{(d[i*l+n]||(d[i*l+n]={source:null,target:null})).source={index:i,startAngle:e,endAngle:e+=a[i*l+n]*f,value:a[i*l+n]}}u[i]={index:i,startAngle:n,endAngle:e,value:h[i]}}else{const t=ai(0,l).filter((t=>a[i*l+t]||a[t*l+i]));r&&t.sort(((t,e)=>r(a[i*l+t],a[i*l+e])));for(const n of t){let t;if(i<n?(t=d[i*l+n]||(d[i*l+n]={source:null,target:null}),t.source={index:i,startAngle:e,endAngle:e+=a[i*l+n]*f,value:a[i*l+n]}):(t=d[n*l+i]||(d[n*l+i]={source:null,target:null}),t.target={index:i,startAngle:e,endAngle:e+=a[i*l+n]*f,value:a[i*l+n]},i===n&&(t.source=t.target)),t.source&&t.target&&t.source.value<t.target.value){const e=t.source;t.source=t.target,t.target=e}}u[i]={index:i,startAngle:n,endAngle:e,value:h[i]}}e+=o}}return(d=Object.values(d)).groups=u,s?d.sort(s):d}return a.padAngle=function(t){return arguments.length?(i=ri(0,t),a):i},a.sortGroups=function(t){return arguments.length?(n=t,a):n},a.sortSubgroups=function(t){return arguments.length?(r=t,a):r},a.sortChords=function(t){return arguments.length?(null==t?s=null:(e=t,s=function(t,i){return e(t.source.value+t.target.value,i.source.value+i.target.value)})._=t,a):s&&s._;var e},a}(!1,!1)}const li=Math.PI,hi=2*li,ci=1e-6,di=hi-ci;function ui(t){this._+=t[0];for(let e=1,i=t.length;e<i;++e)this._+=arguments[e]+t[e]}let fi=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==t?ui:function(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return ui;const i=10**e;return function(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=Math.round(arguments[e]*i)/i+t[e]}}(t)}moveTo(t,e){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,e){this._append`L${this._x1=+t},${this._y1=+e}`}quadraticCurveTo(t,e,i,n){this._append`Q${+t},${+e},${this._x1=+i},${this._y1=+n}`}bezierCurveTo(t,e,i,n,r,s){this._append`C${+t},${+e},${+i},${+n},${this._x1=+r},${this._y1=+s}`}arcTo(t,e,i,n,r){if(t=+t,e=+e,i=+i,n=+n,(r=+r)<0)throw new Error(`negative radius: ${r}`);let s=this._x1,a=this._y1,o=i-t,l=n-e,h=s-t,c=a-e,d=h*h+c*c;if(null===this._x1)this._append`M${this._x1=t},${this._y1=e}`;else if(d>ci)if(Math.abs(c*o-l*h)>ci&&r){let u=i-s,f=n-a,p=o*o+l*l,m=u*u+f*f,g=Math.sqrt(p),_=Math.sqrt(d),x=r*Math.tan((li-Math.acos((p+d-m)/(2*g*_)))/2),y=x/_,v=x/g;Math.abs(y-1)>ci&&this._append`L${t+y*h},${e+y*c}`,this._append`A${r},${r},0,0,${+(c*u>h*f)},${this._x1=t+v*o},${this._y1=e+v*l}`}else this._append`L${this._x1=t},${this._y1=e}`;else;}arc(t,e,i,n,r,s){if(t=+t,e=+e,s=!!s,(i=+i)<0)throw new Error(`negative radius: ${i}`);let a=i*Math.cos(n),o=i*Math.sin(n),l=t+a,h=e+o,c=1^s,d=s?n-r:r-n;null===this._x1?this._append`M${l},${h}`:(Math.abs(this._x1-l)>ci||Math.abs(this._y1-h)>ci)&&this._append`L${l},${h}`,i&&(d<0&&(d=d%hi+hi),d>di?this._append`A${i},${i},0,1,${c},${t-a},${e-o}A${i},${i},0,1,${c},${this._x1=l},${this._y1=h}`:d>ci&&this._append`A${i},${i},0,${+(d>=li)},${c},${this._x1=t+i*Math.cos(r)},${this._y1=e+i*Math.sin(r)}`)}rect(t,e,i,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${i=+i}v${+n}h${-i}Z`}toString(){return this._}};function pi(){return new fi}pi.prototype=fi.prototype;var mi=Array.prototype.slice;function gi(t){return function(){return t}}function _i(t){return t.source}function xi(t){return t.target}function yi(t){return t.radius}function vi(t){return t.startAngle}function bi(t){return t.endAngle}function Mi(){return 0}function wi(){return function(t){var e=_i,i=xi,n=yi,r=yi,s=vi,a=bi,o=Mi,l=null;function h(){var h,c=e.apply(this,arguments),d=i.apply(this,arguments),u=o.apply(this,arguments)/2,f=mi.call(arguments),p=+n.apply(this,(f[0]=c,f)),m=s.apply(this,f)-ii,g=a.apply(this,f)-ii,_=+r.apply(this,(f[0]=d,f)),x=s.apply(this,f)-ii,y=a.apply(this,f)-ii;if(l||(l=h=pi()),u>si&&(Je(g-m)>2*u+si?g>m?(m+=u,g-=u):(m-=u,g+=u):m=g=(m+g)/2,Je(y-x)>2*u+si?y>x?(x+=u,y-=u):(x-=u,y+=u):x=y=(x+y)/2),l.moveTo(p*Qe(m),p*ti(m)),l.arc(0,0,p,m,g),m!==x||g!==y)if(t){var v=_-+t.apply(this,arguments),b=(x+y)/2;l.quadraticCurveTo(0,0,v*Qe(x),v*ti(x)),l.lineTo(_*Qe(b),_*ti(b)),l.lineTo(v*Qe(y),v*ti(y))}else l.quadraticCurveTo(0,0,_*Qe(x),_*ti(x)),l.arc(0,0,_,x,y);if(l.quadraticCurveTo(0,0,p*Qe(m),p*ti(m)),l.closePath(),h)return l=null,h+""||null}return t&&(h.headRadius=function(e){return arguments.length?(t="function"==typeof e?e:gi(+e),h):t}),h.radius=function(t){return arguments.length?(n=r="function"==typeof t?t:gi(+t),h):n},h.sourceRadius=function(t){return arguments.length?(n="function"==typeof t?t:gi(+t),h):n},h.targetRadius=function(t){return arguments.length?(r="function"==typeof t?t:gi(+t),h):r},h.startAngle=function(t){return arguments.length?(s="function"==typeof t?t:gi(+t),h):s},h.endAngle=function(t){return arguments.length?(a="function"==typeof t?t:gi(+t),h):a},h.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:gi(+t),h):o},h.source=function(t){return arguments.length?(e=t,h):e},h.target=function(t){return arguments.length?(i=t,h):i},h.context=function(t){return arguments.length?(l=null==t?null:t,h):l},h}()}var Si={value:()=>{}};function Ti(){for(var t,e=0,i=arguments.length,n={};e<i;++e){if(!(t=arguments[e]+"")||t in n||/[\s.]/.test(t))throw new Error("illegal type: "+t);n[t]=[]}return new Ci(n)}function Ci(t){this._=t}function Ei(t,e){for(var i,n=0,r=t.length;n<r;++n)if((i=t[n]).name===e)return i.value}function Pi(t,e,i){for(var n=0,r=t.length;n<r;++n)if(t[n].name===e){t[n]=Si,t=t.slice(0,n).concat(t.slice(n+1));break}return null!=i&&t.push({name:e,value:i}),t}Ci.prototype=Ti.prototype={constructor:Ci,on:function(t,e){var i,n,r=this._,s=(n=r,(t+"").trim().split(/^|\s+/).map((function(t){var e="",i=t.indexOf(".");if(i>=0&&(e=t.slice(i+1),t=t.slice(0,i)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))),a=-1,o=s.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++a<o;)if(i=(t=s[a]).type)r[i]=Pi(r[i],t.name,e);else if(null==e)for(i in r)r[i]=Pi(r[i],t.name,null);return this}for(;++a<o;)if((i=(t=s[a]).type)&&(i=Ei(r[i],t.name)))return i},copy:function(){var t={},e=this._;for(var i in e)t[i]=e[i].slice();return new Ci(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var i,n,r=new Array(i),s=0;s<i;++s)r[s]=arguments[s+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(s=0,i=(n=this._[t]).length;s<i;++s)n[s].value.apply(e,r)},apply:function(t,e,i){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var n=this._[t],r=0,s=n.length;r<s;++r)n[r].value.apply(e,i)}};var Ai="http://www.w3.org/1999/xhtml",Li={svg:"http://www.w3.org/2000/svg",xhtml:Ai,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function zi(t){var e=t+="",i=e.indexOf(":");return i>=0&&"xmlns"!==(e=t.slice(0,i))&&(t=t.slice(i+1)),Li.hasOwnProperty(e)?{space:Li[e],local:t}:t}function Ri(t){return function(){var e=this.ownerDocument,i=this.namespaceURI;return i===Ai&&e.documentElement.namespaceURI===Ai?e.createElement(t):e.createElementNS(i,t)}}function Ni(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Di(t){var e=zi(t);return(e.local?Ni:Ri)(e)}function ki(){}function Oi(t){return null==t?ki:function(){return this.querySelector(t)}}function Ii(){return[]}function Fi(t){return null==t?Ii:function(){return this.querySelectorAll(t)}}function qi(t){return function(){return null==(e=t.apply(this,arguments))?[]:Array.isArray(e)?e:Array.from(e);var e}}function Ui(t){return function(){return this.matches(t)}}function Bi(t){return function(e){return e.matches(t)}}var $i=Array.prototype.find;function Hi(){return this.firstElementChild}var Gi=Array.prototype.filter;function ji(){return Array.from(this.children)}function Xi(t){return new Array(t.length)}function Vi(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function Wi(t,e,i,n,r,s){for(var a,o=0,l=e.length,h=s.length;o<h;++o)(a=e[o])?(a.__data__=s[o],n[o]=a):i[o]=new Vi(t,s[o]);for(;o<l;++o)(a=e[o])&&(r[o]=a)}function Yi(t,e,i,n,r,s,a){var o,l,h,c=new Map,d=e.length,u=s.length,f=new Array(d);for(o=0;o<d;++o)(l=e[o])&&(f[o]=h=a.call(l,l.__data__,o,e)+"",c.has(h)?r[o]=l:c.set(h,l));for(o=0;o<u;++o)h=a.call(t,s[o],o,s)+"",(l=c.get(h))?(n[o]=l,l.__data__=s[o],c.delete(h)):i[o]=new Vi(t,s[o]);for(o=0;o<d;++o)(l=e[o])&&c.get(f[o])===l&&(r[o]=l)}function Zi(t){return t.__data__}function Ki(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function Ji(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Qi(t){return function(){this.removeAttribute(t)}}function tn(t){return function(){this.removeAttributeNS(t.space,t.local)}}function en(t,e){return function(){this.setAttribute(t,e)}}function nn(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function rn(t,e){return function(){var i=e.apply(this,arguments);null==i?this.removeAttribute(t):this.setAttribute(t,i)}}function sn(t,e){return function(){var i=e.apply(this,arguments);null==i?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,i)}}function an(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function on(t){return function(){this.style.removeProperty(t)}}function ln(t,e,i){return function(){this.style.setProperty(t,e,i)}}function hn(t,e,i){return function(){var n=e.apply(this,arguments);null==n?this.style.removeProperty(t):this.style.setProperty(t,n,i)}}function cn(t,e){return t.style.getPropertyValue(e)||an(t).getComputedStyle(t,null).getPropertyValue(e)}function dn(t){return function(){del