@petal-nexus/toolkit 0.1.0 → 0.1.1
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.
- package/README.md +31 -12
- package/dist/petal-toolkit.cjs10.js +1 -1
- package/dist/petal-toolkit.cjs11.js +1 -1
- package/dist/petal-toolkit.cjs1123.js +1 -1
- package/dist/petal-toolkit.cjs1125.js +1 -1
- package/dist/petal-toolkit.cjs1128.js +1 -1
- package/dist/petal-toolkit.cjs12.js +1 -1
- package/dist/petal-toolkit.cjs13.js +1 -1
- package/dist/petal-toolkit.cjs1320.js +1 -1
- package/dist/petal-toolkit.cjs1320.js.map +1 -1
- package/dist/petal-toolkit.cjs1321.js +1 -1
- package/dist/petal-toolkit.cjs1321.js.map +1 -1
- package/dist/petal-toolkit.cjs1322.js +1 -2
- package/dist/petal-toolkit.cjs1322.js.map +1 -1
- package/dist/petal-toolkit.cjs1325.js +1 -1
- package/dist/petal-toolkit.cjs1327.js +1 -1
- package/dist/petal-toolkit.cjs1328.js +1 -1
- package/dist/petal-toolkit.cjs1329.js +1 -1
- package/dist/petal-toolkit.cjs1329.js.map +1 -1
- package/dist/petal-toolkit.cjs1330.js +1 -1
- package/dist/petal-toolkit.cjs1330.js.map +1 -1
- package/dist/petal-toolkit.cjs1331.js +2 -1
- package/dist/petal-toolkit.cjs1331.js.map +1 -1
- package/dist/petal-toolkit.cjs1332.js +1 -1
- package/dist/petal-toolkit.cjs1332.js.map +1 -1
- package/dist/petal-toolkit.cjs1333.js +1 -1
- package/dist/petal-toolkit.cjs1333.js.map +1 -1
- package/dist/petal-toolkit.cjs1334.js +1 -1
- package/dist/petal-toolkit.cjs1334.js.map +1 -1
- package/dist/petal-toolkit.cjs1335.js +1 -1
- package/dist/petal-toolkit.cjs1346.js +1 -1
- package/dist/petal-toolkit.cjs1347.js +1 -1
- package/dist/petal-toolkit.cjs1348.js +1 -1
- package/dist/petal-toolkit.cjs14.js +1 -1
- package/dist/petal-toolkit.cjs15.js +1 -1
- package/dist/petal-toolkit.cjs18.js +1 -1
- package/dist/petal-toolkit.cjs19.js +1 -1
- package/dist/petal-toolkit.cjs22.js +1 -1
- package/dist/petal-toolkit.cjs24.js +1 -1
- package/dist/petal-toolkit.cjs25.js +1 -1
- package/dist/petal-toolkit.cjs26.js +1 -1
- package/dist/petal-toolkit.cjs27.js +1 -1
- package/dist/petal-toolkit.cjs30.js +1 -1
- package/dist/petal-toolkit.cjs31.js +1 -1
- package/dist/petal-toolkit.cjs32.js +1 -1
- package/dist/petal-toolkit.cjs34.js +1 -1
- package/dist/petal-toolkit.cjs35.js +1 -1
- package/dist/petal-toolkit.cjs36.js +1 -1
- package/dist/petal-toolkit.cjs37.js +1 -1
- package/dist/petal-toolkit.cjs38.js +1 -1
- package/dist/petal-toolkit.cjs4.js +1 -1
- package/dist/petal-toolkit.cjs40.js +1 -1
- package/dist/petal-toolkit.cjs41.js +1 -1
- package/dist/petal-toolkit.cjs42.js +1 -1
- package/dist/petal-toolkit.cjs43.js +1 -1
- package/dist/petal-toolkit.cjs44.js +1 -1
- package/dist/petal-toolkit.cjs45.js +1 -1
- package/dist/petal-toolkit.cjs47.js +1 -1
- package/dist/petal-toolkit.cjs48.js +1 -1
- package/dist/petal-toolkit.cjs5.js +1 -1
- package/dist/petal-toolkit.cjs50.js +1 -1
- package/dist/petal-toolkit.cjs52.js +1 -1
- package/dist/petal-toolkit.cjs6.js +1 -1
- package/dist/petal-toolkit.cjs682.js +1 -1
- package/dist/petal-toolkit.cjs684.js +1 -1
- package/dist/petal-toolkit.cjs7.js +1 -1
- package/dist/petal-toolkit.cjs715.js +1 -1
- package/dist/petal-toolkit.cjs719.js +1 -1
- package/dist/petal-toolkit.cjs721.js +1 -1
- package/dist/petal-toolkit.cjs726.js +1 -1
- package/dist/petal-toolkit.cjs734.js +1 -1
- package/dist/petal-toolkit.cjs752.js +1 -1
- package/dist/petal-toolkit.cjs764.js +1 -1
- package/dist/petal-toolkit.cjs787.js +1 -1
- package/dist/petal-toolkit.cjs8.js +1 -1
- package/dist/petal-toolkit.cjs847.js +1 -1
- package/dist/petal-toolkit.cjs848.js +1 -1
- package/dist/petal-toolkit.cjs850.js +1 -1
- package/dist/petal-toolkit.cjs851.js +1 -1
- package/dist/petal-toolkit.cjs854.js +1 -1
- package/dist/petal-toolkit.cjs859.js +1 -1
- package/dist/petal-toolkit.cjs861.js +1 -1
- package/dist/petal-toolkit.cjs864.js +1 -1
- package/dist/petal-toolkit.cjs866.js +1 -1
- package/dist/petal-toolkit.cjs867.js +1 -1
- package/dist/petal-toolkit.cjs868.js +1 -1
- package/dist/petal-toolkit.cjs870.js +1 -1
- package/dist/petal-toolkit.cjs874.js +1 -1
- package/dist/petal-toolkit.cjs9.js +1 -1
- package/dist/petal-toolkit.es10.js +3 -3
- package/dist/petal-toolkit.es11.js +3 -3
- package/dist/petal-toolkit.es1123.js +1 -1
- package/dist/petal-toolkit.es1125.js +1 -1
- package/dist/petal-toolkit.es1128.js +1 -1
- package/dist/petal-toolkit.es12.js +3 -3
- package/dist/petal-toolkit.es13.js +2 -2
- package/dist/petal-toolkit.es1320.js +2 -34
- package/dist/petal-toolkit.es1320.js.map +1 -1
- package/dist/petal-toolkit.es1321.js +2 -52
- package/dist/petal-toolkit.es1321.js.map +1 -1
- package/dist/petal-toolkit.es1322.js +2 -48
- package/dist/petal-toolkit.es1322.js.map +1 -1
- package/dist/petal-toolkit.es1324.js +2 -2
- package/dist/petal-toolkit.es1325.js +2 -2
- package/dist/petal-toolkit.es1326.js +2 -2
- package/dist/petal-toolkit.es1327.js +2 -2
- package/dist/petal-toolkit.es1328.js +2 -2
- package/dist/petal-toolkit.es1329.js +52 -2
- package/dist/petal-toolkit.es1329.js.map +1 -1
- package/dist/petal-toolkit.es1330.js +95 -2
- package/dist/petal-toolkit.es1330.js.map +1 -1
- package/dist/petal-toolkit.es1331.js +48 -2
- package/dist/petal-toolkit.es1331.js.map +1 -1
- package/dist/petal-toolkit.es1332.js +34 -17
- package/dist/petal-toolkit.es1332.js.map +1 -1
- package/dist/petal-toolkit.es1333.js +2 -95
- package/dist/petal-toolkit.es1333.js.map +1 -1
- package/dist/petal-toolkit.es1334.js +17 -2
- package/dist/petal-toolkit.es1334.js.map +1 -1
- package/dist/petal-toolkit.es1335.js +2 -2
- package/dist/petal-toolkit.es1338.js +2 -2
- package/dist/petal-toolkit.es1339.js +2 -2
- package/dist/petal-toolkit.es1340.js +2 -2
- package/dist/petal-toolkit.es1341.js +2 -2
- package/dist/petal-toolkit.es1343.js +2 -2
- package/dist/petal-toolkit.es1344.js +2 -2
- package/dist/petal-toolkit.es1346.js +2 -2
- package/dist/petal-toolkit.es1347.js +2 -2
- package/dist/petal-toolkit.es1348.js +2 -2
- package/dist/petal-toolkit.es14.js +2 -2
- package/dist/petal-toolkit.es15.js +2 -2
- package/dist/petal-toolkit.es18.js +3 -3
- package/dist/petal-toolkit.es19.js +3 -3
- package/dist/petal-toolkit.es22.js +2 -2
- package/dist/petal-toolkit.es24.js +2 -2
- package/dist/petal-toolkit.es25.js +2 -2
- package/dist/petal-toolkit.es26.js +2 -2
- package/dist/petal-toolkit.es27.js +3 -3
- package/dist/petal-toolkit.es30.js +1 -1
- package/dist/petal-toolkit.es31.js +2 -2
- package/dist/petal-toolkit.es32.js +2 -2
- package/dist/petal-toolkit.es34.js +2 -2
- package/dist/petal-toolkit.es35.js +1 -1
- package/dist/petal-toolkit.es36.js +2 -2
- package/dist/petal-toolkit.es37.js +2 -2
- package/dist/petal-toolkit.es38.js +1 -1
- package/dist/petal-toolkit.es4.js +2 -2
- package/dist/petal-toolkit.es40.js +2 -2
- package/dist/petal-toolkit.es41.js +2 -2
- package/dist/petal-toolkit.es42.js +2 -2
- package/dist/petal-toolkit.es43.js +2 -2
- package/dist/petal-toolkit.es44.js +3 -3
- package/dist/petal-toolkit.es45.js +2 -2
- package/dist/petal-toolkit.es47.js +2 -2
- package/dist/petal-toolkit.es48.js +1 -1
- package/dist/petal-toolkit.es5.js +2 -2
- package/dist/petal-toolkit.es50.js +1 -1
- package/dist/petal-toolkit.es52.js +2 -2
- package/dist/petal-toolkit.es6.js +3 -3
- package/dist/petal-toolkit.es682.js +1 -1
- package/dist/petal-toolkit.es684.js +1 -1
- package/dist/petal-toolkit.es7.js +2 -2
- package/dist/petal-toolkit.es715.js +1 -1
- package/dist/petal-toolkit.es719.js +1 -1
- package/dist/petal-toolkit.es721.js +1 -1
- package/dist/petal-toolkit.es726.js +1 -1
- package/dist/petal-toolkit.es734.js +1 -1
- package/dist/petal-toolkit.es752.js +1 -1
- package/dist/petal-toolkit.es764.js +1 -1
- package/dist/petal-toolkit.es787.js +1 -1
- package/dist/petal-toolkit.es8.js +1 -1
- package/dist/petal-toolkit.es847.js +1 -1
- package/dist/petal-toolkit.es848.js +1 -1
- package/dist/petal-toolkit.es850.js +1 -1
- package/dist/petal-toolkit.es851.js +1 -1
- package/dist/petal-toolkit.es854.js +1 -1
- package/dist/petal-toolkit.es859.js +1 -1
- package/dist/petal-toolkit.es861.js +1 -1
- package/dist/petal-toolkit.es864.js +1 -1
- package/dist/petal-toolkit.es866.js +1 -1
- package/dist/petal-toolkit.es867.js +1 -1
- package/dist/petal-toolkit.es868.js +1 -1
- package/dist/petal-toolkit.es870.js +1 -1
- package/dist/petal-toolkit.es874.js +1 -1
- package/dist/petal-toolkit.es9.js +3 -3
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const X=require("react/jsx-runtime"),g=require("react"),i=require("./petal-toolkit.cjs59.js"),j=require("./petal-toolkit.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const X=require("react/jsx-runtime"),g=require("react"),i=require("./petal-toolkit.cjs59.js"),j=require("./petal-toolkit.cjs1329.js"),A=require("./petal-toolkit.cjs55.js"),y=require("./petal-toolkit.cjs1331.js"),h=require("./petal-toolkit.cjs58.js");function B(f){switch(f){case"light":return{currentAssetsColor:"#16a34a",currentLiabilitiesColor:"#dc2626",netWorkingCapitalColor:"#3b82f6"};case"navy":return{currentAssetsColor:"#10b981",currentLiabilitiesColor:"#f43f5e",netWorkingCapitalColor:"#60a5fa"};case"dark":default:return{currentAssetsColor:"#00FFB3",currentLiabilitiesColor:"#FF4757",netWorkingCapitalColor:"#3B82F6"}}}const P=g.memo(function({data:s,width:W="100%",height:w=400,className:L,themePreset:S="dark",theme:E,showLegend:b=!0,showComponents:k=!0,onChartReady:c}){const{containerId:u,containerRef:x,surfaceRef:l,sciChartTheme:F,baseColors:n,containerStyle:M}=j.useFinancialChartSetup({chartName:"working-capital",width:W,height:w,themePreset:S,customTheme:E}),a=B(S);return g.useEffect(()=>{if(!x.current||s.length===0)return;let m=!1;return(async()=>{try{const C=s.map(e=>e.period),{sciChartSurface:r,wasmContext:t}=await i.scichartExports.SciChartSurface.create(u,{theme:F});if(m){r.delete();return}l.current=r;const q=A.createCategoryXAxis(t,{labelColor:n.axisLabelColor,labels:C});r.xAxes.add(q);const D=A.createNumericYAxis(t,{labelColor:n.axisLabelColor,gridColor:n.gridColor,labelFormatter:e=>Math.abs(e)>=1e9?`$${(e/1e9).toFixed(1)}B`:Math.abs(e)>=1e6?`$${(e/1e6).toFixed(0)}M`:`$${e.toFixed(0)}`});r.yAxes.add(D);const d=s.map((e,p)=>p);if(k){const e=new i.scichartExports.XyDataSeries(t,{xValues:d.map(o=>o-.15),yValues:s.map(o=>o.currentAssets),dataSeriesName:"Current Assets"}),p=new i.scichartExports.FastColumnRenderableSeries(t,{dataSeries:e,fill:a.currentAssetsColor+"AA",stroke:a.currentAssetsColor,strokeThickness:0,dataPointWidth:.25});r.renderableSeries.add(p);const V=new i.scichartExports.XyDataSeries(t,{xValues:d.map(o=>o+.15),yValues:s.map(o=>o.currentLiabilities),dataSeriesName:"Current Liabilities"}),$=new i.scichartExports.FastColumnRenderableSeries(t,{dataSeries:V,fill:a.currentLiabilitiesColor+"AA",stroke:a.currentLiabilitiesColor,strokeThickness:0,dataPointWidth:.25});r.renderableSeries.add($)}const N=new i.scichartExports.XyDataSeries(t,{xValues:d,yValues:s.map(e=>e.netWorkingCapital),dataSeriesName:"Net Working Capital"}),T=new i.scichartExports.FastLineRenderableSeries(t,{dataSeries:N,stroke:a.netWorkingCapitalColor,strokeThickness:3,pointMarker:new i.scichartExports.EllipsePointMarker(t,{width:10,height:10,fill:a.netWorkingCapitalColor,stroke:"#FFFFFF",strokeThickness:2})});r.renderableSeries.add(T),y.addStandardModifiers(r,{crosshairColor:n.crosshairColor,valueFormatters:{"Current Assets":h.tooltipFormatters.currency,"Current Liabilities":h.tooltipFormatters.currency,"Net Working Capital":h.tooltipFormatters.currency}}),b&&y.addLegendModifier(r),c==null||c(r)}catch(C){console.error("Failed to initialize WorkingCapitalChart:",C)}})(),()=>{m=!0,l.current&&(l.current.delete(),l.current=null)}},[s,u,F,n,a,b,k,c]),X.jsx("div",{ref:x,id:u,className:L,style:M})});exports.WorkingCapitalChart=P;
|
|
2
2
|
//# sourceMappingURL=petal-toolkit.cjs52.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("react/jsx-runtime"),x=require("react"),M=require("./petal-toolkit.cjs59.js"),T=require("./petal-toolkit.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("react/jsx-runtime"),x=require("react"),M=require("./petal-toolkit.cjs59.js"),T=require("./petal-toolkit.cjs1329.js"),p=require("./petal-toolkit.cjs55.js"),j=require("./petal-toolkit.cjs1330.js"),y=require("./petal-toolkit.cjs1331.js"),k=require("./petal-toolkit.cjs58.js");function L(l){switch(l){case"light":return{turnoverColor:"#3b82f6"};case"navy":return{turnoverColor:"#60a5fa"};case"dark":default:return{turnoverColor:"#3B82F6"}}}const w=x.memo(function({data:t,width:b="100%",height:v=400,className:F,themePreset:u="dark",theme:S,showLegend:f=!0,onChartReady:i}){const{containerId:a,containerRef:d,surfaceRef:s,sciChartTheme:C,baseColors:o,containerStyle:A}=T.useFinancialChartSetup({chartName:"asset-efficiency",width:b,height:v,themePreset:u,customTheme:S}),h=L(u);return x.useEffect(()=>{if(!d.current||t.length===0)return;let m=!1;return(async()=>{try{const c=t.map(r=>r.period),g=t.map((r,q)=>q),{sciChartSurface:e,wasmContext:n}=await M.scichartExports.SciChartSurface.create(a,{theme:C});if(m){e.delete();return}s.current=e,e.xAxes.add(p.createCategoryXAxis(n,{labelColor:o.axisLabelColor,labels:c})),e.yAxes.add(p.createNumericYAxis(n,{labelColor:o.axisLabelColor,gridColor:o.gridColor,labelFormatter:r=>`${r.toFixed(2)}x`})),e.renderableSeries.add(j.createLineSeries(n,{xValues:g,yValues:t.map(r=>r.assetTurnover),name:"Asset Turnover",color:h.turnoverColor,pointMarker:{size:10}})),y.addStandardModifiers(e,{crosshairColor:o.crosshairColor,valueFormatters:{"Asset Turnover":k.tooltipFormatters.multiplier}}),f&&y.addLegendModifier(e),i==null||i(e)}catch(c){console.error("Failed to initialize AssetEfficiencyChart:",c)}})(),()=>{m=!0,s.current&&(s.current.delete(),s.current=null)}},[t,a,C,o,h,f,i]),E.jsx("div",{ref:d,id:a,className:F,style:A})});exports.AssetEfficiencyChart=w;
|
|
2
2
|
//# sourceMappingURL=petal-toolkit.cjs6.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("./petal-toolkit.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("./petal-toolkit.cjs1320.js");var L;function S(){return L||(L=1,(function(E){Object.defineProperty(E,"__esModule",{value:!0}),E.PROPERTY=void 0,(function(_){_.ALLOWS_MULTI_SELECTION="ALLOWS_MULTI_SELECTION",_.ALLOW_TOOLTIP_OVERLAPPING="ALLOW_TOOLTIP_OVERLAPPING",_.CROSSHAIR_STROKE="CROSSHAIR_STROKE",_.EXECUTE_CONDITION="EXECUTE_CONDITION",_.FILL="FILL",_.HIT_TEST_RADIUS="HIT_TEST_RADIUS",_.IS_ATTACHED="IS_ATTACHED",_.IS_ENABLED="IS_ENABLED",_.PARENT_SURFACE="PARENT_SURFACE",_.RECEIVE_HANDLED_EVENTS="RECEIVE_HANDLED_EVENTS",_.SHOW_ROLLOVER_LINE="SHOW_ROLLOVER_LINE",_.SHOW_TOOLTIP="SHOW_TOOLTIP",_.SECONDARY_EXECUTE_CONDITION="SECONDARY_EXECUTE_CONDITION",_.SELECTED_AREA="SELECTED_AREA",_.SELECTION_FILL="SELECTION_FILL",_.SELECTION_STROKE="SELECTION_STROKE",_.SELECTION_STROKE_THICKNESS="SELECTION_STROKE_THICKNESS",_.STROKE="STROKE",_.STROKE_THICKNESS="STROKE_THICKNESS",_.STROKE_DASH_ARRAY="STROKE_DASH_ARRAY",_.TOOLTIP_DATA_TEMPLATE="TOOLTIP_DATA_TEMPLATE",_.X_AXIS_ID="X_AXIS_ID",_.Y_AXIS_ID="Y_AXIS_ID",_.PLACEMENT_DIV_ID="PLACEMENT_DIV_ID",_.X_LINE="X_LINE",_.Y_LINE="Y_LINE",_.AXIS_LABELS="AXIS_LABELS",_.ANGULAR_AXIS_LABELS_PLACEMENT="ANGULAR_AXIS_LABELS_PLACEMENT",_.RADIAL_AXIS_LABELS_PLACEMENT="RADIAL_AXIS_LABELS_PLACEMENT",_.X1="X1",_.X_COORDINATE_MODE="X_COORDINATE_MODE",_.IS_DRAGGABLE="IS_DRAGGABLE",_.LINE_ANNOTATIONS_OPTIONS="LINE_ANNOTATIONS_OPTIONS",_.LINE_SELECTION_COLOR="LINE_SELECTION_COLOR",_.TOOLTIP_SHADOW="TOOLTIP_SHADOW"})(E.PROPERTY||(E.PROPERTY={}))})(I.__exports)),I.__exports}exports.__require=S;
|
|
2
2
|
//# sourceMappingURL=petal-toolkit.cjs682.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./petal-toolkit.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./petal-toolkit.cjs1321.js");var s;function d(){if(s)return r.__exports;s=1,Object.defineProperty(r.__exports,"__esModule",{value:!0}),r.__exports.updateAxisIds=void 0;function u(e){var i,t;e.parentSurface&&(e.xAxisId||(e.xAxisId=(i=e.parentSurface.getDefaultXAxis())===null||i===void 0?void 0:i.id),e.yAxisId||(e.yAxisId=(t=e.parentSurface.getDefaultYAxis())===null||t===void 0?void 0:t.id))}return r.__exports.updateAxisIds=u,r.__exports}exports.__require=d;
|
|
2
2
|
//# sourceMappingURL=petal-toolkit.cjs684.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("react/jsx-runtime"),g=require("react"),a=require("./petal-toolkit.cjs59.js"),N=require("./petal-toolkit.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("react/jsx-runtime"),g=require("react"),a=require("./petal-toolkit.cjs59.js"),N=require("./petal-toolkit.cjs1329.js"),m=require("./petal-toolkit.cjs55.js"),V=require("./petal-toolkit.cjs1331.js"),y=require("./petal-toolkit.cjs58.js");function j(k){switch(k){case"light":return{bookValueColor:"#16a34a",tangibleColor:"#3b82f6"};case"navy":return{bookValueColor:"#10b981",tangibleColor:"#60a5fa"};case"dark":default:return{bookValueColor:"#00FFB3",tangibleColor:"#3B82F6"}}}const X=g.memo(function({data:t,width:B="100%",height:E=400,className:w,themePreset:d="dark",theme:M,showLegend:C=!0,showTangibleValue:S=!0,onChartReady:l}){const{containerId:u,containerRef:F,surfaceRef:n,sciChartTheme:f,baseColors:i,containerStyle:T}=N.useFinancialChartSetup({chartName:"book-value",width:B,height:E,themePreset:d,customTheme:M}),s=j(d),x=t.some(c=>c.tangibleBookValuePerShare!==void 0);return g.useEffect(()=>{if(!F.current||t.length===0)return;let c=!1;return(async()=>{try{const h=t.map(o=>o.period),{sciChartSurface:e,wasmContext:r}=await a.scichartExports.SciChartSurface.create(u,{theme:f});if(c){e.delete();return}n.current=e;const q=m.createCategoryXAxis(r,{labelColor:i.axisLabelColor,labels:h});e.xAxes.add(q);const v=m.createNumericYAxis(r,{labelColor:i.axisLabelColor,gridColor:i.gridColor,labelFormatter:o=>`$${o.toFixed(2)}`});e.yAxes.add(v);const p=t.map((o,b)=>b),A=new a.scichartExports.XyDataSeries(r,{xValues:p,yValues:t.map(o=>o.bookValuePerShare),dataSeriesName:"Book Value/Share"}),D=new a.scichartExports.FastLineRenderableSeries(r,{dataSeries:A,stroke:s.bookValueColor,strokeThickness:3,pointMarker:new a.scichartExports.EllipsePointMarker(r,{width:8,height:8,fill:s.bookValueColor,stroke:"#FFFFFF",strokeThickness:2})});if(e.renderableSeries.add(D),S&&x){const o=new a.scichartExports.XyDataSeries(r,{xValues:p,yValues:t.map(P=>P.tangibleBookValuePerShare??0),dataSeriesName:"Tangible BV/Share"}),b=new a.scichartExports.FastLineRenderableSeries(r,{dataSeries:o,stroke:s.tangibleColor,strokeThickness:2,pointMarker:new a.scichartExports.EllipsePointMarker(r,{width:6,height:6,fill:s.tangibleColor,stroke:"#FFFFFF",strokeThickness:1})});e.renderableSeries.add(b)}V.addStandardModifiers(e,{crosshairColor:i.crosshairColor,valueFormatters:{"Book Value/Share":y.tooltipFormatters.currency,"Tangible BV/Share":y.tooltipFormatters.currency}}),C&&V.addLegendModifier(e),l==null||l(e)}catch(h){console.error("Failed to initialize BookValueChart:",h)}})(),()=>{c=!0,n.current&&(n.current.delete(),n.current=null)}},[t,u,f,i,s,C,S,x,l]),L.jsx("div",{ref:F,id:u,className:w,style:T})});exports.BookValueChart=X;
|
|
2
2
|
//# sourceMappingURL=petal-toolkit.cjs7.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./petal-toolkit.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./petal-toolkit.cjs1322.js"),p=require("./petal-toolkit.cjs551.js"),d=require("./petal-toolkit.cjs552.js"),y=require("./petal-toolkit.cjs657.js"),C=require("./petal-toolkit.cjs108.js");var u;function v(){if(u)return n.__exports;u=1;var l=n.__exports&&n.__exports.__extends||(function(){var o=function(r,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(e[a]=i[a])},o(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");o(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})();Object.defineProperty(n.__exports,"__esModule",{value:!0}),n.__exports.BaseCache=void 0;var _=p.__require(),c=d.__require(),f=y.__require(),s=C.__require(),h=(function(o){l(r,o);function r(t){var e=o.call(this)||this;return e.webAssemblyContext=t,t&&s.WebGlRenderContext2D.webGlResourcesRefs.add(e),e}return Object.defineProperty(r.prototype,"value",{get:function(){return this.cachedEntity},enumerable:!1,configurable:!0}),r.prototype.invalidateCache=function(){this.cachedEntity=(0,c.deleteSafe)(this.cachedEntity)},r.prototype.resetCache=function(){this.invalidateCache()},r.prototype.delete=function(){var t=this;this.cachedEntity=(0,c.deleteSafe)(this.cachedEntity),s.WebGlRenderContext2D.webGlResourcesRefs.delete(this);try{process.env.NODE_ENV!=="production"&&f.MemoryUsageHelper.isMemoryUsageDebugEnabled&&s.WebGlRenderContext2D.webGlResourcesRefs.forEach(function(e){e.resetCache===t.resetCache&&s.WebGlRenderContext2D.webGlResourcesRefs.delete(e)})}catch(e){console.warn(e)}this.webAssemblyContext=void 0},r})(_.DeletableEntity);return n.__exports.BaseCache=h,n.__exports}exports.__require=v;
|
|
2
2
|
//# sourceMappingURL=petal-toolkit.cjs715.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./petal-toolkit.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./petal-toolkit.cjs1323.js");var t;function s(){return t||(t=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.EDrawingTypes=void 0,(function(n){n.WasmBrush="WasmBrush",n.WasmPen="WasmPen"})(e.EDrawingTypes||(e.EDrawingTypes={}))})(r.__exports)),r.__exports}exports.__require=s;
|
|
2
2
|
//# sourceMappingURL=petal-toolkit.cjs719.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./petal-toolkit.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./petal-toolkit.cjs1324.js");var o;function t(){if(o)return e.__exports;o=1;var _;Object.defineProperty(e.__exports,"__esModule",{value:!0}),e.__exports.EPSILON=e.__exports.DEFAULT_HEIGHT=e.__exports.DEFAULT_WIDTH=e.__exports.IS_TEST_ENV=void 0;var r=!1;return e.__exports.IS_TEST_ENV=r,typeof process<"u"&&(e.__exports.IS_TEST_ENV=r=((_=process.env)===null||_===void 0?void 0:_.TEST_ENV)==="1"),e.__exports.DEFAULT_WIDTH=900,e.__exports.DEFAULT_HEIGHT=600,e.__exports.EPSILON=1e-4,e.__exports}exports.__require=t;
|
|
2
2
|
//# sourceMappingURL=petal-toolkit.cjs721.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("./petal-toolkit.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("./petal-toolkit.cjs1325.js");var r;function n(){return r||(r=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.PROPERTY=void 0,(function(t){t.AXIS_POSITION_COORDINATE="AXIS_POSITION_COORDINATE",t.COORDINATE_MODE="COORDINATE_MODE",t.VERTICAL_AXIS_ID="VERTICAL_AXIS_ID"})(e.PROPERTY||(e.PROPERTY={}))})(_.__exports)),_.__exports}exports.__require=n;
|
|
2
2
|
//# sourceMappingURL=petal-toolkit.cjs726.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./petal-toolkit.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./petal-toolkit.cjs1326.js");var r;function o(){if(r)return t.__exports;r=1,Object.defineProperty(t.__exports,"__esModule",{value:!0}),t.__exports.LayoutStrategyAxes=void 0;var s=(function(){function e(){this.topInnerAxes=[],this.bottomInnerAxes=[],this.leftInnerAxes=[],this.rightInnerAxes=[],this.topOuterAxes=[],this.bottomOuterAxes=[],this.leftOuterAxes=[],this.rightOuterAxes=[]}return e.prototype.clear=function(){this.topInnerAxes=[],this.bottomInnerAxes=[],this.leftInnerAxes=[],this.rightInnerAxes=[],this.topOuterAxes=[],this.bottomOuterAxes=[],this.leftOuterAxes=[],this.rightOuterAxes=[]},e})();return t.__exports.LayoutStrategyAxes=s,t.__exports}exports.__require=o;
|
|
2
2
|
//# sourceMappingURL=petal-toolkit.cjs734.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./petal-toolkit.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./petal-toolkit.cjs1327.js"),d=require("./petal-toolkit.cjs556.js");var c;function f(){return c||(c=1,(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.appendDoubleVectorFromJsArray=r.memCopyFloat32=r.insertDoubleVectorFromJsArray=r.SIZEOF_FLOAT32=r.SIZEOF_NUMBER=void 0;var u=d.__require();r.SIZEOF_NUMBER=8,r.SIZEOF_FLOAT32=4;function m(o,a,e,t){u.Guard.notNull(o,"wasmContext"),u.Guard.notNull(a,"source"),u.Guard.notNull(e,"dest"),u.Guard.isTrue(t>=0,"destIndex must be greater than or equal to zero"),u.Guard.isTrue(t<=e.size(),"destIndex must be less than or equal to dest.size()");var n=a.length;if(n!==0){var i=e.size();e.resizeFast(i+n),t<i&&o.SCRTMemMove(e.dataPtr(t+n),e.dataPtr(t),(i-t)*r.SIZEOF_NUMBER),o.HEAPF64.set(a,e.dataPtr(t)/r.SIZEOF_NUMBER)}}r.insertDoubleVectorFromJsArray=m;function b(o,a,e,t){u.Guard.notNull(o,"wasmContext"),u.Guard.notNull(a,"source"),u.Guard.notNull(e,"dest"),u.Guard.isTrue(t>=0,"destIndex must be greater than or equal to zero"),u.Guard.isTrue(t<=e.size()+a.length,"destIndex must be less than or equal to dest.size() + source.Length");var n=a.length;n!==0&&o.HEAPF32.set(a,e.dataPtr(t)/r.SIZEOF_FLOAT32)}r.memCopyFloat32=b;function s(o,a,e,t){var n=a.size(),i=e.length,F=n,_=F+i;try{a.resizeFast(_)}catch(E){throw new Error("Out of memory exception. Heap size: ".concat(o.HEAPF64.buffer.byteLength/(1024*1024)," mb"),E)}var y=a.dataPtr(F);o.HEAPF64.set(e,y/r.SIZEOF_NUMBER)}r.appendDoubleVectorFromJsArray=s})(l.__exports)),l.__exports}exports.__require=f;
|
|
2
2
|
//# sourceMappingURL=petal-toolkit.cjs752.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./petal-toolkit.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./petal-toolkit.cjs1328.js");var r;function t(){return r||(r=1,Object.defineProperty(e.__exports,"__esModule",{value:!0})),e.__exports}exports.__require=t;
|
|
2
2
|
//# sourceMappingURL=petal-toolkit.cjs764.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./petal-toolkit.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./petal-toolkit.cjs1333.js"),n=require("./petal-toolkit.cjs563.js");var r;function i(){if(r)return a.__exports;r=1,Object.defineProperty(a.__exports,"__esModule",{value:!0}),a.__exports.performanceWarnings=void 0;var e=n.__require();return a.__exports.performanceWarnings={dataDistributionFlagNaN:new e.OneTimePerformanceWarning("Data Distribution flag (BaseDataSeries.containsNaN = false) can be applied to improve performance. Read this website article https://www.scichart.com/documentation/js/current/DataSeries_Resampling.html for more info. To disable this warning set SciChartDefaults.performanceWarnings = false"),dataDistributionFlagSortedAscending:new e.OneTimePerformanceWarning("Data Distribution flag (BaseDataSeries.isSorted = true) can be applied to improve performance. Read this website article https://www.scichart.com/documentation/js/current/DataSeries_Resampling.html for more info. To disable this warning set SciChartDefaults.performanceWarnings = false"),subchartBackgroundNotSimpleColor:new e.OneTimePerformanceWarning("When using isTransparent: false on a SubChart, the background needs to be a simple color, not an html gradient (which the default theme uses). To disable this warning set SciChartDefaults.performanceWarnings = false"),dataLabelsSkippingMany:new e.OneTimePerformanceWarning("DataLabelProvider generated many more labels than it could display. To improve performance consider increasing the pointGapThreshold, increasing the skipNumber, or decreasing the pointCountThreshold. To disable this warning set SciChartDefaults.performanceWarnings = false"),dateTimeDeltaCalculatorBadDelta:new e.OneTimePerformanceWarning(`The DateTimeDeltaCalculator could not find a suitable delta given the current settings.
|
|
2
2
|
Either increase axis.maxAutoTicks, set axis.deltaCalculator.minTicks less than maxAutoTicks / 3, or set possibleDeltas to an array containing more closely spaced values.
|
|
3
3
|
To disable this warning set SciChartDefaults.performanceWarnings = false`)},a.__exports}exports.__require=i;
|
|
4
4
|
//# sourceMappingURL=petal-toolkit.cjs787.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),a=require("react"),e=require("./petal-toolkit.cjs59.js"),w=require("./petal-toolkit.cjs60.js"),g=require("./petal-toolkit.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),a=require("react"),e=require("./petal-toolkit.cjs59.js"),w=require("./petal-toolkit.cjs60.js"),g=require("./petal-toolkit.cjs1332.js"),$=require("./petal-toolkit.cjs29.js"),G=a.memo(function({data:t,width:m="100%",height:x=400,className:S,themePreset:n="dark",theme:D,onChartReady:h}){const M=a.useId(),f=a.useRef(null),o=a.useRef(null),b=D??w.getThemeFromPreset(n),C=w.getBaseThemeColors(n),p=`candlestick-main-${M}`;a.useEffect(()=>{if(!f.current||t.length===0)return;let c=!1;return(async()=>{try{const s=t.map(r=>g.toUnixTimestamp(r.date)),u=t.map(r=>r.open),i=t.map(r=>r.high),L=t.map(r=>r.low),A=t.map(r=>r.close),v=[{type:e.scichartExports.EChart2DModifierType.ZoomPan,options:{xyDirection:e.scichartExports.EXyDirection.XDirection}},{type:e.scichartExports.EChart2DModifierType.MouseWheelZoom,options:{xyDirection:e.scichartExports.EXyDirection.XDirection}},{type:e.scichartExports.EChart2DModifierType.ZoomExtents,options:{xyDirection:e.scichartExports.EXyDirection.XDirection}}],j=[{surface:{id:"mainChart",position:new e.scichartExports.Rect(0,0,1,1),theme:b,subChartContainerId:p},xAxes:{type:e.scichartExports.EAxisType.DateTimeNumericAxis,options:{drawLabels:!0,autoRange:e.scichartExports.EAutoRange.Always,drawMajorGridLines:!0,drawMinorGridLines:!1,drawMajorTickLines:!0,drawMinorTickLines:!1,maxAutoTicks:10,axisBandsFill:"transparent",majorGridLineStyle:{color:C.gridColor,strokeThickness:.5},labelStyle:{color:C.textColor,fontSize:10}}},yAxes:[{type:e.scichartExports.EAxisType.NumericAxis,options:{autoRange:e.scichartExports.EAutoRange.Always,drawMajorGridLines:!0,drawMinorGridLines:!1,growBy:new e.scichartExports.NumberRange(.1,.1),labelFormat:e.scichartExports.ENumericFormat.Decimal,labelPrecision:2}}],series:[{type:e.scichartExports.ESeriesType.CandlestickSeries,ohlcData:{xValues:s,openValues:u,highValues:i,lowValues:L,closeValues:A,dataSeriesName:"OHLC"},options:{dataPointWidth:.7}}],modifiers:v}],{sciChartSurface:l}=await e.scichartExports.chartBuilder.build2DChart(f.current,{subCharts:j});if(c){l.delete();return}o.current=l;const E=l.subCharts[0];if(E){const r=E.xAxes.get(0);if(r!=null&&r.labelProvider){const X=Math.min(...s),R=Math.max(...s);r.labelProvider.formatLabel=q=>g.formatAxisLabel(q,[X,R])}}const F=new $.FinChartLegendModifier({crosshairStroke:"#666666",crosshairStrokeDashArray:[3,3],showAxisLabels:!0,axisLabelFill:n==="light"?"#f0f0f0":"#1a3a4a",axisLabelStroke:n==="light"?"#333333":"#e0e0e0"});l.chartModifiers.add(F),h==null||h(l)}catch(s){console.error("Failed to initialize SciChart:",s)}})(),()=>{c=!0,o.current&&(o.current.delete(),o.current=null)}},[b,n,h]),a.useEffect(()=>{if(!o.current||t.length===0)return;const c=o.current,y=c.subCharts[0];if(!y)return;const s=y.renderableSeries.get(0);if(s&&s.dataSeries){const u=s.dataSeries;u.clear(),u.appendRange(t.map(i=>g.toUnixTimestamp(i.date)),t.map(i=>i.open),t.map(i=>i.high),t.map(i=>i.low),t.map(i=>i.close)),c.invalidateElement()}},[t]);const T={width:typeof m=="number"?`${m}px`:m,height:typeof x=="number"?`${x}px`:x,position:"relative",overflow:"hidden"},k={position:"absolute",width:"100%",height:"100%"};return d.jsxs("div",{className:S,style:T,role:"img","aria-label":`Candlestick chart displaying ${t.length} data points`,"aria-describedby":`${p}-desc`,children:[d.jsx("span",{id:`${p}-desc`,style:{position:"absolute",width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",border:0},children:"Interactive candlestick chart showing price movements over time. Chart includes OHLC data with zoom and pan capabilities."}),d.jsx("div",{ref:f,style:k,children:d.jsx("div",{id:p,style:{position:"absolute",left:0,right:0,top:0,height:"100%"}})})]})});exports.CandlestickChart=G;
|
|
2
2
|
//# sourceMappingURL=petal-toolkit.cjs8.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var $p=Object.defineProperty;var jp=(ye,be,Ce)=>be in ye?$p(ye,be,{enumerable:!0,configurable:!0,writable:!0,value:Ce}):ye[be]=Ce;var ie=(ye,be,Ce)=>jp(ye,typeof be!="symbol"?be+"":be,Ce);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const mt=require("./petal-toolkit.
|
|
1
|
+
"use strict";var $p=Object.defineProperty;var jp=(ye,be,Ce)=>be in ye?$p(ye,be,{enumerable:!0,configurable:!0,writable:!0,value:Ce}):ye[be]=Ce;var ie=(ye,be,Ce)=>jp(ye,typeof be!="symbol"?be+"":be,Ce);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const mt=require("./petal-toolkit.cjs1335.js");var Na;function Vp(){return Na||(Na=1,(function(ye,be){var Ce=(()=>{var gt;var _t=typeof document<"u"?(gt=document.currentScript)==null?void 0:gt.src:void 0;return(function(Ha={}){var pt,_=Ha,ht,tr,za=new Promise((e,r)=>{ht=e,tr=r}),yt=Object.assign({},_),bt=[],Dr="./this.program",Et=(e,r)=>{throw r},me="";function Xa(e){return _.locateFile?_.locateFile(e,me):me+e}var Fr,qa;typeof document<"u"&&document.currentScript&&(me=document.currentScript.src),_t&&(me=_t),me.startsWith("blob:")?me="":me=me.substr(0,me.replace(/[?#].*/,"").lastIndexOf("/")+1),Fr=async e=>{var r=await fetch(e,{credentials:"same-origin"});if(r.ok)return r.arrayBuffer();throw new Error(r.status+" : "+r.url)};var Lr=_.print||console.log.bind(console),oe=_.printErr||console.error.bind(console);Object.assign(_,yt),yt=null,_.arguments&&(bt=_.arguments),_.thisProgram&&(Dr=_.thisProgram);var nr=_.wasmBinary,ar,He=!1,Br,D,O,U,Fe,v,E,S,ee;function wt(){var e=ar.buffer;_.HEAP8=D=new Int8Array(e),_.HEAP16=U=new Int16Array(e),_.HEAPU8=O=new Uint8Array(e),_.HEAPU16=Fe=new Uint16Array(e),_.HEAP32=v=new Int32Array(e),_.HEAPU32=E=new Uint32Array(e),_.HEAPF32=S=new Float32Array(e),_.HEAPF64=ee=new Float64Array(e)}var Ct=[],xt=[],Qa=[],kt=[];function Ya(){if(_.preRun)for(typeof _.preRun=="function"&&(_.preRun=[_.preRun]);_.preRun.length;)ei(_.preRun.shift());ir(Ct)}function Ka(){!_.noFSInit&&!l.initialized&&l.init(),l.ignorePermissions=!1,ir(xt)}function Za(){ir(Qa)}function Ja(){if(_.postRun)for(typeof _.postRun=="function"&&(_.postRun=[_.postRun]);_.postRun.length;)ti(_.postRun.shift());ir(kt)}function ei(e){Ct.unshift(e)}function ri(e){xt.unshift(e)}function ti(e){kt.unshift(e)}var xe=0,ze=null;function Rr(e){var r;xe++,(r=_.monitorRunDependencies)==null||r.call(_,xe)}function Xe(e){var t;if(xe--,(t=_.monitorRunDependencies)==null||t.call(_,xe),xe==0&&ze){var r=ze;ze=null,r()}}function Le(e){var t;(t=_.onAbort)==null||t.call(_,e),e="Aborted("+e+")",oe(e),He=!0,e+=". Build with -sASSERTIONS for more info.";var r=new WebAssembly.RuntimeError(e);throw tr(r),r}var ni="data:application/octet-stream;base64,",Pt=e=>e.startsWith(ni);function ai(){var e="scichart2d.wasm";return Pt(e)?e:Xa(e)}var Ir;function ii(e){if(e==Ir&&nr)return new Uint8Array(nr);throw"both async and sync fetching of the wasm failed"}async function oi(e){if(!nr)try{var r=await Fr(e);return new Uint8Array(r)}catch{}return ii(e)}async function si(e,r){try{var t=await oi(e),n=await WebAssembly.instantiate(t,r);return n}catch(a){oe(`failed to asynchronously prepare wasm: ${a}`),Le(a)}}async function li(e,r,t){if(!e&&typeof WebAssembly.instantiateStreaming=="function"&&!Pt(r)&&typeof fetch=="function")try{var n=fetch(r,{credentials:"same-origin"}),a=await WebAssembly.instantiateStreaming(n,t);return a}catch(i){oe(`wasm streaming compile failed: ${i}`),oe("falling back to ArrayBuffer instantiation")}return si(r,t)}function ui(){return{a:Mp}}async function ci(){function e(a,i){return H=a.exports,ar=H.vh,wt(),Wt=H.yh,ri(H.wh),Xe(),H}Rr();function r(a){e(a.instance)}var t=ui();if(_.instantiateWasm)try{return _.instantiateWasm(t,e)}catch(a){oe(`Module.instantiateWasm callback failed with error: ${a}`),tr(a)}Ir??(Ir=ai());try{var n=await li(nr,Ir,t);return r(n),n}catch(a){tr(a);return}}var B,Y,St={874980:()=>{var e=navigator.userAgent||navigator.vendor||window.opera;return/windows phone/i.test(e)?0:/Android/i.test(e)?1:/iPad|iPhone|iPod/.test(e)&&!window.MSStream?2:0},875250:()=>{Ke["#canvas"]=_.canvas},875301:()=>_.getRandomValue(),875337:()=>{if(_.getRandomValue===void 0)try{var e=typeof window=="object"?window:self,r=typeof e.crypto<"u"?e.crypto:e.msCrypto,t=function(){var i=new Uint32Array(1);return r.getRandomValues(i),i[0]>>>0};t(),_.getRandomValue=t}catch{try{var n=Math.pow(2,32),a=function(){var o=Math.floor(Math.random()*Math.floor(n));return o>>>0};a(),_.getRandomValue=a}catch{throw"No secure random number generator found"}}},876019:e=>{var r=N(e)+`
|
|
2
2
|
|
|
3
3
|
Abort/Retry/Ignore/AlwaysIgnore? [ariA] :`,t=window.prompt(r,"i");return t===null&&(t="i"),allocate(Ur(t),"i8",ALLOC_NORMAL)},876244:()=>typeof AudioContext<"u"?!0:typeof webkitAudioContext<"u",876391:()=>typeof navigator.mediaDevices<"u"&&typeof navigator.mediaDevices.getUserMedia<"u"?!0:typeof navigator.webkitGetUserMedia<"u",876625:e=>{typeof _.SDL2>"u"&&(_.SDL2={});var r=_.SDL2;return e?r.capture={}:r.audio={},r.audioContext||(typeof AudioContext<"u"?r.audioContext=new AudioContext:typeof webkitAudioContext<"u"&&(r.audioContext=new webkitAudioContext),r.audioContext&&typeof navigator.userActivation>"u"&&Fp(r.audioContext)),r.audioContext===void 0?-1:0},877177:()=>{var e=_.SDL2;return e.audioContext.sampleRate},877245:(e,r,t,n)=>{var a=_.SDL2,i=function(c){a.capture.silenceTimer!==void 0&&(clearInterval(a.capture.silenceTimer),a.capture.silenceTimer=void 0,a.capture.silenceBuffer=void 0),a.capture.mediaStreamNode=a.audioContext.createMediaStreamSource(c),a.capture.scriptProcessorNode=a.audioContext.createScriptProcessor(r,e,1),a.capture.scriptProcessorNode.onaudioprocess=function(d){a===void 0||a.capture===void 0||(d.outputBuffer.getChannelData(0).fill(0),a.capture.currentCaptureBuffer=d.inputBuffer,Qe("vi",t,[n]))},a.capture.mediaStreamNode.connect(a.capture.scriptProcessorNode),a.capture.scriptProcessorNode.connect(a.audioContext.destination),a.capture.stream=c},o=function(c){};a.capture.silenceBuffer=a.audioContext.createBuffer(e,r,a.audioContext.sampleRate),a.capture.silenceBuffer.getChannelData(0).fill(0);var s=function(){a.capture.currentCaptureBuffer=a.capture.silenceBuffer,Qe("vi",t,[n])};a.capture.silenceTimer=setInterval(s,r/a.audioContext.sampleRate*1e3),navigator.mediaDevices!==void 0&&navigator.mediaDevices.getUserMedia!==void 0?navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then(i).catch(o):navigator.webkitGetUserMedia!==void 0&&navigator.webkitGetUserMedia({audio:!0,video:!1},i,o)},878938:(e,r,t,n)=>{var a=_.SDL2;if(a.audio.scriptProcessorNode=a.audioContext.createScriptProcessor(r,0,e),a.audio.scriptProcessorNode.onaudioprocess=function(o){a===void 0||a.audio===void 0||(a.audio.silenceTimer!==void 0&&(clearInterval(a.audio.silenceTimer),a.audio.silenceTimer=void 0,a.audio.silenceBuffer=void 0),a.audio.currentOutputBuffer=o.outputBuffer,Qe("vi",t,[n]))},a.audio.scriptProcessorNode.connect(a.audioContext.destination),a.audioContext.state==="suspended"){a.audio.silenceBuffer=a.audioContext.createBuffer(e,r,a.audioContext.sampleRate),a.audio.silenceBuffer.getChannelData(0).fill(0);var i=function(){typeof navigator.userActivation<"u"&&navigator.userActivation.hasBeenActive&&a.audioContext.resume(),a.audio.currentOutputBuffer=a.audio.silenceBuffer,Qe("vi",t,[n]),a.audio.currentOutputBuffer=void 0};a.audio.silenceTimer=setInterval(i,r/a.audioContext.sampleRate*1e3)}},880113:(e,r)=>{for(var t=_.SDL2,n=t.capture.currentCaptureBuffer.numberOfChannels,a=0;a<n;++a){var i=t.capture.currentCaptureBuffer.getChannelData(a);if(i.length!=r)throw"Web Audio capture buffer length mismatch! Destination size: "+i.length+" samples vs expected "+r+" samples!";if(n==1)for(var o=0;o<r;++o)At(e+o*4,i[o],"float");else for(var o=0;o<r;++o)At(e+(o*n+a)*4,i[o],"float")}},880718:(e,r)=>{for(var t=_.SDL2,n=e>>>2,a=t.audio.currentOutputBuffer.numberOfChannels,i=0;i<a;++i){var o=t.audio.currentOutputBuffer.getChannelData(i);if(o.length!=r)throw"Web Audio output buffer length mismatch! Destination size: "+o.length+" samples vs expected "+r+" samples!";for(var s=0;s<r;++s)o[s]=S[n+(s*a+i)]}},881207:e=>{var r=_.SDL2;if(e){if(r.capture.silenceTimer!==void 0&&clearInterval(r.capture.silenceTimer),r.capture.stream!==void 0)for(var t=r.capture.stream.getAudioTracks(),n=0;n<t.length;n++)r.capture.stream.removeTrack(t[n]);r.capture.scriptProcessorNode!==void 0&&(r.capture.scriptProcessorNode.onaudioprocess=function(a){},r.capture.scriptProcessorNode.disconnect()),r.capture.mediaStreamNode!==void 0&&r.capture.mediaStreamNode.disconnect(),r.capture=void 0}else r.audio.scriptProcessorNode!=null&&r.audio.scriptProcessorNode.disconnect(),r.audio.silenceTimer!==void 0&&clearInterval(r.audio.silenceTimer),r.audio=void 0;r.audioContext!==void 0&&r.audio===void 0&&r.capture===void 0&&(r.audioContext.close(),r.audioContext=void 0)},882213:(e,r,t)=>{var n=e,a=r,i=t;_.SDL2||(_.SDL2={});var o=_.SDL2;o.ctxCanvas!==_.canvas&&(o.ctx=_.createContext(_.canvas,!1,!0),o.ctxCanvas=_.canvas),(o.w!==n||o.h!==a||o.imageCtx!==o.ctx)&&(o.image=o.ctx.createImageData(n,a),o.w=n,o.h=a,o.imageCtx=o.ctx);var s=o.image.data,c=i/4,d=0,m;if(typeof CanvasPixelArray<"u"&&s instanceof CanvasPixelArray)for(m=s.length;d<m;){var g=v[c];s[d]=g&255,s[d+1]=g>>8&255,s[d+2]=g>>16&255,s[d+3]=255,c++,d+=4}else{o.data32Data!==s&&(o.data32=new Int32Array(s.buffer),o.data8=new Uint8Array(s.buffer),o.data32Data=s);var y=o.data32;m=y.length,y.set(v.subarray(c,c+m));var p=o.data8,h=3,P=h+4*m;if(m%8==0)for(;h<P;)p[h]=255,h=h+4|0,p[h]=255,h=h+4|0,p[h]=255,h=h+4|0,p[h]=255,h=h+4|0,p[h]=255,h=h+4|0,p[h]=255,h=h+4|0,p[h]=255,h=h+4|0,p[h]=255,h=h+4|0;else for(;h<P;)p[h]=255,h=h+4|0}o.ctx.putImageData(o.image,0,0)},883681:(e,r,t,n,a)=>{var i=e,o=r,s=t,c=n,d=a,m=document.createElement("canvas");m.width=i,m.height=o;var g=m.getContext("2d"),y=g.createImageData(i,o),p=y.data,h=d/4,P=0,A;if(typeof CanvasPixelArray<"u"&&p instanceof CanvasPixelArray)for(A=p.length;P<A;){var C=v[h];p[P]=C&255,p[P+1]=C>>8&255,p[P+2]=C>>16&255,p[P+3]=C>>24&255,h++,P+=4}else{var G=new Int32Array(p.buffer);A=G.length,G.set(v.subarray(h,h+A))}g.putImageData(y,0,0);var R=s===0&&c===0?"url("+m.toDataURL()+"), auto":"url("+m.toDataURL()+") "+s+" "+c+", auto",j=K(R.length+1);return M(R,j,R.length+1),j},884669:e=>{_.canvas&&(_.canvas.style.cursor=N(e))},884752:()=>{_.canvas&&(_.canvas.style.cursor="none")},884821:()=>window.innerWidth,884851:()=>window.innerHeight};function fi(){var e="";typeof window<"u"?e=window.location.hostname:typeof process<"u"&&(e="node");var r=ke(e)+1,t=K(r);return M(e,t,r),t}class Tt{constructor(r){ie(this,"name","ExitStatus");this.message=`Program terminated with exit(${r})`,this.status=r}}var ir=e=>{for(;e.length>0;)e.shift()(_)};_.noExitRuntime;function At(e,r,t="i8"){switch(t.endsWith("*")&&(t="*"),t){case"i1":D[e]=r;break;case"i8":D[e]=r;break;case"i16":U[e>>1]=r;break;case"i32":v[e>>2]=r;break;case"i64":Le("to do setValue(i64) use WASM_BIGINT");case"float":S[e>>2]=r;break;case"double":ee[e>>3]=r;break;case"*":E[e>>2]=r;break;default:Le(`invalid type for setValue: ${t}`)}}var Be=e=>Ua(e),Re=()=>$a();class vi{constructor(r){this.excPtr=r,this.ptr=r-24}set_type(r){E[this.ptr+4>>2]=r}get_type(){return E[this.ptr+4>>2]}set_destructor(r){E[this.ptr+8>>2]=r}get_destructor(){return E[this.ptr+8>>2]}set_caught(r){r=r?1:0,D[this.ptr+12]=r}get_caught(){return D[this.ptr+12]!=0}set_rethrown(r){r=r?1:0,D[this.ptr+13]=r}get_rethrown(){return D[this.ptr+13]!=0}init(r,t){this.set_adjusted_ptr(0),this.set_type(r),this.set_destructor(t)}set_adjusted_ptr(r){E[this.ptr+16>>2]=r}get_adjusted_ptr(){return E[this.ptr+16>>2]}}var Dt=0,di=(e,r,t)=>{var n=new vi(e);throw n.init(r,t),Dt=e,Dt},or=()=>{var e=v[+q.varargs>>2];return q.varargs+=4,e},Ie=or,W={isAbs:e=>e.charAt(0)==="/",splitPath:e=>{var r=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return r.exec(e).slice(1)},normalizeArray:(e,r)=>{for(var t=0,n=e.length-1;n>=0;n--){var a=e[n];a==="."?e.splice(n,1):a===".."?(e.splice(n,1),t++):t&&(e.splice(n,1),t--)}if(r)for(;t;t--)e.unshift("..");return e},normalize:e=>{var r=W.isAbs(e),t=e.substr(-1)==="/";return e=W.normalizeArray(e.split("/").filter(n=>!!n),!r).join("/"),!e&&!r&&(e="."),e&&t&&(e+="/"),(r?"/":"")+e},dirname:e=>{var r=W.splitPath(e),t=r[0],n=r[1];return!t&&!n?".":(n&&(n=n.substr(0,n.length-1)),t+n)},basename:e=>{if(e==="/")return"/";e=W.normalize(e),e=e.replace(/\/$/,"");var r=e.lastIndexOf("/");return r===-1?e:e.substr(r+1)},join:(...e)=>W.normalize(e.join("/")),join2:(e,r)=>W.normalize(e+"/"+r)},mi=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return e=>crypto.getRandomValues(e);Le("initRandomDevice")},Ft=e=>(Ft=mi())(e),Me={resolve:(...e)=>{for(var r="",t=!1,n=e.length-1;n>=-1&&!t;n--){var a=n>=0?e[n]:l.cwd();if(typeof a!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!a)return"";r=a+"/"+r,t=W.isAbs(a)}return r=W.normalizeArray(r.split("/").filter(i=>!!i),!t).join("/"),(t?"/":"")+r||"."},relative:(e,r)=>{e=Me.resolve(e).substr(1),r=Me.resolve(r).substr(1);function t(d){for(var m=0;m<d.length&&d[m]==="";m++);for(var g=d.length-1;g>=0&&d[g]==="";g--);return m>g?[]:d.slice(m,g-m+1)}for(var n=t(e.split("/")),a=t(r.split("/")),i=Math.min(n.length,a.length),o=i,s=0;s<i;s++)if(n[s]!==a[s]){o=s;break}for(var c=[],s=o;s<n.length;s++)c.push("..");return c=c.concat(a.slice(o)),c.join("/")}},Lt=typeof TextDecoder<"u"?new TextDecoder:void 0,Ge=(e,r=0,t=NaN)=>{for(var n=r+t,a=r;e[a]&&!(a>=n);)++a;if(a-r>16&&e.buffer&&Lt)return Lt.decode(e.subarray(r,a));for(var i="";r<a;){var o=e[r++];if(!(o&128)){i+=String.fromCharCode(o);continue}var s=e[r++]&63;if((o&224)==192){i+=String.fromCharCode((o&31)<<6|s);continue}var c=e[r++]&63;if((o&240)==224?o=(o&15)<<12|s<<6|c:o=(o&7)<<18|s<<12|c<<6|e[r++]&63,o<65536)i+=String.fromCharCode(o);else{var d=o-65536;i+=String.fromCharCode(55296|d>>10,56320|d&1023)}}return i},Mr=[],ke=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n<=127?r++:n<=2047?r+=2:n>=55296&&n<=57343?(r+=4,++t):r+=3}return r},Gr=(e,r,t,n)=>{if(!(n>0))return 0;for(var a=t,i=t+n-1,o=0;o<e.length;++o){var s=e.charCodeAt(o);if(s>=55296&&s<=57343){var c=e.charCodeAt(++o);s=65536+((s&1023)<<10)|c&1023}if(s<=127){if(t>=i)break;r[t++]=s}else if(s<=2047){if(t+1>=i)break;r[t++]=192|s>>6,r[t++]=128|s&63}else if(s<=65535){if(t+2>=i)break;r[t++]=224|s>>12,r[t++]=128|s>>6&63,r[t++]=128|s&63}else{if(t+3>=i)break;r[t++]=240|s>>18,r[t++]=128|s>>12&63,r[t++]=128|s>>6&63,r[t++]=128|s&63}}return r[t]=0,t-a};function Ur(e,r,t){var n=ke(e)+1,a=new Array(n),i=Gr(e,a,0,a.length);return r&&(a.length=i),a}var _i=()=>{if(!Mr.length){var e=null;if(typeof window<"u"&&typeof window.prompt=="function"&&(e=window.prompt("Input: "),e!==null&&(e+=`
|
|
4
4
|
`)),!e)return null;Mr=Ur(e,!0)}return Mr.shift()},Pe={ttys:[],init(){},shutdown(){},register(e,r){Pe.ttys[e]={input:[],output:[],ops:r},l.registerDevice(e,Pe.stream_ops)},stream_ops:{open(e){var r=Pe.ttys[e.node.rdev];if(!r)throw new l.ErrnoError(43);e.tty=r,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,r,t,n,a){if(!e.tty||!e.tty.ops.get_char)throw new l.ErrnoError(60);for(var i=0,o=0;o<n;o++){var s;try{s=e.tty.ops.get_char(e.tty)}catch{throw new l.ErrnoError(29)}if(s===void 0&&i===0)throw new l.ErrnoError(6);if(s==null)break;i++,r[t+o]=s}return i&&(e.node.atime=Date.now()),i},write(e,r,t,n,a){if(!e.tty||!e.tty.ops.put_char)throw new l.ErrnoError(60);try{for(var i=0;i<n;i++)e.tty.ops.put_char(e.tty,r[t+i])}catch{throw new l.ErrnoError(29)}return n&&(e.node.mtime=e.node.ctime=Date.now()),i}},default_tty_ops:{get_char(e){return _i()},put_char(e,r){r===null||r===10?(Lr(Ge(e.output)),e.output=[]):r!=0&&e.output.push(r)},fsync(e){e.output&&e.output.length>0&&(Lr(Ge(e.output)),e.output=[])},ioctl_tcgets(e){return{c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},ioctl_tcsets(e,r,t){return 0},ioctl_tiocgwinsz(e){return[24,80]}},default_tty1_ops:{put_char(e,r){r===null||r===10?(oe(Ge(e.output)),e.output=[]):r!=0&&e.output.push(r)},fsync(e){e.output&&e.output.length>0&&(oe(Ge(e.output)),e.output=[])}}},gi=(e,r)=>Math.ceil(e/r)*r,Bt=e=>{Le()},F={ops_table:null,mount(e){return F.createNode(null,"/",16895,0)},createNode(e,r,t,n){if(l.isBlkdev(t)||l.isFIFO(t))throw new l.ErrnoError(63);F.ops_table||(F.ops_table={dir:{node:{getattr:F.node_ops.getattr,setattr:F.node_ops.setattr,lookup:F.node_ops.lookup,mknod:F.node_ops.mknod,rename:F.node_ops.rename,unlink:F.node_ops.unlink,rmdir:F.node_ops.rmdir,readdir:F.node_ops.readdir,symlink:F.node_ops.symlink},stream:{llseek:F.stream_ops.llseek}},file:{node:{getattr:F.node_ops.getattr,setattr:F.node_ops.setattr},stream:{llseek:F.stream_ops.llseek,read:F.stream_ops.read,write:F.stream_ops.write,allocate:F.stream_ops.allocate,mmap:F.stream_ops.mmap,msync:F.stream_ops.msync}},link:{node:{getattr:F.node_ops.getattr,setattr:F.node_ops.setattr,readlink:F.node_ops.readlink},stream:{}},chrdev:{node:{getattr:F.node_ops.getattr,setattr:F.node_ops.setattr},stream:l.chrdev_stream_ops}});var a=l.createNode(e,r,t,n);return l.isDir(a.mode)?(a.node_ops=F.ops_table.dir.node,a.stream_ops=F.ops_table.dir.stream,a.contents={}):l.isFile(a.mode)?(a.node_ops=F.ops_table.file.node,a.stream_ops=F.ops_table.file.stream,a.usedBytes=0,a.contents=null):l.isLink(a.mode)?(a.node_ops=F.ops_table.link.node,a.stream_ops=F.ops_table.link.stream):l.isChrdev(a.mode)&&(a.node_ops=F.ops_table.chrdev.node,a.stream_ops=F.ops_table.chrdev.stream),a.atime=a.mtime=a.ctime=Date.now(),e&&(e.contents[r]=a,e.atime=e.mtime=e.ctime=a.atime),a},getFileDataAsTypedArray(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage(e,r){var t=e.contents?e.contents.length:0;if(!(t>=r)){var n=1024*1024;r=Math.max(r,t*(t<n?2:1.125)>>>0),t!=0&&(r=Math.max(r,256));var a=e.contents;e.contents=new Uint8Array(r),e.usedBytes>0&&e.contents.set(a.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,r){if(e.usedBytes!=r)if(r==0)e.contents=null,e.usedBytes=0;else{var t=e.contents;e.contents=new Uint8Array(r),t&&e.contents.set(t.subarray(0,Math.min(r,e.usedBytes))),e.usedBytes=r}},node_ops:{getattr(e){var r={};return r.dev=l.isChrdev(e.mode)?e.id:1,r.ino=e.id,r.mode=e.mode,r.nlink=1,r.uid=0,r.gid=0,r.rdev=e.rdev,l.isDir(e.mode)?r.size=4096:l.isFile(e.mode)?r.size=e.usedBytes:l.isLink(e.mode)?r.size=e.link.length:r.size=0,r.atime=new Date(e.atime),r.mtime=new Date(e.mtime),r.ctime=new Date(e.ctime),r.blksize=4096,r.blocks=Math.ceil(r.size/r.blksize),r},setattr(e,r){for(const t of["mode","atime","mtime","ctime"])r[t]&&(e[t]=r[t]);r.size!==void 0&&F.resizeFileStorage(e,r.size)},lookup(e,r){throw F.doesNotExistError},mknod(e,r,t,n){return F.createNode(e,r,t,n)},rename(e,r,t){var n;try{n=l.lookupNode(r,t)}catch{}if(n){if(l.isDir(e.mode))for(var a in n.contents)throw new l.ErrnoError(55);l.hashRemoveNode(n)}delete e.parent.contents[e.name],r.contents[t]=e,e.name=t,r.ctime=r.mtime=e.parent.ctime=e.parent.mtime=Date.now()},unlink(e,r){delete e.contents[r],e.ctime=e.mtime=Date.now()},rmdir(e,r){var t=l.lookupNode(e,r);for(var n in t.contents)throw new l.ErrnoError(55);delete e.contents[r],e.ctime=e.mtime=Date.now()},readdir(e){return[".","..",...Object.keys(e.contents)]},symlink(e,r,t){var n=F.createNode(e,r,41471,0);return n.link=t,n},readlink(e){if(!l.isLink(e.mode))throw new l.ErrnoError(28);return e.link}},stream_ops:{read(e,r,t,n,a){var i=e.node.contents;if(a>=e.node.usedBytes)return 0;var o=Math.min(e.node.usedBytes-a,n);if(o>8&&i.subarray)r.set(i.subarray(a,a+o),t);else for(var s=0;s<o;s++)r[t+s]=i[a+s];return o},write(e,r,t,n,a,i){if(r.buffer===D.buffer&&(i=!1),!n)return 0;var o=e.node;if(o.mtime=o.ctime=Date.now(),r.subarray&&(!o.contents||o.contents.subarray)){if(i)return o.contents=r.subarray(t,t+n),o.usedBytes=n,n;if(o.usedBytes===0&&a===0)return o.contents=r.slice(t,t+n),o.usedBytes=n,n;if(a+n<=o.usedBytes)return o.contents.set(r.subarray(t,t+n),a),n}if(F.expandFileStorage(o,a+n),o.contents.subarray&&r.subarray)o.contents.set(r.subarray(t,t+n),a);else for(var s=0;s<n;s++)o.contents[a+s]=r[t+s];return o.usedBytes=Math.max(o.usedBytes,a+n),n},llseek(e,r,t){var n=r;if(t===1?n+=e.position:t===2&&l.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new l.ErrnoError(28);return n},allocate(e,r,t){F.expandFileStorage(e.node,r+t),e.node.usedBytes=Math.max(e.node.usedBytes,r+t)},mmap(e,r,t,n,a){if(!l.isFile(e.node.mode))throw new l.ErrnoError(43);var i,o,s=e.node.contents;if(!(a&2)&&s&&s.buffer===D.buffer)o=!1,i=s.byteOffset;else{if(o=!0,i=Bt(),!i)throw new l.ErrnoError(48);s&&((t>0||t+r<s.length)&&(s.subarray?s=s.subarray(t,t+r):s=Array.prototype.slice.call(s,t,t+r)),D.set(s,i))}return{ptr:i,allocated:o}},msync(e,r,t,n,a){return F.stream_ops.write(e,r,0,n,t,!1),0}}},pi=async e=>{var r=await Fr(e);return new Uint8Array(r)},hi=(e,r,t,n,a,i)=>{l.createDataFile(e,r,t,n,a,i)},Or=_.preloadPlugins||[],yi=(e,r,t,n)=>{typeof x<"u"&&x.init();var a=!1;return Or.forEach(i=>{a||i.canHandle(r)&&(i.handle(e,r,t,n),a=!0)}),a},bi=(e,r,t,n,a,i,o,s,c,d)=>{var m=r?Me.resolve(W.join2(e,r)):e;function g(y){function p(h){d==null||d(),s||hi(e,r,h,n,a,c),i==null||i(),Xe()}yi(y,m,p,()=>{o==null||o(),Xe()})||p(y)}Rr(),typeof t=="string"?pi(t).then(g,o):g(t)},Ei=e=>{var r={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},t=r[e];if(typeof t>"u")throw new Error(`Unknown file open mode: ${e}`);return t},$r=(e,r)=>{var t=0;return e&&(t|=365),r&&(t|=146),t},l={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:class{constructor(e){ie(this,"name","ErrnoError");this.errno=e}},filesystems:null,syncFSRequests:0,readFiles:{},FSStream:class{constructor(){ie(this,"shared",{})}get object(){return this.node}set object(e){this.node=e}get isRead(){return(this.flags&2097155)!==1}get isWrite(){return(this.flags&2097155)!==0}get isAppend(){return this.flags&1024}get flags(){return this.shared.flags}set flags(e){this.shared.flags=e}get position(){return this.shared.position}set position(e){this.shared.position=e}},FSNode:class{constructor(e,r,t,n){ie(this,"node_ops",{});ie(this,"stream_ops",{});ie(this,"readMode",365);ie(this,"writeMode",146);ie(this,"mounted",null);e||(e=this),this.parent=e,this.mount=e.mount,this.id=l.nextInode++,this.name=r,this.mode=t,this.rdev=n,this.atime=this.mtime=this.ctime=Date.now()}get read(){return(this.mode&this.readMode)===this.readMode}set read(e){e?this.mode|=this.readMode:this.mode&=~this.readMode}get write(){return(this.mode&this.writeMode)===this.writeMode}set write(e){e?this.mode|=this.writeMode:this.mode&=~this.writeMode}get isFolder(){return l.isDir(this.mode)}get isDevice(){return l.isChrdev(this.mode)}},lookupPath(e,r={}){if(!e)return{path:"",node:null};r.follow_mount??(r.follow_mount=!0),W.isAbs(e)||(e=l.cwd()+"/"+e);e:for(var t=0;t<40;t++){for(var n=e.split("/").filter(d=>!!d&&d!=="."),a=l.root,i="/",o=0;o<n.length;o++){var s=o===n.length-1;if(s&&r.parent)break;if(n[o]===".."){i=W.dirname(i),a=a.parent;continue}i=W.join2(i,n[o]);try{a=l.lookupNode(a,n[o])}catch(d){if((d==null?void 0:d.errno)===44&&s&&r.noent_okay)return{path:i};throw d}if(l.isMountpoint(a)&&(!s||r.follow_mount)&&(a=a.mounted.root),l.isLink(a.mode)&&(!s||r.follow)){if(!a.node_ops.readlink)throw new l.ErrnoError(52);var c=a.node_ops.readlink(a);W.isAbs(c)||(c=W.dirname(i)+"/"+c),e=c+"/"+n.slice(o+1).join("/");continue e}}return{path:i,node:a}}throw new l.ErrnoError(32)},getPath(e){for(var r;;){if(l.isRoot(e)){var t=e.mount.mountpoint;return r?t[t.length-1]!=="/"?`${t}/${r}`:t+r:t}r=r?`${e.name}/${r}`:e.name,e=e.parent}},hashName(e,r){for(var t=0,n=0;n<r.length;n++)t=(t<<5)-t+r.charCodeAt(n)|0;return(e+t>>>0)%l.nameTable.length},hashAddNode(e){var r=l.hashName(e.parent.id,e.name);e.name_next=l.nameTable[r],l.nameTable[r]=e},hashRemoveNode(e){var r=l.hashName(e.parent.id,e.name);if(l.nameTable[r]===e)l.nameTable[r]=e.name_next;else for(var t=l.nameTable[r];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode(e,r){var t=l.mayLookup(e);if(t)throw new l.ErrnoError(t);for(var n=l.hashName(e.id,r),a=l.nameTable[n];a;a=a.name_next){var i=a.name;if(a.parent.id===e.id&&i===r)return a}return l.lookup(e,r)},createNode(e,r,t,n){var a=new l.FSNode(e,r,t,n);return l.hashAddNode(a),a},destroyNode(e){l.hashRemoveNode(e)},isRoot(e){return e===e.parent},isMountpoint(e){return!!e.mounted},isFile(e){return(e&61440)===32768},isDir(e){return(e&61440)===16384},isLink(e){return(e&61440)===40960},isChrdev(e){return(e&61440)===8192},isBlkdev(e){return(e&61440)===24576},isFIFO(e){return(e&61440)===4096},isSocket(e){return(e&49152)===49152},flagsToPermissionString(e){var r=["r","w","rw"][e&3];return e&512&&(r+="w"),r},nodePermissions(e,r){return l.ignorePermissions?0:r.includes("r")&&!(e.mode&292)||r.includes("w")&&!(e.mode&146)||r.includes("x")&&!(e.mode&73)?2:0},mayLookup(e){if(!l.isDir(e.mode))return 54;var r=l.nodePermissions(e,"x");return r||(e.node_ops.lookup?0:2)},mayCreate(e,r){if(!l.isDir(e.mode))return 54;try{var t=l.lookupNode(e,r);return 20}catch{}return l.nodePermissions(e,"wx")},mayDelete(e,r,t){var n;try{n=l.lookupNode(e,r)}catch(i){return i.errno}var a=l.nodePermissions(e,"wx");if(a)return a;if(t){if(!l.isDir(n.mode))return 54;if(l.isRoot(n)||l.getPath(n)===l.cwd())return 10}else if(l.isDir(n.mode))return 31;return 0},mayOpen(e,r){return e?l.isLink(e.mode)?32:l.isDir(e.mode)&&(l.flagsToPermissionString(r)!=="r"||r&512)?31:l.nodePermissions(e,l.flagsToPermissionString(r)):44},MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=l.MAX_OPEN_FDS;e++)if(!l.streams[e])return e;throw new l.ErrnoError(33)},getStreamChecked(e){var r=l.getStream(e);if(!r)throw new l.ErrnoError(8);return r},getStream:e=>l.streams[e],createStream(e,r=-1){return e=Object.assign(new l.FSStream,e),r==-1&&(r=l.nextfd()),e.fd=r,l.streams[r]=e,e},closeStream(e){l.streams[e]=null},dupStream(e,r=-1){var n,a;var t=l.createStream(e,r);return(a=(n=t.stream_ops)==null?void 0:n.dup)==null||a.call(n,t),t},chrdev_stream_ops:{open(e){var t,n;var r=l.getDevice(e.node.rdev);e.stream_ops=r.stream_ops,(n=(t=e.stream_ops).open)==null||n.call(t,e)},llseek(){throw new l.ErrnoError(70)}},major:e=>e>>8,minor:e=>e&255,makedev:(e,r)=>e<<8|r,registerDevice(e,r){l.devices[e]={stream_ops:r}},getDevice:e=>l.devices[e],getMounts(e){for(var r=[],t=[e];t.length;){var n=t.pop();r.push(n),t.push(...n.mounts)}return r},syncfs(e,r){typeof e=="function"&&(r=e,e=!1),l.syncFSRequests++,l.syncFSRequests>1&&oe(`warning: ${l.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var t=l.getMounts(l.root.mount),n=0;function a(o){return l.syncFSRequests--,r(o)}function i(o){if(o)return i.errored?void 0:(i.errored=!0,a(o));++n>=t.length&&a(null)}t.forEach(o=>{if(!o.type.syncfs)return i(null);o.type.syncfs(o,e,i)})},mount(e,r,t){var n=t==="/",a=!t,i;if(n&&l.root)throw new l.ErrnoError(10);if(!n&&!a){var o=l.lookupPath(t,{follow_mount:!1});if(t=o.path,i=o.node,l.isMountpoint(i))throw new l.ErrnoError(10);if(!l.isDir(i.mode))throw new l.ErrnoError(54)}var s={type:e,opts:r,mountpoint:t,mounts:[]},c=e.mount(s);return c.mount=s,s.root=c,n?l.root=c:i&&(i.mounted=s,i.mount&&i.mount.mounts.push(s)),c},unmount(e){var r=l.lookupPath(e,{follow_mount:!1});if(!l.isMountpoint(r.node))throw new l.ErrnoError(28);var t=r.node,n=t.mounted,a=l.getMounts(n);Object.keys(l.nameTable).forEach(o=>{for(var s=l.nameTable[o];s;){var c=s.name_next;a.includes(s.mount)&&l.destroyNode(s),s=c}}),t.mounted=null;var i=t.mount.mounts.indexOf(n);t.mount.mounts.splice(i,1)},lookup(e,r){return e.node_ops.lookup(e,r)},mknod(e,r,t){var n=l.lookupPath(e,{parent:!0}),a=n.node,i=W.basename(e);if(!i||i==="."||i==="..")throw new l.ErrnoError(28);var o=l.mayCreate(a,i);if(o)throw new l.ErrnoError(o);if(!a.node_ops.mknod)throw new l.ErrnoError(63);return a.node_ops.mknod(a,i,r,t)},statfs(e){var r={bsize:4096,frsize:4096,blocks:1e6,bfree:5e5,bavail:5e5,files:l.nextInode,ffree:l.nextInode-1,fsid:42,flags:2,namelen:255},t=l.lookupPath(e,{follow:!0}).node;return t!=null&&t.node_ops.statfs&&Object.assign(r,t.node_ops.statfs(t.mount.opts.root)),r},create(e,r=438){return r&=4095,r|=32768,l.mknod(e,r,0)},mkdir(e,r=511){return r&=1023,r|=16384,l.mknod(e,r,0)},mkdirTree(e,r){for(var t=e.split("/"),n="",a=0;a<t.length;++a)if(t[a]){n+="/"+t[a];try{l.mkdir(n,r)}catch(i){if(i.errno!=20)throw i}}},mkdev(e,r,t){return typeof t>"u"&&(t=r,r=438),r|=8192,l.mknod(e,r,t)},symlink(e,r){if(!Me.resolve(e))throw new l.ErrnoError(44);var t=l.lookupPath(r,{parent:!0}),n=t.node;if(!n)throw new l.ErrnoError(44);var a=W.basename(r),i=l.mayCreate(n,a);if(i)throw new l.ErrnoError(i);if(!n.node_ops.symlink)throw new l.ErrnoError(63);return n.node_ops.symlink(n,a,e)},rename(e,r){var t=W.dirname(e),n=W.dirname(r),a=W.basename(e),i=W.basename(r),o,s,c;if(o=l.lookupPath(e,{parent:!0}),s=o.node,o=l.lookupPath(r,{parent:!0}),c=o.node,!s||!c)throw new l.ErrnoError(44);if(s.mount!==c.mount)throw new l.ErrnoError(75);var d=l.lookupNode(s,a),m=Me.relative(e,n);if(m.charAt(0)!==".")throw new l.ErrnoError(28);if(m=Me.relative(r,t),m.charAt(0)!==".")throw new l.ErrnoError(55);var g;try{g=l.lookupNode(c,i)}catch{}if(d!==g){var y=l.isDir(d.mode),p=l.mayDelete(s,a,y);if(p)throw new l.ErrnoError(p);if(p=g?l.mayDelete(c,i,y):l.mayCreate(c,i),p)throw new l.ErrnoError(p);if(!s.node_ops.rename)throw new l.ErrnoError(63);if(l.isMountpoint(d)||g&&l.isMountpoint(g))throw new l.ErrnoError(10);if(c!==s&&(p=l.nodePermissions(s,"w"),p))throw new l.ErrnoError(p);l.hashRemoveNode(d);try{s.node_ops.rename(d,c,i),d.parent=c}catch(h){throw h}finally{l.hashAddNode(d)}}},rmdir(e){var r=l.lookupPath(e,{parent:!0}),t=r.node,n=W.basename(e),a=l.lookupNode(t,n),i=l.mayDelete(t,n,!0);if(i)throw new l.ErrnoError(i);if(!t.node_ops.rmdir)throw new l.ErrnoError(63);if(l.isMountpoint(a))throw new l.ErrnoError(10);t.node_ops.rmdir(t,n),l.destroyNode(a)},readdir(e){var r=l.lookupPath(e,{follow:!0}),t=r.node;if(!t.node_ops.readdir)throw new l.ErrnoError(54);return t.node_ops.readdir(t)},unlink(e){var r=l.lookupPath(e,{parent:!0}),t=r.node;if(!t)throw new l.ErrnoError(44);var n=W.basename(e),a=l.lookupNode(t,n),i=l.mayDelete(t,n,!1);if(i)throw new l.ErrnoError(i);if(!t.node_ops.unlink)throw new l.ErrnoError(63);if(l.isMountpoint(a))throw new l.ErrnoError(10);t.node_ops.unlink(t,n),l.destroyNode(a)},readlink(e){var r=l.lookupPath(e),t=r.node;if(!t)throw new l.ErrnoError(44);if(!t.node_ops.readlink)throw new l.ErrnoError(28);return t.node_ops.readlink(t)},stat(e,r){var t=l.lookupPath(e,{follow:!r}),n=t.node;if(!n)throw new l.ErrnoError(44);if(!n.node_ops.getattr)throw new l.ErrnoError(63);return n.node_ops.getattr(n)},lstat(e){return l.stat(e,!0)},chmod(e,r,t){var n;if(typeof e=="string"){var a=l.lookupPath(e,{follow:!t});n=a.node}else n=e;if(!n.node_ops.setattr)throw new l.ErrnoError(63);n.node_ops.setattr(n,{mode:r&4095|n.mode&-4096,ctime:Date.now()})},lchmod(e,r){l.chmod(e,r,!0)},fchmod(e,r){var t=l.getStreamChecked(e);l.chmod(t.node,r)},chown(e,r,t,n){var a;if(typeof e=="string"){var i=l.lookupPath(e,{follow:!n});a=i.node}else a=e;if(!a.node_ops.setattr)throw new l.ErrnoError(63);a.node_ops.setattr(a,{timestamp:Date.now()})},lchown(e,r,t){l.chown(e,r,t,!0)},fchown(e,r,t){var n=l.getStreamChecked(e);l.chown(n.node,r,t)},truncate(e,r){if(r<0)throw new l.ErrnoError(28);var t;if(typeof e=="string"){var n=l.lookupPath(e,{follow:!0});t=n.node}else t=e;if(!t.node_ops.setattr)throw new l.ErrnoError(63);if(l.isDir(t.mode))throw new l.ErrnoError(31);if(!l.isFile(t.mode))throw new l.ErrnoError(28);var a=l.nodePermissions(t,"w");if(a)throw new l.ErrnoError(a);t.node_ops.setattr(t,{size:r,timestamp:Date.now()})},ftruncate(e,r){var t=l.getStreamChecked(e);if((t.flags&2097155)===0)throw new l.ErrnoError(28);l.truncate(t.node,r)},utime(e,r,t){var n=l.lookupPath(e,{follow:!0}),a=n.node;a.node_ops.setattr(a,{atime:r,mtime:t})},open(e,r,t=438){if(e==="")throw new l.ErrnoError(44);r=typeof r=="string"?Ei(r):r,r&64?t=t&4095|32768:t=0;var n;if(typeof e=="object")n=e;else{var a=l.lookupPath(e,{follow:!(r&131072),noent_okay:!0});n=a.node,e=a.path}var i=!1;if(r&64)if(n){if(r&128)throw new l.ErrnoError(20)}else n=l.mknod(e,t,0),i=!0;if(!n)throw new l.ErrnoError(44);if(l.isChrdev(n.mode)&&(r&=-513),r&65536&&!l.isDir(n.mode))throw new l.ErrnoError(54);if(!i){var o=l.mayOpen(n,r);if(o)throw new l.ErrnoError(o)}r&512&&!i&&l.truncate(n,0),r&=-131713;var s=l.createStream({node:n,path:l.getPath(n),flags:r,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return s.stream_ops.open&&s.stream_ops.open(s),_.logReadFiles&&!(r&1)&&(e in l.readFiles||(l.readFiles[e]=1)),s},close(e){if(l.isClosed(e))throw new l.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(r){throw r}finally{l.closeStream(e.fd)}e.fd=null},isClosed(e){return e.fd===null},llseek(e,r,t){if(l.isClosed(e))throw new l.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new l.ErrnoError(70);if(t!=0&&t!=1&&t!=2)throw new l.ErrnoError(28);return e.position=e.stream_ops.llseek(e,r,t),e.ungotten=[],e.position},read(e,r,t,n,a){if(n<0||a<0)throw new l.ErrnoError(28);if(l.isClosed(e))throw new l.ErrnoError(8);if((e.flags&2097155)===1)throw new l.ErrnoError(8);if(l.isDir(e.node.mode))throw new l.ErrnoError(31);if(!e.stream_ops.read)throw new l.ErrnoError(28);var i=typeof a<"u";if(!i)a=e.position;else if(!e.seekable)throw new l.ErrnoError(70);var o=e.stream_ops.read(e,r,t,n,a);return i||(e.position+=o),o},write(e,r,t,n,a,i){if(n<0||a<0)throw new l.ErrnoError(28);if(l.isClosed(e))throw new l.ErrnoError(8);if((e.flags&2097155)===0)throw new l.ErrnoError(8);if(l.isDir(e.node.mode))throw new l.ErrnoError(31);if(!e.stream_ops.write)throw new l.ErrnoError(28);e.seekable&&e.flags&1024&&l.llseek(e,0,2);var o=typeof a<"u";if(!o)a=e.position;else if(!e.seekable)throw new l.ErrnoError(70);var s=e.stream_ops.write(e,r,t,n,a,i);return o||(e.position+=s),s},allocate(e,r,t){if(l.isClosed(e))throw new l.ErrnoError(8);if(r<0||t<=0)throw new l.ErrnoError(28);if((e.flags&2097155)===0)throw new l.ErrnoError(8);if(!l.isFile(e.node.mode)&&!l.isDir(e.node.mode))throw new l.ErrnoError(43);if(!e.stream_ops.allocate)throw new l.ErrnoError(138);e.stream_ops.allocate(e,r,t)},mmap(e,r,t,n,a){if((n&2)!==0&&(a&2)===0&&(e.flags&2097155)!==2)throw new l.ErrnoError(2);if((e.flags&2097155)===1)throw new l.ErrnoError(2);if(!e.stream_ops.mmap)throw new l.ErrnoError(43);if(!r)throw new l.ErrnoError(28);return e.stream_ops.mmap(e,r,t,n,a)},msync(e,r,t,n,a){return e.stream_ops.msync?e.stream_ops.msync(e,r,t,n,a):0},ioctl(e,r,t){if(!e.stream_ops.ioctl)throw new l.ErrnoError(59);return e.stream_ops.ioctl(e,r,t)},readFile(e,r={}){if(r.flags=r.flags||0,r.encoding=r.encoding||"binary",r.encoding!=="utf8"&&r.encoding!=="binary")throw new Error(`Invalid encoding type "${r.encoding}"`);var t,n=l.open(e,r.flags),a=l.stat(e),i=a.size,o=new Uint8Array(i);return l.read(n,o,0,i,0),r.encoding==="utf8"?t=Ge(o):r.encoding==="binary"&&(t=o),l.close(n),t},writeFile(e,r,t={}){t.flags=t.flags||577;var n=l.open(e,t.flags,t.mode);if(typeof r=="string"){var a=new Uint8Array(ke(r)+1),i=Gr(r,a,0,a.length);l.write(n,a,0,i,void 0,t.canOwn)}else if(ArrayBuffer.isView(r))l.write(n,r,0,r.byteLength,void 0,t.canOwn);else throw new Error("Unsupported data type");l.close(n)},cwd:()=>l.currentPath,chdir(e){var r=l.lookupPath(e,{follow:!0});if(r.node===null)throw new l.ErrnoError(44);if(!l.isDir(r.node.mode))throw new l.ErrnoError(54);var t=l.nodePermissions(r.node,"x");if(t)throw new l.ErrnoError(t);l.currentPath=r.path},createDefaultDirectories(){l.mkdir("/tmp"),l.mkdir("/home"),l.mkdir("/home/web_user")},createDefaultDevices(){l.mkdir("/dev"),l.registerDevice(l.makedev(1,3),{read:()=>0,write:(n,a,i,o,s)=>o,llseek:()=>0}),l.mkdev("/dev/null",l.makedev(1,3)),Pe.register(l.makedev(5,0),Pe.default_tty_ops),Pe.register(l.makedev(6,0),Pe.default_tty1_ops),l.mkdev("/dev/tty",l.makedev(5,0)),l.mkdev("/dev/tty1",l.makedev(6,0));var e=new Uint8Array(1024),r=0,t=()=>(r===0&&(r=Ft(e).byteLength),e[--r]);l.createDevice("/dev","random",t),l.createDevice("/dev","urandom",t),l.mkdir("/dev/shm"),l.mkdir("/dev/shm/tmp")},createSpecialDirectories(){l.mkdir("/proc");var e=l.mkdir("/proc/self");l.mkdir("/proc/self/fd"),l.mount({mount(){var r=l.createNode(e,"fd",16895,73);return r.stream_ops={llseek:F.stream_ops.llseek},r.node_ops={lookup(t,n){var a=+n,i=l.getStreamChecked(a),o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>i.path},id:a+1};return o.parent=o,o},readdir(){return Array.from(l.streams.entries()).filter(([t,n])=>n).map(([t,n])=>t.toString())}},r}},{},"/proc/self/fd")},createStandardStreams(e,r,t){e?l.createDevice("/dev","stdin",e):l.symlink("/dev/tty","/dev/stdin"),r?l.createDevice("/dev","stdout",null,r):l.symlink("/dev/tty","/dev/stdout"),t?l.createDevice("/dev","stderr",null,t):l.symlink("/dev/tty1","/dev/stderr"),l.open("/dev/stdin",0),l.open("/dev/stdout",1),l.open("/dev/stderr",1)},staticInit(){l.nameTable=new Array(4096),l.mount(F,{},"/"),l.createDefaultDirectories(),l.createDefaultDevices(),l.createSpecialDirectories(),l.filesystems={MEMFS:F}},init(e,r,t){l.initialized=!0,e??(e=_.stdin),r??(r=_.stdout),t??(t=_.stderr),l.createStandardStreams(e,r,t)},quit(){l.initialized=!1;for(var e=0;e<l.streams.length;e++){var r=l.streams[e];r&&l.close(r)}},findObject(e,r){var t=l.analyzePath(e,r);return t.exists?t.object:null},analyzePath(e,r){try{var t=l.lookupPath(e,{follow:!r});e=t.path}catch{}var n={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var t=l.lookupPath(e,{parent:!0});n.parentExists=!0,n.parentPath=t.path,n.parentObject=t.node,n.name=W.basename(e),t=l.lookupPath(e,{follow:!r}),n.exists=!0,n.path=t.path,n.object=t.node,n.name=t.node.name,n.isRoot=t.path==="/"}catch(a){n.error=a.errno}return n},createPath(e,r,t,n){e=typeof e=="string"?e:l.getPath(e);for(var a=r.split("/").reverse();a.length;){var i=a.pop();if(i){var o=W.join2(e,i);try{l.mkdir(o)}catch{}e=o}}return o},createFile(e,r,t,n,a){var i=W.join2(typeof e=="string"?e:l.getPath(e),r),o=$r(n,a);return l.create(i,o)},createDataFile(e,r,t,n,a,i){var o=r;e&&(e=typeof e=="string"?e:l.getPath(e),o=r?W.join2(e,r):e);var s=$r(n,a),c=l.create(o,s);if(t){if(typeof t=="string"){for(var d=new Array(t.length),m=0,g=t.length;m<g;++m)d[m]=t.charCodeAt(m);t=d}l.chmod(c,s|146);var y=l.open(c,577);l.write(y,t,0,t.length,0,i),l.close(y),l.chmod(c,s)}},createDevice(e,r,t,n){var s;var a=W.join2(typeof e=="string"?e:l.getPath(e),r),i=$r(!!t,!!n);(s=l.createDevice).major??(s.major=64);var o=l.makedev(l.createDevice.major++,0);return l.registerDevice(o,{open(c){c.seekable=!1},close(c){var d;(d=n==null?void 0:n.buffer)!=null&&d.length&&n(10)},read(c,d,m,g,y){for(var p=0,h=0;h<g;h++){var P;try{P=t()}catch{throw new l.ErrnoError(29)}if(P===void 0&&p===0)throw new l.ErrnoError(6);if(P==null)break;p++,d[m+h]=P}return p&&(c.node.atime=Date.now()),p},write(c,d,m,g,y){for(var p=0;p<g;p++)try{n(d[m+p])}catch{throw new l.ErrnoError(29)}return g&&(c.node.mtime=c.node.ctime=Date.now()),p}}),l.mkdev(a,i,o)},forceLoadFile(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if(typeof XMLHttpRequest<"u")throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");try{e.contents=qa(e.url),e.usedBytes=e.contents.length}catch{throw new l.ErrnoError(29)}},createLazyFile(e,r,t,n,a){class i{constructor(){ie(this,"lengthKnown",!1);ie(this,"chunks",[])}get(p){if(!(p>this.length-1||p<0)){var h=p%this.chunkSize,P=p/this.chunkSize|0;return this.getter(P)[h]}}setDataGetter(p){this.getter=p}cacheLength(){var p=new XMLHttpRequest;if(p.open("HEAD",t,!1),p.send(null),!(p.status>=200&&p.status<300||p.status===304))throw new Error("Couldn't load "+t+". Status: "+p.status);var h=Number(p.getResponseHeader("Content-length")),P,A=(P=p.getResponseHeader("Accept-Ranges"))&&P==="bytes",C=(P=p.getResponseHeader("Content-Encoding"))&&P==="gzip",G=1024*1024;A||(G=h);var R=($,T)=>{if($>T)throw new Error("invalid range ("+$+", "+T+") or no bytes requested!");if(T>h-1)throw new Error("only "+h+" bytes available! programmer error!");var V=new XMLHttpRequest;if(V.open("GET",t,!1),h!==G&&V.setRequestHeader("Range","bytes="+$+"-"+T),V.responseType="arraybuffer",V.overrideMimeType&&V.overrideMimeType("text/plain; charset=x-user-defined"),V.send(null),!(V.status>=200&&V.status<300||V.status===304))throw new Error("Couldn't load "+t+". Status: "+V.status);return V.response!==void 0?new Uint8Array(V.response||[]):Ur(V.responseText||"",!0)},j=this;j.setDataGetter($=>{var T=$*G,V=($+1)*G-1;if(V=Math.min(V,h-1),typeof j.chunks[$]>"u"&&(j.chunks[$]=R(T,V)),typeof j.chunks[$]>"u")throw new Error("doXHR failed!");return j.chunks[$]}),(C||!h)&&(G=h=1,h=this.getter(0).length,G=h,Lr("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=h,this._chunkSize=G,this.lengthKnown=!0}get length(){return this.lengthKnown||this.cacheLength(),this._length}get chunkSize(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}if(typeof XMLHttpRequest<"u"){throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var o,s}else var s={isDevice:!1,url:t};var c=l.createFile(e,r,s,n,a);s.contents?c.contents=s.contents:s.url&&(c.contents=null,c.url=s.url),Object.defineProperties(c,{usedBytes:{get:function(){return this.contents.length}}});var d={},m=Object.keys(c.stream_ops);m.forEach(y=>{var p=c.stream_ops[y];d[y]=(...h)=>(l.forceLoadFile(c),p(...h))});function g(y,p,h,P,A){var C=y.node.contents;if(A>=C.length)return 0;var G=Math.min(C.length-A,P);if(C.slice)for(var R=0;R<G;R++)p[h+R]=C[A+R];else for(var R=0;R<G;R++)p[h+R]=C.get(A+R);return G}return d.read=(y,p,h,P,A)=>(l.forceLoadFile(c),g(y,p,h,P,A)),d.mmap=(y,p,h,P,A)=>{l.forceLoadFile(c);var C=Bt();if(!C)throw new l.ErrnoError(48);return g(y,D,C,p,h),{ptr:C,allocated:!0}},c.stream_ops=d,c}},N=(e,r)=>e?Ge(O,e,r):"",q={DEFAULT_POLLMASK:5,calculateAt(e,r,t){if(W.isAbs(r))return r;var n;if(e===-100)n=l.cwd();else{var a=q.getStreamFromFD(e);n=a.path}if(r.length==0){if(!t)throw new l.ErrnoError(44);return n}return n+"/"+r},doStat(e,r,t){var n=e(r);v[t>>2]=n.dev,v[t+4>>2]=n.mode,E[t+8>>2]=n.nlink,v[t+12>>2]=n.uid,v[t+16>>2]=n.gid,v[t+20>>2]=n.rdev,Y=[n.size>>>0,(B=n.size,+Math.abs(B)>=1?B>0?+Math.floor(B/4294967296)>>>0:~~+Math.ceil((B-+(~~B>>>0))/4294967296)>>>0:0)],v[t+24>>2]=Y[0],v[t+28>>2]=Y[1],v[t+32>>2]=4096,v[t+36>>2]=n.blocks;var a=n.atime.getTime(),i=n.mtime.getTime(),o=n.ctime.getTime();return Y=[Math.floor(a/1e3)>>>0,(B=Math.floor(a/1e3),+Math.abs(B)>=1?B>0?+Math.floor(B/4294967296)>>>0:~~+Math.ceil((B-+(~~B>>>0))/4294967296)>>>0:0)],v[t+40>>2]=Y[0],v[t+44>>2]=Y[1],E[t+48>>2]=a%1e3*1e3*1e3,Y=[Math.floor(i/1e3)>>>0,(B=Math.floor(i/1e3),+Math.abs(B)>=1?B>0?+Math.floor(B/4294967296)>>>0:~~+Math.ceil((B-+(~~B>>>0))/4294967296)>>>0:0)],v[t+56>>2]=Y[0],v[t+60>>2]=Y[1],E[t+64>>2]=i%1e3*1e3*1e3,Y=[Math.floor(o/1e3)>>>0,(B=Math.floor(o/1e3),+Math.abs(B)>=1?B>0?+Math.floor(B/4294967296)>>>0:~~+Math.ceil((B-+(~~B>>>0))/4294967296)>>>0:0)],v[t+72>>2]=Y[0],v[t+76>>2]=Y[1],E[t+80>>2]=o%1e3*1e3*1e3,Y=[n.ino>>>0,(B=n.ino,+Math.abs(B)>=1?B>0?+Math.floor(B/4294967296)>>>0:~~+Math.ceil((B-+(~~B>>>0))/4294967296)>>>0:0)],v[t+88>>2]=Y[0],v[t+92>>2]=Y[1],0},doMsync(e,r,t,n,a){if(!l.isFile(r.node.mode))throw new l.ErrnoError(43);if(n&2)return 0;var i=O.slice(e,e+t);l.msync(r,i,a,t,n)},getStreamFromFD(e){var r=l.getStreamChecked(e);return r},varargs:void 0,getStr(e){var r=N(e);return r}};function wi(e,r,t){q.varargs=t;try{var n=q.getStreamFromFD(e);switch(r){case 0:{var a=or();if(a<0)return-28;for(;l.streams[a];)a++;var i;return i=l.dupStream(n,a),i.fd}case 1:case 2:return 0;case 3:return n.flags;case 4:{var a=or();return n.flags|=a,0}case 12:{var a=Ie(),o=0;return U[a+o>>1]=2,0}case 13:case 14:return 0}return-28}catch(s){if(typeof l>"u"||s.name!=="ErrnoError")throw s;return-s.errno}}function Ci(e,r){try{var t=q.getStreamFromFD(e);return q.doStat(l.stat,t.path,r)}catch(n){if(typeof l>"u"||n.name!=="ErrnoError")throw n;return-n.errno}}function xi(e,r,t){q.varargs=t;try{var n=q.getStreamFromFD(e);switch(r){case 21509:return n.tty?0:-59;case 21505:{if(!n.tty)return-59;if(n.tty.ops.ioctl_tcgets){var a=n.tty.ops.ioctl_tcgets(n),i=Ie();v[i>>2]=a.c_iflag||0,v[i+4>>2]=a.c_oflag||0,v[i+8>>2]=a.c_cflag||0,v[i+12>>2]=a.c_lflag||0;for(var o=0;o<32;o++)D[i+o+17]=a.c_cc[o]||0;return 0}return 0}case 21510:case 21511:case 21512:return n.tty?0:-59;case 21506:case 21507:case 21508:{if(!n.tty)return-59;if(n.tty.ops.ioctl_tcsets){for(var i=Ie(),s=v[i>>2],c=v[i+4>>2],d=v[i+8>>2],m=v[i+12>>2],g=[],o=0;o<32;o++)g.push(D[i+o+17]);return n.tty.ops.ioctl_tcsets(n.tty,r,{c_iflag:s,c_oflag:c,c_cflag:d,c_lflag:m,c_cc:g})}return 0}case 21519:{if(!n.tty)return-59;var i=Ie();return v[i>>2]=0,0}case 21520:return n.tty?-28:-59;case 21531:{var i=Ie();return l.ioctl(n,r,i)}case 21523:{if(!n.tty)return-59;if(n.tty.ops.ioctl_tiocgwinsz){var y=n.tty.ops.ioctl_tiocgwinsz(n.tty),i=Ie();U[i>>1]=y[0],U[i+2>>1]=y[1]}return 0}case 21524:return n.tty?0:-59;case 21515:return n.tty?0:-59;default:return-28}}catch(p){if(typeof l>"u"||p.name!=="ErrnoError")throw p;return-p.errno}}function ki(e,r){try{return e=q.getStr(e),q.doStat(l.lstat,e,r)}catch(t){if(typeof l>"u"||t.name!=="ErrnoError")throw t;return-t.errno}}function Pi(e,r,t,n){try{r=q.getStr(r);var a=n&256,i=n&4096;return n=n&-6401,r=q.calculateAt(e,r,i),q.doStat(a?l.lstat:l.stat,r,t)}catch(o){if(typeof l>"u"||o.name!=="ErrnoError")throw o;return-o.errno}}function Si(e,r,t,n){q.varargs=n;try{r=q.getStr(r),r=q.calculateAt(e,r);var a=n?or():0;return l.open(r,t,a).fd}catch(i){if(typeof l>"u"||i.name!=="ErrnoError")throw i;return-i.errno}}function Ti(e,r){try{return e=q.getStr(e),q.doStat(l.stat,e,r)}catch(t){if(typeof l>"u"||t.name!=="ErrnoError")throw t;return-t.errno}}var Ai=()=>Le(""),Ue=(e,r)=>Object.defineProperty(r,"name",{value:e}),jr=[],Ee=[],Oe,I=e=>{throw new Oe(e)},Di=()=>Ee.length/2-5-jr.length,Fi=()=>{Ee.push(0,1,void 0,1,null,1,!0,1,!1,1),_.count_emval_handles=Di},_e={toValue:e=>(e||I("Cannot use deleted val. handle = "+e),Ee[e]),toHandle:e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const r=jr.pop()||Ee.length;return Ee[r]=e,Ee[r+1]=1,r}}}},Rt=(e,r)=>{var t=Ue(r,function(n){this.name=r,this.message=n;var a=new Error(n).stack;a!==void 0&&(this.stack=this.toString()+`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("./petal-toolkit.cjs1340.js"),ze=require("./petal-toolkit.cjs721.js"),Pe=require("./petal-toolkit.cjs550.js"),Fe=require("./petal-toolkit.cjs553.js"),We=require("./petal-toolkit.cjs850.js"),Ye=require("./petal-toolkit.cjs577.js"),Ve=require("./petal-toolkit.cjs567.js"),qe=require("./petal-toolkit.cjs587.js"),Ae=require("./petal-toolkit.cjs854.js"),Oe=require("./petal-toolkit.cjs623.js"),Ge=require("./petal-toolkit.cjs1215.js"),Ke=require("./petal-toolkit.cjs229.js");var he;function Ue(){return he||(he=1,(function(d){var $=N.__exports&&N.__exports.__awaiter||function(e,a,i,s){function u(n){return n instanceof i?n:new i(function(l){l(n)})}return new(i||(i=Promise))(function(n,l){function r(L){try{c(s.next(L))}catch(v){l(v)}}function g(L){try{c(s.throw(L))}catch(v){l(v)}}function c(L){L.done?n(L.value):u(L.value).then(r,g)}c((s=s.apply(e,a||[])).next())})},x=N.__exports&&N.__exports.__generator||function(e,a){var i={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},s,u,n,l;return l={next:r(0),throw:r(1),return:r(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function r(c){return function(L){return g([c,L])}}function g(c){if(s)throw new TypeError("Generator is already executing.");for(;i;)try{if(s=1,u&&(n=c[0]&2?u.return:c[0]?u.throw||((n=u.return)&&n.call(u),0):u.next)&&!(n=n.call(u,c[1])).done)return n;switch(u=0,n&&(c=[c[0]&2,n.value]),c[0]){case 0:case 1:n=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,u=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(n=i.trys,!(n=n.length>0&&n[n.length-1])&&(c[0]===6||c[0]===2)){i=0;continue}if(c[0]===3&&(!n||c[1]>n[0]&&c[1]<n[3])){i.label=c[1];break}if(c[0]===6&&i.label<n[1]){i.label=n[1],n=c;break}if(n&&i.label<n[2]){i.label=n[2],i.ops.push(c);break}n[2]&&i.ops.pop(),i.trys.pop();continue}c=a.call(e,i)}catch(L){c=[6,L],u=0}finally{s=n=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}};Object.defineProperty(d,"__esModule",{value:!0}),d.licenseManager=d.getLicenseInfo=d.applyLicense=d.getLicenseCookie=d.setUseLicenseWizard=d.setRuntimeLicenseKey=d.setLicenseCallback=d.setIsDebugLicensing=d.setDependencies=void 0;var G=ze.__require(),ee=Pe.__require(),Le=Fe.__require(),E=We.__require(),K=Ye.__require(),re=Ve.__require(),ye=qe.__require(),t=Ae.__require(),U=Oe.__require(),H=Ge.__require(),h=Ke.__require(),F=24278,w=24279,se=K.localStorageApi.getLicenseWizardPort();se&&(F=se,w=F+1);var ve=function(e){return $(void 0,void 0,void 0,function(){var s,u,a,i,s,u;return x(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,9]),s="http://localhost:"+F.toString()+e,[4,fetch(s)];case 1:return u=n.sent(),[2,u];case 2:if(a=n.sent(),f("Could not connect to license wizard on port "+F.toString()),!(typeof localStorage<"u"))return[3,8];if(i=K.localStorageApi.getLicenseWizardMaxPort(),!i)return[3,8];n.label=3;case 3:if(!(w<=i))return[3,8];n.label=4;case 4:return n.trys.push([4,6,,7]),s="http://localhost:"+w.toString()+e,[4,fetch(s)];case 5:return u=n.sent(),F=w,[2,u];case 6:return n.sent(),f("Could not connect to license wizard on port "+w.toString()),w=w+1,[3,7];case 7:return[3,3];case 8:throw a;case 9:return[2]}})})},M={fetchFromWizard:function(e){return ve(e)},setCookie:function(e,a,i){return(0,H.setCookie)(e,a,i)},getCookie:function(e){return(0,H.getCookie)(e)},fetchForChallenge:function(e){return fetch(e)},debug:function(e){return console.log(e)}},ge=function(e){return M=e};d.setDependencies=ge;var D=null,Se=function(e,a){a===void 0&&(a=!1),D=e,(a||!e)&&K.localStorageApi.setIsLicenseDebug(e)};d.setIsDebugLicensing=Se;var f=function(e){D===null&&(D=K.localStorageApi.getIsLicenseDebug()),(G.IS_TEST_ENV||D)&&M.debug(e)};f("SciChart version "+ee.libraryVersion);var ie,pe=function(e){ie=e};d.setLicenseCallback=pe;var z="",ce=function(){return z},Te=function(e){var a=z;z=e,z!==a&&z!==""&&B().forEach(function(i){return(0,d.applyLicense)(i,"setRuntimeLicenseKey")})};d.setRuntimeLicenseKey=Te;var W=!0,Ce=function(e){W=e};d.setUseLicenseWizard=Ce;var I=G.IS_TEST_ENV?.1:5,oe=G.IS_TEST_ENV?12:10,Y="api/license",me=function(e){Y=e},ne=0,V,q,A=function(e){return $(void 0,void 0,void 0,function(){var a,i,s,u,n,l;return x(this,function(r){switch(r.label){case 0:return r.trys.push([0,5,,6]),o!==t.LicenseCheckStatus.StartLookingForLicenseWizard&&o!==t.LicenseCheckStatus.LookingForLicenseWizard&&o!==t.LicenseCheckStatus.NoLicenseInWizard?[2]:(f("Trying to get license from local license wizard"),a=void 0,[4,M.fetchFromWizard("/license")]);case 1:return a=r.sent(),a.ok?[4,a.text()]:[3,3];case 2:return i=r.sent(),s=be(i,e),u=s.requiresValidation,n=s.trialExpired,u?(f("Got a developer license from local license wizard. Validating..."),o=t.LicenseCheckStatus.ValidatingDeveloperLicense,P(e)):n?(o=t.LicenseCheckStatus.NoLicenseInWizard,f("No valid license available in licensing wizard. Trying again in ".concat(I," seconds")),V=setTimeout(function(){return A(e)},I*1e3)):(f("Got a valid license from local license wizard."),o=t.LicenseCheckStatus.LicenseOK),[3,4];case 3:o=t.LicenseCheckStatus.NoLicenseInWizard,f("No license available in licensing wizard. Trying again in ".concat(I," seconds")),V=setTimeout(function(){return A(e)},I*1e3),r.label=4;case 4:return[3,6];case 5:return r.sent(),o=t.LicenseCheckStatus.LookingForLicenseWizard,ne+=1,ne<oe?(f("Could not find licensing wizard. Trying again in ".concat(I," seconds")),V=setTimeout(function(){return A(e)},I*1e3)):(console.log("Failed to connect to licensing wizard. Refresh page to retry."),ne=0,o=t.LicenseCheckStatus.FailedToFindLicenseWizard),[3,6];case 6:return l=(0,d.getLicenseInfo)(e),l.hasChanged&&te().forEach(function(g){Z(l,g,g.surfaceType!==U.ESurfaceType.SciChart3DSurfaceType)}),[2]}})})},j=function(e,a,i,s){var u="".concat(e,",").concat(a,",").concat(i,",").concat(s);return M.setCookie("scLicense",u,365)},Ee=function(){var e;e=M.getCookie("scLicense");var a=e.split(",");return a.length===4?{key:a[0],token:a[1],expiry:new Date(Number.parseInt(a[2],10)*1e3),lastValidated:new Date(Number.parseInt(a[3],10)*1e3)}:{key:a[0],token:null,expiry:null,lastValidated:null}};d.getLicenseCookie=Ee;var B=function(){var e=[];return E.sciChartDestinations.length>0&&e.push(E.sciChartDestinations[0].sciChartSurface.getLicenseContext()),E.sciChart3DDestinations.length>0&&e.push(E.sciChart3DDestinations[0].sciChartSurface.getLicenseContext()),E.sciChartSingleDestinations.forEach(function(a){return e.push(a.sciChartSurface.getLicenseContext())}),E.sciChart3DSingleDestinations.forEach(function(a){return e.push(a.sciChartSurface.getLicenseContext())}),e},te=function(){var e=[];return E.sciChartDestinations.forEach(function(a){return e.push(a.sciChartSurface)}),E.sciChart3DDestinations.forEach(function(a){return e.push(a.sciChartSurface)}),E.sciChartSingleDestinations.forEach(function(a){return e.push(a.sciChartSurface)}),E.sciChart3DSingleDestinations.forEach(function(a){return e.push(a.sciChartSurface)}),e},le=function(e,a){var i=-1;return i=a.SCRTCredentials.ApplyLicenseResponse(e),B().forEach(function(s){return s.SCRTCredentials.ApplyLicenseResponse(e)}),i},X=0,P=function(e){return $(void 0,void 0,void 0,function(){var a,i,s,u,n,l,r,r,g,c,L,v,_,y,C,k,m;return x(this,function(b){switch(b.label){case 0:if(a=B(),e===void 0)if(a.length>0)e=a[0];else return[2];i=h.licenseManager2dState.isDev?"license wizard":"server",b.label=1;case 1:return b.trys.push([1,11,,12]),o!==t.LicenseCheckStatus.ValidatingDeveloperLicense?[2]:(f("Attempting to validate license with ".concat(i)),s=e.SCRTCredentials.GetLicenseChallenge(),u=e.SCRTCredentials.GetOrderId(),n=void 0,l="orderid=".concat(u,"&challenge=").concat(s),h.licenseManager2dState.isDev?(r="/validate?".concat(l),[4,M.fetchFromWizard(r)]):[3,3]);case 2:return n=b.sent(),[3,7];case 3:return typeof ie<"u"?[4,ie(l)]:[3,5];case 4:return n=b.sent(),[3,7];case 5:return r="/"+Y+(Y.indexOf("?")>0?"&":"?")+l,[4,M.fetchForChallenge(r)];case 6:n=b.sent(),b.label=7;case 7:return n.ok?[4,n.text()]:[3,9];case 8:return g=b.sent(),g.startsWith("Error")?(f("Server rejected the license challenge: "+g),o=t.LicenseCheckStatus.FailedToValidateDeveloperLicense):(c=le(g,e),c>0?(L=(0,d.getLicenseCookie)().key,L||(L=ce()),v=Math.floor(new Date().getTime()/1e3),j(L,g,c,v),f("License validated"),o=t.LicenseCheckStatus.LicenseOK,_=c-v,X=0,q=setTimeout(function(){o=t.LicenseCheckStatus.ValidatingDeveloperLicense,h.licenseManager2dState.checkStatus=t.LicenseCheckStatus.ValidatingDeveloperLicense,P(void 0)},Math.floor(_*.95*1e3))):(f("license challenge response was invalid: ".concat(g," ").concat(c)),o=t.LicenseCheckStatus.FailedToValidateDeveloperLicense)),[3,10];case 9:if(h.licenseManager2dState.isDev)console.warn("Error during license validation: "+n.statusText),o=t.LicenseCheckStatus.FailedToValidateDeveloperLicense;else throw new Error(n.statusText);b.label=10;case 10:return[3,12];case 11:return b.sent(),h.licenseManager2dState.isDev?(X+=1,X<oe?(f("Could not find ".concat(i,"/").concat(Y,". Trying again in ").concat(I," seconds")),q=setTimeout(function(){return P(e)},I*1e3)):(C=(0,d.getLicenseCookie)().expiry,k=h.licenseManager2dState.isDev?"Please run the license wizard, ensure your license is activated, then refresh page to retry.":"Please check that the endpoint is configured correctly.",console.error("Failed to connect to ".concat(i,"/").concat(Y,". License must be revalidated before ").concat(C.toLocaleString(),". ").concat(k)),X=0,new Date>C&&(o=t.LicenseCheckStatus.FailedToFindLicenseWizard)),[3,12]):(console.warn("Server license validation failed. Looking for local developer license"),z="",o=t.LicenseCheckStatus.NoLicense,e.SCRTCredentials.ResetRuntimeLicense(),a.forEach(function(R){return R.SCRTCredentials.ResetRuntimeLicense()}),O=!1,h.licenseManager2dState.isDev=!0,o=t.LicenseCheckStatus.StartLookingForLicenseWizard,y=(0,d.getLicenseInfo)(e),y.hasChanged&&te().forEach(function(R){Z(y,R,R.surfaceType!==U.ESurfaceType.SciChart3DSurfaceType)}),A(e),[2]);case 12:return m=(0,d.getLicenseInfo)(e),m.hasChanged&&te().forEach(function(R){Z(m,R,R.surfaceType!==U.ESurfaceType.SciChart3DSurfaceType)}),[2]}})})},o=t.LicenseCheckStatus.NoLicense,O=!1,Q=!1,ke=function(e,a){var i,s,u,n;f("applyLicense from "+a);var l="",r=e.SCRTCredentials.GetLicenseType();f("Initial license status is "+t.LicenseType[J(r,e)]);var g=ce();if((o===t.LicenseCheckStatus.NoLicense||o===t.LicenseCheckStatus.LicenseOK||o===t.LicenseCheckStatus.StartLookingForLicenseWizard||o===t.LicenseCheckStatus.LookingForLicenseWizard)&&g){f("Runtime license found");var c=g.indexOf(";");if(c>0){var L=Math.floor(new Date().getTime()/1e3),v=g.substring(c+1);j(g.substr(0,c),v,L+60,L)}else{e.SCRTCredentials.SetRuntimeLicenseKeyW(g),r=e.SCRTCredentials.GetLicenseType();var _=J(r,e);if(f("Runtime license status is "+t.LicenseType[_]),r===e.SCRTLicenseType.LICENSE_TYPE_FULL||r===e.SCRTLicenseType.LICENSE_TYPE_TRIAL||r===e.SCRTLicenseType.LICENSE_TYPE_COMMUNITY||r===e.SCRTLicenseType.LICENSE_TYPE_REQUIRES_VALIDATION)O=!0,l=g;else{var y=e.SCRTCredentials.GetLicenseErrors();window&&(!((i=window.location)===null||i===void 0)&&i.hostname)&&!(!((u=(s=window.location)===null||s===void 0?void 0:s.hostname)===null||u===void 0)&&u.includes("localhost"))||!y.startsWith("License is not valid for this domain")?D?f("Runtime license is invalid: "+y):console.warn("Runtime license is invalid. Call setIsDebugLicensing(true) for details."):f("Runtime license is invalid: "+y),l=""}}}var C=(0,d.getLicenseCookie)();if(l===""&&C&&C.key!==""?(f("Found license in cookie."),l=C.key,e.SCRTCredentials.SetRuntimeLicenseKeyW(l),r=e.SCRTCredentials.GetLicenseType(),r===e.SCRTLicenseType.LICENSE_TYPE_FULL||r===e.SCRTLicenseType.LICENSE_TYPE_TRIAL||r===e.SCRTLicenseType.LICENSE_TYPE_REQUIRES_VALIDATION||(f("License cookie is invalid. "+e.SCRTCredentials.GetLicenseErrors()),(0,H.deleteCookie)("scLicense"),l="",r=e.SCRTLicenseType.LICENSE_TYPE_COMMUNITY)):o===t.LicenseCheckStatus.FetchingFromServer&&(o=t.LicenseCheckStatus.NoLicense),l!=="")if(r===e.SCRTLicenseType.LICENSE_TYPE_COMMUNITY&&(e.SCRTCredentials.SetRuntimeLicenseKeyW(l),r=e.SCRTCredentials.GetLicenseType()),h.licenseManager2dState.isDev=e.SCRTCredentials.GetAllowDebugging(),r===e.SCRTLicenseType.LICENSE_TYPE_FULL||r===e.SCRTLicenseType.LICENSE_TYPE_TRIAL||r===e.SCRTLicenseType.LICENSE_TYPE_COMMUNITY){if(o=t.LicenseCheckStatus.LicenseOK,f("license ok"),r===e.SCRTLicenseType.LICENSE_TYPE_COMMUNITY&&O&&!Q){console.log("Using SciChart Community Edition. To use a license from the License Wizard, remove the call to UseCommunityLicense");var k=e.SCRTCredentials.GetLicenseDaysRemaining();console.log("The community license is valid for 6 months from the date the version in use was released. This version ".concat(ee.libraryVersion," has ").concat(k," day").concat(k===1?"":"s"," remaining")),Q=!0}}else if(e.SCRTCredentials.RequiresValidation())if(f("license requires validation"),O&&h.licenseManager2dState.isDev)e.SCRTCredentials.ResetRuntimeLicense(),(0,H.deleteCookie)("scLicense"),o=t.LicenseCheckStatus.DevKeyInRuntimeKey;else if(C.expiry>new Date&&C.key===l){f("current token in cookie");var m=le(C.token,e);r=e.SCRTCredentials.GetLicenseType(),(r===e.SCRTLicenseType.LICENSE_TYPE_FULL||r===e.SCRTLicenseType.LICENSE_TYPE_TRIAL)&&(o=t.LicenseCheckStatus.LicenseOK);var L=Math.floor(new Date().getTime()/1e3);m*1e3>C.expiry.getTime()&&j(l,C.token,m,L);var b=3600*24,R=(new Date().getTime()-C.lastValidated.getTime())/1e3;f("License expires in ".concat(m-L," seconds. Last validated ").concat(R," seconds ago")),R>b&&o!==t.LicenseCheckStatus.ValidatingDeveloperLicense?(o=t.LicenseCheckStatus.ValidatingDeveloperLicense,h.licenseManager2dState.checkStatus=t.LicenseCheckStatus.ValidatingDeveloperLicense,P(e)):q===void 0&&(q=setTimeout(function(){o=t.LicenseCheckStatus.ValidatingDeveloperLicense,h.licenseManager2dState.checkStatus=t.LicenseCheckStatus.ValidatingDeveloperLicense,P(void 0)},Math.floor((m-L)*.95*1e3)))}else o===t.LicenseCheckStatus.NoLicense&&(o=t.LicenseCheckStatus.ValidatingDeveloperLicense,P(e));else f("license is invalid: "+e.SCRTCredentials.GetLicenseErrors());if(f("checkstatus: "+t.LicenseCheckStatus[o]),o===t.LicenseCheckStatus.NoLicense){if(r===e.SCRTLicenseType.LICENSE_TYPE_COMMUNITY&&!Q){console.log("Defaulting to SciChart Community Edition. Usage constitutes acceptance of our EULA and terms at https://www.scichart.com/community-licensing. See https://store.scichart.com for commercial licensing options.");var k=e.SCRTCredentials.GetLicenseDaysRemaining();console.log("The community license is valid for 6 months from the date the version in use was released. This version ".concat(ee.libraryVersion," has ").concat(k," day").concat(k===1?"":"s"," remaining")),!G.IS_TEST_ENV&&(!((n=document==null?void 0:document.location)===null||n===void 0)&&n.hostname.startsWith("localhost"))&&W&&console.log("SciChart is looking for a paid developer activation from the scichart licensing wizard... To disable this call SciChartSurface.UseCommunityLicense()"),Q=!0}V===void 0&&W&&(o=t.LicenseCheckStatus.StartLookingForLicenseWizard,h.licenseManager2dState.isDev=!0,A(e))}};d.applyLicense=ke;var S,ue=function(){console.error("Modal not initialized")},be=function(e,a){var i=!1,s;return S&&(S.style.display="none"),O=!1,j(e,null,null,null),a.SCRTCredentials.SetRuntimeLicenseKeyW(e),i=a.SCRTCredentials.RequiresValidation(),s=a.SCRTCredentials.GetLicenseType()===a.SCRTLicenseType.LICENSE_TYPE_TRIAL_EXPIRED,B().forEach(function(u){return u.SCRTCredentials.SetRuntimeLicenseKeyW(e)}),{requiresValidation:i,trialExpired:s}},de=new Le.Dictionary,ae=function(e,a){if(!de.containsKey(e)){var i=document.styleSheets;if(i.length===0){var s=document.createElement("style");s.appendChild(document.createTextNode("")),document.head.appendChild(s)}var u=i[i.length-1],n=u.insertRule(a,u.cssRules.length);de.add(e,n)}},_e=function(){ae("licenseModalClose",`.licenseModalClose {
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("./petal-toolkit.cjs1336.js"),ze=require("./petal-toolkit.cjs721.js"),Pe=require("./petal-toolkit.cjs550.js"),Fe=require("./petal-toolkit.cjs553.js"),We=require("./petal-toolkit.cjs850.js"),Ye=require("./petal-toolkit.cjs577.js"),Ve=require("./petal-toolkit.cjs567.js"),qe=require("./petal-toolkit.cjs587.js"),Ae=require("./petal-toolkit.cjs854.js"),Oe=require("./petal-toolkit.cjs623.js"),Ge=require("./petal-toolkit.cjs1215.js"),Ke=require("./petal-toolkit.cjs229.js");var he;function Ue(){return he||(he=1,(function(d){var $=N.__exports&&N.__exports.__awaiter||function(e,a,i,s){function u(n){return n instanceof i?n:new i(function(l){l(n)})}return new(i||(i=Promise))(function(n,l){function r(L){try{c(s.next(L))}catch(v){l(v)}}function g(L){try{c(s.throw(L))}catch(v){l(v)}}function c(L){L.done?n(L.value):u(L.value).then(r,g)}c((s=s.apply(e,a||[])).next())})},x=N.__exports&&N.__exports.__generator||function(e,a){var i={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},s,u,n,l;return l={next:r(0),throw:r(1),return:r(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function r(c){return function(L){return g([c,L])}}function g(c){if(s)throw new TypeError("Generator is already executing.");for(;i;)try{if(s=1,u&&(n=c[0]&2?u.return:c[0]?u.throw||((n=u.return)&&n.call(u),0):u.next)&&!(n=n.call(u,c[1])).done)return n;switch(u=0,n&&(c=[c[0]&2,n.value]),c[0]){case 0:case 1:n=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,u=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(n=i.trys,!(n=n.length>0&&n[n.length-1])&&(c[0]===6||c[0]===2)){i=0;continue}if(c[0]===3&&(!n||c[1]>n[0]&&c[1]<n[3])){i.label=c[1];break}if(c[0]===6&&i.label<n[1]){i.label=n[1],n=c;break}if(n&&i.label<n[2]){i.label=n[2],i.ops.push(c);break}n[2]&&i.ops.pop(),i.trys.pop();continue}c=a.call(e,i)}catch(L){c=[6,L],u=0}finally{s=n=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}};Object.defineProperty(d,"__esModule",{value:!0}),d.licenseManager=d.getLicenseInfo=d.applyLicense=d.getLicenseCookie=d.setUseLicenseWizard=d.setRuntimeLicenseKey=d.setLicenseCallback=d.setIsDebugLicensing=d.setDependencies=void 0;var G=ze.__require(),ee=Pe.__require(),Le=Fe.__require(),E=We.__require(),K=Ye.__require(),re=Ve.__require(),ye=qe.__require(),t=Ae.__require(),U=Oe.__require(),H=Ge.__require(),h=Ke.__require(),F=24278,w=24279,se=K.localStorageApi.getLicenseWizardPort();se&&(F=se,w=F+1);var ve=function(e){return $(void 0,void 0,void 0,function(){var s,u,a,i,s,u;return x(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,9]),s="http://localhost:"+F.toString()+e,[4,fetch(s)];case 1:return u=n.sent(),[2,u];case 2:if(a=n.sent(),f("Could not connect to license wizard on port "+F.toString()),!(typeof localStorage<"u"))return[3,8];if(i=K.localStorageApi.getLicenseWizardMaxPort(),!i)return[3,8];n.label=3;case 3:if(!(w<=i))return[3,8];n.label=4;case 4:return n.trys.push([4,6,,7]),s="http://localhost:"+w.toString()+e,[4,fetch(s)];case 5:return u=n.sent(),F=w,[2,u];case 6:return n.sent(),f("Could not connect to license wizard on port "+w.toString()),w=w+1,[3,7];case 7:return[3,3];case 8:throw a;case 9:return[2]}})})},M={fetchFromWizard:function(e){return ve(e)},setCookie:function(e,a,i){return(0,H.setCookie)(e,a,i)},getCookie:function(e){return(0,H.getCookie)(e)},fetchForChallenge:function(e){return fetch(e)},debug:function(e){return console.log(e)}},ge=function(e){return M=e};d.setDependencies=ge;var D=null,Se=function(e,a){a===void 0&&(a=!1),D=e,(a||!e)&&K.localStorageApi.setIsLicenseDebug(e)};d.setIsDebugLicensing=Se;var f=function(e){D===null&&(D=K.localStorageApi.getIsLicenseDebug()),(G.IS_TEST_ENV||D)&&M.debug(e)};f("SciChart version "+ee.libraryVersion);var ie,pe=function(e){ie=e};d.setLicenseCallback=pe;var z="",ce=function(){return z},Te=function(e){var a=z;z=e,z!==a&&z!==""&&B().forEach(function(i){return(0,d.applyLicense)(i,"setRuntimeLicenseKey")})};d.setRuntimeLicenseKey=Te;var W=!0,Ce=function(e){W=e};d.setUseLicenseWizard=Ce;var I=G.IS_TEST_ENV?.1:5,oe=G.IS_TEST_ENV?12:10,Y="api/license",me=function(e){Y=e},ne=0,V,q,A=function(e){return $(void 0,void 0,void 0,function(){var a,i,s,u,n,l;return x(this,function(r){switch(r.label){case 0:return r.trys.push([0,5,,6]),o!==t.LicenseCheckStatus.StartLookingForLicenseWizard&&o!==t.LicenseCheckStatus.LookingForLicenseWizard&&o!==t.LicenseCheckStatus.NoLicenseInWizard?[2]:(f("Trying to get license from local license wizard"),a=void 0,[4,M.fetchFromWizard("/license")]);case 1:return a=r.sent(),a.ok?[4,a.text()]:[3,3];case 2:return i=r.sent(),s=be(i,e),u=s.requiresValidation,n=s.trialExpired,u?(f("Got a developer license from local license wizard. Validating..."),o=t.LicenseCheckStatus.ValidatingDeveloperLicense,P(e)):n?(o=t.LicenseCheckStatus.NoLicenseInWizard,f("No valid license available in licensing wizard. Trying again in ".concat(I," seconds")),V=setTimeout(function(){return A(e)},I*1e3)):(f("Got a valid license from local license wizard."),o=t.LicenseCheckStatus.LicenseOK),[3,4];case 3:o=t.LicenseCheckStatus.NoLicenseInWizard,f("No license available in licensing wizard. Trying again in ".concat(I," seconds")),V=setTimeout(function(){return A(e)},I*1e3),r.label=4;case 4:return[3,6];case 5:return r.sent(),o=t.LicenseCheckStatus.LookingForLicenseWizard,ne+=1,ne<oe?(f("Could not find licensing wizard. Trying again in ".concat(I," seconds")),V=setTimeout(function(){return A(e)},I*1e3)):(console.log("Failed to connect to licensing wizard. Refresh page to retry."),ne=0,o=t.LicenseCheckStatus.FailedToFindLicenseWizard),[3,6];case 6:return l=(0,d.getLicenseInfo)(e),l.hasChanged&&te().forEach(function(g){Z(l,g,g.surfaceType!==U.ESurfaceType.SciChart3DSurfaceType)}),[2]}})})},j=function(e,a,i,s){var u="".concat(e,",").concat(a,",").concat(i,",").concat(s);return M.setCookie("scLicense",u,365)},Ee=function(){var e;e=M.getCookie("scLicense");var a=e.split(",");return a.length===4?{key:a[0],token:a[1],expiry:new Date(Number.parseInt(a[2],10)*1e3),lastValidated:new Date(Number.parseInt(a[3],10)*1e3)}:{key:a[0],token:null,expiry:null,lastValidated:null}};d.getLicenseCookie=Ee;var B=function(){var e=[];return E.sciChartDestinations.length>0&&e.push(E.sciChartDestinations[0].sciChartSurface.getLicenseContext()),E.sciChart3DDestinations.length>0&&e.push(E.sciChart3DDestinations[0].sciChartSurface.getLicenseContext()),E.sciChartSingleDestinations.forEach(function(a){return e.push(a.sciChartSurface.getLicenseContext())}),E.sciChart3DSingleDestinations.forEach(function(a){return e.push(a.sciChartSurface.getLicenseContext())}),e},te=function(){var e=[];return E.sciChartDestinations.forEach(function(a){return e.push(a.sciChartSurface)}),E.sciChart3DDestinations.forEach(function(a){return e.push(a.sciChartSurface)}),E.sciChartSingleDestinations.forEach(function(a){return e.push(a.sciChartSurface)}),E.sciChart3DSingleDestinations.forEach(function(a){return e.push(a.sciChartSurface)}),e},le=function(e,a){var i=-1;return i=a.SCRTCredentials.ApplyLicenseResponse(e),B().forEach(function(s){return s.SCRTCredentials.ApplyLicenseResponse(e)}),i},X=0,P=function(e){return $(void 0,void 0,void 0,function(){var a,i,s,u,n,l,r,r,g,c,L,v,_,y,C,k,m;return x(this,function(b){switch(b.label){case 0:if(a=B(),e===void 0)if(a.length>0)e=a[0];else return[2];i=h.licenseManager2dState.isDev?"license wizard":"server",b.label=1;case 1:return b.trys.push([1,11,,12]),o!==t.LicenseCheckStatus.ValidatingDeveloperLicense?[2]:(f("Attempting to validate license with ".concat(i)),s=e.SCRTCredentials.GetLicenseChallenge(),u=e.SCRTCredentials.GetOrderId(),n=void 0,l="orderid=".concat(u,"&challenge=").concat(s),h.licenseManager2dState.isDev?(r="/validate?".concat(l),[4,M.fetchFromWizard(r)]):[3,3]);case 2:return n=b.sent(),[3,7];case 3:return typeof ie<"u"?[4,ie(l)]:[3,5];case 4:return n=b.sent(),[3,7];case 5:return r="/"+Y+(Y.indexOf("?")>0?"&":"?")+l,[4,M.fetchForChallenge(r)];case 6:n=b.sent(),b.label=7;case 7:return n.ok?[4,n.text()]:[3,9];case 8:return g=b.sent(),g.startsWith("Error")?(f("Server rejected the license challenge: "+g),o=t.LicenseCheckStatus.FailedToValidateDeveloperLicense):(c=le(g,e),c>0?(L=(0,d.getLicenseCookie)().key,L||(L=ce()),v=Math.floor(new Date().getTime()/1e3),j(L,g,c,v),f("License validated"),o=t.LicenseCheckStatus.LicenseOK,_=c-v,X=0,q=setTimeout(function(){o=t.LicenseCheckStatus.ValidatingDeveloperLicense,h.licenseManager2dState.checkStatus=t.LicenseCheckStatus.ValidatingDeveloperLicense,P(void 0)},Math.floor(_*.95*1e3))):(f("license challenge response was invalid: ".concat(g," ").concat(c)),o=t.LicenseCheckStatus.FailedToValidateDeveloperLicense)),[3,10];case 9:if(h.licenseManager2dState.isDev)console.warn("Error during license validation: "+n.statusText),o=t.LicenseCheckStatus.FailedToValidateDeveloperLicense;else throw new Error(n.statusText);b.label=10;case 10:return[3,12];case 11:return b.sent(),h.licenseManager2dState.isDev?(X+=1,X<oe?(f("Could not find ".concat(i,"/").concat(Y,". Trying again in ").concat(I," seconds")),q=setTimeout(function(){return P(e)},I*1e3)):(C=(0,d.getLicenseCookie)().expiry,k=h.licenseManager2dState.isDev?"Please run the license wizard, ensure your license is activated, then refresh page to retry.":"Please check that the endpoint is configured correctly.",console.error("Failed to connect to ".concat(i,"/").concat(Y,". License must be revalidated before ").concat(C.toLocaleString(),". ").concat(k)),X=0,new Date>C&&(o=t.LicenseCheckStatus.FailedToFindLicenseWizard)),[3,12]):(console.warn("Server license validation failed. Looking for local developer license"),z="",o=t.LicenseCheckStatus.NoLicense,e.SCRTCredentials.ResetRuntimeLicense(),a.forEach(function(R){return R.SCRTCredentials.ResetRuntimeLicense()}),O=!1,h.licenseManager2dState.isDev=!0,o=t.LicenseCheckStatus.StartLookingForLicenseWizard,y=(0,d.getLicenseInfo)(e),y.hasChanged&&te().forEach(function(R){Z(y,R,R.surfaceType!==U.ESurfaceType.SciChart3DSurfaceType)}),A(e),[2]);case 12:return m=(0,d.getLicenseInfo)(e),m.hasChanged&&te().forEach(function(R){Z(m,R,R.surfaceType!==U.ESurfaceType.SciChart3DSurfaceType)}),[2]}})})},o=t.LicenseCheckStatus.NoLicense,O=!1,Q=!1,ke=function(e,a){var i,s,u,n;f("applyLicense from "+a);var l="",r=e.SCRTCredentials.GetLicenseType();f("Initial license status is "+t.LicenseType[J(r,e)]);var g=ce();if((o===t.LicenseCheckStatus.NoLicense||o===t.LicenseCheckStatus.LicenseOK||o===t.LicenseCheckStatus.StartLookingForLicenseWizard||o===t.LicenseCheckStatus.LookingForLicenseWizard)&&g){f("Runtime license found");var c=g.indexOf(";");if(c>0){var L=Math.floor(new Date().getTime()/1e3),v=g.substring(c+1);j(g.substr(0,c),v,L+60,L)}else{e.SCRTCredentials.SetRuntimeLicenseKeyW(g),r=e.SCRTCredentials.GetLicenseType();var _=J(r,e);if(f("Runtime license status is "+t.LicenseType[_]),r===e.SCRTLicenseType.LICENSE_TYPE_FULL||r===e.SCRTLicenseType.LICENSE_TYPE_TRIAL||r===e.SCRTLicenseType.LICENSE_TYPE_COMMUNITY||r===e.SCRTLicenseType.LICENSE_TYPE_REQUIRES_VALIDATION)O=!0,l=g;else{var y=e.SCRTCredentials.GetLicenseErrors();window&&(!((i=window.location)===null||i===void 0)&&i.hostname)&&!(!((u=(s=window.location)===null||s===void 0?void 0:s.hostname)===null||u===void 0)&&u.includes("localhost"))||!y.startsWith("License is not valid for this domain")?D?f("Runtime license is invalid: "+y):console.warn("Runtime license is invalid. Call setIsDebugLicensing(true) for details."):f("Runtime license is invalid: "+y),l=""}}}var C=(0,d.getLicenseCookie)();if(l===""&&C&&C.key!==""?(f("Found license in cookie."),l=C.key,e.SCRTCredentials.SetRuntimeLicenseKeyW(l),r=e.SCRTCredentials.GetLicenseType(),r===e.SCRTLicenseType.LICENSE_TYPE_FULL||r===e.SCRTLicenseType.LICENSE_TYPE_TRIAL||r===e.SCRTLicenseType.LICENSE_TYPE_REQUIRES_VALIDATION||(f("License cookie is invalid. "+e.SCRTCredentials.GetLicenseErrors()),(0,H.deleteCookie)("scLicense"),l="",r=e.SCRTLicenseType.LICENSE_TYPE_COMMUNITY)):o===t.LicenseCheckStatus.FetchingFromServer&&(o=t.LicenseCheckStatus.NoLicense),l!=="")if(r===e.SCRTLicenseType.LICENSE_TYPE_COMMUNITY&&(e.SCRTCredentials.SetRuntimeLicenseKeyW(l),r=e.SCRTCredentials.GetLicenseType()),h.licenseManager2dState.isDev=e.SCRTCredentials.GetAllowDebugging(),r===e.SCRTLicenseType.LICENSE_TYPE_FULL||r===e.SCRTLicenseType.LICENSE_TYPE_TRIAL||r===e.SCRTLicenseType.LICENSE_TYPE_COMMUNITY){if(o=t.LicenseCheckStatus.LicenseOK,f("license ok"),r===e.SCRTLicenseType.LICENSE_TYPE_COMMUNITY&&O&&!Q){console.log("Using SciChart Community Edition. To use a license from the License Wizard, remove the call to UseCommunityLicense");var k=e.SCRTCredentials.GetLicenseDaysRemaining();console.log("The community license is valid for 6 months from the date the version in use was released. This version ".concat(ee.libraryVersion," has ").concat(k," day").concat(k===1?"":"s"," remaining")),Q=!0}}else if(e.SCRTCredentials.RequiresValidation())if(f("license requires validation"),O&&h.licenseManager2dState.isDev)e.SCRTCredentials.ResetRuntimeLicense(),(0,H.deleteCookie)("scLicense"),o=t.LicenseCheckStatus.DevKeyInRuntimeKey;else if(C.expiry>new Date&&C.key===l){f("current token in cookie");var m=le(C.token,e);r=e.SCRTCredentials.GetLicenseType(),(r===e.SCRTLicenseType.LICENSE_TYPE_FULL||r===e.SCRTLicenseType.LICENSE_TYPE_TRIAL)&&(o=t.LicenseCheckStatus.LicenseOK);var L=Math.floor(new Date().getTime()/1e3);m*1e3>C.expiry.getTime()&&j(l,C.token,m,L);var b=3600*24,R=(new Date().getTime()-C.lastValidated.getTime())/1e3;f("License expires in ".concat(m-L," seconds. Last validated ").concat(R," seconds ago")),R>b&&o!==t.LicenseCheckStatus.ValidatingDeveloperLicense?(o=t.LicenseCheckStatus.ValidatingDeveloperLicense,h.licenseManager2dState.checkStatus=t.LicenseCheckStatus.ValidatingDeveloperLicense,P(e)):q===void 0&&(q=setTimeout(function(){o=t.LicenseCheckStatus.ValidatingDeveloperLicense,h.licenseManager2dState.checkStatus=t.LicenseCheckStatus.ValidatingDeveloperLicense,P(void 0)},Math.floor((m-L)*.95*1e3)))}else o===t.LicenseCheckStatus.NoLicense&&(o=t.LicenseCheckStatus.ValidatingDeveloperLicense,P(e));else f("license is invalid: "+e.SCRTCredentials.GetLicenseErrors());if(f("checkstatus: "+t.LicenseCheckStatus[o]),o===t.LicenseCheckStatus.NoLicense){if(r===e.SCRTLicenseType.LICENSE_TYPE_COMMUNITY&&!Q){console.log("Defaulting to SciChart Community Edition. Usage constitutes acceptance of our EULA and terms at https://www.scichart.com/community-licensing. See https://store.scichart.com for commercial licensing options.");var k=e.SCRTCredentials.GetLicenseDaysRemaining();console.log("The community license is valid for 6 months from the date the version in use was released. This version ".concat(ee.libraryVersion," has ").concat(k," day").concat(k===1?"":"s"," remaining")),!G.IS_TEST_ENV&&(!((n=document==null?void 0:document.location)===null||n===void 0)&&n.hostname.startsWith("localhost"))&&W&&console.log("SciChart is looking for a paid developer activation from the scichart licensing wizard... To disable this call SciChartSurface.UseCommunityLicense()"),Q=!0}V===void 0&&W&&(o=t.LicenseCheckStatus.StartLookingForLicenseWizard,h.licenseManager2dState.isDev=!0,A(e))}};d.applyLicense=ke;var S,ue=function(){console.error("Modal not initialized")},be=function(e,a){var i=!1,s;return S&&(S.style.display="none"),O=!1,j(e,null,null,null),a.SCRTCredentials.SetRuntimeLicenseKeyW(e),i=a.SCRTCredentials.RequiresValidation(),s=a.SCRTCredentials.GetLicenseType()===a.SCRTLicenseType.LICENSE_TYPE_TRIAL_EXPIRED,B().forEach(function(u){return u.SCRTCredentials.SetRuntimeLicenseKeyW(e)}),{requiresValidation:i,trialExpired:s}},de=new Le.Dictionary,ae=function(e,a){if(!de.containsKey(e)){var i=document.styleSheets;if(i.length===0){var s=document.createElement("style");s.appendChild(document.createTextNode("")),document.head.appendChild(s)}var u=i[i.length-1],n=u.insertRule(a,u.cssRules.length);de.add(e,n)}},_e=function(){ae("licenseModalClose",`.licenseModalClose {
|
|
2
2
|
color: #aaa;
|
|
3
3
|
float: right;
|
|
4
4
|
font-size: 28px;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./petal-toolkit.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./petal-toolkit.cjs1338.js");var e;function s(){return e||(e=1,Object.defineProperty(t.__exports,"__esModule",{value:!0}),t.__exports.sciChartPieDestinations=t.__exports.sciChart3DSingleDestinations=t.__exports.sciChartSingleDestinations=t.__exports.sciChart3DDestinations=t.__exports.sciChartDestinations=void 0,t.__exports.sciChartDestinations=[],t.__exports.sciChart3DDestinations=[],t.__exports.sciChartSingleDestinations=[],t.__exports.sciChart3DSingleDestinations=[],t.__exports.sciChartPieDestinations=[]),t.__exports}exports.__require=s;
|
|
2
2
|
//# sourceMappingURL=petal-toolkit.cjs850.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./petal-toolkit.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./petal-toolkit.cjs1339.js"),C=require("./petal-toolkit.cjs654.js"),f=require("./petal-toolkit.cjs660.js");var l;function g(){if(l)return o.__exports;l=1,Object.defineProperty(o.__exports,"__esModule",{value:!0}),o.__exports.copyToCanvas=void 0;var u=C.__require(),e=f.__require(),d=function(c,p){return function(t){var n;u.Logger.debug("copyToCanvas");var i=e.PerformanceDebugHelper.mark(e.EPerformanceMarkType.CopyToCanvasStart,{parentContextId:t,level:e.EPerformanceDebugLevel.Verbose}),r=p(t),v=r==null?void 0:r.sciChartSurface,a=r==null?void 0:r.sciChartSurface.domCanvas2D;if(a){var s=a.getContext("2d");s.globalCompositeOperation="copy",s.drawImage(c,0,0,a.width,a.height,0,0,a.width,a.height),e.PerformanceDebugHelper.mark(e.EPerformanceMarkType.CopyToCanvasEnd,{contextId:v.id,parentContextId:t,relatedId:(n=i==null?void 0:i.detail)===null||n===void 0?void 0:n.relatedId,level:e.EPerformanceDebugLevel.Verbose});var _=v.isInvalidated;v.renderedToDestination.raiseEvent(_)}}};return o.__exports.copyToCanvas=d,o.__exports}exports.__require=g;
|
|
2
2
|
//# sourceMappingURL=petal-toolkit.cjs851.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./petal-toolkit.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./petal-toolkit.cjs1340.js");var l;function d(){return l||(l=1,(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.LicenseCheckStatus=r.LicenseType=void 0,(function(i){i[i.NoLicense=0]="NoLicense",i[i.Trial=1]="Trial",i[i.Full=2]="Full",i[i.Full_Expired=3]="Full_Expired",i[i.Trial_Expired=4]="Trial_Expired",i[i.Subscription_Expired=5]="Subscription_Expired",i[i.Invalid_Developer=6]="Invalid_Developer",i[i.Requres_Validation=7]="Requres_Validation",i[i.Invalid=8]="Invalid",i[i.Community=9]="Community"})(r.LicenseType||(r.LicenseType={})),(function(i){i[i.NoLicense=0]="NoLicense",i[i.FetchingFromServer=1]="FetchingFromServer",i[i.StartLookingForLicenseWizard=2]="StartLookingForLicenseWizard",i[i.LookingForLicenseWizard=3]="LookingForLicenseWizard",i[i.ValidatingDeveloperLicense=4]="ValidatingDeveloperLicense",i[i.NoLicenseInWizard=5]="NoLicenseInWizard",i[i.FailedToFindLicenseWizard=6]="FailedToFindLicenseWizard",i[i.FailedToValidateDeveloperLicense=7]="FailedToValidateDeveloperLicense",i[i.DevKeyInRuntimeKey=8]="DevKeyInRuntimeKey",i[i.LicenseOK=9]="LicenseOK"})(r.LicenseCheckStatus||(r.LicenseCheckStatus={}))})(o.__exports)),o.__exports}exports.__require=d;
|
|
2
2
|
//# sourceMappingURL=petal-toolkit.cjs854.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./petal-toolkit.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./petal-toolkit.cjs1342.js");var n;function p(){if(n)return e.__exports;n=1,Object.defineProperty(e.__exports,"__esModule",{value:!0}),e.__exports.hasProperties=e.__exports.areEqual=void 0;function s(r,t){if(r===t)return!0;var o=Object.keys(r),i=Object.keys(r);return o.length===i.length&&o.every(function(u){return Object.prototype.hasOwnProperty.call(t,u)&&r[u]===t[u]})}e.__exports.areEqual=s;var a=function(r,t){return t.every(function(o){return Object.prototype.hasOwnProperty.call(r,o)})};return e.__exports.hasProperties=a,e.__exports}exports.__require=p;
|
|
2
2
|
//# sourceMappingURL=petal-toolkit.cjs859.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("./petal-toolkit.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("./petal-toolkit.cjs1341.js"),H=require("./petal-toolkit.cjs847.js"),O=require("./petal-toolkit.cjs550.js"),N=require("./petal-toolkit.cjs556.js"),K=require("./petal-toolkit.cjs569.js"),U=require("./petal-toolkit.cjs654.js"),Y=require("./petal-toolkit.cjs848.js"),J=require("./petal-toolkit.cjs231.js"),Q=require("./petal-toolkit.cjs849.js"),V=require("./petal-toolkit.cjs237.js"),X=require("./petal-toolkit.cjs238.js"),Z=require("./petal-toolkit.cjs310.js"),$=require("./petal-toolkit.cjs551.js"),x=require("./petal-toolkit.cjs850.js"),ee=require("./petal-toolkit.cjs288.js"),re=require("./petal-toolkit.cjs227.js"),ae=require("./petal-toolkit.cjs660.js");var E;function ie(){return E||(E=1,(function(c){Object.defineProperty(c,"__esModule",{value:!0}),c.initDrawEngineSingleChart=c.createSingleInternal=void 0;var L=H.__require(),R=O.__require(),y=N.__require(),b=K.__require(),W=U.__require(),p=Y.__require(),s=J.__require(),I=Q.__require(),T=V.__require(),M=X.__require(),P=Z.__require(),k=$.__require(),G=x.__require(),A=ee.__require(),B=re.__require(),S=ae.__require(),j=function(a,i,e){return new Promise(function(_,m){var v,h,r,t=I.default.initCanvas(a,e==null?void 0:e.widthAspect,e==null?void 0:e.heightAspect,void 0,(v=e==null?void 0:e.disableAspect)!==null&&v!==void 0?v:s.SciChartDefaults.disableAspect,e==null?void 0:e.touchAction),n=(h=e==null?void 0:e.loader)!==null&&h!==void 0?h:s.SciChartDefaults.defaultLoader,f=(r=n.addChartLoader)===null||r===void 0?void 0:r.call(n,t.domDivContainer,e==null?void 0:e.theme),l=S.PerformanceDebugHelper.mark(S.EPerformanceMarkType.EngineInitStart,{parentContextId:t.domCanvas2D.id}),o=b.WebGlHelper.getWebGlSupport();if(o===b.EWebGLSupport.WebGL2||o===b.EWebGLSupport.WebGL1){var F=(0,M.getLocateFile)(T.sciChartConfig);new L({locateFile:F,noInitialRun:!0}).then(function(u){var d;(d=n.removeChartLoader)===null||d===void 0||d.call(n,t.domDivContainer,f),u.doNotCaptureKeyboard=!0,p.licenseManager.applyLicense(u,"2D single");var g=(0,k.createWasmContextRevocableProxy)(u,t.domCanvas2D.id),w=function(C){var D;((D=e==null?void 0:e.createSuspended)!==null&&D!==void 0?D:s.SciChartDefaults.createSuspended)&&C.sciChartSurface.suspendUpdates(),C.sciChartSurface.addDeletable({delete:function(){g.revoke(),g=void 0}}),S.PerformanceDebugHelper.mark(S.EPerformanceMarkType.EngineInitEnd,{relatedId:l==null?void 0:l.detail.relatedId,contextId:C.sciChartSurface.id,parentContextId:t.domCanvas2D.id}),_(C)};(0,c.initDrawEngineSingleChart)(g.proxy,t,w,e==null?void 0:e.theme,i),(0,R.checkBuildStamp)(u),(0,B.monitorWebGL)(u)}).catch(function(u){var d;W.Logger.debug(u),(d=n.removeChartLoader)===null||d===void 0||d.call(n,t.domDivContainer,f),m(`Could not load SciChart WebAssembly module.
|
|
2
2
|
Check your build process and ensure that your "scichart2d.wasm" and "scichart2d.js" files are from the same version`)})}else throw Error("Sorry Your browser does not support WebGL.")})};c.createSingleInternal=j;var z=function(a,i,e,_,m){y.Guard.notNull(_,"theme");var v=i.domCanvas2D.width,h=i.domCanvas2D.height,r;a.canvas=i.domCanvasWebGL;var t=new a.SCRTFrameRenderer2D,n=i.domCanvasWebGL.id,f={InitializeChart:function(){r=m(a,{canvases:i}),r.applyTheme(_),G.sciChartSingleDestinations.push({canvasElementId:n,sciChartSurface:r,width:v,height:h}),r.setDestinations(G.sciChartSingleDestinations),r.addDeletable({delete:function(){a.TSRRequestExit(),t.delete(),a.SCRTGetGlobalSampleChartInterface().SetFrameRenderer(null),a.SCRTGetGlobalSampleChartInterface().delete(),a.SCRTSetGlobalSampleChartInterface(null),A.labelCache.resetCache()}}),setTimeout(function(){r.invalidateElement(),p.licenseManager.updateLicenseDisplay(r);var o=I.default.subscribeToResize(i.domChartRoot,i.aspect,r,i.disableAspect);r.addDeletable(o),r.addDeletable((0,P.freeCache)(a)),r.setIsInitialized(),e({wasmContext:a,sciChartSurface:r})},0)},Draw:function(o){r.renderSurface.onRenderTimeElapsed()},Update:function(o){},ShutDownChart:function(){}},l=a.SCRTSampleChartInterface.implement(f);l.SetFrameRenderer(t),l.SetFPSCounterEnabled(!1),l.SetWasmBufferSizesKb(s.SciChartDefaults.wasmBufferSizesKb),a.SCRTSetGlobalSampleChartInterface(l),a.callMain()};c.initDrawEngineSingleChart=z})(q.__exports)),q.__exports}exports.__require=ie;
|
|
3
3
|
//# sourceMappingURL=petal-toolkit.cjs861.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./petal-toolkit.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./petal-toolkit.cjs1343.js");var r;function t(){return r||(r=1,Object.defineProperty(e.__exports,"__esModule",{value:!0}),e.__exports.polygonFormatRequiredFieldNames=e.__exports.ltrbFormatRequiredFieldNames=e.__exports.xywhFormatRequiredFieldNames=void 0,e.__exports.xywhFormatRequiredFieldNames=["x","y","width","height"],e.__exports.ltrbFormatRequiredFieldNames=["left","top","right","bottom"],e.__exports.polygonFormatRequiredFieldNames=["x1","x2","y1","y2"]),e.__exports}exports.__require=t;
|
|
2
2
|
//# sourceMappingURL=petal-toolkit.cjs864.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./petal-toolkit.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./petal-toolkit.cjs1345.js"),p=require("./petal-toolkit.cjs721.js"),_=require("./petal-toolkit.cjs569.js"),l=require("./petal-toolkit.cjs108.js");var o;function c(){if(o)return r.__exports;o=1,Object.defineProperty(r.__exports,"__esModule",{value:!0}),r.__exports.RenderSurface=void 0;var i=p.__require(),s=_.__require(),u=l.__require(),a=(function(){function t(n,e,d){this.webAssemblyContext=n,this.viewportSize=e,this.canvasId=d}return t.prototype.getRenderContext=function(){return this.renderContextProperty||(this.renderContextProperty=new u.WebGlRenderContext2D(this.webAssemblyContext,this.viewportSize,this.canvasId)),this.renderContextProperty},t.prototype.invalidateElement=function(n){var e;return i.IS_TEST_ENV?!0:!((e=s.WebGlHelper.getContext(this.webAssemblyContext.canvas))===null||e===void 0)&&e.isContextLost()?!1:(this.webAssemblyContext.TSRRequestCanvasDraw(n),!0)},t.prototype.onRenderTimeElapsed=function(){this.handleDraw(),this.renderContextProperty=void 0},t})();return r.__exports.RenderSurface=a,r.__exports}exports.__require=c;
|
|
2
2
|
//# sourceMappingURL=petal-toolkit.cjs866.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./petal-toolkit.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./petal-toolkit.cjs1346.js"),f=require("./petal-toolkit.cjs551.js"),p=require("./petal-toolkit.cjs552.js"),d=require("./petal-toolkit.cjs659.js");var u;function y(){if(u)return o.__exports;u=1;var h=o.__exports&&o.__exports.__extends||(function(){var i=function(r,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,s){t.__proto__=s}||function(t,s){for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(t[n]=s[n])},i(r,e)};return function(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");i(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}})();Object.defineProperty(o.__exports,"__esModule",{value:!0}),o.__exports.SolidBrushCache=void 0;var l=f.__require(),_=p.__require(),c=d.__require(),a=(function(i){h(r,i);function r(e){var t=i.call(this)||this;return t.webAssemblyContext=e,t}return r.prototype.newBrush=function(e,t){return t===void 0&&(t=!1),this.brush&&e===this.color&&t===this.transparent?this.brush:(this.brush&&this.brush.delete(),this.color=e,this.transparent=t,this.brush=new this.webAssemblyContext.SCRTSolidBrush((0,c.parseColorToUIntArgb)(e),t),this.brush)},r.prototype.delete=function(){this.brush=(0,_.deleteSafe)(this.brush),this.webAssemblyContext=void 0},r})(l.DeletableEntity);return o.__exports.SolidBrushCache=a,o.__exports}exports.__require=y;
|
|
2
2
|
//# sourceMappingURL=petal-toolkit.cjs867.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("./petal-toolkit.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("./petal-toolkit.cjs1347.js"),Y=require("./petal-toolkit.cjs1149.js"),Z=require("./petal-toolkit.cjs851.js"),$=require("./petal-toolkit.cjs848.js"),ee=require("./petal-toolkit.cjs231.js"),te=require("./petal-toolkit.cjs849.js"),re=require("./petal-toolkit.cjs238.js"),ae=require("./petal-toolkit.cjs550.js"),ne=require("./petal-toolkit.cjs551.js"),ie=require("./petal-toolkit.cjs850.js"),ce=require("./petal-toolkit.cjs647.js"),se=require("./petal-toolkit.cjs654.js"),ue=require("./petal-toolkit.cjs657.js"),oe=require("./petal-toolkit.cjs660.js"),le=require("./petal-toolkit.cjs510.js");var W;function de(){if(W)return C.__exports;W=1;var P=C.__exports&&C.__exports.__awaiter||function(S,a,r,s){function i(e){return e instanceof r?e:new r(function(c){c(e)})}return new(r||(r=Promise))(function(e,c){function u(o){try{t(s.next(o))}catch(b){c(b)}}function n(o){try{t(s.throw(o))}catch(b){c(b)}}function t(o){o.done?e(o.value):i(o.value).then(u,n)}t((s=s.apply(S,a||[])).next())})},A=C.__exports&&C.__exports.__generator||function(S,a){var r={label:0,sent:function(){if(e[0]&1)throw e[1];return e[1]},trys:[],ops:[]},s,i,e,c;return c={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function u(t){return function(o){return n([t,o])}}function n(t){if(s)throw new TypeError("Generator is already executing.");for(;r;)try{if(s=1,i&&(e=t[0]&2?i.return:t[0]?i.throw||((e=i.return)&&e.call(i),0):i.next)&&!(e=e.call(i,t[1])).done)return e;switch(i=0,e&&(t=[t[0]&2,e.value]),t[0]){case 0:case 1:e=t;break;case 4:return r.label++,{value:t[1],done:!1};case 5:r.label++,i=t[1],t=[0];continue;case 7:t=r.ops.pop(),r.trys.pop();continue;default:if(e=r.trys,!(e=e.length>0&&e[e.length-1])&&(t[0]===6||t[0]===2)){r=0;continue}if(t[0]===3&&(!e||t[1]>e[0]&&t[1]<e[3])){r.label=t[1];break}if(t[0]===6&&r.label<e[1]){r.label=e[1],e=t;break}if(e&&r.label<e[2]){r.label=e[2],r.ops.push(t);break}e[2]&&r.ops.pop(),r.trys.pop();continue}t=a.call(S,r)}catch(o){t=[6,o],i=0}finally{s=e=0}if(t[0]&5)throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}};Object.defineProperty(C.__exports,"__esModule",{value:!0}),C.__exports.disposeMultiChart3d=C.__exports.createMultichart3d=void 0;var F=Y.__require(),U=Z.__require(),B=$.__require(),G=ee.__require(),M=te.__require(),_=re.__require(),j=ae.__require(),z=ne.__require(),v=ie.__require(),H=ce.__require(),O=se.__require(),K=ue.__require(),E=oe.__require(),p=le.__require(),d={id:void 0,wasmContext:void 0,getChildSurfaces:void 0,createChildSurface:void 0},R,N=function(S,a){return P(void 0,void 0,void 0,function(){var r,s,i,e,c,u,n,t,o,b,h,y,x,f,m,g,w,q,T,D,l;return A(this,function(I){switch(I.label){case 0:M.default.checkChartDivExists(S),r=M.default.initCanvas(S,(y=a==null?void 0:a.widthAspect)!==null&&y!==void 0?y:0,(x=a==null?void 0:a.heightAspect)!==null&&x!==void 0?x:0,M.default.ECanvasType.canvas2D,(f=a==null?void 0:a.disableAspect)!==null&&f!==void 0?f:G.SciChartDefaults.disableAspect,a==null?void 0:a.touchAction),s=(m=a==null?void 0:a.loader)!==null&&m!==void 0?m:G.SciChartDefaults.defaultLoader,i=(g=s.addChartLoader)===null||g===void 0?void 0:g.call(s,r.domDivContainer,(w=a==null?void 0:a.theme)!==null&&w!==void 0?w:_.SciChartSurfaceBase.DEFAULT_THEME),I.label=1;case 1:return I.trys.push([1,4,,5]),e=(q=r.domCanvas2D)===null||q===void 0?void 0:q.id,c=E.PerformanceDebugHelper.mark(E.EPerformanceMarkType.EngineInitStart,{parentContextId:e}),!d.wasmContext||!d.createChildSurface||!d.getChildSurfaces?(R||(R=J()),[4,R]):[3,3];case 2:u=I.sent(),(0,j.checkBuildStamp)(u.wasmContext),d.id=u.id,d.wasmContext=u.wasmContext,d.createChildSurface=u.createChildSurface,d.getChildSurfaces=u.getChildSurfaces,I.label=3;case 3:return E.PerformanceDebugHelper.mark(E.EPerformanceMarkType.EngineInitEnd,{relatedId:(T=c==null?void 0:c.detail)===null||T===void 0?void 0:T.relatedId,contextId:d.id,parentContextId:e}),n=d.createChildSurface,t=d.wasmContext,o=r.domChartRoot.id,b=n(o,r,(D=a==null?void 0:a.theme)!==null&&D!==void 0?D:_.SciChartSurfaceBase.DEFAULT_THEME),[2,new Promise(function(X){setTimeout(function(){var L;(L=s.removeChartLoader)===null||L===void 0||L.call(s,r.domDivContainer,i),b.setIsInitialized(),X({wasmContext:t,sciChart3DSurface:b})},0)})];case 4:return h=I.sent(),console.error(h),(l=s.removeChartLoader)===null||l===void 0||l.call(s,r.domDivContainer,i),[2,Promise.reject(h)];case 5:return[2]}})})};C.__exports.createMultichart3d=N;var k,V=function(){k&&k(),d.createChildSurface=void 0,d.getChildSurfaces=void 0,d.wasmContext=void 0,R=void 0,B.licenseManager.clear()};C.__exports.disposeMultiChart3d=V;var J=function(){var S=function(r,s,i,e){var c=new p.SciChart3DSurface(r,{canvases:i});c.applyTheme(e),c.setDestinations(v.sciChart3DDestinations);var u=M.default.subscribeToResize(i.domChartRoot,i.aspect,c);return c.addDeletable(u),c},a=function(r,s,i,e,c,u){var n=(0,_.createChartDestination)(i.domCanvas2D);if(!n){i.delete();return}var t=r.SCRTSurfaceDestination.implement(n);u.AddDestination(t),v.sciChart3DDestinations.push({canvasElementId:s,sciChartSurface:i,width:e,height:c})};return new Promise(function(r,s){var i=(0,_.getLocateFile)(p.sciChartConfig3D);new F({locateFile:i,noInitialRun:!0}).then(function(e){var c=(0,H.generateGuid)(),u=(0,z.createWasmContextRevocableProxy)(e,c),n=u.proxy;B.licenseManager.applyLicense(n,"3D master"),k=function(){n.TSRRequestExit(),y.delete(),n.SCRTGetGlobalSampleChartInterface().SetFrameRenderer(null),n.SCRTGetGlobalSampleChartInterface().delete(),n.SCRTSetGlobalSampleChartInterface(null),x.delete(),n.SCRTSetGlobalCopyToDestinationInterface(null),u.revoke(),u=void 0,k=void 0};var t=function(){return v.sciChart3DDestinations.map(function(f){return f.sciChartSurface})},o=function(f,m,g){var w=M.default.getCanvas2dId(f),q=v.sciChart3DDestinations.filter(function(l){return l.canvasElementId!==w});h.ClearDestinations();var T=v.sciChart3DDestinations.filter(function(l){return l.canvasElementId===w});for(T.forEach(function(l){return l.sciChartSurface.delete()});v.sciChart3DDestinations.length>0;)v.sciChart3DDestinations.pop();q.forEach(function(l){return a(n,l.canvasElementId,l.sciChartSurface,l.width,l.height,h)});var D=S(n,f,m,g);return D.addDeletable({delete:function(){if(p.SciChart3DSurface.autoDisposeWasmContext&&D.otherSurfaces.length===0)p.SciChart3DSurface.wasmContextDisposeTimeout?setTimeout(function(){v.sciChart3DDestinations.length===0&&p.SciChart3DSurface.disposeSharedWasmContext()},p.SciChart3DSurface.wasmContextDisposeTimeout):p.SciChart3DSurface.disposeSharedWasmContext();else try{process.env.NODE_ENV!=="production"&&K.MemoryUsageHelper.isMemoryUsageDebugEnabled&&D.otherSurfaces.length===0&&console.warn('SciChart3DSurface.autoDisposeWasmContext is disabled, thus wasmContext should be disposed explicitly using "SciChartSurface.disposeSharedWasmContext()".')}catch(l){console.warn(l)}}}),a(n,w,D,m.domCanvas2D.width,m.domCanvas2D.height,h),B.licenseManager.updateLicenseDisplay(D),D};n.canvas=(0,_.getMasterCanvas)();var b={InitializeChart:function(){r({id:c,getChildSurfaces:t,createChildSurface:o,wasmContext:n})},Draw:function(f){O.Logger.debug("Draw",f);var m=v.sciChart3DDestinations.find(function(g){return g.canvasElementId===f});m&&m.sciChartSurface.doDrawingLoop()},Update:function(f){},ShutDownChart:function(){}},h=n.SCRTSampleChartInterface.implement(b),y=new n.SCRTFrameRenderer3D;h.SetFrameRenderer(y),h.SetFPSCounterEnabled(!1),h.SetWasmBufferSizesKb(G.SciChartDefaults.wasmBufferSizesKb),n.SCRTSetGlobalSampleChartInterface(h);var x=n.SCRTCopyToDestinationInterface.implement({CopyToDestination:(0,U.copyToCanvas)(_.SciChartSurfaceBase.domMasterCanvas,Q)});n.SCRTSetGlobalCopyToDestinationInterface(x),n.TSRSetDrawRequestsEnabled(!0),_.SciChartSurfaceBase.domMasterCanvas&&n.SCRTSetMainWindowSize(_.SciChartSurfaceBase.domMasterCanvas.width,_.SciChartSurfaceBase.domMasterCanvas.height),n.callMain()}).catch(function(e){console.error(e),s(`Could not load SciChart WebAssembly module.
|
|
2
2
|
Check your build process and ensure that your "scichart3d.wasm" and "scichart3d.js" files are from the same version`)})})},Q=function(S){return v.sciChart3DDestinations.find(function(a){return a.canvasElementId===S})};return C.__exports}exports.__require=de;
|
|
3
3
|
//# sourceMappingURL=petal-toolkit.cjs868.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./petal-toolkit.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./petal-toolkit.cjs1344.js");var o;function l(){if(o)return s.__exports;o=1,Object.defineProperty(s.__exports,"__esModule",{value:!0}),s.__exports.VisibilityObserver=void 0;var b=(function(){function r(i,t){this.callback=t,this.element=i}return r.observe=function(i,t){var e=new r(i,t);return e.init(),e},r.prototype.disconnect=function(){this.observer.disconnect()},r.prototype.init=function(){var i=this;this.observer=new IntersectionObserver(function(t){for(var e=0,n=t;e<n.length;e++){var v=n[e];i.callback(v.isIntersecting)}},{root:null,threshold:.01}),this.observer.observe(this.element)},r})();return s.__exports.VisibilityObserver=b,s.__exports}exports.__require=l;
|
|
2
2
|
//# sourceMappingURL=petal-toolkit.cjs870.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("./petal-toolkit.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("./petal-toolkit.cjs1348.js");var E;function N(){return E||(E=1,(function(I){Object.defineProperty(I,"__esModule",{value:!0}),I.DISTANCE_TO_LINE=I.ADORNER_GRIP_RADIUS=I.PROPERTY=void 0,(function(_){_.ADORNER_TEMPLATE="ADORNER_TEMPLATE",_.ANNOTATION_CANVAS="ANNOTATION_CANVAS",_.RESIZE_DIRECTIONS="RESIZE_DIRECTIONS",_.AXIS_LABELS_FILL="AXIS_LABELS_FILL",_.AXIS_LABELS_STROKE="AXIS_LABELS_STROKE",_.AXIS_FONT_FAMILY="AXIS_FONT_FAMILY",_.AXIS_FONT_SIZE="AXIS_FONT_SIZE",_.BACKGROUND_COLOR="BACKGROUND_COLOR",_.CENTER_X="CENTER_X",_.CENTER_Y="CENTER_Y",_.CLASS_NAME="CLASS_NAME",_.COLOR="COLOR",_.CONTAINER_BACKGROUND="CONTAINER_BACKGROUND",_.CLIPPING="CLIPPING",_.FILL="FILL",_.FONT_FAMILY="FONT_FAMILY",_.FONT_SIZE="FONT_SIZE",_.FONT_STYLE="FONT_STYLE",_.FONT_WEIGHT="FONT_WEIGHT",_.FORMATTED_VALUE="FORMATTED_VALUE",_.HEIGHT="HEIGHT",_.HORIZONTAL_ANCHOR_POINT="HORIZONTAL_ANCHOR_POINT",_.IMAGE="IMAGE",_.IMAGE_HEIGHT="IMAGE_HEIGHT",_.IMAGE_WIDTH="IMAGE_WIDTH",_.IS_EDITABLE="IS_EDITABLE",_.IS_LINE_MODE="IS_LINE_MODE",_.IS_HIDDEN="IS_HIDDEN",_.IS_SELECTED="IS_SELECTED",_.IS_HOVERED="IS_HOVERED",_.LABEL_PLACEMENT="LABEL_PLACEMENT",_.LABEL_VALUE="LABEL_VALUE",_.MINIMUM_WIDTH="MINIMUM_WIDTH",_.MINIMUM_HEIGHT="MINIMUM_HEIGHT",_.OPACITY="OPACITY",_.PADDING="PADDING",_.PARENT_SURFACE="PARENT_SURFACE",_.SERIES_INFO="SERIES_INFO",_.SERIES_INFOS="SERIES_INFOS",_.STROKE="STROKE",_.STROKE_THICKNESS="STROKE_THICKNESS",_.STROKE_DASH_ARRAY="STROKE_DASH_ARRAY",_.SHOW_LABEL="SHOW_LABEL",_.TEXT="TEXT",_.TEXT_STROKE="TEXT_STROKE",_.TEXT_STYLE="TEXT_STYLE",_.TITLE="TITLE",_.TOOLTIP_LEGEND_OFFSET_X="TOOLTIP_LEGEND_OFFSET_X",_.TOOLTIP_LEGEND_OFFSET_Y="TOOLTIP_LEGEND_OFFSET_Y",_.TOOLTIP_LEGEND_TEMPLATE="TOOLTIP_LEGEND_TEMPLATE",_.TOOLTIP_DATA_TEMPLATE="TOOLTIP_DATA_TEMPLATE",_.TOOLTIP_SVG_TEMPLATE="TOOLTIP_SVG_TEMPLATE",_.VERTICAL_ANCHOR_POINT="VERTICAL_ANCHOR_POINT",_.X1="X1",_.X2="X2",_.XAXIS_ID="XAXIS_ID",_.X_COORDINATE_MODE="X_COORDINATE_MODE",_.X_COORD_SHIFT="X_COORD_SHIFT",_.Y1="Y1",_.Y2="Y2",_.YAXIS_ID="YAXIS_ID",_.Y_COORDINATE_MODE="Y_COORDINATE_MODE",_.Y_COORD_SHIFT="Y_COORD_SHIFT",_.PLACEMENT_DIV_ID="PLACEMENT_DIV_ID",_.ROTATION="ROTATION",_.ADORNER_STROKE="ADORNER_STROKE",_.ADORNER_FILL="ADORNER_FILL",_.ADORNER_RADIUS="ADORNER_RADIUS",_.SELECTION_STROKE="SELECTION_STROKE",_.SELECTION_DELTA="SELECTION_DELTA",_.SELECTION_THICKNESS="SELECTION_THICKNESS",_.DRAGPOINTS="DRAGPOINTS",_.MULTILINE_ALIGNMENT="MULTILINE_ALIGNMENT",_.WRAP_TO="WRAP_TO",_.LINE_SPACING="LINE_SPACING",_.SCALE="SCALE",_.OUTLINE="OUTLINE",_.RADIUS="RADIUS",_.INNER_RADIUS="INNER_RADIUS",_.ARC_COORDINATE_MODE="ARC_COORDINATE_MODE",_.VIEW_BOX_SIZE="VIEW_BOX_SIZE",_.SVG_STRING="SVG_STRING",_.ARROW_HEAD_LENGTH="ARROW_HEAD_LENGTH",_.ARROW_HEAD_WIDTH="ARROW_HEAD_WIDTH",_.ARROW_HEAD_DEPTH="ARROW_HEAD_DEPTH",_.ARROW_HEAD_STROKE_THICKNESS="ARROW_HEAD_STROKE_THICKNESS",_.ARROW_HEAD_COLOR="ARROW_HEAD_COLOR",_.ARROW_HEAD_POSITION="ARROW_HEAD_POSITION",_.IS_ARROW_HEAD_RELATIVE="IS_ARROW_HEAD_RELATIVE",_.SURFACE_RENDER_ORDER="SURFACE_RENDER_ORDER",_.RENDER_LAYER="RENDER_LAYER"})(I.PROPERTY||(I.PROPERTY={})),I.ADORNER_GRIP_RADIUS=10,I.DISTANCE_TO_LINE=10})(A.__exports)),A.__exports}exports.__require=N;
|
|
2
2
|
//# sourceMappingURL=petal-toolkit.cjs874.js.map
|